Joel is smart

Stumbled across this excellent article at Joel on Software today, via some tangential web surfing. (No relation to tantric web surfing)

I’ve been reading a lot of code lately, and I totally agree with him when he says “It’s harder to read code than to write it”. He argues that this is why programmers so often rewrite things rather than extend or even fork an existing implementation.

Of more interest to me, because as ambitious as I am, I’m not about to write my own kernel, are his comments on reading people’s code:

I think the best way to read somebody else’s code is just to SLOW DOWN… it’s like deciphering a code, not like reading.

Most people have trouble reading code because their eyes are used to reading at a certain speed from reading text written in human languages. But code is much more dense than English, and contains ‘secrets’ that need to be deciphered by looking elsewhere: for example, when you see that function call that says UpdateData(FALSE), unless you remember how UpdateData() works, you have to go look for it to figure out what the first argument is and what FALSE means.

My emphasis

Posted by mike on Tuesday February 22nd, 2005, tagged with , | comments disabled

Also Scrobbled

I wrote before about amarok and how cool it is. At the time I was holding off judgement on the audioscrobbler integration.

As it turns out Jeremy has beaten me to it.

So far I think it’s pretty sweet, and looks promising as a way of discovering new music.

Amarok provides the “Now Playing” image on the sidebar of this page, and if you click it you’ll be taken to my audioscrobbler page which displays what I’ve been listening to.

For the tin-foil hat brigade their privacy policy looks pretty solid, to sign up all you need is a username, everything else is optional.

Posted by mike on Monday February 21st, 2005, tagged with , | comments disabled

Kernel Monkey

I spent most of last week chasing a bug in the as yet unreleased 2.6.11 kernel. I hit it originally while testing some code I’ve been writing to implement a mem=X boot-time option. After 2-3 hours of running LTP the box would drop into xmon.

Just for fun it would rarely crash in the same spot, the only commonality was that we’d generally have some registers full of random bollocks, and on further investigation we’d have a page or two of bollocks as well.

Although we had our suspicions as to which patch might have introduced the bug we still needed to tie it down. So I found my self running the test on everything from 2.6.10-bk1 to 2.6.11-rc4, I haven’t counted but that’s something like 30 different kernels.

I’m sure anyone who’s done any sort of decent testing knows all of what I’m about to say, but for me it was new, and so I’m gonna write it down here so google can keep track of it for me.

  • Compile all your kernels on one box, not one of the boxes you’re trying to crash.
  • Make a directory where all your kernels go.
  • Always name the directory a kernel’s in the same as the kernel’s name.
  • If you patch a kernel, change its name, eg: 2.6.11-rc4-with-bens-fixes
  • Keep a record of which kernel is running on which box, when it crashes you may not be able to check.
  • Having said that, if you’re in xmon you can usually check with:
    1:mon> ls linux_banner
    linux_banner: c000000000443d20
    1:mon> dm c000000000443d20
    c000000000443d20 4c696e7578207665 7273696f6e20322e  |Linux version 2.|
    c000000000443d30 362e31312d726334 2d6d69636861656c  |6.11-rc4-michael|
    c000000000443d40 20286d6963686165 6c40737570657265  | (michael@supere|
    c000000000443d50 676f292028676363 2076657273696f6e  |go) (gcc version|

    Although this bug had a habit of corrupting the page holding the banner so then you’re stuffed.

  • Keep a test matrix. It doesn’t have to be tied into your project schedule, or have key milestones and review points, just keep track of which kernel worked/broke on which machine, it’ll keep you sane.
  • It’s also handy to record what you expect each kernel to do. Otherwise you might find yourself inappropriately excited when a kernel doesn’t crash – ie. when it doesn’t have the suspect code and therefore shouldn’t crash.
  • Script it, within reason. You don’t want to spend 3 hours testing the wrong kernel ’cause you copied the wrong zImage into /tftpboot or something.
  • If you’re applying more than one or two patches you need quilt or something similar, otherwise you will get confused (well I did!)

Posted by mike on Saturday February 19th, 2005, tagged with , | comments disabled

Yonic Mutton

On the way back from Woodford, Jess, Catherine, Tom and I started to reengage the analytical side of our brains.

This led to a whole bunch of questions coming up, none of which we really answered very satisfactorily, despite much discussion.

Jess had a few days off when we got back, so she did some heavy googling and came up with answers to a number of the BIG questions. I notice she didn’t come with anything explaining why girls suxes and boys rool, but I’m sure she tried.

Check it out.

Posted by mike on Friday February 11th, 2005, tagged with , | comments disabled

Bullet Proof Bike Racks

Chris describes how some “enterprising individual” made up for the lack of bike racks at the Australian War Memorial.

Apparently Security weren’t too pleased and the next photo in the series involves some rubber gloves, ouch!

Posted by mike on Tuesday February 8th, 2005, tagged with , | comments disabled

Mt Majura

Yesterday evening I decided I needed some exercise so I tried to ride up Mt Majura. Having never been up there before I just sort of headed .. up. Turns out the track is rather direct, ie. it goes straight up the hill for about 2 kms at a 30 degree angle. I got maybe 500m up in 1st gear before I hit a big rock and stopped, and as soon as you lose momentum you’re stuffed.

After a fair bit of walking I got to the top, which was worth it. Great views, especially east towards the coast.

I fanged down the bitumen, foolishly thinking it would take me towards Hackett or Downer. But of course the road comes out on Majura Rd, out behind the airport. So I then had about a 10km ride along the highway back home, which was daunting at first but was actually quite pleasant.

Then I popped back home for a quick shower before riding over to All Bar for some pints with Catherine, Ben and Tom.

Posted by mike on Monday February 7th, 2005, tagged with , , | comments disabled

amaroK Rocks

Urgh, did I have to do the awful pun in the title!

The other day I discovered the greatest music playing app in the entire world. It’s called amaroK, yes with a K, and it’s cool.

It has a great Wizard when you first run it that loads all your music and indexes it and so on. It uses an SQL lite DB in the back which means it doesn’t take forever to load like Juk does (’cause it’s scanning all your oggs).

I particularly like the “100 Random Songs” button, and the “Least listened to”, “Most listened to” etc. Even though I have 5 days worth of non-stop music sometimes I just can’t think of anything I really want to listen to. The random playlist is nice cause it just gets some music going and then you find something that fits your mood.

Did I mention it fetches cover art from Amazon? And Lyrics. And it can upload to Audio Scrobbler which uses the music you listen to to find other music you might like (and has a very good privacy policy).

Tops.

Posted by mike on Sunday February 6th, 2005, tagged with , | comments disabled

Sunday Sunrise

Yesterday arvo Tom and I headed up to Square Rock for a quick hike. It’s probably only 5 kms walk, which isn’t far, but given that we only decided to go for a hike at about 3pm it was far enough. We walked over to Square Rock around sunset, but we ended up camping on the other side of the ridge, looking over Orroral valley.

I wanted to try out sleeping under just a little green fly, the idea being to be able to travel lighter. It was a resounding sucesss, although if it had rained I might be telling a different story. It had the pleasant side effect that I woke up well before the sunrise.

It was remarkably cold for Februrary, although I was sleeping outside at 1450 metres. It warmed up a bit about 10am. After a seriously solid breakfast of muesli we strolled back down to the car. And I was home Northside by 1pm, with plenty of Sunday to spare.

photo View the photos »

Posted by mike on Saturday February 5th, 2005, tagged with , , , | comments disabled

Be my Waif

Spent last night at Tilley’s in the company of the Waifs. They were typically awesome, and owing to the venue I think I’d have to rate it one of my favourite concerts for a while.

The crowd was enthused which was cool, I think we managed four encores. They’re playing at the Canberra Theatre again tonight, so if you weren’t there last night get some tickets fast!

Posted by mike on Friday February 4th, 2005, tagged with | comments disabled