teaching machines

ImageIO Exception

While grading student work, I pass through the whole spectrum of feelings, from elation to disappointment to bafflement to pride. Today I spent a fair bit of time in disappointment, but not because of my students’ code. Because of some code in the Java library. Hear, my friend, a tale of a standard library gone […]

Segfault on std::vector

I was writing a syntax highlighter for the Madeup desktop application the other day. I already had a lexer written months ago that generated a token stream. Each token in the stream knows its indices in the source code, so I sat down to write a pretty innocent algorithm: tokens = lex src for each […]

LaTeX Calendar Generator

My wife is crafting together a calendar full of family photos, and she asked me to print off some simple 2016 calendar grids that she found online. I looked at the templates and vomited. They had URLs on them. Because I suffer from developerism, I asked my wife if she’d let me try and generate some calendar pages […]

Limiting Execution Time in a Shell, Part II

A year ago, I thought I worked around the halting problem. I have students’ code that I need to grade, but sometimes they slip in an infinite loop. This really messes up automated grading. I wrote a shell script that would run their code for X seconds, killing their process if necessary. Sadly, I went to […]

Garbage Collection and Music

I’ve been reading a couple of books from the 1980s about Logo education research. What passed for research papers back then is incredible. Many of them read more like letters to the editor than reports on scientific experiments. Yesterday I was browsing Allan Martin’s Teaching and Learning with Logo. In chapter 9, Making Music with […]

Implicit Named Parameters?

In Learnable Programming, Bret Victor argues that to dispel the mysteries of source code we must show data in its context. One of the examples he suggests of offering context is to add a feature to IDEs: when a developer hovers over a parameter in source code, the IDE shows a message indicating the semantic […]

Limiting Execution Time in a Shell

Every fall my school participates in the ACM’s International Collegiate Programming Contest. Thankfully, we don’t have far to travel. In even years, we host the competition locally. In odd years, we go to a town only a half-hour away. This year was odd. When we arrived, I learned that there was zero infrastructure for judging […]

Getting a List of Forks of a Bitbucket Repository

A friend of mine handles the distribution and submission of homework assignments in an elegant manner: He creates one source repository on Bitbucket for an assignment, committing to it any scaffolding code that he provides to students. Each student forks his repository. The student makes the fork private, so only he and the student can […]

Running a Mac Bundle Synchronously

My holiday wishlist is pretty simple this year: I want to be able to run Mac bundles from the Terminal, such that standard in and out stay in Terminal and that the application window is frontmost. OS X provides the utility open, but open runs the bundle asynchronously, and we lose standard in and standard out from […]

Autocompleting Student Usernames in zsh

I use a lot of scripts to help me grade students’ work, enter their scores in the gradebook, and send them email reports. For example, I might grade the entire class’s work with: Or maybe I just want to grade Quintin Buster’s submission. I just supply his username as a parameter: I’ve had an itch […]