teaching machines

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 […]

CS 318 Lab 20 – Web Jam

Dear students, Let’s shake things up a bit today. When game developers get together to build a game in a very short amount of time, they call that a game jam. We will have a web jam. I want to devote all of today’s lab time to that, so I won’t be doing any talking. […]

CS 330 Lecture 29 – Haskell IO Cont’d

Dear students, Last time we introduced ourselves to Haskell’s world of purity and its world of side effects. We learned that any value that gets created in the world of side effects is packaged up in an IO wrapper using the return function. We can unpackage such wrappers using the <- operator. We will finish […]