Adventures in Post-Apocalyptic Dentistry

Sam: who needs an alarm system? http://news.yahoo.com/s/nm/20060922/od_nm/austria_heads_dc

Evan: Wunderbar.

Evan: I thought that in order to construct your Post-Apocalyptic Throne of Skulls, you had to actually live in the post-apocalyptic era. But I guess all you need to be is an ordinary Austrian dentist.

Sam: Who knew?

Evan: seriously.

Sam: Novacaine for the Blood God!

Evan: haha

Evan: I wonder if those tests you take for job aptitude & career placement are able to measure your capabilities as a post-apocalyptic warlord.

Evan: “Dentist, Pharmacist, …”

Evan: “Post Apocalyptic Warlord”

Sam: “On a scale of 1 to 10, how positively do you view pain inflicted on others for your own gain?”

Sam: 9-10 range probably qualifies you for dentist/warlord

Sam: altho the pile of skulls thing does make dentistry that much more metal.

Evan: Again, who knew?

Sam: Not your average austrian burglar thats for sure.

Hacking MT 2.6; Or, I Don’t Understand Perl

So I’m trying to make a couple of minor modifications to my Movable Type installation’s MT::App::Comments Perl module, in order to make life a little more difficult for comment spammers. My goal is hampered slightly because I don’t know a damn thing about Perl.

In fact, the only language I know reasonably well is Java. Which means that any time I look at code for Language X, my brain does its best to overlay Java syntax on top of Language X, adding in any bits of Language X that I might have accidentally picked up over the years.[1] For example, I can read C++, sort of, because Java’s syntax was designed to be a lot like C++. Except that C++ has all these funny characters sprinkled in: ampersands and asterisks and God knows what else. And when my brain goes down into the depths to retrieve the meaning of these funny characters, it unlocks a door called “CS 5“,[2] and I curl up in a fetal ball and start rocking back and forth and moaning, and the only thing that snaps me out of it is hearing my co-worker Jud singing “The Lunchtime Song.” Yes, we really have a lunchtime song. Want to make something of it?

Anyway, Movable Type is written in Perl, and the module that handles comments contains several hundred lines of code, some of which looks like:

if (!$q->param('text')) {
    return $app->handle_error($app->translate("Comment text is required."));
}

Now, even my poor little Java-addled brain can understand what this means. For starters, I understand “if” and curly braces. I undertand the “!“, the “return“, and the basic idea behind “handle_error(stuff);“. Heck, I even think I understand “q->param('text')“! And in fact, if you try to submit a comment and you leave the “text” field blank, you do indeed get an error message:

Comment text is required.

Try it! It’s fun!

So as a test of my elite Perl-hacking skills, I changed the snippet above to:

if (!$q->param('text')) {
    return $app->handle_error($app->translate("Comment text is required, silly."));
}

But to my great disappointment, submitting a comment with no text resulted in:

Comment text is required.

This could mean one of two things:

  • The Perl module is cached in memory, and the server is not picking up my change.
  • The actual error message is specifed somewhere else in the code, and the snippet I was editing is just a red herring.

The red herring possibility seems unlikely. First, it would be perverse to create a module named MT::App::Comments, have a snippet that appears to handle the empty text field error, but actually handle the error somewhere else. I mean, I know the Perl world is whacky and crazy and There’s! More! Than! One! Way! To Do It!, but seriously. Second, I grepped through all of MT’s Perl code and did not find that particular error string anywhere other than in the Comments.pm file.

That leaves us with the caching possibility. To test this, I renamed the Comments.pm file, and lo! this completely broke comments. Excellent! Except that when I moved the file back, comment functionality resumed, but the system still wasn’t picking up my changes. So it seems that the system’s cache does bother to check whether any of its Perl module files have moved, but it doesn’t bother to waste time checking whether the module contents have actually changed. Perish the thought!

I can understand a caching system that is extremely “sticky” — even if you totally mess with the underlying files, the system doggedly continues to run with whatever it’s got in memory, until you somehow force the system to re-initialize. And I can understand a caching system that continually monitors the state of its files and obediently re-reads the code if it detects any changes. But the in-between behavior makes no sense. Why would you break if a file is missing, but not bother to read the file again when the file magically reappears? I have a hard time believing that this is actually the case. I must be misunderstanding how Perl is working here. Then again, after encountering the utter stupidity of pod2html for Perl 5.8 on Red Hat,[3] I’m willing to believe anything.

Update: Success! Turns out I was grepping in the wrong place. The hack is now in place. See comments.

1. This is sort of like trying to read French by A) looking for words that are very similar in English and B) sprinkling in the thirty-odd actual French words that you dimly remember from high school. Which is, coincidentally, exactly how I read French. Quel surprise!

2. After taking that class, I swore I would never, ever work for the computer industry. And if I ever had to write software, it would only be to do something useful, like solving a physics problem.

3. As opposed to pod2html for Perl 5.8 on FreeBSD, which basically works okay-ish.

Well, This Is Ominous…

Remember those giant communist spiders I was worried about? Okay, I haven’t, like, done a scientific study or anything… but it seems to me that as the summer draws to a close, there are definitely fewer communist spiders, but the ones that remain are larger and fatter and just plain wickeder than ever.

Nature frightens me.

In other, related scary Nature news, my cousin Auros points out this NY Times article about arthropod sexual cannibalism. As my cousin put it, “Well, when het marriage involves having your innards literally liquified and sucked out of your body, the gay agenda starts to sound rather appealing.” Hmmm. Somewhere there’s an old-school vaudeville-style joke about alimony or something in there… but I’m just not in touch enough with my inner Shecky Greene to make it happen. Hey, look, I’m a lamp! Take my wife, please! Eh.

Death by Algorithm!

My old college buddy Dinesh pointed me to the blog of a company, D-Wave, that is trying to make quantum computers commercially available. That statement alone nearly triggered my brain’s Quantum Computing Bullshit Detection Nodule,[1] but Dinesh says that he’s met some of the employees and he thinks they might be the real deal. They’re trying out an alternative approach to quantum computing called adiabatic quantum computing, which they believe is more likely to meet with success than the “traditional” approach. It’s a hard problem, and I wish them luck.

Linked from the D-Wave blog, there’s an interesting paper on arXiv called “NP-Complete Problems and Physical Reality” [PDF]. It’s a more layperson-friendly piece than your average physics journal article, but I still only understood a small fraction of it. This math-y stuff is getting harder every year. Still, I thought it explored some fascinating, if somewhat deranged, physical concepts. I particularly liked the discussion of time-travel computing and its close relation, “anthropic computing”:

“There is at least one foolproof way to solve 3SAT in polynomial time: given a formula phi, guess a random assignment x, then kill yourself if x does not satisfy phi. Conditioned on looking at anything at all, you will be looking at a satisfying assignment! Some would argue that this algorithm works even better if we assume the many-worlds interpretation of quantum mechanics. For according to that interpretation, with probability 1, there really is a universe in which you guess a satisfying assignment and therefore remain alive. Admittedly, if phi is unsatisfiable, you might be out of luck…”

1. Conveniently nestled against the larger and more highly evolved Nanotech Bullshit Detection Nodule.

Why Oh Why Does Documentation Software Suck?

I find myself this Saturday in the possession of a half-full pitcher of mojito. This is something of a problem, given that I need that very pitcher to make mojitos for tomorrow‘s Sunday barbecue. So I have been doing my best this afternoon to rectify the problem. I only bring this up so that if this post seems less coherent than usual, it’s because of the Demon Rum. In vino veritas, and all that.

So. In the course of my job, I need to produce documentation that falls into these basic types:

  • API documentation: a terse reference for the classes and methods available for a particular C++/Java/PHP/whatever library.
  • Man pages: a terse reference for the commands and options available for a particular command-line tool.
  • User guides: conceptual information and examples, written around the relevant API documentation and man pages.

And I need to produce said documentation in the following formats:

  • HTML: the primary format for modern documentation. At my very first job, we produced our documentation as very nice perfect-bound 7″x9″ manuals using Framemaker. That era is long gone.
  • PDF: in case someone needs to print the documentation.
  • troff: man page format, suitable for installing into /usr/share/man/ or wherever man pages go. To be honest, I’m somewhat confused about the difference between troff, nroff, and other *off variations. But I suppose I shouldn’t worry my pretty little tech writer head over such things.

For engineering documentation, I don’t think these types and formats are all that shocking. There are thousands of writers and engineers who are faced with the same problem every day. And yet there is no documentation technology that can handle all of these documentation types and output formats seamlessly. None.

AuthorIT, Framemaker + Webworks, and other mid-range tech writing tools can at least produce output HTML and PDF. All of these tools are Windows-only. All use a proprietary binary format. None handles man pages and source code-generated API documentation. (We won’t even mention Microsoft Word, which still hasn’t figured out how to do ordered lists consistently, or handle documents longer than 100 pages.)

The only toolchain I’m aware of that even comes close is Docbook. It’s text/xml, so it plays nicely with UNIX. It doesn’t require an expensive client to edit. It can produce output in myriad formats, including HTML, PDF, and man pages. It’s open source. It’s modular (with XInclude). It is the only documentation tool chain that even approaches the holy grail of user guides, API guides, and man pages.

Except… There’s no such thing as “out-of-the-box” Docbook: you need to pick your editor, XSLT processor, FO processor, and template customizations, and there is very little guidance on how to do this.

Except… the default HTML output looks like something out of 1993. Basically, the output is nicely-marked up semantic HTML with no CSS whatsoever. Which is fine, except that this means you’re going to have to sink some time into making the HTML look pretty.

Except… PDF output is really buggy, mostly because the major open source FO processor is still in beta status. Not that I blame them — XSL-FO is hard, and typesetting in general is really hard. But the alternative is to buy a commercial FO processor for $4000/CPU… grrrr…

Except… in general, source code documentation generators do not integrate with Docbook. For Java code, there’s a Javadoc doclet that produces Docbook (yay!). For PHP code, phpdocumentor can generate Docbook natively (yay again!) But for C++, Perl, Python, and other languages, you’re screwed.

Why oh why does documentation software suck?

Welcome to Mirkwood; Here’s Your Badge

Although my job has been great so far, there are a few minor issues. I once thought that the greatest danger was fellow employees who can’t park. But now a new threat has reared its ugly head — spiders!

Admittedly, the common California garden spider isn’t quite up to the standards of the horror show that we refer to as “Australian wildlife”. But they sure look wicked, and there are lots of them. Most of them have freaky markings on the legs, and all of them have bloated, distorted abdomens. I’m not sure why the spiders around my neighborhood look nothing like the spiders down at work, but I’m guessing that the latter are benefiting from their proximity to the marsh, and an abundant food source. Moths, flies, butterflies, small joggers… you name it.

Last year the spiders were bad, but this year, they’re getting organized. Walking around the trails behind campus, I’ve found shrubs and reeds completely cobwebbed, with a dozen or more spiders all sharing the same web. I didn’t think spiders could do that. A few weeks ago I brought my concerns to my coworkers at lunch:

Me: So in conclusion, there are tons of giant spiders out there in the marsh, living communally. Aren’t you a little freaked out by that?

Coworker #1: Oh wow, so you mean that we’re surrounded by Communist giant spiders?

Coworker #2: Jeez, what could possibly be worse than Communist giant spiders?

(pause)

Coworker #3: Married gay giant spiders?

Incidentally, I’ve heard that over the last couple of years, gay marriage has been polling very well in the spider community, among males at least…

Literary vs. Genre, Explained Using Pie

I like pie.

In particular, I like key lime pie. There’s really nothing like a good slice of key lime pie. Don’t believe me? Have some! Try some! Key lime pie is delicious.

This is not to say that all key lime pie is good. In fact, the great majority of key lime pie is made from cheap artificial ingredients. More often than not, it’ll be colored radioactive green. This is a real pet peeve of mine. Do people think key lime pie is supposed to be radioactive green? Do the manufacturers of the pie just not care either way? Oh, well. Even if 90% of the key lime pie out there is crap, that means 10% is still scrumptious… you just need to know where to find it.

Naturally, there are many people out there who don’t like key lime pie. “I only like strawberry pie,” they say. Or, “I like all kinds of pie, but key lime pie, not so much.” Or, “You know, I don’t really like pie at all.” Maybe they’ve never had key lime pie. Or maybe they tried key lime pie and hated it — probably because they ordered the radioactive green crap that you get at Denny’s. Maybe they don’t know that there’s good key lime pie out there. But that’s okay! You can’t run around forcing people to try key lime pie. Key lime pie is delicious, but obviously it’s not for everybody.

Although most people have a live-and-let live attitude when it comes to pie, there are some notable exceptions. The most interesting case is blueberry pie. Certain fans of blueberry pie have decided that not only is their personal favorite the only pie worth eating — that’s not so unusual — but they’ve gone so far as to rename their favorite pie as “goodberry pie”. Notice how clever this is. The intrinsic superiority of goodberry pie is, shall we say, baked in to the name itself.

This branding effort has proved remarkably successful. Many pastry chefs and restaurants proudly proclaim that they only make goodberry pie — and is there any other kind of pie, really? The idea that everything other than goodberry pie isn’t worth eating has spawned an entire industry. Eminent university professors who teach Pie Analysis and Pie Creation, critics at the New York Times Pie Review and the London Review of Pie, they all treat goodberry pie as the only “serious” pie.

And this makes fans of goodberry pie perfectly happy. After all, part of the appeal of being a goodberry pie fan is being able to think of yourself as a goodberry pie fan: someone who is sophisticated enough to know that goodberry pie is the only pie worthy of mention. If you press a goodberry pie fan, they might sheepishly admit to eating key lime pie or strawberry pie, but only as a “guilty pleasure”. If you are a serious pie consumer, you are supposed to stick monogamously to goodberry pie and not pollute your palate with other, naughty kinds of pie. Goodberry pie is a harsh mistress.

All this chest-thumping over goodberry pie would be harmless, except that the goodberry marketing campaign has confused a lot of well-intentioned fans of other kinds of pie. After all, the word “good” is right there in the name of the pie! If key lime pie were any good, wouldn’t it be called “good lime pie” or something? Some fans and creators of key lime pie have absorbed this marketing message to such an alarming degree that they have developed a full-blown inferiority complex. “Most key lime pie is gross and nasty and radioactive green,” they say, correctly. “So how can we make ‘Goodberry Key Lime Pie’?”

But this is asking the wrong question! The right question is, “How can we make better key lime pie?” You can’t blame people for forgetting that like all other pies, 90% of goodberry pie is just awful — after all, the goodberry marketing industry exists to obscure this very point. But rather than bemoaning the fact that key lime pie is not goodberry pie, it would be better to spend our time examining the universal qualities that make all pies delicious. Fresh ingredients! Love and care! A thin, flaky crust! The very best goodberry pies have plenty to teach us, but the end goal is not to smush goodberry pie and key lime pie together: it’s to produce the very best key lime pie we can.

I like pie.

Is Our Fantasy Readers Learning?

Charles Stross, “Genre neuroses 101“:

“Finally, there is the blasted heath that is fantasy. At least the two decade long post Lord of the Rings hang-over is mostly over, and the post-movie-trilogy bean fest has faded somewhat. There’s some really interesting stuff going on there (paging Paul Park, Paul Park to the white courtesy phone — or Steven Brust, at a pinch). But fantasy is, almost by definition, consolatory and escapist literature. Pure fantasy doesn’t really tell us anything about the world we live in, and I fail to discern any huge new movements sweeping the field as symptoms of the cultural neuroses of one country or another.” (emphasis mine)

Two problems with the sentence in bold.

First, fantasy is not “by definition” consolatory and escapist. Not even China Mieville believes that. It is trivial to come up with counterexamples.

Second, why is “consolatory” fantasy so obviously inferior to “unsettling” fantasy? I can agree that fantasy that rattles our sensibilities can be excellent. But saying that excellent fantasy must rattle our sensibilities, that’s not qualitatively different from saying that all excellent fantasy should Teach Us Something. Ugh. Look, I don’t mind if you enjoy attempting to OMG R0X0r OUR W0rldvi3w!!!11one1!!, but please, don’t assume that’s the end-all be-all goal for fiction.

Oh, and another thing. “Pure fantasy doesn’t really tell us anything about the world…” Umm, if this is a reference to fundamentally aphysical nature of fantasy, please do keep in mind that 98% of SF, even “hard SF”, is equally aphysical. Those “nanobot/Singularity” stories that are so hip these days? They’re as grounded in reality as the latest offering from Laurel K. Hamilton. Not that nanobot stories can’t be fun and all, but if you’re actually taking them seriously, well, that faint murmuring you’re hearing is the sound of a thousand condensed-matter physicists snickering.

Lloyd Dobler meets the 21st Century

Random web page #1: “Bait and Switch” by Jennifer Ouellette (via “You are Not Lloyd Dobler” by Chad Orzel):

Come to think of it, rent Say Anything for your date, and chances are you’ll win major points. Most women of my era consider Lloyd Dobler (John Cusack’s character in the film) to be the archetypal Romantic Ideal; we still get teary remembering that scene where he holds up the boombox outside his true love’s bedroom window, playing Peter Gabriel’s “In Your Eyes” in order to win her back. *sniff*[1]

Random web page #2: “Women Love Gadgets, Survey Shows“, Yahoo! News UK

The research reveals that despite our supposed “best friend” relationship with diamond, most women (77 per cent) would rather have a big-screen plasma TV than a solitaire necklace. Slightly less surprisingly, a weekend away in Florida also lost out to the prospect of a new plasma TV, with 56 per cent saying they’d go for the goggle box, given the chance.

What can we conclude from this? If you want to patch things up with your girlfriend these days, you need to show up at her house with… an iPod Nano pre-loaded with Peter Gabriel’s “In Your Eyes”?

1. Chad Orzel’s rejoinder: “Absolutely under no circumstances should you rent Say Anything, or any John Cusack movie from the 80’s, for one simple reason: You are not Lloyd Dobler. And you can’t hope to compete with Lloyd Dobler, so don’t even let it come up.”

Bad Movie Classification System: Part Four

Finally after our long wait, the Category IV bad movie! We’ve covered the run-of-the-mill bad movie, the so bad it’s funny bad movie, and the soul-crushingly awful bad movie. What could possibly be left? Ah, the rare but fascinating Category IV. Category IVs are unique in that unlike their cousins, they can in fact have good dialogue, talented actors, interesting plots. But they suffer from one fatal flaw…

  • Type: Category IV
  • Also known as: the “morally inverted” movie
  • Example: Four Weddings and a Funeral
  • Circumstances for watching: by the time you realize what you’re watching, it’s too late

Whoa, whoa, WHOA! I hear you cry. “Morally inverted? What the hell does that mean?” Here you thought I was a nice Reform Jewish boy from California, and before your eyes I’ve transformed into some kind of spittle-flecked Post-Millenial Dispensationalist or something.[1] Wait! Don’t click that back button! Let me explain what I mean first. Actually, it might be easier to start out by explaining what “morally inverted” is not. A morally inverted movie is not a movie where:

  • the bad guys are cooler than the good guys
  • the bad guys win and the good guys get punished
  • the protagonists are the bad guys
  • the bad guys are portrayed sympathetically
  • everyone is a bad guy
  • the whole damn point that there is no such thing as a “bad guy” or “good guy”

Et cetera. Trust me, shades of gray in film are great. I’m a big fan.

No, by “morally inverted”, what I mean is that two things must hold true. First, the filmmaker must construct their universe such that certain characters are obviously meant to be the Good Guys. And second, as the film progresses, it must becomes clearer that despite the filmmaker’s express intentions, the “good guys” are actually horrible people and the viewpoint of “bad guys” is the more sympathetic one. Again, I don’t mean movies that intentionally throw you a moral curveball — I mean movies where the filmmaker is oblivious to the inverted message.

You might have thought my citation of Four Weddings and a Funeral was a weird example, so let’s take a closer look. It’s got good lines, a good cast, it’s visually attractive, and so on. The first time I saw it, I thought exactly what I was meant to think — how charming! How funny! What a cute couple Andie MacDowell and Hugh Grant make!

Then a year later I saw it again. And about halfway through I came to the sinking realization that everything Andie MacDowell’s completely self-centered character did in that movie was calculated to manipulate and crush poor, hapless Hugh Grant. Anyone with sense should be shouting at him, “Run! RUN!! Run away with Kristin Scott Thomas! She’s the one who actually doesn’t hate you!!” At that point the movie fell into the Category IV zone, which is sort of like being forced to watch multiple slow motion car wrecks, each caused by a drunk driver, where each drunk driver gets out of their car, waves cheerfully at the camera, and bounds off.

Romantic comedies are a rich source of Category IVs and near-Category IVs, simply because the genre tends to promote behavior that in real life would be considered psychotic and possibly even criminal. One movie that came awfully close to being a classic Category IV was the Julia Roberts vehicle My Best Friend’s Wedding. You all remember this one: Julia Roberts and her best friend Dermot Something-or-Other make a pact in college that if they both aren’t married by the unimaginably old age of 30, then they’ll marry each other, ha ha ha. Well, Dermot gets engaged to Cameron Diaz,[2] and that shocks Roberts into realizing that she actually loooves Dermot. So being a logical and sensible Romantic Comedy Character, Roberts cries a few tears, dries her eyes, and heads off to the wedding to give her best friend all the support she can muster. No, I’m just kidding. Actually she pretends to be Diaz’s friend, and then tries to pry them apart so that she can take Dermot for herself. Wacky hijinks ensue.

Until — oops! She actually succeeds. And then? Well, there’s a great scene right after Roberts’s “victory”. She’s squatting in a hotel corridor teary-eyed, smoking a cigarette illegally, and telling a bellboy in a shaking voice, “I’m an evil person. I do bad things to perfectly nice people.” By acknowledging that Roberts’s amusing behavior was actually, err, insane, the movie recovered and crossed over into actually-pretty-good territory. Not that the movie had to have a happy ending, mind you. But what would have been unacceptable would have been if Julia had never realized her mistake, and had stolen Dermot What’s-His-Name, and the two of them live happily ever after (but not Diaz). Because after all, Roberts deserves him! Because! She’s the heroine! Anyway.

You might think that many action movies would fall into Category IV, but actually, I think this is relatively rare. A complex action movie takes the effort to acknowledge that the “bad guys” are human beings, war is hell. Now, in a simple action movie, yes, the good guys are mowing down the bad guys without remorse… but really, the bad guys (and the good guys) are really just cartoons. These sorts of movies have the same moral force as the Roadrunner tricking Wile E. Coyote into falling off a cliff to his “death”.

But this is not to say that there aren’t some Category IV action movies out there. The Last Samurai is beautifully shot, has some fine actors (crippled by mediocre dialogue), and some good fight scenes (including Ninja vs. Samurai. Awesome!) Except that the movie takes the lamentable position that the Samurai symbolize the better, braver, Romantic side of Japan, and the businessmen in the capital are all evil cowards. When in fact the Samurai were vicious feudal warlords who would happily cut off the head of any peasant who forgot to bow when they passed. Keep in mind that I’m not arguing that any movie that had heroic Samurai (or their Western equivalent, the feudal knight) is necessarily a Category IV. You can certainly have individual Samurai[3] who are good eggs. It’s just that The Last Samurai spends all its time bemoaning the loss of the Samurai class, which is another thing entirely.

Another Category IV action movie is The Patriot, which had such a laughably one-sided portrayal of the Brits (so evil! so prissy!) that it actually made me embarrassed to be a supporter of the American Revolution. That movie also earned extra Evil points for the subplot involving the mute daughter. See, our hero, Mel Gibson, has this adorable little blond daughter who has never spoken a word. Daddy goes off to war for a couple of years, and she still refuses to speak to him — and in fact, she won’t even hug him, because she’s so mad about his absence. Finally, there’s a scene near the end of the movie where he’s about to leave for war again, and the cutest-little-girl-on-earth runs to him crying, speaking her first words, “Don’t go, Daddy, please don’t go!” And God help me, my eyes got watery, even though I knew that sequence was just about the most crassly manipulative thing ever put to film. That’s when my burning hatred for Mel Gibson really got started.

1. Don’t you hate when that happens? There’s some blogger you’ve reading a few weeks or months, and you’re liking their stuff, and then out of nowhere they write something that makes you think, “My God, this person is a foaming-at-the-mouth lunatic.” Just makes your stomach flip, doesn’t it?

2. Bastard.

3. Or even Seven individual Samurai.