Click here to Skip to main content
15,899,825 members
Home / Discussions / C#
   

C#

 
AnswerRe: C# Programming Challenge - By Reelix Pin
geekfromindia20-May-08 5:51
geekfromindia20-May-08 5:51 
GeneralRe: C# Programming Challenge - By Reelix Pin
Reelix20-May-08 9:05
Reelix20-May-08 9:05 
AnswerRe: C# Programming Challenge - By Reelix Pin
geekfromindia20-May-08 5:56
geekfromindia20-May-08 5:56 
AnswerRe: C# Programming Challenge - By Reelix [modified] Pin
User 665820-May-08 6:09
User 665820-May-08 6:09 
GeneralRe: C# Programming Challenge - By Reelix Pin
Reelix20-May-08 9:12
Reelix20-May-08 9:12 
AnswerToo easy Pin
Guffa20-May-08 8:01
Guffa20-May-08 8:01 
GeneralRe: Too easy Pin
Reelix20-May-08 9:17
Reelix20-May-08 9:17 
GeneralRe: Too easy Pin
Guffa20-May-08 9:21
Guffa20-May-08 9:21 
Reelix wrote:
And the (possible) answer YOU were looking for is one from further up...

Move the

sw1.Start();

JUST above the

// Touch Nothing Below Here


No, I have the sw1.Start(); at the top. No cheating. Smile | :)

Let's do it like this:
Stopwatch sw1 = new Stopwatch();
sw1.Start();
string largeString;
// Touch nothing above here

... code to populate the string here

// Touch nothing below here
if (largeString.Length == 500000) {
	Console.WriteLine("Pass 1");
} else {
	Console.WriteLine("Fail 1");
}
if (sw1.ElapsedMilliseconds < 1000) {
	Console.WriteLine("Pass 2");
} else {
	Console.WriteLine("Fail 2 - " + sw1.ElapsedMilliseconds);
}
bool pass = true;
for (int i = 0; i < 500000; i += 10) if (largeString.Substring(i, 10) != "1234567890") pass = false;
if (pass) {
	Console.WriteLine("Pass 3");
} else {
	Console.WriteLine("Fail 3");
}


Despite everything, the person most likely to be fooling you next is yourself.

GeneralRe: Too easy Pin
Reelix20-May-08 19:58
Reelix20-May-08 19:58 
GeneralRe: Too easy Pin
Guffa21-May-08 6:00
Guffa21-May-08 6:00 
GeneralRe: Too easy Pin
Peter Josefsson Sweden21-May-08 14:08
Peter Josefsson Sweden21-May-08 14:08 
AnswerRe: C# Programming Challenge - By Reelix Pin
#realJSOP20-May-08 10:35
professional#realJSOP20-May-08 10:35 
GeneralRe: C# Programming Challenge - By Reelix Pin
Ennis Ray Lynch, Jr.20-May-08 12:04
Ennis Ray Lynch, Jr.20-May-08 12:04 
GeneralRe: C# Programming Challenge - By Reelix Pin
Gareth H20-May-08 12:40
Gareth H20-May-08 12:40 
GeneralRe: C# Programming Challenge - By Reelix Pin
#realJSOP20-May-08 23:17
professional#realJSOP20-May-08 23:17 
GeneralRe: C# Programming Challenge - By Reelix Pin
Reelix20-May-08 20:00
Reelix20-May-08 20:00 
QuestionRadiobuttons binding Pin
topcatalpha20-May-08 4:54
topcatalpha20-May-08 4:54 
QuestionBinaryFormatter Serializer Out-of-Memory Exception Pin
Ian Uy20-May-08 4:54
Ian Uy20-May-08 4:54 
AnswerRe: BinaryFormatter Serializer Out-of-Memory Exception Pin
Judah Gabriel Himango20-May-08 5:03
sponsorJudah Gabriel Himango20-May-08 5:03 
GeneralRe: BinaryFormatter Serializer Out-of-Memory Exception Pin
Ian Uy20-May-08 5:20
Ian Uy20-May-08 5:20 
GeneralRe: BinaryFormatter Serializer Out-of-Memory Exception Pin
Judah Gabriel Himango20-May-08 5:45
sponsorJudah Gabriel Himango20-May-08 5:45 
QuestionHow to refresh Combo Box in data grid view? [modified] Pin
cocoonwls20-May-08 4:47
cocoonwls20-May-08 4:47 
AnswerRe: How to refresh Combo Box in data grid view? Pin
cocoonwls27-May-08 16:19
cocoonwls27-May-08 16:19 
QuestionHow to convert text files to PDF files using C#.Net Pin
Sophia Rekhi20-May-08 4:32
Sophia Rekhi20-May-08 4:32 
AnswerRe: How to convert text files to PDF files using C#.Net Pin
Judah Gabriel Himango20-May-08 4:59
sponsorJudah Gabriel Himango20-May-08 4: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.