Wednesday, September 24, 2003
emergency rooms

I mentioned previously that I had a bit of a medical incident that I didn't want to talk about before I knew what the other side looked like.

Well, the other side looks like acid reflux and hypertension, so it's not really all that bad. But when you're lying in an emergency room with a bunch of wires connected to you and people drawing blood from both arms, it's tough to maintain a sense of perspective.

Looking back, I think it all started a little over a month previously. I was seeing the doctor for something minor, and he asked me about my family history. I told him that I came from a family that died mostly from smoking related diseases, and that I no longer smoke. On the other hand my father died early from colon cancer.

At this point, every other doctor I've talked to told me that they would just move up my first colonoscopy -- from 50 to 45 (I'm currently 38).

But this guy didn't say that. He asked another question. The question was "How old was he when he died?" He was in his mid-50s, I answered. "Do the math," the doctor replied. We made an appointment for a full colonoscopy right then and there.

I spent the next month with bit of dread -- this is the first time that I've had to deal with any issues that dealt my own personal death (well, I suppose I can't say that truthfully, I ride motorcycles, after all). I had this little niggling thought in my head -- what if I already have cancer within?

I did what I could not to think about it.

The day came, and it went well. The doctor said that there was no sign of anything, and then complimented me on how well I had "prepared." That was an awkward compliment to take, if you have ever gone through the preparation process for a colonoscopy.

So I was relieved. I was happy. The colonoscopy was on a Friday, so I had a weekend to relax.

The next Monday, at work, after lunch, it suddenly felt as if the bottom had fallen out of my chest. It felt like my heart was trying to do _something_, but wasn't successful. I tried relaxing, it didn't help. I got up and walked around, and the feeling didn't go away. I found a website that made me list my symptoms, and every possible combination always ended with the statement that I should see a doctor immediately.

I tried to stay calm.

I picked up the phone, and dialed... Well, according to everyone in the emergency room, I should have dialed 911 and been brought in, but instead I dialed my wife, and she picked me up and took me to the emergency room.

They took me in almost immediately, gave me an EKG, drew a lot of blood, and left me in a room with a muted television, and my wife giving me the "worried" look.

Turns out it was tachycardia, brought on by acid reflux. The acid backs up my esophagus, and since the esophagus is next to the heart, it pissed off the heart, and the heart start beating uncontrollably.

I had to where this thing called a "Holter Monitor" (basically a portable recording EKG) for 48 hours, where it was confirmed that I have a slight, but treatable electrical abnormality in my heart. To confirm that it wasn't the beginning of heart disease, they did a stress echocardiogram (I got to see my heart, it was cool), and saw no blockages (nor any beginning blockages). But they did find some slight thickening of my heart muscle, due to the hypertension that runs in my family.

So, in the end, I have to take something for the hypertension, and something for the gastric reflux. So far, that's it. So far, I'm pretty much alright. I have a good heart.

But boy, that was scary for a while.

1:43:49 PM    comments ()  trackback []  

itertools

I'm really intrigued by the itertools module. This whole "rise of the iterators" in Python is a good thing.

Smalltalk has been a very strong influence for me. I first encountered it and played with it in 1985, when a good friend handed me the infamous "Blue Book." I first grokked object oriented programming within a Smalltalk framework. Much of the information that was codified in the Design Patterns book were things that I learned in the wild with Smalltalk. It's no surprise that the Gang of Four tested out a lot of their ideas at the C2 wiki, and that the wiki has a string Smalltalk bias.

One of my favorite bits of synergy with Smalltalk is between blocks and methods. You could declare a block inline, and pass that block as an argument to a method, and then within that method cause that block to be executed once, or as many times as you wished.

This particular synergy was used to create the looping constructs and control structures within Smalltalk. There is no explicit "if then" syntax, what you have is a method on the boolean class that knows to execute the "true" block if the condition is true, and the "false" block otherwise. Same with the while method.

The important part is that these are just messages. There is nothing special about them. A programmer can create a suite of methods that present control structures that are specifically tailored to the problem domain.

Since I figured out how to leverage that bit in Smalltalk, I've missed it in all the other programming environments I've played with.

But iterators open that up for Python. If you think of a class of iterators, where each call to next() causes one execution of the loop, you can then start creating your own control structures. You can create a method or a function that takes an iterator as an argument, and then in that function you can execute the iterator as many times as is appropriate. Sounds obvious when spelled out, but sometimes I just need to put things together in my head. Creativity is as much about the arrangement of ideas as it is the creation of ideas out of chaos.

Why did I start off with itertools? Well, if you look at what you get in the itertools module, you'll see that they are creating the standard control structures (loops and such) using the iterator point of view.

I can see that I'm going to be changing the way I write a python program now. Iterators and list comprehensions are going to be heavily exercised.

11:18:49 AM    comments ()  trackback []