Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SortBy-Hot doesn't work #136

Open
waitgain opened this issue Mar 30, 2018 · 8 comments
Open

SortBy-Hot doesn't work #136

waitgain opened this issue Mar 30, 2018 · 8 comments
Labels
bizlogic bug Something isn't working TEST ME MORE Needs additional testing / looking into UI PHP Controllers + HTML/CSS/Design/graphics upforgrabs We can use your help - take it if not assigned

Comments

@waitgain
Copy link

Semper's Harbor Freight post had -2 and I posted a new deal, yet his was still placed above mine.
screen shot 2018-03-30 at 12 51 42 am

@waitgain
Copy link
Author

Note the time stamps.

@psineur psineur changed the title Bug: Downvoted post is listed above newer post with no downvotes SortBy-Hot is Steaming Pile of Shit Mar 31, 2018
@psineur psineur added bug Something isn't working UI PHP Controllers + HTML/CSS/Design/graphics upforgrabs We can use your help - take it if not assigned bizlogic labels Mar 31, 2018
@psineur psineur changed the title SortBy-Hot is Steaming Pile of Shit SortBy-Hot doesn't work Mar 31, 2018
@psineur psineur added this to the v.1 - MVP - Public Release milestone Mar 31, 2018
@psineur
Copy link
Contributor

psineur commented Mar 31, 2018

We need to test "Hot" sort better - if it doesn't work at all - something should be done.
Minimal: it should be removed from the front-end
Ideally: it should be fixed - YC or reddit algo can be used if full-implementation is needed

@psineur psineur added the TEST ME MORE Needs additional testing / looking into label Mar 31, 2018
@danielgsims
Copy link
Contributor

danielgsims commented Apr 1, 2018

Here's where the ranking is set: https://github.com/TheRealGD/therealgd/blob/develop/src/Entity/Submission.php#L327-L340

Almost any time the submission is updated, they had the entity recalculate it's ranking score so that the submissions can be indexed by rankings. Unfortunately, it means migrating every submission when tweaking the ranking algorithm.

Also, here's where the sorting actually happens in the SubmissionRepository: https://github.com/TheRealGD/therealgd/blob/develop/src/Repository/SubmissionRepository.php#L180-L183

@nautbot
Copy link
Contributor

nautbot commented Apr 1, 2018

Please see issue #148 I created earlier today regarding ranking algorithms. @DEVxALMIGHTY and I can probably help with this, should we need to make it a v1 priority.

@psineur
Copy link
Contributor

psineur commented Apr 5, 2018

I prefer New, but I'm pretty sure Hot is critical.
Assigned to naut and DEVX

@psineur psineur removed the upforgrabs We can use your help - take it if not assigned label Apr 5, 2018
@psineur
Copy link
Contributor

psineur commented Apr 5, 2018

This is in progress now on triage board

@nautbot
Copy link
Contributor

nautbot commented Apr 7, 2018

For the time being, let's replace the existing "hot" formula with the xkcd formula:

from datetime import datetime, timedelta
from math import log

epoch = datetime(1970, 1, 1)

def epoch_seconds(date):
    td = date - epoch
    return td.days * 86400 + td.seconds + (float(td.microseconds) / 1000000)

def hot(ups, downs, date):
    s = 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(sign * order + (seconds / 45000), 7)

I don't know how to PHP, so whoever can implement ¯\_(ツ)_/¯

@psineur
Copy link
Contributor

psineur commented Apr 25, 2018

There's also something done in #200 IIRC on this. Should look at both before implementing

@psineur psineur added the upforgrabs We can use your help - take it if not assigned label Apr 25, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bizlogic bug Something isn't working TEST ME MORE Needs additional testing / looking into UI PHP Controllers + HTML/CSS/Design/graphics upforgrabs We can use your help - take it if not assigned
Projects
None yet
Development

No branches or pull requests

5 participants