Click here to Skip to main content
15,891,136 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: Kotlin: new(ish) syntax emerges Pin
raddevus16-Aug-19 1:37
mvaraddevus16-Aug-19 1:37 
GeneralRe: Kotlin: new(ish) syntax emerges Pin
Richard Deeming16-Aug-19 1:36
mveRichard Deeming16-Aug-19 1:36 
GeneralRe: Kotlin: new(ish) syntax emerges Pin
raddevus16-Aug-19 1:39
mvaraddevus16-Aug-19 1:39 
GeneralRe: Kotlin: new(ish) syntax emerges Pin
englebart16-Aug-19 2:09
professionalenglebart16-Aug-19 2:09 
GeneralRe: Kotlin: new(ish) syntax emerges Pin
Rob Grainger25-Sep-19 2:32
Rob Grainger25-Sep-19 2:32 
GeneralRe: Kotlin: new(ish) syntax emerges Pin
obermd16-Aug-19 4:14
obermd16-Aug-19 4:14 
GeneralRe: Kotlin: new(ish) syntax emerges Pin
Keith Barrow9-Sep-19 3:04
professionalKeith Barrow9-Sep-19 3:04 
GeneralMemory Leak PinPopular
Bernhard Hiller21-Jul-19 23:17
Bernhard Hiller21-Jul-19 23:17 
Every software developer likes analysing memory leaks, don't we? Unsure | :~
Last friday, I had to work on such a thing. After interacting with a different machine, our WPF application allocated some 100 MB per second, and there is no machine which will stand that for a reasonable time span.

The interaction with that other machine is via WCF. Since some hardware actions take time, I implemented it as a Task. Sometimes, the hardware failed and raised an exception. Our WCF implementation failed to cope with the faulted task. An UnobservedTaskException was raised instead (see also Unobserved TaskException[^] ).

The exception handler still assumed .Net 4 behavior: that the application is about to crash now. It logged the exception, and then showed a MessageBox with the exception details, but that MessageBox hid behind the main window of the application becoming invisible for the user.
And now the memory leak started...

Why? Well, the handler of the Unobserved TaskException runs in the Finalizer thread. The MessageBox is modal. I.e. the MessageBox blocks the thread of the Garbage Collection required for unmanaged memory cleanup...

Some things go terribly wrong.
Oh sanctissimi Wilhelmus, Theodorus, et Fredericus!

GeneralRe: Memory Leak Pin
Member 916705723-Jul-19 21:43
Member 916705723-Jul-19 21:43 
JokeRe: Memory Leak Pin
phil.o23-Jul-19 23:44
professionalphil.o23-Jul-19 23:44 
GeneralRe: Memory Leak Pin
Gary Wheeler24-Jul-19 1:42
Gary Wheeler24-Jul-19 1:42 
GeneralRe: Memory Leak Pin
MSBassSinger25-Jul-19 10:30
professionalMSBassSinger25-Jul-19 10:30 
GeneralRe: Memory Leak Pin
Matias Lopez30-Jul-19 9:41
Matias Lopez30-Jul-19 9:41 
GeneralYou learn something new every day Pin
Gary R. Wheeler11-Jul-19 14:48
Gary R. Wheeler11-Jul-19 14:48 
GeneralRe: You learn something new every day Pin
RickZeeland11-Jul-19 20:08
mveRickZeeland11-Jul-19 20:08 
GeneralRe: You learn something new every day Pin
Gary R. Wheeler12-Jul-19 1:48
Gary R. Wheeler12-Jul-19 1:48 
GeneralRe: You learn something new every day Pin
raddevus12-Jul-19 7:47
mvaraddevus12-Jul-19 7:47 
GeneralRe: You learn something new every day Pin
Gary R. Wheeler12-Jul-19 16:09
Gary R. Wheeler12-Jul-19 16:09 
GeneralRe: You learn something new every day Pin
obermd24-Jul-19 3:21
obermd24-Jul-19 3:21 
GeneralRe: You learn something new every day Pin
Gary R. Wheeler24-Jul-19 15:15
Gary R. Wheeler24-Jul-19 15:15 
GeneralRe: You learn something new every day Pin
CodeWraith29-Jul-19 5:01
CodeWraith29-Jul-19 5:01 
GeneralRe: You learn something new every day Pin
Gary R. Wheeler29-Jul-19 15:01
Gary R. Wheeler29-Jul-19 15:01 
GeneralRe: You learn something new every day Pin
CodeWraith29-Jul-19 20:34
CodeWraith29-Jul-19 20:34 
GeneralRe: You learn something new every day Pin
Gary R. Wheeler31-Jul-19 11:39
Gary R. Wheeler31-Jul-19 11:39 
GeneralRe: You learn something new every day Pin
CodeWraith31-Jul-19 19:23
CodeWraith31-Jul-19 19:23 

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.