Tuesday, December 22, 2009

Embedding date and time into a file in windows - "But it worked last night"

I'm patching a tiny project at work with duct tape until we can get an enterprise solution. A small batch job runs on the windows scheduler doing something like this:

MyCommand.exe  --output=Saturday1201amUS_%date:~10,4%-%date:~4,2%-%date:~7,2%-%time:~0,2%-%time:~3,2%-%time:~6,5%.txt


I ran it yesterday afternoon and it worked great. It created a file named
Saturday1201amUS_2009-12-21-15-46-00.21.log. This morning I did another test with my client and it failed miserably after creating a file named 'Saturday1201amUS_2009-12-22-'. A little investigation turned up that windows does not prepend a zero in front of the hours before noon so my executable file was getting a space in front of 9 oclock:

MyCommand.exe  --output=Saturday1201amUS_Saturday1201amUS_2009-12-22- 9-47-20.31.log

It worked great after putting quotes around the file name.
MyCommand.exe  --output="Saturday1201amUS_%date:~10,4%-%date:~4,2%-%date:~7,2%-%time:~0,2%-%time:~3,2%-%time:~6,5%.txt"

Monday, December 21, 2009

One Stock Trading Company Claims Compute Power of Lawrence Livermore

Interesting article from Technology Review about the computing power of the high-speed stock traders:
The explosion in high-speed automated trading has engendered a massive buildup in technology; Renaissance Technologies, a hedge fund based in East Setauket, NY, boasts that its computing power is equal to that of the Lawrence Livermore National Laboratory.

Wednesday, December 02, 2009

NHibernate Intellisense for Visual Studio 2008

From the NHibernate distribution, I renamed nhibernate-mapping.xsd to nhibernate-mapping-2.2.xsd and nhibernate-configuration.xsd to nhibernate-configuration-2.2.xsd. Then I copied those two files to C:\Program Files\Microsoft Visual Studio 9.0\Xml\Schemas and immediately intellisense started working for me in Visual Studio 2008.