Click here to Skip to main content
11,640,626 members (60,331 online)

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, embarrasing 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: The most creative log ever Pin
Brisingr Aerowing7-Oct-13 4:36
professionalBrisingr Aerowing7-Oct-13 4:36 
GeneralRe: The most creative log ever Pin
Rage11-Oct-13 0:18
memberRage11-Oct-13 0:18 
GeneralRe: The most creative log ever Pin
Guy Lavi12-Oct-13 20:39
memberGuy Lavi12-Oct-13 20:39 
JokeRedundancy at its finest Pin
Edward Giles5-Oct-13 21:49
memberEdward Giles5-Oct-13 21:49 
GeneralRe: Redundancy at its finest Pin
Kornfeld Eliyahu Peter6-Oct-13 9:03
memberKornfeld Eliyahu Peter6-Oct-13 9:03 
GeneralRe: Redundancy at its finest Pin
Brisingr Aerowing6-Oct-13 14:33
professionalBrisingr Aerowing6-Oct-13 14:33 
GeneralRe: Redundancy at its finest Pin
RyanDev7-Oct-13 2:32
memberRyanDev7-Oct-13 2:32 
GeneralRe: Redundancy at its finest Pin
Bernhard Hiller6-Oct-13 22:14
professionalBernhard Hiller6-Oct-13 22:14 
GeneralRe: Redundancy at its finest Pin
Edward Giles11-Nov-13 23:34
memberEdward Giles11-Nov-13 23:34 
GeneralRe: Redundancy at its finest Pin
OriginalGriff6-Oct-13 22:29
protectorOriginalGriff6-Oct-13 22:29 
GeneralRe: Redundancy at its finest Pin
RyanDev7-Oct-13 2:33
memberRyanDev7-Oct-13 2:33 
GeneralRe: Redundancy at its finest Pin
0bx7-Oct-13 23:48
member0bx7-Oct-13 23:48 
GeneralRe: Redundancy at its finest Pin
MacSpudster5-Nov-13 5:47
memberMacSpudster5-Nov-13 5:47 
JokeHow to zero-pad a number? Pin
SortaCore1-Oct-13 0:27
memberSortaCore1-Oct-13 0:27 
A padded number in a file name!
// Set to padded number
int fileCount = Directory.GetFiles("[censored]", "*.csv", SearchOption.AllDirectories).Length + 1;
string fileCountStr = (fileCount <= 999 ? fileCount <= 99 ? fileCount <= 9 ? "000" : "00" : "0" : "") + fileCount;

I think this should win an award for readability in a triply-nested ternary condition Roll eyes | :rolleyes: .
GeneralRe: How to zero-pad a number? Pin
Nagy Vilmos1-Oct-13 0:49
professionalNagy Vilmos1-Oct-13 0:49 
GeneralRe: How to zero-pad a number? Pin
SortaCore1-Oct-13 0:55
memberSortaCore1-Oct-13 0:55 
GeneralRe: How to zero-pad a number? Pin
PIEBALDconsult1-Oct-13 4:18
professionalPIEBALDconsult1-Oct-13 4:18 
GeneralRe: How to zero-pad a number? Pin
Richard Deeming1-Oct-13 4:27
professionalRichard Deeming1-Oct-13 4:27 
GeneralRe: How to zero-pad a number? Pin
PIEBALDconsult1-Oct-13 6:27
professionalPIEBALDconsult1-Oct-13 6:27 
GeneralRe: How to zero-pad a number? Pin
Richard Deeming1-Oct-13 7:09
professionalRichard Deeming1-Oct-13 7:09 
GeneralRe: How to zero-pad a number? Pin
PIEBALDconsult1-Oct-13 10:43
professionalPIEBALDconsult1-Oct-13 10:43 
GeneralRe: How to zero-pad a number? Pin
Richard Deeming1-Oct-13 10:57
professionalRichard Deeming1-Oct-13 10:57 
GeneralRe: How to zero-pad a number? Pin
Big Daddy Farang1-Oct-13 11:23
memberBig Daddy Farang1-Oct-13 11:23 
GeneralRe: How to zero-pad a number? Pin
PIEBALDconsult1-Oct-13 13:44
professionalPIEBALDconsult1-Oct-13 13:44 
GeneralRe: How to zero-pad a number? Pin
Richard Deeming2-Oct-13 1:44
professionalRichard Deeming2-Oct-13 1:44 
GeneralRe: How to zero-pad a number? Pin
SortaCore2-Oct-13 2:07
memberSortaCore2-Oct-13 2:07 
GeneralRe: How to zero-pad a number? Pin
PIEBALDconsult2-Oct-13 3:12
professionalPIEBALDconsult2-Oct-13 3:12 
GeneralRe: How to zero-pad a number? Pin
Richard Deeming2-Oct-13 3:19
professionalRichard Deeming2-Oct-13 3:19 
GeneralRe: How to zero-pad a number? Pin
PIEBALDconsult2-Oct-13 3:28
professionalPIEBALDconsult2-Oct-13 3:28 
GeneralRe: How to zero-pad a number? Pin
SortaCore2-Oct-13 9:21
memberSortaCore2-Oct-13 9:21 
GeneralRe: How to zero-pad a number? Pin
SortaCore1-Oct-13 10:48
memberSortaCore1-Oct-13 10:48 
GeneralRe: How to zero-pad a number? Pin
Grimlock2-Oct-13 23:19
professionalGrimlock2-Oct-13 23:19 
GeneralThat really makes a difference Pin
mav.northwind26-Sep-13 20:51
membermav.northwind26-Sep-13 20:51 
GeneralRe: That really makes a difference Pin
GuyThiebaut2-Oct-13 5:31
memberGuyThiebaut2-Oct-13 5:31 
GeneralRe: That really makes a difference Pin
Athari7-Oct-13 6:50
professionalAthari7-Oct-13 6:50 
GeneralCan I copy that? Pin
BotCar25-Sep-13 2:32
memberBotCar25-Sep-13 2:32 
GeneralRe: Can I copy that? Pin
Pete O'Hanlon25-Sep-13 2:46
protectorPete O'Hanlon25-Sep-13 2:46 
GeneralRe: Can I copy that? Pin
Nicholas Marty25-Sep-13 4:12
memberNicholas Marty25-Sep-13 4:12 
GeneralWhy is my code so slow?? Pin
vonb24-Sep-13 1:39
professionalvonb24-Sep-13 1:39 
GeneralRe: Why is my code so slow?? Pin
Jörgen Andersson24-Sep-13 4:30
professionalJörgen Andersson24-Sep-13 4:30 
GeneralRe: Why is my code so slow?? Pin
vonb24-Sep-13 4:37
professionalvonb24-Sep-13 4:37 
GeneralRe: Why is my code so slow?? Pin
Jörgen Andersson24-Sep-13 8:32
professionalJörgen Andersson24-Sep-13 8:32 
GeneralRe: Why is my code so slow?? Pin
Rage24-Sep-13 5:15
memberRage24-Sep-13 5:15 
GeneralRe: Why is my code so slow?? Pin
Jörgen Andersson24-Sep-13 8:34
professionalJörgen Andersson24-Sep-13 8:34 
GeneralMessage Automatically Removed Pin
24-Sep-13 8:49
memberNishali Kashyap24-Sep-13 8:49 
GeneralRe: Why is my code so slow?? Pin
CIDev24-Sep-13 5:01
professionalCIDev24-Sep-13 5:01 
GeneralRe: Why is my code so slow?? Pin
OriginalGriff24-Sep-13 8:58
protectorOriginalGriff24-Sep-13 8:58 
GeneralRe: Why is my code so slow?? Pin
@AmitGajjar25-Sep-13 1:57
professional@AmitGajjar25-Sep-13 1:57 
GeneralRe: Why is my code so slow?? Pin
PIEBALDconsult24-Sep-13 15:38
professionalPIEBALDconsult24-Sep-13 15:38 
GeneralRe: Why is my code so slow?? Pin
vonb24-Sep-13 19:20
professionalvonb24-Sep-13 19:20 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.


Advertise | Privacy | Mobile
Web01 | 2.8.150731.1 | Last Updated 1 Aug 2015
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid