Tuesday, March 31, 2009


My wife and I are expecting our third child around the end of September. Odd thing about pregnancy: mommy urinates about fifty-seven jillion times a day.

I didn't sleep well tonight—despite having the kids and the dog in bed by 9:15! I woke up after midnight for no particular reason, and then I woke up a couple of hours later when Sam got up to go the bathroom. Going back to sleep again was not an option—unlike Sam whose breathing had already returned to deep and rhythmic—because my brain was in high gear thinking about technical issues at work, side projects, et alia.

Among the others was an untestable hypothesis: maybe having to wee in the wee hours is gentle preparation for the grueling six-week hazing period that is caring for a newborn.

Saturday, March 28, 2009


Sam and I were walking around in a dark, twisty hall. I had a flashlight but was having trouble keeping up with her. When I caught up (seems as though we were in an elevator), she told me she'd been evading me and planning to leave me in this place where no one would find me.

Such disturbing dream-moments jolt me awake. I sat up in bed, and Sam was sitting there with the lamp on. She asked what was wrong, and I told her about the dream. I don't remember going back to sleep.

I woke up this morning and realized I must have dreamed that I was dreaming.

Saturday, March 21, 2009

Digest tag population

In comp.lang.lisp, Ken Tilton relayed a fun exercise involving a two-tiered list of pet populations, selections, and an unusual sort order. He proposed it as a test of language mastery because of his requirement to write "in one go" a single-function solution.

This style of development would be highly unusual with Lisp. Having the whole language available at an interactive read-eval-print loop promotes an incremental, bottom-up approach. As Paul Graham explains, bottom-up design in Lisp is more than building up a library: experienced programmers modify the language itself to make expressing the problem more straightforward.

I wrote a solution in Haskell: Aspects need improvement. The name of the type-synonym PetTags is plural, which is often better expressed as a list type, e.g., [PetTag]. The sort comparison functions (used on lines 39 and 40) are inconsistent in expression. The definition feels clunky and verbose.

In comp.lang.haskell, Florian Kreidler made my code much more elegant:

A more natural Haskell development style would be writing a function, checking it for correctness, and repeating in tiny increments. In the code below, I first wrote flatten, then I wrote select to extract the desired animals, followed by largest to extract the top n by population, and finally I wove them together to create digestTagPopulation.

(Github has a feature request for embedding particular revisions of gists. That would have come in handy in this post.)

Sunday, March 15, 2009

This one involved my family and Batman

My son, another young boy his age, and Batman were cruising around in some kind of aircraft. They land in a field, and somehow, either he snuck back on or never disembarked, my son and the other kid take the plane for a joyride.

Batman didn't seem too concerned about their safety vis-à-vis piloting the craft, but he did worry about an enemy detecting them. He muttered that they needed to stay above the clouds. Imagine the most out of control drunk driver: he weaves badly, but in only two dimensions. Now picture the same in three dimensions.

I heard a narrator's voice-over, and he dissed the plane's construction, calling it a converted hovercraft, which sounded much more humble than it does to my conscious ear. Around then, the plane split, as though in an evasive mode, with two halves of the cockpit rocketing in separate directions, and what remained fell to the ground.

The narrator commented on the construction of the trailer that the plane's debris destroyed, somehow reinforced, but the thing had been crushed like an empty beer can on the side of the road.

My wife comes into the picture, and she was distraught because she thought our son had died in the crash. Several friends of ours were trying to comfort her, but it wasn't working. Sam lashed out at one, accusing her of not understanding because her daughter is a homeschooler, false in both reality and the dream. I tried to calm her and explain that her accusation was unfair, but she was hysterical.