…on Software

A Call For A Filesystem Abstraction Layer

Filesystems are fundamental things for computer systems: after all, you need to store your data somewhere, somehow. Modern operating systems largely use the same concepts for filesystems: a file’s just a bucket that holds some bytes, and files are organised into directories, which can be hierarchical. Some fancier filesystems keep track of file versions and have record-based I/O, and many filesystems now have multiple streams and extended attributes. However, filesystem organisation ideas have stayed largely the same over the past few decades.

I’d argue that the most important stuff on your machine is your data. There are designated places to put this data. On Windows, all the most important stuff on my computer should really live in C:\Documents and Settings\Andre Pang\My Documents. In practice, because of lax permissions, almost everyone I know doesn’t store their documents there: they splatter it over a bunch of random directories hanging off C:\, resulting in a giant lovely mess of directories where some are owned by applications and the system, and some are owned by the user.

Mac OS X is better, but only because I have discipline: /Users/andrep is where I put my stuff. However, I’ve seen plenty of Mac users have data and personal folders hanging off their root directory. I’m pretty sure that my parents have no idea that /Users/your-name-here is where you are meant to put your stuff, and to this day, I’m not quite sure where my dad keeps all his important documents on his Mac. I hope it’s in ~/Documents, but if not, can I blame him? (UNIX only gets this right because it enforces permissions on you. Try saving to / and it won’t work. If you argue that this is a good thing, you’re missing the point of this entire article.)

One OS that actually got this pretty much correct was classic Mac OS: all system stuff went into the System folder (which all the Cool Kids named “System ƒ”, of course). The entire system essentials were contained in just two files: System, and Finder, and you could even copy those files to any floppy disk and make a bootable disk (wow, imagine that). The entire rest of the filesystem was yours: with the exception of the System folder, you organised the file system as you pleased, rather than the filesystem enforcing a hierarchy on you. The stark difference in filesystem organisation between classic Mac OS and Mac OS X is largely due to a user-centric approach for Mac OS from the ground-up, whereas Mac OS X had to carry all its UNIX weight with it, so it had to compromise and use a more traditionally organised computer filesystem.

As an example, in Mac OS X, if you want to delete Photoshop’s preferences, you delete the ~/Library/Preferences/com.adobe.Photoshop.plist file. Or; maybe you should call it the Bibliothèque folder in France (because that’s what it’s displayed as in the Finder if you switch to French)… and why isn’t the Preferences folder name localised too, and what mere mortal is going to understand why it’s called com.adobe.Photoshop.plist? On a technical level, I completely understand why the Photoshop preferences file is in the ~/Library/Preferences/ directory. But at a user experience level, this is a giant step backwards from Mac OS, where you simply went to the System folder and you trashed the Adobe Photoshop Preferences file there. How is this progress?

I think the fundamental problem is that Windows Explorer, Finder, Nautilus and all the other file managers in the world are designed, by definition, to browse the filesystem. However, what we really want is an abstraction level for users that hides the filesystem from them, and only shows them relevant material, organised in a way that’s sensible for them. The main “file managers” on desktop OSs (Finder and Windows Explorer) should be operating at an abstraction level above the filesystem. The operating system should figure out where to put files on a technical (i.e. filesystem) level, but the filesystem hierarchy should be completely abstracted so that a user doesn’t even realise their stuff is going into /Users/joebloggs.

iTunes and iPhoto are an example of what I’m advocating, because they deal with all the file management for you. You don’t need to worry where your music is or how your photos are organised on the filesystem: you just know about songs and photos. There’s no reason why this can’t work for other types of documents too, and there’s no reason why such an abstracted view of the filesystem can’t work on a systemwide basis. It’s time for the operating system to completely abstract out the filesystem from the user experience, and to turn our main interaction with our documents—i.e. the Finder, Windows Explorer et al—into something that abstracts away the geek details to a sensible view of the documents that are important to us.

One modern operating system has already done this: iOS. iOS is remarkable for being an OS that I often forget is a full-fledged UNIX at its heart. In the iOS user experience, the notion of files is completely gone: the only filenames you ever see are usually email attachments. You think about things as photos, notes, voice memos, mail, and media; not files. I’d argue that this is a huge reason that users find an iPhone and iPad much more simple than a “real” computer: the OS organises the files for them, so they don’t have to think that a computer deals with files. A computer deal with photos and music instead.

There are problems with the iOS approach: the enforced sandboxing per app means that you can’t share files between apps, which is one of the most powerful (and useful) aspects of desktop operating systems. This is a surmountable goal, though, and I don’t think it’d be a difficult task to store documents that can be shared between apps. After all, it’s what desktop OSs do today: the main challenge is in presenting a view of the files that are sensible for the user. I don’t think we can—nor should—banish files, since we still need to serialise all of a document’s data into a form that’s easily transportable. However, a file manager should be metadata-centric and display document titles, keywords, and tags rather than filenames. For many documents, you can derive a filename from its metadata that you can then use to transport the file around.

We’ve tried making the filesystem more amenable to a better user experience by adding features such as extended attributes (think Mac OS type/creator information), and querying and indexing features, ala BFS. However, with the additional complexity of issues such as display names (i.e. localisation), requiring directory hierarchies that should remain invisible to users, and the simple but massive baggage of supporting traditional filesystem structures (/bin/ and /lib/ aren’t going away anytime soon, and make good technical sense), I don’t think we can shoehorn a filesystem browser anymore into something that’s friendly for users. We need a filesystem abstraction layer that’s system-wide. iOS has proven that it can be done. With Apple’s relentless progress march and willingness to change system APIs, Linux’s innovation in the filesystem arena and experimentation with the desktop computing metaphor, and Microsoft’s ambitious plans for Windows 8, maybe we can achieve this sometime in the next decade.


Gmail Losing Emails?

Like a lot of other folks, I’d switched over to Gmail my primary email account. Their Web interface is great, and Gmail’s spam filtering is possibly the best I’d ever seen. However, there was one rather small problem, where by “rather small problem” I mean “kinda huge problem”: I was losing emails. As in, I know the person had sent me emails, and I never received them. Yep, I checked the spam folder. The emails never showed up1.

I was willing to forgive this once or twice, seeing as how complicated and fragile all these SMTP shenanigans is. (Seriously, SMTP has to contend with FTP for the Most Stupid Protocol Ever Award.) However, after Gmail lost emails three or four times and I received the emails successfully at my other, non-Gmail accounts, I couldn’t ignore the problem any longer. The last straw was when one of my friends forwarded me an email three times from another Gmail account and none of the mails came through.

I’ve since switched to Pobox.com and have been a happy chappy since. Pobox’s spam filtering isn’t quite as good as Gmail’s, but it’s good enough, and their once-per-day spam report where you can simply click on a false positive spam to whitelist and retrieve it is just brilliant. That feature alone is worth the $20/year. If they had an email forwarding address where I could send them the rest of my spams to improve their overall spam training, Pobox would be perfect. If you’re looking for a powerful, reliable email forwarding service, I can recommend Pobox without hesitation.

So, here’s a question: has anybody else out there lost emails with Gmail? Surely it must’ve happened to somebody besides me. (Oh, and if you read this, work for Google and would like to figure out what’s going on, drop me a mail: I have the Message-IDs of at least a couple of the emails that were lost. Maybe we can all work this out.)

1 The first time I experienced any email lossage with Gmail was, very unfortunately, a business-related mail: one of our RapidWeaver customers had a Gmail address, and despite me sending two or three emails to him, he claimed never to have never received them. Of course, said customer thought that our customer support was rather lacking when he never received an email within a month, despite me sending one off within 14 hours of seeing the problem. A small drama ensued, threats were being made to post about our lack of customer care to the front page of Digg, etc etc. Thankfully everything was sorted out at the very last minute and unhappy people were made happy again, but geez, it’s a nice reminder of how things can go wrong very fast when communication channels break down.


One-Minute Email Delay FTW

I reckon that after composing and sending an email, email programs should have a one-minute delay before it actually sends off your email to its recipients. I find that a lot of the time, I want to make one tiny edit to a message or forgot to say something—two seconds after I actually hit the Send button, of course.

A one-minute delay on all sent email isn’t going to kill anyone, and gives you a nice time frame to make that one last edit to your email before it goes out. (One of the nice things about working offline is that I after I compose an email, I can keep editing it until I rejoin the Intertubes, since my Outbox only gets processed when I go back online.)


On Civil Debate

Compare the response given by David Heinemeier Hansson to Alex Payne in the recent Rails and scaling controversy, to Ingo Molnar’s response to Con Kolivas regarding the new Modular Schedule Core in Linux. Which community would you rather be part of based on this little sample?

(Somewhat ironic since it was Hansson himself that said “It’s no[t] the event that matters, but the reaction to it”, as well as being an evangelist for the It Just Doesn’t Matter principle.)



Go Microsoft:


VMware Fusion Beta 3 vs Parallels

Parallels Desktop for Mac was the first kid on the block to support virtualisation of other PC operating systems on Mac OS X. However, in the past fortnight, I’ve found out that:

  1. Parallels allocates just a tad too many unnecessary Quartz windows1, which causes the Mac OS X WindowServer to start going bonkers on larger monitors. I’ve personally seen the right half of a TextEdit window disappear, and Safari not being able to create a new window while Parallels is running, even with no VM running. (I’ve started a discussion about this on the Parallels forums.)
  2. Parallels does evil things with your Windows XP Boot Camp partition, such as replace your ntoskrnl.exe and hal.dll file and rewriting the crucial boot.ini file. This causes some rather hard-to-diagnose problems with some low-level software, such as MacDrive, a fine product that’s pretty much essential for my Boot Camp use. Personally, I’d rather not use a virtualisation program that decides to screw around with my operating system kernel, hardware abstraction layer, and boot settings, thank you very much.

VMware Fusion does none of these dumbass things, and provides the same, simple drag’n’drop support and shared folders to share files between Windows XP and Mac OS X. I concur with stuffonfire about VMware Fusion Beta 3: even in beta, it’s a lot better than Parallels so far. Far better host operating system performance, better network support, hard disk snapshots (albeit not with Boot Camp), and DirectX 8.1 support to boot. (A good friend o’ mine reckons that 3D Studio runs faster in VMware Fusion on his Core 2 Duo MacBook Pro than it does natively on his dedicated Athlon 64 Windows machine. Nice.) The only major feature missing from VMware Fusion is Coherence, and I can live without that. It’s very cool, but hardly necessary.

Oh yeah, and since VMWare Fusion in beta right now, it’s free as well. Go get it.

1 Strictly speaking, allocating a ton of Quartz windows is Qt’s fault, not Parallels’s fault. Google Earth has the same problem. However, I don’t really care if it’s Qt’s fault, considering that it simply means running Parallels at all (even with no VM open) renders my machine unstable.



I was cleaning up my room the other day, and lo and behold, look what I found...

That, sir, would be the entire 147-page printed manual for FrontDoor 1.99b, an endearing piece of software for all of us who used to run BBSs1. FidoNet, SIGNet and AlterNet indeed. (For all you BinkleyTerm chumps, yeah, I ran that as well, with the holy trinity of BinkleyTerm, X00 and Maximus all under OS/2. Don’t even get me started on ViSiON-X, Oblivion/2, Echo forums and all that stuff… oh, I dread to think the number of hours I must’ve spent looking at every single BBS package under the sun.)

Ah, but the BBS as we know it is dead, Jim. Long live the Internet!

1 And hey Mister Ryan Verner: yes, I ran it with the BNU FOSSIL driver for a while ;-).


Design and Taste in Open-Source Software

I had a email conversation with Jeff Waugh a long time ago about design and taste in open-source software, which Jeff encouraged me to blog about. However, every time I tried to put the email into a blog article, it lost the original feel of what I was trying to say. Kathy Sierra’s superb keynote at Linux.conf.au 2007 on Creating Passionate Users inspired me to publish it more-or-less verbatim here so it wouldn’t be delayed for any longer. (Perfection being the enemy of Good and all that.) As such, here ‘tis:

… something else that I’ve been musing about in the past week is that there’s a really interesting culture difference between the Mac OS X community and the Linux community.

The Mac community thrives on shareware applications: things that cost anywhere between $5-$50. RapidWeaver, a $40 Web application creation program, is apparently used for over 3000 Web pages… There are plenty of Mac shareware developers who make enough money from their software that they can do it for a living, professionally. Wil Shipley, the author of Delicious Library… claimed he had $50,000 in sales of his first day of Delicious Library.

The interesting culture difference is that the Linux community tends to put out small, useful little programs, but with little polish. This is not a criticism: there’s a lot more programs in the Linux world to do what you want to do, and even though they’re not polished, they do work, and they’re open source whereas Mac software generally isn’t. However, it’s a completely different class of programs to Mac shareware: now that I’ve done a lot of work on a program where the UI is the really important thing, I truly admire the amount of polish and sheer effort that goes into the majority of Mac shareware programs. The icons are beautiful, every part of the workflow is accounted for, and the integration with the rest of the system is superb. That’s what you pay your $5 to $50 for, and the authors charge this because they’ve put a hell of a lot of time and effort into all these things.

The attitude difference is quite a contrast: probably the best way to sum it up is that the Linux community tends to produce cheap’n’cheery tools that they’re very happy to give away and share, whereas the Mac community has a much slower rate of production, but their production values are superb: they are completely unwilling to release stuff that isn’t up to the developer’s highest standards.

What approach do you prefer? If you’re a Linux developer, are you willing to put into practice what Kathy Sierra has to say?


Email Disclaimers

You know those frigging stupid 20-line disclaimers that lots of corporates and law-talking guys1 type insist on putting at the end of their emails? I wonder how much bandwidth would be saved if there was a simple link to a disclaimer policy on a Web server instead of attaching it to the end of every single stupid email. Not that I advocate such disclaimer monstrosities—quite the opposite—but if you’re going to do it, at least be as considerate as possible. I had 7 messages total >200k the other day because it was (1) HTML email, (2) top-posted and quoted the entire previous email, and (3) consisted of 98% email disclaimer and 2% content.

I understand the argument that bandwidth and storage is a technological constraint and that we shouldn’t bitch about archiving 200k because we have 500GB desktop hard disk drives these days, but there’s waste, and then there’s waste.

End rant. Back to happy coding land and preparing slides for Linux.conf.au! (You are going, right! If not, why not?)

1 Note to law-talking guys: I don’t have a beef with you, I have a beef with your people.

This blog article is confidential. If you are not the intended recipient you must not disclose or use the information contained in it. You may or may not be offended. If you have received this article in error please notify ANDRE PANG immediately by email and delete the document from your cache, proxies, and all your base. ANDRE PANG is not responsible for any changes made to a document other than those made by ANDRE PANG or for the effect of the changes on the document's meaning. ANDRE PANG accepts no liability for any damage caused by this article or its attachments (if any) due to viruses interference interception corruption, your own sexual inadequacies or unauthorised access. By the way, ANDRE PANG ANDRE PANG ANDRE PANG ANDRE PANG Google juice all caps 1111one-one-one-one. FFS zomgwtf roflcopter.


John Romero on Apple and NeXT

John Romero celebrates the ten-year anniversary of when Apple bought over NeXT:

We were building fat binaries of the tools for all 3 processors in the office - one .app file that had code for all 3 processors in it and executed the right code depending on which machine you ran it on. All our data was stored on a Novell 3.11 server and we constantly used the NeXTSTEP Novell gateway object to transparently copy our files to and from the server as if it was a local NTFS drive. This was back in 1993!

Indeed: even the most modern Windows and Linux development environments today still feel far inferior to the NeXT platforms in many ways. I’m thankful that the superb technology from NeXT lives on to this day: when anyone argues that the object-oriented paradigm has failed, Cocoa is living proof that it can work, and deliver an order-of-magnitude improvement in development productivity. It’s humbling to think that most of the libraries and frameworks that Mac OS X developers take for grated today existed a dozen years ago, before even Windows 95 was around. If you’re not convinced, watch Steve Jobs’s demo of NeXTSTEP version 3 running on a 50MHz cube — in 1991. Windows Presentation Foundation, Glade/GTK+ and Qt Designer look like stone-age tools compared to what NeXT had fifteen years ago.


Partitions, Logical Volumes, Filesystems...

In the last month, I’ve had to dick around with (Linux) fdisk, gparted, lvm, mke2fs, tune2fs, the menagerie of RAID tools, and (Mac OS X) gpt, fdisk, pdisk, asr, diskutil and hdiutil.

I, for one, truly welcome our new ZFS overlords.


Parallels Desktop adds Boot Camp, native window support

Build 3036 of Parallels Desktop has been announced for all you Linux-on-Mac and Windows-on-Mac fans, and it comes with two very cool new features:

  • You can use your Windows XP Boot Camp partition directly in Parallels. No more disk-space-killing installs of Windows XP as a Parallels disk image alongside Boot Camp! This will save me a good 8GB or so of disk space, which is badly needed on a laptop. A side-effect of this is that it should speed up Parallels’s I/O performance, since it now uses a raw block device for its virtual disk access rather than simply using a large file on a partition.
  • Coherency: Shows Windows applications as if they were Mac ones. I’m guessing that Parallels can overtake Windows’s window manager and somehow displays the window as a native Aqua one. There are some pretty cool screenshots of this feature around.

There’s a ton of other cool new features as well. Delicious!


Die evil Cisco VPN client, die

If you have a VPN at your workplace, chances are good that it’s one of those Cisco 3000 VPN Concentrator things, which seem to be an industry standard for VPN equipment. Chances are also good that you’ve likely been forced to use the evil, evil proprietary Cisco VPN client, which has been known to be a source of angsta majora for Mac OS X and Linux users. (And if you think Windows users have it good, think again: the Cisco VPN client completely hosed a friend’s 64-bit Windows XP system to the point where it wouldn’t even boot.)

Enter vpnc, an open-source VPN client that works just fine on both Mac OS X and Linux. Linux people, I assume that you know what you’re doing — all you should need is a TUN/TAP kernel driver and you’re good to go. Mac OS X folks, you’ll need to be comfortable with the UNIX terminal to use it; unfortunately no GUI has been written for it yet. If you’re a Terminal geek, here’s a small guide for you:

  • Download and install a tun/tap driver for Mac OS X.
  • Download and install libgcrypt. If you have DarwinPorts (neé MacPorts) installed, simply do “port install libgcrypt”. Otherwise, grab it from the libgcrypt FTP site and install it manually.
  • You’ll need to check out the latest version of the vpnc code from its Subversion repository: “svn checkout http://svn.unix-ag.uni-kl.de/vpnc/”. The latest official release (0.3.3, as of this writing) will not compile properly on Mac OS X, which is why you need the code from the Subversion trunk.
  • After doing the standard “make && make install” mantra, run your Cisco VPN .pcf profile through the pcf2vpnc tool and save the resulting .vpnc file in /etc/vpnc.
  • ./vpnc YourProfile.vpnc, and that should be it. While you’re debugging it, the --nodetach and --debug 1 options may be useful.

Muchas gracias to Mario Maceratini at Rising Sun Pictures for hunting down vpnc for me.


Choice Isn't Always a Good Thing

You know that Which Operating System Are You quiz?

Well, they’re gonna have to expand it to include all six versions of Windows Vista, whenever that decides to be unleashed unto the world. Hello, six versions? With the starter edition only being able to use 256MB of RAM and run three applications at once? Even eWeek says that “you would be better off running Windows 98”. You know what, instead of choosing between Vista Starter, Vista Home Basic, Vista Home Premium, Vista Business, Vista Enterprise or Vista Ultimate, how about I just run Mac OS X or Linux instead, you stupid tossers?

Jesus, the excellent lads over at Microsoft Research (who produce some truly world-class work) must be just cringing when they hear their big brother company do totally insane stuff like this.


For the Mac Vim lovers

Do you like Mac OS X?

Do you like… Vim?

If so, your prayers may just have been answered: see the Vi Input Manager Plugin by Jason Corso. Vi-style key bindings in any Mac OS X text input area? Schyeah baby. As Jason says:

Right now, you should be thinking — “you mean the editor in XCode will behave like Vi?” Answer: Yes.

It’s open source too. Nice work Jason; let the hacking begin!


Add Cmd-1 and Cmd-2 back to iTunes 7

iTunes 7.0 removed the Cmd-1 and Cmd-2 shortcuts to access the iTunes window and the equaliser, for whatever reason. You can add them back in via the Keyboard preference in System Preferences:

  • launch System Preferences,
  • go to the Keyboard & Mouse preference,
  • click on the Keyboard Shortcuts tab,
  • hit the + button, pick iTunes as the application, type in “Show Equalizer” as the menu title, and use Cmd-2 for the keyboard shortcut.
  • hit the + button, pick iTunes as the application, type in “Hide Equalizer” as the menu title, and use Cmd-2 for the keyboard shortcut.
  • hit the + button, pick iTunes as the application, type in “iTunes” as the menu title, and use Cmd-1 for the keyboard shortcut.



Ejecting a stuck CD

If your CD won’t eject from your Mac (for example, say, if you’re running the Leopard developer preview and the stupid mdimport process is locking files inappropriately…), the good ol’ -f (force) flag on umount will be your saviour:

  • sudo umount -f /Volumes/"AUDIO CD" (or whatever the volume name is)
  • Press the Eject key

Apple Mail and Self-Signed SSL Certificates

For those of you getting sick of Apple Mail pestering you about your beautiful self-signed SSL certificates running on your home-brew Gentoo 386SX/16 imaps/pop3s server, check out Apple’s knowledge base article 25593 to fix the problem once and for all.

After that:

  • double-click on your newly-imported certificate in the Keychain Access utility,
  • scroll down to the bottom of the window and click on the “Trust Settings” disclosure triangle,
  • and finally, set the “When using this certificate” selector to “Always Trust”.

Huzzah, no more SSL shenanigans.



Aww jeah, this little program wins some seriously awexome geek points:

GLTerminal Screenshot

That, folks, is GLTerminal. It emulates the curvature of ye olde green and amber CRT tubes; what you can’t see in the screenshot is that it can also emulate particular baud rates (all the way from 110 to 19200), complete with the ghosting effect of the slow phosphor updates that the old terminals had. I leave you with one of its Preferences windows:

GLTerminal Options


Google Talk and Jabber vs the Rest

I have a lot of friends on the MSN Messenger chat network that I quite enjoy talking to, but unfortunately my favourite instant messaging program — iChat on Mac OS X — can’t talk to MSN. (Linux people, keep reading, I promise this post will get more relevant to you despite my reference to iChat.) iChat, can, however, talk to Jabber servers. I’ve known for a while that many Jabber servers have the capability to bridge networks, so that you can talk to people on all the other chatting networks (ICQ, Yahoo!, AIM, MSN, and Google Talk) by simply logging into a single Jabber server. However, I never bothered configuring iChat to do this until today.

I’m very happy to say that one of the first guides I found on Google about how to set up iChat to talk to MSN was on the Jabber Australia site, which is also one of the most professional Web sites I’ve seen for a free, open service. The process was quite painless and nearly completely Web-based: the Jabber Australia site imports all your current MSN contacts into your new Jabber contacts list, so you don’t have to re-type them all in. The Jabber<->MSN bridge even sends across all your buddies’ icons, so I can see iChat proudly displaying pictures of all my mates. Very schmick.

Step the second: I also have friends on Google Talk, and since Google opened up their servers to Jabber federation in January 2006, that means I also get to chat with all my friends who have Gmail accounts and never bother logging into the IM networks. (Muahaha, and they thought they could avoid me!) Now I’m finally gotten into the 2000 era and have one chat client that can talk to any of MSN, ICQ, Yahoo!, Google Talk, and AIM; woohoo, clever me.

However, the story’s much bigger than just simple chat network interoperability. Google’s move into the IM market by unleashing Google Talk might have seemed rather underwhelming when it was first announced: after all, it was just like Skype… but Google voice chat was Windows-only when Skype is Windows/Mac/Linux, and oh yeah, it also had, like, none of Skype’s user base. However, Google Talk has one massive weapon behind it: open standards. In the past few months, Google has done two very significant things:

  • They’ve opened up their servers so that they can interoperate with other Jabber servers.
  • Published their voice-call protocol as an open standard, and even provided third-party developers with a library (libjingle) that can be integrated into any IM client.

The second point is huge: in one move, Google has brought voice capability to the entire Jabber federation chat network. (And, if you haven’t used Google Talk, the voice quality is damn good: better than Skype, and possibly on par or better than iChat AV.) The implication of this is that there’s going to be a big split in the short-term between the official ICQ/Yahoo!/AIM/MSN clients and everyone else (i.e. Trillian, Gaim, AdiumX, etc). The official clients will, of course, only work with their own network since they want to lock you in, but every other IM client that doesn’t currently support voice chatting — which means everybody except for Skype and iChat AV — is very, very likely to be putting Google’s voice protocols into their own chat clients. Look a couple of years ahead, and I think you’ll find that every IM chat client is going to have voice support, and that they’ll be divided into two camps: the ones that support Google’s voice protocol because it’s an open standard, and everybody else.

The thing is, right now, that “everybody else” is really only one other group: Skype. There’s also iChat AV, but that’s small fry compared to Skype, and since Apple piggybacks off the AIM network right now, they don’t have a large interest in locking customers into one particular network. (It’d be relatively easy for Apple to migrate all their .Mac accounts over to a Jabber-federated network just by throwing a couple of Jabber servers up for their .Mac users and publishing a new version of iChat that talked to that.) This means that it’s more-or-less going to be Skype vs Google Talk in the next coming years, and while Skype has absolutely huge mindshare right now, I don’t think they have a hope of holding out, because they’re the only damn network right now that absolutely requires you to use their own client. The one killer advantage that Skype has compared to Google Talk is that you can use Skype call-out and call-in to do phone calls, but once Google gets SIP support into Jingle, Google Talk will have that capability as well. Unless Skype do something radical, they’re going to be extinct in a few years as developers start pushing Jingle support into every single IM client.

Heh, not a bad situation at all: in one move, Google’s not only guaranteed some measure of success for themselves in the IM market, but they’ve also made the world a slightly better place by giving users client choice and software choice thanks to open standards. One voice protocol to rule them all, and in the darkness bind them…


Fixing console/terminal output in Xcode

If you’re having problems with Xcode not intercepting console/terminal output from your program (with ⌘-R, Build and Run or ⌘-Y, Build and Debug), try this:

  • Go to your Xcode project and select the executable in the project list.
  • Bring up the inspector for the executable (⌘-I, or just double-click on it).
  • Change “Use Pseudo terminal for standard input/output” to “Use Pipe for standard input/output” on the General tab of the inspector.
  • Do not use a Pipe for standard input/output on the Debugging tab of the inspector, unless you don’t want to be able to debug your executable.

That fixed it up for me.


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…


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.


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.



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



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)?


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!


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.



I just found a little gadgety program for Windows named Y’z Shadow: all it does is add a little shadow effect to your windows (similarly to Mac OS X’s window shadow). While it sounds gimmicky, it’s amazing just how much difference a little shadow makes in distinguishing one window from the next. Try it out and see if it makes window management just that little bit easier for you!

Update: It looks like the YzShadow link above is dead, but you can appear to download it from at least one other website.


"Witch" Window Switcher

A man named Peter Maurer has published a most excellent bit of software for the Mac named Witch. Witch is a window switcher, in the spirit of LiteSwitch X in the pre-Panther days. I quite like the standard ⌘-Tab window switcher that’s built into Panther, so I won’t be using Witch for that. However, Witch’s killer feature for me is that it can also replace the ⌘-` key with its own switcher, which works in a MRU (Most-Recently-Used) fashion, similarly to how ⌘-Tab works.

Witch’s standard ⌘-Tab window switcher replacement also cycles through all documents in all windows, rather than only cycling through the active windows, which is gives more Windows-like behaviour if you prefer that. It also has other nifty features like being able to assign window zoom/minimise to keyboard shortcuts — but IMHO, that’s all small candy compared to the excellent ⌘-` document switcher replacement!


Windows Calling Conventions

I found an excellent webpage about Win32 calling conventions when I had the pleasure of writing a C++ Apache 2 module. If you’re a UNIX guy who’s learning to deal with anything that involves both C and C++ on Windows, and you’re getting stack dumps which just does not make sense, it could be a calling convention problem. If you don’t think that’s too bad, just wait until you have to write typedefs and use type casts which involve calling conventions! (C’s typedef syntax seriously needs a kick in the nuts.)



If you’re like me and have about 100 files sitting in your Safari downloads folder, have a look at DownloadComment:

When you download things in Safari, DownloadComment will put the original URL into the saved file’s Finder Comments. Now you’ll always know where your downloads came from.

Cmd-I in Finder to display the file comments, and BAM! Instant reminder where on earth you got that file from and why. I’ve been using it for less than a week, and it’s already proven itself useful.


Linux Kernel Patch of the Week

And the Linux Kernel Patch of the Week award goes to …

Jake Moilanen provided a series of four patches against the 2.6.9 Linux kernel [story] that introduce a simple genetic algorithm used for automatic tuning. The patches update the anticipatory IO scheduler [story] and the zaphod CPU scheduler [story] to both use the new in-kernel library, theoretically allowing them to automatically tune themselves for the best possible performance for any given workload.

Whether it really is truly effective will only be seen, but the coolness factor is so there …


Je ne sais quoi

This is gold:

Mr. Jobs, please establish eligibility requirements for the purchase of a new Mac. A good start would be to disqualify anyone who listens to Ashanti or anything they play on K-Rock.


Custom Screen Sizes with NVidia Chipsets

Well, here’s something I had absolutely no idea existed before today: you can add your own custom screen resolutions with NVidia’s video drivers.

  • Control Panels -> Display Properties -> Settings tab -> Advanced button -> your nvidia chipset tab
  • Select the Screen Resolutions & Refresh Rates menu item on the ‘drawer’ next to the dialog box
  • Click on the Add button, and add away.

This is great for those monitors which can’t quite push it to 1600×1200 comfortably (e.g. being either too blurry or just having too low a refresh rate at such high resoutions). I’m running my old-ish 21” CRT at 1400×1050 now at 85Hz: quite a decent amount more desktop real estate than 1280×1024, with a refresh rate where I won’t be tearing my eyes out. Nice.


Frozen Bubble for Mac OS X

If you’ve got a weird graphics corruption problem when you try to play Frozen Bubble on Mac OS X that looks like this:

Try downloading my patched version of Frozen Bubble which fixes the problem.

Note to hackers: the patch to fix the problem is pretty trivial …

diff -Nru Frozen-Bubble (Original).app/Contents/Resources/__main__.pl Frozen-Bubble.app/Contents/Resources/__main__.pl
--- Frozen-Bubble (Original).app/Contents/Resources/__main__.pl	Thu Jan  1 06:12:48 2004
+++ Frozen-Bubble.app/Contents/Resources/__main__.pl	Sun Nov 28 23:00:13 2004
@@ -1679,12 +1679,8 @@
 	generate_new_bubble($PLAYERS[1], $next_bubble{$PLAYERS[0]}->{img});
-    if ($graphics_level == 1) {
-	$background->blit($apprects{main}, $app, $apprects{main});
-	$app->flip;
-    } else {
-	fb_c_stuff::effect($app->{-surface}, $background->display_format->{-surface});
-    }
+    $background->blit($apprects{main}, $app, $apprects{main});
+    $app->flip;
     $display_on_app_disabled = 0;

I have no idea why the fb_c_stuff::effect there is screwing things up so badly; I suspect it’s either a problem with SDL for Mac OS X, or Frozen Bubble’s fb_c_stuff.xs Perl/C code. Furthermore, it only doesn’t work on some Macs I’ve tried (my 1GHz TiBook/Radeon Mobility 9000, and Michelle’s 800MHz iBook G4). Some Macs work OK, some Macs don’t. With the patch, all Macs work OK. Beats me completely. I’ve emailed the Frozen Bubble for Mac OS X maintainer to see if he can dig around a bit to find out why it’s causing such a ruckus …

Update: The official Mac OS X port has now properly fixed the graphics corruption bug as of version 1.0.0e, so this patch is now redundant. Go grab the new version!


fork: Resource temporarily unavailable

If you’re seeing the above error on Mac OS X, see pdm’s Mac OS X hint for the quick fix. For a more thorough explanation, check out John Bellardo’s page about the fork and vfork problem in Darwin. John’s page also has a neat kernel extension that somewhat fixes the bug, but it didn’t work for me with Panther (10.3.5), and I was after a really simple fix.

Update: If you’re running Mac OS X 10.4 Tiger, there’s a much easier solution that involves (you guessed it) editing a launchd configuration file.


On Windows Marketshare

John Gruber writes a good article titled Windows Versus the World:

Most regular people donít even realize that there exist any choices other than Windows. Itís not they havenít heard of Apple or Linux, but that they donít really understand what they are. Part of Appleís stated reasons for launching their own retail initiative a few years ago was simply to raise awareness that the Mac even is an alternative to Windows PCs.

The article’s a little bit Apple-centric, but that’s quite OK considering that John’s blog is largely about Macs. I think he’s completely right that desktop Linux distributions will start overtaking Macintosh marketshare in the next few years, though (if it hasn’t already).



If you just can’t get your fingers away from those magical Emacs C-a and C-e keys and you’re using Windows a lot, XKeymacs might just be the thing for you:

XKeymacs is a keyboard utility to realize emacs like-useability on all windows applications. With XKeymacs you can use emacs keybindings with any windows application. You also get bash-like command completion in your DOS shell.

The only serious missing feature is the magical M-/ key (Dynamic Abbreviation), which is unfortunately one of the biggest reasons that I love Emacs so much. Even so, it’s pretty damn nice having those familiar keys available in Windows applications, from Notepad to Visual Studio.


My Action Figure Can Beat Up Microsoft's Action Figure

Quote from Tidbits:

Now here’s an odd marketing campaign — so odd, in fact, that I wonder if I’m missing a level or two of self-mocking irony. Microsoft is running a sweepstakes to promote Microsoft Office 2004 for Mac based on the slogan, “Get in touch with your inner suit.”


The Raymond Chen camp

Raymond Chen on more herculean efforts to retain backward compatibility in Windows, this time related to virtual memory management:

In Windows†95, the memory manager was completely rewritten and the above coincidence was no longer true. To conserve kernel-mode virtual address space, physical memory was now mapped linearly only as necessary. Of course, the drivers that relied on the old behavior were now broken because the undocumented behavior they relied upon was no longer present. As a result, when it starts up, Windows†95 looks around to see if any drivers known to rely on this undocumented behavior are loaded.

Wow. (Pun intended.)



iPhotoToGallery totally rules. How much simpler can you make exporting things from iPhoto?


crunchyRawUnbonedPanel indeed

Aww, who says Apple don’t sprinkle easter eggs in their code anymore?


The Apple Product Cycle

Only funny because it’s true.


6-Star Smart Playlists in iTunes

iTunes is nice and all, but I wish you could rank a song between 0-6 stars rather than 0-5 stars. That way, you can classify 0-star songs as unrated, and have 5 stars leftover for your own classification, rather than 4, which may be a bit too restrictive. Well, you can do this pretty easily for purposes of including it in a smart playlist, which is all I wanted to do.

How to do it? Easy:

  • Rate all your 6-star songs as 5-star, so they’ll be included in any matches that would normally include 5-star songs.
  • Add the text “6-star” to the comment of any of the songs you want to rate as 6-star.
  • Make a new Smart Playlist, and include the “6-star” text as part of the criteria for the playlist.

That’s it. You can obviously expand the scheme to 69 stars if you want, but 6 is enough for me.


Embedding Frameworks in Applications

If your Mac OS X application uses a framework, you can embed it in your application even after you’ve built and linked the application against a framework which you’ve installed privately to /Library/Frameworks.

The secret is to use the obscure install_name_tool command. You’ll need to do two things:

  1. Change the identification name of the framework itself from Foo.framework/... to @executable_path/../Frameworks/Foo.framework/...
  2. Change the application’s main executable dependent shared library list, from Foo.framework/... to @executable_path/../Frameworks/Foo.framework/...

Here’s how to do it:

  1. Copy your existing framework first and work on that: the install_name_tool command directly modifies the framework, so you’ll probably want be operating on a copy of it.
  2. Run install_name_tool -id '@executable_path/../Frameworks/Foo.framework/...' Foo.framework/Foo
  3. Run install_name_tool -change 'Foo.framework/...' '@executable_path/../Frameworks/Foo.framework/...' MyApplication.app/Contents/MacOS/MyApplication

To find out what to put in the ... bit of the commands above, run the otool -L command on the executable or shared library to see the full pathname. It should look something like Versions/A/Foo.

It’s a bit of a pain in the arse, but at least it works. Until I figured this out, it was really a bit of a pain to embed frameworks into applications properly!


Subversion for Mac OS X

Note: I don’t support this package anymore: Martin Ott of TheCodingMonkeys provides his own statically-linked Subversion binaries, and Darwinports also supplies their own subversion package. The main reason I made this package was because I wanted an easy way to install Subversion without going through Fink, which wants to install Apache 2 at the same time. Both the above two places enable you to do that. I’m only keeping this around for posterity’s sake :).

Subversion Package

Detailed Dependency Build Information

Subversion has quite a number of dependencies, which make building it not a lot of fun. My binary distribution puts all of Subversion’s dependencies into the /usr/local/libexec/subversion directory, so if you have any of its required libraries installed yourself or via Fink, none of these versions will conflict. The downside is that you use a bit more disk space, but hey, who’s complaning about a few megabytes these days?

The APR (the Apache Portable Runtime) 0.9 branch was used, checked out on 15 March 2003 3:20pm (UTC +10), with the following ./configure line:

./configure --prefix=/usr/local/libexec/subversion/apr

apr-util ./configure line:

./configure --prefix=/usr/local/libexec/subversion/apr-util --with-dbm=db42 --with-berkeley-db=/usr/local/libexec/subversion/berkeley-db --with-apr=/usr/local/libexec/subversion/apr

Berkeley DB 4.2.52 with the and 4.2.52 patches applied. The following ./configure line was used to compile it:

../dist/configure --prefix=/usr/local/libexec/subversion/berkeley-db

The version of OpenSSL that is distributed with Mac OS X Panther 10.3.2 (0.9.7, I believe) was used.

Neon. Note: ./autogen.sh was run for Neon, so that a newer version of libtool and the auto{conf,make} utilities would be installed which understands how to build shared libraries on Mac OS X.

./configure --prefix=/usr/local/libexec/subversion/neon --with-ssl --enable-shared


./configure --prefix=/usr/local/libexec/subversion/swig

Subversion itself was ./configured with (note also ./autogen.sh was run):

./configure --with-ssl --with-apr=/usr/local/libexec/subversion/apr --with-apr-util=/usr/local/libexec/subversion/apr-util --with-neon=/usr/local/libexec/subversion/neon --with-apxs=/Library/Apache2/bin/apxs --prefix=/usr/local/libexec/subversion


Mail.app Pictures

You know those cute little pictures which pop up if you receive an email from somebody with a Mac.com account? It turns out that you can set that picture with an email header: no Mac.com account needed.

Simply add a X-Image-Url header to your email, with the contents being a URL that contains the picture, e.g. X-Image-Url: http://www.algorithm.com.au/albums/ozone/Me.jpg.

Credit where credit is due: I found out about this tip from the following two links:


Porting UNIX Programs to Mac OS X

This is a short list of problems that I frequently encountered when porting applications to Mac OS X. As any veteran Linux hacker will predict, most of them involve libtool :-)

libtool problems

  • Can’t dlopen/dlsym a file properly? Make sure that you have -module parameter in the plugin’s plugin_LDFLAGS entry in its Makefile.am.
  • libtool doesn’t write the proper information to its .la files if you compile a library as --enable-static --disable-shared. You’ll have to edit the .la file and change the library_names parameter there to be libname.a.

C++ problems

  • g++’s support for templates is pretty good now, but if you’re having problems, have a look at GCC’s documentation on templates. In particular, note the -frepo flag: using that solved a few template problems for me.

Emacs for Mac OS X


There are a few ‘native’ versions of Emacs for Mac OS X: by ‘native’, I mean they have an Aqua interface, and don’t require an X11 server. Here are the full names of the ones that I know of, so you know what to google for if you’re ever that interested :).

  • Emacs on Aqua. Works with Panther, but seems quite unstable.
  • Carbon Emacs. Sources and binaries are available on that page, although I don’t know if the binaries available there work with Panther. However, recent binaries (built from the CVS repository) which do work with Panther can also be obtained from Mindlube’s Emacs page. This is the Emacs version I currently use with Panther.
  • Enhanced Carbon Emacs. Same as the above, but has a couple more packages, in particular ones which support LaTeX/AucTeX/etc. Binaries only, and the author has now updated Enhanced Carbon Emacs to work with Panther. Recommended.
  • Emacs 21 for Mac OS X — Source only. Ovidiu Predescu has put together a binary package of it. Ovidiu’s page also has some nice key bindings you can add to your ~/.emacs file to get Cmd-X/C/V, Cmd-S, Cmd-L etc. working, if you’re a veteran classic MacOS user.
  • XEmacs 19.14 for Macintosh (and also XEmacs 21.5.9 for Macintosh, which is considered alpha right now). I haven’t tested to see whether this works with Panther.

I’m fairly sure that all of them are based on GNU Emacs (except the XEmacs port, obviously).

The version I used in Jaguar is Enhanced Carbon Emacs: it’s been very stable and comes with lots of useful packages. Mind you, I haven’t used it that much—I use vim for most of my Unix editing—but Emacs works when I need it. Now Enhanced Carbon Emacs is available for Panther, but I haven’t tried it yet since I don’t use Emacs too often.

When you install any of those Emacs packages, it’ll stick an Emacs application in the /Applications directory like any other Mac app. If you’re using it from the terminal a lot, here’s a shell script I wrote which will open the GUI version of Emacs (and leave the console window “frozen” while the GUI is running, just like a normal X11 app):


if [ -x '/Applications/Emacs.app/Contents/MacOS/Emacs' ]; then
  exec /Applications/Emacs.app/Contents/MacOS/Emacs "$@"
  exec /usr/bin/emacs "$@"

Emacs in text fields?

If you haven’t found out by accident yet, you can actually press C-a and C-e inside a text field in Cocoa application to go to the beginning and end of the line. It turns out that key bindings for Cocoa applications are completely customisable, which is just way cool. The default key bindings are in a property list file at /System/Library/Frameworks/AppKit.framework/Resources/StandardKeyBinding.dict, and you can override those key bindings with a file in ~/Library/KeyBindings/DefaultKeyBinding.dict. You’ll never look at the humble TextEdit application in the same way again.

If you’re an Emacs guy, I highly recommend getting TextExtras , which allows you to do things like pipe the contents of the text field through filters (run your word processing document through sed -e s/foo/bar/, sweet), and also adds the can’t-live-without dynamic abbreviation and abbreviations features.

See gnufoo’s Mac OS X page for a slightly more in-depth look at how to bind keys to Emacs commands. After that, you can grab my DefaultKeyBinding.dict file, which has things like M-/ bound to dynamic abbreviation already.