December 2005 - Posts

Today, Saint Nicholas brought Windows Server 2003 R2. More information on http://www.microsoft.com/windowsserver2003. For the official press bulletin, take a look at http://www.microsoft.com/presspass/press/2005/dec05/12-06WS03R2RTMPR.mspx. Personally, I do like the R2 philosophy, having more regular minor updates of product releases. Basically, R2 versions take the previous stable version of the technology (in this case Windows Server 2003 SP1 + latest updates) and put new things (some of those being available already as separate downloads) on top of it (in this case things such as ADFS, ADAM, updates to DFS, better File and Print Management, .NET Framework 2.0, Windows SharePoint Services 2.0, CLFS, etc). In the end, R2 releases have two turn ons:

  • existing users can deploy the R2 release with much confidence because the core of the system doesn't change (NT 5.2 stays NT 5.2), except for the Service Pack (which should be deployed by most customers already)
  • customers that haven't move to Windows Server 2003 already have much more reasons to migrate now because of the additional features that become available in R2

Let's hope at some point in time the R2 wave reaches beyond the Windows Server 2003 and Virtual Server 2005 products. Product release intervals such as SQL Server 2000 to SQL Server 2005 are way too long for a big set of customers.

Del.icio.us | Digg It | Technorati | Blinklist | Furl | reddit | DotNetKicks

What a brainteaser this was. The last couple of days/hours I was following this thread on MSDN about weird behavior of int.Parse:

int.Parse("0") //throws FormatException

Basically, the problem was the sPositiveSign value under HKEY_CURRENT_USER\Control Panel\International being set to 0, which means the positive sign is '0'. Thus, while parsing the "positive sign 0" is being cut off and then the rest of the string ("") is parsed as a number, which doesn't work of course. This also explains why int.Parse("00") wasn't a problem. Although you can't set the positive sign to '0' through the Control Panel, it's still possible to do it through the registry, causing problems. No idea how the computer of the user in the post ended up with this wrong setting...

Del.icio.us | Digg It | Technorati | Blinklist | Furl | reddit | DotNetKicks

Just a bit more of C# 2.0 language evangelism. Everyone who's familiar with C-style programming languages knows the use of the "default" keyword in the context of a switch statement. However, C# 2.0 introduces the "default" keyword in another context as well, as shown below:

class Def
{
   public static void Main()
   {
      System.Console.WriteLine(Bool());
      System.Console.WriteLine(Int());
      System.Console.WriteLine(IntA());
   }

   public static bool Bool()
   {
      return default(bool);
   }

   public static int Int()
   {
      return default(int);
   }

   public static int? IntA()
   {
      return default(int?);
   }
}

In fact, this is nothing more than a wrapper around the default values of various types, but it can be convenient in some scenarios. Think of automatic code generation for a while, isn't that trivial using this? Or even better, in the context of generic classes, what this feature was originally intended for (e.g. default(T) where T is a type param of a generic class). I hope everyone is familiar with the int? syntax of C# 2.0 as well. This language feature is called nullable types and allows "value types" to have a null value by wrapping those in an instance of (the generic class) System.Nullable.

Del.icio.us | Digg It | Technorati | Blinklist | Furl | reddit | DotNetKicks

More Posts