Click here to Skip to main content
15,898,538 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: How to find an Access violation error(involving CStringT) in 3rd Party program Pin
CPallini29-Dec-08 7:56
mveCPallini29-Dec-08 7:56 
GeneralRe: How to find an Access violation error(involving CStringT) in 3rd Party program Pin
Randor 29-Dec-08 9:02
professional Randor 29-Dec-08 9:02 
GeneralRe: How to find an Access violation error(involving CStringT) in 3rd Party program Pin
Larry Mills Sr29-Dec-08 11:35
Larry Mills Sr29-Dec-08 11:35 
QuestionRandom seeding in C++ different to Java? Pin
c#_keithy29-Dec-08 6:16
c#_keithy29-Dec-08 6:16 
GeneralRe: Random seeding in C++ different to Java? Pin
Luc Pattyn29-Dec-08 6:26
sitebuilderLuc Pattyn29-Dec-08 6:26 
QuestionRe: Random seeding in C++ different to Java? Pin
CPallini29-Dec-08 7:50
mveCPallini29-Dec-08 7:50 
AnswerRe: Random seeding in C++ different to Java? Pin
BobInNJ29-Dec-08 9:44
BobInNJ29-Dec-08 9:44 
GeneralRe: Random seeding in C++ different to Java? Pin
CPallini29-Dec-08 10:07
mveCPallini29-Dec-08 10:07 
BobInNJ wrote:
Given a seed, two different random number generation algorithms will return different random values.

I know, that's fine.

BobInNJ wrote:
Worse yet, all random number generators have the property have after a certain number of random numbers being generated, they repeat themselves.

I know, there's a reason they're called pseudo-random generators.

BobInNJ wrote:
The length of this sequence is called the period.

Of course: repetaing patterns have a period.


BobInNJ wrote:
Over the years, there has been a fair amount of theory on how to develop a good random number generator. I believe the one that comes with the Microsoft C++ compiler is a good one and it has a very long period. I do not know about the one that comes with the Java compiler except that it almost certainly uses a slightly different algorithm and therefore it will have a different period.

Why a slightly different algorithm should have a different period?

BobInNJ wrote:
If you need the same results on both C++ and Java, I strongly recommend that you implement your own random number generator.

That's not a good suggestion. As you probably know, writing a good random generator is not a simple matter. It is better (as suggested by Luc Pattyn) to use some technique to exploit the same number generator code or simply adapt an existing one.


BTW: Bob, did you find a bit irony in my OP, didn't you? Big Grin | :-D

If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.

This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke

[My articles]

GeneralRe: Random seeding in C++ different to Java? Pin
BobInNJ29-Dec-08 10:33
BobInNJ29-Dec-08 10:33 
GeneralRe: Random seeding in C++ different to Java? Pin
Luc Pattyn29-Dec-08 10:43
sitebuilderLuc Pattyn29-Dec-08 10:43 
QuestionWM_USER ignored by View window? (CHtmlView) Pin
nobaq29-Dec-08 1:43
nobaq29-Dec-08 1:43 
AnswerRe: WM_USER ignored by View window? (CHtmlView) Pin
Roger Stoltz29-Dec-08 2:24
Roger Stoltz29-Dec-08 2:24 
AnswerRe: WM_USER ignored by View window? (CHtmlView) Pin
KASR129-Dec-08 19:21
KASR129-Dec-08 19:21 
Questionbinary search tree Pin
foshia29-Dec-08 1:30
foshia29-Dec-08 1:30 
AnswerRe: binary search tree Pin
Maximilien29-Dec-08 3:02
Maximilien29-Dec-08 3:02 
QuestionIntelliSense:'No additional information available' in VC++2005. Pin
Le@rner29-Dec-08 1:17
Le@rner29-Dec-08 1:17 
AnswerRe: IntelliSense:'No additional information available' in VC++2005. Pin
Hamid_RT29-Dec-08 1:31
Hamid_RT29-Dec-08 1:31 
GeneralRe: IntelliSense:'No additional information available' in VC++2005. Pin
Le@rner29-Dec-08 1:54
Le@rner29-Dec-08 1:54 
AnswerRe: IntelliSense:'No additional information available' in VC++2005. Pin
Jijo.Raj29-Dec-08 3:08
Jijo.Raj29-Dec-08 3:08 
AnswerRe: IntelliSense:'No additional information available' in VC++2005. Pin
Randor 29-Dec-08 8:39
professional Randor 29-Dec-08 8:39 
Questionchange background color of dialog Pin
zhiyuan1629-Dec-08 0:59
zhiyuan1629-Dec-08 0:59 
AnswerRe: change background color of dialog Pin
Malli_S29-Dec-08 1:04
Malli_S29-Dec-08 1:04 
GeneralRe: change background color of dialog Pin
zhiyuan1629-Dec-08 1:16
zhiyuan1629-Dec-08 1:16 
GeneralRe: change background color of dialog Pin
Malli_S29-Dec-08 1:24
Malli_S29-Dec-08 1:24 
GeneralRe: change background color of dialog Pin
zhiyuan1629-Dec-08 1:43
zhiyuan1629-Dec-08 1:43 

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.