Writing a calculator in C# using SableCC

Writing a calculator is a simple task - just add nine buttons labeled 1-9 and add a plus and minus button and we're almost good to go. In this entry I'm going to write a calculator called SimpleCalc that does not have a GUI, instead it'll take in an arbitrary expression and calculate the results of it. The input I'll use as my immediate goal is the following:

Read the complete 26532 bytes...

Digg it | Kick it | Dzone it | Reddit


IIS7 w3wp process hung on shutdown

A single server has started to sometime leave zombie w3wp.exe processes when trying to recycle. A new process is spawned properly and everything seems to work, except the old processes are still present and take up memory. Task manager reports there's only a single thread left, far from the active ones that have between 40 and 70 threads usually.

Read the complete 6177 bytes...

Digg it | Kick it | Dzone it | Reddit


IIS request filtering woes

I recently put a number of load balanced websites in production by using the newly released IIS7 Application Request Routing v2 Beta extension. Everything seemed to run perfectly both performance and functionality wise. There was a slight problem however.

Read the complete 3424 bytes...

Digg it | Kick it | Dzone it | Reddit


Combining paths with multiple parts

Whenever you concatenate multiple strings into a path, you really ought to be using the System.IO.Path class's Combine method. At times you may be concatenating a number of smaller parts of a path instead of just the two that the Path.Combine() method takes. Nested Path.Combine calls quickly become difficult to read and error prone:

Read the complete 4668 bytes...

Digg it | Kick it | Dzone it | Reddit


The cost of latent logging code

Logging is an integral part of most applications, whether it's for logging performance metrics or causality data. Avoiding performance hits due to logging can be tricky though as we don't want to spend CPU cycles on the logging infrastructure when logging is disabled, while still keeping the full logging ability when required.

Read the complete 7750 bytes...

Digg it | Kick it | Dzone it | Reddit