Questions for random


6187

Generate distinctly different RGB colors in graphs

When generating graphs and showing different sets of data it usually a good idea to difference the sets by color. So one line is red and the next is green and so on. The problem is then that when the
4946

Random angle in matlab

I'm trying to write a matlab program which is able to a random walk, but each step/vector has the same length and the thing that determines the direction is a "random" angle. The angle is not quite
7711

more than 1 sequence of random numbers c#, linq

i was using this code to generate a random sequence of numbers:
4412

How to make a random but partial shuffle in Python?

Instead of a complete shuffle, I am looking for a partial shuffle function in python.
5106

C++ - Random seed at runtime

How can I generate different random numbers at runtime?
5795

In MATLAB, how to generate random numbers depending on the data?

For example if Ax = 0.0023, it should add some noise to it and produce newAx = 0.0027
4790

Uncorrelated parallel random seeds with C++ 2011?

Currently, I have a main application in Fortran that need a seed to generate pseudo-random numbers.
5338
4664

C# Random codes - Is most of it simply wrong?

I had a lot of issues with randomizing lists. I am talking about a list of 200 elements, where I want to shuffle the list. Don't get me wrong, I read a lot of examples, and on first glance there are
3166

How do I randomly select an item from a list using Python?

Let's say, as an example, I have the following list:
680

Initiating a second Random object using the same seed

Using a seed you can get a Random object to spit the same sequence of numbers over and over again. But what if you want to shut down your app, relaunch it and continue spitting numbers from where you
997

How to choose randomly in a certain ratio

I want to choose randomly* between two alternatives with unequal probability.
3404

C# Dice game, turn this into a user typed input

Ive made a dice "game" which randomly chooses a number and then "rolls" to see how many rolls it takes to get the same number. The problem im having is how can I make the pyöräytys to be typed in ...
9846

C# Changing only part of an array, in random places

I've got a 2D array of int's in a console c# code (7X3 'cells'). The moment I create it, it is initialized with zeros.
144

android quiz radio buttons do not display the correct value

I created this algorithm to generate randomly generated numbers. For some reason the fake answers and the right answer don't output the right result. I dont understand why the answer is returned s...
7712

Use rand() to generate uniformly distributed floating point numbers on (a,b), , and [a,b]

I want to collect the "best" way to generate random numbers on all four types of intervals in one place. I'm sick of Googling this. Search results turn up a lot of crap. Even the relevant results are
4378

android how to get 4 images in array from ten array of image randomly

I want to get four images from a array but I need same position images from other array
1866

python c extension: multithreading and random numbers

I have implemented a work queue pattern in C (within a python extension) and I am disappointed with performance.
6569

Rand() in TYPO3 Extbase Query

Im using Extbase in TYPO3.
238

MySQL select 10 random rows from 600K rows fast

How can I best write a query that selects 10 rows randomly from a total of 600k?
6850

C++ Boost random numeric generation problem

I must generate a random number using boost libraries, I use this code:
2925

Algorithm for generating a random number

I'm looking to generate a random number and issue it to a table in a database for a particular user_id. The catch is, the same number can't be used twice. There's a million ways to do this, but I'm
4643

Scheme: creating a random range

In scheme I have to use random to define a procedure that accepts no arguments and returns an integer in the range 1 to 10, inclusive and i cant use if. im lost =(
2372

Seedable Random number generator in JavaScript

I'm looking for a random number generator in JavaScript which I can initialize with a certain seed and gives a deterministic result (according to that seed). It should be capable of providing random
503

Javascript function for generating similar numbers

Given a floating point number, help me write a function that generates a number with a modified hundredth of a decimal place.
7166
5378

Quantifying randomness

I've come up with 2 methods to generate relatively short random strings- one is much faster and simpler and the other much slower but I think more random. Is there a not-super-complicated method o...
1348

srand() is not working below initialization of array randomly

Below but it always gives me 42 as SIZE. I wanted to randomise SIZE with srand(time(NULL)) but obviously it is not working because it is below randomisation of SIZE. When I try to add it before
2788

Javascript - Create paragraph from random array of words

I am trying to take a set of words for example...
9890

MySQL rand() ignore duplicates

I have been trying to use the following MySQL:
9007

Generate “characters” based on a probability

I need a little help with my tetris game
9070

How to test PRNG?

Lately I implemented a MersenneTwister for 64-bit integer (or long). Is there a guide or examples of how to test PRNG so that I may know whether or not my implementation is good-enough solution. I'm
8606

Random 1-5 5x5 Array

I am trying to make a 5x5 table that will have the numbers 1-5 random put in the rows/columns. But they need to have all different numbers for each row and column.
5996

golang random number generator how to seed properly

I am trying to generate a random string in Go and here is the code I have written so far:
604

PHP image hourly

I have a PHP file that randomly generates an image from a folder on every refresh. I downloaded it from here (which also has an explanation).
3362

how to hide two random label's text among six label?

I have Six labels, I want to hide two label's text randomly when a button is clicked.I am new to iphone,How do I do that?
8983

Javascript Random problem?

var swf=["1.swf","2.swf","3.swf"];
9030

Java generate random numbers using Possion/Gaussian/Exponential/Geometric/Uniform distribution

How can I generate a random number in Java using different distributions within a range(0-99).
1434

How to select random trial with sql? (Bernoulli Trial)

For each parent that exists I would like to select 1 child row randomly. The table structure looks like this:
9217

How do I add a fade in?

How would I add a fade in to this?
8048

RandomNumberGenerator vs RNGCryptoServiceProvider

According to MSDN documentation for RandomNumberGenerator:
7547

Animating random text to reform as complete sentence with jQuery

I have been working on this problem and really need some help.
6440

Random array size at the beginning?

I want to make a random sized array everytime program executes at first but compiler yells me
3943

My PHP Random page generator has stopped working properly after 100,000 hits

My website relies completely on a random page generator that loads a page from a text file list. The code was kindly written by "lserni" on the forum. The script has been working perfectly the la...
4799

Randomise Whole Folders

I'm in the process of creating an experiment for a psychology researcher, there are various tasks involved which the participant has to complete. I have been asked to randomise the order of the fol...
3570

Is there an issue with this UUID generation code?

So I have some code which needs to use UUID for database IDs. I've gone with v4 (random) for simplicity's sake, and I don't see any real reason to use any of the other less random version of UUID. My
9978

Recommended way to initialize srand?

I need a 'good' way to initialize the pseudo-random number generator in C++. I've found an article that states:
7356

I'm creating a random array in PHP and my code doesnt seem to output a truly random answer

I want to construct an array of 3 offers that output in a random order. I have the following code and whilst it does output 3 random offers it doesn't appear to be random. The first value in the
6334

C: the definitive truth about rand, random and arc4random

There's a lot of conflicting information about this topic. So let's try to agree on a definitive answer:

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.