|
|
The guy is hidden a genious! He calculated the prime numbers up to 113 without assistance! I would have stopped at 19...
|
|
|
|
|
|
I do kinda feel sorry for him. I hope you crushed his dreams of being a programmer.
|
|
|
|
|
|
He is a genius - always staying in business with a new update of primes!!
|
|
|
|
|
ROFL ! I REALLY hope that he doesn't get hired to program an elevator controller or people will will wait a long time before getting to their level.
Je vous salue du Québec !
|
|
|
|
|
During starting my career as VC programmer and my first multithread program
I used the while loop and global variable to wait for thread to finish.
I always recall it when ever I write WaitForSingleObject after that.
<br />
DWORD dwStart = GetTickCount();<br />
<br />
while( m_sManagerNode.IsEmpty() == FALSE ){<br />
if( GetTickCount() - dwStart >= 60000 ){<br />
bReturn = FALSE; <br />
break;<br />
}<br />
}<br />
return( TRUE );<br />
Regards
Anil
|
|
|
|
|
|
Well, you made the lazy CPU working...
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
|
|
|
|
|
|
No worries, one Sleep could save you
codito ergo sum
|
|
|
|
|
I think it already happened to everyone to rewrite existing code or API just because one did not know that the code already existed.
In a different manner, as I was a student, it took me one week to transform serial signals (-12/+12 Volts) into a (0/+5V) signals using all kind of electronic beings (resistance, amplifier, ...) just to find out after that that someone had already thought about the problem and that we could buy RS232 integrated circuits everywhere.
Constantly "Saving the day" should be taken as a sign of organizational dysfunction rather than individual skill - Ryan Roberts[^]
|
|
|
|
|
Yeah, I'd probably cringe if I had to look at some of the "code"(I use the term loosly) that I wrote right out of college.
|
|
|
|
|
This doesn't register with me, I learned threads with Java ... Maybe comment and point out mistakes ?
Je vous salue du Québec !
|
|
|
|
|
|
After reading a few posts on this forum, it makes me remember some horrible code I have written before. (While I was a VB5 programmer)
It also reminds me of some horrible code I've seen some other people write, like the following:
private bool isValid(int testValue, int minValue, int maxValue)
{
for (int counter = minValue; counter <= maxValue; counter++)
{
if (testValue == counter)
{
return true;
}
else
{
if (counter == maxValue)
{
return false;
}
}
}
}
To make matters worse, they then called this method a few hundred times with min and max Values of 0 and about 500.
---
The sum of the intelligence of the world is constant. The total number of people is always increasing.
|
|
|
|
|
Nice, that's a brilliant little horror.
p.s. use <pre> tags around your code instead of <code> tags. <pre> tags will preserve the whitespace.
|
|
|
|
|
I've just modified it to use <pre> tags
---
The sum of the intelligence of the world is constant. The total number of people is always increasing.
|
|
|
|
|
hmmm awesome
Regards,
Sylvester G
sylvester_g_m@yahoo.com
|
|
|
|
|
Hey, don't knock VB5... Back in the day, it was pretty amazing if you were too lazy/rushed to learn the MFC.
As for the code... Wow... Nice one.
|
|
|
|
|
Oh, man, I never thought of doing that.
|
|
|
|
|
PIEBALDconsult wrote: Oh, man, I never thought of doing that.
I saw the following formatting masterpiece:
int nTotalMinutes;
int nHours=0;
int nMinutes=0;
while (nTotalMinutes >= 60)
{
nTotalMinutes -= 60;
nHours++;
}
printf("Time %d:%d\n", nHours, nMinutes);
The above snippet only illustrates the concept because, if I remember well, the starting point were nTotalSeconds !
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
|
|
|
|
|
Why, oh why? Use modulus , pleeaaassee
|
|
|
|
|
Simply because they weren't able to use it...
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
|
|
|
|