Archive for March, 2010

Smartphone Market Penetration

Wednesday, March 17th, 2010

Some stats from ComScore illustrate the state of the mobile market. This post provides some simple charts of the data.

What’s the breakdown of smartphone market share?

Smartphone Market Share January 2010

Clearly BlackBerry are doing incredibly well, covering almost half the market.

Which platform’s been growing the most over the last 3 months?

Smartphone Growth (Millions) from October 2009 to January 2010

Somewhat surprisingly, BlackBerry continue to consolidate their position, taking most of the new entrants to the market.

Interestingly, in the original statistics, Google appear to be doing the best, and Microsoft the worst. However, in terms of actual numbers, BlackBerry continue to be number 1 for growth, with Microsoft and Palm equal losers.

These stats are based on the US market. Visit ComScore for the original figures.

Remember me with PHP – hack it #6

Monday, March 15th, 2010

PHP persistent sessions
“Remember me” functionality was recently implemented on the Supernifty login screens. The PHP documentation is surprisingly non-obvious so here’s how to do it.

If you’re already using the $_SESSION variable, the default is for this variable to live only for as long as the browser. Once the user closes the browser, the cookie will be deleted, and they’ll be logged out.

To remember a user across browser sessions, here’s what needs to be done.

Tell the browser to remember the session

You do this with the line:

setcookie( session_name(), session_id(), time() + 86400*30 );

This overwrites the default session cookie, with a cookie that will persist on the user’s browser for one month.

Note that since cookies are set in the headers sent to the browser, this needs to be done before writing any content to the browser.

With HTML like

<input type="checkbox" name="remember" value="remember"/>

You could have a handler like:

$remember = $_POST['remember'];
if ( isset( $remember ) && $remember == 'remember' ) {
setcookie( session_name(), session_id(), time() + 86400*30 );

Tell the server to remember the session

Bizarrely, PHP’s default session time is something ridiculous like 24 minutes.

To tell the server to remember the session for longer, you need to set some PHP environment variables, like so:

ini_set("session.gc_maxlifetime","2592000"); // 24*30 hours
session_set_cookie_params( 86400*30 );

More details about PHP’s session lifetime

With these two pieces in place, you can now implement a “remember me” checkbox on your login screen with PHP, while continuing to use the $_SESSION variable.

Top 500 songs of all time – visualized

Wednesday, March 10th, 2010

A radio station recently ran a survey asking listeners vote for their favourite songs, the result being a 500 song countdown of the “greatest songs of all time”.

Supernifty has produced a handy tool for you to play with the results, with a simple search function, charts of the most popular artists, and a breakdown by decade of the greatest songs.

Top songs categorized by decade

Can you guess who the most popular artist is? Wondering if your favourite made it? Check it out.

Although the results are in many ways a reflection of the listeners’ demographic, it’s still pretty fun to play with.

See the top 500 songs of all time.

Vancouver Olympics – Comic #4

Tuesday, March 2nd, 2010

Vancouver vs Wall Street - Supernifty Comic #4

Click to see the comic full size