Archive for February, 2009

ie7 bug – Popup blocker prevents clicking dropdown lists.

Tuesday, February 24th, 2009 | General | 11 Comments

ie7I had a strange experience with IE 7. It was suddenly impossible to click dropdown lists. The popup blocker displayed the toolbar, saying it blocked a popup. The dropdown was from my own code running on localhost, so it was definitely not a popup defined in the event. I am really not sure when this happened. Yesterday I installed the Internet Explorer Collection, which is great for testing GUI in different versions of Internet Explorer. This could cause the strange behaviour, but I'm really not sure. The collection includes IE 8 Beta, and I have seen others with IE 8 Beta having this problem.

I soon found out other users having this problem and most referred to this page for a solution. I tried the suggestion on adding localhost to the "trusted sites" and setting security level to medium-low, but that didn't solve my problem. I then uninstalled the Internet Explorer Collection without any luck. I also tried resetting Internet Explorer; Tools->Internet options->Advanced->Reset… (button). But again, no luck. Also restarted windows just to be sure.

Only left solution was to remove or reinstall IE7. Removing will downgrade to IE 6, which is really not what I want. So I downloaded the IE 7 installer from Microsoft and installed IE7 again (no option in installer to "reinstall"). Restarting windows, and everything was working fine again. Since that was not one of the options in the guide I found (link above), I though it was worth mention it here.

Ok, back to work…

Tags: ,

Use regular expressions in Visual Studio to clean up code

Friday, February 20th, 2009 | .NET | No Comments

This is a reminder to myself.

Knut, remember that Regular Expressions are very handy to clean up a lot of messy code.

Here is an example:
The following function call results in a code analysis warning:

DBHelper.SetPropertyFromDB(m_City, dr("CITY"))

It's a helper function that returns the typed value from a DBValue. Not really useful these days with NHibernate or Typed Datasets, but it's code from an old application. Here is the signature of the code:

Shared Sub SetPropertyFromDB(ByRef pProperty As Object, ByVal value As Object)

The warning reported is:

"Warning: Implicit conversion from 'Object' to 'String' in copying the value of 'ByRef' parameter 'pProperty' back to the matching argument."

To fix this, I created a new method that returns the correct typed value instead of returning the referenced parameter and marked the old method "Obsolete":

Public Shared Function GetDBValue(ByVal pProperty As Object, ByVal dbValue As Object) As Object

Now, I had to rewrite all the calls to the function (several hundred calls). This included returning the typed value into the same variable as the first parameter in the function call, like this:

m_City = DBHelper.GetDBValue(m_City, dr("CITY"))

This is easily achieved by using Regular Expressions in the "Find and Replace" dialog in Visual Studio:

Find What:

DBHelper.SetPropertyFromDB\({.*},

(note: the \ escapes the ( and the expression group is marked by a {})

Replace with:

\1 = DBHelper.GetDBValue(\1,

(note: the \1 will represent the expression group)

Pretty simple, and very powerful :-)

Tags: ,

Extend the GridView

Thursday, February 19th, 2009 | .NET | 1 Comment

The default GridView class has by default a lot of great features. However, some important features are missing. One of the most important is the ability to display the grid even if it is empty.
Here is a great class extending the GridView with some additional features.

http://forums.asp.net/p/1012442/2951765.aspx#2951765

Tags: ,

XBOX – be quiet!

Tuesday, February 3rd, 2009 | General | 2 Comments

I have 3 Xbox 360's at home. Seems a bit too much, but they have really come down in price, and I use 2 of them as extenders for my Vista Media Center. The biggest problem with the Xbox is the noise it produce. The Media Center box is virtually silent using a mCubed hfx classic, so I want my extenders to be as quiet as possible. I could of course buy some Linksys DMA 2100 extenders, but they do not support VGA out, which is the only input option on my LCD monitor.

I'm using one of the Xboxes in the kitchen, connected to a 15" LCD monitor. The LCD is mounted above the fridge and serves as a kitchen TV. The Xbox is hidden behind a shelf placed above the refrigerator. This is almost in ear height when standing up and makes the noise come out pretty loud.

I read some reviews on the Lian Li PC XB01 case and decided to give it a try. Opening the Xbox will void the warranty, so I decided to modify the oldest one, as it no longer has a warranty.

The Lian Li case is pretty large as you can see in the video below.

This is mainly because of the large 120mm fan in the back. But it also gives some opportunities regarding further modding and better controlling the noise. You can even put a water cooling system in there. There are dedicated holes in the case for the water tubes.

It was quite tricky to dismount the Xbox, and you need a set of Torx tools (6, 8 and 10) to be able to do the work. Mounting the mainboard and DVD drive in the Lian case was straight forward.

The result

As this mod is only used as a Media Center Extender and not used for playing games at all, I didn't need the Xbox harddrive. The only noise coming from the case will be the fan. The standard fan which comes with the case is not very silent, but far better than the Xbox fans. I guess I will order a Papst fan to replace the standard fan.

Standard Xbox 360 Arcade (Falcon chipset)

Xbox 360 inside Lian Li PC XB01using oem fan (Zephyr chipset)

I also found a more extreme cooling solution for even more silent mods. Check out this site, which has an awesome mod: http://www.silentxbox.com/xbox_eng.php

Tags:

Search

Knut Hamang

This is the official site for Knut Hamang. I am a professional technical consultant specialized in Microsoft and .NET technologies and platforms. I work as an independent consultant in Norway and have more than 10 years of professional experience. To get in contact with me, please send me an email or check my public profile on View Knut Hamang's profile on LinkedIn