Using Prime Numbers to Generate Backgrounds
bpeh123 pointed out an article about generating organically tiled backgrounds inspired by the life cycle of cicadas. The trick is to overlay multiple background tiles with prime widths thus generating a series that does not repeat for a sufficiently long period. This introduces a seeming irregularity and makes the background appear much more natural.
...NEEEEEEieieiirrrnngngne eEEEEEEEEEEee eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeernrng!
Do daemons dream of electric sleep()?
Why can I only check Post Anonymously when I post a new comment but not a reply? Also, it would be kinda cool if I could click on fucking links again without having to triple right click and then open in a new window.
... whatever that dude is smoking.
XML is a known as a key material required to create SMD: Software of Mass Destruction
"..While this is a rather rockâ(TM)nâ(TM)roll ending for our nerdy cicada, it raises an obvious question: Is it just by chance that they adopted 7, 11, or 13-ââyear life cycles, or are those numbers somehow special?" Those numbers always come up in conspiracy theories.
- "If one man can create that much hate, you can only imagine how much love we as a togetherness can create."
From TFA:
FAIL. 1 is not prime.
They can't even quote an article they link to properly ."
Their article: "that is,1, 2, 3, 5, 7, 11, 13, 17, 19, 23, and so on"
Wikipedia: "2, 3, 5, 7, 11, 13. .
Cool. I've looking at automatically generating stuff for games recently. Obviously, this works for authentic-looking backgrounds, but my friends and I were working on a project that involved automating critter generation using classic predator-prey models. One big worry was the farming-to-death of critters that are part of an ecosystem. This idea might be useful for much more nicely randomized or randomized-seeming mob population/spawning.
No OS on the planet can protect itself from a user with the admin password. - Yvan256
And not in a good way.
If cicadas were important to birds, then birds would have evolved a boom/bust cycle of 7, 13, or 17 years.
Cicadas emerging in prime-number cycles in fact gives birds a feast every couple of years, except when the cicada cycles tend to align, then it's a super-feast for a year or two.
But more importantly, it keeps cicada species from being out at the same time competing for mating time with mates they can't actually reproduce with. (Food isn't relevant, since they spent their time in the ground as grubs eating so they could expend their energy looking in the skies for a mate, then finding a nice spot to latch onto and die). Except, again, in those years when they overlap, then they encounter those stressors, but now there are twice as many cicadas and the birds can't eat them all so both species end up doing okay anyway.
And the leap from cicada prime-number cycling (which, despite what I said, may just be a coincidence) to arranging tiles in a pseudo-random pattern to mimic random patterns in "nature"? That makes me feel like I'm gorged on cicada pasta and want to throw up.
First, since when are curtains "nature". Second, random things look random because they are random. Third, using prime numbers to mimic randomness is not randomness, unless you use a random-number generator to help you pick which of the prime numbers in your range to use. But then there was no reason to limit yourself to prime numbers. Because there was no reason to do such a thing in the first place.
Fifth, nature does cyclical rather handily; not everything need be random to look natural. In fact, the lack of repetition in something generally random but capable of repetition is a dead giveaway that it's not actually random.
Ow. Ow, ow, ow.
So totally the Pauli Excuseme Principle: "That's not wrong, it's not even right."
Designer discovers basic properties of the prime numbers (and confuses 1 for a prime).
I'd like to cum in a black girl's cunt, and have her bounce up and down on me when I hold her black tits.
It's kind of neat that you can involve a little math in something like web design. Granted this isn't calculus, but it's still a fun little way to make neat patterns.
Democracy Now! - your daily, uncensored, corporate-free
Not only did I learn interesting information about the insects I hate the most (and believe me, if I could, I would destroy every last one of the annoying bugs!) but I also learned that you can have multiple images for backgrounds in CSS and have them lay atop one another. (None of the books or software ever seemed to suggest that it was even possible!)
While the idea is pretty ingenious, if I had known you could specify more than one image for backgrounds, I would have figured this one out on my own -- I have been overlaying images and background images inside of DIVs for a while to get some really nice effects. But now, to be able to lay one atop the another in the same block? AWESOME.
And yes, at the article says, inferior browsers cannot handle this -- I tried it on IE8 to see what would happen and... yeah... it hung.
There are two schools of thought, one considers 1 to be a prime (since its divisors are "1" and itself) the other school of thought doesn't. Some proofs work nicer if 1 is considered to be a prime, some proofs don't.
So it's just a matter of opinion.
Now, next time Iran fakes out a missile launch test and claims it has tested some 53 rockets and shows pictures, it is going to be impossible to detect the cut/paste jet plumes.
sed -e 's/Chuck Norris/Rajnikant/g' joke > fact
Question: Do cicadas come every 17 years, or do they come every year?
Having lived in the Deep South for 5 years I seem to remember cicadas coming every year. Wikipedia says there are "broods" and there's 2500 different species. So, was I seeing a different species every year, or did I just see a different brood every year? I think I saw 2 different species.
How many more years will slashdot have an off-by-one error on your Score in your profile?
...that my first thought was "Ah, someone has finally understood why Gödel numbering is clever..."?
... there's too many of them.
You got truthiness in my mathematics!
This will not do. Oh no, no, no, no, no.
the preceding comment is my own and in no way reflects the opinion of the Joint Chiefs of Staff
...Are in order for the web developer community; they've discovered Perlin Noise! Aww bless! Meanwhile, game developers everywhere have been using this technique to generate anything from planetary landscapes to entire galaxies for a while now. Baby steps guys.
While it is isn't correct, I do recall being told in school that one is a prime because it is only divisble by itself.
HDGary secures my bank
I've been using primes as max-mount-count for my ext3 filesystems to avoid checking them all at the same time for years
Cool, but aren't we all supposed to be using fractals to generate realistic-looking virtual worlds and such by now? I mean, that's what I thought when I read that Scientific American article back in the 80s, and wrote a C program that ran for two weeks on my Compaq to create a picture of a Mandelbrot set. What was really funny was that the Compaq screen was grey scale...
Great men are almost always bad men--Lord Acton's Corollary
It makes no more sense to me to use prime numbers as opposed to pi or anything else that will give you irrational numbers.
Well, the images do have to be an integer number of pixels wide, but if the ratio between lengths approximated an irrational number you would expect long periods. Even relatively prime numbers would work. Tiles of length 7, 15, and 16 won't repeat for 1,680 pixels. Basically, if you want to create a nice, non-repetitive pattern of overlayed tiles, make certain that the smallest common multiple for all of the tile sizes is larger than your expected screen width.
This is not the prime number theorem, this is the fundamental theorem of arithmetic. There's only 2 millennia worth of mathematics between the two :).
Chrome functions fine with it?
On the one hand, that's good to know...
On the other hand, isn't having to switch to chrome to make it reliable kinda... not-very-open-sourcey? (If you'll pardon the lack of English construction in that psuedosentence, and in this fragment.)
-- IANAL, this isn't legal advice, and definitely isn't legal advice for you. Also, Squee!
hmm. I am surprised by the way people seem to be impressed by this. I though a few more /.ers would have written a hash function before.
How the feck can this be considered news? The use of prime numbers have been used this way for ages (encryption and RNG to name the two most obvious).
The images in question are bitmaps. Even on slashdot, they have integers for width and height. If you want to generalize, generalize to coprime, as other have noted.
Think global, act loco
Q: How do you tell a mathematician, a physicist and an engineer apart with one question?
A: Ask them "Are all the odd numbers above 2 prime?"
Mathematician: Well, 3 is prime, 5 is prime, 7 is prime, 9 is not prime, so NO.
Physicist: Well, 3 is prime, 5 is prime, 7 is prime, 9 is not prime, but that is just experimental error.
Engineer: Well, 3 is prime, 5 is prime, 7 is prime, 9 is prime, 11 is prime...
(My father was an engineer, my brother is a physicist and I was a mathematician at one point, so this turned into a family joke!)
You will not drink with us, but you would taste our steel? - Walter Matthau, The Pirates