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 →