News for hackers. Stuff that matters.
Re:How Hacker News ranking algorithm works by pypyguy on Monday October 11, 2010 @09:26PM (#1781961)
Any genius willing to translate this to python?
Re:How Hacker News ranking algorithm works by sstrudeau on Monday October 11, 2010 @10:54PM (#1782130)
There's a python implementation in the original article:

  def calculate_score(votes, item_hour_age, gravity=1.8):
      return (votes - 1) / pow((item_hour_age+2), gravity)
Re:How Hacker News ranking algorithm works by zackattack on Monday October 11, 2010 @10:25PM (#1782073)
I would prefer PHP but seconded
Re:How Hacker News ranking algorithm works by sstrudeau on Monday October 11, 2010 @10:56PM (#1782136)
This is pretty trivial but sure, something like:

  function calculate_score($votes, $item_hour_age, $gravity=1.8) {
    return ($votes - 1) / pow(($item_hour_age+2), $gravity);
  }
Re:How Hacker News ranking algorithm works by mkramlich on Tuesday October 12, 2010 @02:51AM (#1782550)
it's interested to see such a direction comparison of PHP to Python. PHP is very similar to the Python except with more syntax noise. :) And probably worse docs. And worse namespacing, etc. ;)