LX

I’ve been sick the last few days. Meh.

I went down to Georgia last weekend, looking for a soul to steal, as usual. My grandparents have attained their sixtieth year of marriage this year, so I spent 20 hours in the Atlanta suburb in which I once resided.

The lady at the check-in counter told me to have a nice flight, and I said “you too.” I used to enjoy flying, but the soviet checkpoints we must navigate now have really killed it for me. Wearing my EFF shirt, I was surprised to not get the magic SSSes on my boarding pass. The trek through the screening area still sucked, though, even without the special treatment. I expect that for Thanksgiving I’ll be driving my car instead. Thanks, 4th amendment haters.

My grandparents are doing well. My grandfather congratulated me on the engagement news and wished us our own 60 years of bliss. We grandchildren presented them with a scrapbook of various detritus of our lives and toasted their health. Teary tributes were made, and so on. It was a nice visit, if too brief.

Dead literati

Fun fact: F Scott Fitzgerald and family are buried next to the chapel where Ange & I are to be married. Neat.

BTW, if any of my few readers happen to be job hunting, let me know, as our company needs programmers badly.

Date saved

Well, some progress has been made in the wedding planning, including the tentative selection of date: 15 Sept 2007. First, though, we have to talk to the priest this weekend and consequently do a bit of acting as to the degree of our collective piousness. Here’s hoping we’re judged to be adequate.

Not much else going on this weekend, other than the Battle of Techs on the gridiron. May the worst team lose!

keelhaul handlin’ of OEM flags

Most of the pirate stuff annoys the heck out of me on talk like a pirate day (that was yesterday by the way, yarr and so forth). But Linus’ kernel announcement yesterday was priceless, though he could stand to work on his piratese.

My next kernel contribution should ship with 2.6.19, w00t.

People are dumb

I saw a guy with a sticker on his backpack today that said “Rideing Durty.” Now, I know this has something to do with some song, and that it is also cool/trademarkable in some circles to spell things wrong (see Fabolous), but seriously, rideing? If you were the printer making said sticker, how could you let that one get through?

Also, Oscar Mayer is now making cooking hot dogs easier. Is this the state of culinary despair to which our society has sunk, that cooking hot dogs is too onerus? I love the write-up in the press release: “Preparation is easy, and there’s no cook top mess or boiling water!” Oh, heavens, that my prayers have been answered so fully! I fear I’ll be telling my future children how I remember it taking almost a minute to make a hot dog, and we had to open the buns ourselves! And grilled cheese, boy was that a sisyphean task…

Hello, java!

I was messing around with Java bytecode today for no particular reason. It’s a fairly simple assembly language — stack based so it takes a little getting used to but not hard for anyone who has used an HP calculator. I installed a copy of jasmin from my apt repository and got to work.

I wanted to make a “Hello, world!” that wasn’t completely obvious at first blush, so the plan of attack was to just push all the ascii codes on the stack in reverse order then call System.out.print() on them in a loop. Each iteration checks the loop count, if ok then pop the next code and print it. Here is where the bytecode verifier is a pain in the ass: apparently, the instructions must be executed each time through a loop with the same stacksize, or else you are branded an evil hacker. Very annoying. I could’ve used an array instead but that also takes a bunch of pushes and stores, so I just unrolled the loop. It works, I guess. Code after the jump.
Continue reading “Hello, java!”

Bug

Philly didn’t happen, again because of rain. I saw on their website that the game went on anyway. Bah.

My ubuntu install is doing a bit better after a week of various customizations. Now the Fn key and all of the special laptop keys do things (more than I ever had working on my Dell), and tap-to-click is going on the touchpad. I’m still having a strange problem with HAL, however, and negotiating its maze of XML config files isn’t the best. While looking for help, I saw this: Ubuntu bug #1. Silly, but I like the feedback, especially the “it’s a feature!” post.

It’s always rainy in Philadelphia

Well, because the last trip was such a success (rained out ballgame), this Saturday a few of us are heading back to Philly to cash in the raincheck. Here’s hoping we have enough time for a wiz wit (and of course to soak up all the culture that PA has to offer.)

In other news, I have a new laptop. After getting pissed at my Dell for its recent habit of turning itself off whenever it feels like it (hmm, just like my old Sony!), I picked up an Intel MacBook. Yep, my IQ points are already receding. First thoughts — OSX is pretty cool but I probably won’t use it much: better than hockey pucks but still too graphical for a real Unix user.

I installed ubuntu on the other half of the hard drive, and discovered an interesting failure mode of the use-sudo/no-root-password mindset. If you change the hostname (via vi /etc/hostname) without updating the hosts file, you’re screwed: sudo won’t work anymore so you have to boot single user mode to fix it. Ubuntu is a slightly more polished debian, but some things grate: ‘nano’ as the default text editor? Icky.

The mac keyboard needs some work. No PgUp/Dn, Caps lock is huge and frequently triggered, Backspace is called Delete. A little xmodmap and it’s not so bad though.

blocks

It can be a humbling experience to revist old code. And I’m not talking about the dynamic simulation stuff, which is obviously a hack on top of a pile of hacks. No, this week I returned to my old pal ansiconv, the program that converts text files to images of the text file, rendering it as if you had ANSI.SYS loaded and typed TYPE KOOL.ANS at the cee colon backslash prompt. This program had achieved a modicum of success in its heyday but lately various alternatives have popped up written in languages such as C# and PHP. Being the C bigot that I am (one who writes Java for a living), I thought I would update this one great program, slap a PHP module interface on it, and unleash it upon the world.

Stylistically, the program was a mess: 2-space indentations, curly braces on the same line as the function definition, spaces (( after the )) parentheses, seemingly no rhyme or reason to naming of typedefs, and, horror of horrors, extensive use of studlyCaps. Oh, how I had strayed from the Unix flock. Even worse, I found an obvious bug in TAB character handling; a memleak or two in the error paths; infrequent to non-existent use of the static keyword; global variables aplenty, in one place documented “to ease calling into functions” (had I some phobia of struct?); and even a case of a function returning a pointer to a global variable. Take that ctime(3). All this in the space of some 2 KLOC.

The good news is, a few hours with vim and the codebase is much better: no more globals, no more leaks, no more uglyNamingConventions. I changed the build to create a library with a single entry point, which the ansiconv binary uses to work its magic. All the CGI support code was ripped out, and I wrote a small PHP module that utilizes libansiconv to do stuff on the web. Finally, I borrowed an enhancement from our friends who wrote the newer ansi converters, which is to emit 4 bits-per-pixel images when we can to reduce their size.

The other ansi converters are more full-featured, but C still wins in speed, hands down. A rough test shows ansiconv converts around 2500 ansis/minute, compared with 270 ansis/min for another popular PHP converter (both tests include the overhead of starting the PHP interpreter).

If you have no freakin clue what this post is on about, visit Doug’s great page, 16c.