Sell the Belkin and buy a D-Link or Airport!

At the beginning of this year I bought a fabulous new LAN router from Belking, the Belkin N Wireless Router F5D8236-4. It's a modem-less router that I use linked to my ISP's router (I am connected through Fastweb).

With its double band (one for B/G WiFi connections, the other for N WiFi connections) it has always served very well for my home devices: an iPod Touch, an iPhone 3G, a Dell XPS 630i, an iMac and a PS3. By the month of April I bought this fantastic brand new MacBook Pro 15", and after a short period I sold the XPS.
Continue reading

Unlocked iPhone 4 international pricing show off. Cry Italy!

Filip Chudzinski has created a very clean and helpful document, in which all the international prices for an unlocked iPhone 4 are gathered.

Costs vary a lot. In the document, we can see that the iPhone 4 16GB has a minimum price of 496 € (from Hong Kong) and a maximum price of 659 € (from Italy). Prices for the 32 GB model range from 585 € (always in Hong Kong) to 779 € (always in Italy). The average prices are: 594,21 € for the 16 GB model and 699,29 € for the 32 GB model.

Unlocked iPhone 4 international pricing

In this document you can look at all the international prices (till now) for an unlocked (not branded) iPhone 4. Those countries above which you see a lock are the ones where you can only buy a branded iPhone (so, no "native" unlocked iPhone 4 is available).
Continue reading

How to sort rated content

If you are a web developer, or at least a webmaster, and if you have rateable content on your website, you probably almost once faced this common problem: how should I sort my content, using the collected rating data?

As a common problem, it has common but different solutions, most of which are wrong. We will analyse two cases: the up/down rating, and the 5-star rating.
Continue reading

Mastering the Ackermann Function

Yesterday I came in touch with a curious, astonishing mathematical function. It's called Ackermann function.

Mathematically speaking, it is a well-defined total function. That is, it has defined values for every integer input (= total function), and this value is not ambiguous (every input has one and one only possible output value) (= well-defined).

Speaking about computer science, this function is computable, but it's not a primitive recursive function. In other words, you can implement an algorithm to express the function using while-loops (= computable), but still you cannot write an equivalent algorithm using only do-loops (= not primitive recursive). I suggest you to try this statement.

The function has this form:

As you can see, it's form is fairly simple. But, even if it seems simple, its values explode quickly. A(4, 2), for example, has more than 19.000 digits.

Ackermann Function on the complex plane

Representation of the Ackermann Function on the complex plane

What I want to talk about is the possible implementation of such a function by means of a computer algorithm. I will use Python for the next examples, but the description is language-independent.

Continue reading