Musings
muse: to turn something over in the mind meditatively and often inconclusively
Visitors

Looking at my blog's cluster map it seems I've recently seen a bit of an increase in visitors from the US. In particular someone (or perhaps some group?) somewhere in Kansas (near as I can tell) seem to have become regulars.

So I took a look through my referrer logs to see if there was anything in there of interest. By far the majority of my visitors seem to arrive at my page directly. Either that or their browser is not setting HTTP_REFERER (yes it's misspelled, not one of the Internet community's finest moments).

The only trend of note is quite odd. It seems a lot of people end up here because they're searching for song lyrics. For some reason, just after posting them my song lyrics seem to end up on page one of a variety of search engines (most commonly MSN and Yahoo though) for searches involving those lyrics. It obviously doesn't last very long though. There's generally only a single entry in my log file for a given set of lyrics and repeating the search now doesn't bring this page up.

Odd little dynamic there. If I were more inclined I might look into how I could translate this into a little SEO.

Posted at 09:15 PM

Warp speed Mr Sulu

bikes_after_rooi_els_small.jpg
I'm by no means a speed freak. Nor would I consider myself an adrenaline junkie. I'm definitely still in possession of that little part of your brain that goes "wibble wibble" under duress, in the process distracting that other part of your brain that's responsible for hanging on to the contents of your bladder. In other words, toss me off a mountain unexpectedly and I will almost certainly wet my trousers and probably hit the bottom bawling like a three year old who's just watched her father run over CindyTM with the lawn mower.

But. The part of a ride I look forward to the most, by a large margin, is the bit where I get onto the first freeway, usually the M5 just a few minutes from here, and hit the hyperspace button. There's something delicious about going from 40 to 140 in no time at all and watching cars recede into the distance glowing slightly as they're redshifted.

Andy and I set off a little earlier today, largely because of time constraints but also to avoid some of the heavier traffic. We took a leisurely trip along the coast road, stopping in Hermanus for a bite to eat before swinging through Stanford and Caledon and turning back.

The weather was great, the roads quiet and I only experienced one heart-stopping moment. This is rare. Most of the time the local fauna seems hell bent on suicide and damned if they aren't going to take me with them. Just after turning off from Stanford I was coasting down a long hill and remembered that I'd filled up but forgotten to reset the trip meter. So I eased off and released the throttle so I could lean forward to reach it. The first thing I noticed that struck me as odd was that the fuel injection indicator light was on. Then I noticed the oil light. Finally I realised that I had, in fact, lost all power. "Odd" I thought, "I'm pretty sure it isn't supposed to do that". Certainly resetting the trip meter in the past had never required a reboot.

So I pulled off the road and came to a stop thinking that this was probably going to be expensive. It was at this point that I noticed the kill switch was in the off position. For those of you not blessed with a bike of your own this is a switch that normally sits on the throttle. It has to be in the on position before you can start the bike and it's called the kill switch because that's normally how you kill the engine. I must have flipped it off while reaching for the trip meter. I think perhaps in future I'll give that a miss.

The rest of the trip was uneventful. Lunatic Golf driver here, psychotic BMW driver there. The usual. Lots and lots of birds of prey out hunting. Mostly Jackal Buzzards and Steppe Buzzards but a fair number of Yellowbilled Kites and more Goshawks than I normally see.

All in all a pretty pleasant way to spend a Sunday morning. Highly recommended (in case that wasn't yet obvious).

Posted at 02:06 PM

Indiana Jones in New York

Another weird REM stage last night. My (anonymous) apprentice and I were led to an ancient, and secret, treaure in a large abandoned building in New York by a passage in the book of Jefferson, itself within the book of Revelations, and therefore in fact could more accurately be described as a sub-book.

That about sums it up. Or at least the bits I can remember.

Sometimes it's fun to go back through my dream entries and reread them. Some of them are so utterly bizarre they kind of put the rest of the Universe in perspective.

Posted at 02:09 PM

Odds (very) and ends (or braces)

This is probably going to be a bit of a random ramble. You have been warned.

To start with, an odd statistic. On the 21st of January when SourceForge started tracking statistics for RoX it was ranked 52,731 based on page visits. There are 111,389 registered projects at the moment, so right from word go with just a handful of visitors (me, me and me) it was already ahead of more than half of those projects. As of today it's ranked at 4,439. That's a pretty significant bit of climbing. The thing is, the absolute page hits aren't that impressive. They peak at around 40 visits on any given day with an average of around 15 hits a day. That's not a lot. So how did it go from 50,000 to 4,500?

This tells me that there are a lot of SF projects that aren't getting any visits. Not even from their owners. Which means they're probably dead. That's a lot of dead projects.

Moving swiftly along. I've been writing some more Ruby code this week and I've had a few minor revelations in the process. I stand firm by my conviction that a lot of the "cool" stuff people are raving about (and this applies to other languages too) are mostly write-time optimizations. They let you do more in less. But I think that's the wrong place to be focusing on optimizing. It doesn't help in the vast majority of cases to reduce writing-time, especially when it's usually at the expense of the next person who has to read that code.

And no, I don't buy the "it's a more natural way to express it". That's completely subjective and while some people have raved about it I find Ruby code in general to be pretty jarring. Yes, I admit I'm more comfortable in languages I know better, like Java or Python, but a lot of the constructs that are Ruby-esque just get up my nose. And frankly, I don't know that any language truly feels natural out of the starting gate. There's always that initial "help, I can't find my own arsehole" phase while you get to grips with the way the API hangs together, naming conventions and library structures. Hell I remember Java's whole package structure/classpath approach caused it's fair share of headaches to start with.

So I realise that I have some way to go before I can really evaluate Ruby objectively. I'm still spending morning's calling my left ear my arsehole only to discover that, well, it's not. As a result I try my best to cut Ruby some slack and take this into account.

That said, a few things have crystallized for me this week. The first of these is that in general generated API docs suck. This is language independent. I noticed it first with Ruby's API docs. They tend to suck quite badly. There's usually nothing more than a handful of examples and that's if you're lucky. And if a method has a description it's often less than useless.

But this is not limited to Ruby. Indeed, look over the JavaDocs for a given open source project and you'll see what I mean. Sparse leaps to mind (occasionally, so does self-mutilation).

But, it occurs to me that in a dynamically typed language poor API docs are a bit more of a kick in the googlies than in a statically typed language. Often just having a method name and the types it takes (and returns) gives you enough of a hint to battle through an undocumented API (sure API designers can make even this impossible but it takes skill to do that). And if you're blessed with a decent editor (or IDE) then you get autocompletion which means you can usually get through any reasonable API without referring to the docs too often.

In a dynamically typed language neither of these "crutches" are available so you're at the mercy of the docs unless you feel like wading through the source code. And generated docs for a dynamically typed (Java/C++ style OO) language pretty much tell you that class Foo has a method called bar. If it's decently done you'll get names of parameters as well. Now granted, in some cases this is enough information, but it's still less than you get in a statically typed language. This is not about which is better or worse. It's just an observation that in one case there's less information available so you tend to be a bit more at the mercy of the person documenting their code.

Another thing that has crystallized for me is the whole write-time optimization thing I mentioned earlier. I've felt this for a while but I'm just seeing more things that reinforce it. One of these is the ability to reopen classes in Ruby. Effectively this lets you muck about with the class definition. This has some really cool uses. For example, if you do your logging through a static Log class (so you don't have to pass log handles between objects) then when it comes to unit testing time you have no way of confirming that that logging is happening under the appropriate conditions. So what you want is a mock object that records what is called and that you can query after the fact. One option is to back the Log class with some sort of pluggable instance and plug in a different implementation for testing. A simpler way (in Ruby) is to simply reopen the Log class and just change the way it works.

This is pretty cool until you realise that there's nothing stopping any code from doing this. What this means is that you can't really trust a class's definition at any point in your code. But that's not really a huge issue for me. What really bugs me about class reopening is when people do it repeatedly through their library. The Ruby net/http library does this. They reopen one of their central classes about half a dozen times in their library, each time adding a little more to the class.

So getting an overall picture of the class requires reading through the entire library, just to make sure you haven't missed any "additions". Ideally this would be non-issue because your IDE would show you the "finished product". But that's a little difficult because it would basically have to execute your code to get to that point because if it's going to be accurate (and who wants an inaccurate tool?) it can't afford to ignore the fact that any bit of code pulled into the library may tweak the class. But it can't blindly execute your code because you might have all sorts of ghetto shit in there writing files and opening sockets and doing all sorts of things you'd rather not have happening arbitrarily.

At the end of the day reopening a class, while cool, is a bit of a write-time optimization. It makes the job of writing the code far simpler but I think you trade away too much in terms of the ability to understand code you just inherited (or wrote a few weeks ago).

But I'll plow on and see if getting familiar with the libraries (probably my biggest frustration at the moment) reduces the impact of any of this.

Posted at 11:38 PM

RoX released

I've been putting it off in the name of perfection but the cold hard truth of it is that software is never finished. It's just taken away from the programmer.

Since there's no one to take it away from me I've decided to just bite the bullet and put up version 0.1.

Posted at 11:38 PM

Some shade of blue

I'm in a bit of a weird place at the moment. Drifting describes it in part. Maybe floating would be better. Drifting suggests motion.

Some days it's like sitting a big, empty room. One with sprung wooden floors, the kind that only emphasize the silence you're disturbing when you move. Every now and then the silence is dusted with a melancholic hue.

Posted at 08:37 PM

Karate Chop!

A bizarre collection of events kept my synapses busy last night. At the core of it all though, was an evil genius who had me pinned down by a pair of his goons so his sushi chef could threaten menacingly to reduce my fingers by one.

Fortunately, unbeknownst to him, I was in fact Superman and was in fact perfectly safe.

There was a lot more, fantastic escapes on motorbikes, exploding buildings (oil refineries to be more precise) vast stretches of open African savanna. In fact I suspect last night's dream would have made a cracking action movie.

Posted at 08:20 AM

Google Talk

A simple idea with pretty interesting results. Type in the start of a sentence. It could be a question, the start of a statement, or some random words. Try the following out if you're not sure:

  • President Bush should
  • All programmers
  • It's fashionable
  • A man is defined
  • A woman is defined
  • The biggest threat
  • It only makes sense if



Google talk
a
Google Hack
by
Douwe Osinga

Posted at 10:33 PM

Tragedy

Saturday evening saw us celebrating a friend's 21st birthday. I heard today that one of the guys there that evening was killed in a car accident after leaving the party.

This tragedy really drives home the risks of driving under the influence of alcohol. I didn't know him very well but it's still a shock when something like this happens within your social periphery.

I imagine that right now a range of people are feeling like they should have stepped in and done something to prevent it. How strongly they feel this is probably directly related to how well they knew him.

This is a tough one. It's easy to walk down the path of "if only". If only someone had taken his keys away and driven him home. If only someone had convinced him to stay and perhaps sober up a little bit. If only ...

Unfortunately, while that might have put this tragedy off there's a pretty good chance it would have been only for a short while. Drinking and driving is endemic in this country. I'm as guilty as the next person and everyone I know has done it, although most of us have realised the error of our ways (to some degree). The sad truth is that this is one of those teach a man to fish cases. Stopping a person driving drunk once as often as not only delays the inevitable. Eventually your luck runs out. If you're fortunate you get caught and must deal with the law. If you're less fortunate you may leave a hole among the people you leave behind.

Posted at 09:02 PM

Useful software

I enjoy writing software most when it's useful. It gives me a warm glow to know that something I've created has made someone else's life easier, or even just a little more entertaining.

Newt is probably the best example (in fact it's also one of the few examples: almost everything I've written since then has been for The Man). I spent a few weeks here and there over a period of a couple of years at varsity writing it. The UCT Department of Mathematics and Applied Mathematics are using Newt in their first year course and over the past while it's been downloaded more often than I would have guessed, and had visits from unexpected quarters.

Someone in the US dropped me a note this week to ask if he could get a printed copy of the manual for Newt (or at least an electronic copy of the help more suited to printing than a Microsoft help file is). It seems he's using it to help his kids with their Maths, which was always the intention behind Newt.

I'm gearing up for a first release of RoX shortly. Hopefully it will make someone's life somewhere a little easier. At the very least we'll be using it internally for some of our XML-RPC comms. It's not quite a Newt, in the sense that it's a library and therefore intended for programmers and not end users. It's also (by definition) not visual. Even if someone doesn't understand or care about the Maths behind Newt it's pretty easy to plot a pretty 3D surface that anyone can appreciate.

Newt resulted in a lot more immediate satisfaction because of this but, truth be told, I prefer writing code for other programmer's. The problems tend to be more interesting (to me at least), and other programmer's tend to have a better idea of what's involved. The latter is both a blessing and a curse: only someone who understands what was involved can really appreciate it but if your approach (or implementation) is stupid or badly thought out they're generally pretty quick to point it out.

Posted at 03:22 PM

RoX in your headers

I finally got around to registering a SourceForge project for RoX, a little homegrown goodness I've been putting nights and weekends into for the past couple of weeks.

What is Rox? Glad you asked ;-) In a nutshell it's an XML-RPC implementation for Java backed by NIO for scalability in the face of large numbers of concurrent connections, and a combination of reflection and dynamic proxy goodness to provide a "natural" fit with your other Java code.

The project page goes into a bit more detail. I haven't put up the source code just yet because I'm still figuring out how to put all the bits together to make up a SourceForce project. I was hoping to use SVN but I just saw that it's still in beta on SF and so I may have to resort to using CVS. Or I'll hold out until SVN is available.

If you're absolutely desperate to get a copy and start playing drop me a note.

Posted at 11:44 PM

Back to the drawing board

Sigh. After some back and forthing around two of the components and their limitations, and after taking a second look at our requirements it's become apparent that the first thing I'm going to do in the morning is throw away a pile of code and start again.

This time round will be much (much) simpler but it still sucks a little to have to start again.

That coupled with some "interesting" (in the Chinese sense) news and a run in with a NIO race condition (logged in 2002 and as yet unfixed) in Sun's Linux implementation has left me feeling a tad bruised.

Sigh.

Posted at 08:04 PM

Tai ... ouch

Back to Tai Chi after a break. The last time I tried to stand on one leg and perform a control 180 degree rotation without (a) falling over or, (b) kicking the person next to me, was before Christmas.

There's nothing like chiropractor-needs-a-second-house followed by tiger-can't-move-in-the-morning to provide a little focus.

Posted at 08:23 PM

Chinese immigrants and Christmas rollercoasters

I think I reached a new level of detail in my dreams last night.

As a kid we occasionally spent time at relatives in one of the swankier parts of Joburg. Their place was huge and featured prominently in my dream last night. Except it was larger. A small peninsula in fact.

And it was Christmas day. Or at least I think it was. Frequently I feel like a little downtime. A chance to disconnect from people and noise and things. Again, this featured prominently last night. I remember spending much of the very dark, overcast day wandering what passed for the coastline. Wandering, in fact, through rows and rows of cars parked. I can only assume these were visitors.

At some point I stumbled across a small train (as I said, it was a large peninsula) only to find a Chinese immigrant and his son being forced off the train because of some misunderstanding about the ticket. He only had money left for one ticket and was trying to get to Kalk Bay with his son. So I dropped them off. This happened "out-of-band" because it didn't actually feature in the dream. I just knew I'd done it. Admittedly there was much additional evidence, mostly in the form of people who were upset with me for disappearing.

It ended (fade to black) with me and a bunch of people on a variant of one of those Pirate Ships you see in amusement parks. This one had the added benefit of a little lateral displacement thrown into the mix.

The last thing I remember being aware of was that a nearby physio thought this would be a good test of people's back muscles.

Posted at 09:29 AM

A three error correcting code

Oddly enough, three people who've had their mitts on my life at some point all share a birthday today.

Birthday wishes to all of you. I'm not sure which of you, if any, are still reading this page, but on the off chance you do I hope the day is filled with little fairy's carrying bags of gold, and that they're not the by-product of strong medication or too much alcohol.

Posted at 09:18 AM

Life, Religion, Homophobia

In the spirit of documenting some of the idiocy that surrounds us, here are two gems from the news today:

More than 300 Muslim pilgrims were killed in a stampeded during the annual Hajj pilgrimage in Mecca. Apparently, the stampede happened during the final phase of the Hajj, the symbolic stoning of the devil on the Jamarat Bridge. All I can imagine is that someone miscalculated, had the stone-throwers form a circle and nobody knew when to stop.

Seriously, when your religion places your life in peril, perhaps it's time to reconsider?

And in the UK yesterday a University student was arrested and hauled before the local magistrate court after he asked a local (presumably horse-mounted) policeman if he realised his horse was gay. The charges? Making homophobic remarks.

Maybe he was afraid the horse might make a pass at him?

Shite people. Get it together.

Posted at 10:20 PM

1000 year old spam

regal You shall look even sexier with a fashionable item. defend

Don't you hate it when spammers get medieval on your ass?

Posted at 09:36 AM

And another one's gone ...

Sheesh people. Within minutes (literally) of Rory and Tarin's news, Gary dropped me a note to say he and Bev are taking the plunge too.

Congrats, salutations, commiserations, whatever floats your boat!

It's probably a pretty practical trend though. At this rate there'll be no one left to go whoring with, which will probably help the wives to be sleep soundly at night.

Posted at 12:01 AM

And another one's down, and ...

Sheehs, it really is playing out like a song by Queen. They're falling like flies!

Congrats to Rory and his new owner Tarin.

Posted at 11:30 PM

7D6

Time marches inexorably on. I gave up long ago trying to live the Stuyvesant life. The fictitious world involving supermodels in bikini's driving through snow in a hummer with personalized plates that read "Powder".

New Year's has always been one of those evenings that just doesn't live up to the hype. Eventually you wise up and realise that the only way to spend it is quietly, with friends.

2006. Not a particularly auspicious number. At least not in base 16. Next year is a different story though: a palindromic hexadecimal number with the same last digit in bases 8, 10 and 16. Surely there's something deeply significant hidden in there? In truth, the latter is not a particularly amazing coincidence if you actually stop and think about it.

Time for bed. I'm lacking in the sleep department. I made the mistake earlier in the week of getting so annoyed by badly designed, implemented and documented code (specifically the Apache XML-RPC implementation) that I decided to rewrite it. After about 2 days work I'm almost finished the implementation.

It's been a week of disappointments on this front actually. You kind of wander around thinking that anything that pops out of the Apache pot must be at least half-decent. Unfortunately there are enough projects being incubated under that banner that plenty of them are pretty pathetic. I think they've gained such wide-spread acceptance only because they were the first 'working' implementation, even if they were awful. And the kinds of deadlines most of the software industry works to these days means that once something is working you kind of have to move on.

Pet peeves on this front at the moment:


  • Log4j: generally acceptable on the implementation front this has blurred the line between debugging and logging and since there's no way to switch it off, too often your users are faced with debug output written by a dyslexic moron. Worse by giving programmers something to put into their catch blocks it manages to play down the fact that an exception was raised and either needs to be handled or passed up to the caller. Logging it is not handling it.

  • Apache's XML-RPC implementation. Badly written. Almost entirely undocumented. Badly designed: static configuration methods on classes unrelated to the instance you're trying to configure?

  • Prevayler. Nice idea. The implementation even seems to work in the few cases I've tried it. But if you dig into the code there are (or were) some horrors: exception handling that results in infinite recursion and swallowed critical exceptions are two that spring to mind.

  • 90% of the Java DOM XML parser implementations. Either they're completely unusable or they work but the code is the documentation. Way too many Java programmers seem to think having raw JavaDoc generated HTML (sans any actual human generated comment) constitutes documentation.

But not all code sucks. If you need a decent Java SAX XML parser Piccolo is worth a look. And if you need a DOM equivalent take a peek at NanoXML.

This is rapidly heading into bitter-and-twisted so I'm going to leave it there.

Posted at 12:45 AM