TechTalk on Scalability & Availability using NLB and IIS ARR

As promised during my TechTalk today at Microsoft Denmark, here are the links to all slides and demo code. Unfortunately you'll not be able to download the VPC's as those total around 30GB.

Read the complete 533 bytes...

Digg it | Kick it | Dzone it | Reddit


Fixing Flash bugs and intercepting IIS Application Request Routing cookies

What does Flash, upload, cookies, IIS load balancing and cookies have to do with each others? More than I'd like :(

Read the complete 9495 bytes...

Digg it | Kick it | Dzone it | Reddit


Reading width & height of Flash file

Obtaining the movie height & weidth of a Flash file is an easy task using the swfdump tool that comes as part of the swftools package. Here's an example of how to invoke swfdump from C# and read out the height & width of a given Flash file.

Read the complete 2321 bytes...

Digg it | Kick it | Dzone it | Reddit


Defending against the improbable

As little children we've all been taught that it's better to program defensively than relying on exceptions being thrown. However, sometimes it's preferably to just hope for the best and catch exceptions if they happen.

Read the complete 6088 bytes...

Digg it | Kick it | Dzone it | Reddit


Working with identity column seed & increment values

All of the following samples are based on the following table:

Read the complete 5174 bytes...

Digg it | Kick it | Dzone it | Reddit


Solving access denied errors using Process Monitor

Access denied errors are not uncommon when deploying new websites / features that interact with the filesystem. While it might work in local testing, it suddenly doesn't anymore when deployed. Using Process Monitor I'll show how to easily debug these issues.

Read the complete 4425 bytes...

Digg it | Kick it | Dzone it | Reddit


How to do URL rewriting on IIS 7 properly

One of my earlier blog posts, and the all time most popular one, was about how to make URL rewriting on IIS 7 work like IIS 6. While my method did provide a means to the goal, it's humiliatingly far from what I should've done. Since the old post is still the most visited post on my blog I feel obligated to write a followup on how to do proper url rewriting in IIS 7.

Read the complete 6157 bytes...

Digg it | Kick it | Dzone it | Reddit


Simple file synchronization using robocopy

On numerous occations I've had a need for synchronizing directories of files & subdirectories. I've used it for synchronizing work files from my stationary PC to my laptop in the pre-always-on era (today I use SVN for almost all files that needs to be in synch). Recently I needed to implement a very KISS backup solution that simply synchronized two directories once a week for offsite storing of the backup data.

Read the complete 4802 bytes...

Digg it | Kick it | Dzone it | Reddit


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


Making the ASP.NET State Service work across network

Once you start distributing your ASP.NET website across multiple webservers, you're going to need a way to share session state. That is, unless your app is stateless, in which case scaling it should be a breeze!

Read the complete 3521 bytes...

Digg it | Kick it | Dzone it | Reddit


devLINK 2009 followup

I'm finally sitting in the train on my way home from the Airport and an excellent week spent in Nashville, also known as Nash Vegas.

Read the complete 2285 bytes...

Digg it | Kick it | Dzone it | Reddit


IIS7 - The object identifier does not represent a valid object

When adding sites to IIS7 either by script or by editing the config files directly, you may receive an error in the sites list that says:

Read the complete 4637 bytes...

Digg it | Kick it | Dzone it | Reddit


Tricky SQL Server decimal math

SQL Server datatypes are not always what they seem to be. Martin Schmidt recently had an interesting blog post (in danish) regarding implicit decimal conversion that sparked my interest.

Read the complete 5407 bytes...

Digg it | Kick it | Dzone it | Reddit


Evolution of the simple genetic algorithm

Based on my previous post on how to implement a simple genetic algorithm, I got some great comments pointing out that the algorithm might not be the most pure form of a genetic algorithm. I won't disagree, though I will point out that evolution also does occur due to mutation alone, so genetic algorithms may come in different forms.

Read the complete 6354 bytes...

Digg it | Kick it | Dzone it | Reddit


Implementing a simple genetic algorithm

In this blog post I'll give a quick introduction to what genetic algorithms are and what they can be used for. We'll implement a genetic algorithm that attempts to guess an RGB color by evolving upon a random set of initial guesses, until it at some point evolves into the correct RGB value.

Read the complete 17719 bytes...

Digg it | Kick it | Dzone it | Reddit


TxF presentation materials

Yesterday I presented on how to use Transactional NTFS (TxF) in .NET, at the Copenhagen .NET User Group.

Read the complete 322 bytes...

Digg it | Kick it | Dzone it | Reddit


Thoughts on blogging

I am hastily nearing my third year blogging at improve.dk. Before reinventing my blog, I wrote articles and tutorials at the same address, though in Danish. When I rebooted my blog I completely ditched my old material and started blogging in English. After discussing the concept of blogging a lot recently, I've gathered up my thoughts on the subject.

Read the complete 6769 bytes...

Digg it | Kick it | Dzone it | Reddit


Speaking at devLink 2009

The session list for devLink 2009 has been announced. I'm delighted to announce that one of my abstracts was chosen - I will be speaking at devLink 2009 in Nashville, TN.

Read the complete 1081 bytes...

Digg it | Kick it | Dzone it | Reddit


Solving deadlocks through locking hints

Deadlocks in any database can be a hard beast to weed out, especially since they may hide latently in your code, awaiting that specific moment when they explode. An API website, exposing a series of webservices, had been working fine for months, until I decided to run my client app with a lot more threads than usual.

Read the complete 12007 bytes...

Digg it | Kick it | Dzone it | Reddit


Deciphering a SQL Server data page

SQL Server stores all of it's data in what is basically a large array of "pages". Each page is exactly 8kb and can contain various kinds of data, depending on the page type. In this entry we'll explore how to decipher a data page.

Read the complete 19723 bytes...

Digg it | Kick it | Dzone it | Reddit


Query Optimization - A Case Study

Yesterday I did an interview with Søren Spelling Lund for ANUG (Aarhus .NET User Group) on SQL Server Optimization, as a followup to my recent talk on that subject. He asked me an interesting question - what is the normal process of determining the need of an optimization, and how to actually do it? This is a case study from today.

Read the complete 12834 bytes...

Digg it | Kick it | Dzone it | Reddit


ANUG Talk: Optimizing SQL Server 2005

Tonight I held my SQL Server Optimization talk at ANUG. There was an impressive turnout of almost 50 people, and based on the feedback I've received so far, I think it went alright :)

Read the complete 1424 bytes...

Digg it | Kick it | Dzone it | Reddit


Resource URLs and their effect on client side caching

One of the best way to improve performance of any website is to reduce the load from clients by allowing them to cache resources. There are various ways to ensure we utilize client side caching to the fullest extent, an often overlooked parameter however, is the actual URL for the resource we want to cache.

Read the complete 6743 bytes...

Digg it | Kick it | Dzone it | Reddit


Utilizing transactional NTFS through .NET

We're used to using transactions when dealing with the database layer. Transactions ensure we can perform multiple queries as one atomic event, either they all succed or they all fail, obeying the rules of ACIDity. Until Vista, performing transactional file operations haven't been possible.

Read the complete 13572 bytes...

Digg it | Kick it | Dzone it | Reddit


TechTalk: Optimizing SQL Server 2005

I held a TechTalk on optimizing SQL Server 2005 on the 21st of January. I think it went well so I'm looking forward to the evaluations - please fill them out :)

Read the complete 1130 bytes...

Digg it | Kick it | Dzone it | Reddit