Raindrop

Posted October 23rd, 2009 in Software by Stephen

There are two big problems with using the Internet for communicating with friends, family, and co-workers:

Too many channels
Twitter, Facebook, identi.ca, blogs, email, AIM, Google Chat, Facebook Chat, etc. With all the input flying around it’s a serious time effort to keep up-to-date with just one of these, let alone most (or all) of them.

Poor signal to noise ratio
There’s a lot of noise out there. Even discounting spam (completely irrelevant noise) there’s still a big gap between that and completely relevant messages that companies are all too happy to fill. Leaving us with the job to figure out our own solutions to sorting out the messages we want to respond to, from those we just want to receive and archive.

The Mozilla development team has been working on an answer to these problems: Raindrop. As they describe it:

When a friend’s link from YouTube or flickr arrives, your messaging client should be able to show the video or photos near or as part of the message, rather than rudely kicking you over to a separate browser tab. Notifications from computers and mailing lists should be organized for you, not clutter your Inbox or require tedious manual filter setup. It should be easy to smoothly integrate new web services into your conversation viewer entirely using open web technologies.

I’ve been looking for a good way to just integrate Twitter and Facebook. The potential to integrate Twitter, Facebook, Email, and IM is quite intriguing.

The email address that broke Django

Posted October 12th, 2009 in Programming by Stephen

Noting for future reference:

Simply inputting this email address into a Django email field was enough to cause its regex validation to infinitely loop, bringing down the application. If you’re doing any kind of email address validation you should make sure that this is appropriately parsed.

Single bash_profile, multiple computers

Posted October 9th, 2009 in Programming by Stephen

I find it useful to maintain one .bash_profile for all of my computers, including the servers I have access to. I make this work with some simple bash logic laying out the profile as follows:

# global
global stuff here
 
# global settings for all servers
if [ "$HOSTNAME" != "(my primary computer's hostname)" ]
  server stuff here
else
  my computer stuff here
fi
 
# now some server specifics
case "${HOSTNAME}" in
  "serverhostname01" )
    stuff for serverhostname01 here
  ;;
  "serverhostname02" )
    stuff for serverhostname02 here
  ;;
esac

On Losing Weight

Posted October 8th, 2009 in Personal by Stephen

On the 17th day in the month of September, 2008: I started dieting.

I had discovered The Hackers Diet and reading it finally turned the key that allowed me to truly understand how weight loss and weight gain work. Armed with this knowledge I was able to almost immediately rocket down the pounds, and keep them off.

The Hacker’s Diet is an online book written by one John Walker who, as an engineer, decided to approach weight loss as an engineering problem.

So, there was nothing for it but to shed all those pounds I’d packed on through the stressful years of starting, growing, and running a company. “If all you have is a hammer, everything looks like a nail.” I’m an engineer. I decided to approach weight loss as an engineering problem.

I studied the human body the way I’d tackle a misbehaving electronic circuit or computer program: develop a model of how it works, identify the controls that affect it, and finally adjust those controls to set things aright.

It worked! In less than a year, totally under my own direction and without any drugs or gimmicks, I went from 215 pounds to 145 and achieved physical fitness. Since then, I’ve kept my weight right where I want it with none of the yoyo swings I’d suffered in the past. All of this was accomplished in less than 15 minutes a day, and without any significant changes in the way I choose to live my life.

- John Walker, The Hacker’s Diet : Introduction

His thesis is that eating for weight loss is actually extremely simple: only calories matter. Eating to be healthy and to not feel sluggish or lethargic is an entirely different matter. The two are related of course, but independent of each other.

You could actually lose weight if you just ate candy bars, you’d just feel miserable doing it because you wouldn’t be getting the vitamins and minerals you need and, the calories would be packed into small sizes and leave you feeling hungry all the time. 240 calories of spinach is much more filling than 240 calories of Butterfinger. Likewise, you could actually gain weight eating healthy foods; you’d just have to eat enough of them.

At its simplest (from the perspective of weight loss) the body is just a calorie burning machine. Every day it burns a slightly flexible number of calories (that flexibility is metabolism) to keep itself warm, functioning, and without adding or burning to its energy stores (fat). Eat so much that it can’t burn all the calories and they get stored; eat so little that it can’t meet its energy requirements and stored energy is burned. Simple!

Before reading this, I had a very skewed understanding of how dieting worked. I thought that weight was a simple result of the number of calories eaten per day. Eat X number of calories per day: weigh Y. But that isn’t so. Maintaining a constant weight just means eating within the range of daily calories that your body can take in without having to alter its energy stores. So, assuming my weight was currently constant, all I needed to do was temporarily reduce the number of calories in, wait for my body to burn off enough energy stores, then resume my regular eating.

So I did, and it worked. In three months I lost over thirty pounds. I can, in fact, set my weight goal to any arbitrary number (within reason) and weigh that amount. During the loss I experimented with different types of foods: high fructose corn syrup, carbohydrates, etc. None altered in any way the downward slope of my weight, only calories. Avoiding carbohydrates was helpful though as they are very calorie dense foods.

Now, you may ask, what about exercise? Can’t I just exercise more and lose weight that way? Well, yes; but no.

Don’t kid yourself into thinking that exercise, by itself, will make you lose weight. Consider the following activities, and the number of calories an average person burns per hour in each.

Activity Calories/hour
Walking 300
Bicycling 300
Aerobics 400
Swimming 400
Tennis 500
Basketball 500
Jogging 700

Compare those numbers, remembering that they’re for a full hour spent nonstop in the exercise, with the calories in the following food items:

Tasty Treat Calories
Peanut butter sandwich 275
Pizza (3 slices) 500
Big Mac 560

Clearly, even an hour a day of exercise doesn’t account for much food. And what’s the likelihood you’ll find the time to spend a full hour, every day, month after month, year after year, doing those exercises?

So, don’t exercise to try to burn off calories and lose weight. Unless you’re a professional athlete or obsessed with sports, you’re not likely to spend enough time exercising strenuously enough to make much of a difference. Exercise will help you lose weight in more subtle ways. Regular exercise increases your rate of metabolism: the number of calories you burn all the time. Plus, for many people, exercise actually reduces appetite.

- John Walker, The Hacker’s Diet : What, Me Exercise?

So, yes, exercise is great but it’s not the key to easy, consistent weight loss. You exercise to live longer and feel better, not to take off the pounds.

Even if you don’t buy into any of this Hacker’s Diet stuff, I’d still like to point you to the weight tracking tool created for The Hacker’s Diet. It treats each daily weight as a data point for a exponentially smoothed weighted moving average.

When faced with apparently random variation in a collection of things, the first thing a statistician does is compute an average or, more precisely, the arithmetic mean. What’s the average height of 30 year old men? Measure a whole bunch of them, add up their heights, and divide by the number you measured. Whether the number you get is useful for anything is another matter, but at least you can always easily calculate an average.

… Averaging has filtered out the influence of the daily variations, leaving only the longer term trend. But we can do even better. Rather than waiting for ten days to elapse before computing the average, why not each day calculate the average of the last ten days? This will give us a continuous graph rather than just one box every ten days, and we don’t have to wait 10 days for the next average.

- John Walker, The Hacker’s Diet : Signal and Noise

Given your daily weight measurements, the HDO weight tracker will smooth out the variations (being bags of mostly water, we tend to slosh a bit) to yield an accurate reading of your current weight, as well as your trend. (If you’re interesting in the actual math – The Hacker’s Diet : Pencil and Paper)

This is an extremely powerful tool because it helps detect changes in weight trend (up or down) before you actually really notice the shift in numbers on the scale. Speaking from experience here, when I stopped tracking my daily weight I quickly shifted from “I weigh 192.7 lbs.” to “Eh, I weigh something like 195 to 200.” This sort of nebulous measuring reduces the granularity of weight tracking from pounds to tens of pounds and can allow the weight to sneak back in.

The Hacker’s Diet is the meta-diet from which all other dieting and weight loss systems descend. It allowed me to truly understand how calories work, how metabolisms work, and how weight is controlled by their simple function.

Calories In – (Calories Out + Calories Burned) = Weight Loss or Gain

Alan Watts on play

Posted October 7th, 2009 in Snippets by Stephen

Do you know what Scholarship means? What a school means? The original meaning of a scholar? Leisure. We talked of a scholar and a gentleman because a gentleman was a person who had a private income, and he could afford to be a scholar. He didn’t have to earn a living. Therefore he could study the classics and poetry and things like that.

Today nothing is more busier than a school! They make you work work work work work because you have got to get through on schedule. They have expedited courses and you go to school so as to get a union card or PHD or something so that you can earn a living. So it’s a whole contradiction of scholarship.

Scholarship is to study everything that’s unimportant. Not necessary for survival. All the charming irrelevancies of life. But you see the thing is this. If you don’t have a room in your life for the playful, life’s not worth living. All work and no play makes Jack a dull boy. But if the only reason for which Jack plays is that he can work better afterwards he’s not really playing. He’s playing because it’s good for him. He’s not playing at all!

To be a true scholar you have to cultivate an attitude to life where you’re not trying to get anything out of it. You pick up a pebble on the beach and look at it. It’s beautiful. Don’t try to get a sermon out of it. Sermons and Stones and God and everything be damned. Just enjoy it. Don’t feel that you’ve got to salve your conscience by saying that this is for the advancement of your aesthetic understanding. Enjoy the pebble. If you do that you’ll become healthy. You become able to be a loving helpful human being. But if you can’t do that… If you can only do things because somehow your going to get something out of it. You’re a vulture.

Alan WattsThe Tao of Philosophy

My Son’s Ninja Training

Posted October 4th, 2009 in Personal by Stephen

A quick post from my iPod, because I can.

One of my son’s favorite things to do lately is cover his head with a blanket and then walk around blindly, trying to avoid things. He trips every now and then, but just uses that as a opportunity to practice catching his falls, which he has gotten quite good at. Great reflexes!

WPtouch

Posted October 3rd, 2009 in Site by Stephen

Wow, WPtouch is seriously nice. Two clicks from the WordPress admin interface and my blog has a very slick iPod Touch/iPhone theme. Seriously awesome.

Back around to WordPress

Posted October 3rd, 2009 in Site by Stephen

So it turns out that WordPress has gotten pretty awesome. An iPod Touch app, slick backend interface, still a great collection of plugins, easy peasy posting…how can I resist?

Jekyll was great: plaintext posts, liquid layouts, smart design, and I had a cool setup where a git push would regenerate the site. BUT writing a new post involved: being at a computer with git or ssh, manually creating a file in the proper directory with the proper filename, manually adding the yaml header with the post metadata, and managing the whole commit, push deal to update the site. Geeky? Definitely. Easy, fast? Not really. Fun? Yes, until it wasn’t.

Sure I could’ve scripted away the headaches, but then I had to do some experimentation for a post in a UNC library blog (WordPress) and saw the latest admin design for the first time and was just excessively pleased. So here I am, jumping blog platforms again (for what, the sixth, seventh time?).

This time I’m *not* bringing along the old content. Instead I have created a blogging archive to house my old posts. So far I only have the very recent (everything that was in jekyll) and the very old (1998-2000) in the archive. Where’s 2001-2006? I really have no idea. I think I was on livejournal at one point. I ran an iBlog but have no idea where those files area. I created a blogging interface to walawiki but seem to have misplaced that as well. When and if I track any of that down, to the archive it will go. For now, just welcome me back to blogging.