Monday, October 16, 2006
Tip: Scrolling in Firefox with your hands on the home row
Short Version: You can scroll down in Firefox with the spacebar, and scroll up with shift+spacebar.
Long Version: This was surprisingly hard to find. I couldn't seem to find a definitive list of default keybindings in Firefox anywhere. I ended having to dig through /usr/share/firefox hoping to find some file that has the default keybindings. Eventually, I found platformHTMLBindings.xml (located at /usr/share/firefox/chrome/toolkit/content/global/platformHTMLBindings.xml on my Debian etch installation and presumably can be overridden somehow in your profile directory.)
The lines in question are:
<handler event="keypress" key=" " modifiers="shift" command="cmd_scrollPageUp" /> <handler event="keypress" key=" " command="cmd_scrollPageDown" />
Thursday, October 05, 2006
Unique Snowflakes And Really Big Numbers
I've always suspected that the "no two snowflakes are alike" meme is false because of the Birthday Paradox. So I decided to do a little research (read: Google) to find out for sure.
Of course, it all depends on what you mean by "alike." My personal definition would be something like "if you can't differentiate between them with an optical microscope, they're alike."
So, with that in mind, are any two snowflakes alike?
What do you mean, an African or European snowflake?
It turns out that there are several classes of snowflakes. The linked page explains that really small snowflakes (ie, ten molecules or so) are obviously non-unique. In addition, there are simple, smallish snowflakes that pass the optical microscope test. It goes on to assert vaguely that the possible number of large, complex snowflakes is around 100!. (around 10^158). Which is really huge number.
On the other hand, The Straight Dope uses basically the same argument I had been using: "Lots and lots of snowflakes, gotta be a collision somewhere, right?"
I'm leaning towards the combinatorial argument though. Here's why: Combinations of items grow really, really fast. Way faster than most people expect. (Well, faster than I expect, anyway.)
For instance, the current word size in most desktop computers these days is 32 bits. That means it can hold 2^32 different possible values. (about 4 billion.) If you started counting from one to 2^32 at one number per second, you'd finish in about 136 years.
But some newer PCs have a 64 bit word size. 2^64 doesn't seem a lot bigger than 2^32, but it is. 2^64 is 2^32 times larger than 2^32. If you tried to count to 2^64, you wouldn't finish before the Sun burned out. If you had 2^64 dollars, and you spent a billion dollars (10^9) a second, it would take 584 years to run out. If you could travel at the speed of light, it would take 314,000 years to go 2^64 miles.
So 2^64 is a pretty big number. But 2^65 is twice as large. That's hard to me to remember. At some level, I know how it works. I know that n^(m+1) = n * n^m. But I really have to think about it before it hits home.
And 2^64 is "only" about 10^19. And 100! (about 10^158, remember) is the alleged number of possible snowflakes. Which is, as I said, a really huge. And even if that's off by, say, 60 orders of magnitude, that would still be 10^98, which is more than the number of particles in the known universe.
And that's why I'm beginning to think that it's possible that no two snowflakes are alike.