30 January 2009

Mac Box Set & Leopard

Just got my Mac Box Set (Mac OS X, iLife and iWork). At $149 (Amazon price as of 30 Jan), it’s the same price as iLife and iWork bought separately. I wanted both of those.

As it happened, I used the Mac OS X DVD to update a machine to 10.5.6, and tried to use that computer as part of my compile farm (using Xcode’s Distributed Build feature). It showed up as incompatible with the others. Apparently Mac Box Set includes 9G66, while the combo update installs 9G55. I didn’t realize Apple was distributing multiple builds of 10.5.6. Normally no one would really care, but distributed builds need perfect configuration matches.

So I probably won’t be able to use this machine in my compile farm until the next Mac OS X update.

25 January 2009

Control Room

Just watched the documentary Control Room, about Al Jazeera during the invasion of Iraq. Poor Al Jazeera! They were hated by both sides, as near as I could tell because they were devoted to broadcasting the truth.

The movie was for me full of ambiguities. For example, the soldiers going door to door (pretty scary stuff from my own training) vs the poor civilians caught in this. The soldiers trying to control the civilians without being able to speak their language vs the poor civilians who had no idea what they were being told. The reporters wanting information, the military not wanting to give out something useful to their enemy.

I found 1Lt Josh Rushing very sympathetic (perhaps because I was once a 1Lt). He seemed to be honestly trying to understand the Arab point of view. And was keenly aware that he reacted to dead Americans on TV differently than to dead Iraqis.

The DVD includes deleted scenes. I didn’t watch all, but many were political discussions that may be enlightening but didn’t really relate to the main theme of the film.

An interesting and thought-provoking documentary, still relevant.

05 January 2009

Class Names under gcc

We recently changed our C++ framework to use the language’s RTTI (historically we didn’t because some compilers didn’t do a good job with it, but that’s pretty ancient history by now). Previously we used a bunch of macros to roll our own, including the ability to print an object’s class (for debugging purposes), something like “ResourceImage.” The first cut at “native” support showed this as “N3GF213ResourceImageE,” which is too ugly for my liking. (It’s essentially a mangled name.)

So Chris Blackwell pointed me in the right direction, and we now have
#include <cxxabi.h>

template <typename ObjType> std::string class_name(ObjType* anObject)
int status;
char *realName;
realName = abi::__cxa_demangle(typeid(*anObject).name(), 0, 0, &status);
std::string retVal(realName);
return retVal;
which returns a human-readable name.