Click here to Skip to main content
13,596,321 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: C# Recipe for uncatchable exception Pin
Marc Clifton1-May-18 2:30
protectorMarc Clifton1-May-18 2:30 
GeneralRe: C# Recipe for uncatchable exception Pin
Super Lloyd1-May-18 4:44
memberSuper Lloyd1-May-18 4:44 
GeneralRe: C# Recipe for uncatchable exception Pin
Kevin Marois1-May-18 5:46
professionalKevin Marois1-May-18 5:46 
JokeRe: C# Recipe for uncatchable exception Pin
0x01AA1-May-18 5:59
professional0x01AA1-May-18 5:59 
GeneralRe: C# Recipe for uncatchable exception Pin
Paulo Zemek1-May-18 13:23
professionalPaulo Zemek1-May-18 13:23 
GeneralRe: C# Recipe for uncatchable exception Pin
Super Lloyd1-May-18 17:13
memberSuper Lloyd1-May-18 17:13 
GeneralRe: C# Recipe for uncatchable exception Pin
Paulo Zemek2-May-18 8:08
professionalPaulo Zemek2-May-18 8:08 
GeneralFun with double Pin
Super Lloyd24-Apr-18 23:24
memberSuper Lloyd24-Apr-18 23:24 
I am doing a lot of computational maths work at home at the moment and, just for giggle, I thought of writing the following method. Code behave as incorrectly as expected! Big Grin | :-D
static void Main(string[] args)
{
    var e = 1e18;
    Console.WriteLine(IsEven(e));
    Console.WriteLine(IsEven(e + 1));
    Console.WriteLine(IsEven(-e));
    Console.WriteLine(IsEven(-e + 1));
}
bool IsEven(double d)
{
     if (d < 0) return (d % 2) > -1;
     return (d % 2) < 1;
}
A new .NET Serializer
All in one Menu-Ribbon Bar
Taking over the world since 1371!

GeneralRe: Fun with double Pin
Daniel Pfeffer24-Apr-18 23:55
professionalDaniel Pfeffer24-Apr-18 23:55 
GeneralRe: Fun with double Pin
Super Lloyd25-Apr-18 5:33
memberSuper Lloyd25-Apr-18 5:33 
GeneralRe: Fun with double Pin
Kirk 1038982126-Apr-18 6:21
memberKirk 1038982126-Apr-18 6:21 
GeneralRe: Fun with double Pin
Super Lloyd26-Apr-18 6:29
memberSuper Lloyd26-Apr-18 6:29 
GeneralRe: Fun with double Pin
Kirk 1038982126-Apr-18 6:34
memberKirk 1038982126-Apr-18 6:34 
GeneralRe: Fun with double Pin
raddevus26-Apr-18 13:19
mvpraddevus26-Apr-18 13:19 
GeneralRe: Fun with double Pin
Super Lloyd26-Apr-18 13:40
memberSuper Lloyd26-Apr-18 13:40 
GeneralRe: Fun with double Pin
Peter_in_278026-Apr-18 15:03
professionalPeter_in_278026-Apr-18 15:03 
GeneralRe: Fun with double Pin
John Simmons / outlaw programmer7-May-18 8:33
professionalJohn Simmons / outlaw programmer7-May-18 8:33 
GeneralRe: Fun with double Pin
Super Lloyd7-May-18 11:51
memberSuper Lloyd7-May-18 11:51 
GeneralRe: Fun with double Pin
John Simmons / outlaw programmer8-May-18 1:10
professionalJohn Simmons / outlaw programmer8-May-18 1:10 
Generaldotnet core web api : generate sub-webs for users Pin
raddevus20-Apr-18 10:43
mvpraddevus20-Apr-18 10:43 
GeneralRe: dotnet core web api : generate sub-webs for users Pin
Richard Deeming20-Apr-18 11:35
mvpRichard Deeming20-Apr-18 11:35 
GeneralRe: dotnet core web api : generate sub-webs for users Pin
raddevus20-Apr-18 12:06
mvpraddevus20-Apr-18 12:06 
PraiseRe: dotnet core web api : generate sub-webs for users Pin
RickZeeland20-Apr-18 21:13
mvpRickZeeland20-Apr-18 21:13 
GeneralRe: dotnet core web api : generate sub-webs for users Pin
raddevus21-Apr-18 7:00
mvpraddevus21-Apr-18 7:00 
PraiseRe: dotnet core web api : generate sub-webs for users Pin
RickZeeland21-Apr-18 7:02
mvpRickZeeland21-Apr-18 7:02 

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.


Advertise | Privacy | Cookies | Terms of Service
Web01-2016 | 2.8.180621.3 | Last Updated 23 Jun 2018
Copyright © CodeProject, 1999-2018
All Rights Reserved.
Layout: fixed | fluid