Click here to Skip to main content
15,886,067 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: 3 years back I wrote like this :) Pin
Sathesh Sakthivel9-Jul-07 20:03
Sathesh Sakthivel9-Jul-07 20:03 
GeneralBrings back memories [modified] Pin
D1117-Jun-07 4:16
D1117-Jun-07 4:16 
GeneralRe: Brings back memories Pin
Judah Gabriel Himango7-Jun-07 4:19
sponsorJudah Gabriel Himango7-Jun-07 4:19 
GeneralRe: Brings back memories Pin
D1117-Jun-07 5:20
D1117-Jun-07 5:20 
GeneralRe: Brings back memories Pin
Sylvester george7-Jun-07 4:37
Sylvester george7-Jun-07 4:37 
GeneralRe: Brings back memories Pin
Ian Shlasko7-Jun-07 4:41
Ian Shlasko7-Jun-07 4:41 
GeneralRe: Brings back memories Pin
PIEBALDconsult7-Jun-07 4:50
mvePIEBALDconsult7-Jun-07 4:50 
GeneralRe: Brings back memories Pin
CPallini7-Jun-07 5:57
mveCPallini7-Jun-07 5:57 
PIEBALDconsult wrote:
Oh, man, I never thought of doing that.



I saw the following formatting masterpiece:

int nTotalMinutes; // Total time expressed in minutes

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! Big Grin | :-D

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.

GeneralRe: Brings back memories Pin
Michael Sadlon7-Jun-07 8:18
Michael Sadlon7-Jun-07 8:18 
GeneralRe: Brings back memories Pin
CPallini7-Jun-07 9:02
mveCPallini7-Jun-07 9:02 
GeneralRe: Brings back memories Pin
Emil - Gabriel11-Jun-07 4:18
Emil - Gabriel11-Jun-07 4:18 
GeneralRe: Brings back memories Pin
CPallini11-Jun-07 5:15
mveCPallini11-Jun-07 5:15 
GeneralRe: Brings back memories Pin
Michael Sadlon7-Jun-07 8:20
Michael Sadlon7-Jun-07 8:20 
GeneralNot the same Pin
Xiangyang Liu 刘向阳7-Jun-07 16:44
Xiangyang Liu 刘向阳7-Jun-07 16:44 
GeneralRe: Not the same Pin
PIEBALDconsult8-Jun-07 3:28
mvePIEBALDconsult8-Jun-07 3:28 
GeneralRe: Not the same Pin
PIEBALDconsult9-Jun-07 7:03
mvePIEBALDconsult9-Jun-07 7:03 
GeneralRe: Brings back memories Pin
Pete O'Hanlon7-Jun-07 8:25
mvePete O'Hanlon7-Jun-07 8:25 
GeneralRe: Brings back memories Pin
Ravi Bhavnani7-Jun-07 19:51
professionalRavi Bhavnani7-Jun-07 19:51 
GeneralRe: Brings back memories Pin
John R. Shaw8-Jun-07 22:38
John R. Shaw8-Jun-07 22:38 
GeneralRe: Brings back memories Pin
Russell Jones13-Jun-07 3:45
Russell Jones13-Jun-07 3:45 
GeneralRe: Brings back memories Pin
DynV21-Jun-07 18:38
DynV21-Jun-07 18:38 
GeneralObviously Pin
Judah Gabriel Himango6-Jun-07 13:02
sponsorJudah Gabriel Himango6-Jun-07 13:02 
JokeRe: Obviously Pin
Chris Meech6-Jun-07 14:44
Chris Meech6-Jun-07 14:44 
GeneralRe: Obviously Pin
Pete O'Hanlon6-Jun-07 23:01
mvePete O'Hanlon6-Jun-07 23:01 
JokeRe: Obviously Pin
DavidNohejl6-Jun-07 23:40
DavidNohejl6-Jun-07 23:40 

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.