Archive for June, 2011

Sleep sort

It’s not very often that someone invents a new sort, but I have certainly never seen that one before:

#!/bin/bash
function f() {
    sleep "$1"
    echo "$1"
}
while [ -n "$1" ]
do
    f "$1" &
    shift
done
wait

The idea is simple: you take the first element of the array, say n, you fork a new process which sleeps n seconds then displays that number. Repeat for the next element.

Calculation of the average complexity of this algorithm left as an exercise to the reader.

Related: Quantum bogosort.

For some reason, I feel like taking a nap.

Unlocked iPhones: big deal or no deal?

Paul Thurrott wrote a quick review of Mac OS X “Lion”:

PROS: Finally picks up much needed features from other mobile platforms
CONS: Best features were literally copied from other mobile platforms
RATING: Three out of five stars

Surprisingly, John Gruber agrees with Paul’s impressions, although of course, he can’t help adding a little bit of polish to make Apple look good.

On a related note, I’m quite surprised by his take on the recent availability of unlocked iPhones in the US:

In other words, these unlocked iPhones sold in the U.S. aren’t for the U.S. — they’re for the parts of the world without carrier deals with Apple.

He’s agreeing with a piece written by Horace Dediu, who argues that unlocked iPhones are a big deal:

The iPhone is now available in the US unlocked. Judging by the lack of reaction to the news, one would assume that this is not a significant event. I would argue however that it’s a very significant event.

I think it’s pretty insignificant because these phones cost $649. Even affluent buyers will most likely balk at the price, no matter how good the iPhone is, and the countries that currently don’t have any iPhone distribution are not exactly known to be teeming with rich customers. The fact that you need to buy these phones in the US and then have them shipped over is an additional hurdle.

Do you remember how Apple pundits were saying that the new Verizon iPhone was not going to just sell millions but actually help the iPhone catch up with Android? In my opinion, the availability of unlocked iPhones will have the exact same impact on iPhone sales as Verizon did: close to none.