Click here to Skip to main content
15,895,011 members
Home / Discussions / C#
   

C#

 
AnswerRe: C# technology Pin
jschell12-Mar-14 11:17
jschell12-Mar-14 11:17 
Questionintellisense Pin
cdpsource11-Mar-14 2:11
cdpsource11-Mar-14 2:11 
AnswerRe: intellisense Pin
Tom Marvolo Riddle11-Mar-14 2:21
professionalTom Marvolo Riddle11-Mar-14 2:21 
QuestionConcatenating specific properties values of class Pin
nitin_ion10-Mar-14 23:59
nitin_ion10-Mar-14 23:59 
SuggestionRe: Concatenating specific properties values of class Pin
Kornfeld Eliyahu Peter11-Mar-14 0:19
professionalKornfeld Eliyahu Peter11-Mar-14 0:19 
GeneralRe: Concatenating specific properties values of class Pin
nitin_ion11-Mar-14 0:37
nitin_ion11-Mar-14 0:37 
GeneralRe: Concatenating specific properties values of class Pin
Kornfeld Eliyahu Peter11-Mar-14 0:41
professionalKornfeld Eliyahu Peter11-Mar-14 0:41 
GeneralRe: Concatenating specific properties values of class Pin
nitin_ion11-Mar-14 0:48
nitin_ion11-Mar-14 0:48 
AnswerRe: Concatenating specific properties values of class Pin
Kornfeld Eliyahu Peter11-Mar-14 0:53
professionalKornfeld Eliyahu Peter11-Mar-14 0:53 
GeneralRe: Concatenating specific properties values of class Pin
nitin_ion11-Mar-14 1:24
nitin_ion11-Mar-14 1:24 
GeneralRe: Concatenating specific properties values of class Pin
Kornfeld Eliyahu Peter11-Mar-14 1:35
professionalKornfeld Eliyahu Peter11-Mar-14 1:35 
QuestionC# Win Forms Drag n Drop email to .EML file Pin
Member 875270110-Mar-14 23:29
Member 875270110-Mar-14 23:29 
AnswerRe: C# Win Forms Drag n Drop email to .EML file Pin
Bernhard Hiller11-Mar-14 0:08
Bernhard Hiller11-Mar-14 0:08 
GeneralRe: C# Win Forms Drag n Drop email to .EML file Pin
Member 875270111-Mar-14 0:13
Member 875270111-Mar-14 0:13 
GeneralRe: C# Win Forms Drag n Drop email to .EML file Pin
Bernhard Hiller11-Mar-14 0:31
Bernhard Hiller11-Mar-14 0:31 
GeneralRe: C# Win Forms Drag n Drop email to .EML file Pin
Member 875270111-Mar-14 0:34
Member 875270111-Mar-14 0:34 
QuestionC# Windos app with SQl Issue Pin
manumaxma10-Mar-14 22:32
manumaxma10-Mar-14 22:32 
AnswerRe: C# Windos app with SQl Issue Pin
Eddy Vluggen11-Mar-14 0:59
professionalEddy Vluggen11-Mar-14 0:59 
QuestionDatagridview Timed Output Pin
Su069110-Mar-14 18:25
Su069110-Mar-14 18:25 
AnswerRe: Datagridview Timed Output Pin
OriginalGriff10-Mar-14 22:41
mveOriginalGriff10-Mar-14 22:41 
AnswerRe: Datagridview Timed Output Pin
Richard MacCutchan10-Mar-14 22:46
mveRichard MacCutchan10-Mar-14 22:46 
QuestionShortest Way to Shuffle Array Pin
computerpublic10-Mar-14 16:23
computerpublic10-Mar-14 16:23 
AnswerRe: Shortest Way to Shuffle Array Pin
BillWoodruff10-Mar-14 22:35
professionalBillWoodruff10-Mar-14 22:35 
I prefer to use a Generic method to handle sorting any Type:
C#
private T[] ShuffleArray<T>(T[] theArray)
{
    Random rnd = new Random((int) DateTime.Now.Ticks & 0x0000FFFF);
    return theArray.OrderBy(itm => rnd.Next()).ToArray();
}
Examples of use:
C#
int[] theInts = new int[]{1,2,3,4,5};

theInts = ShuffleArray(theInts);

string[] theStrings = new string[] {"a", "b", "c", "d","e","f"};

theStrings = ShuffleArray(theStrings);
I used the code in this 2008 StackOverFlow thread for the shuffling routine shown here, but adapted it myself to be generic: [^].

I strongly suggest you study that SO thread; it has a variety of techniques presented, and good discussion of issues.

The technique I'm using here is not as "powerful," and fast, as other techniques: your specific Application may need/require stronger methods, including, possibly, the use of the Cryptographic Random generator in .NET; see: [^] for an example that uses 'OrderBy with the Cryptographic Random generator.
“The best hope is that one of these days the Ground will get disgusted enough just to walk away ~ leaving people with nothing more to stand ON than what they have so bloody well stood FOR up to now.” Kenneth Patchen, Poet

GeneralRe: Shortest Way to Shuffle Array Pin
Simon_Whale11-Mar-14 0:00
Simon_Whale11-Mar-14 0:00 
GeneralRe: Shortest Way to Shuffle Array Pin
computerpublic11-Mar-14 6:59
computerpublic11-Mar-14 6:59 

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.