search for: random_valu

Displaying 11 results from an estimated 11 matches for "random_valu".

Did you mean: random_val
2017 Nov 03
1
Extreme bunching of random values from runif with Mersenne-Twister seed
..." integer vector by hand. > seeds = c(86548915L, 86551615L, 86566163L, 86577411L, 86584144L, 86584272L, + 86620568L, 86724613L, 86756002L, 86768593L, 86772411L, 86781516L, + 86794389L, 86805854L, 86814600L, 86835092L, 86874179L, 86876466L, + 86901193L, 86987847L, 86988080L) > > random_values = sapply(seeds, function(x) { + set.seed(x) + y = runif(1, 17, 26) + return(y) + }) > > summary(random_values) Min. 1st Qu. Median Mean 3rd Qu. Max. 25.13 25.36 25.66 25.58 25.83 25.94 > > We are facing a weird situation in our code when using R'...
2017 Nov 03
5
Extreme bunching of random values from runif with Mersenne-Twister seed
...ot;86756002", "86768593", "86772411", "86781516", "86794389", "86805854", "86814600", "86835092", "86874179", "86876466", "86901193", "86987847", "86988080") random_values = sapply(seeds, function(x) { set.seed(x) y = runif(1, 17, 26) return(y) }) This gives values that are **extremely** bunched together. > summary(random_values) Min. 1st Qu. Median Mean 3rd Qu. Max. 25.13 25.36 25.66 25.58 25.83 25.94 T...
2005 Jul 26
3
Generating unique random tokens for ActiveRecord objects
I have an ActiveRecord subclass that needs to generate a random (hard to guess) token for each record in its corresponding table. Currently I''m doing something like this: def before_create self[''token''] = random_value while self.class.find_by_token(self[''token'']) self[''token''] = random_value end end (random_value is a method that generates a random value for the token, not surprisingly.) I can see a potential timing error there if a ro...
2017 Nov 03
2
Extreme bunching of random values from runif with Mersenne-Twister seed
...ot;86772411", >> "86781516", "86794389", "86805854", "86814600", "86835092", >> "86874179", >> "86876466", "86901193", "86987847", "86988080") >> >> random_values = sapply(seeds, function(x) { >> set.seed(x) >> y = runif(1, 17, 26) >> return(y) >> }) >> >> This gives values that are **extremely** bunched together. >> >> > summary(random_values) >> Min. 1st Qu. Median...
2017 Nov 03
0
Extreme bunching of random values from runif with Mersenne-Twister seed
...uot;86768593", "86772411", > "86781516", "86794389", "86805854", "86814600", > "86835092", "86874179", "86876466", "86901193", > "86987847", "86988080") > random_values = sapply(seeds, function(x) { > set.seed(x) > y = runif(1, 17, 26) > return(y) > }) Why do you do that? 1) You should set the seed *once*, not multiple times in one simulation. 2) Assuming that your strings are correctly translated to integers and the same...
2017 Nov 03
0
Extreme bunching of random values from runif with Mersenne-Twister seed
...8593", > "86772411", > "86781516", "86794389", "86805854", "86814600", "86835092", > "86874179", > "86876466", "86901193", "86987847", "86988080") > > random_values = sapply(seeds, function(x) { > set.seed(x) > y = runif(1, 17, 26) > return(y) > }) > > This gives values that are **extremely** bunched together. > > > summary(random_values) > Min. 1st Qu. Median Mean 3rd Qu. Max. >...
2017 Nov 03
2
Extreme bunching of random values from runif with Mersenne-Twister seed
..."86781516", "86794389", "86805854", "86814600", "86835092", >>>> "86874179", >>>> "86876466", "86901193", "86987847", "86988080") >>>> >>>> random_values = sapply(seeds, function(x) { >>>> set.seed(x) >>>> y = runif(1, 17, 26) >>>> return(y) >>>> }) >>>> >>>> This gives values that are **extremely** bunched together. >>>> >>>>...
2017 Nov 03
0
Extreme bunching of random values from runif with Mersenne-Twister seed
...gt;>> "86781516", "86794389", "86805854", "86814600", "86835092", >>> "86874179", >>> "86876466", "86901193", "86987847", "86988080") >>> >>> random_values = sapply(seeds, function(x) { >>> set.seed(x) >>> y = runif(1, 17, 26) >>> return(y) >>> }) >>> >>> This gives values that are **extremely** bunched together. >>> >>> > summary(random_values) >...
2017 Nov 05
0
Extreme bunching of random values from runif with Mersenne-Twister seed
...uot;, "86794389", "86805854", "86814600", "86835092", >>>>> "86874179", >>>>> "86876466", "86901193", "86987847", "86988080") >>>>> >>>>> random_values = sapply(seeds, function(x) { >>>>> set.seed(x) >>>>> y = runif(1, 17, 26) >>>>> return(y) >>>>> }) >>>>> >>>>> This gives values that are **extremely** bunched together. >>&g...
2017 Nov 04
0
Extreme bunching of random values from runif with Mersenne-Twister seed
...; > seeds = c(86548915L, 86551615L, 86566163L, 86577411L, 86584144L, > 86584272L, > + 86620568L, 86724613L, 86756002L, 86768593L, 86772411L, 86781516L, > + 86794389L, 86805854L, 86814600L, 86835092L, 86874179L, 86876466L, > + 86901193L, 86987847L, 86988080L) > > > > random_values = sapply(seeds, function(x) { > + set.seed(x) > + y = runif(1, 17, 26) > + return(y) > + }) > > > > summary(random_values) > Min. 1st Qu. Median Mean 3rd Qu. Max. > 25.13 25.36 25.66 25.58 25.83 25.94
2010 Jun 02
0
Multiple threads writing to the same Starling queue doesn't work?
...rling queue at the "same time"? It doesn''t seem reliable according to my tests - but maybe I am doing something wrong. If I do: def test_starling FooWorker.asynch_foo_test(:my_id => ''foo'') temp = [] for i in 1..1000 temp << Thread.new(i) {|random_value| do_stuff(random_value)} end temp.each do |t| t.join end end def do_stuff(lvalue) starling = Starling.new(''localhost:22122'') starling.set(''foo'', :rvalue => lvalue) end # In FooWorker: def foo_test(options) starling = Starling.new(''...