Click here to Skip to main content
15,886,873 members

The Weird and The Wonderful

   

The Weird and The Wonderful forum is a place to post Coding Horrors, Worst Practices, and the occasional flash of brilliance.

We all come across code that simply boggles the mind. Lazy kludges, embarrassing mistakes, horrid workarounds and developers just not quite getting it. And then somedays we come across - or write - the truly sublime.

Post your Best, your worst, and your most interesting. But please - no programming questions . This forum is purely for amusement and discussions on code snippets. All actual programming questions will be removed.

 
GeneralRe: Special Case Pin
MehGerbil20-Jun-12 0:56
MehGerbil20-Jun-12 0:56 
GeneralRe: Special Case Pin
BobJanova20-Jun-12 3:45
BobJanova20-Jun-12 3:45 
GeneralRe: Special Case Pin
MehGerbil20-Jun-12 4:12
MehGerbil20-Jun-12 4:12 
AnswerRe: Special Case Pin
Rotted Frog25-Jun-12 18:17
Rotted Frog25-Jun-12 18:17 
GeneralRe: Special Case Pin
MehGerbil26-Jun-12 2:16
MehGerbil26-Jun-12 2:16 
AnswerRe: Special Case Pin
Vitaly Tomilov22-Jun-12 6:38
Vitaly Tomilov22-Jun-12 6:38 
GeneralRe: Special Case Pin
Albert Holguin25-Jun-12 17:43
professionalAlbert Holguin25-Jun-12 17:43 
GeneralInvalid TimeZone. Please Move. PinPopular
SoMad15-Jun-12 21:01
professionalSoMad15-Jun-12 21:01 
Almost 12 years ago (before I joined the company Smile | :) ), this little beauty almost made it into the release build of one of our applications:

// We need a time zone
CString strTimeZone;
timeb timeptr;
ftime(&timeptr);
long TimeZone  = (long)timeptr.timezone/(long)60;

switch(TimeZone)
{
case 8:
	strTimeZone = "P";
	break;
case 7:
	strTimeZone = "M";
	break;
case 6:
	strTimeZone = "C";
	break;
case 5:
	strTimeZone = "E";
	break;
default: 
	AfxMessageBox("Invalid TimeZone. Please Move.");
}



Soren Madsen
GeneralRe: Invalid TimeZone. Please Move. PinPopular
OriginalGriff15-Jun-12 21:17
mveOriginalGriff15-Jun-12 21:17 
GeneralRe: Invalid TimeZone. Please Move. Pin
SoMad15-Jun-12 21:38
professionalSoMad15-Jun-12 21:38 
GeneralRe: Invalid TimeZone. Please Move. PinPopular
Sander Rossel15-Jun-12 21:23
professionalSander Rossel15-Jun-12 21:23 
GeneralRe: Invalid TimeZone. Please Move. Pin
SoMad15-Jun-12 21:36
professionalSoMad15-Jun-12 21:36 
GeneralRe: Invalid TimeZone. Please Move. Pin
jschell18-Jun-12 11:27
jschell18-Jun-12 11:27 
GeneralRe: Invalid TimeZone. Please Move. Pin
satovey18-Jun-12 3:47
satovey18-Jun-12 3:47 
GeneralRe: Invalid TimeZone. Please Move. Pin
RafagaX18-Jun-12 7:18
professionalRafagaX18-Jun-12 7:18 
GeneralRe: Invalid TimeZone. Please Move. Pin
wizardzz18-Jun-12 9:33
wizardzz18-Jun-12 9:33 
GeneralRe: Invalid TimeZone. Please Move. PinPopular
JackDingler19-Jun-12 9:49
JackDingler19-Jun-12 9:49 
GeneralWhy String.Format? PinPopular
FireDog3126215-Jun-12 11:50
FireDog3126215-Jun-12 11:50 
GeneralRe: Why String.Format? Pin
Sander Rossel15-Jun-12 13:10
professionalSander Rossel15-Jun-12 13:10 
GeneralRe: Why String.Format? Pin
SoMad15-Jun-12 13:34
professionalSoMad15-Jun-12 13:34 
GeneralRe: Why String.Format? PinPopular
Sander Rossel15-Jun-12 21:19
professionalSander Rossel15-Jun-12 21:19 
GeneralRe: Why String.Format? Pin
SoMad15-Jun-12 21:30
professionalSoMad15-Jun-12 21:30 
GeneralRe: Why String.Format? Pin
Sander Rossel15-Jun-12 21:46
professionalSander Rossel15-Jun-12 21:46 
GeneralRe: Why String.Format? Pin
FireDog3126218-Jun-12 3:17
FireDog3126218-Jun-12 3:17 
GeneralRe: Why String.Format? Pin
Moshe Katz18-Jun-12 4:33
Moshe Katz18-Jun-12 4:33 

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.