Category: Geek


While trying to get my head together to write another post on atheism (because it’s the only thing that attracts attention to blogs apparently) I remembered a page I made a long, long time ago when I was new to this web development thing. I’ve always had a thing for Real Programmers; I respect the skill required back in the good old days of programming, when you actually had to understand how a computer worked before you could tell it what to do.

These days, you can be a programmer and not once in your entire career worry about op codes, memory addressing or garbage collection. If you have not at some point at least played with assembler, you are *not* are Real Programmer. If you have not read “The Art of Assembly Language Programming” or “IBM PC Assembly Language and Programming” you are *not* a Real Programmer. If you have never called an interrupt from a program, you are *not* a Real Programmer.

I don’t really consider myself a Real Programmer (I can’t program in FORTRAN for example and I often use interpreted languages like Python and PHP to do my job) but I love the idea of Real Programmers. I wish I was a Real Programmer, that I was around when the PDP6 was new and the IBM 704 was on it’s way out, being replaced by keyboard terminals. I guess, looking back, it is pretty cool that I was learning to program when the internet came into existence and that I know what a BBS is (and so do my parents, having paid the phone bills). Perhaps some new programmers will look at people like me and think something in the lines of ‘they used to do web programming with Perl and CGI on Redhad 1, heeeectic’. That would be cool.

If you want to know what a Real Programmer is, read “Hackers: Heroes of the Computer Revolution” (ISBN 0-385-19195-2) immediately.  When you start sleeping in the ceiling of a lab just to be close to your computer, you can be considered a Real Programmer. Another epic piece of Real Programmers literature can be read here (I’m pretty sure that’s where the whole Real Programmers affirmations series came from anyway): http://rixstep.com/2/2/20071015,00.shtml: Real Programmers Don’t Use Pascal.

In memory of all real programmers everywhere, I re-post The Story Of Mel to kick off my series of “Real programmer’ affirmations.

The Story of Mel

This was posted to Usenet by its author, Ed Nather (), on May 21, 1983.

A recent article devoted to the macho side of programming
made the bald and unvarnished statement:

Real Programmers write in FORTRAN.

Maybe they do now,
in this decadent era of
Lite beer, hand calculators, and “user-friendly” software
but back in the Good Old Days,
when the term “software” sounded funny
and Real Computers were made out of drums and vacuum tubes,
Real Programmers wrote in machine code.
Not FORTRAN. Not RATFOR. Not, even, assembly language.
Machine Code.
Raw, unadorned, inscrutable hexadecimal numbers.
Directly.

Lest a whole new generation of programmers
grow up in ignorance of this glorious past,
I feel duty-bound to describe,
as best I can through the generation gap,
how a Real Programmer wrote code.
I’ll call him Mel,
because that was his name.

I first met Mel when I went to work for Royal McBee Computer Corp.,
a now-defunct subsidiary of the typewriter company.
The firm manufactured the LGP-30,
a small, cheap (by the standards of the day)
drum-memory computer,
and had just started to manufacture
the RPC-4000, a much-improved,
bigger, better, faster — drum-memory computer.
Cores cost too much,
and weren’t here to stay, anyway.
(That’s why you haven’t heard of the company,
or the computer.)

I had been hired to write a FORTRAN compiler
for this new marvel and Mel was my guide to its wonders.
Mel didn’t approve of compilers.

“If a program can’t rewrite its own code”,
he asked, “what good is it?”

Mel had written,
in hexadecimal,
the most popular computer program the company owned.
It ran on the LGP-30
and played blackjack with potential customers
at computer shows.
Its effect was always dramatic.
The LGP-30 booth was packed at every show,
and the IBM salesmen stood around
talking to each other.
Whether or not this actually sold computers
was a question we never discussed.

Mel’s job was to re-write
the blackjack program for the RPC-4000.
(Port? What does that mean?)
The new computer had a one-plus-one
addressing scheme,
in which each machine instruction,
in addition to the operation code
and the address of the needed operand,
had a second address that indicated where, on the revolving drum,
the next instruction was located.

In modern parlance,
every single instruction was followed by a GO TO!
Put that in Pascal’s pipe and smoke it.

Mel loved the RPC-4000
because he could optimize his code:
that is, locate instructions on the drum
so that just as one finished its job,
the next would be just arriving at the “read head”
and available for immediate execution.
There was a program to do that job,
an “optimizing assembler”,
but Mel refused to use it.

“You never know where it’s going to put things”,
he explained, “so you’d have to use separate constants”.

It was a long time before I understood that remark.
Since Mel knew the numerical value
of every operation code,
and assigned his own drum addresses,
every instruction he wrote could also be considered
a numerical constant.
He could pick up an earlier “add” instruction, say,
and multiply by it,
if it had the right numeric value.
His code was not easy for someone else to modify.

I compared Mel’s hand-optimized programs
with the same code massaged by the optimizing assembler program,
and Mel’s always ran faster.
That was because the “top-down” method of program design
hadn’t been invented yet,
and Mel wouldn’t have used it anyway.
He wrote the innermost parts of his program loops first,
so they would get first choice
of the optimum address locations on the drum.
The optimizing assembler wasn’t smart enough to do it that way.

Mel never wrote time-delay loops, either,
even when the balky Flexowriter
required a delay between output characters to work right.
He just located instructions on the drum
so each successive one was just past the read head
when it was needed;
the drum had to execute another complete revolution
to find the next instruction.
He coined an unforgettable term for this procedure.
Although “optimum” is an absolute term,
like “unique”, it became common verbal practice
to make it relative:
“not quite optimum” or “less optimum”
or “not very optimum”.
Mel called the maximum time-delay locations
the “most pessimum”.

After he finished the blackjack program
and got it to run
(“Even the initializer is optimized”,
he said proudly),
he got a Change Request from the sales department.
The program used an elegant (optimized)
random number generator
to shuffle the “cards” and deal from the “deck”,
and some of the salesmen felt it was too fair,
since sometimes the customers lost.
They wanted Mel to modify the program
so, at the setting of a sense switch on the console,
they could change the odds and let the customer win.

Mel balked.
He felt this was patently dishonest,
which it was,
and that it impinged on his personal integrity as a programmer,
which it did,
so he refused to do it.
The Head Salesman talked to Mel,
as did the Big Boss and, at the boss’s urging,
a few Fellow Programmers.
Mel finally gave in and wrote the code,
but he got the test backwards,
and, when the sense switch was turned on,
the program would cheat, winning every time.
Mel was delighted with this,
claiming his subconscious was uncontrollably ethical,
and adamantly refused to fix it.

After Mel had left the company for greener pa$ture$,
the Big Boss asked me to look at the code
and see if I could find the test and reverse it.
Somewhat reluctantly, I agreed to look.
Tracking Mel’s code was a real adventure.

I have often felt that programming is an art form,
whose real value can only be appreciated
by another versed in the same arcane art;
there are lovely gems and brilliant coups
hidden from human view and admiration, sometimes forever,
by the very nature of the process.
You can learn a lot about an individual
just by reading through his code,
even in hexadecimal.
Mel was, I think, an unsung genius.

Perhaps my greatest shock came
when I found an innocent loop that had no test in it.
No test. None.
Common sense said it had to be a closed loop,
where the program would circle, forever, endlessly.
Program control passed right through it, however,
and safely out the other side.
It took me two weeks to figure it out.

The RPC-4000 computer had a really modern facility
called an index register.
It allowed the programmer to write a program loop
that used an indexed instruction inside;
each time through,
the number in the index register
was added to the address of that instruction,
so it would refer
to the next datum in a series.
He had only to increment the index register
each time through.
Mel never used it.

Instead, he would pull the instruction into a machine register,
add one to its address,
and store it back.
He would then execute the modified instruction
right from the register.
The loop was written so this additional execution time
was taken into account —
just as this instruction finished,
the next one was right under the drum’s read head,
ready to go.
But the loop had no test in it.

The vital clue came when I noticed
the index register bit,
the bit that lay between the address
and the operation code in the instruction word,
was turned on —
yet Mel never used the index register,
leaving it zero all the time.
When the light went on it nearly blinded me.

He had located the data he was working on
near the top of memory —
the largest locations the instructions could address —
so, after the last datum was handled,
incrementing the instruction address
would make it overflow.
The carry would add one to the
operation code, changing it to the next one in the instruction set:
a jump instruction.
Sure enough, the next program instruction was
in address location zero,
and the program went happily on its way.

I haven’t kept in touch with Mel,
so I don’t know if he ever gave in to the flood of
change that has washed over programming techniques
since those long-gone days.
I like to think he didn’t.
In any event,
I was impressed enough that I quit looking for the
offending test,
telling the Big Boss I couldn’t find it.
He didn’t seem surprised.

When I left the company,
the blackjack program would still cheat
if you turned on the right sense switch,
and I think that’s how it should be.
I didn’t feel comfortable
hacking up the code of a Real Programmer.

This is one of hackerdom’s great heroic epics, free verse or no. In a few spare images it captures more about the esthetics and psychology of hacking than all the scholarly volumes on the subject put together. (But for an opposing point of view, see the entry for Real Programmer.)

[1992 postscript — the author writes: “The original submission to the net was not in free verse, nor any approximation to it — it was straight prose style, in non-justified paragraphs. In bouncing around the net it apparently got modified into the ‘free verse' form now popular. In other words, it got hacked on the net. That seems appropriate, somehow.” The author adds that he likes the ‘free-verse' version better than his prose original...]

[1999 update: Mel's last name is now known. The manual for the LGP-30 refers to “Mel Kaye of Royal McBee who did the bulk of the programming [...] of the ACT 1 system”.]

[2001: The Royal McBee LPG-30 turns out to have one other claim to fame. It turns out that meteorologist Edward Lorenz was doing weather simulations on an LGP-30 when, in 1961, he discovered the “Butterfly Effect” and computational chaos. This seems, somehow, appropriate.]

[2002: A copy of the programming manual for the LGP-30 lives at http://ed-thelen.org/comp-hist/lgp-30-man.html]

If you are a Real Programmer or have worked with a Real Programmer I would love to hear your war stories and of your heroic programming feats of greatness,  especially if I can re-post them with my Real Programmers series.

I used to work with a Real Programmer, Clive, the only person I consider to have been a mentor in my programming career. He used to program RPL on punch cards back in the day. When I picture Mel above, I think of Clive, who I will probably feature in some upcoming posts.

When correctly reared spitting at a human is a rare thing. Llamas are very social herd animals, however, and do sometimes spit at each other as a way of disciplining lower-ranked llamas in the herd. A llama’s social rank in a herd is never static.

Google Nexus One – GMail

This post was re-posted from the Official Gmail Blog:

Posted by Anna de Paula Hanika, Android Product Marketing Manager

Not only does the just-announced Nexus One have a beautiful display, snappy processor, and five megapixel camera complete with flash and geotagging, but you can also buy it online with or without a service plan. Plus, it runs Android 2.1, which adds a couple of new features to the native Gmail application:

  • Quick contact badge: Press the contact status icon within Gmail, and a handy box shows all of the ways you can reply to a contact — including email, chat, SMS, and Facebook.
  • Voice input: Swipe the keyboard, then just speak to select contacts or write an email, complete with punctuation. Period!

Nexus One also features the Gmail updates of Android 2.0, including:

  • Multiple Gmail accounts: Sync multiple accounts to the same device and switch between them without leaving the app.
  • Undo: A handy ‘undo’ link makes it easier to retrieve messages when you hit archive or delete by mistake. (Note: you can’t yet undo send as you can with the desktop version of Gmail).

For more information on Nexus One visit google.com/phone. To learn more about Gmail on this and other Android devices, check out the Gmail page on mobile.google.com/android, or watch this video:

Read the original article here

It’s quite amuzing (which is to say, I almost cracked a smile):

Originally from: http://news.nexus-one.co.uk/post/334453516/a-review-of-the-nexus-one-from-an-iphone-user-as

Ich, bin, ein, Nerd!

But first, let us establish the exact extent of the Nerdity:

I was thinking about starting a series of posts on programming an evolution simulator, about how I am going to go about it this time (I’ve started a couple of times but some of the details eluded me in the past). But then my ThinkGeek order arrived and now I can’t concentrate properly on what I wanted to write about before, my mind clouded with the geekly awesome currently in the air.

So, I’m going to show off the Nerd!(tm) gear that arrived today instead.

The shirts I got for myself (ok, I may have gone a bit overboard, but that is entirely besides the point):

Go away or I will replace you a small shell script

http://www.thinkgeek.com/tshirts-apparel/unisex/frustrations/374d/

Do or Do Not

http://www.thinkgeek.com/tshirts-apparel/unisex/itdepartment/9e4a/

user error

http://www.thinkgeek.com/tshirts-apparel/unisex/frustrations/59fe/

Killer Coding Ninja Monkeys

http://www.thinkgeek.com/tshirts-apparel/unisex/itdepartment/5e89/

Arrgh

http://www.thinkgeek.com/tshirts-apparel/unisex/generic/7666/

You are dumb v2.0

http://www.thinkgeek.com/tshirts-apparel/unisex/generic/38db/

And for my wife:

GeeKISSexy Babydoll Tee

http://www.thinkgeek.com/tshirts-apparel/womens/5c8f/

Geek Love Poem Babydoll

http://www.thinkgeek.com/tshirts-apparel/womens/724f/

Pixel Angel

http://www.thinkgeek.com/tshirts-apparel/womens/ccb7/

Can you feel the awesome? Can you? No doubt that you can.

Many sheep and goat producers indicate a special bond quickly develops between lambs and their guard llama and that the llama is particularly protective of the lambs. Guard Llamas. Cool.

I need a new phone but which one

I had an iPhone 3G not too long ago and it was great. I was then forced to part with it and I have missed it sorely since. I have been using a really crappy Sony Eriksson since that sad day and it’s getting to the point now where that has to change.

There are, in my mind, 3 realistic options at moment (or there will be soon anyway): the Apple iPhone 3GS, the Google Nexus One and the Nokia N900.

Since I had an iPhone before, which I loved, quite frankly, I know I won’t be disappointed. I have two gripes with it: it’s insanely expensive here and I don’t have a Mac to develop software for it on. And I have no plans for acquiring a Mac any time soon. It’s not a train smash but I do like the tinker sometimes. The technical specs are pretty good, 844 MHz CPU, 256 Mb RAM, 7.2 Mb HSDPA, 3 mega pixel camera.

I’ve been waiting for proper news on the Google Nexus One for a while now and from what I have seen, it looks to be an excellent phone. I don’t personally know anybody that has one yet, so all I have to go on so far are reviews. The technical specs for it look great, to be honest: 1 GHz CPU, 800 x 480 screen, 5 mega pixel camera, 512 Mb RAM and 7.2 Mb HSDPA. This is all good, all, good.

The Nokia N900 from Nokia is interesting, it has an actual keyboard. My experience with the iPhone was that an on-screen keyboard is passable until you have an SSH terminal open and are trying to work. At that point, it gets a bit painful. I am a bit worried at the quality of Nokia phones lately, my wife has had many issues with her E71. From a spec point of view it seems ok, 800 x 480 display, 256 Mb RAM, 600 MHz CPU with graphics accelerator, 7.2 Mb HSDPA.

What is causing me to think about the situation is that both Nokia’s S60 and Google’s Android have Python support. I have recently started programming in Python and are loving it very much. Objective C, on the other hand, I have had an unpleasant encounter with, which doesn’t matter since I don’t plan on buying a Mac any time soon. If I were to be given one, on the other hand…

The Nexus One isn’t available here yet but I can already see that the price for it will be somewhat lower than the iPhone and will, it seems, be available unlocked by default.

On pure specs then, and programming language support, the Nexus One would beat the iPhone in my books and I am a Google fanboy, no doubt about that.  The problem is I don’t know how well the Android OS stacks up against the iPhone OS – which is excellent.

What I really need is to find me somebody who owns an iPhone and now a Nexus One. If you happen to be in that situation, let me know, I would love to know what your experience with them are.

Like humans, llama males and females mature sexually at different rates. Females reach puberty at approximately 12 months.

So I bought a bunch of T-Shirts from ThinkGeek, smothered in awesome goodness. They weren’t cheap but it didn’t break the bank either. A T-Shirt is a T-Shirt (unless you’re one of those Ed Hardy wearing people, not awesome). After you add delivery to the order, them shirts start getting expensive but, you think to yourself, it’s ok, what’s a couple extra bucks for the geekly goodness? Right? Right.

Then, DHL phone you.

Did you know, for example, that one has to pay 45% import duty on a shirt. I, shit, you, not. I’m furious. Those filthy, back stabbing, thieving, cold hearted, communist bastards at customs are charging me 45% import duty on my order. To put it into perspective, including shipping, my total order for 7 T-Shirts came to R1505. I now need to cough up an EXTRA R827 for import duties and VAT because it’s a bunch of T-Shirts. For clothing, apparently, the government gang rapes one to, well, I’m not sure why. Possibly because they feel one needs to be gang raped as part of being a South African citizen to properly appreciate why one should buy local goods.

For the perspective part: I bought a Kindle and including shipping, VAT and estimated import duties, it came to R2700. Amazon then refunded me R500 from that which means the Kindle ended up costing only R2200 which is cheaper than the T-Shirts.

What kind of fuckery is this?

The gestation period of a llama is 11 1/2 months (350 days).

ThinkGeek is made of win

I love shopping at ThinkGeek and I’ve shopped there many times before. My wife literally has to hold me back from bankrupting us on that site, such is the level of my geek.

Some of the stuff I have had those guys send me include (but are not limited to):

When I started this post I had no intention of saying anything other than ThinkGeek is made of win but I realise now that it sounds more like an advert than a blog post.

Well, it’s meant to be an advert, in so far as that I personally think ThinkGeek is great and that everybody should buy from them. I did. Today. A whole *bunch* of T-Shirts, much to the dismay of my wife, who is now much poorer in cash but much richer in geek awesomeness (yes, I bought her some also).

ThinkGeek does not (yet) sell any llama apparel.

Follow

Get every new post delivered to your Inbox.

Join 89 other followers