Click here to Skip to main content
15,906,081 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: The Illusion of a Choice Pin
PIEBALDconsult5-Apr-10 9:36
mvePIEBALDconsult5-Apr-10 9:36 
GeneralRe: The Illusion of a Choice Pin
eatstoomuchjam7-Apr-10 3:55
eatstoomuchjam7-Apr-10 3:55 
GeneralRe: The Illusion of a Choice Pin
riced7-Apr-10 4:54
riced7-Apr-10 4:54 
GeneralRe: The Illusion of a Choice Pin
dojohansen8-Apr-10 2:35
dojohansen8-Apr-10 2:35 
GeneralRe: The Illusion of a Choice Pin
supercat99-Apr-10 7:56
supercat99-Apr-10 7:56 
GeneralRe: The Illusion of a Choice Pin
David Skelly7-Apr-10 6:21
David Skelly7-Apr-10 6:21 
GeneralRe: The Illusion of a Choice Pin
David Skelly7-Apr-10 6:28
David Skelly7-Apr-10 6:28 
GeneralRe: The Illusion of a Choice Pin
supercat97-Apr-10 7:21
supercat97-Apr-10 7:21 
The compact framework does not support synchronization contexts, and so it is incorrect to set exitContext to true, since the CF cannot do what you are asking it to do in this case.

Does the CF not support synchronization contexts at all? My understanding is that the exitContext parameter says to exit any existing synchronization context before waiting, and reacquire it afterward. If no such context can exist, why should a True value of exitContext pose a problem? Code which relies upon synchronization contexts would fail when an attempt was made to create one; if no synchronization context exists, exiting all synchronization contexts should pose no problem.

BTW, with regard to checking for negative values and then for -1, many processors can check for negative numbers more quickly than they can perform general comparisons. The two-part test may save time in the more common case even if it wastes time in the -1 case. Given the likelihood that the -1 was a defined constant, I think that part of the code is reasonable.
GeneralSubclassing Pin
Ian Shlasko31-Mar-10 8:56
Ian Shlasko31-Mar-10 8:56 
GeneralRe: Subclassing Pin
Andrew Rissing31-Mar-10 17:42
Andrew Rissing31-Mar-10 17:42 
GeneralRe: Subclassing Pin
Ian Shlasko31-Mar-10 17:50
Ian Shlasko31-Mar-10 17:50 
GeneralRe: Subclassing Pin
Andrew Rissing1-Apr-10 5:23
Andrew Rissing1-Apr-10 5:23 
GeneralRe: Subclassing Pin
Ian Shlasko1-Apr-10 11:17
Ian Shlasko1-Apr-10 11:17 
GeneralRe: Subclassing Pin
Rob Grainger7-Apr-10 3:54
Rob Grainger7-Apr-10 3:54 
GeneralRe: Subclassing Pin
Ian Shlasko7-Apr-10 9:19
Ian Shlasko7-Apr-10 9:19 
GeneralRe: Subclassing Pin
Lutosław29-Apr-10 7:29
Lutosław29-Apr-10 7:29 
QuestionRe: Subclassing Pin
Chris Meech1-Apr-10 3:05
Chris Meech1-Apr-10 3:05 
AnswerRe: Subclassing Pin
Ian Shlasko1-Apr-10 10:56
Ian Shlasko1-Apr-10 10:56 
GeneralEncoding IP addresses Pin
Bernhard Hiller26-Mar-10 4:31
Bernhard Hiller26-Mar-10 4:31 
GeneralRe: Encoding IP addresses Pin
adgonz26-Mar-10 5:36
adgonz26-Mar-10 5:36 
GeneralRe: Encoding IP addresses Pin
reflex@codeproject30-Mar-10 8:24
reflex@codeproject30-Mar-10 8:24 
GeneralRe: Encoding IP addresses Pin
adgonz30-Mar-10 8:54
adgonz30-Mar-10 8:54 
GeneralRe: Encoding IP addresses Pin
supercat97-Apr-10 7:29
supercat97-Apr-10 7:29 
GeneralThat's an useless class Pin
doud26-Mar-10 3:19
professionaldoud26-Mar-10 3:19 
GeneralRe: That's an useless class Pin
Covean26-Mar-10 4:00
Covean26-Mar-10 4:00 

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.