February 22, 2012: Watch Me: Trial Run

A dozen people have come forward since I asked last week for volunteers to make short screencasts showing how they program. I just sent them a sample problem to work on to test things out (see below the fold); the videos they create won't be made public, but I hope it gives readers an idea of the scale of problems we're going to be looking at. If you have suggestions for interesting problems of a similar size, please add them as comments on this post.

Hello, and thank you once again for volunteering to help Software Carpentry by recording a screencast to show people how you program. To test out your system, I'd like you to record yourself solving the problem described below using any tool or tools you like, on whatever kind of computer you prefer. Use whatever recording tool you like (a demo version of Camtasia, QuickTime, xvidcap, ...), and save in whatever video format is easiest. Please:

Write a command-line program called 'total' to add up the numbers in a data file. The input file's name is given to the program as its sole command-line argument; its only output is the sum of the numbers in the file (if the file does not contain any numbers, the output is 0.0). The file may contain any number of lines (including none at all); each line may contain at most one floating-point number, and may also contain leading or trailing whitespace. (Lines containing only whitespace, or nothing at all, are allowed, and should be ignored.) For example, if the file 'numbers.txt' contains:



then invoking the program as:

$ total numbers.txt

should print 102.3 on a line by itself.

< OlderNewer >

This post originally appeared in the Software Carpentry blog.