Click here to Skip to main content
15,894,460 members

Welcome to the Lounge

   

For discussing anything related to a software developer's life but is not for programming questions. Got a programming question?

The Lounge is rated Safe For Work. If you're about to post something inappropriate for a shared office environment, then don't post it. No ads, no abuse, and no programming questions. Trolling, (political, climate, religious or whatever) will result in your account being removed.

 
GeneralRe: On list.OrderBy(x => random.Next()) Pin
lopatir24-Oct-17 4:44
lopatir24-Oct-17 4:44 
GeneralRe: On list.OrderBy(x => random.Next()) Pin
CodeWraith24-Oct-17 5:13
CodeWraith24-Oct-17 5:13 
GeneralRe: On list.OrderBy(x => random.Next()) Pin
Richard Andrew x6424-Oct-17 9:20
professionalRichard Andrew x6424-Oct-17 9:20 
GeneralRe: On list.OrderBy(x => random.Next()) Pin
Richard Deeming24-Oct-17 4:05
mveRichard Deeming24-Oct-17 4:05 
GeneralRe: On list.OrderBy(x => random.Next()) Pin
harold aptroot24-Oct-17 4:10
harold aptroot24-Oct-17 4:10 
GeneralRe: On list.OrderBy(x => random.Next()) Pin
megaadam24-Oct-17 4:20
professionalmegaadam24-Oct-17 4:20 
GeneralRe: On list.OrderBy(x => random.Next()) Pin
BillWoodruff24-Oct-17 4:20
professionalBillWoodruff24-Oct-17 4:20 
GeneralRe: On list.OrderBy(x => random.Next()) Pin
harold aptroot24-Oct-17 5:10
harold aptroot24-Oct-17 5:10 
Fisher-Yates is fine, you can even write a lazy version that yield returns the elements as soon as they have been chosen (it's really a sequence of random choices out of "the set of item you haven't had yet", every choice is final). Of course one should then be careful about their source of random numbers, for example a freshly-seeded instance of System.Random only has at most 31 bits of entropy (fewer if seeded with the current time) which on large shuffles limits the set of possible outcomes.
GeneralRe: On list.OrderBy(x => random.Next()) Pin
BillWoodruff24-Oct-17 22:03
professionalBillWoodruff24-Oct-17 22:03 
GeneralRe: On list.OrderBy(x => random.Next()) Pin
harold aptroot25-Oct-17 1:10
harold aptroot25-Oct-17 1:10 
GeneralRe: On list.OrderBy(x => random.Next()) Pin
BillWoodruff25-Oct-17 2:44
professionalBillWoodruff25-Oct-17 2:44 
GeneralRe: On list.OrderBy(x => random.Next()) Pin
harold aptroot25-Oct-17 5:21
harold aptroot25-Oct-17 5:21 
GeneralRe: On list.OrderBy(x => random.Next()) Pin
BillWoodruff25-Oct-17 6:56
professionalBillWoodruff25-Oct-17 6:56 
GeneralRe: On list.OrderBy(x => random.Next()) Pin
harold aptroot25-Oct-17 7:08
harold aptroot25-Oct-17 7:08 
GeneralRe: On list.OrderBy(x => random.Next()) Pin
Dan Neely25-Oct-17 3:38
Dan Neely25-Oct-17 3:38 
GeneralRe: On list.OrderBy(x => random.Next()) Pin
BillWoodruff25-Oct-17 3:44
professionalBillWoodruff25-Oct-17 3:44 
GeneralRe: On list.OrderBy(x => random.Next()) Pin
Dan Neely25-Oct-17 5:05
Dan Neely25-Oct-17 5:05 
GeneralRe: On list.OrderBy(x => random.Next()) Pin
BillWoodruff25-Oct-17 6:41
professionalBillWoodruff25-Oct-17 6:41 
GeneralRe: On list.OrderBy(x => random.Next()) Pin
Dan Neely25-Oct-17 7:37
Dan Neely25-Oct-17 7:37 
GeneralRe: On list.OrderBy(x => random.Next()) Pin
harold aptroot25-Oct-17 5:09
harold aptroot25-Oct-17 5:09 
GeneralCopy-Paste Coding Culture Pin
Jacquers24-Oct-17 2:07
Jacquers24-Oct-17 2:07 
AnswerRe: Copy-Paste Coding Culture Pin
W Balboos, GHB24-Oct-17 2:11
W Balboos, GHB24-Oct-17 2:11 
GeneralCopy-Paste Everything! Pin
megaadam24-Oct-17 2:54
professionalmegaadam24-Oct-17 2:54 
GeneralRe: Copy-Paste Coding Culture PinPopular
Marc Clifton24-Oct-17 3:01
mvaMarc Clifton24-Oct-17 3:01 
GeneralRe: Copy-Paste Coding Culture PinPopular
Dan Neely24-Oct-17 3:02
Dan Neely24-Oct-17 3:02 

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.