Monday, November 26, 2007

problem of the day

A colleague was trying to write a calculation tool on IIS logs. I recommended him to try the text file driver from Microsoft Jet. He couldn't get it going. The error is:

Cannot Update. Database or object is read-only
Error code is -2147217911 or 0x80040E09

Turns out the file has an extension of ".log". Once I changed it to ".txt" everything works. Can't find an explanation though.

Wednesday, November 21, 2007


We got caught in the production system yesterday.

Turns out the problem is that we use System.IO.Path.GetTempFileName() to, well, get a temporary file name to use in a directory. This method, if you read the documentation (which I did not), states that

Creates (emphasis mine) a uniquely named, zero-byte temporary file on disk and returns the full path of that file.

So there is a side-effect by calling this method. But that's not all. In the remarks it said:

The GetTempFileName method will raise an IOException if it is used to create more than 65535 files.

So the production system failed because this method has been called more than 65535 times.

Lessons learned:
(1) RTFM!
(2) the method should be renamed CreateTempFile.

Tuesday, November 13, 2007

indoor trainer

I have always resisted the idea of riding a trainer in the house. It never appeared to be interesting nor effective, until this year.

It started out having a cold winter this January when I have to stop commuting for a few weeks.
In the fall when soccer season starts it is obvious that I will have less time riding in daylight.
Then there was some discount trainer emails flying around.

So being the cheap bastard that I am, instead of buying a new one, I sourced an old noisy trainer for $20 from a friend.

I've started riding on the trainer and it feels different. The 12s or zone 2s seem to be harder on the trainer than on the road. I've tried a small amount of 14s just to see how it feels and it seems harder as well.

On the entertainment front I found some old Japanese animation series that I normally would not watch sitting down. It works and time flys by a bit better than a regular Hollywood movie.

I probably need to set up a fan as I am sweating like a pig.

The lesson learned is that it is not boring when you don't want it to be boring.
Listed on BlogShares