Click here to Skip to main content
15,891,372 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: It's Primes as far as the eye can see! Pin
Ian Shlasko27-Oct-14 11:07
Ian Shlasko27-Oct-14 11:07 
GeneralRe: It's Primes as far as the eye can see! Pin
newton.saber27-Oct-14 11:13
newton.saber27-Oct-14 11:13 
GeneralRe: It's Primes as far as the eye can see! Pin
newton.saber27-Oct-14 11:03
newton.saber27-Oct-14 11:03 
GeneralRe: It's Primes as far as the eye can see! Pin
Ian Shlasko27-Oct-14 5:26
Ian Shlasko27-Oct-14 5:26 
GeneralRe: It's Primes as far as the eye can see! Pin
newton.saber27-Oct-14 5:36
newton.saber27-Oct-14 5:36 
GeneralRe: It's Primes as far as the eye can see! PinPopular
Ian Shlasko27-Oct-14 5:43
Ian Shlasko27-Oct-14 5:43 
GeneralRe: It's Primes as far as the eye can see! Pin
den2k8827-Oct-14 6:06
professionalden2k8827-Oct-14 6:06 
GeneralRe: It's Primes as far as the eye can see! Pin
OriginalGriff27-Oct-14 5:51
mveOriginalGriff27-Oct-14 5:51 
newton.saber wrote:
it's a puzzle for you.

Not really: there are an infinite quantity of each.
The way we define "more", "less", and "equal" for infinite quantities is as follows. For two collections A and B (say A are the even numbers and B are the odd numbers) we say that

If you can associate every item in A with a unique item in B, and vice versa, then A and B are the same size.
If you can associate every item in A with a unique item in B, but not vice versa, then B is bigger than A.
If you can associate every item in B with a unique item in A, but not vice versa, then A is bigger than B.

In this case you can associate every even number n with the odd number n+1, and you can associate every odd number m with the even number m−1 (assuming 0 is even) so therefore there are just as many odd numbers as even numbers.
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...

GeneralRe: It's Primes as far as the eye can see! Pin
newton.saber27-Oct-14 8:23
newton.saber27-Oct-14 8:23 
GeneralRe: It's Primes as far as the eye can see! Pin
PIEBALDconsult27-Oct-14 8:52
mvePIEBALDconsult27-Oct-14 8:52 
GeneralRe: It's Primes as far as the eye can see! Pin
newton.saber27-Oct-14 9:23
newton.saber27-Oct-14 9:23 
GeneralRe: It's Primes as far as the eye can see! Pin
OriginalGriff27-Oct-14 10:05
mveOriginalGriff27-Oct-14 10:05 
GeneralRe: It's Primes as far as the eye can see! Pin
newton.saber27-Oct-14 11:05
newton.saber27-Oct-14 11:05 
GeneralRe: It's Primes as far as the eye can see! Pin
PIEBALDconsult27-Oct-14 6:17
mvePIEBALDconsult27-Oct-14 6:17 
GeneralRe: It's Primes as far as the eye can see! Pin
newton.saber27-Oct-14 8:23
newton.saber27-Oct-14 8:23 
GeneralRe: It's Primes as far as the eye can see! Pin
PIEBALDconsult27-Oct-14 6:38
mvePIEBALDconsult27-Oct-14 6:38 
GeneralRe: It's Primes as far as the eye can see! Pin
OriginalGriff27-Oct-14 7:10
mveOriginalGriff27-Oct-14 7:10 
GeneralRe: It's Primes as far as the eye can see! Pin
Ian Shlasko27-Oct-14 7:19
Ian Shlasko27-Oct-14 7:19 
GeneralRe: It's Primes as far as the eye can see! Pin
PIEBALDconsult27-Oct-14 7:25
mvePIEBALDconsult27-Oct-14 7:25 
GeneralRe: It's Primes as far as the eye can see! PinPopular
Ian Shlasko27-Oct-14 7:35
Ian Shlasko27-Oct-14 7:35 
GeneralRe: It's Primes as far as the eye can see! Pin
PIEBALDconsult27-Oct-14 8:18
mvePIEBALDconsult27-Oct-14 8:18 
GeneralRe: It's Primes as far as the eye can see! Pin
Ian Shlasko27-Oct-14 8:41
Ian Shlasko27-Oct-14 8:41 
GeneralRe: It's Primes as far as the eye can see! Pin
Bert Mitton27-Oct-14 8:41
professionalBert Mitton27-Oct-14 8:41 
GeneralRe: It's Primes as far as the eye can see! Pin
Ian Shlasko27-Oct-14 8:44
Ian Shlasko27-Oct-14 8:44 
GeneralRe: It's Primes as far as the eye can see! Pin
Bert Mitton27-Oct-14 10:05
professionalBert Mitton27-Oct-14 10:05 

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.