Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upCookbook ideas for the rand crate #227
Comments
brson
added
the
tracking issue
label
Jul 8, 2017
This comment has been minimized.
This comment has been minimized.
|
Similar to the range example: Create random passwords from a set of allowed characters. |
budziq
referenced this issue
Sep 24, 2017
Closed
add "Create random passwords from a set of allowed characters" example #287
budziq
added this to the impl period milestone
Oct 4, 2017
This comment has been minimized.
This comment has been minimized.
|
How about an example of creating a specified-length vector of random numbers out of edit: I realize a bit late that with the current |
This comment has been minimized.
This comment has been minimized.
|
@mykalu
Fair points. To be honest rand requires a major rewrite to make it really pleasant to use. let mut rng = rand::thread_rng();
// mean 2, standard deviation 3:
let normal = Normal::new(2.0, 3.0);
let v: Vec<_> = (0..10).map(|_| normal.ind_sample(&mut rng)).collect(); |
This comment has been minimized.
This comment has been minimized.
|
|
This comment has been minimized.
This comment has been minimized.
|
I read the 0.5 Changelog and the stuff they added was great, but not really helpful to a wide audience. Most of the changes were to support true randomness required for a security perspective. I'm not sure there's a lot of value to a wide audience for this. @pitdicker did a good job in #391 to update the API. I think the cookbook has a good sample of Rand usage. |
brson commentedJul 8, 2017
•
edited by AndyGauge
We already have 4 examples:
So it's not obvious we need more. But here's an opportunity to reevaluate the set we've got and brainstorm about it.