1 2 3 4
alphanumerics = [*('0'..'9')] + [*('A'..'Z')] + [*('a'..'z')] (0...25).map { alphanumerics[Kernel.rand(alphanumerics.size)] }.join ...
1 2 3 4
module DiscreteDistribution # pick_random is useful for spliting up a collection by its specified discrete distribution ...
Ruby Randomly pick an item base ...
by David Dai,
June 15, 2008 06:02,
No refactoring, tagged with random, algorithm, discrete, discrete distribution, ruby, load balance, multivariate, ab-test
This method is useful to lo...
So this is kind of trivial ...