流行的算法算法

2023-09-10 22:53:35 作者:一往情深深几许

在SO 18乔尔提到,将排名根据他们的年龄和普及项目的算法,它是基于重力。可能有人张贴此? C#是可爱的,但实际上任何语言(当然,我不能这样做LISP)就可以了。

On SO 18 Joel mentioned an algorithm that would rank items based on their age and popularity and it's based on gravity. Could someone post this? C# would be lovely, but really any language (well, I can't do LISP) would be fine.

推荐答案

我的理解是,它是大约从另一个杰夫阿特伍德交

My understanding is that it is approximately the following from another Jeff Atwood post

t = (time of entry post) - (Dec 8, 2005)
x = upvotes - downvotes

y = {1 if x > 0, 0 if x = 0, -1 if x < 0)
z = {1 if x < 1, otherwise x}

log(z) + (y * t)/45000