teaching machines

CS 318 Lab 24 – Workday

Dear students, There are a few topics I had hoped to address this semester, like these: styling a WordPress blog a Bootstrap-style grid layout We will tackle one of these on Monday. Which would you prefer? Also, after having examined your first prototypes, I’ve added a few extra requirements to the final project: All images […]

CS 330 Lecture 35 – Parsing

Dear students, We started writing our own lexer last time. We were trying to model in code this DFA that we drew on the board: Now, you might not have seen it, but we were actually playing a game of Chutes and Ladders. Each character in our source code was like a roll that moved […]

CS 318 Project – Prototype 2 – due on May 10

Your next milestone in the project is to iterate on the first digital prototype of your site. You will present this second draft of your prototype to randomly assigned classmates for another round of evaluation. Task 1: Iteration on Your Prototype Create a second draft of your site in a folder named prototype2 in your […]

CS 330 Lecture 34 – Lexing

Dear students, Okay, we’re on a quest to design our own programming language. Usually you’re supposed to start this kind of learning by writing a calculator. I couldn’t bring us to do that. Instead we’re going to design a language for drawing art based on primitive shapes. And instead of me foisting a language upon […]

CS 318 Lab 23 – Peer Review

Dear students, Today is peer review day. You will examine three peers projects and give mostly anonymous written feedback. You will spend 15 minutes examining each site in detail. Look for functional issues. Try to break it by resizing the window and locate weird interactions with links or menus. Look for aesthetic issues. Do the […]

CS 330 Lecture 33 – State Machines

Dear students, Okay, pruning out the recursive calls that you’ve already done before is one way to tame recursion. Let’s look at another. We mentioned early that the piling up of stack frames is what gets recursion in trouble. Consider this definition of sum’ in Haskell: sum' [] = 0 sum' (first:rest) = first + […]

CS 330 Lecture 32 – Taming Recursion

Dear students, We’ve seen that Haskell does some pretty crazy things: it infers types, it supports this crazy pattern matching stuff, it disallows side effects, and it computes things lazily. Let’s look at one last crazy thing it does: it uses recursion for everything! There are no loop control structures. Normally, when you think of […]

CS 330 Lecture 31 – Call-by-name and Call-by-need

Dear students, Last time we introduced a different way of passing parameters. Instead of eagerly evaluating them, we delayed evaluation until they were referenced inside the function. You are probably thinking, “Call-by-name. Big deal. How many new control structures am I going to need in my life?” Probably not many, but I think the bigger […]

CS 318 Lab 21 – Iframes and Transitions

Dear students, Today we explore transitions to add a little life to our webpages. We will focus on the mechanics of the CSS transitions. I leave it up to your good judgement to not go overboard or favor vanity over content. We’ll do a little example of making some list elements pop out when hovered […]

CS 330 Lecture 30 – Call By Name

Dear students, When you call a function, what happens? In particular, what happens in this code? int m() { cout << "m" << std::endl; return 5; } int r() { cout << "r" << std::endl; return 7; } int multiply(int a, int b) { cout << "*" << std::endl; return a * b; } int […]

1 2 3 4 9