Click here to Skip to main content
15,894,273 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: How to read a file completely? Pin
David Skelly30-Jul-10 4:18
David Skelly30-Jul-10 4:18 
GeneralRe: How to read a file completely? Pin
PIEBALDconsult30-Jul-10 6:21
mvePIEBALDconsult30-Jul-10 6:21 
GeneralRe: How to read a file completely? Pin
Luc Pattyn30-Jul-10 6:26
sitebuilderLuc Pattyn30-Jul-10 6:26 
GeneralRe: How to read a file completely? Pin
MalikRizwan22-Sep-10 0:09
MalikRizwan22-Sep-10 0:09 
GeneralRe: How to read a file completely? Pin
Luc Pattyn22-Sep-10 2:02
sitebuilderLuc Pattyn22-Sep-10 2:02 
GeneralRe: How to read a file completely? Pin
MalikRizwan22-Sep-10 19:27
MalikRizwan22-Sep-10 19:27 
GeneralRe: How to read a file completely? Pin
Luc Pattyn22-Sep-10 19:39
sitebuilderLuc Pattyn22-Sep-10 19:39 
GeneralRe: How to read a file completely? Pin
Bernhard Hiller1-Aug-10 20:02
Bernhard Hiller1-Aug-10 20:02 
It breaks out of the loop with the first exception encountered, which is typically a System.IO.EndOfStreamException because the last line from which is read is always empty. And the normal way to leave that loop is exactly this exception. Every file read will cause three such lines in the log file (later on, the file is read another two times - it is certain that it has not changed between reads...). The next file causing another three lines in the log, and so on. When searching for the cause of a different error I was severely mislead by these messages.
GeneralRe: How to read a file completely? Pin
itsravie3-Aug-10 0:33
itsravie3-Aug-10 0:33 
AnswerRe: How to read a file completely? Depends on how you read the file. Pin
Dwayne J. Baldwin3-Aug-10 20:38
Dwayne J. Baldwin3-Aug-10 20:38 
GeneralRe: How to read a file completely? Pin
Machaira4-Aug-10 2:24
Machaira4-Aug-10 2:24 
GeneralBored of if..else? PinPopular
Dan_Martin28-Jul-10 22:45
Dan_Martin28-Jul-10 22:45 
GeneralRe: Bored of if..else? Pin
Keith Barrow29-Jul-10 2:57
professionalKeith Barrow29-Jul-10 2:57 
GeneralRe: Bored of if..else? PinPopular
Jeroen De Dauw29-Jul-10 3:09
Jeroen De Dauw29-Jul-10 3:09 
GeneralRe: Bored of if..else? Pin
Samuel Cragg30-Jul-10 12:29
Samuel Cragg30-Jul-10 12:29 
GeneralRe: Bored of if..else? Pin
Gary R. Wheeler1-Aug-10 0:21
Gary R. Wheeler1-Aug-10 0:21 
GeneralRe: Bored of if..else? Pin
bleedingfingers3-Aug-10 2:10
bleedingfingers3-Aug-10 2:10 
GeneralRe: Bored of if..else? Pin
Hired Mind5-Aug-10 10:59
Hired Mind5-Aug-10 10:59 
GeneralRe: Bored of if..else? Pin
Roger Wright3-Aug-10 20:55
professionalRoger Wright3-Aug-10 20:55 
GeneralRe: Bored of if..else? Pin
VaKa11-Aug-10 9:27
VaKa11-Aug-10 9:27 
GeneralRe: Bored of if..else? [modified] Pin
BillW3325-Aug-10 6:12
professionalBillW3325-Aug-10 6:12 
GeneralClustering... The hard way! Pin
Geoff Bolton28-Jul-10 17:44
Geoff Bolton28-Jul-10 17:44 
GeneralRe: Clustering... The hard way! Pin
Super Lloyd28-Jul-10 20:49
Super Lloyd28-Jul-10 20:49 
GeneralRe: Clustering... The hard way! Pin
leppie28-Jul-10 21:57
leppie28-Jul-10 21:57 
GeneralRe: Clustering... The hard way! Pin
Jeroen De Dauw29-Jul-10 3:14
Jeroen De Dauw29-Jul-10 3:14 

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.