rand

Random ids between limit IDs using RAND() php msql

hi anyone know about how to use Random wallpaperid between limit IDs using RAND() php msql i use this but its RAND() whole database $sql_wallpaper = "SELECT * FROM wallpaper WHERE RAND()>0.9 ORDER BY RAND() LIMIT 0,5"; $res_wallpaper = mysql_query($sql_wallpaper); reply please ...

C++: simple question about random number function

Possible Duplicate: Given a function which produces a random integer in the range 1 to 5, write a function which produces a random integer in the range 1 to 7 I was asked a simple question (purely in interest), in it there's a function which supplies a random number between 1 and 6, now with based off that function you need to...

How to investigate the times a library function like rand() is invoked in C

Is there a way to find how many times the C library function rand() has been called during an execution of a program? The program is written by myself thus its code can be edited. I can find how many times rand() is called using Visual Studio debugger. However, I found that my program produces different random number sequence when runni...

rand() seeding with time() problem

I'm having difficulty figuring out how to use rand() and seeding it with time() using Xcode. I want to generate random decimal numbers between 0 and 1. The code gives me seemingly random numbers for elements 1 and 2, but element 0 is always somewhere around 0.077. Any ideas why this would be? My code is: #include <stdio.h> #include <s...

Random and negative numbers

Hello, I have to generate numbers in range [-100; +2000] in c++. How can I do this with rand if there is only positive numbers available? Are there any fast ways? ...

Help getting, or displaying, random records in ColdFusion from a MySQL query?

I've got a jquery roller/scroller that displays snippets of records returned from my 'Helpful Hints' database table query. I want to keep the scroller to about 15 records but not always the first 15 records. Is it more efficient to write a query like: SELECT * FROM table ORDER BY RAND() LIMIT n Which returns a random result or do I ...

Repeatable randomness in Ruby

I know I can "restart" my rand calls by calling srand with a seed, but surely this would affect future calls to rand by other library methods, including cryptographic methods? How can I repeat my randomness in certain places and still ensure that the rest of my code isn't affected? ...