3 ms·
I use what reddit uses, works well http://code.reddit.com/browser/r2/r2/lib/db/sorts.py http://code.reddit.com/browser/r2/r2/lib/db/sorts.py s = score(u
by ck2 17y ago
I use what reddit uses, works well
http://code.reddit.com/browser/r2/r2/lib/db/sorts.py http://code.reddit.com/browser/r2/r2/lib/db/sorts.py
s = score(ups, downs)
order = log(max(abs(s), 1), 10)
sign = 1 if s > 0 else -1 if s < 0 else 0
seconds = epoch_seconds(date) - 1134028003
return round(order + sign * seconds / 45000, 7)
Let me know if you want my attempt at a MySQL translation of that.
ps. why is my account ( _ck_ ) so slow when logged in and my comments marked as "dead" ? Was I flagged as a spammer by mistake? Example: http://news.ycombinator.com/item?id=1219475 http://news.ycombinator.com/item?id=1219475
- araneae 17y agoThat's not really appropriate for what this blog post was talking about, which is rating products. It doesn't make sense for products' ratings to be time sensitive. That would make the most recent items have an artificially inflated score.
- ck2 17y agoBut you want to control the weight of a rank for an aging product, no? Let's say you are ranking cellphones that a store sells and someone has a fond memory of a cellphone they used a few years ago so they vote it up. But the phone itself was posted years ago, compared to the newest phones that came out this year. You don't want their vote to have as much weight because of the product age.
- araneae 17y agoYou could make an argument for using that for, say, deciding on which products should be featured on a page that's promoting products to consumers. But for actual product "scores" that people see that's a very bad idea. A book shouldn't have a 4/5 if everyone rated it a 5/5 just because it came out 50 years ago.
- swombat 17y agops. why is my account ( _ck_ ) so slow when logged in and my comments marked as "dead" ? Was I flagged as a spammer by mistake? Looks like it. Looking at your posting history on _ck_, though, I don't see why you'd be auto-deaded. I suggest emailing pg about it.