teaching machines

CS 330 Lecture 28 – Haskell IO

Dear students, There are a few ideas we didn’t get to last time. Let’s touch upon those before diving into a discussion of Haskell I/O. First, what about the type signature for fold? Let’s reason it out. We know it will have four parts: three parameters and a return value. fold :: _ -> _ […]

CS 318 Lab 19 – Reform

Dear students, Today we continue to explore forms. Many of you in this class will be professional communicators. Forms are kind of a big deal to you. Books don’t have them. Nor do radio and television. But our websites do. What power! Forms are a doorway; they make the web a two-way street. Your words […]

CS 330 Lecture 27 – Fold

Dear students, Let’s start with a Program This! Complete two of the following functions based on your row number. All of them accept a list. Solve them using the pattern-matching style, with base cases and general cases defined separately. All of them should be two-liners. upped, which generates an uppercase version of the incoming String […]

CS 318 Lab 18 – Forms

Dear students, Thus far we have focused on one half of the communication process: the “speaking” of our ideas to our sites’ visitors. Generally this is not enough. We would like to hear back from our visitors. We want them to join a mailing list, make an order, contribute an idea, vote, and who knows […]

CS 330 Lecture 26 – HOFs Elsewhere and Closures

Dear students, Let’s start with a Program This! Write the necessary Java 8 code to filter a List. Make the code as general as possible, allowing its clients to supply their own filtering criteria. Here’s my solution. To leave a hole in the filtering algorithm, we must leave a parameter for the predicate. We’ll use […]

CS 318 Project – Prototype 1 – due on April 24

Your next milestone in the project is to create a digital prototype for your site. You will present this prototype to randomly assigned classmates for an initial evaluation. Task 1: Create a Prototype Create a first draft of your site in a folder named prototype1 in your GitHub project. Name this directory exactly; no spaces, […]

CS 318 Lab 17 Cont’d – Dropdowns and Tabviews

Dear students, Last time we started implementing dropdown menus. We decided to continue that effort today, though I do want to add one extra and related exercised: a tabbed viewer. Here’s your TODO list: Read chapter 10 in your book. Complete the Codecademy exercise on forms. It is woefully incomplete and it uses single quotes […]

CS 330 Lecture 25 – Filter, Map, and Foreach

Dear students, Let’s start with a Program This: Write in Haskell a function count that accepts a predicate and a list. It yields the number of elements for which the predicate is true. We’d write it like is in an imperative way: count = 0 for each element in list if predicate is true of […]

CS 318 Lab 17 – Pseudoselectors and Dropdowns

Dear students, Today’s lab is designed around something I saw in a lot of your mockups: dropdown navigation menus. There aren’t a lot of new ideas here, but application of old ones. So, I won’t talk much. However, I did incorporate a few of the pseudoclass selectors that you met in CSS Diner. Let’s revisit […]

CS 330 Lecture 24 – Lambdas

Dear students, There are at least four ways of defining functions in Haskell: by defining a named function by partially applying parameters to get a new function expecting only the remaining parameters by composing a gauntlet of functions together by defining unnamed lambdas We discussed composition last time. We continue that today, but we also […]