« November 2005 | Main | January 2006 »

December 23, 2005

Belated bicycles

I've often wondered why bicycles weren't invented earlier.

Chariots have been around since 2000 BC, so the technology to create the bicycle has been in existence for almost 4000 years.

In the late 1700's the Industrial Revolution surely provided enough tools to turn 1764's Spinning Jenny into a cycling Jenny.

Then there was the rapid evolution of the car. All the way back in 1769 a French inventor named Nicolas-Joseph Cugnot created a steam-powered car, and in the late 1800's petrol-powered internal combustion engined cars appeared.

The development of the bicycle was much shorter, but much later. The first one that wasn't propelled by running along the ground was a treadle-powered model of 1840. In the 1860's the familiar pedals were added, and by 1900 the essential elements of the modern bike had been born.

December 22, 2005

Military spending

Does being a superpower necessitate high-military spending? I don't have historical figures, but I suspect that past world powers were the biggest military spenders of their times, because of their large empires to protect, and the funding available to them. Below is some data for 2005 from the CIA World Fact Book on total spending on the military.


The ranking of military expenditure as a percentage of GDP paints a very different picture, with poor, war-torn countries such as Eritrea and Angola heading the list.

I must admit to being slightly surprised at Australia's relatively high spending on the military, especially as these figures were prior to the recently announced increase in spending on the military as a proportion of GDP. In absolute terms, Australia's US$16 billion already vastly overshadows its near neighbours Indonesia and New Zealand, who spend US$1 billion annually.

Finally, one can consider military spending per person, which Israel currently leads by a considerable margin, and which holds many of the rich Middle Eastern oil states and typical Western European democracies near the top.

Kyoto Protocol ratifiers

Despite some noisy dissenters, the Kyoto protocol has gained widespread acceptance around the world. This chart shows the number of countries who have agreed to follow the protocol, and notes some exceptions:

Temperature scales

Which temperature scale does your country use? The reason for the disparity shown in the chart below is probably not accurately explained by Dr Staff.


Whilst I wouldn't normally care what scale another country uses, it does affect me because I watch films and television from the United States. For example, in Survivor Guatemala the host mentioned that it was 120 (or was it 110) Fahrenheit, so I had to get google to translate "120 f in c" as 49 degrees Celsius to realise that it really was hot. So, if only for the benefit of international relations, I believe the scale worldwide should be standardised. Although I imagine there'd be great resistance amongst the general population in the US, other countries have managed to switch seemingly without trouble.

Update (28 Jan 2006): John Quiggin has some interesting thoughts on the whole topic of why the USA has not gone metric:

the attitude underlying the adherence to traditional measures is that the US is rich enough and important enough to do what it likes, and the rest of the world can like it or lump it (an attitude not unique to this issue). There’s a lot of truth in this, and it helps to explain why the US is pretty much self-sufficient in a wide range of cultural services. On the other hand, it’s not conducive to success in export markets for goods.

December 19, 2005

Console market share

Now that the next generation of games consoles is starting to appear, it's a good time to review who won the battle for market share last time. According to the Wikipedia it was a clear victory to Sony.

December 18, 2005

Charts galore

Inspired by the pithy charts appearing in UK satirical magazine Private Eye I have started adding some simple charts to my blog. Whereas they have an army of moles, whistleblowers and hawk-eyed readers to provide their information, I just have myself to find some interesting titbits that are hopefully not too well known.

December 16, 2005

Convention on the Rights of the Child

Has your country ratified the Convention on the Rights of the Child, the most widely accepted human rights treaty ever?

December 14, 2005

SQLite delight

If you've been reading the MovableType forums recently then you might have come away with the impression that the venerable Berkeley DB database is old, slow, and easy to corrupt. A similar response can be found if you Google for berkeley corrupt movable type.

Despite the fact that the only trouble I have had in almost three years was when my host upgraded their version of the Berkeley DB software, so my blog stopped working until my database was upgraded too, I was concerned about these aspersions being cast. Fortunately, it doesn't take much effort to discover that the BDB is still highly regarded in technical circles, and is often the best tool for the job. However, there are some areas where alternative databases are better suited.

Perl.com has a great concise technical comparison of BDB with the new contender SQLite. From this programmer's standpoint, and ignoring speed issues, SQLite is a clearly superior solution. The data itself is all neatly contained in a single file, as opposed to BDB's sprawling mass. Even more importantly, the data itself is exceedingly easy to query and manipulate, using standard SQL syntax. It feels the same as a "real" database, such as SQL Server or MySQL, which makes the transition between them all quite straightforward.

For these reasons, when I had the opportunity to move my MovableType database from BDB to SQLite with my transition to a new host, I did so. It immediately paid dividends, because I found that the data needed some coaxing to get the blog set up perfectly. Although a script is provided that theoretically moves the data from BDB to any of the supported SQL databases, I found that it did not actually run for me. Rather than debug the script, I decided to use MT's export and import facilities. This route does not maintain your MT settings and templates, but I had so much detritus from previous versions of MT around that I thought a clean start would be good.

After the initial import of my old blog entries to my new blog, I was disappointed to find that most of the individual entry archive names had changed - they were longer than before. For example, /archives/2005/11/worth_waiting_f_1.html had become /archives/2005/11/worth_waiting_for.html, thus breaking my permalinks. It turns out that the entries do not have their file names stored in the export file. This combined with the fact that the default Basename Length had been increased from 15 to 30 in the latest MT to produce different file names. Luckily this was easy to fix. After deleting my entries, setting the default back to 15, then importing again, I found the archive names back to how they should be.

Longer base names do produce more readable URLs, so I decided to go with the new default of 30. But what if I wanted to export and import my data in future? How could I import some entries with a basename of 15 and some with a length of 30. Luckily, with an SQL-compliant database this is easy. Just import everything with a length of 30, shorten the relevant ones, check for duplicates, and rename as appropriate.

Say, for example everything before 2004 used 15 character basenames. This command will shorten them:
UPDATE mt_entry SET entry_basename = substr(entry_basename,0,15) WHERE entry_created_on < date('2004-01-01')

Then, because some entries might now have identical names, we must seek them out:
select count(*) as num, entry_basename from mt_entry group by entry_basename order by num desc

If you find any with the same name, just use a numeric suffix, as MT itself does.

This fixing is all pleasantly hassle-free, due to the benefits of SQL compliance.

Chaucery domain

All of my public web sites have now been moved over to the Chaucery domain, with my blog in its own subdomain. Previously, everything was squeezed into my ISP's free, low-functionality webspace. Now with a new host there is room to grow, and the facilities to build more interesting products.

It'll be interesting to see how Google likes the change. Because this blog does not have a cohesive theme, most of my visitors arrive via search engines. So, I'll be monitoring my traffic statistics closely for the next few weeks to see if a bunch of .htaccess redirects on my old site will help my new site to retain its Google's rankings.

December 5, 2005

Blogspot experiment

I am testing out Blogger with The Martian Wombat blog. Since it has 300MB of space to put pictures, I will mostly use it for that purpose, especially as my current host has never had enough space to include images.