30 Jan 2012

Lessons from my first open source project

Todotxt.net is my first real open source project. I’ve written and shared some dodgy PHP scripts in the past and thrown some code up on google code, but this is the first time I’ve engaged with the OSS community. And I’ve learnt a couple of things.

Open standards are better than open source

The thing that drew me to using Todo.txt in the first place was that at its heart is a plain text file that you can hack in whatever editior, on whichever platform, you choose. It turns out that that also makes it a very attractive thing to develop for.

No matter how open Gina’s source was, if I had to dick around with some proprietary storage format I wouldn’t have even looked at creating a Windows client for it. In fact, I didn’t look at any of the existing source code when writing todotxt.net – I just wrote to the standard.

Open source is awesome

I was pretty blown away when people started downloading my little app and even taking the time to report bugs. After all, it was at v0.1 and appropriately hacky and buggy. But then something awesome happened.

I woke up one morning and saw that someone had submitted a bug report. As I started to reply I noticed that I had a github pull request fixing the same bug. While I was sleeping, someone reported a bug in my app and someone else fixed it.

Inexpressibly awesome.

Have an upgrade mechanism in place. Always

At version 0.8 things were humming along nicely – a couple of dozen people had downloaded the app and a couple of people were contributing code. Then Gina blogged about it and Lifehacker picked it up. Suddenly I was getting 600 downloads a day.

The only problem was, v0.8 had the new intellisense functionality which turned out to be pretty buggy. I got a fix out quickly, but had no way to tell the 600 people who had already downloaded the buggy version. I’m sure more than a few people were put off by the random crashing and probably never looked back to see if there was an update.

A couple of point releases later I added in an upgrade notification. It’s terribly basic, but it works. In future projects I’m going to have update notifications in some from in before I release even an early alpha.

Git’s not scary, and github is awesome

I’d hackily played with Git a couple of times, thinking my Mercurial knowlege would let me wing it. It didn’t. Because I wanted to use github (it’s what all the cool kids are doing) I figured I should put some time into finding my way around the basics. To my releif and surprise, it’s not as forboding as it intially seems.

And github, well, you can see why it’s become the defacto OSS repository. The cool kids are using it becuase it’s frakking fantastic. It’s just so easy to share code, track changes, accept patches, manage issues. It’s really pretty special.

29 Jan 2012

Managing my asthma

It’s taken me 15 years to feel like I have some control over my asthma. This is how I do it – maybe it will be useful for someone.

Disclaimer: I’m not a doctor, I have no experience other than my own. Asthma affects people differently – trying something like this could literally kill you. If you choose to do it, be careful, and make sure you always have your inhaler with you

Step 0: Get as cardio fit as possible

When I first met my wife I was in the best shape of my life – not too much body fat, and a decent amount of muscle. I ate well and lifted weights a lot. But I did almost no cardio and my asthma, although much better than when I was fat and inactive, still wasn’t great.

A few years later (after I’d let marriage, kids and work eat into my gym time ;)) I had little muscle or cardio fitness. My asthma was quite bad. I started the Couch to 5K program and felt like I was going to die. But by the time I could run 5km (combined with the steps below), my asthma was almost non-existent. I could go months at a time without using a preventative or an inhaler.

(For a whole swag of reason I’ve slackened off on my cardio over the past few months and am paying for it now. Step 0 is as much a reminder to myself as anything else).

So get fit. It makes everything else work a whole lot better.

Step 1: Exhale

Although asthma seems to effect everyone differently, the most common advice you’ll find is to ensure you exhale fully. I’ve read scientific stuff about excess carbon dioxide exacerbating the restriction of your airways, but the why doesn’t really matter. 

I can almost on-demand give myself an attack by intentionally not exhaling properly. 

If I can stay calm (see step 2) I can usually control an asthma attack by forcing myself to breath slowly, shallowly and exhaling as much as possible. Breathing in through your nose and out through your mouth is a handy way to help do this.

Step 2: Stay calm

This is the hardest part. I don’t know about you, but I freak as soon as I feel an attack starting. I’m minutely conscious of my breath, my heart rate rises and I just want to gulp air in as fast as possible. All of which just makes things worse.

You have to train yourself to not freak out. In part I do that by not taking Ventolin straight away. I get it out, take the cap off, then sit with it in my hand and try and relax myself. But my brain is already in panic mode so it’s pretty hard to control. 

You’d be surprised how far you can go. I admit to being kinda stupid on a few occaisions, taking it to the point of being dangerous. When I was running I would get furious at being held back by asthma attacks, so I decided to run through them. I really wouldn’t recommend this – getting light-headed and seeing stars and still running is pretty stupid. But in a way finding out how far I could push myself was quite valuable. 

Ideally though, you want to practice building your resiliance without putting yourself in (as much) danger. Which brings us to …

Step 3: Stop breathing

To control the fear, you need to expose yourself to the trigger, preferably in a controlled, relatively safe way. Ever since I’ve had asthma holding my breath for more than a couple of seconds kicks my “OMFG I’m going to die” reflex into action. So that’s what I practice doing.

The best way I’ve found to practice is kneeling on all fours, exhaling as much as possible, sucking my stomach as hard as possible towards my spine, and holding it for as long as I can. With your stomach sucked in it’s very hard to sneak in accidental cheat breaths.

I usually last around 10 seconds. By the 5th rep I’m clawing the floor and praying for the end. By the 10th I’m usually somewhat calm, though the end can never come quick enough.

Messing with your breathing can bring on an attack so make sure you have your meds with you if you do something like this.

You can also try swimming, although I’m not sure if that’s more or less disturbing. The combination of exercise, water, and controlled breathing has certainly been enough to scare the shit out of me. The nice thing is, if you can relax into it you can gradually increase the strokes between breaths (or just reduce the stroke rate). You can’t cheat-breath when your head’s under water.

And then…

So long as I keep practicing holding my breath, I am usually able to stay calm when I do have an asthma attack. That lets me properly concentrate on my breathing. 95% of the time (when I’m fit, probably 75% when I’m not) I can control the attack without medication, breathing my way through it until it passes. 

I’m not sure if it’s causal or coincidental, but not using meds seems to drastically reduce the number of attacks I have. The more quickly I reach for the Ventolin, the more regular the attacks. 

Doctors

Doctors have told me that it’s best to take Ventolin as soon as you feel the attack starting. I’m sure they’re completly correct. You’re not going to die from having Ventolin a little earlier than you needed it.

But it’s a shitty way to live, especially when I can control and reduce the attacks without a huge amount of effort. 

29 Jan 2012

1001 Albums

A month in and my information diet is going well. I’m still fiddling with how Twitter fits, but otherwise I’m liking it a lot. One of the goals was to consume more “complete thoughts” like books, articles and music, and so far I’ve heavily leaned towards getting through my reading backlist.

Last week I subscribed to Rdio, the first real subscription music streaming service to hit Australia. And tonight, as I walked past the bookshelf, it occurred to me that I can do something that I’ve wanted to do for a long time but which has never been practical: listen to all the albums in 1001 Albums You Must Hear Before You Die.

It’s a toss-up between music and reading for my first real hobby. I remember in early primary school converting Mum and Dad’s LPs to cassette so I could listen to them on my tape deck. As I teenager I spent an inordinate amount of time listening to borrowed, recorded, and (once I had a job) purchased albums. I’d spend hours reading the liner notes. Honestly, between music and books I don’t know when I found time for the important high school stuff like working, studying and drinking.

I still listen to music a lot, but mostly in the background while I’m working. On occasion I’ll make the time to really listen to an album, but it’s becoming more rare. And for the most part I’m not discovering a lot of new music (although I have found two of my top 10 bands in the last year or so). I’d like to change that.

With some notable exceptions, my musical knowledge is a mix of the 40s/50s/early 60s pop stuff my parents listened to, and 90s+ alt/metal. The 70s and 80s barely exist, and the rest isn’t really that well rounded. I mean, sure, I love Cash, and Bowie, Miles Davis and Pink Floyd get decent rotation time. But I’m missing a lot.

And that’s where 1001 Albums comes in. A mix of genres across 5 decades. I can’t wait! I’m already up to my 4th album for the night. If you want to follow what I’m listening to and what I think of it, head over to Twitter

As an aside, rdio has been flawless so far. It has had every album I’ve looked for, and other than some missing playlist/queuing stuff, the iPad app is very usable.

Tags

Programming (24)
Other stuff (17)
Photography (12)
Flex (7)
Audio (6)
Personal (6)
Politics (6)
Linux (5)
career (5)
Ubuntu (4)
eeepc (4)
info diet (4)
Gear (3)
PA2V2 (3)
Parenting (3)
ipod (3)
site (3)
Headphones (2)
Vista (2)
html5 (2)
iphone (2)
posterous (2)
proj365 (2)
social_media (2)
twitter (2)
AppEngine (1)
DT880 (1)
Health (1)
HyperProgram (1)
Java (1)
Notes (1)
O1 (1)
Pentax (1)
XML (1)
Zoo (1)
apple (1)
books (1)
dashboard (1)
development (1)
economy (1)
google (1)
hosting (1)
ipad (1)
libertarianism (1)
management (1)
money (1)
music (1)
org_culture (1)
tax (1)
web (1)