Software Design Spring 2006 For today, you should have: 1) read Chapter 3 of How to Think 2) read Chapter 2 of the Olinux manual For lab tomorrow, you should: 1) read Chapter 4 of How to think 2) read Chapter 3 of the Olinux manual For Friday, you should: 1) prepare for a quiz on Chapters 1-3, emphasizing vocabulary! (be on time) Early project program --------------------- If you already know some Python, you might want to start on a project early. Starting early will be mostly grade-neutral; it will neither help nor hurt. But it is an opportunity 1) to take on a more substantial project, 2) to make good use of available time at the beginning of the semester, 3) to address some material in software engineering that the rest of the class might not get to. Required elements ----------------- Your project must involve: 1) substantial software design, probably including object-oriented design and possibly including data structure and algorithm design. (rule of thumb, if you have no classes, no inheritance an no recognizable data structures, that's a big red flag) 1') at least one signficant design or implementation decision that you can justify. 2) substantial interface design, involving at least two clearly- identified levels. 3) the development of a program meta-language; a vocabulary for talking about your program. 4) teamwork; you must work in groups of 2-4. I will help coordinate the mating dance, but if you are the odd person out, you might have to wait until the next phase. Many projects will involve: 1) a graphical user interface (because event-driven programming is an important concept) 2) a distributed application (either using one or implementing one) You can build on top of existing libraries, but you should try to stick with common, well-supported ones. Also, you should be building on top of existing libraries, not making substantial changes to them or contributing to an existing project. A successful project might be useful to a wider audience, so you might want to package it and make it available... LATER. Preparing software for distribution and maintaining it is time-consuming and not the focus of this class (roughly 50/50 design and implementation). Examples of past projects ------------------------- 1) synthesis of RSS feeds and graphical display of related threads 2) turtles that paint like Jackson Pollack 3) graphical display of audio signal 4) IM interface to a web proxy 5) networked card game Assume that you will have tkinter and either Pyro or Twisted at your disposal (although we won't get to them for a while, so you might have to read ahead.) Project proposal ---------------- Proposals due next Friday 10 February (or sooner if you want feedback) One page per group, with the following information: a) who's in the group? b) what's the project? 1-3 paragraphs c) what's the minimum/maximum deliverable? d) what's the biggest problem you foresee or question you need to answer to get started? Homework 1 Help --------------- Sorry about the pace! Because of the timing of the first lab, we are about a week ahead, but that means that the labs are getting ahead of the reading/lectures. If we survive the first couple of weeks, we get to do more cool stuff later, but there is a price! First, let's review functions (notes02.txt) Important words: define, call (invoke), argument, parameter. Important concept: separating what happens when the function is defined from what happens when it is called. Questions? for loops --------- What do the following statements do? for c in 'allen': print c, for i in range(4): print i for statement is an example of a compound statement 1) header ending in : 2) indented body By convention, indentation is 4 spaces. End of body marked by an outdented line. bob = Turtle(world) for color in ['red', 'yellow', 'blue']: print color #inside the loop bob.set_color(color) #inside the loop bob.fd(100) #outside the loop Printing -------- 1) go to the printer you want to use and copy the name and IP address from the sticker For example, OC371R03 is 10.24.11.229 2) As root, type printconf & A printer configuration window should appear. 3) Press New. A configuration wizard should appear. 4) Press Forward to get to the first useful screen, then enter the name you want to use to refer to this printer. Don't bother with the description. Press Forward. 5) Select queue type Networked UNIX (LPD). In the server entry, type the IP address. In the queue entry, type the name of the printer again (or whatever, it doesn't matter). Press Forward. 6) Under Printer Model, select Postscript Printer from the scrollbox. Press Forward. 7) Press finish. 8) When it asks, don't print a test page. We'll use your homework as a test page. a2ps ---- a2ps stands for "ASCII to Postscript". It is a versatile program for printing plain text files. 0) Before you try to print something, make sure your network is working. That way we can separate printer problems from network problems. Since you know the IP address of a printer, try to ping it: ping 10.24.11.229 1) Log into your user account and go to the directory where your homework solution is. 2) Check that there is a comment in your program that has your name in it. 3) Type a2ps -1 hello.py (that's a one, not an ell) The -1 option means "one page per sheet of paper". The default, unfortunately, is "two pages per sheet", which is too small for my aging, myopic eyes.