Saturday, June 30, 2012

Buzzing

Desperately trying to think of things to write about, I received a spark of inspiration while sitting on the toilet in the bathroom (a decent segue from my last post).  Apparently a fly had been hanging out in the room for a while and then decided to start flying around.  It made the characteristic annoying buzzing sound (while also bashing into the wall and everything else in a futile attempt to escape from the room).  I wondered what the cause of this buzzing was.

A guess would be that the wings flap at such a rate that the disturbances in the air are in the range of human hearing.  Reading around, this seems to be a fairly common explanation, however other places say that this is actually false.  They say it's actually the deformation of the fly's thorax that causes the noise.

Other sources mention the air passing through spiracles, "tiny airways used for respiration".  Apparently bees "buzz by vibrating their wings and bodies and pushing air through spiracles", which is likely similar to flies.  In conclusion I'm still not really sure what the exact correct answer is.

Thursday, June 28, 2012

Why do mexican toilets all have garbage cans?

I was in Mexico City for the last week or so and my stomach wasn't feeling all that well a fair amount of the time.  Because of this I frequented the bathrooms often and noticed that all of them contained a small garbage can.

This probably should have caused me to put my used toilet paper in the garbage (what else are you going to put in there) especially after seeing other used pieces in them (ewww).  However I happily kept flushing them down without seeming to cause the toilets to clog, though I was probably messing something else up further down.  Despite this the toilets seemed to function well overall and I can only imagine that at least a few of the other people from the many different countries were doing the same thing as me.

There were no signs indicating that I shouldn't flush the toilet paper because I guess it's just standard practice.  After reading a bit more about this it seems like some Mexican people when they first come to the US have the opposite problem and because of their habits put the dirty toilet paper on the ground in absence of a garbage can!

Tuesday, June 26, 2012

The colours of noise

Most people have probably heard the term "white noise" before, but apparently there are other colourful designations for different types of noise.  Joining white, but less commonly known, are pink, brown/red, blue, violet and grey.  The noise is classified by how the power changes as the frequency of the noise changes.


White noise, like white light, has a flat frequency spectrum.  So it has equal power at each frequency.  It can be used to mask background noise or even as a random number generator.  


Pink noise falls logarithmically with frequency.  So the amount of energy between 10 and 20 Hz is the same as between 1000 and 2000 Hz.  This is the same as how humans hear so it's often used to test speakers and other audio equipment.


Brown noise falls off more quickly and is the kind of noise produced by Brownian motion.  Blue and violet noise both increase in energy with increasing frequency.  Grey noise has more energy at the top and bottom parts of the spectrum.  The human ear hears each frequency equally loud so grey noise can be used to study hearing loss.


Not to be left out, black, green and orange noise are other unofficial colours.  Check out wikipedia to listen to samples of the different types of noise and read more about them.

Tuesday, June 5, 2012

Every keyboard tells a story

Nearly eight years ago I started using a program called WhatPulse to track the number of keyboard presses and mouse clicks I did.  Later on they added the ability to track how far you moved your mouse.  Over 102 months I currently have 47,101,737 key presses, 9,186,669 mouse clicks and have moved my mouse 1140.74 km!

You can also locally keep track of which keyboard keys you press the most.  Because of reinstallations I only have the last ~1.3 million presses.  It's still interesting though to look at the frequencies and think about why they are the way they are.  WhatPulse can generate a "heatmap" of your keyboard to get a quick overview of your keypresses.

The letters are probably what you would expect.  The order being eoatsinrlchmdupgwfybvkzjq.  Although it varies, according to some analysis English letter frequency is etaonrishdlfcmugypwbvkxjqz.  Apparently the top eight letters make up about 65% of total usage.  Although in a different order, my top eight letters are the same as on average, with differences starting to occur the farther down you go. The order for numbers is 0129365478.  Not sure what to make of that.

The order for the F keys is 9,5,2,4,6,10,7,8,12,1,11,3.  However looking at the numbers F9 is pressed 18.5 times more than F5, the second most frequent one!  F5 is pressed about 3 more times than the next highest, F2, with the remaining F keys, including 2, being about the same.  It turns out that in the BlackBerry simulators F9 selects things, so when I'm testing an app I'm pressing that key a lot.  I could probably rebind it to something easier to press, but over time I've just gotten used to it.  F5 is probably higher than the others because of the refresh shortcut.

You can see that I never touch my number pad which suggests I'm probably using a laptop.  You can also see something about the frequencies of the buttons that are on the right and left sides of the keyboard.  It looks like right shift, control and alt are pressed much more frequently than their left counterparts.  You might take this to suggest that I'm left handed, however it turns out that it is a combination of an error in the key detector and something a bit random.

According to the data I've pressed left shift a grand total of 7 times while pressing right shift 36,231 times!  I know for a fact this is not the case as I almost always use left shift.  So it appears the key detector has switched these two.  Similarly for right and left alt.  I rarely if ever use right alt and it seems the frequencies have been switched.  Control is actually a bit of a different story.  A little while ago I was having some problems with my left control key and in an attempt to remove the key cap I accidentally snapped it off!  I wasn't able to reattach it and over time I grew accustomed to using right control.  Unfortunately I often would use left control while programming, so now I either use right control or if I place my finger precisely in the middle of the phantom key I can use left control.  I'm not sure why these two keys were detected correctly!

If you try out WhatPulse your keyboard can have a story as well.