Click here to Skip to main content
15,905,912 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionHow to get network interface name of local machine? Pin
George230-Oct-03 15:15
George230-Oct-03 15:15 
AnswerRe: How to get network interface name of local machine? Pin
Alexander M.,30-Oct-03 22:15
Alexander M.,30-Oct-03 22:15 
QuestionDoes anyone have spare time and want to help me? Pin
Snyp30-Oct-03 14:43
Snyp30-Oct-03 14:43 
AnswerRe: Does anyone have spare time and want to help me? Pin
kotbegemot31-Oct-03 1:24
kotbegemot31-Oct-03 1:24 
AnswerRe: Does anyone have spare time and want to help me? Pin
Anonymous24-Dec-04 19:58
Anonymous24-Dec-04 19:58 
GeneralRandom number generator Pin
Snyp30-Oct-03 14:36
Snyp30-Oct-03 14:36 
GeneralRe: Random number generator Pin
alex.barylski30-Oct-03 15:51
alex.barylski30-Oct-03 15:51 
GeneralRe: Random number generator Pin
ZoogieZork30-Oct-03 15:54
ZoogieZork30-Oct-03 15:54 
It depends on how "random" you need your random numbers to be. The standard (ANSI C) rand() function should be random enough for most general-purpose applications, but on some platforms be aware that the lower-order bits may be much less random than the higher-order bits. AFAIK, most implementations of rand() use the "linear congruential formula":
http://www.taygeta.com/rwalks/node1.html[^]

Another random number generation algorithm is the Mersenne Twister:
http://www-personal.engin.umich.edu/~wagnerr/MersenneTwister.html[^]

Of course, the strongest random number generators are ones which use a random natural source rather than an algorithm. Under Linux, the /dev/random device collects entropy in the form of timings between hardware interrupts. The downside to these generators are the fact that you can quickly exhaust the supply of random bits from the source and thus have to wait while the device collects more data. Other potential natural sources of random bits are measurements of radioactive decay and even lava lamps (as implemented by a team at SGI, using the image data from a webcam pointed at the lamps). Smile | :)

For much more in-depth information about random number generation, see: "Numerical Recipes in C: The Art of Scientific Computing", particularly chapter 7 ("Random Numbers"). The authors go through a number of random number generation algorithms with varying randomness.

- Mike
GeneralRe: Random number generator Pin
Mike Dimmick31-Oct-03 6:14
Mike Dimmick31-Oct-03 6:14 
QuestionHow to create a slider control Pin
vhunghl30-Oct-03 14:07
vhunghl30-Oct-03 14:07 
AnswerRe: How to create a slider control Pin
vcplusplus30-Oct-03 14:16
vcplusplus30-Oct-03 14:16 
GeneralRe: How to create a slider control Pin
vhunghl30-Oct-03 22:44
vhunghl30-Oct-03 22:44 
Questionwhy does it not happen MM_WOM_DONE? Pin
vhunghl30-Oct-03 13:25
vhunghl30-Oct-03 13:25 
Questionhow to find whether a file already exists in a folder? Pin
Deepak Samuel30-Oct-03 12:53
Deepak Samuel30-Oct-03 12:53 
AnswerRe: how to find whether a file already exists in a folder? Pin
yndfcd30-Oct-03 13:17
yndfcd30-Oct-03 13:17 
AnswerRe: how to find whether a file already exists in a folder? Pin
Jeryth30-Oct-03 13:18
Jeryth30-Oct-03 13:18 
AnswerRe: how to find whether a file already exists in a folder? Pin
vcplusplus30-Oct-03 14:26
vcplusplus30-Oct-03 14:26 
GeneralOperator Overloading Troubles Pin
Jeryth30-Oct-03 12:48
Jeryth30-Oct-03 12:48 
GeneralRe: Operator Overloading Troubles Pin
ZoogieZork30-Oct-03 13:42
ZoogieZork30-Oct-03 13:42 
GeneralRe: Operator Overloading Troubles Pin
Jeryth30-Oct-03 14:11
Jeryth30-Oct-03 14:11 
GeneralRe: Operator Overloading Troubles Pin
ZoogieZork30-Oct-03 15:12
ZoogieZork30-Oct-03 15:12 
GeneralRe: Operator Overloading Troubles Pin
jason9931-Oct-03 2:00
jason9931-Oct-03 2:00 
GeneralRe: Operator Overloading Troubles Pin
Jeryth31-Oct-03 6:38
Jeryth31-Oct-03 6:38 
GeneralWindow focus problems Pin
paulb30-Oct-03 12:32
paulb30-Oct-03 12:32 
GeneralRe: Window focus problems Pin
Anthony_Yio30-Oct-03 15:33
Anthony_Yio30-Oct-03 15:33 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.