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 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 […]
CS 330 Lecture 23 – Ways of Making Functions: Composition
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’ve seen the first two. Now let’s turn to composition. You’ve almost […]
CS 318 Lab 16 – Midterm
Dear students, Today we have a midterm. Here’s your TODO list for next time: Complete CSS Diner, a game for learning CSS selectors. Read chapter 9 in your book. On a quarter sheet, share 2-3 questions or observations from your playing and reading. See you next time! Sincerely, Midterm You will reverse engineer and recreate […]
CS 330 Lecture 22 – Ways to Define Functions: Partial Evaluation
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 A good first question to ask is this: why do we need […]
CS 330 Lecture 21 – More Recursion and Pattern Matching
Dear students, Today we solve more problems in Haskell together. Along the way we will discover some of the peculiarities of functional programming, like the lack of iteration, the supremacy of recursion, and the beauty of pattern matching: Here are the problems we’ll solve: Last time we started to write a function to determine if […]