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:
- do use a headset mike if you have one, but if you don't, please don't worry about it for now—this is just a test
- do use full-screen recording—the real videos will have to be constrained (probably to 800×600 or 1024×768), but for now, let's keep it simple
- do talk a lot while you're coding—stream of consciousness like "OK, so let's open up the editor again and try swapping those values in the other order..." is what we're after
- don't worry about editing your video to cut out "ums" and "errs", typing mistakes, and so on—we'll do that for you in the real screencasts, and again, this is just a test
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:
22 31.3 +5.0e1 -1
then invoking the program as:
$ total numbers.txt
should print 102.3 on a line by itself.
Originally posted at Software Carpentry.