-
Notifications
You must be signed in to change notification settings - Fork 670
Try other peers for space if we get errors #1010
Conversation
#1005 (comment) still needs addressing |
|
No, it's not. The 2nd answer says "One way to shuffle a list is to assign random numbers to each element in the list and sort by those numbers. We can extend that idea, we just have to pick weighted random numbers." |
My bad, it's the first answer I was referring to. |
You seem to be quoting the first answer; http://programmers.stackexchange.com/a/233552/124690. Which, as noted in the comments and at the top of the answer, gives the wrong result. |
Hence I said "It's not perfect, but perhaps good enough?" |
b9a069a
to
892b824
Compare
892b824
to
c76f640
Compare
I have implemented the scheme suggested by that StackOverflow answer. It's a bit longer in Go than in Python... |
I put some comments in bboreham@b9a069a |
9cd15e7
to
8a4b0d5
Compare
Try other peers for space if we get errors Fixes #896
I've merged this, but now 1.0 won't merge cleanly into master. @bboreham please do that merge and resolve the conflict. |
|
Replacing #1005 which was against master not 1.0
Note I have done it a slow and stupid way in one commit, then improved the algorithmic complexity using a CDF and binary search in the next commit.
Fixes #896