Click here to Skip to main content
15,886,137 members
Home / Discussions / C#
   

C#

 
Questionactivity-selection algorithm in c# Pin
mazizi026-Jan-13 20:36
mazizi026-Jan-13 20:36 
AnswerRe: activity-selection algorithm in c# Pin
Pete O'Hanlon26-Jan-13 21:16
mvePete O'Hanlon26-Jan-13 21:16 
GeneralRe: activity-selection algorithm in c# Pin
mazizi027-Jan-13 9:37
mazizi027-Jan-13 9:37 
GeneralRe: activity-selection algorithm in c# Pin
Pete O'Hanlon27-Jan-13 9:50
mvePete O'Hanlon27-Jan-13 9:50 
AnswerRe: activity-selection algorithm in c# Pin
Dave Kreskowiak27-Jan-13 3:46
mveDave Kreskowiak27-Jan-13 3:46 
GeneralRe: activity-selection algorithm in c# Pin
mazizi027-Jan-13 9:35
mazizi027-Jan-13 9:35 
GeneralRe: activity-selection algorithm in c# Pin
Dave Kreskowiak27-Jan-13 14:37
mveDave Kreskowiak27-Jan-13 14:37 
AnswerRe: activity-selection algorithm in c# Pin
riced27-Jan-13 11:06
riced27-Jan-13 11:06 
Here's an activity selection algorithmm coded in C# - probably not what you want. Smile | :)
But you have not explained what you want.
C#
static void Main(string[] args)
{
   Random rndGen = new Random();
   var activities = new List<string>() { "bake bread", "mow lawn", "read book", "sleep", "don batman costume", "sneeze",
                  "have a beer", "code furiously", "make excuse for late assignment", "plead for help"};

   for (int i = 0; i < 3; i++)
   {
      int act = rndGen.Next(activities.Count);
      Console.WriteLine((i+1).ToString() + ". " + activities[act]);
   }
   Console.ReadLine();
}

Regards
David R
---------------------------------------------------------------
"Every program eventually becomes rococo, and then rubble." - Alan Perlis
The only valid measurement of code quality: WTFs/minute.

GeneralRe: activity-selection algorithm in c# Pin
PIEBALDconsult27-Jan-13 17:50
mvePIEBALDconsult27-Jan-13 17:50 
AnswerRe: activity-selection algorithm in c# Pin
J4amieC28-Jan-13 0:44
J4amieC28-Jan-13 0:44 
AnswerRe: activity-selection algorithm in c# Pin
pt140128-Jan-13 8:40
pt140128-Jan-13 8:40 
QuestionC# access excel file Pin
dcof26-Jan-13 18:24
dcof26-Jan-13 18:24 
SuggestionRe: C# access excel file Pin
Richard MacCutchan27-Jan-13 0:15
mveRichard MacCutchan27-Jan-13 0:15 
AnswerRe: C# access excel file Pin
Dave Kreskowiak27-Jan-13 3:44
mveDave Kreskowiak27-Jan-13 3:44 
QuestionWCF receiving large XML Pin
Alex Campos Vzla25-Jan-13 11:39
Alex Campos Vzla25-Jan-13 11:39 
AnswerRe: WCF receiving large XML Pin
Eddy Vluggen26-Jan-13 3:38
professionalEddy Vluggen26-Jan-13 3:38 
Questionreading NTFS Share permission - how to interpret SHARE_INFO_2.Permissions flag Pin
devvvy25-Jan-13 8:52
devvvy25-Jan-13 8:52 
AnswerRe: reading NTFS Share permission - how to interpret SHARE_INFO_2.Permissions flag Pin
André Kraak25-Jan-13 10:57
André Kraak25-Jan-13 10:57 
AnswerRe: reading NTFS Share permission - how to interpret SHARE_INFO_2.Permissions flag Pin
Richard Deeming28-Jan-13 2:02
mveRichard Deeming28-Jan-13 2:02 
Questionreturn list of url if i enter specific keyword Pin
prashant.k.bamania25-Jan-13 2:24
prashant.k.bamania25-Jan-13 2:24 
AnswerRe: return list of url if i enter specific keyword Pin
Richard MacCutchan25-Jan-13 3:24
mveRichard MacCutchan25-Jan-13 3:24 
GeneralRe: return list of url if i enter specific keyword Pin
prashant.k.bamania26-Jan-13 1:21
prashant.k.bamania26-Jan-13 1:21 
GeneralRe: return list of url if i enter specific keyword Pin
Richard MacCutchan26-Jan-13 1:23
mveRichard MacCutchan26-Jan-13 1:23 
AnswerRe: return list of url if i enter specific keyword Pin
Pete O'Hanlon25-Jan-13 3:53
mvePete O'Hanlon25-Jan-13 3:53 
GeneralRe: return list of url if i enter specific keyword Pin
prashant.k.bamania26-Jan-13 1:22
prashant.k.bamania26-Jan-13 1:22 

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.