Click here to Skip to main content
15,918,485 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: Opinions Pin
riced27-Jul-10 23:23
riced27-Jul-10 23:23 
GeneralRe: Opinions Pin
QuiJohn28-Jul-10 2:56
QuiJohn28-Jul-10 2:56 
GeneralRe: Opinions Pin
SirTimothy28-Jul-10 8:14
SirTimothy28-Jul-10 8:14 
GeneralRe: Opinions Pin
Gary R. Wheeler1-Aug-10 0:25
Gary R. Wheeler1-Aug-10 0:25 
GeneralRe: Opinions Pin
PIEBALDconsult28-Jul-10 3:18
mvePIEBALDconsult28-Jul-10 3:18 
GeneralRe: Opinions Pin
elchupathingy28-Jul-10 3:31
elchupathingy28-Jul-10 3:31 
GeneralRe: Opinions Pin
SirTimothy28-Jul-10 8:12
SirTimothy28-Jul-10 8:12 
GeneralRe: Opinions Pin
Luc Pattyn28-Jul-10 8:20
sitebuilderLuc Pattyn28-Jul-10 8:20 
GeneralRe: Opinions Pin
Jörgen Andersson28-Jul-10 5:10
professionalJörgen Andersson28-Jul-10 5:10 
GeneralRe: Opinions Pin
leonej_dt28-Jul-10 6:31
leonej_dt28-Jul-10 6:31 
GeneralRe: Opinions Pin
supercat928-Jul-10 6:59
supercat928-Jul-10 6:59 
GeneralRe: Opinions Pin
dybs28-Jul-10 16:29
dybs28-Jul-10 16:29 
GeneralRe: Opinions Pin
SirTimothy28-Jul-10 16:58
SirTimothy28-Jul-10 16:58 
JokeRe: Opinions Pin
johannesnestler2-Aug-10 3:00
johannesnestler2-Aug-10 3:00 
GeneralRe: Opinions Pin
SirTimothy3-Aug-10 15:54
SirTimothy3-Aug-10 15:54 
GeneralRe: Opinions Pin
Lutosław30-Jul-10 2:15
Lutosław30-Jul-10 2:15 
JokeRe: Opinions Pin
SirTimothy30-Jul-10 8:33
SirTimothy30-Jul-10 8:33 
GeneralRe: Opinions Pin
Lutosław31-Jul-10 2:07
Lutosław31-Jul-10 2:07 
GeneralRe: Opinions Pin
SirTimothy31-Jul-10 4:50
SirTimothy31-Jul-10 4:50 
GeneralRe: Opinions Pin
Lutosław1-Aug-10 21:05
Lutosław1-Aug-10 21:05 
SirTimothy wrote:
the compiler just expands it to *(y + iarray) which is the same as iarray[y]

It relies on a C-specific feature, where size of int is the same as size of an address, doesn't it? In C# int is always a 32-bit integer...

I suppose proving n^2 runtime isn't hard. Each obfuscation can be transformated to a more readable form, which is fully equivalent. Step by step, one could get something similar to my code posted above. I suppose. Sometimes when I have a trouble with theory I generate a chart and write "The chart says, that the algorithm is quadratic, isn't it?". Unfortunately not every teacher was satisfied with such report... Roll eyes | :rolleyes:
Greetings - Jacek

GeneralRe: Opinions Pin
Euhemerus8-Aug-10 1:45
Euhemerus8-Aug-10 1:45 
GeneralAre you sure that it's not null? PinPopular
JeremyBob22-Jul-10 21:39
JeremyBob22-Jul-10 21:39 
GeneralRe: Are you sure that it's not null? Pin
Yusuf23-Jul-10 13:37
Yusuf23-Jul-10 13:37 
GeneralRe: Are you sure that it's not null? Pin
ThatsAlok25-Jul-10 20:42
ThatsAlok25-Jul-10 20:42 
GeneralRe: Are you sure that it's not null? Pin
J4amieC26-Jul-10 6:09
J4amieC26-Jul-10 6:09 

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.