0 comments suggest edit

It appears to me that Windows Live Writer completely ignores categories returned by the getRecentPosts Metaweblog API method.

It took me a long time to realize this because I write all my posts using WLW and it stores the categories for a recent post on the local machine. So as long as I do everything via WLW, I’d never notice.

But a recent bug report alerted me to the problem. I logged into my blog via the web admin interface and changed the categories. I refreshed the recent posts in WLW and opened up a post, and sure enough the categories for the post were not updated.

I was experiencing the same thing in Blogjet, but after making a small tweak in the code, everything works fine in BlogJet. Unfortunately WLW is still broken in this respect.

I’ve carefully analyzed the HTTP traffic with Fiddler and cannot figure out why this would happen. Everything looks absolutely correct on Subtext’s end. I must conclude it’s a bug with WLW.

Would someone be so kind to confirm this with a different blog engine for me? Just run through the repro steps I mentioned above and let me know if it really works for you. I’d really be grateful.

Just to be clear: Repro Steps

  1. Create a post with no categories.
  2. Use another tool (such as your blog’s web admin) to specify several categories.
  3. In Windows Live Writer, refresh the recent posts.
  4. Click on the post to edit it.
  5. Check whether or not the correct categories are selected in the category drop down.

Thanks Mucho!

0 comments suggest edit

There’s a really devious scam going around worth mentioning because of one compelling tactic the scammers use.

My dad received a letter the other day “informing” him that he was the lucky winner of some unclaimed prize money. Below is the letter he received.


They sent him a check for $1,940 dollars and told him that all he needs to do to claim the prize money is deposit the check and send back a portion of that money for processing fees and identification purposes.

My dad’s first thought (which I imagine yours is as well) was, Oh! This must be a scam. They expect me to deposit their check and then send them a check from my bank account. After a few days, their check won’t clear and they’ll have my money.

For laughs, my dad decided to call the guy up to see what sort of crazy explanation he would provide. His answer caught my dad off-guard. He told him to wait till the check clears before sending them a check.

Huh? Wait a minute. So they want me to wait till the check clears? Doesn’t that mean the money is fully in my account? What if I never send them a check? I could just keep the money. If this is a scam, how are they making money?

Calling the Better Business Bureau provided the answer. They told my dad under no circumstances should he deposit that check. Yes, the check will clear, but probably because it was written by another victim defrauded by this same scam. Later when the scam is discovered by that victim, my dad would be liable for depositing a fraudelent check.

InspectorsWhat’s really makes this scam compelling and likely to sucker a lot of people into falling for it is the mistaken belief that once a check clears, the money is in the clear. It’s not.

In any case, if you receive such a scam letter, the proper authorities to report it to is not the FBI but the Postal Inspectors, the law enforcement wing of the United States Postal Service (and the subject of a really cheesy movie, The Inspectors starring Louis Gosset Jr.).

I would suggest warning your family members who are prone to such scams. Especially those who consistently fall for those PayPal emails and keep opening up pictures of Anna Kournikova sent via email.

0 comments suggest edit

When searching for source code in a particular language, what do the words being searched on tell you about that language?

Koders.com publishes an interesting Open Source Zeitgeist which focuses on search trends and patterns within open source code. This is very similar to Google’s Zeitgeist, but grouped by programming language and specific to open source code. This might help us gain some insight into answering the above question.

For example, compare this screenshot of the top Ruby, Java, and C# searches.

Top Java Searches - 1. md5, 2.swing,
C# Searches 1.system, 2.dataset,
3.openforecast Top Ruby Searches 1. proxy, 2.file,
3.socket Top PHP Searches 1. None, 2. excel,

It’s hard to draw any conclusive conclusions based on this sample, but let me offer a few uninformed thoughts, and you can tell me how off-base I am.

Someone suggested that you sort of get a sense of the maturity of a language by the terms being searched. I can kind of see that if I define maturity in this case to mean how well the general developer community within this language understands the features of the particular language.

The idea is that if a language has been around for a long time, there might not be as many searches on basic language features and more searches that appear to be task focused, or at least on esoteric features of the language. I admit, I’m not exactly convinced. Is this true? Let’s take a look.

Take Ruby for example. Even though it’s been around as long as Java, it is only recently (past few years) that it has had a huge surge in popularity. Thus, many of the top search terms seem focused on programming constructs such as proxy, file, socket, and thread. This might reflect the large number of people just learning their way around the language.

Then again, Ruby developers are also searching on terms such as rails, controller, activerecord. These are mature software development concepts.

Whereas Java, which arguably is more mature and has a much larger community, the top terms are slightly more esoteric (md5, swing, tree) or just vain. Java developers search for “java” when searching Java code? How many search results does that produce?However, also in the top are the terms string and file. That makes sense since even though Java is mature, there are still lots of new Java developers.

What’s really interesting to me is the inclusion of “Hibernate” as number 10 in the Java results.

Contrast this to C# where It does not surprise me that dataset is number 2 for C#. It’s the workhorse for the RAD developer. It appears that in pure numbers, the DataSet is winning over OR/M and such. There are no search results for activerecord, NHibernate, Subsonic, OR/M, etc… Whether that is a sad thing or not I leave for a subsequent flame war.

What’s interesting to me is that PHP seems really focused on the domain. Being unfamiliar with PHP, I could totally be wrong, but with search terms like excel, mail, and forum, that’s the impression I get.

Sort of makes sense that an old established widely used scripting language would have its basic features already understood. Though I have no idea why the top search term would be none. Are PHP programmers nihilistic?

In any case, many of you are thinking I’m drawing too many conclusions from too little data. You are absolutely correct. This is mere idle speculation already colored by preconceived notions.

However, I do find it interesting to look at these results and ask, what do they say about these languages and their users?

0 comments suggest edit

Raymond Lewallen doesn’t mean to single anybody out, but in his latest post on the topic of living better, he observes that

…there is a decent percentage of programmers that are obviously overweight. You’ve heard people talk: that fat, glasses wearing, backpack toting guy MUST be a geek! Even if you don’t wear glasses and tote a backpack with a laptop inside, if you’re plain overweight, people assume you have a high probability of being a computer geek!

So what can you do about it? At the MVP summit, I observed many things (unhealthy things) that I believe people can do to curb their diets and become healthier, leaner people.

So based on events at a geek conference, the MVP summit, Raymond assumes that unhealthy diets and lack of exercise could be at fault. Let me propose another theory based on my experience today on the exhibition floor of the SD West conference.

Burger and

As is common at conferences, several booths were giving out those ubiquitous one-size-fits all X-Large t-shirts emblazoned with a flaccid attempt at being hip and witty. All of this is lost on me as I receive a shirt I will never wear, as it looks like a dress on me. At least it will make a good rag for cleaning the next spill on my kitchen floor.

Contrast this to when I head over to SourceGear’s booth. I had the great pleasure to meet the founder of SourceGear, Eric Sink, in person. He is the author of one of my favorite blogs, in which he writes insightful posts on running a software company and software development in general.

Interesting random connection to Eric: He and I discovered that we both lived in thesame apartment complex in Spain, but at different times.

Back to the story. They actually are giving out shirts that I would consider wearing outside of a conference hall. He asks if I would like one, to which I reply, “Sure!”. It’s his next question that throws me aback.

Which size would you like?

Uh…excuse me. What was that?

You see, SourceGear had shirts in all sizes! Not only that, they had an ingenious ploy to get everyone wearing them. They were giving out a Wii and said they would randomly walk around and give people wearing the t-shirt tickets for the Wii raffle. Near the end of the day, it seemed like everyone was wearing their shirt.

Then it occurred to me. Developers are so used to being fit into a single mold, we often don’t know better. We often do that to our users, forcing them to conform to our software rather than conforming our software to how users really work.

In the keynote, David Platt gave several examples of sites that work and don’t work. Using the Starbucks website as an example, he did a search for one in his area. It didn’t find one within the selected radius, 5 miles, and gave him an empty search result page asking him to search again. Come again?

As Platt points out, when you’re in need of a coffe, would you ask your friend, “Hey, where are all the Starbucks within five miles from here?”, or do you ask, “Hey, where is the nearest Starbucks?” and then make the decision to go or not based on that information. You do the latter and so should our software.

But I digress.

Getting back to my epiphany. It occurred to me that maybe developers are fat, because we’re all trying to fit into that X-Large conference t-shirt. Perhaps, if more companies focus on the user like SourceGear, we’ll see thinner developers wearing shirts that actually fit. Just maybe.

If so, remember to thank Eric for giving developers a reason to not get fat.

0 comments suggest edit

Gavin Joyce, creator of DotNetKicks, has decided to open the source for the site and allow the community to help out in implemeting features and bug fixes.

This makes a lot of sense for a community site like DotNetKicks. Not only can the community build the content, but it can contribute to the actual feature set of the site as well!

Gavin has always been a bit progressive with this site, offering half of his AdSense revenue to those who submit stories (you have to configure your AdSense in your profile and DotNetKicks will show your AdSense ID 50% of the time).

I think this is a great idea and wish him much luck. I also look forward to being able to contribute a little bit here and there (donating heavily with code from Subtext of course).

0 comments suggest edit

Update: I’ve created a new NuGet Package for Identicon Handler (Package Id is “IdenticonHandler”) which will make it much easier to include this in your own projects.

A while ago, Jeff Atwood blogged about Identicons for .NET. An Identicon is an anonymized visual glyph that can represent an IP address. I likened it to a Graphical Digital Fingerprint.


The original concept and Java implementation was created by Don Park.

Afterwards, Jeff and Jon Galloway became excited by the idea and ported Don’s code to C# and .NET 2.0 and released it on his website.

This weekend, we’ve spent some time working out a few kinks and performance improvements and are proud to release version 1.1 on CodePlex.

Why CodePlex?

We chose CodePlex for this project because the codebase for this is extremely small, so the patch issue I mentioned in my critique, A Comparison of TFS vs Subversion for Open Source Projects, is not quite as large an issue.

We don’t expect this project to grow very large and have a huge number of releases. This code does one thing, and hopefully, does it well.

So in that respect, CodePlex seems like a great host for this type of small project. It is really easy to get other developers up and running if need be.

Having said that, I probably wouldn’t host a large project here yet based on the critique I mentioned.

code 0 comments suggest edit

Lock After reading Scott Hanselman’s post on Managed Snobism which covers the snobbery some have against managed languages because they don’t “perform” well, I had to post the following rant in his comments:

What is it that makes huge populations of developers think they’re working on a Ferrari when their app is really just a Pinto? \ \ “I’m writing a web app that pulls data from a database and puts it on a web page. I never use ‘foreach’ because I heard it’s slower than explicitly iterating a for loop.

In my time as a developer I’ve experienced too many instances of this Micro Optimization, also known as Premature Optimization.

Premature optimization tends to lead “clever” developers to shoot themselves in the foot (metaphorically speaking, of course). Let’s look at one common example I’ve run into from time to time—double check locking for singletons.

Double Check Locking Refresher

As a refresher, here is an example of the double check pattern.

public sealed class MyClass
  private static object _synchBlock = new object();
  private static volatile MyClass _singletonInstance;

  //Makes sure only this class can create an instance.
  private MyClass() {}
  //Singleton property.
  public static MyClass Singleton
      if(_singletonInstance == null)
          // Need to check again, in case another cheeky thread 
          // slipped in there while we were acquiring the lock.
          if(_singletonInstance == null)
            _singletonInstance = new MyClass();

The premise behind this approach is that all this extra ugly code will wring out better performance by lazy loading the singleton. If it is never accessed, it never needs to be instantiated. Of course this raises the question, Why define a Singleton if it’s quite likely it’ll never get used?

The Singleton property checks the static singleton member for null. If it is null, it attempts to acquire a lock before checking if its null again. Why the second null check? Well in the time our current thread took to acquire the lock, another thread could have snuck in and initialized the singleton.

Note that we use the volatile keyword for the _singletonInstance static member. Why? Long story made short, this has to do with how different memory models can reorder reads and writes. For the current CLR you can ignore the volatile keyword in this case. But if you run your code on Mono or some other future platform, you may need it, so no point in not leaving it there.

Criticisms or If this is fast, how much faster is triple check locking?

Jeffrey Richter in his book CLR via C# criticizes this approach (starting on page 639) as “not that interesting” (Yes, he can be scathing!)

The double-check locking technique is less efficient than the class constructor technique because you need to construct your own lock object (in the class constructor) and write all of the additional locking code yourself.

The cost of initializing the singleton instance would have to be significantly more than the cost of instantiating the object used to synchronize access to it (not to mention all the conditional checks when accessing the singleton) to be worth it.

A Better Approach? The No Look Pass of Singletons

So what’s the better approach? Use a static initializer in what I call the No Check No Locking Technique.

public sealed class MyClass
  private static MyClass _singletonInstance = new MyClass();

  //Makes sure only this class can create an instance.
  private MyClass() {}
  //Singleton property.
  public static MyClass Singleton
      return _singletonInstance;

The CLR guarantees that the code in a static constructor (implicit or explicit) is only called once. You get all that thread safety for free! No need to write your own error prone locking code in this case and no need to dig through Memory Model implications. It just works, unlike your Pinto, sorry, “Ferrari”.

See, sometimes you can have your cake and eat it too. This code, which is simpler and easier to understand, happens to perform better and requires one less object instantiaton. How do you like them apples?

It turns out that this approach is also recommended for Java, as it was discovered that the double check locking approach wasn’t guaranteed to work.

What!? You’re Still Using Singletons?!

Now that I’ve gone through all this trouble to show you the proper way to create a Singleton, I leave you with this thought. Should a well designed system use Singletons in the first place, or is it just a stupid idea? That’s a topic for another time.

Please note that double check locking doesn’t only apply to Singletons. It just happens to be the place where it is most often seen in the wild.

0 comments suggest edit

Search Magnifying
Glass With all the advances in software development in the past few years, I would have to point to Google and Google Groups as the two tools that provide the biggest productivity enhancements for me as a software developer. This fact is probably nothing new to any of you.

Search as a development tool is a phenomena some are starting to refer to asSearch Driven Development(Not to be confused with Test Driven Development).

Let’s face it, at the rate that new technology is being churned out these days, and given the huge size of many of these frameworks we use, it is impossible to learn everything up front. At some point, we have to stop RTFM’ing, put the documentation down, and start coding. And when we run into trouble, we thank our lucky stars that Google is there to save the day.

Wouldn’t it be great to have some of that search power integrated in your IDE? It turns out that Koders.com have done just that. They provide two free IDE plugins available, one for Eclipse and one for Visual Studio.NET, on their website in the downloads section.

When you go to the site, there’s a little animation demonstrating the plugin. Click the View Again button if you missed it.

Here’s a screenshot I took of SmartSearch^TM^ in action. After typing out the method name, a moment later, the result shows up.

Screenshot of Koders SmartSearch<sup>TM</sup> in

The Smart Search feature is a bit Clippy like at times and sometimes exhibits a bit of lag, making it less useful than it could be. You may just want to turn it off and choose to use the plugin search box directly.

Though there is room for improvement, I think SmartSearch^TM^ is really a really interesting application of context based search and could be quite useful as a double check while writing code. Oh hey, there are already 100 implementations of this method. Let’s see how mine stacks up. Avert my eyes from the GPL licensed code!


Under the hood, these plugins make use of the Koders.com search engine. This engine directly indexes source control repositories and allows users to quickly search and browse through Open Source code. It’s includes a nice interface and provides all the information necessary (such as the license) so you can make an informed decision on whether to use it or not. You can also choose to filter by language and license.

Given my interest in Open Source software, I had heard of Koders.com but didn’t know about their plugins till today, when I had lunch with Darren Rush, the CEO of Koders.com. Little did I know until Darren contacted me via my blog, Koders.com is based in Los Angeles! Darren turned me on to the term Search Driven Development.

Finally! A Los Angeles based company doing something really interesting in the Open Source space that isn’t part of “The Industry”. Very Cool!

As an aside, during our conversation, we wondered why L.A. doesn’t have anywhere close to the tech industry that the Bay Area does. We seem to have all the elements here, but not the community. I seem to think it’s because this area is dominated by the film industry. He pointed out that geography due to the horrible traffic creates pockets of communities. Probably a bit of both.

But I digress.

In any case, lest you think I’m shilling (Yeah, he bought lunch, but I can’t be bought that cheaply!), the other player in this field that I’ve heard about (apart from the obvious 800lb gorilla) is Krugle.com. While their site has a nice color scheme and look and feel, I found Koders easier to use because of its similarity in layout to Google (did I mention Koders is L.A. based?).

I think sticking to the Google Search look (searchbox in the middle) is a smart move for any search site. As soon as I see such a site, I know what to do and where to type. Krugle has a beta plugin to Eclipse, but doesn’t seem to have anything for Visual Studio.NET yet.

asp.net, code 0 comments suggest edit

Some people think the ViewState is the spawn of the devil. Not one to be afraid of being in bed with the devil, I feel a tad bit less negative towards it, as it can be very useful.

Still, it has its share of disadvantages. It sure can get bloated. Not only that, but disabling ViewState can wreack havock with the functionality of many controls.

This is why ASP.NET 2.0 introduces the control state. The basic idea is that there is some state that should be considered the data for the control, while other state is necessary for the control to function. For example, the contents of a GridView. The control doesn’t absolutely need this data persisted across postbacks to function properly. You could choose to reload it from the database, Cache, or Session.

In contrast is the state of the selected node in a TreeView. This is state that is necessary for the control to function properly across postbacks.

Unlike the ViewState, the control state isn’t implemented as a property bag. You have to do a little bit of extra work to make use of it. Namely, there are two methods you have to implement in your custom control.

  • LoadControlState – Restores the control state from a previous page request. ASP.NET calls this method passing in the control state as an object to this method.
  • SaveControlState – Saves any changes to control state since the last post back. You need to return the state of the control as the return value of this method. ASP.NET will store it.

Your custom control must also register the fact that it needs the control state by calling Page.RegisterRequireControlState.

A Demonstration That Makes This All Clear As Mud

I’ve put together a simple control to demonstrate the control state. Now before I go any further, I must warn you not to copy and paste this implementation. This implementation is designed to clarify how the control state works. I will present another implementation that describes a safer approach, which you can feel free to copy and paste. You’ll see what I mean.

public class ControlStateDemo : WebControl
  public int ViewPostCount
    get { return (int)(ViewState["ViewProp"] ?? 0); }
    set { ViewState["ViewProp"] = value; }

  public int ControlPostCount
    get { return controlPostCount; }
    set { controlPostCount = value; }
  private int controlPostCount;

  protected override void OnInit(EventArgs e)
    //Let the page know this control needs the control state.

  protected override void OnLoad(EventArgs e)

  protected override void Render(HtmlTextWriter writer)
    writer.Write("<p>ViewState: " + this.ViewPostCount + "</p>");
    writer.Write("<p>ControlState:" + this.ControlPostCount + "</p>");
  protected override void LoadControlState(object savedState)
    int state = (int)(savedState ?? 0);
    this.controlPostCount = state;

  protected override object SaveControlState()
    return controlPostCount;

This control has two properties. One backed by the ViewState and the other backed by a private member variable. Notice that we register this control with the Page in the OnInit method.

In the OnLoad method, we increment each property. For demonstration purposes, we need these properties to change on each postback, and this is as good a method as any.

In the Render method, we simply output the values of the two properties. So far so good, eh?

Now we get to the LoadControlState method. This method is called by ASP.NET early in the control lifecyle (after OnInit but before LoadViewState) in order to provide your control with the saved control state from the previous request.

In this case, we can cast this value to an int and set the control’s state (the value of controlPostCount) to this value.

The SaveControlState method provides ASP.NET the data to store in the control state as the return value. In this example, we return the value of controlPostCount. This is how we knew we could cast the value to an int in LoadControlState.

Now if I drop this control onto a page with a Button control, let’s see what happens after a few postbacks.

Image showing the ViewState and Control State counters with values of

As expected, both values increment, as they are persisted across postbacks. But what happens if we disable ViewState on the page and click the button a few more times.

Image showing the ViewState counter with a value of 1 and the Control
State counters with a value of

As you can see, we retain the control state, while the ViewState is disabled.

But What About Inherited Controls?

I am so glad you asked! In this example, I inherited from WebControl, but what if I inherited from TreeControl, or some other control that made use of the control state. My implementation of LoadControlState and SaveControlState pretty much obliterates the control state for the base class.

The class I wrote here is intentionally simple to show you no real magic is going on. Let’s demonstrate the proper way to save and load the control state by creating a class that inherits from this control.

public class SubControlStateDemo : ControlStateDemo
  public int AnotherCount
    get { return this.anotherCount; }
    set { this.anotherCount = value; }

  private int anotherCount;

  protected override void OnLoad(EventArgs e)

  protected override void Render(HtmlTextWriter writer)
    writer.Write("<p>AnotherCount:" + this.AnotherCount + "</p>");

  protected override object SaveControlState()
    //grab the state for the base control.
    object baseState = base.SaveControlState();

    //create an array to hold the base control’s state 
    //and this control’s state.
    object thisState = new object[] {baseState, this.anotherCount};
    return thisState;

  protected override void LoadControlState(object savedState)
    object[] stateLastRequest = (object[]) savedState;
    //Grab the state for the base class 
    //and give it to it.
    object baseState = stateLastRequest[0];

    //Now load this control’s state.
    this.anotherCount = (int) stateLastRequest[1];

In this control, we inherit from the ControlStateDemo control I wrote earlier and added a new property called AnotherCount. The main thing to focus on here is our new implementation of SaveControlState and LoadControlState. We now take great pains to make sure that the base control gets the value it is expecting.

In SaveControlState, the first thing we do is grab the control state from the base control by calling base.SaveControlState. As you recall, this holds the value for the private member controlPostCount.

Since we want to add our own private member, anotherCount to the control state, we create an array to store both values and then return this array to the caller.

Within the LoadControlState method, we know we’re going to be passed in an object array and that the first element of the array is the control state for our base class. So in that method, we grab the first element and pass it to the method call base.LoadControlState, thus giving the base class what it expects to receive for its control state.

We then grab the second element, which is our control state, and set anotherCount to this value.

Let’s look at a screenshot of the result in action. Looks like everything is humming along nicely.

Screen showing our new property also being saved and restored

I would recommend using this approach anytime you implement control state in a custom control because you never know when you might override the control state for a base class.

0 comments suggest edit

When you see the following in your CSS

  margin-top: 10px;
  margin-right: 20px;
  margin-bottom: 10px;
  margin-left: 20px;

It makes sense to convert it to this.

  margin: 10px 20px;

It’s cleaner and takes up less space.

There are a lot of ways you can optimize your CSS in this way. I’m not talking about compression, but optimization.

Today, The Daily Blog Tips site linked to a website called CleanCSS that can perform many of these optimizations for you. For example, feed it the above CSS and it will make that conversion. Very nice!

0 comments suggest edit

I used to think the choice of using dashes vs underscores to separate words in an URL was simply a matter of personal preference. Nothing more than a religious choice.

Personally, I preferred underscores because I felt dashes intruded upon the words while underscores stayed at the bottom out of the way. So much so I had originally made that the default URL scheme in Subtext for friendly URLs and was using that myself.

It wasn’t till recently that I learned this debate has already been resolved. Years ago.

I wouldn’t say resolved really. Just that, there appears to be a really good reason to choose dashes over underscores. Apparently, Google sees the dash as a word separator, while the underscore is perceived to be part of the word. Something to do with being able to search for C++ style constant variables SUCH_AS_THIS in the title of a post.

The question is, does this still apply today? Does iteven matter?

To be on the safe side, I’m falling in line for now. Or rather, in dash. What are your thoughts?

0 comments suggest edit

In January, I wrote that according to the Chinese Zodiac, this is the Year of the Golden Pig. According to foklore, this is a special event that occurs once every 600 years and brings great fortune to babies born during the year.

As an aside, not many realized that the Chinese New Year didn’t start until February 18 this year. So your January baby doesn’t make the cut. But don’t worry, read on.

Many historians and others have discounted the year of the golden pig as mere legend. No historical record 600 years ago point to the significance of this day.

That hasn’t stopped the baby boom from soaring on in places like China and Korea. Historical fact will not stop the masses from having their golden piglet.

piglets However, my friend Walter had an interesting observation. All of these extra children that will be born as part of this boom are competing for the same scarce resources. As they grow up, they’ll all be competing in entrance exams for limited spots in the various prestigious universities. And when they graduate, they’ll be competing for a limited set of jobs.

So will the Year of the Golden Pig actually be the Year of the Starving Pig?

It will be interesting to see what happens in these countries.

0 comments suggest edit

You’ve spent hours setting up your blog on your favorite blog platform just right. Good for you! So how do you maintain your blog so that it remains at the top of its game?

It turns out, there are a large number of free web utilities useful for improving your blog’s effectiveness outside of your blog engine.

Image of hammer, ruler, and other tools. CC
licensed. Tools 4 Argentina - Some Rights Reserved

Everytime I come across one of these useful utilities, I bookmark it to my Blog Utilities folder. This folder is my blogger utility belt, full of tools to meet every need when composing blog posts or optimizing my site for bandwidth and speed.

I’ve chosen to focus on web utilities as they are quick and easy to use — no installation required. This is not a comprehensive list by far, as I am sure there are many others out there. Let me know what I missed in the comments.


The first three tools in this category are all website speed testers, but each offers something different, so I’ve listed them all.

  1. Web Page Analyzer
    • This tool is fairly comprehensive and may be the only one you really need for website speed analysis. Includes stats on every file and object downloaded and provides approximate download times for different connection rates.
  2. OctaGate Site Timer
    • I didn’t find this one to be as accurate as the first one because it attempted to download images referenced in my CSS files that were commented out. However, it provides a nicer graphical output that marks when the request was started, when it connected, and the time when the first and last bytes were received. It also highlights 404 errors in red, which is handy for finding missing files or bad URLs.
  3. HttpZip Compression Checker
    • Use this to check whether files from your website are being served with HTTP Compression on or off. Thanks to Jeff Atwood for pointing me to this one (among others).
  4. Dynamic Drive Online Image Optimizer-if you’re hardcore about your image compression, you should check out Ken Silverman’s Utility Page. But if you’re like me and just want a quick and easy web based utility for compressing images, this is your site. It can convert gif, jpg, and png files up to 300kb. It will also do conversions to other image types and display multiple results at various color levels and compression rates so you can pick the best one for your needs.
  5. Javascript Minimizer
    • This is an extremely simple tool. Paste in your javascript and click the button and reduce the size of your javascripts.
  6. CSS Minimizer
    • Just like the Javascript minimizer, but for Cascading Style Sheets.

Statistics and Search Engine Optimization

Get a handle on your web traffic with these sites.

  1. Website Grader
    • Gives your website a score in an attempt measure its effectiveness. Shows your PageRank, meta info, domain info, technoratic stats, etc… It generates a really neat report card for your blog.
  2. Google Webmaster Central - An absolute essential tool for those who care about users finding their site via Google. Especially pay attention to the Webmaster tools which include Sitemap support.
  3. Google Analytics-A free and full featured analytics package for your blog or website. Add some javascript to your page template and you’re in information overload land, but done up with nice charts and graphs.
  4. 103bees Search traffic analysis**- Unlike other stats packages, this one is focused purely on natural search engine traffic analytics. What are users searching for when they land on your site? This is a nice complement to Google Analytics. And it’s free! One caveat is that the script can be slow sometimes, which can play havoc with CSS based designs.
  5. Technorati - It’s so obvious, I almost forgot to list it. Register, claim your blog, and find out who is linking to you. You can add a little script to your blog that displays how many other posts link to yours.
  6. Alexa.com - The beauty of this site is that you can easily compare your website’s reach with several other websites on a single graph, thus starting a huge pissing contest.

Spicing Up Your Posts With Images

  1. Wikipedia Public Domain Image Resources
    • Images can bring a blog post to life. But rather than worrying about receiving a cease and desist letter for misusing copyrighted material, why not use images that are part of the Public Domain? This page is chock full of links to resources for free images.
  2. PicFindr -Despite it’s “Oh so Web 2.0” name (must everything end in a consonant plus “r” these days? At least it doesn’t have BETA anywhere), this tool is really great. It will search a set of free photo sites such as Stock.xchng, for free photographs.
  3. Flickr Creative Commons
    • Still haven’t found that picture that just hits the point you’re trying to make? Try the Flickr Creative Commons search engine. Remember, these photos are not public domain. You do need to abide by the license. But for the most part, the licenses are pretty lenient for you to reuse the photos in your own blog.
  4. Open Clip Art Library
    • Maybe you want your image to be iconicrather than photographic. Check out this free Public Domain clip art library to find an icon for every occasion.
  5. WP Clipart
    • Another Public Domain clip art library, though the quality tends to be less than the Open Clip Art Library.

Create and Improve Your Content

  1. Cliche Finder - Try to avoid using too many tired old cliches by running your post through this web based utility.
  2. HallwayTesting.com
    • This is a fantastic site for basic hallway usability testing. Just submit your URL and real people will post comments with criticisms and praise for your site. The more specific you are about what you want testers to focus on, the better quality the feedback. Try it out.


  1. FeedBurner - This one gets special mention because it fits in so many categories. It’ll help optimize your bandwidth by serving your RSS feeds for you. Also, it includes a basic free stats package as well as a premium stats package that can replace Google Analytics. FeedBurner can also provide features your blogging platform might not, such as subscribing to RSS Feeds via email.

Special Mention

As I mentioned before, this post is focusing on web utilities. However, these two utilities are so essential, I just had to break my own rule and list them.

  1. Firebug Firefox Add-on - Ok, this breaks my rule as it isn’t technically a website, but it is a FireFox browser plugin so it might as well be a website, right? Well in any case, this tool is too important not to mention. It has it all. It can be used to time your websites download speeds, view the underlying HTTP information, measure the size of each file. Add to that a great Javascript debugger and CSS and DOM explorer. This is a must have tool.
  2. Windows Live Writer
    • I broke my rule again. This tool won’t help you write better content, but it’ll help you have fun doing it. Also, all the plugins available make it easy to add a little extra oomph to your blog posts by including Flickr images, formatted code, etc…

Again, I’m sure I missed someone’s favorite tool hear, so please let me know what I missed in the comments. And if you do, let me know which tool you’d remove from this list in order to add yours. I’ll try following up at a later time with an improved list.

Technorati Tags: Tips, href=”http://technorati.com/tags/Blogging”>Blogging, href=”http://technorati.com/tags/Utilities”>Utilities

code, tdd 0 comments suggest edit

Leon Bambrick (aka SecretGeek) has started a series on Agile methodologies and Test Driven Development (TDD) in which he brings up his own various hidden objections to TDD in order to see if his prejudices can be overcome.

One of the questions he asks is an age old argument against TDD. Who Tests the Tests?Leon sees potential for a stack overflow since, given that the tests are code, and that according to TDD, code should be tested, shouldn’t there be tests for the tests?

The short answer is that the code tests the tests, and the tests test the code.


Testing Atomic Clocks

Let me start with an analogy. Suppose you are travelling with an atomic clock. How would you know that the clock is calibrated correctly?

One way is to ask your neighbor with an atomic clock (because everyone carries one around) and compare the two. If they both report the same time, then you have a high degree of confidence they are both correct.

If they are different, then you know one or the other is wrong.

So in this situation, if the only question you are asking is, “Is my clock giving the correct time?”, then do you really need a third clock to test the second clock and a fourth clock to test the third? Not if all. Stack Overflow avoided!

Principle of Triangulation

This really follows from the principle of triangulation. Why do sailors without electronic navigation systems bring three sextants with them on board a ship?

With one sextant, you could rely on the manafacture testing to assume its measurements are correct, but wear and tear over time(not much unlike the wear and tear a codebase suffers over time) might make the measurements slightly off.

If you take measuremnts with two sextants, then you have enough information to decide if both are measuring accurately or if one is not. However in this situation, we need to know exactly which measurement is correct.

So we take a third sextant out. The two sextants that take measurements most closely together are most likely correct. Accurate enough to cross the Atlantic.

aspnet configuration 0 comments suggest edit

Are you tired of seeing your configuration settings as an endless list of key value pairs?

<add key="key0" value="value0" />
<add key="key1" value="value1" /> 
<add key="key2" value="value2" />

Would you rather see something more like this?

  someOtherSetting="value" />

Join the club. Not only is the first approach prone to typos (AppSettings["tire"] or AppSettings["tier] anyone?), too many of these things all bunched together can cause your eyes to glaze over. It is a lot easier to manage when settings are grouped in logical bunches.

A while back Craig Andera solved this problem with the Last Configuration Section Handler he’d ever need. This basically made it easy to specify a custom strongly typed class to represent a logical group of settings using XML Serialization. It led to a much cleaner configuration file.

But that was then and this is now. With ASP.NET 2.0, there’s an even easier way which I didn’t know about until Jeff Atwood recently turned me on to it.

So here is a quick run through in three easy steps.

Step one - Define your Custom Configuration Class

In this case, we’ll define a class to hold settings for a blog engine. We just need to define our class, inherit from System.Configuration.ConfigurationSection, and add a property per setting we wish to store.

using System;
using System.Configuration;

public class BlogSettings : ConfigurationSection
  private static BlogSettings settings 
    = ConfigurationManager.GetSection("BlogSettings") as BlogSettings;
  public static BlogSettings Settings
      return settings;

    , DefaultValue = 20
    , IsRequired = false)]
  [IntegerValidator(MinValue = 1
    , MaxValue = 100)]
  public int FrontPagePostCount
      get { return (int)this["frontPagePostCount"]; }
        set { this["frontPagePostCount"] = value; }

    , IsRequired=true)]
  [StringValidator(InvalidCharacters = "  ~!@#$%^&*()[]{}/;’\"|\\"
    , MinLength=1
    , MaxLength=256)]
  public string Title
    get { return (string)this["title"]; }
    set { this["title"] = value; }

Notice that you use an indexed property to store and retrieve each property value.

I also added a static property named Settings for convenience.

Step 2 - Add your new configuration section to web.config (or app.config).

      <section name="BlogSettings" type="Fully.Qualified.TypeName.BlogSettings,   
      AssemblyName" />
    title="You’ve Been Haacked" />

Step 3 - Enjoy your new custom configuration section {.clear}

string title = BlogSettings.Settings.Title;
Response.Write(title); //it works!!!

What I covered is just a very brief overview to get you a taste of what is available in the Configuration API. I wrote more about configuration in the book I’m cowriting with Jeff Atwood, Jon Galloway, and K. Scott Allen.

If you want to get a more comprehensive overview and the nitty gritty, I recommend reading Unraveling the Mysteries of .NET 2.0 Configuration by Jon Rista.

0 comments suggest edit

Curb your enthusiasm season 1
dvdJuan Catalan must be feeling “Pretty good. Pretty, pretty, pretty, pretty, good.” His poor luck seemed to exceed Larry Davidian proportions when he was accused of murder. But his luck took a turn for the better after over five months in Jail.

Catalan claimed to be at a Dodgers game with his daughter when the murder occurred. His defense attorney scoured TV footage of crowd shots from the game but could not find Juan. After learning that the show Curb Your Enthusiasm, starring Larry David who co-created Seinfeld, had taken footage at the ballpark that day (I think I remember this episode!), HBO allowed the attorney to search through their footage and he found a time-stamped shot of Catalan in the outtakes.

HBO allowed Melnik to look through the footage, and he found a shot of Catalan with his 6-year-old daughter and two friends. The footage was time coded, confirming that Catalan was at the ballpark shortly before the time of the slaying 20 miles away in the San Fernando Valley.

“There he was in the outtakes,” said Gary S. Casselman, the attorney handling Catalan’s lawsuit. “He’s glad it’s over. It’s terrible to be in jail, and he thought he would never see his daughters again.”

I read this in the Los Angeles Times yesterday morning and laughed at his good fortune to be saved by a television show.

Catalan was not a fan of “Curb Your Enthusiasm” before his time in jail. “He is now,” Casselman said.

I bet he is. The full Los Angeles Times article is here.

0 comments suggest edit

UPDATE: As an aside, it would probably be more accurate to say the FizzBuzz question is a Requirement. So where you read the term Spec, you can replace it with Requirement. Either way, the same thing applies. The only thing not ambiguous is the code. As they say, the code is the spec.

One last point, then I’m done with this topic of FizzBuzz and spec writing. In a recent post, I mentioned tongue firmly in cheekthat the FizzBuzz “spec” has certain flaws. Now I admit I’m taking this out of context a bit to make a point. FizzBuzz is an simple interviewquestion, not a spec, possbily intended to elicit this type of analysis from the candidate. Even so, I think there’s a good lesson to learn here.

My point was that all specs are merely rough approximations of the actual requirement. Specs are ambiguous, but software is not. Software doesn’t generally deal well with ambiguity. Change a random bit in memory and all hell breaks loose.

However, some of that was lost due to the extremely nitpicky point I made about the spec. So here’s another, still nitpicky, but a bit less so.

Every so called “correct” program written in the comments of Jeff’s blog had the following output.


But, doesn’t the following output meet the letter of the spec (difference in bold)?


My point being, the spec is explicit about replacing numbers divisible by three with “Fizz”, but it doesn’t say to replace numbers divisible by five.

Yes, I agree. Developers should not act like total logicians and nitpick every detail. Human language is inexact, and we have to deal with that fact of life. Unfortunately, sofware doesn’t have the same resiliency towards ambiguity. If this output was meant to be fed into another software system, this ambiguity would cause bad data, software crashes, who knows what calamity!

You might say I’m splitting hairs here. Of course I am because the compiler is going to split hairs. The Web Service I’m trying to call is going to split hairs. The HTML browser is going to try and not split hairs, but is going to ultimately fail. Software is all about splitting hairs.

Instead, we need to move beyond the spec and ask questions before writing code, during writing code, and after writing code. Do not be afraid to talk to the customer or customer representative. That’s all I was trying to say.

Thanks to Rob Conery who was trying to make this point in my comments, but it was lost on everybody. ;)

0 comments suggest edit

UPDATE: You can now subscribe to my feed via email. This is a service offering from Feedburner. Sweet!

Flame from
Feedburner.comI’ve decided to make the jump and switch to Feedburner after the glowing recommendation from Jeff Atwood. However, being the paranoid sort, I decided to go ahead and pay for the MyBrand PRO feature.

This allows me to keep control over my feed by serving it from my own domain http://feeds.haacked.com/haacked/. Not that I don’t trust FeedBurner, but if I ever want to take my feed back in-house, it’ll be a lot easier for me to change a DNS setting than to wait for them to perform a 301 redirect back to me.

If you’re reading this in your aggregator, my guess is that everything is working fine. If not, please do let me know if you encounter any problems. Flame on!