Why the Penguins Won

As their ranks broke, the last surviving remnants of the Redmond Marketing Army dropped their muskets and ran; fleeing in terror; pursued by the wails of the slower stragglers; fallen as the inexorable wave of penguins and wildebeest swiftly flowed over the scene, displaying incredible agility and determination.

22 December 2006

Subtlight Photograph Lanched

I've finally finished enough of my Photography portfolio to publish it on the web. It's located at:

http://www.subtlight.com/

All the photographs are under a Creative Commons license - making them free for personal use. They would be ideal for use as a desktop background - which I encourage.


Enjoy.

02 November 2006

Travel Tips from Singapore

I never could have predicted that I would stand here today and type travel tips! I'm here in Changi Airport - Singapore. Here are my top three travel tips that will change your perspective.

Number 1 - Don't stay in an up-market hotel. That's right, stay in the cheapest hotel that boasts a bed, a toilet, a shower and (in hot climates) an airconditioner. After all, you're only going to sleep there!

Number 2 - User public transport. This is an excellent way to observe the locals doing what the locals do. Along with this tip, I should stress two important journeys - one at peak time, which can be exciting, and the last train of the day. The "last train" trip is important. The other passengers will generally be too tired to care about an act any more - you'll get to observe them without the veneir they show to the rest of the world.

Number 3 - Don't join a tour. I never joined one tour in Singapore and I was here for eight days! During this time, I did some things that I would never have done had I been following a tour guide. Some highlights include bundu-bashing across a miniture golf course on Sentosa island (that was exciting, you had to be there) walking round the Mc Ritchie reservoir and hitting the streets of Geylang at night.

There you have it - three nuggets of travel wisdom from a software developer.

22 August 2006

Adventures in PostgreSQL I

As I prepare to embark on a long journey through PostgreSQL, I thought it wise to write about what I expect from this product. This will form a benchmark to refer back to after being influenced by the marketing material.

First and foremost, I expect a backup solution that I trust more than mysqldump. I spent the last four hours fighting with sed and mysqldump to write a script that regularly generates working output. I spent the last four weeks fighting with the combination of cron and mysqldump.

Secondly, I expect a useful full text search mechanism. I always thought that MySql's solutions, which works out the box, would be great. Today, the first time I have ever attempted to actually use it, I discovered that it only works with MyISAM tables. Unfortunately, MyISAM tables don't support some rather crucial features, like transactions! I am not prepared to sacrifice transactions for full-text indexes.

Lastly, I expect a more logical solution to time zones. After about eight months of solid MySQL use I am only beginning to understand how MySql's date and time types actually work. Up until now, I have simply stored everything using Universal Time and converted manually in my own application.

Who knows? I might just be porting my whole project to PostgreSQL this week!

09 August 2006

Google Browser Sync

I have discovered the most incredible tool from Google: Google Browser Sync. - a FireFox plug-in that synchronizes browser data, such as history and bookmarks, across browser "installations".

Google Browser Sync. allows the synchronization of bookmarks, history, open tabs and window, cookies and saved passwords across browser installations. These "installations" may be different PCs, different operating systems on the same PC or simply different user accounts The plug-in is free, as in free beer, but not open source.

To use the plug-in, you require a free Google Account. Additional security is provided by a "PIN" code that is used to encrypt your data. Specifying a PIN and choosing to encrypt your data prevents everyone, even Google, from viewing it.

The official page for the plug-in is: http://www.google.com/tools/firefox/browsersync/index.html

Unfortunately, a problem with Google's download service prevents downloads of the .xpi file from many locations, including mine. To solve this problem, you must use an anonymous proxy. I downloaded the .xpi using www.anonymouse.org.

Once downloaded, no geographic restrictions are placed on its use.

Unfortunately, you may only use the plug-in in one browser at a time, although Google say they are working on this problem. Additionally, it only works in FireFox. Hopefully, they will add support for other browsers, like Safari, and allow sharing of data across different browsers.

28 July 2006

Google Code – First Impressions

You name it, Google's doing it, or planning to in the near future.

As an existing user of several Google services, notably Google Search, G-Mail and Google Calendar, I was excited to read about a new effort to create a Google Open Source project repository akin to SourceForge.net. The service is up and running at http://code.google.com/hosting and requires naught but a Google account to access. (Once again, Google's at the head of the pack – this time, the Single Sign On movement.)

A quick buzz around the site shows Google Code to be a typical Google service – clean and simple. It is so clean and simple that I almost disregarded it as very incomplete until I saw the wisdom in Google's design.

Projects on Google code appear to have a home page, subversion repository and issue tracker – that's it. These three features just happen to be the most used features on any open source host. The project categorization features follow a typical Web 2.0 style: names and tags. The site features an Issue tracker that I would actually like to use, something I can't say about any other.

Some things are missing. Notably, there appears to be no way to host either a project web or a Doxygen documentation web. Both of these features are provided by SourceForge.net and, while I have never actually used them, I intend to use them in the near future. (Apparently Google has no plans to provide Web hosting. Perhaps they'll provide a limited, cut down feature, like a Project Wiki or Forum)

I think Google should offer free hosting of webs containing information related to open source projects hosted on Google code. phpBB, MediaWiki and Doxygen generated content should be permitted.

For now, I will continue to use SourceForge and watch Google's progress.

27 July 2006

The Iconic Knowledge Base

I have installed multiple instances of the MediaWiki software as a knowledge base. So far, it has excelled at the task!

MediaWiki is the open-source Wiki software behind the fabled Wikipedia.org service. While my knowledge base is unlikely to ever become very large, or have a large number of contributors, the software scales down exceptionally well.

MediaWiki is the epitome of the very essence of the Wiki concept. It is a multi-user, collaborative environment that facilitates the easy creation of short to medium length documents. The powerful hyper-linking features negate the need for large documents in a knowledge base.

One must remember what MediaWiki is not. While it is an excellent document storage, revision and organisation system, it is not an expert system, an issue tracker or a help-desk solution. This software will not suggest solutions to your problems – it is purely a mechanism for the storage of notes on a particular topic.

A MediaWiki knowledge base will help. I find that I never forget a concept or an idea, but I struggle to remember details. MediaWiki will never forget details!

For me, it has proven to be the iconic knowledge base system for any team, even singletons.

17 July 2006

My First User Defined Aggregate

Today, I successfully wrote and deployed my first MySql User Defined Aggregate Function. It's not spectacular, but it is incredibly useful and only took a couple of hours to master the UDF system. The incredible amount of knowledge that I gained was worth the time alone!

The function is a simple function, it multiplies all the values it aggregates. This is similar to the SUM() function, but it multiplies instead of adding.

Interestingly, I found another solution to this problem that did not require as much work. This solution uses the exp(), sum() and log() functions to implement the same behaviour.

My function is used like this:

SELECT PRODUCT() FROM

The alternative solution would be:

SELECT EXP(SUM(LOG())) FROM

The COALESCE() function may be used to replace nulls with the identity element: 1.0 in both cases.

Internally, there is more difference than that shown in the two SQL statements above. The later solution requires two complex floating-point operations: EXP() and LOG(). My aggregate function operates with basic multiplication only.

User Defined Aggregate Functions for MySql are developed as C or C++ Shared Libraries (or objects), compiled externally and then loaded into the database server using a simple SQL statement. This is not complicated in any way. My function was implemented in a single code file (.cpp) and did not even require a header! I have never seen any production code that is closer to academic, algorithmic code – ever!

I did encounter a few gotchas during the development process. The project was not big enough to require GNU autotools, so I just compiled it by hand. To do this, I had to include some MySql headers. The 'locate' command and the '-I' switch to gcc came in handy here. Additionally, I required the '-shared' switch to force GCC to give me a shared object. Here's how I compiled it:

gcc -I /usr/include/mysql -shared -o udf_product.so product.cpp

I deployed it directly into /usr/lib. I cannot say that I am happy with this, because sticking one of my files in a system folder goes against the grain, but it works! (This is a folder that I can guarantee is in ld's search path.)

I loaded the function into the MySql server with the following statement:

CREATE AGGREGATE FUNCTION product RETURNS REAL SONAME 'udf_product.so'

I was disappointed to note that this command would not accept an absolute path to the binary. I am not sure why this is so. Additionally, this function proceeded to play silly-buggers with my library. In order to remove the function, I had to manually delete its registration record from `mysql`.`func` and then restart the MySql Daemon (server) for my actions to take effect. At least once, this “CREATE” statement decided that the function already existed while “DROP FUNCTION” decided that there was no such function to drop!

As far as the code is concerned, it was fairly simple. I forgot to “return 0” at the end of the initialization function and received a very cryptic error about it: “HY000 Can't Initialize Function.” Otherwise, all went well.