Giter VIP home page Giter VIP logo

Comments (3)

arvidj avatar arvidj commented on May 27, 2024

Simple idea: Create a list with all known hashes, in such a way that each hash appears X times, where X = votes + 1 for that hash. So if there are three hashes: A, B and C with 2, 1 and 0 votes respectively, the list would be: [A,A,A,B,B,C]. Then pick a random element out of this list. This would probably not be fair though. Here is some more inspiration: http://www.evanmiller.org/how-not-to-sort-by-average-rating.html

from ipfspics-server.

didiercf avatar didiercf commented on May 27, 2024

On another part of the problem, I'll most likely use a virtual table (CREATE VIEW) to combine both our current tables and make the vote count easier.

from ipfspics-server.

cloutier avatar cloutier commented on May 27, 2024

Another idea:

 x = the number of hashes 
 y = a random humber between 0 and x^2
 the selected hash is the one in position closest to sqrt(y) when they are 
 reverse-ordered by (upvotes - downvotes)

It should be a very fast query. It won't advantage much the best one though, but having some bad ones should be an aspect of a random pictures.

@arvidj's link could be very good for a best-of page.

from ipfspics-server.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.