Problem Solving Stack

I recently started a new supplementary coding technique that I have not heard about anywhere else. I'm not sure what to call it, although internally I've been calling it streaming, an abbreviation for stream of consciousness programming. It works by writing out how you are solving a problem.

Here's a real-life example that likely took place over the course of a couple of hours:

control_parsing
 Go through documents and figure out what appropriate values would be for the metadata and the control data to get it out
  Given a standard document, the ability to correctly parse out the fields
   Given a patient identifier, find the matching patient
    What API call do I use for this?
     Where is the system id of 387 coming from?  I could swear I've seen that before
      I don't think it's actually used, I think that we just use the patient identifier and the user's institution id
       Pretend we are calling the API call with the known patient identifier and user's institution id to ensure that I have the right mental model

Process

I use vim to type out my thoughts and save them a text file. I could see marking things off by putting '#' at the beginning of the line, which for me would gray the line out, but normally I just delete things when I get done. This results in a nice feeling of crossing things off of the list. If I'm in the heat of solving a problem, I often don't write or delete lines. But when I come to a stopping point or am considering what next to do, I usually write out what I am thinking. This minimizes overhead and preserves flow.

Read on →

Meaningful conversations

Awhile back I did a thought exercise. The exercise was a way of seeing what you valued most in life. It goes like this:

Every day for a week, write down the following snippet and answer it ten times:

Something I really want out of life is…

It seemed interesting, and I like it when things are spread out over a period of time so that you can see yourself in different ways. So I did this off and on for a few weeks. I expected that depending on the time of the day and my mood that this would fluctuate quite a bit, but I was surprised to see some recurring themes and a strong direction.

One of the things that struck me was "Something I really want out of life is to have meaningful conversations". I put this down a few times, but I never really defined "meaningful conversation." Perhaps I knew what I meant, but perhaps I didn't and was just being vague. So I thought about it for a bit.

Meaningful conversations are one of the most desirable events that I can think of. If I knew that I would have a great conversation but I had to miss something else to have it, there are few things that I would rather do with that time. Of course, this rarely happens in practice because there is a certain degree of spontaneity, it just so happens that two people are walking along similar paths in life, considering the same problems or running into the same obstacles. It is, of course, possible to be too analytical, and thereby spoil things. As with anything that is desirable, it is advisable to not become too attached to previous experiences and expectations.

Read on →

Growing Up

When I was growing up, my relatives always seemed to ask me the same questions. "How is school going?", "Do you have any girlfriends?" and, of course, the time-honored classic: "What do you want to be when you grow up?"

While the second question usually flustered me, it was the third question that seemed to evoke the most interest from my relatives. They would say ominous things like, "If you want to be happy in life and make a lot of money, you had better figure out what you want to do." I usually said something like be a doctor or lawyer, and they seemed mollified and the conversation changed to adult topics.

Read on →

Capistrano completion for zsh under Ubuntu

Seeking a way to extend completion in zsh for Capistrano tasks for a Rails project, I found a script that apparently works for OS X. However, it didn't seem to work out of the box for Ubuntu, so I made a few modifications. Put this in a file and source in your .zshrc file, and you should be set!

_cap_does_task_list_need_generating () {
  if [ ! -f .cap_tasks ]; then return 0;
  else
    accurate=$(stat -c "%y" .cap_tasks)
    changed=$(stat -c "%y" config/deploy.rb)
    return $(expr $accurate '>=' $changed)
  fi
}
 
_cap () {
  if [ -f config/deploy.rb ]; then
    if _cap_does_task_list_need_generating; then
      cap -T | cut -d " " -f 2 | sed -e '/^ *$/D' -e '1,2D' >! .cap_tasks
    fi
    compadd `cat .cap_tasks`
  fi
}
 
compdef _cap capompdef _cap cap

The first time that you attempt completion with cap, the available tasks will be analyzed and cached. Then, future completions will work correctly and quickly. If you have any problems, deleting the .cap_tasks file will signal that the generating process needs to happen again.

Read on →

The Pomodoro Technique

If you've walked by my area in the couple months or so, you may have noticed that I sometimes have a massive stopwatch displayed on my computer. I was consuming some content produced for the Agile 2008 conference, and came across a very interesting article about the Pomodoro Technique, a way to think about time and work differently. Staffan Nöteberg has a book about the system, and can probably explain it more coherently than my attempt in this post.

What is it?

The Pomodoro Technique is a system that Francesco Cirillo created and used when he was a student to help him focus. Staffan then used this technique successfully in software development, and believes that it can be applied to most things that people do. Pomodoro comes from the Italian word for tomato, which was the form of his original timer.

For the system, you just need a pen, paper, and a kitchen timer. I'm using this online stopwatch and using simple text documents to replace the pen and paper. The online stopwatch is nice because it has an alarm that rings through my headphones so I don't bother anyone.

How do I use it?

So anyway, a pomodoro is a set period of 20 to 35 minutes in which you focus intently on the task at hand. After each pomodoro, you take a 3-5 minute break to stretch, relax, or just kind of space out. Nothing mentally challenging should be done. When you do four pomodoros back to back, it's called a set. After each set, you should take a longer break (15-30 minutes.) This is an ideal time for lunch, running errands, making non-work related phone calls, etc.

Read on →