Click here to Skip to main content
15,890,438 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: I must be doing something wrong... Pin
Daniel Pfeffer19-Mar-23 23:07
professionalDaniel Pfeffer19-Mar-23 23:07 
GeneralRe: I must be doing something wrong... Pin
PIEBALDconsult20-Mar-23 2:50
mvePIEBALDconsult20-Mar-23 2:50 
GeneralRe: I must be doing something wrong... Pin
Daniel Pfeffer20-Mar-23 4:26
professionalDaniel Pfeffer20-Mar-23 4:26 
GeneralRe: I must be doing something wrong... Pin
Bohdan Stupak19-Apr-23 4:31
professionalBohdan Stupak19-Apr-23 4:31 
GeneralChatGPT "solves" a riddle for me. Pin
GKP199212-Mar-23 22:15
professionalGKP199212-Mar-23 22:15 
GeneralRe: ChatGPT "solves" a riddle for me. Pin
Jörgen Andersson13-Mar-23 0:13
professionalJörgen Andersson13-Mar-23 0:13 
GeneralRe: ChatGPT "solves" a riddle for me. Pin
Ron Anders13-Mar-23 1:45
Ron Anders13-Mar-23 1:45 
GeneralRe: ChatGPT "solves" a riddle for me. Pin
jschell20-Mar-23 7:03
jschell20-Mar-23 7:03 
GeneralRe: ChatGPT "solves" a riddle for me. Pin
PIEBALDconsult13-Mar-23 5:34
mvePIEBALDconsult13-Mar-23 5:34 
GeneralRe: ChatGPT "solves" a riddle for me. Pin
PIEBALDconsult13-Mar-23 13:34
mvePIEBALDconsult13-Mar-23 13:34 
GeneralRe: ChatGPT "solves" a riddle for me. Pin
adriancs6-Apr-23 1:15
mvaadriancs6-Apr-23 1:15 
GeneralRe: ChatGPT "solves" a riddle for me. Pin
adriancs6-Apr-23 1:26
mvaadriancs6-Apr-23 1:26 
GeneralRe: ChatGPT "solves" a riddle for me. Pin
DrWalter PE26-Apr-23 18:38
professionalDrWalter PE26-Apr-23 18:38 
GeneralRe: ChatGPT "solves" a riddle for me. Pin
GKP199226-Apr-23 20:26
professionalGKP199226-Apr-23 20:26 
GeneralRe: ChatGPT "solves" a riddle for me. Pin
Amarnath S18-May-23 1:08
professionalAmarnath S18-May-23 1:08 
GeneralHow I learned to stop worrying & love The Error Pin
raddevus12-Mar-23 12:48
mvaraddevus12-Mar-23 12:48 
GeneralRe: How I learned to stop worrying & love The Error Pin
jschell20-Mar-23 7:13
jschell20-Mar-23 7:13 
GeneralRe: How I learned to stop worrying & love The Error Pin
DrWalter PE26-Apr-23 18:38
professionalDrWalter PE26-Apr-23 18:38 
GeneralBut it feels so _diiirtyyy_! Pin
PIEBALDconsult1-Mar-23 8:01
mvePIEBALDconsult1-Mar-23 8:01 
GeneralRe: But it feels so _diiirtyyy_! Pin
Mircea Neacsu1-Mar-23 8:34
Mircea Neacsu1-Mar-23 8:34 
GeneralRe: But it feels so _diiirtyyy_! Pin
PIEBALDconsult1-Mar-23 9:08
mvePIEBALDconsult1-Mar-23 9:08 
GeneralRe: But it feels so _diiirtyyy_! Pin
Mircea Neacsu1-Mar-23 9:22
Mircea Neacsu1-Mar-23 9:22 
GeneralRe: But it feels so _diiirtyyy_! Pin
PIEBALDconsult1-Mar-23 9:32
mvePIEBALDconsult1-Mar-23 9:32 
GeneralRe: But it feels so _diiirtyyy_! Pin
jschell20-Mar-23 7:20
jschell20-Mar-23 7:20 
GeneralRe: But it feels so _diiirtyyy_! Pin
PIEBALDconsult20-Mar-23 10:04
mvePIEBALDconsult20-Mar-23 10: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.

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.