• Ryan Gordon on Games Development

    Ryan Gordon, the lone gunman who’s responsible for porting quite a number of Wintendo games to Linux and Mac OS X, was interviewed recently. He had this to say about coding for games:

    None of the games are rewarding. Is that bad of me to say? Game development has nothing to do with quality and everything to do with shipping what you can get away with. That’s just how it is; I didn’t make this horrible world.

    Nothing unexpected, I guess. I wonder how many fields haven’t succumbed to the “it’s all a matter of what you can get away with” mantra of quasi-engineering? Writing academic papers, maybe? Nahh …

  • Creating Universal Binaries with GNU autotools

    If you’re a Unix hacker on Mac OS X, chances are you’ll be using a very large number of open-source projects that use GNU autotools: these are the projects that you typically compile with the ./configure script. It turns out that building a Mac OS X “Universal Binary” that runs on both PowerPC and Intel isn’t too hard at all, with the appropriate magic incantations to the ./configure script:

    CFLAGS="-isysroot /Developer/SDKs/MacOSX10.4u.sdk -Wl,-syslibroot,/Developer/SDKs/MacOSX10.4u.sdk -arch i386 -arch ppc" \
    ./configure 

    Notes about this:

    • You will get a ton of warnings from the linker during the compile that the -syslibroot parameter was ignored since no linking was done. Just ignore them. (If you find out how to shut ld up, do email me!)
    • You may need to pass the --disable-dependency-tracking to ./configure, especially for projects that use GNU libtool. Yeah, this means you won’t get proper dependency tracking for your project, so (just like the Universal Binary Programming Guidelines suggests) I’d suggest you compile a universal binary only when you build a proper release package.

    Update: Note that this is merely a way to get autotools to build universal binaries. It definitely does not mean that your project will automagically work with on both PowerPC and x86. (In particular, you’ll have to change autoconf-supplied architecture and endian macros such as AC_C_BIGENDIAN: see the autoconf section of the Universal Binary Programming Guidelines for more details.)

    Update (2): It seems that this technique has officially been sanctioned by Apple: technical note TN2137 uses the exact CFLAGS that I’ve described here.

  • WWDC, San Francisco, Tuesday

    Not much news other than geek news again, I’m afraid. (I guess attending a conference from 9-6:30pm saps most of the day away!) The day was pretty uneventful, though I did sneak out to visit the Apple Store and CompUSA during one session time slot where I really wasn’t interested in anything that was running. You’d all be very proud of me: I picked up quite a few things at both places, but put them back down before I bought them. Fear my willpower.

    One thing I did forget to mention on Monday was one awesome demo at the end of the day. During the Graphics and Media State of the Union talk, a DJ was invited up on stage to show off some of the new graphics features on the Mac. A DJ showing off graphics, you say? He demonstrated completely live, real-time “sequencing” of visual compositions of movies, and had hooked up visual effects to effects he was running on the music. e.g. Mixing between two songs would blend two different videos together, and applying a grinding resonance filter to the music would make the screen warp and distort. It was all very, very cool stuff: something I wanted to do quite a number of years ago when I was actively doing mixing. Apple is really being a bad boy and inviting me back into some of my old habits! The DJ there is playing at a local San Francisco club on Thursday: I’ll so be there.

    At the end of the day, I ran into Ashley Butterworth, one of the other people at WWDC from my own Uni who I hadn’t met yet. We ended up going back to his room and randomly nattering about various geeky things, from Cocoa development to Objective-C vs Haskell. After that, I retired to my hotel room and flopped into bed, and that was that. Zzzz …

  • WWDC, San Francisco, Monday

    Geek news first: I guess all the geeks have heard the news that Apple’s switching to Intel x86 processors. I won’t offer any particular opinion of mine here (at least, not yet …), though I will warn that there are plenty of totally crackpot theories flying around. If you’re not a long-time Mac user (or possibly even a Mac developer), it’s far too easy to believe some outlandish theories that so-called respectable people are crying about. Probably the two most balanced and accurate things I’ve read so far about it is John Siracusa’s editorial, and (somewhat surprisingly) MacRumor’s Intel FAQ. I’m waiting for the hype to die down (and also to play with one of the Intel Mac developer systems) before I make any judgements.

    The rest of the day was pretty good too, though quite uneventful. The sessions that day were relatively interesting (yep, that means I actually attended all the sessions, aren’t I a good boy?), and I retired back to the Courtyard Marriott early since I’ll have plenty more times in my life to come back to San Francisco and party like it’s 1999. (Nothing to do with how I have plenty of work to do, email to check, and sleep to catch up on, I swear.) I seem to run into all the other Australian students when I’m least looking for them, too: no sign of them for almost the whole day, and then when I’m just about to leave, I run into about ten of them.

    All in all, a pretty cheap’n’cheerful day for me, with the small exception of that small announcement by Steve Jobs, of course. Sounds like fun, if you ask me! I’m all about fun.

  • San Francisco, Saturday and Sunday

    I left Los Angeles on Saturday afternoon (to the great sadness of my cousin’s kids: sorry Kevin and Kallista!) for the windy city of San Francisco. For the first time evar, LAX did not completely suck. Traveller’s tip: if you can, try catching an afternoon flight from LAX. There are no queues. Since I’m sure frequent LAX travellers will be stunned after reading that, let me repeat that: no queues. I had maybe five people in line before me at the check-in counter, exactly two people in line before me at security, and that was it. I was a very happy camper on that LAX visit.

    The flight itself was fine: a tiny little aircraft (three seats per row; one on the port side, two on the starboard side) with complementary beverages (I love Coke, Cokey Coke Coke, Here It Goes Down, Down In My Belly, Mmm Mmm Mmm). I arrived in San Francisco around 4:15pm; strangely enough, that was one hour ahead of schedule, but I ain’t complaining. By the time I arrived at the hotel (the Courtyard Marriott, for those interested) and settled in, it was about 6pm. The Moscone convention centre where WWDC was held was kinda very hard to miss (that’s the 2004 image, but 2005 is more-or-less the same), so I grabbed my fancy WWDC badge from there, and had dinner at the Sony Metreon building across the street. (What is it about the USA that gives rise to meal names such as “croissandwich” and “chickenshroom”?)

    After that, of course, I visited the Apple Store, which was a mere 5-minute walk away from the Sony Metreon building. As usual, I didn’t end up buying anything there, but it was just one of those mandatory things I had to do when you’re in a North American city. What was more intriguing was the Virgin Megastore that was right next to the Apple Store: after spending around half an hour there, I picked up a James Lavelle Global Underground mix CD (Barcelona #023, not the more popular Romania #026 one), and the new DJ Rap album named Bulletproof: we’ll see if the oldskool jungle and drum’n’bass girl is still as good as she was in the late 90s!

  • Los Angeles

    Shopping, shopping, shopping. That sums up L.A. pretty nicely for me: all those fun boutique shops that haven’t come to Australia yet (Banana Republic, Club Monaco, Zara, the Apple Store, Barnes and Nobles, and of course, Victoria’s Secret), and the one-and-only Fry’s Electronics, the biggest place I know of that has such a craphouse website.

    I guess Dom and Zoe were feeling like they needed a small break, so they actually came down to visit L.A. with me, which was awesome: I introduced the two to The Grove, the only place that I absolutely have to go to while I’m in Los Angeles. Sun, outdoors, great cafÈs and eateries (hello Cheesecake Factory!), movies, girls wearing tank tops, free wireless courtesy of an Apple Store … yep, my kinda place. I’m a tad (but only a tad) ashamed to say that I spent far too much money there for my own good. But hey, you only live once, right? (At least my credit card still works, which means that I haven’t used up my credit limit yet …)

    My relatives in Los Angeles took me to a totally awesome Japanese BBQ retaurant for dinner on Friday: think Korean BBQ, where you sit at a table with a fire-making stove thingy in the middle of the table, but Japanese intead. Of course, this may not have been the best decision after my cousin and I ate at Tony Roma’s for lunch and thus overstuffed ourselves with ribs, but somehow I still managed to scoff down the huge piles of beef and veges. Very, very yum; very, very good.

    All in all (much like this blog entry), my trip to Los Angeles was too short. It was great catching up with my cousins and being able to see Dom and Zoe for a bit longer, but really, one and a half days just isn’t that much time to do anything, particularly in a city as diverse as Los Angeles. Ahh well, considering that the Apple University Consortium scholarship more-or-less paid for the trip over here, I guess I can’t complain too much!

  • Sony PSP and Wipeout Pure

    One thing that made a serious dent into my ever-growing credit card debt while I was in Toronto was getting a Sony PSP, which I’m glad to say was money well-spent. Wipeout Pure absolutely rips arse. (Dom, I’m up to 21 gold medals now, go me!)

    There’s been plenty of good reviews on the PSP floating around on the Web, so I won’t add to them. All I will say about it is that Wipeout Pure is great: if you’re an oldskool Wipeout 2097/XL fan like myself and was a bit disappointed with the feel of Wipeout Fusion, Pure brings back all the goodness of 2097. At first I thought it would be a bit restricting playing on a small screen instead of a nice big TV or monitor, but the freedom the PSP gives you is a big win: I was playing the thing at the airport lounges, planes, and in bus shuttles. I wouldn’t use it as an iPod replacement simply because the iPod does that job a lot better (and as significantly longer battery life, too), plus the PSP isn’t quite small enough to fit into one’s pocket yet.

    So, at least if you were interested in the PSP for Wipeout Pure, go get one. Pure is the pinnacle of the Wipeout series so far.

  • Toronto, 27th May to 5th June

    First, apologies for the lack of posts. I’ve been a pretty busy boy, and the few hours I’ve had to myself, I’ve either had to do Uni work, CSIRO work, or sleep (usually in that order :).

    How do I sum up Toronto? It was one of the most busy and best one-week holidays I’ve had. For those of you who don’t know, the main reason I went there was to attend my cousin’s wedding. It was a traditional Hindu wedding (you can find some photos on my gallery site) and was absolutely wonderful. It was possibly the only wedding reception that I attended where we had two hours of speeches and dancing before dinner was served at nearly 10pm, and I wasn’t bored in the least. I got to meet and catch up with cousins who I haven’t seen in 15 years; you know when you meet up with some friends from your childhood and you’re so relieved and happy that you just click with them? That’s what it felt like — one of those natural highs that keeps you going for days, multiplied by every single one of them I met.

    Apart from meeting up with the relatives, I of course also visited Dom and Zoe, who are very much settled in and happy in Toronto. I got an excellent reminder of just how nice it is to live in the heart of a city: a 10-minute walk brings you to fantastic cafÈs, excellent shopping, and even the water (for those Australians who miss seeing the ocean glitter during a sunny day, like spoiled old me).

    Amongst other things, I met up with the esteemed Wolfgang Thaller, the Glasgow Haskell Compiler Mac maintainer, all-around far-too-clever person who knows a hell of a lot about everything, from World War I to Alpha Centauri to s Objective-C and C++ wizardry. Plus, Wolfgang didn’t even yell at me when I was half an hour late to meet him at the bus station (oops). Nice chap, he is! We ended up soaking up the sun on a rare sunny Toronto day at Harbourside, which is just south of CN Tower, drinking lattÈs, tea, and beer, and consuming a most excellent 600oz steak for dinner. (I still don’t get Canada’s units of measurement, by the way: make up your mind whether you use metric or imperial! Metric preferable.)

    The other surprise to come in Toronto was meeting up with an old friend of mine, Astrid Fauchon, for those of you who knew me 10 years ago and remember her. For those who want the details, feel free to email me, but I’m happy to say that it was really good to see her again, and that it gave closure to one of the only bits of my life that I felt never really wrapped up nicely.

    The most interesting bit of the trip was really feeling all the events happen together: I just had a great time. I was getting probably an average of 4-6 hours of sleep every day, and while I was a little stressed at times, I was really glad I was kept so bu. Catching up with cousins and old friends and just clicking with all of them felt wonderful, and drove the point home that friends and family really are the important things around. I’m really lucky to be able to see all of them again, and I guess it changed my perspective on things a little. A trip like this reminded me that making the trek halfway across the world to see friends and family is so much more than worth it, and all the nervousness of not seeing them in 15 years and worrying about whether you’ll get along well is often gone in the first few seconds. Here’s a toast to good mates!

    Update: I’ve posted some photos online of Toronto in general, Jennifer and Ashish’s wedding, and meeting up with my cousins.

  • Control-T

    Well, you learn something new every day. How many Unix veterans know about the Unix status character, Control-T?

  • Off to North America

    I’m off to North America for the next 2 weeks: Toronto, Los Angeles and San Francisco, in that order. If any readers are attending WWDC in San Francisco, drop me an email and let’s meet up!

  • coLinux

    We needed to set up some Annodex servers for demos this week, and our server software currently runs best on Linux. So, what to do if you’re using Windows machines which you can’t install Linux on for whatever reason, political or technical? Run Linux inside Windows, of course, via coLinux.

    coLinux is great. No, scratch that — coLinux is really great. Not only does it work, it works really well: it’s fast (I really don’t think I’ve ever seen a Debian system boot up in 2-3 seconds), it’s stable, and it even uses a pretty small amount of memory, since Linux servers tend to be on the trim side. A full-blown Linux installation for us with Apache serving multi-megabyte multimedia streams to multiple Windows clients was using up less than 30MB of Windows’s memory pool. Low fat.

    If you must have Windows on your desktop/laptop for whatever reason, but need Linux and are getting sick of doing the reboot dance just to switch OSs, give coLinux a whirl. And, if you want to get geek cred points, watch your friends’ jaws drop when they see X11 applications hosted on coLinux displaying in Cygwin/X; it’s pretty scary just how well it all works. Now, whither my coLinux for Mac OS X port (and flying car)?

  • The Mother of All Demos

    Ars Technica has an new article (that Slashdot seemed to miss) titled A History of the GUI. The first couple of pages of the article are great, but unfortunately it soon degenerates into screenshots of various GUIs that were introduced in the late 1980s.

    However, it does talk for nearly a full page about Doug Engelbart’s Mother of All Demos, given in 1968. As befits its name, Engelbart’s demo is one of the most important events to ever happen in the history of computing. It not only featured the first demonstration of the mouse, but also …

    featured hypertext linking, full-screen document editing, context-sensitive help, networked document collaboration, e-mail, instant messenging, even video conferencing!

    Hypertext linking and networked document collaboration guys, in 1968. We still don’t have a decent networked document collaboration system today, bar wikis (which aren’t real-time), and SubEthaEdit (which is great, but is limited to plaintext, and only works on the Mac). Engelbart was doing stuff 37 years ago that we still haven’t managed to conquer today.

    Anyway, to get to the point of this post, I really encourage you to check out the following two video recordings if you can make time for them — they’ve been lovingly digitized and preserved so that we can view them so many, many years later:

    They’re absolutely amazing. So damn amazing, this will probably be the one and only time I’ll tell you to download and install RealPlayer just so you can view Doug’s 1968 demo. You can feel history in the making as you watch the videos, I kid you not. To some extent, I almost despise Kernighan and Ritchie for spawning a culture and mindset that ultimately won, despite being more mediocre. Where would we be today if the world had embraced Smalltalk instead? Ah, time to stop being sentimental and crank out more C code, so I don’t look like such a starry-eyed kid again …

  • The Commentator

    Are you a totally k-rad coder who just can’t stop cutting code to spare time for those silly comments? Cenqua’s Commentator was made just for you:

    The Commentator uses revolutionary real-time language processing to actually grok your code and add the necessary comments on the fly. No more doco to slow you down. Just install The Commentator and watch as your coding elegance is eloquently decorated with insightful, nuanced commentary … as you type. What’s more, The Commentator’s powerful Personality Controls allow you to tweak it’s output so completely that it’s as if The Commentator is speaking for you. In your voice. Explaining to those that need it, so that you can get on and get busy.

    It’s worth checking out just for the personality controls screenshot. SCO or chicks indeed!

  • Flip4Mac's WMV Player

    For those of you looking to play Windows Media on the Mac and absolutely loathe Windows Media Player, check out Flip4Mac’s WMV Player component for the Mac. For US$10, you can play Windows Media files in QuickTime player. (Though see the note about open-source players below; their support for Windows Media may be good enough for your purposes.) I bought it, and I’ve been quite happy with it. It will even use the QuickTime plugin instead of the dreaded Windows Media plugin to handle playback of Windows Media on the Web, even when they’re served those clunky .asx files.

    Note: Several open-source multimedia players, such as VLC, XinePlayer and mplayerosx, will play .wmv files, but some WMV files have an advanced codec that these players don’t support yet, so they unfortunately won’t play all .wmv files. While I’m fairly certain that the codec will be reverse-engineered in time, for me, $10 is a pretty good deal to make sure I don’t have to deal with the pain of Windows Media Player ever again. (Of course, the arguably better solution is to use non-proprietary media file formats such as Ogg Vorbis and Ogg Theora!)

  • CSV to Address Book Importer

    Mostly for my own reference, here’s an awesome CSV to vCard webpage which will import CSV data, and output vCard (.vcf) format files. This is rather useful if you have masses of contacts to import into Apple’s Address Book program. Bonus coding-fu points for being totally implemented in Javascript!

  • I'm 100% smart!

    (Warning: formatting is borked. Sue me for being lazy with copy’n’paste.)











    Your brain: 25% interpersonal, 15% visual, 25% verbal, and 35% mathematical!


    Congratulations on being 100% smart! The above score breaks down what kind of thinking you most enjoy

    doing. It says nothing about how good you are at any one, just how interested
    you are in each, relatively. A substantial difference in scores between two people means, conclusively, that they are different kinds
    of thinkers.


    Matching Summary:
    Each of us has different tastes. Still, I offer the following advice, which I think is obvious:



    1. Don’t date someone if your interpersonal percentages
      differ by more than 50%
      .


    2. Don’t be friends with someone if your verbal percentages
      differ by more than 60%
      .

    3. Don’t have sex with someone if their math percentage
      is over 50%
      .



    Update, April 2005:
    Try my new test, the 3-Variable Purity Test
    .








    My test tracked 4 variables How you compared to other people your age and gender
    :























    You scored higher than 70%
    on interpersonal







    You scored higher than 11%
    on visual







    You scored higher than 70%
    on verbal







    You scored higher than 48%
    on mathematical




    Link: The 4-Variable IQ Test written by chriscoyne on Ok Cupid
  • Coding Fonts

    I’m frequently surprised whenever I see veteran coders whittling away in Windows using Courier New or some equally horrible monospace font. (Yeah, I know this is all subjective, so if you don’t like my opinions, go back to using Comic Sans MS, OK?) Considering how much you can stare at the screen all day if you’re a professional coder, a readable pleasant font could actually improve your productivity and lifestyle, in every Dilbertesque sense.

    Windows actually comes with a great monospace font that unfortunately seems to be reserved for use by its console windows only. Macintosh folks have been lucky to have had an excellent monospace font (Monaco 9) since its inception in 1984, and UNIX/X11 people have been blessed with truly excellent monospace fonts (schumacher-clean and good ol’ fixed, whoever made that.)

    So, if you’re never thought about your choice of a coding font, check out the following fonts which were made for heavy-duty programmers (complete with slashed zeros; long live the IBM PS/2!). Most of them are available for Windows, the Mac and Linux, too.

  • A Short History of Nearly Everything

    This book has received a hell of a lot of praise from a hell of a lot of people: all I can say is that it greatly deserves it. Bill Bryson manages to make the book both educational and entertaining. I wish this was a textbook that I had to read for high school (in addition to more in-depth textbooks on the particular topic being studied, of course): it’s the only book I’ve read that made geology seem non-boring. (I wouldn’t quite say that it stirred an interest in geology for me, but it at least made me appreciate it as a science, which I never did before.) Even if you do know quite a lot about the Stars and the Earth, it’s worthwhile reading this just to get an idea of the personalities who were behind all the discoveries.

    Best of all, many of the topics it discusses, such as life and the galaxy, gave me back that sense of wonder I had about science and discovery when I was a younger lad. Every time it got me thinking about the beauty of nature and the universe, it brought a smile to my face — and I think it’s worth reading just for that. Highly recommended!

  • An alternative PDF viewer for Windows

    Welp, I finally got sick of Adobe Acrobat Reader 6.0 for Windows. Rather than downgrade to Acrobat Reader 5.0, which definitely sucks less (but still sucks), I Googled around and found an alternative PDF viewer for Windows called Foxit PDF Reader. Wow, double-click on a PDF and a viewer window opens in half a second. It can render fonts using ClearType, and you can select text too. Lightweight goodness.

  • reduce() in Python

    There’s been a reasonable amount of publicity about Guido van Rossum’s comments on the usefulness of the reduce function in Python, but there’s quite an interesting comment on Lambda the Ultimate about how reduce() in Python is quite, well, broken:

    Heh. reduce() is broken in python (in that it’s not actually a fold function), so I don’t blame Guido for not being able to figure it out in his head. Rather than handling the zero- and one-element list cases properly, it (a) doesn’t take a basis element, (b) raises an error on empty lists and © RETURNS THE SINGLE ELEMENT WITHOUT CALLING A FUNCTION ON IT in the one-element case (true even in recursion). … The way it’s defined, reduce is not fold, it’s a broken fold.

    Folding an empty list results in an error? If that is the case, well, it’s no wonder it wasn’t used in Python very much. I’d very much rather Python rip out a half-arsed fold function altogether rather than trying to make it semi-functional (pun intended). That only gives a bad impression about functional programming, and doesn’t benefit anyone. (Disclaimer: I haven’t double-checked the above claim myself, so I don’t know if what Jacob says it’s true. The Lambda the Ultimate folks usually have their heads screwed on very right when it comes to anything to do with programming language semantics, though …)

    For the record, I also disagree with Guido’s assertions that map() and filter() should go away just because list comprehensions exist. map and filter have single purposes: to transform lists, and filter lists. Since list comprehensions can do the job of both map and filter, it’s not immediately obvious what they do, because they now give you more choice, and more choice means less immediate obviousness. If you see a map or filter, you know it’s just doing a list tranformation or a list filter, and that’s it. If you see a list comprehension, you have to read its innards to understand what it’s doing. Or (using Haskell syntax) do you really think [ x | x <- [1..10], isEven x ] more immediately obvious filter (isEven) [1..10]? Considering Python’s heavy emphasis on code readability, that sounds like a step backwards to me.

    Update: As pointed out, if you use an initialiser with reduce(), you get sane behaviour back. That’s good. However, I find it a bit odd that an initialiser is optional, rather than mandatory. (It’s managed to fool at least one user into thinking fold is broken — how many more people had the same misconception?)

    Update #2: Shane Stephens points out that the optional-initialiser-version of reduce() is actually quite useful. Rather than try to repeat it abysmally, I’ll just clag in a part of Shane’s email here:

    … there’s a very good (but possibly non functional-programming-oriented) reason for the optional lack of a basis in python’s reduce function: sometimes you don’t WANT to run the function on a single element. A good example is concatenating strings: reduce(lambda a, b: a + ", " + b, some_array).

    Indeed, this is 100% analagous to the foldl1 function in Haskell, which is the same as a fold, but doesn’t take an initialiser element. So, it looks like half of this article of mine is full of crap. :)