Click here to Skip to main content
15,921,793 members
Home / Discussions / C#
   

C#

 
QuestionDataSet merge method usage question. Pin
oscarderooij20-May-08 5:44
oscarderooij20-May-08 5:44 
AnswerRe: DataSet merge method usage question. Pin
topcatalpha20-May-08 21:27
topcatalpha20-May-08 21:27 
GeneralRe: DataSet merge method usage question. Pin
oscarderooij21-May-08 7:35
oscarderooij21-May-08 7:35 
QuestionC# Programming Challenge - By Reelix Pin
Reelix20-May-08 5:03
Reelix20-May-08 5:03 
AnswerRe: C# Programming Challenge - By Reelix [modified] Pin
originSH20-May-08 5:33
originSH20-May-08 5:33 
GeneralRe: C# Programming Challenge - By Reelix Pin
ssclaire20-May-08 6:35
ssclaire20-May-08 6:35 
GeneralRe: C# Programming Challenge - By Reelix Pin
User 665820-May-08 6:40
User 665820-May-08 6:40 
GeneralRe: C# Programming Challenge - By Reelix Pin
Guffa20-May-08 9:17
Guffa20-May-08 9:17 
GeneralRe: C# Programming Challenge - By Reelix Pin
Reelix20-May-08 9:10
Reelix20-May-08 9:10 
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
The Nightcoder21-May-08 14:08
The Nightcoder21-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 

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.