The way to be a cook is to cook. — Edward Espe Brown (Tassajara Cooking•)
- On-the-fly data entry with Markdown and Perl—Wednesday, August 26th, 2026
-
One of my resolutions this year was to start focusing on the cookbooks I already own rather than acquiring more. Whenever I buy a new cookbook, I make a note of the recipes I’d like to try most and put the list inside the front page. This means that most of my cookbooks have a postcard or notebook sheet listing the recipes I find interesting. When I want to try out a particular cookbook, I am easily reminded of what I thought was interesting about it when I bought it.
But if I want to look for a particular recipe among all of my cookbooks, that becomes an obviously more involved process. So, I decided to convert each of those paper lists into a single searchable file on my computer.
Typing that sort of thing into a database cell by cell is time consuming and annoying. It requires paying attention to the screen rather than just typing. I decided to use a faster format for typing desired recipes book by book, and then write a quick script to convert that fast format into a tab-delimited file for import into a database or spreadsheet.
As with most of my quickie text conversion scripts, that faster format looks a lot like Markdown.
Here’s what the source file ended up looking like:
- # Australia Jet Age Cookbook
- 1970
- *22 Caramel Squares (golden syrup)
- 23 Heavenly Slices
- *36 Ginger Beer
- 15 Fruit Salad Ice Cream
- # Mirro Dough Mixer & Bread Baking Kit
- 1975
- *16 Coconut Coffee Cake
- 14 Stollen
- 8 Oatmeal Bread
- *Cornmeal Bread
- 6 Health Bread
- 10 Kolaches
- *12 Hungarian Coffee Cake
- *Herb Rolls
- 15 Apple Cake
That is, I type the book title once, and the year the book was published; then, page numbers also only get typed once. Special recipes are marked with an asterisk at the start of the line. It’s very fast. I was able to do a full bookcase, a half bookcase, and the display shelf by the dinner table, all in just a few days by typing during my spare moments here and there.
The script turns that format into a file more readily readable by apps such as Google’s spreadsheet, or any database program.
- Duplicating repetitive BASIC lines—Wednesday, April 22nd, 2026
-
If I’m reading Peter Stumpf’s code right, this image was just a series of LINEs in the Color Computer’s Extended BASIC.
I wrote last time about some of the command-line utilities I use on macOS to help type code from books and magazines. I have two other very simple utilities I use that I’ve never written about because they’re so simple. Both have to do with repetitive code.
The lack of real custom functions in Color Computer BASIC makes a lot of its code very repetitive. Often, long sections of a BASIC listing will be the same line with slightly different numbers over several lines or even columns. I wrote basicDuplicator to literally just duplicate the selected line, updating only the line number.
[toggle code]
- #!/usr/bin/perl
- # duplicate a line of BASIC with increments
- # Jerry Stratton astoundingscripts.com
-
while ($option = shift @ARGV) {
-
if (!$count && $option =~ /^[1-9][0-9]*$/) {
- $count = $option;
-
} elsif (!$increment && $option =~ /^[1-9][0-9]*$/) {
- $increment = $option;
-
} elsif (!$lineText && $option =~ /^([1-9][0-9]*) (.+)$/) {
- $lineNumber = $1;
- $lineText = $2;
-
} else {
- help("Unknown option $option");
- }
-
if (!$count && $option =~ /^[1-9][0-9]*$/) {
- }
- help("Duplication count must be one or more") if !$count;
- help("BASIC line with initial line number must be provided") if !$lineText;
- $increment = 10 if !$increment;
- $currentLine = $lineNumber;
-
while ($currentLine <= $lineNumber + $count*$increment) {
- print "$currentLine $lineText\n";
- $currentLine += $increment;
- }
-
sub help {
- my $message = shift;
- print "$0 <count> [increment] <line>\n";
- print "Reprint initial line, and then duplicate LINE, COUNT times, incrementing the line number by 10 or given increment\n";
- print "\n";
- print "$message\n";
- exit();
- }
Suppose, for example, that I’m faced with the following three lines:
- 50 M1=240:M2=RND(70)+60:GOTO16
- 51 M3=240:M4=RND(70)+60:GOTO16
- 52 M5=240:M6=RND(70)+60:GOTO16
- Thoughts on typing 8-bit code—Wednesday, March 18th, 2026
-
I’ve been neglecting my Color Computer posts for a while now. It’s not that I’m not using my CoCo, it’s that most of what I do is play old 8-bit games and fool around with simple programs in old books.
Over on Allen Huffman’s blog earlier this year we had a short discussion about Rainbow Check and the usefulness of its various iterations when typing in TRS-80 Color Computer code from The Rainbow.
In fact, The Rainbow went through three variations on how to preflight your code as you typed it that, weirdly, few if any other magazines or books picked up on. The first verification tool is that The Rainbow was the first such magazine, almost from the start, to present their code listings in 32-character lines. This meant that, when typing code in on your Color Computer you could look at the left-most and right-most columns to get a good idea of whether you had typed the code correctly.
This was pretty simplistic, of course. Typos that didn’t involve adding a character or losing a character would only be obvious if that typo happened to occur at the beginning or end of a line. So in January of 1983 The Rainbow introduced their Rainbow Chek utility. It, too, was very simple: each listing provided a table of numbers representing how much memory should have been used up by your code at various checkpoints. When you reached that checkpoint (i.e., line number), you would run the utility. It would tell you how much memory the code used, and you could verify that number against the printed table.
This was really only useful for fat-fingered extra/missing characters—which the 32-character line already helped with—and for typos in BASIC commands. Typos in BASIC commands prevent them from tokenizing. As long as the typo doesn’t itself represent another command, that will alter memory usage.
Despite those limitations, and combined with the 32-column validation, the first “Rainbow Chek” was very useful compared with the absolute nothing every other publisher provided.
There were, however, a huge class of errors that Rainbow Chek wouldn’t catch, so in February 1984 they introduced Rainbow Check Plus. This provided a true checksum based on the tokenized BASIC commands and the ASCII codes of non-tokenized characters.
- Save That Thou Art—Wednesday, April 9th, 2025
-
There are several hymns sung to the tune of the “Irish folk melody” Slane. It’s a storied tune, supposedly named after the Irish Hill of Slane were St. Patrick “lit an Easter fire in defiance of the pagan king Lóegaire”. It’s also very evocative. I first heard the tune in Lord of All Hopefulness, which ends each line with a countdown of the passing day: the break of the day, the noon of the day, the eve of the day, and the end of the day.
But my favorite is Be Thou My Vision, using words translated from a much earlier Irish poem. The original is, by tradition, attributed to the Irish poet and saint Dallán Forgaill. According to online sources, Mary Elizabeth Byrne translated “Rop Tú Mo Baile” from a Middle Gaelic poem to an English-language poem, and published it in 1905. Eleanor Hull “versified” the poem in 1912, though I can’t see whether she was versifying Byrne’s translations or going back to the original Gaelic.1
It’s not just that this earlier date puts it into the public domain that makes it my favorite—although that helps! As much as I enjoy Lord of All Hopefulness, there’s something contrived about its lyrics. In contrast, Be Thou My Vision is heartfelt and simple.
Looking at the various versions, the conversion from poem to hymn is an interesting class in how to translate a very personal prayer into a hymn to be sung during Catholic Mass.
