Click here to Skip to main content
15,846,826 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 I learned to stop worrying & love The Error Pin
DrWalter PE26-Apr-23 19:38
professionalDrWalter PE26-Apr-23 19:38 
GeneralBut it feels so _diiirtyyy_! Pin
PIEBALDconsult1-Mar-23 9:01
mvePIEBALDconsult1-Mar-23 9:01 
GeneralRe: But it feels so _diiirtyyy_! Pin
Mircea Neacsu1-Mar-23 9:34
Mircea Neacsu1-Mar-23 9:34 
GeneralRe: But it feels so _diiirtyyy_! Pin
PIEBALDconsult1-Mar-23 10:08
mvePIEBALDconsult1-Mar-23 10:08 
GeneralRe: But it feels so _diiirtyyy_! Pin
Mircea Neacsu1-Mar-23 10:22
Mircea Neacsu1-Mar-23 10:22 
GeneralRe: But it feels so _diiirtyyy_! Pin
PIEBALDconsult1-Mar-23 10:32
mvePIEBALDconsult1-Mar-23 10:32 
GeneralRe: But it feels so _diiirtyyy_! Pin
jschell20-Mar-23 8:20
jschell20-Mar-23 8:20 
GeneralRe: But it feels so _diiirtyyy_! Pin
PIEBALDconsult20-Mar-23 11:04
mvePIEBALDconsult20-Mar-23 11:04 
The reader has no clue whether what it's reading is corrupt or not, that's determined at a higher level. The reader's job is to simply read the characters and return them.

jschell wrote:
Or say stop after 10 or so?

That's the issue I was running into, I had it throw an Exception after ten seconds, I needed to keep that from happening.


jschell wrote:
you are getting unicode


Yes, but the reader was taking too long to read the UNICODE characters which are outside the ASCII range. It now reads them almost as quickly as UNICODE characters which are within the ASCII range.
But to do so, It's flipping between two implementations of a method -- one for ASCII and another for non-ASCII -- depending on which characters it encounters.
GeneralRe: But it feels so _diiirtyyy_! Pin
jschell21-Mar-23 6:35
jschell21-Mar-23 6:35 
GeneralRe: But it feels so _diiirtyyy_! Pin
PIEBALDconsult21-Mar-23 6:50
mvePIEBALDconsult21-Mar-23 6:50 
GeneralRe: But it feels so _diiirtyyy_! Pin
jschell23-Mar-23 6:55
jschell23-Mar-23 6:55 
GeneralRe: But it feels so _diiirtyyy_! Pin
PIEBALDconsult23-Mar-23 7:53
mvePIEBALDconsult23-Mar-23 7:53 
GeneralChatGTP: Write me a poem about programming Pin
Marc Clifton1-Feb-23 4:00
mvaMarc Clifton1-Feb-23 4:00 
GeneralRe: ChatGTP: Write me a poem about programming Pin
Sean Ewington1-Feb-23 4:02
staffSean Ewington1-Feb-23 4:02 
GeneralRe: ChatGTP: Write me a poem about programming Pin
Slacker00716-Feb-23 2:13
professionalSlacker00716-Feb-23 2:13 
GeneralRe: ChatGTP: Write me a poem about programming Pin
Andre Oosthuizen28-Feb-23 3:03
mveAndre Oosthuizen28-Feb-23 3:03 
GeneralRe: ChatGTP: Write me a poem about programming PinPopular
Daniel Pfeffer1-Feb-23 4:22
professionalDaniel Pfeffer1-Feb-23 4:22 
GeneralRe: ChatGTP: Write me a poem about programming Pin
Slacker0071-Feb-23 5:33
professionalSlacker0071-Feb-23 5:33 
GeneralRe: ChatGTP: Write me a poem about programming Pin
Daniel Pfeffer1-Feb-23 7:41
professionalDaniel Pfeffer1-Feb-23 7:41 
GeneralRe: ChatGTP: Write me a poem about programming Pin
Jeremy Falcon1-Feb-23 9:31
professionalJeremy Falcon1-Feb-23 9:31 
GeneralRe: ChatGTP: Write me a poem about programming Pin
peterkm1-Feb-23 5:02
professionalpeterkm1-Feb-23 5:02 
GeneralRe: ChatGTP: Write me a poem about programming Pin
Ron Anders1-Feb-23 10:16
Ron Anders1-Feb-23 10:16 
GeneralRe: ChatGTP: Write me a poem about programming Pin
SteakhouseLuke15-Feb-23 2:02
SteakhouseLuke15-Feb-23 2:02 
GeneralSpan<T> equality Pin
Rob Grainger31-Jan-23 15:05
Rob Grainger31-Jan-23 15:05 
GeneralRe: Span<T> equality Pin
Richard Deeming31-Jan-23 22:50
mveRichard Deeming31-Jan-23 22:50 

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.