DK easter egg found

July 2nd, 2009

Don Hodges found the easter egg I put in Donkey Kong over 25 years ago.  His write-up is at:

 http://www.donhodges.com/donkey_kong_easter_egg.htm

I’m totally impressed.

And no, getting the easter egg to pop up still isn’t worth your time…. :-)

 

Chemistry unhinged

June 15th, 2009

Here’s a series of wonderful postlets on “Things [chemicals] I won’t work with.”  Link.  From stuff that smells very bad to things that like to explode in the dark; stinks and bangs for grown-ups (that is, if there /is/ any adult supervision in the chemistry biz, which I am beginning to doubt).

 

Dead Newt

June 13th, 2009

Once upon a time I had a prototype Newton that didn’t boot. The crash was occurring early enough that the screen was not initialized, and the debugger we usually used for low-level problems wasn’t usable. The audio chip was too complex to write to, and in fact there probably wasn’t physical memory available to safely do audio DMA. The serial port was out for some reason (I forget why. Hush now, don’t bug me, this is a story :-) ).

So I wrote some loops of ARM assembly language. The loops didn’t access any memory, didn’t print anything, and they didn’t exit, and didn’t cause any output lines to change. In fact, each of the loops was identical except for their length. I sprinkled them through the boot code and quickly (within about an hour) found the problem (some configuration of stuff in the flash store caused the Newt OS to hurl).

So how did the loops help?

This isn’t a Car Talk puzzler, so I’ll give you the answer right away: Each of the loops had a distinctive sound when I held an AM radio up to the Newton. There was a “high sounding” short loop and a “low sounding” longer one, and by stuffing these into various forks of the boot code I could trace the system’s progress and even shift some data out.

In retrospect I could also have:

- Asked a tech to solder an LED to a spare output line (I’m not sure if we had any, though. Output lines, I mean).

- Clicked the speaker by stuffing data into it (though this might have required setting up DMA and so forth) or maybe just turning its power on an off.

- Gritted my teeth and initialized the serial output on the Newton (this looked hairy to me, and while it probably would have taken longer, it would have given the team a way to debug boot issues later on, sans radio).

As they say: “Any stort in a porm.”  I also think that debugging with a radio was pretty cool.

My first computer

June 8th, 2009

How I got my first computer was like this.

—-

My grandfather was a tinkerer, inventor, high school science teacher and an enthusiastic ham radio operator. He loved gadgets. When I was a kid and we visited, I’d say a brief “Hi” to Grandma and make a beeline for Grandpa’s well-equipped basement shop. I’d come upstairs for meals and excursions to see other relatives in the area, but mostly I was mucking around in Grandpa’s basement (the collection of old Tom Swift books helped keep me down there, too).

Grandpa taught me about tools and loved to show off his latest gadgets (he was very fond of anything magnetic, especially electro-magnets, and always had a few around that he’d recently made or acquired). He was the guy in the neighborhood to see if your snow-blower was acting up, or if your garage door opener was out of commission. He loved radios in any form, and was not afraid of chemistry, carburetors or high voltage. I learned how to use a drill press, what Selsyn motors are, how to strip wire, and about a dozen uses for old baby food jars.

On one visit, when I was nine or ten years old, he tried to teach me Ohm’s Law. Some people constantly carry reminders of things important to them: pocket charms, key-chain trinkets, photos of family or the dog; /he/ carried little cards made of phenolic on which he had printed the various forms of Ohm’s Law. He was an Ohm’s Law freak.

I remember him saying, “This is the most important equation I know. E equals I times R.” And being in the third or fourth grade and completely lacking in algebra, I just did not get it. I did my best to fake understanding, but he was used to his students doing that.

“So, what’s E divided by R?” he demanded.

“Um, I?”

Whew. But the next couple questions I got wrong, and then I think he got a little more excited and started in on inductors, capacitors and reactance, and I was even more clueless. I just wanted to get back to the basement and curl up with some science fiction. My avuncular, wonderful tinker-Grandpa had acquired a serious and slightly scary aspect. Eventually the grilling ended, and I remember thinking that we each had disappointed the other. He gave me a little printed card with Ohm’s Law on it and had me promise to memorize it.

—-

Despite the Ohm’s Law Grandpa Impedance Mismatch, in fifth or sixth grade I started mucking around with electronics as a hobby, building a few things that worked and a lot more that didn’t; really just having fun. I put together some Heathkit projects (a power supply, a digital volt/ohm meter) and read things like the ARRL Handbook for fun. I had my own lab bench in the basement where I did equal amounts of mechanical tinkering, soldering, and making stinks and messes with a chemistry set (augmented with trips to the chemistry supply store at the local university, because even though this predated the true dumbing down of chemistry sets, they still hadn’t put anything truly interesting in mine). I was pretty much a geek, and school was about as much fun as you might imagine for a geek-with-glasses in the mid 1970s.

Electronics was fun, but computers were what fascinated me. I was inhaling science fiction; the main character in the Heinlein book Starman Jones worked with a computer, and The Moon is a Harsh Mistress was all about a really smart computer. I visited my Dad’s lab and played with the calculators and small computers they had there. I stared at Nixie tubes and tried to figure out how they worked.

The high school I was going to had a teletype (an old ASR-33, later upgraded to a faster 300 baud dot-matrix terminal) that dialed in to the school system’s PDP-10, but it was hard to get time on the system without being in a programming class. As a freshman I had no hope of getting “official” computer time for the next couple of years, and I had to sit by and watch the lucky, older students laboriously peck in their assignments: ka-chunk, ka-chunk, ka-CHUNKAchunkchunk… Teletypes really are glorious things when they really get moving. I wheedled some time on the terminal anyway; wrote a version of Life and a chess-move generator.

My parents bought me a Hewlett-Packard 25C programmable calculator. It had 49 steps of program memory, and I spent uncountable hours writing and stuffing programs into it. (My MasterMind game simply would not fit; weeks of clever hacks got it down to 51 steps, but no matter what I did I couldn’t squeeze it down to 49). My dad would sometimes bring home his HP-65 calculator from the office; the 65 had a little magnetic card reader, and I spent entire evenings programming it to run little games I’d written.

Then the January 1975 issue of Popular Electronics came out. It had a picture of the Altair 8800 on the cover, and I wanted one of those so badly I could taste it. When magazines like Byte and Kilobaud came out, I started buying those with my allowance rather than science fiction paperbacks. I scoured the ads in the back of the magazines for parts and made lists of the components I’d need to build a computer (but couldn’t afford). I got data sheets and data books (I don’t remember where) and started designing computers on paper. I memorized 7400-series chip pinouts and drew circuits in class. I found a manual for a SCELBI-8H, an 8008-based system, and it had ROM listings that I studied for weeks. I spent a summer designing an 8008-based CPU board of my own, all the way down to circuit board layouts, though I never actually built it. I knew I wanted to write my own version of BASIC, so I started by writing a floating point package; with a few hints I figured out things like normalization and strategies for doing multiple-precision operations.

A local calculator shop (they had those back then) started carrying computers: some rather cheesy ones from Southwest Technical (”SWTPC”) and the higher-quality “digital group” systems. The Z-80 was announced around this time, and I bought a programming manual for it. I got a part-time job at the local university helping one of my dad’s grad students with a project that involved shucking and carefully measuring literally tons of dried corn. I was actually saving money instead of blowing it on books.

I really, really wanted to program computers. But if you had asked me a simple question, “Why?,” I wouldn’t have been able to say. I was pretty much a teen-age geek basket case. It couldn’t have been pretty.

—-

2AM on Christmas morning, 1977. I snuck upstairs to see what was under the tree. Mom and Dad always put the “big” presents out after we kids went to bed, and they never wrapped them.

There was a package about two and half feet long, maybe eight inches wide and four deep, labeled “the digital group”. Holy shit. But that was weird; it wasn’t big enough to be a computer. Maybe the rest of it was elsewhere? Maybe they’d found a box and re-used it for (say) a sweater?

I went back downstairs and got in bed.

Then I snuck back upstairs again. Definitely part of a computer, not large enough to be the whole thing; maybe the rest was in the garage? I checked it out, peeked into corners and into the cars. Nada. I went back downstairs and couldn’t sleep.

In the morning, I found that my parents had bought me a ‘digital group’ computer system kit from that calculator shop. The first box was the keyboard; the rest of the parts came in installments as I assembled them, board-by-board over the next three months or so. All told the system cost about $1200. They’d agonized over this, but had seen me truly driven over the past couple of years. My dad, in particular, counseled me:

“Don’t get into computers just to do stuff with computers; it’s a dead end. Do something else and use the computers as a tool.”

I’m not entirely sure that was bad advice. The industry does tend to eat its children.

—-

I put the keyboard together in a few hours, and spent the remainder of Christmas vacation vibrating (the calculator store was closed over the holiday). An I/O board was next (a pretty easy soldering job). Then three 8K memory boards (each board about ten inches by eight, with two 4K banks of 1K-by-1-bit chips — that’s 64 chips for 8K of RAM). I took my time with all of the boards, making sure that each connection was soldered correctly, with no bridges or cold joints. When I took them to the dealer for testing (the dealer had a DG system they used to help customers with bring-up), all of these boards worked the first time.

I spent a week of evenings on the CPU board, carefully soldering each connection, taking conscious breaths between each one, examining every solder joint with a magnifying glass. I can still smell the solder and feel the warmth of the thin vertical trail of smoke on my nose. I wanted the board to be perfect. I dropped it off at the shop, and when I went back after school the next day the staff was impressed; the CPU board had also worked the first time — that was the first time they’d seen a customer-built CPU come right up.

“That board looked like it was made in the factory.”

Next, the video board. I was feeling cocky, rushed the work, and missed a solder bridge.

Their verdict: “Not as good as the last one. We were going to offer you a job building boards, but maybe not now.”

I was a bit disappointed, but I think I narrowly escaped a career as an electronics tech.

The cabinet, power supplies and monitor were last, and after making the last wiring connections and checking them I started the system bringup. First I borrowed Mom’s cassette tape recorder (the system booted from an OS on audio cassette — Mom never got to use that recorder again). I plugged in one board, applied power, checked for shorts and too-warm chips. Finally I turned off the power and let the fan slow to a stop. I carefully put the CPU card in its slot, and hit the power switch.

The monitor displayed:

Z - 8 0 R e a d I n i t i a l i z e C a s s e t t e

I put the OS tape in Mom’s cassette player and hit PLAY. The screen started filling with numbers as the simple monitor loaded each byte of the OS. Finally it displayed a menu. I could edit hex, or octal, or display memory, or tell the system to jump to a location and start executing.

I restarted the system, loaded up BASIC, and tried some simple programs. I’d last run these programs on the school district’s PDP-10, and now I was able to run them in my own bedroom, without worrying about whether some senior would kick me off the terminal so he could do a school assignment. My system was blazing fast, too; a teletype couldn’t compete with a video monitor.  I was the only kid in school who had his very own computer.  That was cool beyond imagining.
—-

When I was nine or ten years old, one of my chores was take our dog (a wonderful, soulful basset hound named Dook) out for a walk in the evening. Dook weighed about as much as I did. Rabbits were plentiful where we lived. I used to be very afraid that Dook would spot a rabbit on a walk, because he would get excited, start baying, and take off across a field, dragging me along behind.

One evening he did this and after getting a face full of grass I just let go of his leash. My Dad saw what happened and caught up with Dook in the woods. Dook had actually caught the rabbit. But . . . he looked up at Dad, paw on the poor little bunny, with an expression that looked a lot like “Now what?”

—-

I stared at the monitor thinking “Now what?”

Before I booted that system from cassette, I’d been a hardware guy, driven to make a bunch of chips and boards work. After the first menu came up, I was a software person. I wasn’t that interested in soldering any more. Over the next few years I would add some hardware to the system (a modem for getting on to Arpanet, a mass storage system that supported real files, rather than simple and manual audio cassettes), but I’d never build anything quite as large again.

I knew one thing now: Software was going to be harder.

A little more wisdom

May 24th, 2009

The longer it takes to fix a bug, the smaller the fix will be.

[I once spent two weeks finding a nasty bug in the Newton’s OS, which was manifested by a mysterious and well-nigh irreproducible scheduler freeze. The fix was to swap two instructions in a trap handler.

You’ll just have to take my word for this: I did the fix over then-Apple’s Xmas holiday week off. You had to get very-high-level-manager approval to work during this week, because they paid triple. The fact they were paying me lots more money had nothing to do with how long it took to find the problem. Honest.]

—-

Operating system people get no respect. All the hoopla and credit goes to the folks six APIs above your stuff, who move pixels around and make “ZIP-BOOM” noises while wasting cycles with horrible abandon. No one cares about the coal miners who pull those cycles out of the raw earth to begin with, it’s all about the actors using the light made by your coal.

Don’t forget that.  Do, and you’ll wind up unhappy.

Bitterness equals 1 over the number of levels you are above the hardware. This, of course, makes hardware people infinitely bitter, which exactly matches observation.

—-

“What we need in this company are more fat engineers with beards.”

(overheard)

 

50k

May 24th, 2009

50,000 pieces of blog spam.

(rant omitted)

Carry on.

 

Installer heck

May 4th, 2009

I started using Microsoft’s Visual C++ in 1993 when the 1.0 version came out; when version 1.5 was released, I was using it to develop products at a startup. One of the things that was interesting about VC++ then was the installer; compared to prior versions of the Microsoft tools, VC++ was a breeze to install. Visual C++ actually had an installer team; MSDN published an interview with the manager of the group. “The installation experience is very important.” They got it.

Fast-forward 15 years and installers are still important, but God damn it, they suck hard.

I’m not sure why this is. Correction, I have conflicting theories. The first is, most teams foist off the installer work to junior engineers; the kind of people who will actually believe that typing in 60 character case-sensitive unlock codes is a good thing. Then there are paranoid freaks who have the need to seal everything up behind product keys, feature enabler codes, license.txt files and (of course) physical dongles, just to get to the EULA. Put these two types in a room together and they’ll produce a Fort Knox-class installer for Notepad that nobody will be able to run.  The transistor blows to protect the fuse; the software blows to protect product support.

—-

Recently I had to download and install a package that had one of the craziest protection schemes I’ve ever seen. After clicking through the usual maze of agreements (”I accept” and “Okay fine, your company now owns my immortal soul”), the download page asked for the MAC address of my machine. Under separate cover, the site’s download manager emailed a license file that had to be placed into a very specific directory on my machine’s hard drive, whereupon the installer would run (instead of failing with messages like “00232-FATAL_LIC_NF”). The result? The installer unpacked a directory of source code. Obviously someone was told, “Protect this sample code at all costs,” and followed orders to the letter.

I promptly checked the stuff into source control. Problem solved. I wonder which corner of Hell I’m going to end up in?

Lucifer: “Listen up! Adulterers, follow the signs saying ‘Burning Tar Pits’. Money lenders and financial industry employees, you’re in the ‘Taco Bell’ line for the rest of eternity; pray you don’t reach the counter. And anyone who circumvented the spirit of a software license system –”

Me: “WHAT!?”

L: “… the Bubbling Acid Pits of Operating System Install Hell!.”

Me: “Wait, what about my other sins? Pride? Greed? And shit, I thought a lot about killing the guy who wrote the driver framework for –”

L (smiles evilly): “We’re gonna put you right next to Richard Stallman.”

Let us not talk about the installs from hell, where you hunt high and low for the 5996-qr3b-patch09_6_51a_.32 (but not 5996-qr3b-patch09_6_52b_.31). Eventually you find it buried on some web site (behind three username/password doors, each with different and conflicting rules for required and allowed password characters), start the download (apparently through a submarine line laid to the Antarctic and back, via the Panama canal) and discover that what you’ve downloaded is actually just a download manager for the next stage of the process. Which involves a physical trip to Sandusky, Ohio to prostrate yourself in the lobby of LoserSoft with a suitcase of cash and beg abjectly for a download key, followed by self-immolation. Gotta read the goddamn fine print on the EULA.

There was the memorable piece of Macintosh software that involved nearly fifty swaps of seven floppy disks. It. Took. A. While.

You want to know what my idea of the perfect installer is? A copy, from point A to point B. From the distribution disk (or a zip file) to some directory of my choosing. It used to be that a lot of Macintosh software worked this way (I don’t know if this practice continues). I know that most Window programs do not (don’t get me started on registry entries and use of complexified XML as a glorified substitute for .INI files).

Somewhere in this galaxy an advanced civilization has discovered the solution to all of this, and they are happily flitting around and not telling us what it is. But I suspect the reason we haven’t seen them is that their fleet of hyperdrive saucers is grounded until they discover how to install 5996-qr3b-patch09_6_51A_.33 (”Oh, Qualtar, I think that’s supposed to be a capital groknard, not a lower-case one…”)

Taking stock

May 3rd, 2009

“That’s three P-1 bugs this week, Bill.”

“Yes sir, I know.”

“All the managers had a meeting about it this morning. So . . . how do you want to do this? Go the HR route, or –”

“I’ll take the Yard.”

“You’re sure?”

“I talked it over with my family last night. Yes, I’m sure.”

“Right. Just between you and me, I’m happy you made that choice.”

“I don’t want to let the team down, with this final push. And all.”

“Okay, I’ll call security.”

—-

HugeSoft’s pillory is located on the main campus to one side of the famous soccer field, near the center line, on a little mound raised up and covered with grass. It is easily visible and strategic to one of the company’s largest cafeterias. There are no trees, and there is usually no shade until late afternoon. It is a point of debate whether a day on the mound is easier in warm weather, or during one of the frequent rainy days in the area where HugeSoft is located. Three posts are set in a line, about ten feet apart. Usually only one or two are occupied. During heavy ship cycles there are waiting lists.

You’re tied up most of the day. The stint starts around 8am. HR meticulously video tapes the entire ordeal, from the traditional walk past the CEO’s office to the finishing-up dunking ceremony in the fountains. Anyone can say a safe word and be released immediately, no questions asked. Only half a dozen people have done this. People are led to a post and loosely tied to it; water is at hand, and on hot days sun-screen is applied. If it gets over 80, it’s over. It’s not the Middle Ages or early Colonial America, it’s no picnic, but it’s also not a joke.

—-

Bob Kneeth is a Vice President. Sundar V. is a high-level engineer. Both of them have spent a day out in The Yard.

“You can easily have a bad month,” says Kneeth, “Everybody does now and then. You break the build a couple of times because you tried a shortcut and it backfired. Or you’re not getting enough sleep; that happens a lot. Then your boss and HR show up in your cubical, and frankly it’s kind of a relief.”

Sundar: “It’s really catharsis. If they wanted to get rid of you, they’d just fire your ass, and frankly that’d be a lot easier and cheaper. This tells the rest of company, ‘These guys, they fucked up. But they’re worth saving. Pay attention to what you do, because quality matters.’”

Kneeth (laughing): “The only really bad time is around lunch, when they throw stuff at you. HR’s there to make sure you don’t get hurt, and there are plenty of foam toys, but they can throw food at you if they want to.”

Sundar: “Mexican day is the worst.”

Kneeth: “Some people have allergies, and there are signs saying what you can toss.”

Sundar: “Yeah. I got off easy, because I’m vegan. One of my buddies is Jewish, and no one knew what the devil to toss at him because HR decided bagels were too hard.”

—-

In the engineering groups it is traditional to bring a change of clothes and pull an all-nighter after spending the day on the Yard. In the morning, HR comes by and all records of the event are erased. It didn’t happen.

“It’s both funny and not funny at all,” says an anonymous engineer. “It’s a serious quality thing, and if you’ve been out there more than twice you’re probably going to be out on the street after that. But everyone makes mistakes, and this is a way of acknowledging that we’re human, and that even serious mistakes can be forgiven.”

Wisdomlets

April 19th, 2009

I only have so many semicolons and curly-braces left in these fingers, and I’m wasting them on this?

—-

This is not God’s programming language.

This is not the Devil’s programming language, either.  Evil is too smart to be obvious.  If Evil had a programming language it would be sweet and seductive, leading you down the primrose path to perdition and just massive screwedness (huh: Name a successful product done in, say, Smalltalk).  C++ is not evil, rather, it is the language for masochists; it’s the kitty that purrs nicely to you until it’s earned your trust, and that’s when it turns into claws and utter batshit insanity.

—-

Every time you use #define, God kills a start-up.

—-

When you have an office move, destroy your extra move stickers, or you will wind up with extra junk (provided by thoughtful cow-orkers).

—-

I’m sorry about the Smalltalk crack.  It’s my favorite language (well, after LISP) that I’ll never ship a product in.  Wah.

 

Format /this/

March 27th, 2009

Once upon a time I wrote a formatter for a new hard disk drive product. I was young and impressionable, and had once lost a bunch of work when I accidentally wiped a disk, and so this utility was paranoid and asked if you were really sure, absolutely positively bloody sure that you wanted to format the disk, and it did this by prompting and forcing you type in the phrase, “Yes Mother, I really want to format the hard disk.” Verbatim. Including capital-M Mother and the dot at the end. I was young, and was a jerk.

It was an interim tool anyway, just a hack to get our disk prototypes off the ground. A couple months later I wrote a GUI-based formatter and that’s what shipped to end-users. I forgot about the earlier utility. Childish things, and all that. As far as I know, only a couple of people in the s/w development group had had to suffer through my sick little joke, and they did so with complete empathy. Everyone has lost data to some bright moment of utter stupidity. (Oh shit, did I really just type Y, return? Did I really not back anything up in the last week?)

About a year later one of my cow-orkers visited the Taiwanese factory where they made the drives, and he returned with a curious story. It turned out that the official GUI-based formatter had a bug, and it didn’t work on the very first format of some (low) percentage of the drives. We’d only had a few of the drives to work with, and “factory fresh” wasn’t a test case we’d been able to do much with.

But we didn’t even know it was a problem, because the ever-resourceful folks running the factory saved the day without telling us. Somehow they acquired a copy of the original command-line based formatter, which did work on the troublesome “fresh” drives. And so, on a couple of lab benches in a small re-work area, some workers had been given cue cards and had been taught to type in the phrase “Yes Mother, I really want to format the hard disk.” Capital-M for Mom, and a dot at the end.

I don’t know if the workers ever found out what the phrase meant. I’d like to think they’d laugh it off, but somehow I doubt it.