March 2008

published: Tue, 4-Mar-2008   |   updated: Fri, 5-Aug-2016
Turnstone's open space

Here are the articles that were published in March 2008.

First problems with Windows Vista SP1

So far, Service Pack 1 has been fine. I installed it early last week and haven't seen any problems. I did recalculate my Windows Experience Index and it notched up from 5.1 to 5.2 (these are the memory scores, otherwise it would be 5.6), but I'm going to guess that's because I was borderline before and the hardware has settled down in the past month of use. Read more...

Red-black trees (part 4)

Last time in this series on red-black trees, we convinced ourselves that leaving the balance of binary search trees to chance was pretty good but not completely optimal. Even if we could guarantee that we added items in a completely random order to our trees (and, to be honest, that's an unrealistic expectation), we would still only get average search times of 1.39 * log2(n), instead of the theoretic log2(n). So we shall have to exploit an "active" balancing algorithm, and the best one we know of is the red-black tree. Read more...

Calculating pi with C#

A couple of evenings ago, my wife was reading an article about a federal prosecutor, when she suddenly exclaimed "How many digits of π (pi) do you know? Because this lawyer knows 500 digits." I had to admit that I'd only memorized π to eight decimal places, 3.14159265, but I immediately jumped in with "I know how to write a program that can print out thousands of digits of π." So she threw down the gauntlet. Read more...

Fixing code listings

Dustin Campbell manages to display source code in his blog posts with the Visual Studio syntax highlighting. So, go on, how do you do it, I asked. Simple, as any fule kno, he said. When you copy source code with Visual Studio, it creates a data block in rich text format (RTF). Take that clipboard data, parse it, and output HTML. I could see that he felt I wasn't up to writing an RTF parser. Hah! Moi? Read more...

Red-black trees (part 3)

In this continuing series on red-black trees, we've now seen how to insert into a normal binary search tree. In fact the implementation and code were so simple, it's hard to even recognize that anyone would want to do anything else. Why invent more complicated binary trees, when the binary search tree seems to do so well? Read more...

Theme Change

I got bored. Over the next couple of weeks I need to create a couple of other websites (essentially single-pagers for charity events) and so I wanted to practice CSS again. This new theme you see (at least that's so, all you readers of RSS, if you went to the website) I'm calling Castlerigg. Read more...

Red-black trees (part 2)

Now that I have the technology available to draw trees quickly and accurately (and you have seen the algorithm and its implementation at first hand), it's time to go back to the main subject: red-black trees. Except that I have some more foundation to lay first. So in this episode we'll look at binary search trees, and how to insert new nodes into them. After all, visually, a red-block tree is a binary search tree with colorful nodes. Read more...