September 5th, 2009
I updated my computer to Mac OS 10.6 (“Snow Leopard”) last week. It worked well. This afternoon, though, I tried to compile a C program for the first time in a long time.
-bash: gcc: command not found
Hmmm….that’s not good. I found gcc living under /Developer/usr/bin, but problems remained:
$ /Developer/usr/bin/gcc -O -o ~/stream stream.c
stream.c:43:20: error: stdio.h: No such file or directory
Digging a bit further, I found that the Snow Leopard upgrade had removed the links to the old (10.5) Developer Tools installation from under /usr but hadn’t installed the new version of the Developer package. The fix was to:
- Insert the Snow Leopard upgrade CD
- Enter the “Optional Installs” folder
- Run Xcode.mpkg
After doing this, I found that I had a /usr/include directory once again, and gcc was able to compile things quite happily.
August 18th, 2009
Recent ReCaptcha texts I’ve encountered:
Nixon’s vowels
indie rock so post-ironic that they wear their trucker hats backwards
10 Moors
the hottest new boy band on the Iberian Peninsula
graven krill
they play both kinds of music: gothic and industrial
August 15th, 2009
I’ve just finished version 1.0-alpha2 of Assetbarista, my Greasemonkey script for Firefox that attempts to improve the discussion forum of the Achewood cartoon.
New in this version is the ability to preview one’s comments before posting. Assetbar, the system that powers the Achewood forum, supports the BBcode markup language. In the absence of a previewing mechanism, it is easy to make mistakes in the markup syntax, and people who post to Assetbar routinely curse BBcode.
Starting with this second alpha release, Assetbarista adds a button that allows previewing of one’s messages prior to posting.
It would be more impressive to add a WYSIWYG editor, I suppose, but a preview mechanism delivers 90% of the benefit for 10% of the development effort.
July 31st, 2009
A long time ago, in grad school, my advisor taught me to use gprof, a tool that produced a report showing where all the CPU time was spent in one’s program. Gprof required recompiling the program with special instrumentation, and its instrumentation granularity wasn’t great, but it provided invaluable data about performance bottlenecks. Ever since then, I’ve been a user and advocate of software performance profiling tools.
The basics of performance profiling have remained largely the same over the years, but the tools have grown more sophisticated.
A couple of years into my career, I started using Quantify, an application from Pure Software. It worked by rewriting the compiled code at link time to add timing support. This technique offered two nice advantages over gprof: because it ran after the compiler and didn’t require source code, Quantify could instrument third-party, binary-only libraries; and Quantify’s time measurement was much more precise than gprof’s.
In 2002, I found OProfile for Linux. It was even more convenient to use than Quantify. Rather than instrumenting the program’s code, OProfile worked at the system level, taking advantage of performance counters built into modern CPUs to profile any running process–and even the kernel–with low overhead.
A couple of years later, I used Shark, one of the developer tools included with Xcode on Mac OS X. Shark did basically the same thing as OProfile–collect a sample, and then turn it into a human-readable report–but with an easy-to-use GUI.
This afternoon I wanted to study the CPU usage of memcached, so I tried out the profiling tools in the latest version of Xcode. Shark is still there, but there’s also a new tool called Instruments that trumps every previous profiler I’ve used by displaying and continuously updating the profile report in real time:

Thinking about the evolution of profiling tools over the years, from gprof to Instruments, I’m struck by how much I appreciate the advances in usability. Software performance optimization is a complex and somewhat specialized skill set, and anyone who understands the output of a profiler is probably quite capable of figuring out the compiler flags for gprof. Back in school, my younger self probably would have scoffed at the idea of an automated, real-time, GUI-based profiling tool. Today, though, having spent a career dealing with ever-increasing complexity, I’m very happy to find that someone has done the work to encapsulate profiling in an easy-to-use GUI so I can spend less time figuring out the tools and more time doing useful work.
July 24th, 2009
My old place of employment wanted to promote a new “been there, done that” feature. They apparently wrote some code that picks a random question from their database and displays it to the visitor with a call to action:

Note the middle option: “Want to.” Huh?
July 13th, 2009
Update, October 2, 2009: For OS X 10.6, please see the instructions here: http://www.wdream.com/2009/09/install-open-mq-4-4-on-mac-os-x-10-6-snow-leopard/. Thanks to Espen Schulstad for the tip.
I just installed Open MQ on Mac OS X. The process required a few modifications to the out-of-the-box installation mechanism. Starting with the generic OpenMQ 4.3 Unix binary download from java.net, I had to change two things:
1. Force the use of Java 1.5 rather than 1.6 for the installer GUI by setting JAVA_HOME to /System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home
Update, August 9, 2009: As an alternative, you can specify the Java version via a command-line argument to the OpenMQ install script: ./installer -j /System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home. Thanks to reader Ryan Nitz for the tip.
Note that the installer GUI will let you choose the Java version for OpenMQ to use at runtime, and you can specify 1.6 at that point if you want.
2. Change all references to /bin/uname in the install scripts to /usr/bin/uname. In the 4.3 release, the files that must be changed are ./installer and ./mq/lib/install/init-config.
I suppose I could have symlinked /bin/uname to /usr/bin/uname instead, but I took the less drastic path of changing OpenMQ’s install scripts.
May 4th, 2009
Dear search engines,
When I search for “<name of some ORM package> shard” I am looking for information on database partitioning. While I appreciate the extra work you’ve done to include matches on “<name of some ORM package> shared” automatically, that wasn’t really what I was looking for.
March 17th, 2009
I work at a company of ~200 people. We have an informal email list to which nearly everyone in the company subscribes. The list carries all manner of discussion, but perhaps the most common use of it is to sell things. I tried that today, listing miscellaneous gadgets that I’d otherwise have sold on eBay. Within an hour, I had a buyer for everything on my list. That wasn’t the interesting part, though. The interesting part was that in the first five minutes I received a dozen replies from people wanting to buy one specific item: an external USB hard drive of modest capacity. Nothing else I was selling, not even an iPod at a bargain price, elicited that kind of response.
In this particular sample population, there apparently is quite a demand for external disk drives. I suppose people are increasingly aware of the importance of backups. The inclusion of easy-to-use backup software in mainstream operating systems probably is a contributing factor.
February 16th, 2009
Version 0.9 of Assetbarista is now finished. One feature that has been in Assetbarista for a long time is the removal of a mousemove event callback from all the avatar icons in the Assetbar discussion page. The removal of a callback counts as a feature because it fixes a race condition in Assetbar’s Ajax logic. Version 0.9 still has that same functionality, but with a different implementation: instead of actually unhooking the event callback from every avatar on the page, Assetbarista now replaces Assetbar’s mousemove callback function with a new version that skips the Ajax call. This has two nice side-effects: Assetbarista’s initial scan through the discussion thread is now about 35% faster because it doesn’t have to modify event bindings any more, and the race-condition fix now applies automatically to other avatar icons elsewhere on Assetbar that happen to use the same mouseover handler function.
December 26th, 2008
Assetbarista 0.8 is now available. My ongoing exercise in GreaseMonkey-based development has gained one new feature in this release: when you post a new comment to Assetbar, Assetbarista applies Unicode formatting fixups so that you needn’t reload the page.
To make this feature work, I put wrappers around the JavaScript callback functions that Assetbar uses to process form submissions. These wrappers open up the possibility of replacing the comment entry form’s plain text entry box with a WYSIWYG text editor in the future.
|
|