Every story and comment from the Hacker News API, in a layout borrowed from 2001.
A comment on Vitter's reservoir sampling algorithm D: randomly selecting unique items.
A SPN will generate a unique random permutation, from which you can draw your random list of unique items. With a little of post-ptocessing, you can generate random permutations of arbitrary size.
I have implemented it in matlab and python:
http://nl.mathworks.com/matlabcentral/fileexchange/36626-alg...
https://gist.github.com/jdfr/46633c630471494d67ae
There are no comments on this comment yet.
A SPN will generate a unique random permutation, from which you can draw your random list of unique items. With a little of post-ptocessing, you can generate random permutations of arbitrary size.
I have implemented it in matlab and python:
http://nl.mathworks.com/matlabcentral/fileexchange/36626-alg...
https://gist.github.com/jdfr/46633c630471494d67ae