CSC151.02 2003F, Class 49: A CGI Project Admin: * Exam 3 ready (more or less). Sorry that it took so long. * Read "Records in Scheme" * Congratulations to Sung-Ju for getting a letter-to-the-editor published in the world-renowned Des Moines Register. (Development in developing countries.) Extra credit for finding and reading his editorial. Overview: * Why are we learning this stuff? * What did we learn, anyway? * Project: Simple database search Questions on the Exam Q: Do recursive procedures have to be tail-recursive? A: No Q: Will we receive extra credit for making them tail recursive? A: Maybe Q: What happens if we write kernels that are not local? A: You will lose style points. Why are we learning CGI? * So that we can make Web pages that "do cool stuff". * So that we can write programs that other people can interact with without getting a Linux account or learning how to start DrScheme or both. * It's a different way of using Scheme; it may be harder to find errors, so it exercises your brain in a different way. * It might even be fun. Review: What did we learn? * How to take a variable and create a Web site that is tailored to the user. * Sam's silly diagram of the process. * In the HTML page
* In the Scheme part of the CGI script (get-cgi-variable "...") ; The thing in ellipses must match the thing in ellipses in the HTML page. * Your goal is to write a procedure, (page), that reads variables and generates an HTML page. Exercise: Combine these ideas with stuff we've done recently (e.g., searching). Write a simple Web-based information retrieval application. * Countries and their capitals. 0 * People and their grades. 2 * Beverages. 5 * Grinnell students and interesting facts about those students, such as their majors. 8 For each student, we will store: * 0: First name * 1: Last name * 2: Nickname * 3: Home * 4: Major * 5: Class/year We can represent each student as a vector. We can represent all students as a list of those things. * Can we search the list of students by first name? (define search-students (lambda (...) ...)) To build an application, we need to get a request from the user, search the students, turn the student records to HTML, and show the result.