Skip to content

Instantly share code, notes, and snippets.

@kenchangh
Last active August 29, 2015 14:04
Show Gist options
  • Save kenchangh/2d971fd56309cf4db67e to your computer and use it in GitHub Desktop.
Save kenchangh/2d971fd56309cf4db67e to your computer and use it in GitHub Desktop.
A rewrite of the hot score algorithm in Julia
# The epoch seconds when the algorithm is implemented
const SET_TIME = 1403975999.39
function hot(score, created, comments, user_rep)
# To make the score scale smaller
score = log10(abs(score))
if score > 0
sign = 1
elseif score < 0
sign = -1
else
sign = 0
end
seconds_since = created - SET_TIME
return round( (score * sign + seconds_since + comments + user_rep), 5 )
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment