Archive for the ‘Walking Journal’ Category

Walking Journal: 45 miles, starting a Twitter client chain

Friday, September 25th, 2009

I’ve been neglecting both walking and posting on here, though I’ve neglected posting more, obviously.

I’ve been very busy with work and side projects and my house trying to fall apart on me, so I’ve been out of free time lately.

Anyway, my total is now up to 45 miles of walking. Not too much more than last time, really. I’ve gone on some walks around the neighborhood with Angie, and I’m not counting them, mostly because I don’t know how long they are, really.

I decided I wanted to start a “chain,” where every day I do something to work toward a goal I’ve set for myself (yes, I mean other than the walking, though that can be a chain as well).

Fortunately enough for me, I found Don’t Break The Chain, where you can keep track of one or more “chains” of things you want to do every day.

The Twitter Client Chain

So I’m creating a web-based Twitter client, as a project for me to try out all the different techniques and technologies that I want to use, but don’t have the chance to work with as much as I’d like during my day job. Also, ideally, it will at some point become a supplementary source of income.

That’s a quite a way off until I have more free time in a month or two, but for now, I will satisfy myself with making some small amount of progress on it each day (hopefully).

I’m writing this client in Erlang, using the awesome Nitrogen web framework with the equally awesome MochiWeb web server. My goals for this project include using test driven development and continuous deployment and fully embracing the mantra of “release early, release often”.

The plan is to have something up and running on a server as soon as possible. By something, I mean even less than a full-featured twitter client. But as soon as something is up, I can start getting feedback, and see what I should work on next. If I’m creating a product for users, there’s no use in developing what I want.

I need to develop what my users want.

I started this chain up about a week ago, and broke it after the first day. Now I’m trying again.

Tests and pre-commit hooks

During my previous, one-day chain, I managed to get a test harness (using the EUnit Erlang unit test framework) set up which will find any modules ending with _tests, stopping at the first error.

At the moment, I have a shell script which runs the tests. When it starts to take too long, I will switch over to an Erlang module which loops through, so I don’t get the startup times of the Erlang interpreter for each test. Or if anyone knows an easier way (perhaps there’s already a module that does that somewhere?).

#!/bin/bash
 
for modfile in `ls ebin/*_tests.beam`
do
    mod=`basename $modfile .beam`
    echo Running $mod:
    erl -noshell -pa ./ebin -s runtest main ${mod%.*}
    [ $? -eq 0 ] || exit 1
done
[ $mod ] || exit 1

The runtest module consists of the following:

-module(runtest).
-export([main/1]).
 
main(Mod) ->
    case eunit:test(Mod) of
        error -> halt(1);
        _ -> init:stop()
    end.

It’s all kind of thrown together, but the point is incremental improvement, so I’ll get back to it when/if I need to. Like I said, there’s probably something else out there that will do a better job at this than I did.

So, today, my “chain link” was partially taking that script and setting it up to run from the GIT pre-commit script, and partially writing this blog post.

Getting it set up to run as a pre-commit script just involved making sure it returns non-zero whenever there is a test error (or if no tests were run, which happens when make hasn’t been run yet).

The pre-commit script itself (placed in .git/hooks/pre-commit and set executable) is pretty simple:

#!/bin/sh
./tests.sh
if [ $? != 0 ]
then
        echo "===================================="
        echo " Commit stopped due to test failure"
        echo "===================================="
        exit 1
fi

Chain length: 1!

What’s next?

Next up, I’m acutally going to start on the meat of the project. Since I haven’t fully decided on what GUI library I want to use, nor what GUI testing framework I want to use, I’m going to start on the backend with code to manage user login info and queries (timeline searches, DMs, etc.).

I’ve got some great ideas (I think) on ways to enhance the way people have conversations over Twitter (and eventually other mediums), so you can be sure that there will be more posts about this in the future.

Walking Journal: 9 miles, thunderstorm, etc.

Thursday, August 27th, 2009

weight-2009-08-26-2

I walked at least 4 miles today. I’m not sure if I got too far over that, though, because a thunderstorm came through and killed the power before I could look at the exact amount on the treadmill. The last time I looked it was 4, so I’ll count it as that.

Thunderstorm

I was excited when I first saw the clouds rolling in, because we haven’t gotten a good rain for months now, and our lawn (as I mentioned in my last entry) is getting pretty brown.

However, when lightning started striking across the street from me, I started to get a little worried. That, and the fact that my wall-mounted monitor was swaying back and forth. Fun fact: speakers make a nice crackly noise when lighting strikes close by.

I don’t think I’d seen lightning strike before. It was quite a sight to see. A bright flash, then a sort of green glow and a halo of sparks that drifted slowly away from the strike point. And it happened in the same place, three times in a row, a few minutes in between. “Never strikes the same place twice” my ass!

After the storm had passed, we went outside to see how bad the damage was. Our South and street facing section of fence had been blown over into our yard, all of the fence posts simply snapped off. It takes a pretty strong wind to break a healthy 4×4, I think. We also lost the corrugated plastic roofing over half our back patio, and worst of all, the planter box with my ginger plants in it got blown over! Three out of four of the plants seem to be okay, but one of them got snapped off at the base of the stalk. We also found some roofing shingles in the back yard, so we’ll probably need to take a look at the roof when it’s light outside.

We were lucky compared to some neighbors. One guy down the street got a huge tree (somewhere around 3 feet in diameter) through the roof of his station wagon, and partway through his PT Cruiser (it hit the station wagon first, so that took the brunt of the damage). He seemed in relatively good spirits despite the damage, telling us that he was going to convert the station wagon into some sort of el Camino-type thing by cutting the damaged back half of the roof off. Perhaps all the beer he and his friend were drinking was helping him to stay in a good mood about it.

500 languages slowdown

I’ve been very busy with work and personal projects recently, and so I haven’t had much time for the 500 programming language project. I started learning about Nu, a lispy, interpreted, object-oriented language built in objective-c. I got the interpreter compiled and working on my 64-bit Ubuntu machine, which took more work than I would have liked due to the fact that most of the development of Nu takes place on Macs. Anyway, there’s a webserver for Nu, called Nunja and a Nu markdown processor, so I was thinking I’d write a simple blog engine as my Nu program. Nu is looking like a really interesting programming language so far, so it might be one I come back and spend some more time on.

But as I was saying, I haven’t had as much free time lately, so the posts have slowed down. Don’t let that fool you, though. I haven’t given up on the challenge, I’ve just accepted that it might be a while before I can be pumping out 5 languages a week. And it might, in fact, take me more than the 2 years I was originally thinking (dreaming) that it would take.

Walking Journal: 5 Miles

Wednesday, August 26th, 2009

weight-2009-08-26

I’m starting a walking journal, to keep track of how far I walk each day, and to give me something to post about more frequently. Despite the fact that most of my posts on here are Probably about Programming, this is still, in fact, a personal blog, so I think posting personal things on here pretty much makes sense to me.

I’ll also use the walking journal as an actual journal, to talk about things other than walking. I can justify this by noting that I will, most likely be writing a lot of the journal while walking, so the name still works. I wrote most of this one while walking, so it works!

Walking journal

I’ve walked 5 miles since deciding to start this morning, so that’s a good start, I suppose.

Perhaps I’ll do a 100200 miles to a chumby-style thing with this. Though I have an advantage with my walking desk, because I can walk and be working at the same time. If I walked during my entire workday, I’d be able to get 16 or so miles a day without a problem, and I’d have 100 miles in no time :) , so maybe I’ll make my goal about losing weight instead of a specific distance. 20 pounds to a Pandora?

I’ve redoubled my efforts at weight loss, and I’ve started both walking daily and tracking my weight again.

You can join in on the fun and track my progress on my Physics Diet profile

It looks like I’ve been slowly on an upward gain, but it’s just because I weighed myself before dinner, rather than before breakfast as I always did before, and it filled in the blanks since February, since I haven’t weighed myself since then. I’ve actually been holding pretty steady in weight, I think, so it’ll be good to break through this plateau and get my weight lower.

School’s started again in Round Rock

School is back in session. I guess no more sleeping in since the children gather outside our bedroom window in the morning to wait for the bus.

On the plus side, I can once again go out on my front lawn in a bathrobe and yell at those “damn kids” to “get off my lawn!”

I could have done that during the summer, but I would have looked a little silly when all that was out there was dead grass.

Teeth are expensive

I had a 9am (super early for me) dentist appointment today to get an impression for a crown taken. Good god these teeth are costing me a lot of money.

I’ve used up all my COBRA dental insurance from my last job, and from what I hear it’s nearly impossible to get private dental insurance, so it’s going to all be out-of-pocket from now on.

Since with my current job I’m technically a “private contractor,” because they have no offices in the US, they are just paying me what would cover insurance (though it might not cover personal insurance after my COBRA is over).

Perhaps the way to go is really personal insurance in the sense that I will put away that same money every month in case of medical emergency.

Or I could just have all my teeth removed and switch to an all-liquid diet. I’m sure Angie would love having a toothless 25-year-old husband. For sure.