Click here to Skip to main content
15,886,873 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.

 
AnswerRe: Interesting technique used in some Legacy code! Pin
Super Lloyd18-Jun-14 20:35
Super Lloyd18-Jun-14 20:35 
GeneralRe: Interesting technique used in some Legacy code! Pin
Stefan_Lang20-Jun-14 4:34
Stefan_Lang20-Jun-14 4:34 
GeneralRe: Interesting technique used in some Legacy code! Pin
Super Lloyd20-Jun-14 5:26
Super Lloyd20-Jun-14 5:26 
GeneralCodeProject Daily News - The only newsletter I would, deliberately, subscribe to PinPopular
Adam Tibi10-Jun-14 23:25
professionalAdam Tibi10-Jun-14 23:25 
GeneralRe: CodeProject Daily News - The only newsletter I would, deliberately, subscribe to Pin
JMK-NI10-Jun-14 23:42
professionalJMK-NI10-Jun-14 23:42 
GeneralRe: CodeProject Daily News - The only newsletter I would, deliberately, subscribe to Pin
PIEBALDconsult12-Jun-14 3:08
mvePIEBALDconsult12-Jun-14 3:08 
GeneralRe: CodeProject Daily News - The only newsletter I would, deliberately, subscribe to Pin
OriginalGriff16-Jun-14 5:28
mveOriginalGriff16-Jun-14 5:28 
GeneralEnhanced Password Security Pin
Bernhard Hiller10-Jun-14 21:08
Bernhard Hiller10-Jun-14 21:08 
The other day, a customer complained that we - sometimes, but not always - wrote the password of their Hospital Information System (HIS) in our log files in clear text.
Heh? Just another customer telling us bullshit!?
Alahs, right he is.
When our application starts, it logs some general information, e.g. hardware, OS, and Environment Variables.
And in the section of the Environment Variables, sometimes there was an entry like
HIS_PWD=CUSTOMERS_HIS_PASSWORD
The customer found then out that it did not happen when he started our application from the start menu or from its desktop item. It only happened when he started it from the HIS (as the doctors normally do: the HIS can provide us with context information like the patient the doctor is working on).
Well, a process inherits the environment from the process it was started from, including all its Environment Variables.
Do you see what happened here?
It's really a great idea to store the clear-text password as an environment variable, it is absolutely safe there.
JokeRe: Enhanced Password Security Pin
Kornfeld Eliyahu Peter10-Jun-14 22:17
professionalKornfeld Eliyahu Peter10-Jun-14 22:17 
GeneralRe: Enhanced Password Security Pin
Eddy Vluggen11-Jun-14 0:29
professionalEddy Vluggen11-Jun-14 0:29 
GeneralRe: Enhanced Password Security Pin
Trajan McGill11-Jun-14 3:07
Trajan McGill11-Jun-14 3:07 
GeneralRe: Enhanced Password Security Pin
PIEBALDconsult11-Jun-14 12:02
mvePIEBALDconsult11-Jun-14 12:02 
GeneralRe: Enhanced Password Security Pin
PIEBALDconsult11-Jun-14 12:10
mvePIEBALDconsult11-Jun-14 12:10 
GeneralDateTime.Now vs. GetSystemTime Pin
Bernhard Hiller30-May-14 0:17
Bernhard Hiller30-May-14 0:17 
GeneralRe: DateTime.Now vs. GetSystemTime Pin
Pete O'Hanlon30-May-14 1:05
mvePete O'Hanlon30-May-14 1:05 
GeneralRe: DateTime.Now vs. GetSystemTime Pin
Bernhard Hiller2-Jun-14 0:30
Bernhard Hiller2-Jun-14 0:30 
GeneralRe: DateTime.Now vs. GetSystemTime Pin
Pete O'Hanlon2-Jun-14 0:32
mvePete O'Hanlon2-Jun-14 0:32 
GeneralRe: DateTime.Now vs. GetSystemTime Pin
Jörgen Andersson2-Jun-14 21:11
professionalJörgen Andersson2-Jun-14 21:11 
GeneralRe: DateTime.Now vs. GetSystemTime Pin
Bernhard Hiller2-Jun-14 21:35
Bernhard Hiller2-Jun-14 21:35 
GeneralRe: DateTime.Now vs. GetSystemTime Pin
Jörgen Andersson2-Jun-14 21:56
professionalJörgen Andersson2-Jun-14 21:56 
GeneralRe: DateTime.Now vs. GetSystemTime Pin
BobJanova2-Jun-14 0:51
BobJanova2-Jun-14 0:51 
GeneralRe: DateTime.Now vs. GetSystemTime Pin
Rob Philpott10-Jun-14 5:20
Rob Philpott10-Jun-14 5:20 
GeneralRe: DateTime.Now vs. GetSystemTime Pin
Eddy Vluggen6-Jun-14 5:11
professionalEddy Vluggen6-Jun-14 5:11 
GeneralSuccessfully writing to a string literal Pin
Indivara18-May-14 23:44
professionalIndivara18-May-14 23:44 
GeneralRe: Successfully writing to a string literal Pin
Freak3019-May-14 1:45
Freak3019-May-14 1:45 

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.