« | » Main « | »

Damien Katz's Couch

Tuesday 31 August 2004

I've worked for twenty years as a software engineer, in corporate organizations of various sizes. By its nature, the work environment is imperfect. Too many things have to get done in too little time. You get compromises and disappointments from having more than one decision-maker. Chasing after customers, with their technological whims and superstitions, is frustrating.

So it is with great interest that I'll be following Damien Katz's progress. Damien is a good friend, and a great developer. I wish we were still working together. But he is off on a grand adventure: he's building a highly distributed file system called Couch. No one is paying him to do it, he's moving to a less expensive part of the country, living off savings, and figuring out the business aspects later. He's writing about the whole thing on his brand-new blog.

Damien is building his system for the pure pleasure of the building, and crossing his fingers that his family will be able to eat. (Actually, he's also available for contract work).

This sounds more dramatic than it is, but I feel a bit like a member of some software chain gang, watching as a fellow prisoner saws off his leg manacle and flees. Will he make it? Will his crazy plan work? I cheer for him, not only in the wild hope that he might succeed, but because if he does, it means others might be able to follow his example. Go, Damien, go!

George Lakoff dissects the war on terror

Monday 30 August 2004

Just in time for the Republican National Convention, esteemed linguistics professor George Lakoff talks about the way slogans frame the debates over policy: Linguistics professor George Lakoff dissects the "war on terror" and other conservative catchphrases. In particular, he faults the Democrats for letting Republicans choose memes through slogans, and not fighting fire with fire:

Conservatives have branded liberals, and the liberals let them get away with it: the "liberal elite," the "latte liberals," the "limousine liberals." The funny thing is that conservatives are the elite. The whole idea of conservative doctrine is that some people are better than others, that some people deserve more. To conservatives, if you're poor it's because you deserve it, you're not disciplined enough to get ahead. Conservative doctrine requires that there be an elite: the people who thrive in the free market have more money, and they should. Progressives say, "No, that's not fair. Maybe some should have more money, but no one should live in poverty. Everybody who works deserves to have a reasonable standard of living for their work." These are ideas that are progressive or liberal ideas, and progressives aren't getting them out there enough.

What progressives are promoting is not elite at all. Progressives ought to be talking about the conservative elite. They shouldn't be complaining about "tax cuts for the rich," they should be complaining about "tax cuts for the conservative elite," because that's who's getting them.

Let the games begin

Sunday 29 August 2004

Seems like some of the more interesting events at the Olympics weren't covered at all: Let The Games Begin:

"There’s a lot of sex going on. You get a lot of people who are in shape, and, you know, testosterone’s up and everybody’s attracted to everybody," says Breaux Greer, a shaggy-blond Californian who competed in the javelin at the Sydney Games.

Cleaning up after yourself

Friday 20 August 2004

I've long been an advocate of deleting code and letting go of the past, but don't leave mysterious garbage behind. Recently, a co-worker was removing some unneeded code. A certain class (let's call it COldThing) was obsolete, and all references to it had to go. He changed code that looked like this:

static bool bInitted = false;

if (!bInitted) {
    gpOldThing = new COldThing();
    bInitted = true;

to something that looked like this:

static bool bInitted = false;

if (!bInitted) {
    bInitted = true;

This is just inexcusable. Why leave the empty initialization logic? The only explanation is simple haste. I ran across this code while working in the file, and it took some digging to figure out why this no-op initialization logic was there.

I added a few paragraphs to Deleting Code about this.

MD5 collisions

Thursday 19 August 2004

Looks like the venerable MD5 cryptographic hash has developed a crack: A real MD5 collision. A team has published two different input streams which hash to the same MD5 value. Of course, because of the pigeonhole principle, everyone knew this had to happen. But no one had ever found a pair before.

Now that they have, researchers will be working on the question of whether it is feasible to compute, for any given input stream, a different stream with the same hash. If that happens, then MD5 is useless cryptographically, and a lot of infrastructure will have to be thrown out, but not before a bunch of bad stuff (like theft and fraud) happens.

Mark Pilgrim provides this Python program to demonstrate:

# see http://www.freedom-to-tinker.com/archives/000663.html

a = "\xd1\x31\xdd\x02\xc5\xe6\xee\xc4\x69\x3d\x9a\x06\x98\xaf\xf9\x5c" \
    "\x2f\xca\xb5\x87\x12\x46\x7e\xab\x40\x04\x58\x3e\xb8\xfb\x7f\x89" \
    "\x55\xad\x34\x06\x09\xf4\xb3\x02\x83\xe4\x88\x83\x25\x71\x41\x5a" \
    "\x08\x51\x25\xe8\xf7\xcd\xc9\x9f\xd9\x1d\xbd\xf2\x80\x37\x3c\x5b" \
    "\xd8\x82\x3e\x31\x56\x34\x8f\x5b\xae\x6d\xac\xd4\x36\xc9\x19\xc6" \
    "\xdd\x53\xe2\xb4\x87\xda\x03\xfd\x02\x39\x63\x06\xd2\x48\xcd\xa0" \
    "\xe9\x9f\x33\x42\x0f\x57\x7e\xe8\xce\x54\xb6\x70\x80\xa8\x0d\x1e" \

b = "\xd1\x31\xdd\x02\xc5\xe6\xee\xc4\x69\x3d\x9a\x06\x98\xaf\xf9\x5c" \
    "\x2f\xca\xb5\x07\x12\x46\x7e\xab\x40\x04\x58\x3e\xb8\xfb\x7f\x89" \
    "\x55\xad\x34\x06\x09\xf4\xb3\x02\x83\xe4\x88\x83\x25\xf1\x41\x5a" \
    "\x08\x51\x25\xe8\xf7\xcd\xc9\x9f\xd9\x1d\xbd\x72\x80\x37\x3c\x5b" \
    "\xd8\x82\x3e\x31\x56\x34\x8f\x5b\xae\x6d\xac\xd4\x36\xc9\x19\xc6" \
    "\xdd\x53\xe2\x34\x87\xda\x03\xfd\x02\x39\x63\x06\xd2\x48\xcd\xa0" \
    "\xe9\x9f\x33\x42\x0f\x57\x7e\xe8\xce\x54\xb6\x70\x80\x28\x0d\x1e" \

print a == b

from md5 import md5
print md5(a).hexdigest() == md5(b).hexdigest()

Running it prints:


Tile-based Flash game tutorial

Thursday 19 August 2004

Tony (I couldn't find his last name) has written a tutorial about writing tile-based games in Flash: Tile Based Games. It is a good introduction, with breezy (if slightly fractured) explanations of the code, taken in small steps, with playable demonstrations as you move along. My son finally understands arrays, I learned something about ActionScript's object model, everyone wins.

He also has a selection of his games for when you need a break from coding!

Juggling clubs

Monday 16 August 2004

I've long wanted a set of six good-quality juggling clubs, for the day when I've got someone to pass clubs with. Being a basically cheap person, I haven't invested in any. But I saw the Flying Karamazov Brothers last week. They are talented and funny, and they re-inspired me. At intermission, Ivan was chatting with the audience, and I asked him what clubs they used on stage. He said they were Dubé American clubs.

I ordered three to see if I liked them, and they arrived today. They seem very heavy to me. Does anyone have any experience with these? I've juggled with a friend's Dubé European clubs, and they are very nice, but more expensive, and fragile-seeming.

Conditions from hell

Friday 13 August 2004

I saw this in a chunk of code recently (the names have been changed to protect the guilty):

if (state == kActive ||
    // always allow invitation responses.
    isInviteResponse ||
    // ..(three-line comment that I couldn't understand)..
    ( (state == kUninvited || state == kInvited) &&
      ( opcode == kUninvite ||
        ( isOutgoing && opcode == kUpdate ) ) ) )
    // execute the command.

Um, right, whatever. Is that condition correct? Who can tell? I can't make sense of it. I would rewrite it with intermediate booleans like this:

» read more of: Conditions from hell... (2 paragraphs)

Code bloat

Friday 13 August 2004

Bob links to Jason Marshall's The Exponential Nature of Lines of Code:

There's more here than just a vague fuzzy warm feeling that the code is 'tight'. It means longer code-build-test cycles, more resource requirements from the code, and harder-to-solve optimization issues. Worst of all, replicated code means replicated bugs. It means developers are spending a lot of time doing the same work over and over again, with slightly different details. Slogging the same boring code over and over again is essentially menial labor, and is bad for morale.

Project management

Thursday 12 August 2004

Being a developer, my naturally preferred activity at work is writing code. To place things on a crude scale, after that comes designing the system, helping others get their work done, and last, project management. Project management is one of those necessary evils. No developer wants to think about it, very few of them are good at it, all chafe at the control imposed on them by it. But without it, all the rest is for nought.

Pete Lyons pointed to Max Widemans's voluminous resource on project management: Expert Project Management. I'm guessing there's some useful stuff in there, but it will take a more focused effort than I'm willing to give it right now to find it. There are so many pages that to my developer's eyes are about the same thing, that I don't know where to look for nuggets of wisdom. And too much of it feels like pseudo-science, like Those Sexy Triangles Again, about how to diagram the tradeoff between cost, quality, time, etc.

The death of orkut

Wednesday 11 August 2004

First I read on Bob Congdon's site about Orkut being taken over by Brazilians. There's nothing wrong with Brazilians outnumbering Americans, but they seem a bit too eager to join seemingly random groups: the Brookline Massachusetts group has 75 members, 7 of whom live in Brazil.

Then Adam Greenfield writes up what many have been thinking in Social networking sites: a postmortem:

Let's start with the indisputable fact that they introduce awkward social situations that did not otherwise exist, or were at least far less explicit.

In a few years, we'll all look back on this and laugh...

On static typing

Tuesday 10 August 2004

After a small project of mine was converted from Python to C#, I have a new-found admiration for Python's dynamic typing, and other cool features like named arguments in function calls. I have come to believe this about static typing:

Static typing prevents certain kinds of failures. Unfortunately, it also prevents certain kinds of successes.

On the utility of computer books

Thursday 5 August 2004

This made me smile. Charles Miller relates his first impressions of Dive Into Python. He says the book is the wrong size:

Unlike most computer books, it is far too light to be used as a weapon, and not thick enough to raise a monitor to eye-level. Nevertheless, it is not nearly thin enough to be used to prop up one leg of a wobbly table. I can only imagine this is a massive oversight on the part of the publisher, who should know by now what most computer books are really used for.

Given its complete uselessness for any other purpose, I may be forced to read it.


Thursday 5 August 2004

Over a year ago, I mentioned the idea of naming classes without 'Manager'. I said at the time that I liked the idea of using 'Wrangler' instead. Well, I finally went ahead and did it: CRetryWrangler was born. It has a nice alliterative ring to it. I figured I'd get a little grief from my co-developers about the whimsical name.

One of them asked me, "What's a wrangler?", and I told him it was a kind of cowboy who takes care of horses or something. He comes back later and informs me that is its second definition, but the first is:

An angry disputant; one who disputes with heat or peevishness.

Sure enough. Oh well. The name sticks. Maybe it's even more appropriate.

Pokia retro phone of the future

Thursday 5 August 2004

It had to happen. Pokia is some guy who makes old-fashioned corded handsets for cell phones. Now while you are talking on your swank new latest micro-sized, feature-packed cell phone, you can look like you are talking on a phone half a century older. He seems to be making them one at a time, and selling them on eBay, though he's had a lot of press, so it's only a matter of time before they become a mass-marketed item.

Cygwin argument handling?

Wednesday 4 August 2004

So, I love cygwin, because it gives me powerful Unix command line tools for my Windows machine. Thank you. I love it. But: would it kill them to accept -? as a request for help?

$ diff -?
diff: invalid option -- ?
diff: Try `diff --help' for more information.

Why? What would be so terrible about understanding dash-query? I type it every time I want help, and have to look at that stupid error message every time. Grr...

Id3reader.py, 1.5

Tuesday 3 August 2004

I've updated my Python module id3reader.py to version 1.5. It now supports genre information (although genres are stupid), and does a better job handling the vast variety of character encodings.

I feel kind of silly about this update, because I did the coding back in February. It took an email from a dissatisfied user before I realized that I had useful changes that I had not posted here. Mea culpa.

Failing infrastructure

Monday 2 August 2004

Today was just one of those days. All day at work was the kind of integration hell that comes when four developers all make big changes at once. We spent most of the day trying to grok each others changes to debug one problem after another.

And I found bugs in the parts of our code that were long thought completely flushed out: reference counting, exception messages, engine patterns, and so on. Then, to top things off, when I got home, the main waste pipe in my basement had sprung a leak and was soaking the floor!

Maybe tomorrow the things that are supposed to just work, will.

« | » Main « | »