The Wiert Corner – irregular stream of stuff

Jeroen W. Pluimers on .NET, C#, Delphi, databases, and personal interests

  • My badges

  • Twitter Updates

  • My Flickr Stream

  • Pages

  • All categories

  • Enter your email address to subscribe to this blog and receive notifications of new posts by email.

    Join 1,854 other subscribers

Chrome “Open frame in new tab” replacement: Open Frame/This Frame extensions

Posted by jpluimers on 2011/05/16

New versions sometimes means the loss of features.

Starting with Google Chrome 10, the “Open frame in new tab” option in the context menu was removed (“Reload frame”, “View frame info” and “View frame source” are still there though).

The removal has been reported as a bug by Michael Schramm on December 10, 2010, but no action from the Chromium nor Chrome teams yet.

But shortly after the removal, two Chrome extensions appeared:

Though they both work very well, I like the second one more because it has slightly more options (it is based on the first one).

Note that when you install these extensions, you have to reload a tab when you want to use the new functionality offered by the extension on that tab.

–jeroen

via: Open Frame – Google Chrome extension gallery.

Posted in Chrome, Power User, Web Browsers | Leave a Comment »

Disable Windows 7 DLNA exposure

Posted by jpluimers on 2011/05/13

It looks like when you install Windows Media Player in Window 7, it will expose your media library for DLNA access by default for any user that chooses “quick” settings.

This even when you have not turned on media streaming, or not enabled the “Automatically allow devices to play my media” (this link has some screenshots on those settings).

I know few users who go the whole nine yards around those “quick” settings, so pretty much any Windows 7 user has their media library exposed as DLNA in your Home or Work networks (DLNA seems disabled on Public networks by default).

This is both a pollution of your DLNA space (for instance making it more difficult from your digital TV to to select the correct DLNA source), and an exposure. Any malware in your network might so some discovery (and yes, truckloads of PC’s in Work or Home networks have such malware running).

Though searching for “Winodws 7” “Disable DLNA” returns few good results, the actual trick is easy:

  1. On the start menu, type “Manage advanced sharing settings”
  2. Click the arrow next to “Home or work”
  3. Under “Media Streaming”, click “Choose media streaming options”
  4. Click on the “Block all” button
  5. Click the “OK” button
  6. Close the “Advanced sharing settings” window

–jeroen

via: Media Streaming with Windows 7 – Engineering Windows 7 – Site Home – MSDN Blogs.

Posted in Power User, Windows 7 | 4 Comments »

How to Get Paths and URL fragments from the HttpRequest object

Posted by jpluimers on 2011/05/12

There are many ASP.NET HttpRequest properties.

Sadly, the MSDN documentation does not have many examples telling you which property maps to which portion of the URL.

So it usually is a big fight extracting the sub portions you need.

Luckily, Steve Lautenschlager has the How Do I Get Paths and URL fragments from the HttpRequest object? article online.
The article has a table with the properties and portions of the URL that end up in those properties.

Really neat, as it saves a lot of time.

–jeroen

Posted in .NET, ASP.NET, Development, Software Development | Leave a Comment »

Martin Kulov’s Blog: Any CPU vs. x86 vs. x64

Posted by jpluimers on 2011/05/11

Thanks to Martin Kulov’s Blog: Any CPU vs. x86 vs. x64 I got a reference to a great article explaining this in more detail.

The obvious points are 1., 2. and 3., but it is 4..7 that makes the article really worth reading.

–jeroen

PS: a few more relevant links

http://stackoverflow.com/questions/247098/x64-net-compilation-process-explorer-oddity

http://stackoverflow.com/questions/311158/why-doesnt-the-corflags-utility-warn-when-marking-x64-assemblies-as-x86

Posted in .NET, ASP.NET, C#, Development, Software Development | Leave a Comment »

FM USB Library

Posted by jpluimers on 2011/05/10

The FM USB Library is on my research list.

–jeroen

PS: a few raw links that might fit in:

http://www.silabs.com/usbradiohttp://www.silabs.com/products/mcu/Pages/USBFMRadioRD.aspx

http://code.google.com/p/silabsradiodll/

http://parts.digikey.nl/1/1/543483-usb-fm-radio-stick-usbfmradio-rd.html

http://www.mouser.com/ProductDetail/Silicon-Laboratories/USBFMRADIO-RD/?qs=42TdBvIR%2fY7X5XVJkFBvBg%3d%3d

http://nl.farnell.com/jsp/search/productdetail.jsp?sku=1186925

http://www.newark.com/jsp/Non-Stocked/All+Non-Stocked+Products/SILICON+LABORATORIES/USBFMRADIO-RD/displayProduct.jsp?sku=98K2140

http://www.mp3car.com/hardware-development/64550-usb-fm-rds-solution-with-sofware-40.html

http://www.mp3car.com/hardware-development/64550-usb-fm-rds-solution-with-sofware-41.html

http://usb.brando.com/prod_detail.php?prod_id=00136

http://usb.brando.com/usb-radio-ii_p1785c35d15.html

http://www.whitebream.com/p811.shtml?id=p811

http://khason.net/blog/read-and-use-fm-radio-or-any-other-usb-hid-device-from-c/

http://www.dealextreme.com/p/usb-digital-radio-receiver-dongle-fm-76-108mhz-1929

http://www.silabs.com/products/audiovideo/fmreceivers/Pages/default.aspx

http://www.google.com/search?sourceid=chrome&ie=UTF-8&q=usb+fm+rds+site%3Amouser.com

http://www.mp3car.com/hardware-development/69493-hqct-module-new-thread-following-hu-rds-rdbs.html

http://www.mp3car.com/hardware-development/64550-usb-fm-rds-solution-with-sofware-2.html

http://www.cartft.com/catalog/il/1139

http://www.digital-car.co.uk/forum/showthread.php?12194-New-CarTFT-FM-(Automotive-USB-FM-RDS-tuner)

http://www.cartft.com/catalog/il/1017

http://btwincap.sourceforge.net/download.html

http://btwincap.sourceforge.net/supportedcards.html

http://www.alibri.it/RRMobile/Silab%20USB%20Radio.htm

http://www.mo-co-so.com/Car-TFT-FM-Tuner-with-RDS-p/mcs-tft-rad.htm

http://support.microsoft.com/default.aspx?scid=kb;EN-US;Q311272

Posted in .NET, C#, Delphi, Development, Prism, Software Development | Leave a Comment »

Removing the VMWare Server SSL Certificate Trust Warning – via: IIS Hacks | Server and System Administration

Posted by jpluimers on 2011/05/09

When you install VMware Server 2.0 on Windows Server 2008, Internet Explorer will give you a warning that it cannot load the local VMware Server console web-site at https://servername:8333.

The reason is that the security certificate is self-signed by the local machine, not by a trusted CA.

Internet Explorer does not allow you to add that CA, but you can from within Windows Explorer.

The Removing the VMWare Server SSL Certificate Trust Warning article explains how.

Note that on x64 Windows Server 2008 systems, the VMware Server certificate by default is in the C:\Program Files (x86)\VMware\VMware Server\SSL directory.

Finally, you will need to add https://servername:8333 to the trusted sites in Internet Explorer.

–jeroen

via: Removing the VMWare Server SSL Certificate Trust Warning – IIS Hacks Server and System Administration

Posted in Power User, VMware | 2 Comments »

VMware Workstation and multi-core hosts/guests

Posted by jpluimers on 2011/05/06

With the gaining popularity of Desktop systems with multi-core processors, it becomes interesting to use multi-core CPU guests in VMware workstation.

Right now, Intel Core i3 through i7 processors can provide from 2 to 6 cores, some cores even supporting hyper-threading and providing 12 virtual cores using a single physical processor.

Does it make sense now to run all your VM guests with multiple virtual cores / vCPUs?

On the VMware forums and knowledge base, there are many threads and articles with information on vCPUs.

The consensus is that VMware workstation can take longer to schedule a synchronized set of cores for a VM than VMware ESX(i) has, and the host OS needs CPU cycles too.

The reason is that VMware workstation needs the underlying host Operating System for that, whereas ESX(i) has it’s own kernel.

In the VMware workstation 7 beta, under some circumstances, adding more vCPUs actuall made the guest run slower (this has been fixed).

You need to be careful when vCPUs in the guest compete with pCPUs in the host; it can lead to frequent freezes in the guest.
The rule of the thumb is that you should not use more than 50% of the host pCPU cores as guest vCPUs.

So the best is to start with one (1) vCPU, and only crank it up when needed.
Take into account however that for Windows XP you will need to  change the HAL to support multiple CPUs, which can be a pain.

In some cases it can pay off big to increase the number of vCPUs, especially when they are actually used.

Another thing you need to be aware of is that modern CPUs van vary their clock speed, now even depending on the number of cores used. In the past this had influences on timekeeping, but not so any more with modern Core i# processors.

Finally, with the increase of hard-disk space, people use snapshots more often. This can dramatically decrease the performance, as the number of open files per VM increases.

I hope this helps you choosing the number of vCPUs in your guest.

–jeroen

Note: Both VMware ESXi and VMware Workstation 7.1+ can even support vCPU with multiple cores to help cope with guest OS CPU licensing limitations: set the cpuid.coresPerSocket property in your vmx for that.

Posted in Power User, VMware | 1 Comment »

Don’t sleep when you use your Entity Framework model from a separate assembly

Posted by jpluimers on 2011/05/05

The Entity Framework needs you to have a connection string in your App.Config.

It is good practice having your Entity Framework model in a separate assembly.

When using it in your main app, be aware that the connection string that belongs to your model needs to be in the App.config of your main app.

If not, you get an exception like this:

System.ArgumentException was unhandled
Message=The specified named connection is either not found in the configuration, not intended to be used with the EntityClient provider, or not valid.
Source=System.Data.Entity
StackTrace:
at System.Data.EntityClient.EntityConnection.ChangeConnectionString(String newConnectionString)
at System.Data.EntityClient.EntityConnection..ctor(String connectionString)
at System.Data.Objects.ObjectContext.CreateEntityConnection(String connectionString)
at System.Data.Objects.ObjectContext..ctor(String connectionString, String defaultContainerName)

The clue is the contents of the defaultContainerName parameter: you will see that in the App.config of your Entity Framework assembly.

Copy that over to the App.config of your main assembly, then make sure it points to your right database (if you use OTAP), then go :-)

Your App.config then looks like this:

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <connectionStrings>
    <add name="MyEntities" connectionString="metadata=res://*/My_EntityModel.csdl|res://*/My_EntityModel.ssdl|res://*/My_EntityModel.msl;provider=System.Data.SqlClient;provider connection string=&quot;data source=my-sql-server;initial catalog=my-database;persist security info=True;user id=my-user;password=my-password;multipleactiveresultsets=True;App=EntityFramework&quot;" providerName="System.Data.EntityClient" />
  </connectionStrings>
</configuration>

–jeroen

Posted in .NET, C#, Database Development, Development, EF Entity Framework, Software Development, SQL Server | Leave a Comment »

SmackFu: Shoutcast Metadata Protocol

Posted by jpluimers on 2011/05/04

The SmackFu: Shoutcast Metadata Protocol page describes how the Icecast and Shoutcast meta-data (like song title) are being sent inside their streams.

Notes:

  • The above only explains the song meta data (artist-title); you cannot update the Stream Title without performing a reconnect, as they are in the stream meta data; this post explains why.
  • The stream headers are explained here, but they don’t contain the song title!
  • Icecast uses the dash “-” as separator between artist and title of the song, so if an Artist contains a dash, you are out of luck, as this thread shows.

–jeroen

Posted in .NET, BASS, Development, Power User, Software Development | Leave a Comment »

DealExtreme uses ASP.NET

Posted by jpluimers on 2011/05/03

It is always fun to see error messages on web-sites; they reveal a lot about the technology they use.

For instance, DealExtreme – a very popular site to order electronics and gadgets from the far east – uses ASP.NET.

They have verbose logging enabled, which even includes a warning to turn it off in production sits, as per this comment in the page source:

This error page might contain sensitive information because ASP.NET is configured to show verbose error messages using <customErrors mode=”Off”/>. Consider using <customErrors mode=”On”/> or <customErrors mode=”RemoteOnly”/> in production environments.

This is the full text, indicating they use .NET 2.0 and SQL Server with connection pooling (which is a good thing), and the BLToolkit extensions, Callbacks, a separation of Business Logic and Data Abstraction (BLL, DAL/DAO) probably using Spring.net and Data Binding by calling BindData() in stead of DataBind().

Server Error in ‘/’ Application.


A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: Named Pipes Provider, error: 40 – Could not open a connection to SQL Server)

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Data.SqlClient.SqlException: A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: Named Pipes Provider, error: 40 – Could not open a connection to SQL Server)

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:

[SqlException (0x80131904): A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)]
   System.Data.ProviderBase.DbConnectionPool.GetConnection(DbConnection owningObject) +578
   System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection) +88
   System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory) +6265031
   System.Data.SqlClient.SqlConnection.Open() +258
   BLToolkit.Data.DbManager.ExecuteOperation(OperationType operationType, Action operation) +64
[DataException: A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)]
   BLToolkit.Data.DbManager.OnOperationException(OperationType op, DataException ex) +176
   BLToolkit.Data.DbManager.ExecuteOperation(OperationType operationType, Action operation) +135
   BLToolkit.Data.DbManager.OpenConnection() +91
   BLToolkit.Data.DbManager.get_Connection() +42
   BLToolkit.Data.DbManager.OnInitCommand(IDbCommand command) +31
   BLToolkit.Data.DbManager.get_SelectCommand() +28
   BLToolkit.Data.DbManager.GetCommand(CommandAction commandAction, CommandType commandType, String sql) +18
   BLToolkit.Data.DbManager.PrepareCommand(CommandAction commandAction, CommandType commandType, String commandText, IDbDataParameter[] commandParameters) +91
   BLToolkit.Data.DbManager.SetCommand(CommandAction commandAction, CommandType commandType, String commandText, IDbDataParameter[] commandParameters) +51
   BLToolkit.Data.DbManager.SetCommand(String commandText, IDbDataParameter[] commandParameters) +25
   DealExtreme.Mall.Common.DAL.DAO.BLToolkitExtension.CategoryAccessor.GetAll() +168
   DealExtreme.Mall.Common.BLL.CategoryBL.CategoryLogic.GetAllCategory() +53
   DealExtreme.Mall.Common.Caching.ProductCaching.CategoryCache.GetAllCategories() +9
   DealExtreme.Mall.Common.Caching.ProductCaching.BLToolkitExtension.CategoryCache.GetAllCategories() +433
   DealExtreme.Mall.Search.BLL.SearchLogic.GetSearchedCategory(String request) +255
   DealExtreme.Mall.Search.Web.Search.BindData() +416
   DealExtreme.Mall.Search.Web.Search.Page_Load(Object sender, EventArgs e) +16
   System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +25
   System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +42
   System.Web.UI.Control.OnLoad(EventArgs e) +132
   System.Web.UI.Control.LoadRecursive() +66
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2428


[SqlException]: A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)
at System.Data.ProviderBase.DbConnectionPool.GetConnection(DbConnection owningObject)
at System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection)
at System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory)
at System.Data.SqlClient.SqlConnection.Open()
at BLToolkit.Data.DbManager.ExecuteOperation(OperationType operationType, Action operation)
[DataException]: A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)
at BLToolkit.Data.DbManager.OnOperationException(OperationType op, DataException ex)
at BLToolkit.Data.DbManager.ExecuteOperation(OperationType operationType, Action operation)
at BLToolkit.Data.DbManager.OpenConnection()
at BLToolkit.Data.DbManager.get_Connection()
at BLToolkit.Data.DbManager.OnInitCommand(IDbCommand command)
at BLToolkit.Data.DbManager.get_SelectCommand()
at BLToolkit.Data.DbManager.GetCommand(CommandAction commandAction, CommandType commandType, String sql)
at BLToolkit.Data.DbManager.PrepareCommand(CommandAction commandAction, CommandType commandType, String commandText, IDbDataParameter[] commandParameters)
at BLToolkit.Data.DbManager.SetCommand(CommandAction commandAction, CommandType commandType, String commandText, IDbDataParameter[] commandParameters)
at BLToolkit.Data.DbManager.SetCommand(String commandText, IDbDataParameter[] commandParameters)
at DealExtreme.Mall.Common.DAL.DAO.BLToolkitExtension.CategoryAccessor.GetAll()
at DealExtreme.Mall.Common.BLL.CategoryBL.CategoryLogic.GetAllCategory()
at DealExtreme.Mall.Common.Caching.ProductCaching.CategoryCache.GetAllCategories()
at DealExtreme.Mall.Common.Caching.ProductCaching.BLToolkitExtension.CategoryCache.GetAllCategories()
at DealExtreme.Mall.Search.BLL.SearchLogic.GetSearchedCategory(String request)
at DealExtreme.Mall.Search.Web.Search.BindData()
at DealExtreme.Mall.Search.Web.Search.Page_Load(Object sender, EventArgs e)
at System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e)
at System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e)
at System.Web.UI.Control.OnLoad(EventArgs e)
at System.Web.UI.Control.LoadRecursive()
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
[HttpUnhandledException]: Exception of type 'System.Web.HttpUnhandledException' was thrown.
at System.Web.UI.Page.HandleError(Exception e)
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
at System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
at System.Web.UI.Page.ProcessRequest()
at System.Web.UI.Page.ProcessRequest(HttpContext context)
at ASP.search_aspx.ProcessRequest(HttpContext context)
at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)


Version Information: Microsoft .NET Framework Version:2.0.50727.4952; ASP.NET Version:2.0.50727.4955

Posted in .NET, ASP.NET, C#, Development, Software Development | Leave a Comment »