Saturday, October 04, 2003

Debugging

Philip K Dick's A Scanner Darkly tells about a drug,
substance-D. Long-term use causes permanent brain damage by
gradually disconneting the left and the right hemisphere. After the
damage has taken place to maximal extent, the user may recover enough
to do manual farming labor, but not much more.

In a scene, a group of addicts is inspecting a bike. They were told
it has ten gears, but they only see seven: two in the front
and five in the back. Only after they ask a random man-in-the-street
they find out the obvious logic behind the equation.

Debugging sometimes throws you to a similar mood, especially at
the end of the day, when you're tired. Nothing you do seems to have
much effect on the bug. After hours of forking, data logging and
minimal changes, you may find out that the reason was very simple indeed
- some file was missing, etc. - and you've had exactly the same error
before, and it produced exactly the same effect. But still, you just
couldn't connect the dots between the cause and the consequence.

Barris: (Standing in the middle of the living room with a great new
big shiny bike, very pleased)
Look what I got for twenty dollars!

Freck: What is it?

Barris: A bike, a ten-speed racing bike, virtually brand new. I saw it
in the neighbour's yard and asked about it and they had four of them
so I made an offer of twenty dollars cash and they sold it to me.
Colored people. They even hoisted it over the fence for me.

Luckman: I didn't know you could get a ten-speed nearly new for twenty
dollars. It's amazing what you can get for twenty dollars.

Donna: It resembles the one the chick across the street to me and got
ripped off about a month ago. They probably ripped it off, those
black guys.

Arctor: Sure they did, if they got four. And selling it that cheap.

Barris: It's a man's bike, so it can't be.

Freck: Why do you say it has ten speeds when it only has seven gears?

Barris: (Astonished) What?

Freck: (Going over to bike and pointing) Look, five gears here
and two gears here at the other end of the chain. Five and two makes
seven. So it's only a seven-speed bike.

Luckman: Yeah, but even a seven-speed racing bike is worth twenty
dollars. He still got a good buy.

Barris: Those colored people told me it was ten speeds. It's a rip-off.
(Everyone gathers to examine the bike. They count the gears again
and again.)


Freck: Now I count eight. Two in front, six in back. That makes eight.
Arctor: But it should be ten. There are no seven-speed or eight-speed
bikes. Not that I ever heard of. What do you suppose happened to the
missing gears?

Barris: Those colored people must have been working on it, taking it
apart with improper tools and no technical knownledge, and when they
reassembled it they left three gears lying on the floor of their garage.
They're probably still lying there.

Luckman: Then we should go ask for the missing gears back. If we all go
together they will give them to us; you can bet on it, man. We'll all
go, right? (Looking around for agreement)

Donna: Are you positive there's only seven gears?

Freck: Eight.

Donna: Seven, eight. Anyhow, I mean, before you go over there, ask
somebody. I mean, it doesn't look to me like they've done anything to it,
like taking it apart. Before you go over there and lay heavy shit on
them, find out. can you dig it?

Arctor: She's right.

Luckmann: Who should we ask? Who do we know that's an authority on
racing bikes?

Freck: Let's ask the first person we see. Let's wheel it out the door,
and when some freak comes along we'll ask him. That way we'll get a
disheartened viewpoint.


(They collectively wheel the bike out and encounter a black man
wheeling his car. They point out to it's seven - eight? - gears and
ask how many there are, altought they can see - except for the poor
Charles Freck - that there are only seven. They can ascertan it
with their own eyes. What's going on?)


Young black man: (Calmly) What you have to do is multiply
the number of gears in front by the number in the rear. It is not an
adding but a multiplying, because, you see, the chain leaps across from
gears to gear, and in terms of gear ratios you obtain five times one of
the two in front, which gives you one times five, which is five, and
then when you shift this lever on the handle-bar the chain jumps to
the other one of the two in front and interacts with the same five
in the back all over again, which is an additional five. The addition
involved is five plus five, which is ten. Do you se how that works?


(They thank him and silently wheel the bike back inside. The black
man goes on locking up, and they close the front door of the house
and just stand there.)


Luckman: Anybody got any dope? "Where there's dope there's hope."

No comments: