Hello Friends,
I was searching for a faster alternative to /dev/urandom when I stumbled across this interesting tidbit:
One good trick for generating very good non-random-but-nearly-random bits is to use /dev/random's entropy to seed a fast symmetric stream cipher (my favorite is blowfish), and redirect it's output to the applicatio...
Hello, for my program I need pseudo random integers with different ranges.
Until now I used the rand() function but it has it's limitations.
I found the boost::random library to be a much better replacement but I didn't want to create random generators all over the place.
( I need random integers in many classes, because it's a stress t...
Hi,
i want to generate a sequence of unique random numbers in the range of 00000001 to 99999999.
So the first one might be 00001010, the second 40002928 etc.
The easy way is to generate a random number and store it in the database, and every next time do it again and check in the database if the number already exists and if so, genera...
I have a table of approx 3500 Items. In another table I'm storing user votes - the Item id, the user id and the score. When a user hits this script, it must randomly select an Item they haven't already voted on.
At the moment I'm using LEFT JOIN then testing for null to find the set of Items they haven't voted on. Trouble is, using ORDE...
I'm working on a project that involves diverting phone calls to a number of destinations.
For example, I want:
10% of calls to go to destination A
20% of calls to go to destination B
30% of calls to go to destination C
40% of calls to go to destination D
The number of destinations and their percentages must be configurable.
I've ...
Hi,
I am trying to display a random product image and description from the access database, so i am selecting the highest idproduct then randomising a number between 1 and %highestid%, this is what i have so far....
IF frontpage = 1 then
SQLSTR = "SELECT idproduct AS prodtot FROM products order by idproduct desc"
Set objRS = Server.C...
I am doing a security presentation for my Computer and Information Security course in a few weeks time, and in this presentation I will be demonstrating the pros and cons of different attacks (dictionary, rainbow and bruteforce). I am do the dictionary and rainbow attacks fine but I need to generate the bruteforce attack on the fly. I ne...
I need to make an script that picks a random sentence from a txt-file and says each word in a random voice, using an array of voices, speaking rate modulation and pitch.
For example:
A sentence is chosen randomly from the txt file: "make a bed:listen carefully:read a book"
and {"make", "a", "bed"} is spoken word-for-word by a random voi...
Hey,
I need to seed the random number generator in boost (which is loaded from an int) for a few processes, for a program that has to compile and work both in Windows and in Linux.
I used std:time(0), which worked, but since the processes are jobs which are run simultaneously, some of them would run at the same second, producing the s...
I'd like to create a random boolean in JavaScript, but I want to take the previous value into account. If the previous value was true, I want it to be more likely for the next value to be true. At the moment I've got this (this is in the context of a closure - goUp and lastGoUp are locals to the containing scope):
function setGoUp() {
...
this is my code :
function getRandom_marker(bounds) {
var leftBottom=[bounds.getSouthWest().lat(),bounds.getSouthWest().lng()]
var rightTop=[bounds.getNorthEast().lat(),bounds.getNorthEast().lng()]
var latlng=[leftBottom[0]+Math.floor(Math.random() * (rightTop[0]-leftBottom[0])),
leftBottom[1]+Math.floor(Math.random() * (right...
how can i easily (quick and dirty) change, say 10, random lines of a file with a simple shellscript?
i though about abusing ed and generating random commands and line ranges, but i'd like to know if there was a better way
...
I have a an array of objects and would like to be able to randomly choose one from the list when a button is pressed. How would you do that in Android?
...
I have a set of values, and an associated percentage for each:
a: 70% chance
b: 20% chance
c: 10% chance
I want to select a value (a, b, c) based on the percentage chance given.
how do I approach this?
my attempt so far looks like this:
r = random.random()
if r <= .7:
return a
elif r <= .9:
return b
else:
return c
I'...
I've made a class (code below) that handles the creation of a "matching" quiz item on a test, this is the output:
It works fine.
However, in order to get it completely random, I have to put the thread to sleep for at least 300 counts between the random shuffling of the two columns, anything lower than 300 returns both columns sorted ...
I have an app that processes images. For testing it, I have a script that submits an image. This is not completely uncommon.
I am bored with my test images. Filling up a folder with some images and getting my test script to randomly pick one gets boring really quickly.
Is there any script - in any language, really - that can get a r...
Say you have a 2D area and you want to generate random points within it, by setting
x = random() * width
y = random() * height
do the points clump around the centre of the area? I remember reading something saying they would, but I can't quite figure out why, and how to prevent it.
...
Is it possible to generate a random integer in Freemarker template?
...
I'm trying to print random items from a list into my XCHAT channel messages. So far I've only been able to print the random items from my list alone, but not with any specific text.
Example usage would be: "/ran blahblahblah" to produce the desired effect of a channel message such as "blahblahblah [random item]"
__module_name__ = "ra...
I've read the papers linked to in this question. I half get it. Can someone help me figure out how to implement it?
I assume that features are generated by some heuristic. Using a POS-tagger as an example; Maybe looking at training data shows that 'bird' is tagged with NOUN in all cases, so feature f1(z_(n-1),z_n,X,n) is generated as
(...