The Lair

Do not meddle in the affairs of dragons, for you are crunchy and taste good with ketchup

Archive for the 'programming' Category

strInSpace or locInSpace?

April 10th, 2007

So Charles Simonyi is in space. Old news, I know. It took me till today to realize that the person in orbit right now isn’t Charles Petzold. Somehow I managed to mix up the two based on the fact that they’re both connected with Microsoft and named Charles. Silly.

This is a pity because I was about to write fondly of the two editions of “Programming Windows” which are Petzold’s enduring legacy to programming and still occupy shelf space on my programming bookcase. Authoritative, dense and probably not for the faint of heart. None of the MFC junk in the earlier editions, it was all C. I haven’t programmed seriously for Windows since … oh, before Windows 2000 was released but they’re still useful for the occasional API reference. Long since superseded by other books on the shelf though.

But no, this isn’t Petzold in orbit. Wrong Charles. Instead, Simonyi the space tourist invented Hungarian notation. Charles Petzold (the other Charles) made it popular by using the notation extensively in his books.

I can’t remember how many times I’ve muttered that the guy who invented this piece of crap (meaning, Hungarian notation) had his head in the clouds. Now it seems that I was being prophetic. I was also wrong.

According to Joel Spolsky, Simonyi invented Apps Hungarian - a concept with which I agree and still use in other languages. Apps Hungarian notation uses mnemonics to indicate the semantics of a variable. That is to say, the intent. Systems Hungarian on the other hand, uses mnemonics to indicate the type. I hate Systems Hungarian with a passion. Guess which form of Hungarian notation is more prevalent in industry? Yeah. Not the good sort.

Charles, noooo! Get outta my head, Charles!.

Habari

January 30th, 2007

A few weeks ago, there was a huge buzz around a new blogging software project named Habari. I heard of it then and wandered over to the IRC channel to take a look at the product. The people behind the project were already known to me through other IRC channels and I was quite keen to find out what they had been cooking up.

Other people have already done the introductions and the guiding principles behind Habari. They’ve also partly addressed the FAQ aspect; particularly a generic answer to why we need yet another blogging application in a market that is already rather crowded. Wordpress works, doesn’t it? Why do we need to bother reinventing the blog software wheel?

I run Wordpress on the Lair, as I have done for the last couple of years. It’s not everything I want it to be - but realistically, I don’t know if any blogging application could be that without a lot of custom additions. I’ve also been following Wordpress development (and development of some of the plugins) for a while and I’ve occasionally given back fixes, albeit minor ones. But there’s no reason why blogging software development couldn’t be done differently; or dare I say it, better.

I think it’s more interesting for me to explain why I personally decided to contribute to Habari development.

Read the rest of this entry »

quicktime-java, the real deal

November 20th, 2006

The only thing worse than missing documentation, they say, is documentation which is out of date. That’s why I’m regaling you with my efforts to get Quicktime for Java and the related SDKs installed.

Let’s start with the first obvious port of call - installation. The site says; “In order to install QuickTime for Java, developers will need to select ‘QuickTime for Java’ in the ‘Custom’ install option”. Ok, fair enough. Not everyone wants or needs the Java API to mess with Quicktime, so tuck it away in a custom option. But wait…

There is no fricking “Custom Install” option in the Quicktime installer.

Ok. So maybe the installer doesn’t like the permissions on my notebook? Let’s try it on another machine. Is a magical custom install button produced? Nope. Maybe they want you to download it later? So, tick the box which allows your software to be updated automatically by Apple and see if Qt-J is available. Nope again. The SDK is missing.

Right. So now what? Download their super bundled iTunes and Quicktime. Maybe that has the Java API? Nope, it doesn’t.

Google then. That’s right. Quicktime 7 installs Qt-J without asking anyone anything. Aargh. Thanks for letting me know. Not.

Go hit up their sample code. The installer which silently poked the API on my harddisk is also supposed to automagically add various bits to the system classpath. This is Apple. It’s supposed to “just work”, right? Wait. No, it didn’t. Unsurprisingly, the sample code refuses to run.

More Google. Apparently, the Java SDK for Quicktime is packaged as a zip file and is tucked away in a subdirectory off the main Quicktime install. It’s not even a jar file as convention dictates, but a zip file instead. *sigh*

Add the zip file to the classpath manually (fie to you, installer!) and it all starts working. Apple’s site however, is still broken. Dumbasses.

If it was this traumatic installing things, how do you think the programming is going to go? Yeah, I think it will go swimmingly well too. Yet this is actually the best available option for messing with multimedia content with Java. Pity the fool.