Archive for August 2010

Does Your Language Shape How You Think? – NYTimes.com

Does Your Language Shape How You Think? – NYTimes.com.

Good article on a question that is always of interest in programming language circles. The modern take, apparently, is ““Languages differ essentially in what they must convey and not in what they may convey.”

The obvious example would be that in explicitly-typed languages, you always have to convey information on what types your functions expect and return:

int plus(int a1, int a2);

while in an implicitly typed language, you don’t:

def plus(a1, a2)

Another example is that in Ruby, if you want to access an instance variable, you use the ‘@’ symbol: @my_instance_variable, as opposed to languages such as Java and C#, where instance variables are not necessarily distinguishable from local variables. Because that’s often a valuable thing to know, one often finds coding standards: naming instance variables with _foo or mFoo or always referring to them as this.foo or what-have-you.

Presumably, the upshot of this is that you ought to seek a language in which you must convey the things that you think are universally important.

Today’s XKCD

I hope this bodes well for a job I’m interviewing for this week…

Twitter Weekly Updates for 2010-08-29

  • Concurrency is hard: Multiday Chinese traffic jam continues http://www.npr.org/templates/story/story.php?storyId=129395326 #
  • There was a blog post not long ago saying like “MS is not a single company, but a marketing company for 100 companies” Anyone have link? #
  • The “Netduino” an Arduino-pin-compatible shield programmable in C# http://bit.ly/cystzE Fun! #
  • WTF? My iPhone has started creating a screaming cricket sound for several seconds when I dock it. Anyone heard of this? #
  • Sox beat Rays and creep towards wildcard. Hawaii beats Georgia and advances in LLWS. Good day for baseball, wish I’d been able to watch! #

Powered by Twitter Tools

100′ Club

‘Not feeling it. Lungs not as full as they should be — already feeling funky. Caught my fins at the surface for a sec. Bail out now and try again.’

These are my thoughts as I approach the first bleach bottle. I am upside down, pulling myself hand-by-hand down a rope clipped to a trio of bleach bottles that is floating in Honaunau Bay. I’d been to the bottles and a little beyond on my previous dive, but this was my “target dive” which I’d challenged myself to accomplish. I was holding my breath, wearing just a mask, long fins, and a weight belt to counteract the buoyancy of my wetsuit near the surface. I pull past the bottles and continue down.

On Sunday Tina and I did something that we’ve wanted to do forever and have been actively trying to coordinate for several months — a freediving clinic with Annabel Edwards, one of the world’s top freedivers. Since moving to the Big Island, Tina and I have switched from being SCUBA fanatics to being freedive fanatics — there’s much less gear and weight and fuss but even more importantly, freediving is incredibly addictive, as it combines a yoga-like focus on breathing and relaxation with the natural beauty of the underwater world. Staying underwater is all about relaxation, but of course that’s balanced by the most basic of human needs — the need to breathe.

And then there’s the mental game. Holding your breath as long as you can hurts and always ends the same way — an explosive exhale and gasping for air. Although if you really hold your breath long enough to pass out, you may actually “lock up” for several seconds before that happens — which is a good thing if you’re underwater. There’s no getting around the “underwater when you start breathing again” thing — if that happens, you aren’t going to have a good time. That reptile brain hanging around your basal ganglia is damn sure of it. It tells your subconscious mind to get to work and it obeys — popping the thoughts most likely to sway you into your conscious mind. Those perfectly rational reasons why you shouldn’t do the thing you’re scared of — “that bully’s too big to stand up to,” “she won’t go out with you,” or, in this case, “you screwed up and don’t have enough air in your lungs to do this.”

Now that I’m on the permanent mooring rope, I’m down far enough that my wetsuit and lungs have compressed and lost most of their buoyancy. At this point, the 8 pounds on my weight belt pull me down on their own and I’m sinking. Even if I were to drop the weights, at this point I’d probably continue down, getting more compressed, becoming less buoyant, and drop until I hit the bottom at 150’. The amazing thing is that Annabel would be able to get me: she’s gone as deep as the bottom here — by swimming down without a rope or fins, doing a breaststroke!

There’s a school of akule darting around in the light shafts that easily penetrate the clear water of Honaunau. The mooring is on a sand bottom, but gobies — thin little fish that usually cling to coral strands — have made it their home. Rather than disturb them I let my hand open and let the rope glide by. I’m coming up to another bleach bottle — if I make it to that I will have achieved my personal best.

We met Annabel at a coffee shop in Honaunau. She was wearing a t-shirt from the Japan “Freediving Championchips” [sic]. Over half-caf Kona coffee and scones we spent an hour talking about safety and the physiological shifts that occur as you stress your body by immersing it in water. Your heart slows down, your blood flow shifts, and as anyone who’s tried to get to the bottom of a swimming pool knows, your ears complain about the increasing pressure. As SCUBA divers, you learn about these mechanics and master some of them — equalizing your ears and becoming comfortable breathing even if your nose is open to the ocean or filled with water. But one of the really amazing things about SCUBA is that you don’t feel the pressure. Even at over 90’, when you have more than 42 pounds of pressure on every square inch of your body, when you are breathing off a tank, you breathe in air at the same pressure as the water and don’t feel the pressure. (You do, though, feel the density of the air increase so that it almost feels like you’re breathing water.) But when freediving, you are directly exposed to the pressure and because you are going down and up much quicker than you would diving, you experience the changes more acutely.

Because you’re mostly water and because water is relatively incompressible, it’s really just the air-spaces in your body that are stressed during diving — especially your sinuses and ears. You have to push air from your mouth, throat, and lungs into your sinuses and eustachian tubes in order to avoid acute pain and an eardrum rupture — air that you could otherwise used for holding your breath longer. In addition, your mask is squeezed onto your face and you have to exhale into it to stay comfortable and avoid rupturing the capillaries around your eyes.

If, for whatever reason, your sinuses are clogged and you can’t clear, you can’t freedive. Unfortunately, this happened to Tina. After a few dives, her sinuses clogged up and she “felt like I had an ice cream headache and that my teeth were going to get pushed out into my mouth.” That totally sucked — this dream-come-true experience and Tina was restricted to swimming around the surface trying every trick in the book to clear her sinuses.

As I approached the second bleach bottle, I can see a pink ribbon tied around the line below. It doesn’t seem that much further. So I move my hand away from the line, give a slow kick with my fins (unnecessarily, as I’m now dropping rapidly), squeeze my nose and push air into my sinuses, and exhale into my mask. I drop past the bottle. I’m deeper than I have ever been.

The two others with us in the clinic were Ramin and Lee, who were mostly interested in improving their techniques for spearfishing. Tina and I are more into it because it’s such a great way to experience the ocean — once you can hold your breath long enough to settle at the bottom and wait for a few seconds, the fish actually become curious about you and swim right up to your mask. We love SCUBA diving, but the bubbles scare away fish. You can stay longer with SCUBA, of course, but there’s gear — you have to get filled air tanks, you have to carry thirty or forty pounds of gear over the lava to the entry site, you have to scrupulously clean your regulators and make sure your dive computer’s batteries aren’t running low, etc. With freediving you can just throw mask, fins, snorkel, and towel into the car and head off to the beach (well, if you happen to live in Hawaii and there’s great freediving 5 minutes from your house…). Plus, the yoga-like challenge of doing better by relaxing in a stressful situation is incredibly addictive and is the best mind-clearing meditation I know.

The pink ribbon is still 10’ or so below me when my ears and mask once again tell me they need more air from my lungs. This time, though, my lungs make it clear they won’t cooperate — it’s not that they aren’t full nor even that they are exhale-deflated. They are empty, crushed, used up. I push the air in my throat and mouth into my sinuses and ears. My diaphragm contracts spasmodically, trying to retrieve the air. I grab the line just below the pink ribbon. My body swings around and I am upright in the water. I look up towards the surface — my favorite part of freediving. I expect to see tiny figures silhouetted against the sky, but I’m so deep that I can’t really see the surface well. I look at my dive watch, just to make sure…

I am 100’ underwater.

There are 5 parts of a freedive: preparation, descent, bottom time, ascent, and recovery. The ascent is the most dangerous. With your wetsuit compressed and your lungs compressed and having pushed a good deal of what little air they have into your sinuses and mask, you’re heavier than water. Which means that you have to spend energy ascending. But you don’t have a fresh lungful of air to give you oxygen and scrub away the carbon dioxide in your blood. So on your way back up, you know things are going to get uncomfortable.

What’s going to make you uncomfortable is the carbon dioxide. What triggers your desire to breathe is not the burning up of oxygen, but the build-up of carbon dioxide. But what knocks you out is lack of oxygen. There’s a correlation between oxygen (your fuel) and carbon dioxide (your exhaust), of course, but the “I don’t care what you want, I’m going to inhale now” increase in carbon dioxide level is different than the “eyes roll back sleepy-time” decrease in oxygen level.

On the surface, at a normal atmosphere’s pressure, it’s very difficult to hold out long enough against the carbon dioxide discomfort to get to the oxygen knockout point — I certainly cannot do it. However, if you happen to expose your body to rapidly decreasing ambient pressure (such as, by say, ascending towards the surface of the water after having swum down a long way), something called Dalton’s Law of Partial Pressure can make your oxygen level drop very rapidly. So if you’ve been holding your breath and exerting yourself (such as, by say, swimming underwater), you can have what’s called “shallow water blackout,” — an “eyes roll back sleepy time” oxygen problem that happens right as you’re about to get to the surface (because that’s when the pressure is dropping most rapidly) or even in the few minutes after you surface.

My diaphragm contracts spasmodically. If I wasn’t willfully keeping my throat shut, it would be a hiccup. I’m still below the second bleach bottle, which is at 75’. Hiccuping would be bad right now. What’s happening is that my carbon dioxide has reached a level where my body has decided to jumpstart my breathing, whether I like it or not. In a moment, when the first contraction fails to start my breathing, I’ll get another, stronger one. And after that, a little quicker, another. And another and another. With practice, you can learn to make the contractions come slower and be less powerful, so they are less distressing. But because of the danger, when Tina and I are freediving by ourselves, we generally surface before we get to the the contraction stage. And I haven’t been practicing on the couch much lately. So when the contractions come, they’re strong and they hurt. I look up and see a figure swimming down, not far above me. It’s Annabel and she’s swum down to the first set of bleach bottles to help me if I pass out. It’s still 50’ to the surface.

Annabel is in her 50s and, to look at her, “active world class competitive athlete” is probably not the first thing you’d think. She has that deceptive swimmer’s build that carries a little extra insulation and, let’s face it, most of us don’t expect middle-aged women to be very involved in competitive extreme sports. She’s a very friendly and laid-back instructor and while safety procedures and warnings probably take up at least half her briefing, she put us all at our ease.

In the water, she’s just amazing. Her breathing is relaxed and even her final inhale before diving only seems slightly deeper than her previous breaths. On her first dive, she ties the float to the bleach-bottle mooring at 50’. On her second dive, she ties the 100’ ribbon. And in both cases, when she surfaces she demonstrates the three recovery breaths she wants from us, says “I’m ok,” in the way she wants us to, and doesn’t seem winded in the least.

It was Sunday morning and there were two other groups of freedivers out practicing. We were at the shallowest of the moorings used by freedivers — the water was a mere 150’ deep where we were. The others were in, I suppose, 200’ or so — you know, good practice depth. It’s amazing to say it, but I am quite sure that I was safer out there than I am when I am freediving 20’ below most snorkelers.

I’m in the last seconds of the dive when I wonder if I’m going to pass out or do the “samba” that precedes an actual blackout. The contractions are continuous and so forceful that I’m making grunting noises. But at this point I’m positively buoyant, the air in my sinuses and mask is expanding and bubbling up around my head and I’m heading up so fast that, no matter what happens, I’m going to be on the top.

I explode out of the water, probably up to my belly button I’m moving so fast, blowing out the air in a single blast and immediately gasping in a lungful. I momentarily keep my lips closed to do the recovery “pressure breaths” but instead of the dictated three I do four or five before I can take a breath deep enough to say the magic words.

“I’m okay.”

You can read more about Annabel and sign up to take a class with her at http://freediveparadise.com/

screen-shot-2010-08-22-at-45512-pm

Wordless Wednesday

screen-shot-2010-08-22-at-45512-pm

Twitter Weekly Updates for 2010-08-22

  • Disk Utility cannot fix my Mac boot drive. Time to find out how good Time Machine is… #
  • Looks like my Mac crashes were due to the RAM boards having worked loose. Lost a day’s work and another day fixing it, but all-in-all happy #
  • The Sounds of Sorting http://bit.ly/acQMT2 #
  • Jays have a 9-run lead in top of 3rd. Guess those chores around house WILL get done after all. •sigh• #
  • Beta testers wanted: Shoredive Hawai’i iPhone / iPad app. DM or email to lobrien@knowing.net. Please retweet! #
  • Beta testers wanted: Eve Online Character Dashboard iPhone/ iPad app. DM or email to lobrien@knowing.net. Please retweet! #
  • I grant you that it’s opinionated, but YAGNI http://www.worldcarfans.com/110081727946/pagani-zonda-hh-owner-revealed #

Powered by Twitter Tools

Twitter Weekly Updates for 2010-08-15

  • Holy crap! 2 weeks I’m on vacation and someone proves P != NP? http://www.hpl.hp.com/personal/Vinay_Deolalikar/ #
  • Wikipedia doesn’t have a page for “replica symmetry breaking.” Dang. Other than that, I would TOTALLY follow the P != NP paper. #
  • P != NP AND “Rubik’s Cube requires 20 moves” http://www.cube20.org/ in the same month? We’re in a golden age, people! #
  • For those interested in tracking the P != NP debate, I suggest http://rjlipton.wordpress.com for commentary #
  • Ruby has totally ruined me for whiteboard programming. I can’t think anymore without a REPL. #
  • Bailing on going to astro club meeting tonight. Deciding that it’s not just jetlag + allergies, but a real-live cold. :-( #
  • Directed by Julie Taymor: Check. Music by Bono & The Edge: Check. On Broadway: Check. “Spiderman The Musical”: Uh…what’s that now? #
  • At Don the Beachcomber Mai Tai contest — quite a zoo! #
  • Looking at Venus, mercury, mars, Saturn, moon. Having a Mai Tai with friends. No ka oi. #

Powered by Twitter Tools

Possible Proof of P != NP

I’m not sure that this one will break into the public consciousness, but Vinay Deolalikar of HP may have proved one of the major challenges in complexity theory, that P != NP. In addition to being a great intellectual success, this particular problem has very big practical implications. Luckily, though, what may have been proved is what was widely suspected to be true, so the upshot is that, if the proof is correct, the worlds of digital commerce and cryptography will breathe a sigh of relief.

Twitter Weekly Updates for 2010-08-08

  • Microsoft LightSwitch is the classic “v3 will be awesome” app. #
  • Google Wave, we hardly knew ye http://googleblog.blogspot.com/2010/08/update-on-google-wave.html #
  • Just passed a scooter / moped gang. #
  • Parked on Tarmac in DEN. At least weather looks good — home later today. #
  • Realized those staring in airport mistook my kite bag for a rifle case. Stand down, folks, nothing but nylon and string #

Powered by Twitter Tools

Twitter Weekly Updates for 2010-08-01

  • United airlines phone-based support for missing bags: blatant lies by policy or personal initiative? Sachim Malik and others. #ual #
  • RIP Loren Heiny, a familiar name in the Tablet PC community. #
  • Just scored box seats to Neil Young tonight! \o/ #
  • At Muddy Buddy Chicago. Sitting in air conditioned Lincoln Town Car. Shaking my fist at young whippersnappers. #

Powered by Twitter Tools

div>