Skip to main content

Timeline for Select members based on activity

Current License: CC BY-SA 4.0

3 events
when toggle format what by license comment
Feb 26, 2019 at 17:09 comment added morbusg @N3buchadnezzar with a quick times = (n, retval = {}) => { let ppl = asMembers(fileContentsAsString); while(n-- > 0) { let cur = weightedRandom(ppl); retval[cur] = retval[cur] ? retval[cur] + 1 : 1 } return retval } and running times(10000), I get {Noen: 6437, 'John Doe': 2169, 'The rock': 1121, 'Ally MacBeal': 273}.
Feb 26, 2019 at 11:57 comment added N3buchadnezzar Interesting solution. How would this work when none of my weights are integers?
Feb 26, 2019 at 6:22 history answered morbusg CC BY-SA 4.0