1
2
3
4
alphanumerics = [*('0'..'9')] + [*('A'..'Z')] + [*('a'..'z')]
(0...25).map { alphanumerics[Kernel.rand(alphanumerics.size)] }.join

...

Ruby Generating a string of rand...

by scudco, July 02, 2008 18:23, 4 refactorings, tagged with random character, random

So this is kind of trivial ...

7bdb696ac0f589522c9ed31a1b24057b Talk
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...

535215c41c0949117577517b4506202c Talk
1
2
3
4
from random import random as _
eval(compile("\n".join(
	["(lambda %s:" % (chr((121 - ((25 - (ord("z") - y)))))) 
...

Python Random number generator

by dbr, April 02, 2008 10:11, 3 refactorings, tagged with random, number

It works okay, but I think ...

Efdad317c297a2aee89ef435995dbdb6 Talk
1
2
3
4
<script type="text/javascript">
var feature_stuff = new Array(
'<li><a href="#">URL 1</a></li>',
...

JavaScript Random URL

by DeathfireD, October 29, 2007 15:21, 7 refactorings, tagged with random, url, math

Outputs one of the 5 urls r...

421453710d51d7daaea8069af0aa4126 Talk