-
ext2fs IFS
Well, some kind-hearted soul has finally written a kernel-mode Installable File System (IFS) ext2 driver for Windows NT/2000/XP. While it ain’t no reiserfs driver for Mac OS X (now that’d be worth some serious restecp), it’s still rather schmick. Plus, now that free kernel-mode ext2 drivers are available for all the major desktop operating systems, hopefully we’re one step closer to destroying FAT as the lowest common denominator filesystem once and for all…
-
Can Asians Think?
Yeah, sure, you could say that this book has a bit of controversial title. The reason I was interested in it was because I read an interview with the author, Kishore Mahbubani, on a random Web site about a year ago, and he sounded like he had some pretty interesting things to say about the world, politics, and the Asian/European dichotomy. Of course, after reading the half-page biography spiel on Mahbubani, I shouldn’t have been surprised: it turns out that he’s Singapore’s ambassador to the United Nations.
The reason for the controversial title (other than to make people give it more than just a passing glance at the bookstore, I suppose) is this question that Mahbubani poses: on the total timeline that humanity has been present on this Earth, the East (including the Middle East) have been the dominant civilisation until very recently. To an outside observer, it seems quite incredible that Europeans have ascended so quickly, so fast: in 1500 years, they’ve gone from being the most backwards culture to being the world leaders in almost every respect. The simple question that Mahbubani asks is: why, and how, did this happen?
Once you get past the first few essays, however, it’s clear that this historical question is just a teaser: Can Asians Think covers much more ground than just that. For example, the book discusses the conflicting agendas of the United States and the United Nations, gives insight into the moral and ethical values of the more traditional Asian mindset (which many Australians may be interested in reading given Singapore’s recent capital punishment of Nguyen Tuong Van), says quite frankly why the imposition of democracy on lesser-developed countries is doomed to fail, and talks about the occupation of Cambodia by Vietnam and the Khmer Rouge.
People who have grown up being truly exposed to both the Western and Asian mindsets will probably not get a huge amount out of the book, simply because they will most likely understand and agree with much of what Mahbubani wants to say. I’m reluctant to state whether people who have been exposed to only either the Asian or Western mindset will find the book useful, but only because I haven’t given it yet to any of my Intelligent Worldly Friends™ I consider to be in those categories and discussed the issues in the book with them yet. I am, however, very keen on doing exactly this. The book talks about some damn interesting topics, and if it can generate intelligent (perhaps heated) discussion at a dinner table, it’s hit its mark, has it not?
About the only criticism I have about the book is that the essays now seem a bit dated, even if the oldest ones were only written around 15 years ago. It would be a much more compelling read, for example, to see his opinion on the United States’s reaction to September 11, 2001, their recent opposition against the United Nations, and his thoughts on the occupation of Iraq given his views on the spread of democracy before economic development. It would also be interesting to read about his thoughts on post-British Hong Kong, and China’s incredible economic growth since the turn of the century. However, it’s impossible to fault the book for this lack of discussion: even mathematics textbooks can become outdated at some stage of their life :).
Highly recommended.
-
iTunes Video Quality vs DivX
I finally found some free time this week to watch the modern Battlestar Galactica TV series, which I bought from the iTunes Music (neÈ video) Store. (As an aside, Battlestar Galactica is absolutely awexome — but that’s a whole ‘nother story).
I actually have DivX versions of the episodes that can be obtained from the usual places where people obtain DivX versions of TV episodes. I decided to buy the episodes from iTunes anyway, to see how they’d compare in quality to the DivX ones. I’m not particularly surprised to say that the quality of the iTunes videos are slightly worse than the DivX versions floating around: there are some people who are pretty damn crazy and spend weeks tweaking their DivX video encoding parameters to make them look really good. Thanks to the rabid fanbase on P2P distribution networks that demand very high video quality, you also generally find that most videos on P2P networks have been lovingly hand-tweaked and encoded quite well.
(Note: I’m using the term DivX to mean the whole plethora of MPEG-4 video codecs, such as the “real” DivX, xvid, 3ivx, etc. You can start endless debates about which codec is better than the rest for encoding particular types of motion video, and that’s not my goal here.)
However, even though the iTunes video versions aren’t quite as good quality as the DivX versions that you find floating around on the ‘net, it’s not quite that simple:
- First, I was playing the videos on a 1GHz Powerbook G4, which may not quite be powerful enough to do decent post-processing on the H.264-encoded video. iTunes uses QuickTime for its video playback, and QuickTime is a pretty adaptable beast: if your CPU isn’t powerful enough to perform decent post-processing, it simply will make the frames look worse rather than dropping frames, even resorting to simple linear sampling to perform scaling if absolutely necessary. It’s entirely possible that the videos would look much better on a high-end computer such as a modern Athlon system or a Power Mac G5.
- The iTunes videos were encoded at 320×240, which is much lower than typically encoded DivXs (the Galactica DivXs that I had were encoded at 640×352). This also means that the iTunes videos weren’t widescreen, for those of you lucky punks who have 16:9 screens.
- I was playing the videos on a TV, which has a lower resolution than on a computer monitor. The raw resolution of the videos don’t make such a big difference because of this, which partially negates the last point. I should point out that the TV I was watching it on was pretty big (42”), so it’s still very easy to see encoding artefacts.
- The iTunes videos were much more colour-accurate than the DivX versions: all the DivX encodes I’ve seen were far less saturated. (I’m sure that it’s possible to get DivX versions that are more colour-correct; I’m just going on the DivX videos that I have.) A/B’ing the iTunes video and the DivX on the TV, I’d actually say that the richer colour on the iTunes version more than compensated for the DivX’s increased resolution, and made the ‘feel’ of the video better overall. Except…
- There were some very visible blockiness during the space combat sequences of Battlestar Galactica: outer space is quite black, and the H.264 encoder that Apple uses on its videos decided to seriously quantize the black bits and produce large blocks of visible non-colour-matching blackness. I suspect this would be less of a problem for non-sci-fi series, and this problem didn’t come up very often, but the encoding artefacts were bad enough that they did detract from the whole cinematic experience when they appeared.
- The iTunes videos were much smaller; part 2 of the Battlestar Galactica mini-series was ~400MB for iTunes, vs ~700MB for DivX.
Overall, I was generally happy with the iTunes versions of the TV episodes except for the blockiness during the space combat scenes. It’d be interesting to play the episodes on a PC or Mac with some grunt (or a 5G video-capable iPod), and see if the blockiness disappears due to better post-processing. If it does, I’d be tremendously happy with them.
So, if it were pretty much any other TV series, I’d be pretty happy with buying them from the iTunes store, but Battlestar Galactica is looking like it’ll be my favourite hard(ish) sci-fi series ever, so I’ll probably hunt down the HD broadcasts or buy the DVDs at some point. I feel that the USD$2 per episode at the iTunes store is very well-priced, and that it’s cheap enough to sus out a couple of episodes before deciding that (a) you’re happy with the quality, or (b) you’ll chase down the DVDs because the quality isn’t good enough for you and you’re a big fan of the show.
Obviously, there are other reasons besides just technical ones in the iTunes store vs P2P debate, such as where you personally lie on the ethical compass about giving money back to the people who produce the series and the distribution houses, what your stance on iTunes’s DRMS policy is, and also the ease of buying stuff on iTunes vs the ease of searching on P2P networks. I think that the videos available on the iTunes store are a good first step in the right direction, though. Technically, though, I’m reasonably happy with the iTunes videos, and would certainly buy from the store again.
-
IBM Model M now in USB
-
Your Laptop LCD vs the Sun
If you’re like me and quite enjoy cafÈ-style computing, you’ve no doubt tried to use your laptop sometimes in some pretty harsh sunlight. LCD backlights just aren’t powerful enough to compete with our lovely life-giving star, so usually I have a lot of trouble reading stuff on the screen in bright sunlight.
The solution? Try inverting your screen colours, so that black comes out white, and white comes out black. You’ll be amazed just how much more readable white-on-black is in bright lighting than black-on-white, and also how little you’ll have to set your screen brightness to properly read stuff:
- Mac OS X: Ctrl-Option-Command-8
- Windows: Run the Magnifier utility and select Invert Colors.
I don’t know if there’s a way to invert colours on UNIX systems (XFree86/X11): if somebody’s keen enough to find out and drop me an email, I’ll add the information in here. (Of course, all you hardcore UNIX geeks who run white-on-black terminals will now get black-on-white terminals instead. Ahh well, just screen invert back when you’re in a terminal I suppose!)
As an added benefit, some laptop LCDs also seem to get longer battery life when they do this. Kudos to this Mac OS X hint for the heads-up on this!
-
Perfume
Perfume’s a fascinating book written by Patrick S¸skind; it’s set in the 18th century, and is about the story of Jean-Baptiste Grenouille, a person born with an unearthly sense of smell. It’s fascinating for S¸skind’s portrayal of what’s possible when you have this incredibly keen sense that gives you so many opportunities about life that you’ve never even imagined of, from being able to smell lost pocket change from across to the room to passing through crowds undetected. I also enjoyed S¸skind’s tangents and diatribes about the secondary characters partially because the pages he spends on them adds a lot to the atmosphere, but also because plenty of it is just downright amusing.
Unusually, though, I didn’t find it find it a particularly compelling read: it wasn’t a book that made me want to keep reading to find out what happens next. I’m not saying that makes it a bad book — I think it’s an excellent read — merely that I didn’t find I had the urge to read it, which a characteristic that I usually associate with uninteresting books. However, I’m glad I did persist in reading it: the ending is clearly the peak of the book, and finally unveils the full awe of the protagonist’s superhuman scent abilities that S¸skind has been building up since the very beginning.
Recommended reading, though if you’re like me, you may need some willpower to persist to the good bits (i.e. the ending).
-
Star Wars, Salvatore, Vector Prime, and Knights of the Old Republic
I played the computer role-playing games Star Wars: Knights of the Old Republic I and II a while ago, and KoTOR II was up there with the immortal Planescape: Torment and Fallout 2 as the best RPG I’ve ever played. They presented the Star Wars universe in a whole new light that the movies don’t even hint at; I was actually annoyed that Star Wars III was such a Steaming Pile of Sith because KoTOR I and II’s production values were just orders of magnitudes better — to the point where I felt the movies actually did some severe injustice to the Star Wars universe that it founded. If you don’t know me that well, you’ll have to take it as a given that I really don’t get annoyed with movies very often; it’s just sad to see that such a rich world full of rich characters has such a bad reputation because the movies don’t give it any depth.
(I am completely aware that this all makes me sound like a raving militant geek, by the way.)
So, as an attempt to explore more Star Wars stuff, I picked up Vector Prime, the first of the books in the series about the New Jedi Order, written by R. A. Salvatore. I really wanted to like this book, especially considering Salvatore wrote it and I respect him greatly as a fantasy author. (I’d like to remind people who think Drizzt and the Forgotten Realms are totally clichÈ, that the whole dark elf genre didn’t exist until Salvatore brought it to the greater public and RPG awareness. Even if you don’t like his characters or the setting he writes in, he still writes the most vivid combat scenes out of any author I’ve ever read.) To my minor disappointment, I thought Vector Prime was pretty average. Maybe it’s because I was unjustifiably comparing its storyline to the one I experienced when I played KoTOR II, or maybe it’s because I’ve been reading “higher” literature lately such as the Unbearable Lightness of Being, but Vector Prime just seemed to be a bit… rushed, I think. Too much happening, with not enough substance on the new characters you meet (as opposed to the portrayal of Luke, Leia, Han and Chewbacca, which were done perfectly).
You know that when you read a really good book, or (much more rarely) played an incredible computer game, you were glad you did because it added something to your life, and that you learnt something from it? Vector Prime’s plot didn’t evoke those kind of feelings. I put it in the category of good, enjoyable sci-fi, but you’re not missing out on much if you don’t read it.
So, Vector Prime’s an adequate introduction to the Star Wars universe, but for now, the Knights of the Old Republic games represent everything that’s awesome about Star Wars. KoTOR II, in particular, is to be highly commended for exploring some pretty interesting philosophical issues while working within the confines of a licensed world where the artists and storytellers were restricted in what they were allowed to do. I find it a bit of a shame that the computer games bring out the best in the genre, because books are just so much more accessible to the general public than computer games, so a lot of people just won’t experience what an excellent plot setting the Star Wars universe can be. I’d love to see a good novel adaptation of the KoTOR plot lines, but somehow I don’t think that’ll ever happen.
Long story short: Vector Prime was pretty average, while KoTOR I and II rocked. KoTOR I is much more accessible than II since BioWare are incredibly talented at writing mainstream CRPGs, whereas KoTOR II throws you in the deep end: it’s much darker and gritty, but ultimately more rewarding thanks to ex-Black Isle folks being responsible for its development. If you’re into RPGs at all, do yourself a favour and play them.
-
IHT on Nguyen Tuong Van
I normally don’t post about current affairs, but there’s an excellent article on the International Herald Tribune about Nguyen Tuong Van’s execution, and its effects on the minds of the Australian public, and Australia-Singapore relations:
Singapore’s dawn execution Friday of Nguyen Tuong Van, a convicted Australian drug smuggler, may ultimately raise fewer questions about Singapore’s rigorous penal code than it does about Australia’s readiness to integrate with rapidly developing Asian neighbors that do not share its views on human rights and other basic issues.
Now, back to your regularly scheduled tech blogging…
-
The Old vs the Different
Rosyna Keller writes an interesting blog entry about patching some bugs in Apple’s Safari and Preview applications. All good and well, but if you’re a veteran Unix hacker, the following statement will likely catch your eye:
In a perfect world paths would never be used in software. They’re evil.
It’s interesting coming from a Unix-centric background that there may be ways to refer to things on your filesystem with something—anything—other than a path (and inodes don’t really count). In a similar fashion to groupthink, the idea of paths as the Primary Way of locating files have been so ingrained into Unix culture that it’s quite hard to think about anything else.
The operating system world is so largely dominated by Unix and Windows these days that it’s hard to conceive of other ways of doing basic things like naming files. I greatly respect people like Hans Reiser who are trying to advance the state of computing, and have to fight tooth and nail with traditionalists to do so. (Note that I’m not saying tradition, nor Unix, is bad: it’s just not a good enough excuse to reject new ideas that might conflict with it.)
I wonder if Unix (or at least Linux) will ever have something as user-friendly as the Mac’s aliases to locate files? It is kind of nice that, you know, you can actually move a file to somewhere else on your disk and the application will automagically know where it is anyway. You’d think that in 30+ years of computing, we’d be able to do at least that by now.
-
The Unbearable Lightness of Being
Wow. How on Earth does one do justice to such a classic book with a little, meagre blog entry? There are plenty of comprehensive reviews of it already on Amazon.com, so I encourage you to read those reviews and descriptions if you’ve never heard of the book. It’s apparently pinned as a difficult-to-read book, but I found the writing style quite conversational, and easy to put down and pick up where you left off (unlike those evil books which you just can’t put down even when it’s 5am and you really should be going to bed so you can stay awake at work the next day). One thing that surprised me about it is that it’s more recent than I expected: from what I can gather, the first publishing date is in 1984.
(Note: spoilers follow!)
While I loved pretty much every part of the book, the most striking bits for me were:
- Milan Kundera’s vivid descriptions of Karenin, Tomas and Tereza’s dog. I don’t think I’ve ever been moved so much about an animal as when I read about how joyful Karenin was about his daily activities, and later in the book when he’s not so joyful. I didn’t quite shed a tear, but the descriptions evoked some serious happiness and sadness.
- Kundera’s thoughts about “what happens once happens not at all”, and the idea that chance is what defines your life. It’s only a short paragraph or two, but the description of the six unlikely events that led Tereza to meet Tomas has stuck with me long after reading it.
- The idea that a man (ahem, in this politically correct age, I mean, a person) is defined by the heavy decisions he makes. It’s interesting to note which philosophers Kundera refers to when he compares lightness and heaviness, and how some viewed lightness as a Good Thing and heaviness and weightiness as a Bad Thing.
- The whole idea of monogamy: is sleeping around on your partner an acceptable thing to do? Can it be forgiven in some circumstances, or for some people? Is anybody who sleeps around when they’re married a Bad Person for breaking the vow of marriage (which, I’d like to point out for the record, I take pretty seriously)? I don’t know. Is anything in this world so black and white? Are relationships so important and sacred that they’re not also susceptible to the laws of complexity?
Es muss sein, es muss sein, es muss sein. Immense thanks to the person who gave me this book; my life is certainly richer for it!
-
My South Park Character
For those who haven’t seen the awexome South Park Character Studio yet:

Ice cream in the left hand, skis on the feet. Aww jeah.
-
Your code as a filesystem
Ever wanted to view the classes and methods in your code via FTP? If not, why not?
-
My Cyborg Name
-
Mighty Mouse
I wrote up some first impressions of Apple’s new Mighty Mouse on the Whirlpool forums, if anyone’s curious. The things appear to be selling like hotcakes at my local AppleCentre!
-
Patterns in Software
Paul Graham writes in his “Revenge of the Nerds” article:
… in the OO world you hear a good deal about “patterns”. I wonder if these patterns are not sometimes evidence of … the human compiler, at work. When I see patterns in my programs, I consider it a sign of trouble. The shape of a program should reflect only the problem it needs to solve. Any other regularity in the code is a sign, to me at least, that I’m using abstractions that aren’t powerful enough — often that I’m generating by hand the expansions of some macro that I need to write.
-
Language Optimisations vs Domain-Specific Optimisations
To quote part of the abstract from Arch D. Robinson’s awesome paper, The Impact of Economics on Compiler Optimization:
Compile-time program optimizations are similar to poetry: more are written than are actually published in commercial compilers. Hard economic reality is that many interesting optimizations have too narrow an audience to justify their cost in a general-purpose compiler, and custom compilers are too expensive to write. This has already happened accidentally for C++, albeit imperfectly, in the form of template metaprogramming.
In a nutshell, writing optimisations is hard. Often, it’s too much of an engineering effort to implement tons of optimisations in a production-quality compiler: the gains you see simply aren’t worth the amount of effort. I won’t ramble on about this, since that’s the focus of Robinson’s paper, and it’s an enlightening read if you’re interested in that topic. (It’s also an enlightening read of you’re wondering what all the fuss is about with C++ templates.) Related to Robison’s paper is a talk given by Bill Pugh, titled “Is Code Optimization Research Relevant?”. One standout slide from that talk is this one:
18 years from now, if we pull a Pentium III out of the deep freeze, apply our future compiler technology to SPECINT2000, and get an additional 2x speed improvement … I will be impressed/amazed.
And Bill is pretty much right. But I won’t talk about whether research on optimisations is relevant or not — again, have a browse of Bill’s talk if you want to debate that with him.
What I do want to talk about is that both Robinson’s paper and Pugh’s talk both hint at something which is never explicitly stated: the successful optimisations which have been done in the past few years are mostly domain-specific optimisations. These are optimisations which apply to only to a particular problem area, e.g. graphics (thus the word “domain” in domain-specific). Pugh gives the example that optimising matrix multiplication is quite successful: here, the domain that is being optimised is matrices, a well-defined and well-known area of maths. Robinson makes the point that C++ templates are successful because they can be used to create domain-specific optimisations, since they can be used to meta-program the compiler.
One interesting example of a domain-specific optimisation are the vector units on a modern desktop system: AltiVec on the PowerPC, the PlayStation 2’s Emotion Engine, MMX/SSE on Intel x86s. While they’re not part of the compiler, they are a perfect example of just how well you can optimise code when you start having domain-specific constructs available (in this case, vector operations). Modern-day programmable graphics cards such as the latest NVidias and ATI Radeons are proof that native language (and hardware) support for vectors can reap massive speed benefits, and IBM’s new Cell CPU begs for properly vectorised code to get any decent performance out of it. The point of all this is: if your programming language natively supports expressing the problem domain you want to solve, you can really optimise the hell out of it.
In the future, I hope that languages or compilers will enable us to easily write domain-specific optimisations, because language optimisation research — especially for imperative languages — simply aren’t going to give us that much of a speedup anymore. Look at the number of optimisation options in the gcc manpage and count how many of them will really give you a significant speedup. Beyond some basic, well-known optimisations, such as constant propagation and inlining, are the rest of those obscure optimisations really worthwhile? Is it worth it to put the engineering effort into those optimisations when you not only have to code them up, but also maintain them and make sure that they don’t cause optimised program to behave differently to non-optimised programs?
I’d rather that all that engineering effort be put into making the language and compiler more extensible, so that libraries can come bundled with their own optimisations that can be added to the compiler. This potentially gives a much greater speed increase. In low-level languages such as C, this doesn’t make such a big difference because you’re programming so close to the hardware (though it certainly can sometimes: observe the success of C++ templates). High-level languages that enable the programmer to more closely express the problem domain in the language, such as Python and Haskell, have much more to gain.
-
Flash Player 8 public beta for Mac
Macromedia’s Flash Player 8 has entered public beta testing. For Mac OS X folks, the most significant change is that, well, it finally doesn’t suck. Or, to put it in another way, it doesn’t feel like you’re running it on a 16Mhz 68000. Finally, enjoy the delights of Strong Bad and godskitchendigital without Flash grinding 100% of your CPU!
With joy, I can scratch “write Safari plugin from open-source Flash implementation” off my TODO list …
Update: Flash Player 8 is now out of the beta-testing phase. You can download the full version from Macromedia’s Flash download page.
-
Valgrind vs C and C++
From an interview with Julian Seward, author of the superb Valgrind (as well as cacheprof, bzip2, and a co-author for the Glorious Glasgow Haskell Compiler: quite a remarkably productive fellow, huh?):
Valgrind is loaded with assertion checks and internal sanity checkers which periodically inspect critical data structures. These are permanently enabled. I don’t care if 5 percent or even 10 percent of the total run-time is spent in these checksóautomated debugging is the way to go. As a result, Valgrind almost never segfaultsóinstead it emits some kind of a useful error message before dying. That’s something I’m rather proud of.
Nice indeed; I wonder if programming languages of the future will be able to do automatic assertions of such data structures in their run-time systems. All you’d need is to annotate the structures with some simple boolean conditions, and the language can merrily check them whenever a garbage collection pass is executed (since programming languages of the future will all have automatic memory management, of course. Right? Helllllllo?)
And, one more little quote (sorry, I couldn’t resist):
Valgrind is only useful because C and C++ are such crappy programming languages.
A-men to that, Haskell brother. Snigger snigger snigger …
-
Endianness
From Apple’s Universal Binary Programming Guidelines:
Note: The terms big-endian and little-endian come from Jonathan Swiftís eighteenth-century satire Gulliverís Travels. The subjects of the empire of Blefuscu were divided into two factions: those who ate eggs starting from the big end and those who ate eggs starting from the little end.
Good to see Apple addressing the important questions in their guides.
-
godskitchendigital
It’s been about a month now since I received an email about this, and I haven’t seen it mentioned anywhere else yet. If you’re into electronica/dance music and have been looking for a decent online music store to buy tracks from, check out godskitchendigital. The name is slightly misleading: they thankfully sell lots of stuff, not just God’s Kitchen CDs. Some interesting bits of information about the site:
- They have a pretty good selection of electronica available, and carry quite a few tracks that aren’t available even at the iTunes music store. I managed to track down some Satoshi Tomiie tracks there that I haven’t seen anywhere else.
- The music file quality is very impressive: pick and choose between 320k (LAME-encoded) MP3, 192k M4A (MPEG-4 audio), or, for another 50c, get the .WAV files instead (!). Note that they have a weird system where if you order a .WAV, you get shipped it on a CD rather than just downloading it. No, I don’t understand that either, but it’s nice to see they offer it as an option. For all the iPod owners, the 192k M4A files work perfectly fine in both iTunes + iPod.
- 100% Flash interface. An interesting idea, though I’m sure it’s going to annoy the living hell out of Mac users, where the Flash plugin is unexplainably slow as molasses.
- The big feature: no DRM. None. At all. If you download a 320k MP3, that’s exactly what you get: a 320k MP3, with properly formatted ID3 tags. No weirdass player you have to use, no iTunes music store-style M4P protected media. This is real nice indeed; I wonder what their legal department had to do to pull this one off.
So, if you like electronica, go check it out. The all-Flash interface might not be that appealing (especially for Mac users), but the selection is good, the price is reasonable (especially for electronic music, where you tend to want singles/EPs more than albums) and the downloads are excellent quality. Oh yeah, and no DRM!
