\<ajax> god. i'm really getting used to this monitor
\<ajax> i don't know what i'm going to do when it gets taken away
\<keithp> ajax: what monitor is that?
\<ajax> keithp: dell 30"
\<clee> ajax is a whore
\<ajax> a whore with a nicer monitor than you

yet another python rant

I hit another case of "Python really makes me angry" today and I thought I would share it with you all, since I know how much you love reading about things that enrage me.

I have a chunk of code that (while being significantly more complex) looks like this:

def baz():
    print kitties # This works fine.

def bar():
    print kitties # This one throws an exception!
    kitties = 'delicious' # The exception is because of this.

def foo():
    stuff = {'kitties': 'squishy'}

    for k, v in stuff.iteritems():
        globals()[k] = v


This is another example of Python's scoping being weird, and in my opinion, broken.

Let me explain, in case you didn't bother copy & pasting that into a python shell and running it.

baz() will execute properly. bar() will not. But the error you get from bar() is worthless - it tells you that you're trying to read from an unassigned local variable, except you're trying to read from a global variable. The problem I have is not that bar() fails - it's that it is inconsistent with baz() working. I realize that adding a global kitties makes bar() work properly; but I think that in this case, the error should really be when you try to reassign a global variable that hasn't been declared as global.

implementing ideas

I like getting around to implementing the various ideas that I bounce back and forth inside my skull.

One of those ideas that I had for a long time was to solder a PS/2->USB converter directly into an IBM Model M keyboard, along with a USB plug so that I could just swap out USB cables to plug the keyboard into the computer.

I have finally done that, after some inspiration from zevv, a few choice purchases at Fry's Electronics, and a few borrowed parts from my friend Cliff.

I have to say, this kicks way more ass than even I had hoped. (ajax, eat your heart out.)

Still on the list:

  • finish the Qt4 frontend for HandBrake
  • write my own email client that doesn't suck balls
  • write my own AIM client that doesn't suck balls
  • hack up some apps for Qtopia/Opie/whatever for my shiny new iPaq 3670

I know there's more than that, but those are the ones that are currently taking up the most brainspace, so I'm going to have to get to them sometime.

Due to United Airlines sucking balls, Dave Airlie crashed at my place last night after they called back and cancelled his flight from SFO to Sydney. I've said this before, although maybe not on this blog, but United are a bunch of cockbags. They have fucked up at least one leg of every single trip of mine that they've ever been involved in. In any case, I know far too many foreigners named Dave.

Also, I've been growing this out for the first time ever. Looks like I'm going to have to update my various avatars...

screeching handbrake

I really love it when I can easily find something that bothers me in a piece of software, dive into the source, and start fixing things.

That's what I've been doing lately with this little DVD ripping app called HandBrake - it's a cross-platform GPL DVD ripper that makes it almost painfully easy to take a movie from a DVD and turn it into a file that you can watch whenever the need strikes you.

There are some problems, though. Right off the bat, there is the issue that (when ripping a DVD) libdvdread spews out hundreds of lines of output, warning me that a value isn't 0 and it should be. It's not fatal, but it certainly is annoying, so I whipped up this patch up to fix it.

Also, I don't have a video iPod at the moment, or a Sony PSP (and I don't see myself buying the latter anytime soon, but you know... if one were to fall into my lap, I'd probably use it and enjoy the hell out of it.) Anyway, not owning one of these devices, I'm more interested in HandBrake as a way to make high-quality compressed archives of my DVD movies that I can watch on the HDTV in the living room. There's a problem, though; HandBrake scales the picture by default as it transcodes it.

Not anymore, it doesn't. Now it has support for (optionally) embedding the anamorphic pixel ratio into the output file, and can preserve the original DVD video frames. Which means, with x264 at least, a reasonable performance increase of about 15%. Not too shabby!

Unfortunately, the only GUIs for HandBrake are on Mac OS X and BeOS. Now, I love BeOS. Haven't used it in years, though, and I don't even think it'll run on my hardware; Haiku still isn't quite there yet, either, but I'm keeping tabs on it. What I really wanted is a Linux UI for HandBrake.

So, I've been hacking on one.

Qt4 HandBrake UI

Stay tuned for more on this...

aoe is hotness

I've been playing with ATA over Ethernet on my home network and I have to say, it is pretty damn sweet.

In fact, it would be absolutely perfect if I could use AOE to share drives to my media center, and then use ZFS on that machine. Unfortunately, Linux doesn't have ZFS, and OpenSolaris doesn't seem to have AOE yet. (The Coraid site has a Solaris driver, and they claim it works on Solaris 7+, but there is no source and I don't happen to have an OpenSolaris machine to test it on at the moment.)

But - the ability to pool together all of my disparate disks into one gigantic volume is awesome. It's like Voltron, but with hard drives instead of robots.

Leopard features

I was lucky enough to get a ticket to attend WWDC this year, and I've been looking over the session schedule to see what the sessions are, when I ran across this interesting little blurb: > DTrace, an open source project which provides insight into the > interaction between your code and the OS kernel, is now available as > part of Leopard. This session will explain how kernel developers can > both take advantage of, and extend, DTrace's functionality to help > debug and optimize low-level code.

DTrace in MacOS X? Hell yes!

it gets all jiggly

I learned something interesting a few weeks ago and it just popped back into my mind so I decided to record it for my adoring fans.

Second-hand smoke really fucks with me. Savanah introduced me to a friend and we spent a few hours at said friend's apartment; they both did some pretty impressive chimney impersonations and I ended up feeling sick for days. My throat felt like it was on fire, and I kept coughing up chunks of ... I don't even know what. Maybe lung. My nose wouldn't stop running and I was constantly sneezing.

I'm not sure exactly how much later - maybe a week or so - I was at Cliff's place and we were hanging out. I lamented the effects that the second-hand smoke had on my throat, and Cliff empathized with me; apparently I'm not the only one that second-hand smoke fucks with.

However, Cliff's throat was not ravaged and he was in fact feeling fine, so he jokingly suggested that we smoke some hookah. (For those of you playing along at home, no, I'm not using code-words for drugs. We smoke hookahs, not bongs, and we smoke tobacco out of them.) I figured, at this point, what the hell could it hurt? Cliff prepared the hookah and I continued coughing up internal organs.

Soon, the hookah was ready to go - those things take like ten minutes or so to get ready if you're fast, and longer if you're not - and we started smoking. Almost immediately, I noticed something very strange - my nose stopped running.

I was intrigued.

Several minutes later, I noticed that I had also not been coughing. My nose was still not running, and I was even able to breathe out of both nostrils. You might think that's a funny thing to notice, but trust me, you don't miss it until you can't do it anymore.

Hours later, I was still feeling worlds better. I'm not sure what the logical explanation here is, but first-hand smoke fixed every symptom introduced by my overexposure to the second-hand variety. This perplexes me, but I do not question feeling well; I just enjoy it.

how disturbing

[savanah] I'm going to snowball you one of these days, just to show you the difference between sperm and orange pulp

tacos are not worth endangering the mission

Took a road trip to Arizona this past weekend. It's a pretty hefty drive from Palo Alto to Phoenix and back; roughly ten or eleven hours each way. I got to spend time with Savanah, though, so as far as I'm concerned it was worth it. Her brother kicked my ass at Halo 2, but that isn't very surprising since I suck at Halo and its ilk.

I decided that I'm not going to Norway. As much as I would have loved to go, I'm pretty sure it wouldn't really work out at this point.

I informed Trolltech of my decision last week and when I showed up at work on Monday, I was in turn informed that since I'm not going to Norway, there's not really any reason for me to stick around in the Palo Alto office; end result, I no longer work for Trolltech.

This is kind of cool, actually; it gives me a couple of weeks of free time with money to relax, and as tired as I still am from the road trip, I think I might go back to Arizona again. I might even tell some other people that I'm there this time. I have to be back in time to move into my new apartment though. Since I don't work at Trolltech, I also don't get to live in the Trolltech-sponsored housing; I'm crashing at my friend Cliff's place currently, and I don't move into my own place until next week.

At least I can't complain that my life is boring.