Parity Time

Right before each school year begins, my colleagues and I meet with our incoming first-year students. We show them around the building, introduce them to the student groups, and generally just try to be welcoming. This past year, I decided my contribution to this event would be a magic trick from CS Unplugged. Since one […]

Stella

Homework assignments usually start brewing in my head well before I actually assign them. Stella, for instance, was born last fall but won’t be assigned until next fall. I also need about that much time to respond to an email. Stella is a kaleidoscopic drawing application. The user draws on a canvas, and the drawn […]

CS 330 Lecture 16 – Parametric Polymorphism

Dear students, Don’t get me started on arrays. What sort of world is this where an array is fixed in size, but yet it doesn’t know what that size is? We must fix this. Let’s create a growable array: class Flexray { public: Flexray() : capacity(10), nitems(0), elements(new int[capacity]) { } ~Flexray() { delete[] elements; […]

CS 318 Lab 11 – Two-column Layout

Dear students, Today we visit the canonical two-column layout. We’ll use the float property to allow other content to flow around it. We’ll do a quick example together of adding drop caps to a page. Suppose we have this paragraph: A writer—and, I believe, generally all persons—must think that whatever happens to him or her […]

CS 330 Lecture 15 – Choices in C++

Dear students, C++ is a language with choices. Some call that a curse. I’d argue that asking that all doors be closed but one gives to much authority to an outside entity that can’t possibly understand our situation and can’t be trusted to know which door is best. Let’s discuss a few of these choices […]