This repository has been archived by the owner. It is now read-only.
Permalink
Browse files

Make hot score continuous.

  • Loading branch information...
bsimpson63 committed Jan 12, 2014
1 parent d8e4156 commit 50d35de04b928836b7ee955c8a26f197e24ab01e
Showing with 2 additions and 2 deletions.
  1. +1 −1 r2/r2/lib/db/_sorts.pyx
  2. +1 −1 sql/functions.sql
@@ -53,7 +53,7 @@ cpdef double _hot(long ups, long downs, double date):
else:
sign = 0
seconds = date - 1134028003
return round(order + sign * seconds / 45000, 7)
return round(sign * order + seconds / 45000, 7)
cpdef double controversy(long ups, long downs):
"""The controversy sort."""
@@ -21,7 +21,7 @@
-------------------------------------------------------------------------------
create or replace function hot(ups integer, downs integer, date timestamp with time zone) returns numeric as $$
select round(cast(log(greatest(abs($1 - $2), 1)) + sign($1 - $2) * (date_part('epoch', $3) - 1134028003) / 45000.0 as numeric), 7)
select round(cast(log(greatest(abs($1 - $2), 1)) * sign($1 - $2) + (date_part('epoch', $3) - 1134028003) / 45000.0 as numeric), 7)
$$ language sql immutable;
create or replace function score(ups integer, downs integer) returns integer as $$

0 comments on commit 50d35de

Please sign in to comment.