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.

Leggi tutto →

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.

Leggi tutto →

Antennagate: Apple avoids the problem and loses in 5 moves

Everyone should know, by now. The latest Apple creation, the astonishing new iPhone 4, has some really big issues. The main is certainly the so called “death-grip”: depending on how you hold the phone, it eventually loses signal and drops calls. As Apple said, “X marks the spot”, the spot being the little gap between two external antennas on the outer edge of the new iPhone.

I will try to demonstrate that Apple is avoiding the problem giving void answer and trying to pilot the customers’ and press opinion towards wrong concepts.

Leggi tutto →