Keith's Blog

Linking problem solved

Some time ago, I wrote in my blog about a linker problem g++ on AIX. Something like this
g++: -b must come at the beginning of the command line.

Well, I discovered that I could replace my '-b' parameters with -Wl,-b, and the linker would accept the parameters as valid. However, ld on AIX doesn't like this part of a singleton class.

template <typename T> class Singleton
{
static T* _instance;
};

template <typename T> T* Singleton::_instance = NULL;

This worked fine everywhere else, (HP-UX, Solaris, Linux, Windows, OSF) but not on AIX.
The solution was to use a static local variable, instead of a static class variable.

This seems to work, all four processes link, except one of them uses libcppunit, and this doesn't seem to work on AIX. :-(


Graduation

Yesterday, my sister graduation from University of California, Riverside.

After a lengthy drive all the way out to Riverside, we settled into the bleachers in the outdoor stadium at UCR. The ceremony began at 6, and we arrived at 5 to get reasonable seats. Imagine though, the Riverside heat, the blazing sun, and an outdoor stadium. Not a good combination.

We were lucky however. We arrived early enough to find some seats with partial shade, that became full shade as the sun went down. Those people on the other side, looking into the sun, were blanketed with heat for at least another hour or two.

After 1.5 hours of names I couldn't pronounce, we heard my sister's name, clapped, cheered, and then went to dinner.


Internationalization

My latest struggle and triumph at work involved internationalization.

Throught my code, were lines like this
LOG( "Transfered " << bytes << " to server");

Which won't translate into foreign languages well because the variable bytes might need to go in a different place in the sentence, and a translator would see strings like "Transfered " and " to server", which would be hard to translate without proper context.

And so I came up with the simple idea to use format specifiers. I used the syntax from C#, and now the log line looks like this.
LOG( "Transfered {0} bytes to server", bytes );

Now a translator would see the string "Transfered {0} bytes to server", which would be much easier to translate. As an added bonus, you can reuse the parameters ( "{0}.{1} {0}.{2}" ), and you can put them out of order (" {3}-{2}-{1} "). Although it wasn't hard to write, I'm proud of it anyway.


Santa Cruz Island

This weekend I went on an overnight trip to Santa Cruz Island, part of the Channel Islands National Park. We hiked, we snorkeled, we camped, and we explored the old ruins of various ranches.

This was my first attempt at snorkeling. I could breath through the tube well enough, but the salt water kept getting into it somehow, and ended up in my sinuses, makeing my nose run. I saw some fish, plenty of kelp, barnacles, urchins, and sea anenomes.

Both days were cool and overcast in the mornings, and sunny in the afternoons. The temperature at night was pleasant, not too cold.

Next time, we will plan farther ahead of time, get kayaks, and spend two days kayaking and snorkeling.


Pictures can be found at http://www.keith-roberts.com/gallery2/v/SantaCruzIsland/


Ace Attourney DS


During my off moments, over the past several months, I've been playing a game called "Phoenix Wright, Ace Attorney" on my Nintendo DS.

The plot of the game is that you are a defense attorney, and you must investigate and defend your clients in some very interesting and convoluted cases.

The game is unusual in that it's not particularly 3D, but instead focuses on discovery, logic, and analysis of clues. I really enjoyed playing this game, and am a little sad that I finished the last case today. If you happen to have a DS, and don't mind using many hours of your free time, I highly recommend this game.


Malibu Creek

This last weekend, I went to Malibu Creek again for some rock climbing with Sri, Eugene, Carrie, and Liz. We arrived around 8:30 AM, expecting to find crowds of climbers at the Apes Wall. However, when we got there, the place was deserted! We set up three different top ropes, and everyone got a chance at each. It was espescially impressive watching Eugene, Sri, and Carrie try the 11a 'Planet of the Apes' climb, the premeir climb on the wall.

The day was *extremely* hot, so after climbing, we went down to the rock pool, and took a dip. This included climbing a 12 foot boulder in the middle of the pool, and cannonballing off of it. Eugene managed to "outsplash" me, and Sri the daredevil jumped from a much higher spot.

After climbing, we all went to a pizza place in Malibu that according to Carrie "has the best pizza on the west coast".

Pictures can be found at http://www.keith-roberts.com/gallery2/v/MalibuCreek/


Pretty Slick Technology

During lunch today, I took a few minutes to play 'Phoenix Wright: Ace Attourney' on my Nintendo DS. The game follows a lawyer through several involved cases.

On the current case, you are given a bottle of fingerprinting dust. You apply the dust by tapping the lower screen with the stylus. This in itself is impressive, the touch screen is very responsive.

But the truly slick part, is how you remove the excess dust. The game tells you to just "blow". This stumped me at first. I thought, "what, I'm just supposed to blow air at it?" I tried all the other buttons, looking for a "blow air" button, but there was none to be found. So I took a breath, and blew... and the screen responded! Little pixular dust particles flew away as if I had blown them with my breath.

At first I thought it might be sound, but it only worked if I blew directly into the little microphone slot on the bottom right. If I covered up the slot, or I blew away from the slot, it didn't work. My best guess is the DS hardware listens for static(blowing on a microphone), and reports it to the game. Then the game can interpret the static how it sees fit.