Click here to Skip to main content
15,885,875 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: Beautiful code... Pin
KarstenK9-May-16 7:56
mveKarstenK9-May-16 7:56 
GeneralRe: Beautiful code... Pin
Sander Rossel9-May-16 10:26
professionalSander Rossel9-May-16 10:26 
GeneralRe: Beautiful code... Pin
PauloJuanShirt9-May-16 23:46
PauloJuanShirt9-May-16 23:46 
GeneralRe: Beautiful code... Pin
kmoorevs12-May-16 9:14
kmoorevs12-May-16 9:14 
GeneralFrom one security guy to another (or to a "hacker"... don't care). Pin
Paulo Zemek27-Apr-16 16:52
mvaPaulo Zemek27-Apr-16 16:52 
GeneralRe: From one security guy to another (or to a "hacker"... don't care). Pin
Chris Quinn27-Apr-16 21:30
Chris Quinn27-Apr-16 21:30 
GeneralRe: From one security guy to another (or to a "hacker"... don't care). Pin
Paulo Zemek27-Apr-16 21:52
mvaPaulo Zemek27-Apr-16 21:52 
GeneralThe "One" Pin
Paulo Zemek24-Apr-16 13:00
mvaPaulo Zemek24-Apr-16 13:00 
I got me thinking about numbers, conventions and things like that.
I remember talking to some people about it, but maybe I was imagining it. Anyways...

The number one is a very interesting number.
I was thinking how all the base systems give a 10 when we use the actual base as the number. That is, 2 in binary is 10. 3 in a ternary system is 10. 10 in our decimal system, is 10. 16 in the hexadecimal system, is written as 10.
By "convention" we could say that 1 in the base 1 would give a 10...

But then we hit our first crash... or we found infinity... or whatever.
Let me explain: The binary system (base 2) only sees the 0 and the 1. A "base 1" system would only see the 0, and nothing else.
So, it would be impossible to have a "10".
But we may think about it diferently. The value for all base systems can be discovered by dividing the value we want by the base value, and we keep dividing until the value reaches zero.

That is, we could divide 1 by 1. It will result in 1, but we will still have one. So, we keep dividing one by one, and we always have an extra one. To infinity!
So, by trying to divide one by one, we are actually only making the one become bigger and bigger... or should I say that we discovered the true value?

An interesting thing is that many basic languages consider the true value to be -1 (actually, all bits set to one)... while other languages consider true to be only 1 (not a lot of ones).

I also don't know if a teacher really told me that... or if I simply imagined, but one of the rules was that it doesn't matter if we want to multiply or divide one by one... we end-up always having half of it.
Let me explain:
1/1 = 1
1*1 = 1

So, we had 2 ones on one side and, on the other side, we ended up with a single one. So, half the ones, right?
But to my perception, we only multiplied the number of ones by doing this. We had 2 number ones... then, after the equals sign, another one appeared. In the end, we have 3 number ones.
That is, by trying to either divide or multiply one by one, we always get a kind of clone. A new one!

Where am I going with this?
No idea. I simply considered it funny that multiplication or division of one by one may end-up in multiplication or division of the ones... and it is only a matter on how you look at it. Are you looking at the result (after the equals sign), are you looking at the image? Are you simply counting how many ones appeared?
Funny isn't?

Don't try to think about this under the effect of drugs. It may halt your brain! I know it kinda did it to mine... everything went white, with a really high pitched sound!
Remembering: I don't do drugs. People drugged me and tried to screw up my mind... they kinda succeeded on it.
GeneralRe: The "One" Pin
PIEBALDconsult24-Apr-16 14:14
mvePIEBALDconsult24-Apr-16 14:14 
GeneralRe: The "One" Pin
Paulo Zemek24-Apr-16 16:51
mvaPaulo Zemek24-Apr-16 16:51 
GeneralRe: The "One" Pin
Pete O'Hanlon24-Apr-16 21:37
mvePete O'Hanlon24-Apr-16 21:37 
GeneralRe: The "One" Pin
Paulo Zemek25-Apr-16 2:46
mvaPaulo Zemek25-Apr-16 2:46 
GeneralRe: The "One" Pin
Richard Deeming25-Apr-16 3:27
mveRichard Deeming25-Apr-16 3:27 
GeneralRe: The "One" Pin
Paulo Zemek25-Apr-16 11:14
mvaPaulo Zemek25-Apr-16 11:14 
GeneralRe: The "One" Pin
Lutosław25-Apr-16 11:38
Lutosław25-Apr-16 11:38 
GeneralRe: The "One" Pin
Matt T Heffron25-Apr-16 12:40
professionalMatt T Heffron25-Apr-16 12:40 
PraiseRe: The "One" Pin
Richard Deeming26-Apr-16 1:08
mveRichard Deeming26-Apr-16 1:08 
GeneralRe: The "One" Pin
Jörgen Andersson25-Apr-16 20:29
professionalJörgen Andersson25-Apr-16 20:29 
GeneralRe: The "One" Pin
Paulo Zemek25-Apr-16 20:44
mvaPaulo Zemek25-Apr-16 20:44 
GeneralRe: The "One" Pin
Paulo Zemek25-Apr-16 20:49
mvaPaulo Zemek25-Apr-16 20:49 
GeneralRe: The "One" Pin
David A. Gray1-Jul-16 21:46
David A. Gray1-Jul-16 21:46 
GeneralCaught in the trap again PinPopular
Bernhard Hiller21-Apr-16 20:48
Bernhard Hiller21-Apr-16 20:48 
GeneralRe: Caught in the trap again Pin
Rob Grainger22-Apr-16 1:16
Rob Grainger22-Apr-16 1:16 
GeneralRe: Caught in the trap again Pin
Richard Deeming22-Apr-16 1:22
mveRichard Deeming22-Apr-16 1:22 
JokeRe: Caught in the trap again Pin
Bernhard Hiller22-Apr-16 3:18
Bernhard Hiller22-Apr-16 3:18 

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.