Course Schedule

[Note: this webpage last modified Thursday, 08-Dec-2011 22:51:17 EST]

This web-page will be kept up to date with the required reading to perform before each lecture.

The following gives a tentative guess of an outline of the semester, organized by week. This webpage will be updated throughout the semester as things change.

Week 0 (Aug 25)

Topics: What is an algorithm, how does a computer work (why are programming languages such a pain?). Installing and running python programs. Variables and arithmetic in python (+, -, *, /, %). In-class activity - how to find the smallest, how to sort a list (motivation for need of for/while, if, variables, functions).

Reading: Think python, Chapter 1 "The Way of the Program", Chapter 2 "Variables, Expressions, and Statements".
Wikipedia article on computer.

Do: Download and install Python version 2.7.2 from http://python.org/download/.

Week 1 (Aug 30, Sept 1)

Topics: Number guessing game. While loops (indentation, break statement). Interacting with the user (raw_input, print). Using IDLE and debugging. "Tracing" a program. Getting random numbers. Boolean values and operators (and, or not). Comparison operators (<, <=, ==, <>, >, >=). Conditional statements (if, elif, else). Types of variables/date and converting between them (integer, floating point number, string/text). Importing modules, dir, the math and random modules. Using help in IDLE. Comments in python.

Reading: Python tutorial Chapter 3 "An Informal Introduction to Python", Chapter 4 "More Control Flow Tools".
Think python, Chapter 5 "Conditionals and recursion" (skip parts about recursion), Chapter 7 "Iteration" (focus on parts about while loops), Section 13.2 "Random numbers".

Week 2 (Sept 6, 8)

Topics: Continuation of last week and/or getting started on the next week's material depending on our pace.

Supplemental reading: Wikipedia article on binary search

Week 3 (Sept 13, 15)

Topics: Hangman game. For loops, including range function. Lists in python, use of [] and : for those. Functions in python, including use of () and def for those. More about strings (strings are lists of characters/letters). Encryption with Caesar cipher.

Reading: Think Python, Chapter 3 "Functions", Chapter 8 "Strings", Chapter 10 "Lists".

Supplemental reading: Wikipedia article on Caesar cipher

Week 4 (Sept 20, 22)

Topics: Continuation...

Week 5 (Sept 27, 29)

Topics: Continuation...

Week 6 (Oct 4, 6)

EXAM EXAM EXAM - first exam is October 6.

Topics: Turtle graphics - import turtle, penup, pendown, setpos, forward, setheading, right, left, mainloop, speed, clearscreen, onkey, onscreenclick, onclick, and other turtle functions. Being able to draw a graph (Cartesian or parametric) with the turtle. Random walk with the turtle. Drawing a fractal with the turtle. Drawing other things using for loops. Registering functions to happen when the user clicks or types a key. Recursive functions, functions as variables.

Reading: turtle module on python.org, Koch snowflake fractal, review reading on recursion in Think Python

Supplemental reading: cardioid on wikipedia, random walk on wikipedia, python.org turtle planet/moon demo, other python.org turtle demos

Week 7 (Oct 11, 13)

Topics: Continuation of turtle.

Week 8 (Oct 18, 20)

Topics:

Picture toolkit - grayscale, changing tint of picture, etc.
Files and directories on computers and in python. What is a picture file (bunch of pixels, each of those have red/green/blue values)? Nested for loops for looking at each pixel in a picture. Modifying the red/green/blue values (e.g., white is all set to 255, black is all set to 0, gray means all have the same value).
PIL Image module, including functions for open, save, mode, resize, paste, accessing pixels.
Tuples - similar to list but immutable and created using () instead of [].

Reading: The Tutorial in the Python Imaging Toolkit documentation. Commented files from in-class code describing images and how to use the PIL module.
Think Python Chapter 12 "Tuples", but don't worry about the part talking about dictionaries yet.
notes on RGB, color, digital images

To do: Download and install Python Imaging Library

Week 9 (Oct 25, 27)

Topics: Continuation from last week. Will get to the newer stuff when we're ready...

Week 10 (Nov 1, 3)

Topics: Continuation of images.

The main parts of a computer: CPU, memory, external storage (hard drive, CD/DVD, USB drive), connection to internet. Difference between memory and external storage - memory is temporary and can disappear after your program runs, need to store anything permanent on the hard drive in a file. Memory is very fast and more expensive, hard drive is very slow and very cheap.

Using files in python (open, readlines, read, write, close, "rt"/"wt"/"rb"/"wb"/"at"/"ab"). Opening urls/webpages with urllib2 (urlopen, read, readlines, close)

Reading: Think Python, chapter 14 Files (in particular 14.1, 14.2, 14.4).
Wikipedia article about computers at the top of this webpage.
python.org documentation about urllib2.

Week 11 (Nov 8, 10)

Topics: Dictionaries in python, {} and [] notation for those.

Reading: Think Python Chapter 11 Dictionaries and Chapter 9 Case: Study Word Play. In particular, section 9.1 has some information about reading files. The rest of it is optional. Chapter 13 up through 13.5.

Week 12 (Nov 15, 17)

Topics:

continuation of dictionaries.

EXAM EXAM EXAM - second exam will probably be November 17.

Week 13 (Nov 22)

Topics: Classes in python, including __init__ constructor, self variable in the class functions, how to make functions and variables inside of a class object, and creating a class variable.

Reading: Think Python: Chapter 15 Classes and Objects, Chapter 17 Classes and Methods (through section 17.5).
Supplemental (not required): the rest of Chapter 17, Chapter 18 Ineritance.
Supplemental for reference: An Introduction to Tkinter

Week 14 (Nov 29, Dec 1)

Topics: Continuation of classes, and potentially getting into the topics for next week.

Week 15 (Dec 6, 8)

Topics: Running time, efficiency. Sorting algorithms (selection sort, merge sort)

Did not get to the following, but would have been great... Lower bound for sorting. Running time of "grade school" addition, multiplication. Difference between different types of running time (linear, quadratic, exponential, etc.). Some problems cannot be solved (e.g., halting problem). P versus NP, brute force search, factoring, cryptography. Robots. Exceptions in python (try and except, types of exceptions). Doing user interface with tKinter.

Reading: Commented code from class each day, look at the in-class code.

Supplementary Reading: sorting

Final Exam slot (Dec 15 10:00am for section 002, Dec 13 1:00pm for section 001)