Wednesday, 3 June 2009

A neater way to implement singleton pattern

public class Elvis()
{
  private static final Elvis INSTANCE = new Elvis();
  private Elvis() {}
  public static Elvis getInstance()
  { 
    return INSTANCE;
  }
}

Only one single instance of Elvis is ever created. Since the attribute is static it is shared amongst all instances and since its final it can not be changed after the initial initialisation. The constructor being private ensures that no other instances are created. Moreover this implementation is automatically thread-safe and employs lazy instantiation since the static member is created the first time its accessed.

Wednesday, 27 May 2009

La Rotonde des Tuileries‎ in Paris restaurant review

We arrived at this restaurant after a fantastic visit to the Louvre and we settled down for the worst lunch during our stay in Paris

Alarm bells should have rang when the couple next to us complained about their chicken being undercooked and another table questioned the extortionate 20% service charge! We also witnessed a waiter sneeze into his hands and proceed to bring cutlery to another table! I mean I've heard of onion soup, but swine flu soup is taking the biscuit! We should have left at this point really! However we did not...

The food was absolutely shocking, the onion soup was foul and one of our cheese toasties had a hair in it amongst the stale veg! When we complained, the waiters were first ignorant, then accused us of planting the hair in our food and then finally turned extremely rude even threatening to call the police unless we paid the bill in full!

In summary avoid at all costs unless you want your day out ruined!

Absolutely shocking service and food! How do you say in French "this sucks"?!

Wednesday, 13 May 2009

iPhone Developer Program

The iPhone, isn't it cool? Apple have created a developer program where people can develop their own app and then sell it via the iStore. Create an app, test it, pick a price, distribute it then rake in 70% of revenue!

Sounds simple enough! The only problem is what will your app do? That’s the hard part!

There are quite a few snags onece you read the small print! The $99 fee for distribution for a start but you should be able to recover this once people start downloading your app! Apple also have to approve your app - so iBoobs is a no-no! You also have to learn objective-C for Mac OS X (aka Cocoa). Erm... oh yes, and you can only develop using Xcode on the Mac OS X platform! So you'll need a Macintosh or at least a Hackintosh!

However these things aside, creating an app that people can shake and poke is pretty cool. Facebook apps eat your heart out!

Thursday, 26 February 2009

Alias explosion

We all use multiple sites online - social networking, chat, email, forums, calendars and blogs! With millions of users online, it is inevitable that we are often unable to have the login we want - someone else has often got there first! This leads to what I call "alias explosion" where we have many aliases for different sites we use.

How many aliases do you have? I counted mine and I had 31 - all tucked away in a text file on my PC at home. This worked fine, but if I traveled and forgot to take the text file with me on a USB stick I was stuck! This made me realise that it would be great to have a central online alias store. Here we could store all our aliases, user names and logins. We could access this site at any time, any place and best of all we would only need to remember one single alias! How great would that be?

I developed akamanager.com to try put this idea into reality. Currently still in beta, I would welcome any feedback.

About akamanager.com:

akamanager means "also known as" manager. It is a free online utility that lets you manage all your different logins, accounts and aliases across many sites that you use daily.

For example, you might be "joe_bloggs" on one site and "joeBloggs81" on another. This is fine for just two sites but with the explosion in the number of sites we use this becomes difficult to manage! Enter akamanager.com!