Airport

[This entry backdated to when I actually wrote it]

I’m currently sitting in the Atlanta airport as part of a quick in-and-out to visit a sick relative. I’d easily give a digit for a sausage biscuit right now, but alas the best I can do is trail mix.

More evidence that the terrorists have won: while waiting in the security line with 2000 of my closest friends, having disposed of the Purell I forgot to check, they started playing some Glenn Medeiros over the intercom. You know,

Nothing’s gonna change my love for you
You ought know by now how much I love you
One thing you can be sure of
I’ll never ask for more than your love

There, now you have it stuck in your head too.

I’m reading Kitchen Confidential on the strength of this blog entry by “No Reservations” star Anthony Bourdain. It’s a humorous look at how the restaurant industry is much less glamorous than one might think. [Later on the plane, my single-serving friend, a philosophical sheet metal worker, said this is like life: first you want to get with some beautiful woman, then you realize she’s nasty inside, but by then it’s too late because you’re already married.]

In other news, Angeline and I saw a famous celebrity while dining at the White Flint mall the other night: Matthew Lesko, the question-mark-blazer-ensuited guy who exhorts us to get FREE government money. He was in uniform and looked lost. Doesn’t ring a bell? Here’s Andy Dick’s impression of him.

event.getCurrent

Congratulations, NASA, on finally managing to make space interesting again!

In other last week’s news, bunnie of Xbox hackery fame has a nice rundown on why the ATHF debacle was such a sad commentary on our society. I hope the 2 mil extortion that Ted agreed to is just a face-saving thing and no money actually changed hands.

Linuxy

I’ve been trying out a few new Linux features lately. First, kernel 2.6.20 is shipping with kvm which includes support for the new virtualization instructions on recent processors. This is great because I can use the kvm-modified version of qemu to boot other Linux or Windows XP images while in Linux. Emulating Linux is nice for debugging those kernel bugs that lockup the box, while Windows could theoretically be useful for reverse engineering drivers. Qemu also sets up a NAT transparently so you can easily use the network once you’re in the guest OS. No news to anyone that’s used vmware, but this is free, and a heckuva lot faster than all-software emulation. Pictured is my little XP-under-Linux test:

Also, I’m playing with Xgl a bit. This is the X server that’s built on top of OpenGL, providing window managers the ability to add eye candy to mundane things like dragging windows around. My laptop JustWorked with the builtin i945 graphics chip, which is interesting because glx still claims to be using the software renderer. Coupled with beryl, all of your virtual desktops get mapped to faces of a cube, so when you Ctrl-Alt-(left/right/mouse) you can rotate the cube to find the appropriate workspace. The window manager has active corners like OSX which default to exposé-like features. When you drag around windows under this thing, they have a cute little warping animation, and when you bring something to the front, the other windows become transparent. It’s still a little buggy and I’m not sure that I won’t find the eye-candy ridiculously annoying at some point, but for now it’s a cool toy. A screenshot wouldn’t do it justice, so visit youtube for demos of it by unaccountably shirtless dudes.

Clocked


Clock, side view
Originally uploaded by bluesterror.

I constructed this a week or two ago, but only just now got a chance to photograph it with a real camera. This represents the first theoretically useful circuit I built with the Arduino platform. It utilizes the 7 segment decoding program along with a real time clock (RTC), blinking out the time one digit at a time. The RTC speaks a serial protocol called I2C so only two pins on the microcontroller are needed to read the time.

This is part of a project I’ll be building on soon, but it’s mostly still in the proof-of-concept phase.

Cooking

Angeline and I took our first cooking class last Saturday, despite her having the worst case of pink eye I’ve ever seen (we tried to find a stand-in for her prepaid slot unsuccessfully). Anyway, the class was on basic Chinese cooking, and an area chef supplied us with recipes and went over some basic techniques. I can’t say that I learned much that I didn’t already know, apart from the Mandarin words approximately meaning ‘slice’ and ‘shred’ (and ‘death’), but this was a nice format for a class (that is, much wine was consumed).

We’ll see how it goes when I remake all of these dishes in my own kitchen, which is coming because Ange was unable to taste anything we prepared. I had to describe it in my uninformed-food-critic vocabulary: “hmm, I guess it is salty and grassy.”

Cracker Jacked

WTF is up with prizes from Cracker Jacks lately? I remember in my youth the prizes would sometimes suck, like you’d get a sticker or a temporary tattoo or something like that, but nowhere near the suckage of recent times. Last week I bought a huge bag of the sticky, not-enough-peanuts-having treat while at a Caps game. I thought the prize couldn’t be worse than my last one from several years ago, a “notepad” — that is, a tiny square of paper with four lines on it and a picture of an Octopus — but I was wrong. Instead, I got a piece of paper that informed me historical facts about Susan B. Anthony with an unflattering drawing of same. Who the hell would want this? CJ, if you have decided your mission is to help mankind by educating kids, how about educating them that this bag of caramel corn has 8000 calories inside it and eating it will make one enormous. And the kernels will somehow get stuck to all of your clothes and people will laugh at you and say, “hey look, it’s the guy with the popcorn stuck to his pants” and you will cry.

Moose munch is way better.

Can’t spell geek without the EE

Since I’ve been mucking with electronics again recently, I spent some xmas money on a Weller temperature-controlled soldering iron, my POS Radio Shack Board Burner 2000 no longer cutting it. Then I took the time last weekend to set up a workbench of sorts with some component drawers and all that good stuff. All it needs is a logic analyzer, oscope, and bench supply (yeah right!).

Yesterday I received a kit in the mail from Spark Fun for an Arduino ‘shield.’ This is a little board that plugs on top of the Arduino microcontroller board, in this case giving you a little prototyping area. You get the PCB and a few resistors, LEDs and jumper headers to solder onto the board. It took me about an hour with my new setup to put the thing together, and I must say the Weller is *great*. Every single one of my solder connections was perfect whereas with my old iron there would be huge blobs everywhere, scorch marks on the PCB, cold joints aplenty. In another 10 minutes, I had wired up a circuit that basically implements a BCD to 7 segment converter with the microcontroller (i.e., it counts from 0-9 continuously). Here are some ugly phone-cam pics. Aren’t you so cuuute wit your widdle breadboard!

Toronto wrapup

I can’t remember what I was going to write here, except that I suck at Monopoly. We had a good time in Toronto even though it was crowded with eight people in a 2BR apartment. The weather was nice and warm. Weird, eh? Speaking of “eh,” I only heard one person say it, while we were watching some hockey game in a Queen Street pool hall. I came back with only a few CDN dollars this time. They don’t go quite as far as they used to.

Here’s Christmas 2006, in thumbnails. The rest of my pictures are somewhere in Baltimore.


Work

Hrm, this evil project sounds familiar. Here’s hoping the contractors in Seattle that are implementing it aren’t hopeless idiots. /me scans work inbox… oops, too late.

Back from Toronto


Angeline & I went up to the not-quite-frozen north last week to visit her fam for Christmas. I shall account for time spent there in a future entry a few days from now, but not right now because the pictures I want to post are on my camera that I left there.

Instead, I’ll continue to post about boring technical subjects. Today: one example of sucky Java performance (a topic which hardly anyone in the Java community cares about, apparently). I had a disagreement of opinion with a co-worker recently, as I was coming across code written by a 3rd person that went like:


public void getBar() { return this.bar; }
public void doSomething() {
getBar().frob();
getBar().xyzzy();
getBar().baz();
}

I remarked that this sort of programming is not only extra typing, but performs poorly because inside doSomething we are now making six method calls instead of only the three we need. My co-worker suggested the Java compiler was smart enough to inline getBar(). I was skeptical for two reasons: first that getBar is public, so in order to allow subclasses to override it, it has to be in the Java-equivalent of a vtable, like every other Java method. Second, I’ve looked at the output of javac and it is really quite dumb.

So, I decided to make it easy on the compiler in a test program to see (excerpt):


private static final String blah="blah";
private final String getBlah() { return blah; }
public void doit() { System.out.println(getBlah()); }

There’s no way for a subclass to override getBlah or the value it returns; however, the code generated is:


public void doit();
Code:
0:	getstatic	#3; //Field java/lang/System.out:Ljava/io/PrintStream;
3:	aload_0
4:	invokespecial	#4; //Method getBlah:()Ljava/lang/String;
7:	invokevirtual	#5; //Method java/io/PrintStream.println:(Ljava/lang/String;)V
10:	return

Obviously, the final keyword does nothing. Now, I don’t know much about how the JVM/JIT will further optimize this, but this can’t be more efficient than a simple load of the variable onto the stack. We have to store this on the stack for one thing, and the JVM needs to store a return address somewhere. A small effect, sure, but why throw away performance?

Maybe I’ll be evil and start asking why Java should have the ‘virtual’ keyword in interviews.