Thursday, October 30, 2008

BigInteger in .NET Framework 4 - The big WOW

If you have experience with Java, maybe you know that Java supports BigInteger type. This data type supports to store and manipulate big integer numeric. But in .NET, there is no BigInteger type (Actually, as I remember, Microsoft added BigInteger to .NET Framework 3.5 2.0 beta, but then removed it in the final version).

Now, in .NET Framework 4, Microsoft decided to add it back (check out the .NET Framework 4 poster). For me, it's a big WOW. Long time ago I need to develop a library which need to store very big integer values and convert from decimal to binary, to hexa and vice versa. And it's a painful experience. Even I used this class but it doesn't work properly for very very very big integer values.

Nice to see BigInteger now :-)

Monday, October 27, 2008

Enable AHCI Mode after installing Windows Server 2008

Today my friend told me about enabling AHCI on Windows, it can help to improve the performance of IO when it can use the advantage of SATA hard disk drives. The problem is I didn't enable AHCI when I install Windows Server 2008. Is there any way to do it after installing the Windows?

Yes, there is. And here it is:

1. Exit all Windows-based programs.
2. Click Start, type regedit in the Start Search box, and then press ENTER.
3. If you receive the User Account Control dialog box, click Continue.
4. Locate and then click the following registry subkey:
HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Msahci
5. In the right pane, right-click Start in the Name column, and then click Modify.
6. In the Value data box, type 0 (zero), and then click OK.
7. On the File menu, click Exit to close Registry Editor.
8. Restart the PC and change the settings for RAID/AHCI from "Disabled" to "AHCI" (maybe it will different in your PC)

Windows Server 2008 has built-in SATA driver which support AHCI but disable by default. By tweaking registry, you've just enabled it.

Note: You can apply the same process for Windows Vista.

Saturday, October 25, 2008

Changing Sleep mode to Shutdown mode, and vice versa

In Windows Vista, when you click the Power button in Start menu, Windows Vista will go to sleep. But in Windows Server 2008, it will shut down. So how to change the Power button settings to sleep mode shut down the PC in Windows Server 2008?

It's very simple. Just go to Control Panel, Power Options, select (or create) a power plan then change the setting as in the screenshot