Tuesday, September 30, 2008

Micropoll

 I recently discovered MicroPoll through Scott Hanselman's site and liked the format so I thought that I'd try it out with an inline survey on this blog to see how well it works.

 

Here are the results of the poll:

Polls Powered By MicroPoll

Monday, September 29, 2008

Google Chrome Installer Error 1625

Just tried to install Google Chrome on Server 2008 and received the following error from Google Chrome Installer:

Installation failed. Component ChromeGears failed to install. Detailed message: The installer encountered error 1625: The installation is forbidden by system policy. Contact your system administrator.

Solved: Ran the ChromeSetup.exe file as administrator and everything installed okay. Open the containing folder of the setup file and right click install file (ChromeSetup.exe) and select "Run as Administrator."

Friday, September 26, 2008

Hosts file locked (read-only) on Server 2008

I was trying to edit the HOSTS file on Windows Server 2008 with Notepad++ but after editing it wouldn't let me save it with a "Save failed" - "Please check whether if this file is opened in another program" (the ...whether if... is their message not my typo).

Anyhow, didn't turn out to be read-only as I initially thought or another process as suggested (I did try stopping several services to see if that would help) but instead it turned out to be the fact that I hadn't started Notepad++ as administrator.

I don't understand why I need to run Notepad++ as administrator to edit the HOSTS file but aparently I do. I'm sure that it's just a matter of getting used to this new Vista style UAC that I assume is the underpinning of the security model in Server 2008.

To run Notepad++ (or any other program) as an administrator just right click on the application and select "Run As Administrator."

Thursday, September 25, 2008

Double URL Encoding

Sometimes you know the answer but you still want to see it happen to make yourself happy.

Question: If you encode some text and then encode it again is it encoded inside encoded?
Answer: Yes
Question: What happens if you decode it twice as well?
Answer: You get back to the original unecoded text

Here is a snippet of text that demonstrates it using C# in .NET. You need to include the System.Web library.

            string stringWithAmp = "&";
            Console.WriteLine(stringWithAmp); // "&"
            stringWithAmp = HttpUtility.HtmlEncode(stringWithAmp);
            Console.WriteLine(stringWithAmp); // "&"
            stringWithAmp = HttpUtility.HtmlEncode(stringWithAmp);
            Console.WriteLine(stringWithAmp); // "&"
            stringWithAmp = HttpUtility.HtmlDecode(stringWithAmp);
            Console.WriteLine(stringWithAmp); // "&"
            stringWithAmp = HttpUtility.HtmlDecode(stringWithAmp);
            Console.WriteLine(stringWithAmp); // "&"
 

Monday, September 22, 2008

The Second Law of Continuous Integration

From this post on Jeremy Miller's blog:

Jeremy's First Law of Continuous Integration:

If you check in very often and/or first, you can make merge conflicts be someone else's problem.

The Second Law:

If someone did sneak in a check in between two of your check ins then the merge problem will be small because the number of changes you've done will be small if you're checking in frequently. 

The Law of Encouragement:

Point this out to your coworkers to make all changes between check ins as small as possible so that you don't waste half a day on merging.

Reinstall of Vista and Ubuntu Virtual Machines

Over the weekend I was trying to install a few things on my Vista and Ubuntu Linux virtual machines. Both are 64bit VM's runing under Server 2008 x64 with Hyper-V. I ended up in the situation where the Vista machine lost its network connection and then wouldn't power down. It got to the point of almost powering down and then hung. I tried all sorts of things to sovle this problem but was unsuccessful. This state of the VM was also causing Server 2008 to blue screen on about every fifth reboot and when I looked at the log files they always related to the VM. I also tried to start and stop the Linux VM (which had been in a stopped state all this time) and the same thing happened inasmuch as I couldn't power it down.

In the end I uninstalled the Hyper-V role in Server 2008 and deleted the VM machines from the hard disk. Here are my notes about what I learned and the mistakes that I made.

  1. Download and get the ISO ready before creating a virtual machine.
  2. When setting up a VM that does not have Integrated Components select a legacy network adapter.
  3. Uncheck the box that says "start VM when this wizard finished" (or somthing like that).
  4. Once you've created the VM open the settings and check them all. Check that there's a single network adapter and that it's a legacy adapter.
  5. As soon as you've run the install of the operating system and it's completed its initial updates take a snapshot of the VM.
  6. Take regular snapshots of the VM after each operation that you perform.

 

Saturday, September 20, 2008

Hyper-V with Vista x64 and Ubuntu Linux Desktop x64

Notes about setting up Vista x64 as a guest virtual machine on my Windows Server 2008 x64 machine.

The installation ran relatively smoothly. I pointed the Hyper-V wizard at the Vista x64 iso and the installation happened.

The only tricky part was getting the network connection up and running. On Hyper-V, under settings for Vista x64 I had to add a Legacy Network Adapter and set that to my point to my Virtual Network. I also left the MAC address at Dynamic and unchecked the "Enable virtual Lan identification" check box.

When setting up Ubuntu Linux Desktop x64 I had to use the same strategy with setting a Legacy adapter to get it to hook onto the network.

I read somewhere that it's the x64 part of these operating systems that cause you to have to use the legacy adapter. I'm right on the edge of my knowledge at the moment as I've never done any of this before so take what you read with a pinch of salt. I now believe that it's because the Integration Components (IC's) are not available for these OS's.