Click here to Skip to main content
15,919,931 members
Home / Discussions / C#
   

C#

 
Questionup_down control Pin
Member 5903109-Apr-10 1:33
Member 5903109-Apr-10 1:33 
AnswerRe: up_down control Pin
Dave Kreskowiak9-Apr-10 3:10
mveDave Kreskowiak9-Apr-10 3:10 
QuestionRandom.next(min,max) Pin
igalep1329-Apr-10 0:42
igalep1329-Apr-10 0:42 
AnswerRe: Random.next(min,max) Pin
Luc Pattyn9-Apr-10 0:55
sitebuilderLuc Pattyn9-Apr-10 0:55 
GeneralRe: Random.next(min,max) Pin
igalep1329-Apr-10 1:02
igalep1329-Apr-10 1:02 
GeneralRe: Random.next(min,max) Pin
Luc Pattyn9-Apr-10 1:08
sitebuilderLuc Pattyn9-Apr-10 1:08 
GeneralRe: Random.next(min,max) Pin
igalep1329-Apr-10 1:18
igalep1329-Apr-10 1:18 
GeneralRe: Random.next(min,max) Pin
David Skelly9-Apr-10 2:05
David Skelly9-Apr-10 2:05 
I tried this using min 0 and max 10. In my case, it seemed to like the number 3 quite a lot and 0 didn't come up much at all. Interestingly, when I reused the same instance of Random rather than creating a new one each time, I seemed to get a better spread of numbers (purely subjective since humans aren't very good at judging how random a sequence truly is).

The plain truth is that Random isn't particularly random. If you need random numbers that are closer to being genuinely random, use one of the cryptographic random number generators. But, they are quite slow to initialise so in that case you should definitely not create a new one each time through the loop.
GeneralRe: Random.next(min,max) Pin
PIEBALDconsult9-Apr-10 3:34
mvePIEBALDconsult9-Apr-10 3:34 
GeneralRe: Random.next(min,max) Pin
Luc Pattyn9-Apr-10 1:56
sitebuilderLuc Pattyn9-Apr-10 1:56 
GeneralRe: Random.next(min,max) Pin
David Skelly9-Apr-10 2:29
David Skelly9-Apr-10 2:29 
GeneralRe: Random.next(min,max) [modified] Pin
igalep1329-Apr-10 2:42
igalep1329-Apr-10 2:42 
GeneralRe: Random.next(min,max) Pin
David Skelly9-Apr-10 2:57
David Skelly9-Apr-10 2:57 
GeneralRe: Random.next(min,max) Pin
igalep1329-Apr-10 5:36
igalep1329-Apr-10 5:36 
AnswerRe: Random.next(min,max) Pin
Luc Pattyn9-Apr-10 2:18
sitebuilderLuc Pattyn9-Apr-10 2:18 
AnswerRe: Random.next(min,max) Pin
riced9-Apr-10 2:22
riced9-Apr-10 2:22 
GeneralRe: Random.next(min,max) Pin
David Skelly9-Apr-10 2:34
David Skelly9-Apr-10 2:34 
GeneralRe: Random.next(min,max) Pin
ragnaroknrol9-Apr-10 6:18
ragnaroknrol9-Apr-10 6:18 
GeneralRe: Random.next(min,max) Pin
Luc Pattyn9-Apr-10 2:39
sitebuilderLuc Pattyn9-Apr-10 2:39 
Questioncopi image from picturebox to scalablepicturebox control Pin
aasif aslam9-Apr-10 0:07
aasif aslam9-Apr-10 0:07 
AnswerRe: copi image from picturebox to scalablepicturebox control Pin
OriginalGriff9-Apr-10 0:26
mveOriginalGriff9-Apr-10 0:26 
QuestionHow to filter two columns in bindingsource Pin
crisjala8-Apr-10 23:44
crisjala8-Apr-10 23:44 
AnswerRe: How to filter two columns in bindingsource Pin
OriginalGriff9-Apr-10 0:04
mveOriginalGriff9-Apr-10 0:04 
QuestionAbout the Pop3 Pin
Omkaar8-Apr-10 23:42
Omkaar8-Apr-10 23:42 
AnswerRe: About the Pop3 Pin
OriginalGriff9-Apr-10 0:06
mveOriginalGriff9-Apr-10 0:06 

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.