Archive for December, 2005

Australia Photos

Wednesday, December 28th, 2005
2005 Australia Trip

I finally posted some of the photos from my trip to Australia in the fall of 2005. My mom and I went to Ulladulla, a little town 3 hours south of Sydney on the coast. We got to meet up with a lot of friends, new and old, and that was very enjoyable. I also had a brand new camera, a Canon 20D to play with.

Unfortunately, it was a rather short trip because I had to get back to school, but it was still quite fun.

Causes Grumpiness

Wednesday, December 28th, 2005

I started learning the GPU shader programming language Cg yesterday. In fact, I reviewed a lot of things, including Microsoft’s HLSL and the OpenGL shader-language GLSL. But, since I can only learn so much, I decided to stick with Cg for now.

(more…)

No Fear

Friday, December 23rd, 2005

I don’t know why the History Channel insists on producing these documentaries about major airline accidents, but they sure aren’t helping my fear of flying. Part of me thinks, “I shouldn’t watch - it’ll just disturb me.” Another part says, “Hey, this could be important!” And then there is the visceral response to seeing a catastrophe unfold.

What I do know is that there’s a whole lot more that could go wrong than whatever I can dream up!

When Choice Isn’t Good

Thursday, December 22nd, 2005

There are times when choice isn’t good. Like when you are shopping for fish-sauce. You will never feel quite so helpless as when you are facing a dozen different choices for bottled runoff from fermented anchovies, and you have no idea which option is good, and which one will make you wish you were dead a few hours after ingesting it. To make it worse, I couldn’t read any of the handful of Asian scripts on the bottles, so I was pretty much flying blind.

All of my options basically said, “Ingredients: water, anchovies, salt, sugar.” So, I made an assumption: Higher price means better quality. Of course, this is a big assumption; “higher price” could also mean “company had to settle more lawsuits,” or “company had to bribe more authorities to stay out of hot water.” But, I’m not thinking about that.

I settled on this “Double Parrot” fish-sauce; being about the third-highest in the price category, it has to be good, right? It didn’t make me sick, anyway, and it did give a nice subtle flavor to the yellow curry I made. Maybe next time I will be adventurous and try something else.

Over-Engineering?

Tuesday, December 20th, 2005

Last night I was looking through some of the Java 1.5 API documentation, and I discovered the java.io.Closeable interface. “A Closeable is a source or destination of data that can be closed.” And, you guessed it, the Closeable interface has exactly one method: close().

Thanks! How in the world did we get through five major Java releases without having this interface? I have no idea…

Then I discovered a second Java 1.5 addition, java.io.Flushable. Again, it has exactly one method: flush().

Now, this definitely strikes me as an obvious case of over-engineering. If closing or flushing an object were a lengthy procedure that required some level of attention, then I could see the justification for having a couple of special interfaces. In that case, Closeable and Flushable would each have a couple of methods to track the closing or flushing operation, and it would be really obvious why “It’s such a good idea to have these interfaces!”

However, as it stands, I can’t find a single method in the Java 1.5 API that actually takes an argument of either Closeable or Flushable; they are only used in class-declarations for the java.io and java.nio.* packages. So, presumably, somebody thought it would be a Good Idea, and that was that!

Of course, now we need to have a javax.swing.Closeable interface, for all of the different UI-widgets that can be closed. I mean, how are you supposed to know whether you can close a particular UI-widget? Dialogs and windows and frames cry for a special Closeable interface of their own.

Finally, can somebody explain to me why java.net.Socket doesn’t implement java.io.Closeable? It has a close() method - an obvious candidate for this special new interface.

Do-It-Yourself Java Profiler

Thursday, December 15th, 2005

This evening I got a bug: I wanted to see how easy it would be to implement a profiler using the new Java 1.5 java.lang.instrument API. Not being a native speaker of JVM bytecodes, I also downloaded the Javassist package from the JBoss folks, and started tinkering.

A few hours later, I was able to run various Java programs, and get a dump of object allocations and deallocations as they ran. All with a couple of Java classes that get to transform the bytecodes of classes as they are loaded. Sweet! Most of the hard work centered around figuring out Javassist, which at times produced the telltale impulses of wanting to rip my hair out. But once I worked through those issues, it was remarkably smooth sailing!

This was mainly a proof-of-concept, but now that I know it works, I’ll have to refine this thing! The return on my efforts is pretty high, because of how easy this has all become. It amazes me, what you can do with these things by now.

Sigh, now to get only five hours of sleep, again…

User Interface Design for Programmers

Thursday, December 15th, 2005

I finished reading this book by Joel Spolsky yesterday. It was pretty interesting, and it had some good points, but it felt a bit lightweight as far as user-interface design books are concerned. The way I would summarize it is:

  • “Here are a few fundamental UI-design axioms.”
  • “Here are [Joel's] opinions on how these axioms translate to real user-interfaces.”

Interesting? Yeah, pretty much. Worth the $19 I spent for it? No, probably not. You can get much better books for $20 or less! Also, most of the points in Joel’s book are already made on his website, http://www.joelonsoftware.com.

So, I’d recommend saving your money for something else.

Ten bucks?!

Tuesday, December 6th, 2005

At least six months ago, I got a brand new Delta 13″ thickness-planer for my woodworking projects. Unfortunately, I haven’t gotten to use it at all since I got it, because two small screws weren’t included with the shipment. And, since I have been busy surviving my first term at Caltech, I haven’t had a chance to track down replacements.

Well, this is the last week of the first term, and since I haven’t had any classes to teach, I have been getting some of these things taken care of. And I discovered this pretty nifty website, ServiceNet, that lets you purchase parts for a whole bunch of different power-tools. So, I track down the two small screws that I need. Here is the price breakdown:

Small screw #1: $1.75
Small screw #2: $1.60
Cheapest shipping option: $7.00

Yep, that’s right: $10.35 for two small screws.

So, while on a completely different quest, I happened to check at my local OSH for these screws I need. And, surprise surprise, they have them! (It actually was a surprise - they are metric screws with a hex-socket cap, which I wouldn’t expect are super common.) Total price for five of them, including tax, was just under two bucks.

Saved eight bucks, yay for me! And now I have a brand new way to maim myself.

Five minutes???

Sunday, December 4th, 2005

Ugh, what a pain! This WordPress stuff said it would only take five minutes, but of course that doesn’t include the time for setting up the platform, or MySQL, or any of that malarkey. More like 3 hours.

Oh well. Now I can start sharing my profound insights with the rest of the world again. I’m sure you couldn’t wait for that.