Dec 12, 2006

I've been watching my weblogs (by which I mean the actual web server logs) scroll by to make sure everything's kosher and fixing up little things here and there.

It's an interesting view of your website; I'm not sure I've ever really watched a weblog for hours at a time before. One interesting point: While I'm sure my experience isn't necessarily representative, the online feed readers have really taken off. I suppose if even I've converted to Google's reader, and I tend to prefer local clients to web clients, that means something. (The only aggregator that I've been happy with on Linux is also a complete, absolute dog. 20 feeds shouldn't result in multi-second bouts of 100% CPU usage several times an hour; it was noticably degrading general performance. Parsing RSS isn't that hard.) I'd estimate two thirds of my subscribers are on online clients, and that's just the ones that I can tell; some online readers like the Earthlink's don't give reader statistics in the User-Agent.

It's also interesting how many browsers put "Mozilla/4.0" in the string, including several web crawlers, and the rest put "Mozilla/5.0" in the string. Mozilla-based browsers may only have 10%-15% market share, but you'd never know that from a naive reading of the User-Agent strings, where it's still 1996.

Dec 12, 2006

An "unbeatable" Clinton-Obama ticket?

You know, just on general principles I don't really want our President sequence to go "Bush, Clinton, Bush, Clinton".

And even more strongly on the same principles, I don't want to see "Bush, (Clinton,) Bush, Bush", so Jeb, unless you are a political genious please don't run.

300 million people in this country and only one family and one marriage is Presidential material?

If we're really lucky, 2008 will be Clinton vs. Bush. Won't that be fun.


Chelsea Clinton was born in 1980, and a President must be at least 35 years old according to the constitution, which she will be in 2015, so if President Hillary Clinton serves 2008-2012 and 2012-2016, Chelsea will be just old enough to take over.

Alternatively, we could elect Hillary Clinton, then we could go Jeb Bush, then, even at one term each, Chelsea Clinton will be ready to take the Presidency.

But it looks like the Bushes will win this fight long term; Bush Senior isn't even out of children yet, and there's a lot of spouses left. The (Rodham-)Clintons would need to start going to their extended family or something once they tap Chelsea, which just goes to show you that Steyn may be on to something with that demography stuff.

The United States is so rich, we have not one but two royal lines of succession! Take that, all you poor, enfeebled European monarchies!

Dec 11, 2006

I just saw a Konqueror user flash by in my logs (which I've been watching for errors), and decided to check my Javascript to see if it worked in Konqueror. I'm not surprised to find out it doesn't.

Unfortunately, I don't see any way to debug the Javascript with Konqueror. A few web pages reference starting konqueror in a console to get javascript errors output on STDOUT, but that's not working on my copy. Without any feedback, I can't fix it in any reasonable amount of time.

NonMockObjects 0.2.0 Released
Dec 11, 2006

I've released NonMockObjects 0.2.0.

This release adds easy support for obtaining many variants of an object, which allows you to easily test that all combinations of some parameters have a certain invariant.

For instance, my Entry objects for this weblog can optionally contain a title, a link for the title, and a summary. The only constraint on that set is that a link affects a title, so you really need a title for the link to make sense, although it is permissible to have a link without a title in the database. By setting up my Entry creation function to indicate that each of those can either be None or contain a certain concrete string, I can obtain all 8 combinations of an entry with:

    for entry in data.variations_entry():

And then perform some tests, such as verifying that no code crashes and that the RSS renders all combinations correctly.

You'd be surprised what such combinatoric testing can reveal. I think such combinatoric testing is a powerful argument in favor of automated testing; you already can't possibly run manual tests as often as you run automated tests, but testing umpteen combinations of parameters really highlights the difference. Manually testing what can rapidly become hundreds of combinations of parameters can be impossible, even once at the end of a project, and you certainly aren't going to do it repeatedly, let alone every time the code changes.

Obviously you have to be careful not to go overboard and accidentally specify a few million combinations, but so far I have not found that to be a problem in practice. If you have an object that truly has a million distinct behaviors, you've probably got a design problem.

The unit testing on this weblog's code still isn't quite up to par (I just now noticed I have no category index pages, whoops!), but it'd be even worse without the support of NonMockObjects.

If there's going to be a 0.2.1, it'll probably add the ability to request the exact set of parameters that was used to create the object along with the object, that is, code that looks like the following:

    for object, creation_parameters in data.variations_entry():

where creation_parameters is a dict containing the concrete parameters used to create the object this time through the loop.

I'm still trying to work out whether this constitutes an antipattern or not. The argument against it is that you really ought to be able to easily re-discover the parameters by examining the returned object, and if you can't, it might be a sign that your creation functions are too complicated. The argument in favor of it is "complexity happens", and might still be easier to work with the parameters directly. So far I've always been able to examine the returned object.

For full documentation on the process of creating and using variations, see the Variations header in the API documentation.

Dec 11, 2006

I was having a problem with one of the code paths through my RSS caching routines. This is a post to test that Google and a couple of other readers are working now.

<- Future Posts Past Posts ->


Site Links


All Posts