Friday, September 23, 2011

Ubuntu, KVM and Resolution

Ubuntu is a nice alternative to Windows.  I have tried few distros like Redhat, SuSe, Mandrive, and Ubuntu is the distro I finally settle mainly because of the APT package system.  I do like to use Linux but I don't like to "fix" Linux.  Flexibility and customizability of Linux to me is a double edged sword, it is great for enthusiasts, but terrible to people just want to use.  Ubuntu is closest I can found (mind you, there is always something better in Linux world)

However, there is one essential thing I really hope can get fixed that is setting the resolution of a monitor.  Yes, there are GUI tools for it but they all seem to work only if the auto detection work.  For instance, if the monitor is connected through KVM, you are out of luck.  You are most likely need to set it manually, and doing so it isn't not nice at all.

For instance, I have recently moved to a newer version of Ubuntu which uses a newer implementation of XOrg.  Unfortunately, the changes made in the new XOrg breaks the driver of my old AGP GeForce graphics card.  I don't really bother too much about all these 3D thing, but one nice feature of a property GeForce driver is its ability to force a resolution and a refresh rate graphically (okay I am still using a CRT monitor).  Without the nVidia driver, I need to do things manually.  To make things even more complicate, the old xorg.conf has been demoted in favor of something else (though you can still use it)

Anyway, cutting a long story short, I had tried a few settings combinations and with my limit knowledge and impatience, I gave up after ending up many times in recovery mode (so I can change my xorg.conf settings)  I finally gave up on my GeForce 400MX card and replaced it with a Radeon 9600 card.  And this time, things is a bit easier.  I can use the xrandr to set the resolution and refresh rate using the instructions from this site:

http://www.ubuntugeek.com/how-change-display-resolution-settings-using-xrandr.html

Except, I put all these commands in a script file, and call this script file within the /etc/gdm/Init/Default

As I said at the beginning, I would prefer this can be done graphically so average users like myself can do simply basic things such as setting resolutions and refresh rate easily without the need of editing setting files with text editors.

Wednesday, September 21, 2011

I was testing my MVC2 application on a new IIS server setup by my colleague.  However, when I tried to run it, I got error said it can't locate the file.  Then I poked around the server to see if there were any setting mistakes.  When I hit the .NET Compilation option on the Site settings, I got an error.  After a bit of research on Google, it seems this problem was caused by the order of installation.

It seems if IIS server was installed after the .NET installation, the IIS will not pick up the necessary changes made by .NET Framework installer to run the MVC2.  To fix it, you can run the aspnet_regiis tool within the .NET folder (located in %windir%\Microsoft.NET\Framework\v4.0.30319) with the iru option as suggested in Scott Hanselman's blog http://www.hanselman.com/blog/ASPNET4BreakingChangesAndStuffToBeAwareOf.aspx.

In Scott's blog, he suggests to enter the command as

aspnet_regiis -iru

However, on my Windows Server 2008 (NOT R2), I found the -iru didn't work, but /iru works, e.g. aspnet_regiis /iru.  Therefore, I would suggest you to try using /iru if -iru did not work for you.

Further references can be found at: http://msdn.microsoft.com/en-us/library/k6h9cz8h%28v=VS.100%29.aspx

Tuesday, September 13, 2011

Access ... thanks Microsoft for another problem!

Today I have this funny problem which Access and OleDB gave me two different results for the same view.  After hours of puzzling, finally found out it is because of the wild card used in the LIKE clause.

The story as follow, I have a view in Access similar to the below

select * where code like '*fun*'

This works fine within Access, i.e. only result contains "fun" returned.  However, when I accessing this view within VisualStudio via OleDB, the conditional clause was ignored.  Since I am accessing the same view within the same Access database, it really puzzled me why the different results returned, especialy there was no errors returned.

Initially I thought it was because of caching, so I restarted my machine.  Run the query within Visual Studio after restart, same problem.

Then I removed the connection within Visual Studio and recreate it as I thought it may caused by wrong settings.  Again, same problem.

Finally, I  replaced the * with % as I would write my LIKE in standard SQL. Bingo, everything works as intended.

Thanks Microsoft.  Can you not try to be special and screw things up?!