Les Nombres for iPhone is all new

The little app for learning French numbers, Les Nombres for iPhone, has been updated to version 1.4!

This version brings you a revamped user interface, scoring and the possibility to tweet your high score. It looks like this:

It still speaks French to you and it still works hard to get those numbers into your head, but in a new, easier to use package. For all the juicy details, head for the Les Nombres for iPhone home page, or go straight to the App Store to get it!

The Magic of Replaceable Parameters

Apart from hard-coding “Hello, world!”, another bad habit you may have picked up when you learned programming is constructing user-visible messages from parts: strings, numbers and other data, concatenated together.

For example, say that you had to show the user how many unread messages there are in a given mailbox. Let’s assume that mailboxName contains the name of the mailbox, and messageCount holds the number of unread messages. In Java, you might be tempted to whip up a user-visible message like this:

String message = "There are " + messageCount + " unread messages in mailbox '" + mailboxName + "'";

This is not the way to do it in an international application. Let’s find out why, and have a look at a better and much more future-proof way of doing it.
Continue reading

Comments are closed

Aside

Please note that comments are closed on all the blog posts on this site. The reason for that is the overwhelming number of spam comments that appeared whenever a new entry was posted. After all the pointless drivel from made-up people in the style of “i am always learning new things with your blog this is very good”, complete with links to who knows what sort of websites, we have decided to turn comments off. Afterwards, reading Matt Gemmell’s post about turning comments off in his blog, we became convinced that we had made the right decision.

What was that date again?

For many of us, dates and times are absolutely essential in our daily lives. We make appointments, set deadlines, celebrate birthdays and anniversaries, and generally mark time using clocks and calendars.

What makes dates and times interesting from a programmer’s perspective is that while there is a standard time (the Coordinated Universal Time or UTC), there are multiple local time zones in use all over the world. A single instance in UTC has many local equivalents, and offsets between time zones and universal time are wild and wonderful.

Not only are time zones a little tricky, but there are also multiple local representations for an instance in local time. A representation in this context means the way it is printed in a daily newspaper, in the calendar, and indeed, on the screen of a computer or a mobile device. In the realm of internationalization (I18N) they are known as date and time formats.

The conventions for showing local time are well established, and the differences between them are significant enough to cause a lot of confusion if care is not taken. While it would be the most logical thing to do (thank you Mr. Spock), it is hardly practical to expect all the world’s population to adopt a single standard date and time format such as the ISO 8601 international standard notation in their daily lives. The national and linguistic conventions are very well established locally.

Just recently, Nokia launched new Windows Phone devices in their Lumia series. The company wanted to build anticipation before the announcement with short teaser videos which all marked the date of the launch: 05.09.2012. If you saw this date advertised early in the year, you might think it could mean either September 5th or May 9th this year. But which is it?  Continue reading