CS 3813/780: Python Programming and Text Processing, Fall 2012

Time and Location TTh, 9:25-10:40am, SB B-141
  1. Prof. Liang Huang (huang @ cs), Instructor
  2. Kai Zhao (z.kaayy @ gmail), TA
  3. Xiuyi Huang (xiuyi @ cs), Admin
Office Hours
LH: T 4-5pm, Th 10:50-11:30am, SB A-328
KZ: T 10:50-11:30am, Th 4-5pm, SB A-207b
Additional office hours available before quizzes and exams.
We will not follow any particular textbook, but the following are good references:
  1. How to Think Like a Computer Scientist: Learning Python
  2. The Official Python Tutorial
  1. For questions, please come to office hours (the most effective way), or:
  2. Newsgroup: cs3813780-qc@googlegroups.com (by default, questions should be posted here; check first if your question has already been asked before (most likely they have already been answered by other students); try your best to answer other people's questions; we both monitor it regularly).
  3. Course Email: cs3813780.qc@gmail.com (it will reach both Prof/TA. Only for issues specific to you, e.g. why my code crashes, or I missed class today, etc. We will simply ignore questions that should have been posted to the newsgroup instead; so if you don't get your email answered in 24 hours, post them to the newsgroup.)
  4. Do not email Prof/TA individually. We don't read those emails. By strictly enforcing the use of newsgroup and course email we can also keep track of class participation easily.
Grading homework (3): 25%, quizzes: 10%x3=30%, midterms: 15%, final project: 22%. class participation: 8%.

the 8% participation is made up of 3% in-class Q/A, 2% newsgroup/office hour participation, 3% catching/fixing bugs in class/exams/HWs and constructive suggestions (each obvious typo: 0.5%, each non-trivial bug or constructive suggestion: 1%, with a cap of 10%, i.e., if you catch 10 serious bugs your can potentially earn up to 15% (rather than the 8%) from class participation alone! (quickest way to boost your grade!)

Homework Policies
  1. homework is all about programming and you will submit to Blackboard.
  2. no plagiarism: only high-level discussions are allowed (i.e., not relating to a single line of code), and you have to declare who you discussed with.
  3. late penalty: you can turn in one HW late for up to 32 hours with no penalty. the second/third late HW will receive an automatic zero.
  4. grading: 80% correctness, 10% efficiency, and 10% style. Correctness is done in a blackbox fashion, so make sure you conform to the strict I/O specifications and pass the sample I/Os. programs which do not comply will receive an automatic zero even if the logic is completely correct.
  5. we strongly recommend that you use Linux or Mac. Windows users are not supported for technical questions; make sure your code passes sample I/O on a Linux or Mac before you submit. By default you can use the powerful linux machine cs12.cs.qc.cuny.edu.
  6. Please use Python 2.7. It is installed on cs12, and Xiuyi has created account for everybody on it with 2.7 being your default python. Do NOT use Python 3 -- it's a separate experimental branch that is not backward compatible with Python 2.x.
Exam Policies
  1. For each exam (quiz/midterm) you have two chances: the in-class one and the take-home one, the former weighing more than the latter.
  2. Exam questions are mostly fill-in-the-blanks type, but could also include some theory (e.g. complexity). Most questions are based on HW.
  3. After each exam I will give you a projected final grade, which becomes more and more accurate towards the end.
  4. Quiz 1 is on Tuesday 9/4, testing your CS background using Python. Don't worry about Python syntax, but do review datastructures (e.g., why is qsort O(nlogn)?). It'll be based on my slides and HW0. If I believe you are likely to fail in the end I'll tell you right away so that you can drop in time to receive a partial tuition refund.
  5. Each quiz and exam will be announced at least one week ahead of time. I will try my best to avoid having quizzes/exams on major religious holidays but I can not promise to accommodate all requests since they might be conflicting.

Course Plan (tentative):

  1. Python Basics (Aug-Sep)
    1. Syntax; List Comprehensions; Pythonic Style -- quiz 1
    2. Data Types (list, dict, tuple, string) -- HW 1
    3. Basic Functional Programming (map, filter, lambda)
    4. Applications: Sorting and Memoization
  2. OOP and FP (late Sep--mid Oct)
    1. Pythonic OOP -- quiz 2
    2. More on Functional Programming (reduce, iterator/generator, laziness) -- HW 2
  3. Pythonic Implementation of Classical Algorithms: (mid Oct--early Nov)
    Priority Queue and Heapsort; Dijkstra and Viterbi; Prim, Kruskal and Boruska; Tarjan and Kosaraju (SCCs); Dynamic Programming (LCS, CFG/CKY, etc) -- midterm
  4. Combining Python and C++/C/Java; Cython and numpy: (Nov) -- HW 3
  5. Python for Text and Language Processing (Dec) -- quiz 3, project

Schedule, Slides, and HWs (R==Th):

  1. T 8/28: administrativia (see above), review of data structures
  2. R 8/30: Pythonic showcase
  3. T 9/4: Quiz 1 in-class.
  4. R 9/6: Quiz 1 take-home part due. Discussions of Quiz 1. A closer look at Python. Last chance to drop with a 50% refund.
  5. T 9/11: Python syntax, lists, list comprehensions, and strings.
  6. R 9/13: memory allocation, tuples, and dictionaries. HW 1 out on 9/14: data structures, functional-style recursions, sorting and statistics.
  7. T 9/18: University holiday.
  8. R 9/20: Guest lecture by TA Kai: sets, I/O, functional programming basics, sorting.
  9. T 9/25: University holiday.
  10. R 9/27: Help on HW 1. sets from {}. sorting. memoized recursion. HW1 due on 9/28.
  11. T 10/2: Review. HW1 solutions.
  12. R 10/4: Quiz 2 (in-class). unofficial course review.
  13. T 10/9: Quiz 2 (take-home) due. Discussions of Quiz 2.
  14. R 10/11: OOP.
  15. T 10/16: OOP cont'd. operator overloading.
  16. R 10/18: OOP cont'd. BST. HW 2 out. due Fri Nov 2.
  17. T 10/23: OOP cont'd and FP. decorators.
  18. R 10/25: FP.
  19. T 10/30: Hurricane Sandy.
  20. R 11/1: Hurricane Sandy.
  21. T 11/6: Iterators/generators.
  22. R 11/8: Help with HW 2.
  23. T 11/13: Review and Discussions of HW 2.
  24. R 11/15. Midterm.
  25. T 11/20. Discussions of Midterm. Priority Queue Implementation.
  26. R 11/22. Thanksgiving.
  27. T 11/27. Dijkstra and Hashed Priority Queue Implementation. part of HW3 out. due Sat Dec 8.
  28. R 11/29. Cython.
  29. T 12/4. numpy.
  30. R 12/6. Help with HW3. Final Project Description (slides, detailed writeup).


  31. T 12/11. Discussions of HW3. Help with project.
  32. R 12/13. Quiz 3. Help with project.
Liang Huang
Last modified: Thu Dec 6 17:41:18 EST 2012