Last active
August 29, 2015 14:04
-
-
Save kenchangh/2d971fd56309cf4db67e to your computer and use it in GitHub Desktop.
A rewrite of the hot score algorithm in Julia
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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