Archive for March, 2010

LHC: some details about the software

March 31, 2010 Leave a comment

Yesterday represented a large milestone for the LHC. Here’re some details on the software.

You can also view LHC’s real time status here and here, the latter being the more interesting from a technology and visualization perspective.

Categories: Astronomy, CEP

Protobuf-Net: Couple of gotchas

March 15, 2010 Leave a comment

Here’re a couple of issues with Protobuf-net that I ran into recently.

  1. C# classes generated with protogen /p:detectMissing flag creates string getters as
    get { return _myStringField ?? ""; }
    This means that string fields that were supposed to be nulls still get sent to the server as an empty string; not an ideal situation.
    The fix is to manually edit the generated class to remove the coalesce from all string getters.
     get { return _myStringField; }
  2. If you try to serialize a class where you do not populate an optional enum with no enum value defined for zero (0), you’ll get an exception “The default enum value is not defined for the optional property”. This happens even though Google spec says that in such cases, the 1st value should be used; although, in my opinion, Protobuf-Net should check whether to serialize the enum at all before attempting to get to the valid enum values.
    For example, this enum will throw the aforementioned exception:
    public enum MyEnum {
       MyEnumValueA = 10,
       MyEnumValueB = 100

    Unfortunately, there’re no workarounds for this problem at the moment except adding a “MyEnumValueUnknown=0” to the enum.

The author, Marc Gravell, is aware of these issues. Here’s hoping he’ll get a chance to fix these problems quickly.

Categories: .net