Difference between revisions of "CSC111 Class Page 2011"

From dftwiki3
Jump to: navigation, search
(Weekly Schedule)
(Weekly Schedule)
 
(220 intermediate revisions by the same user not shown)
Line 1: Line 1:
<center>[[CSC111_2011 | Main Page]] | [[CS111_Syllabus_2011 | Syllabus ]] | [[CSC111_Class_Page_2011 | Weekly Schedule ]] | [[CSC111_Class_Page_2011#Links_and_Resources | Links & Resources ]]</center>
+
<center>[[CSC111_2011 | Main Page]] | [[CS111_Syllabus_2011 | Syllabus ]] | [[CSC111_Class_Page_2011 | Weekly Schedule ]] | [[CSC111_Class_Page_2011#Links_and_Resources | Links & Resources ]] | [http://piazza.com/smith/spring2014/csc111/home Piazza]</center>
 
<br />  
 
<br />  
 
----
 
----
Line 12: Line 12:
 
Ford Hall, 356.<br />
 
Ford Hall, 356.<br />
 
Telephone: 3854<br />
 
Telephone: 3854<br />
Office hours TBA, and by appointments
+
Office hours Monday, 2-4 p.m., Tuesday 1-3 p.m., and by appointments
| width="50%" |
+
| width="30%" |
 
&nbsp;
 
&nbsp;
 
|}
 
|}
  
 
<br /><br />
 
<br /><br />
Click [http://cs.smith.edu/classwiki/index.php/CSC111_TA_Hours here] for TA hours this week.
+
To see when and where TAs are available this week, click [http://cs.smith.edu/classwiki/index.php/Computer_Science_TA_hours here].
 +
 
 +
<onlydft>
 +
Ideas for next time: http://www.pippinbarr.com/games/theartistispresent/TheArtistIsPresent.html
 +
</onlydft>
  
 
=Weekly Schedule=
 
=Weekly Schedule=
 +
  
 
{| style="width:100%" border="1"
 
{| style="width:100%" border="1"
Line 26: Line 31:
 
|'''Week''' || '''Topics''' || '''Reading'''  
 
|'''Week''' || '''Topics''' || '''Reading'''  
  
<!-- ================================================================== -->
+
 
 
|-valign="top"
 
|-valign="top"
 
|width="15%"| Week 1 <br /> 9/8  
 
|width="15%"| Week 1 <br /> 9/8  
Line 33: Line 38:
 
** A look at the syllabus
 
** A look at the syllabus
 
** Introduction to computer programming<br>
 
** Introduction to computer programming<br>
 +
** [[NicelyDocumentedProgram.py|Example]] of a Python program
 +
<videoflash>g_82xHimSNE</videoflash>
 +
** Playing with Python (an introduction to [[CSC111_Lab_1_2011 | Lab #1 ]])
 +
** [http://zetcode.com/tutorials/pythontutorial/keywords/ Python keywords]
 +
<br />
  
 
----
 
----
* [[CSC111_Lab_1_2011 | Lab #1 ]]
+
* [[CSC111_Lab_1_2011 | Lab #1 ]] and [[CSC111 Lab1 2011 Solution |Solution to the Challenges...]]
* [[CSC111_Homework_1_2011 | Homework #1]]  
 
 
||
 
||
 
* Read Chapter 1 in Zelle.
 
* Read Chapter 1 in Zelle.
 +
** Whenever there are examples in Python, try them out at your computer.
 +
** Test yourself with the Programming Exercises at the end of the chapter.
 
* Read the [http://maven.smith.edu/~jfrankli/111s08/pairProgramming2000.pdf article] on pair programming.  We will discuss it in class on Th 9/15.
 
* Read the [http://maven.smith.edu/~jfrankli/111s08/pairProgramming2000.pdf article] on pair programming.  We will discuss it in class on Th 9/15.
<!-- ================================================================== -->
+
 
 
|- style="background:#eeeeff" valign="top"
 
|- style="background:#eeeeff" valign="top"
 
| Week 2 <br /> 9/13<br />
 
| Week 2 <br /> 9/13<br />
 
||
 
||
 
* '''Tuesday'''
 
* '''Tuesday'''
 +
** 5 minutes with Guido von Rossum
 +
<br />
 +
 +
 +
{{#widget:Google Video
 +
|docid=-7758421725489622662
 +
|width=400
 +
|height=326
 +
}}
 +
 +
<br />
 +
 +
 +
** A word about semantics: a look back at the challenge solutions for [[CSC111_Lab_1_2011 | Lab #1 ]]
 +
** A variable is just a way to name a memory location...
 +
** Rules for naming variables
 +
** [[CSC111 Temperature Conversion Program | Temperature conversion program. ]]
 +
<br />
 
* '''Thursday'''
 
* '''Thursday'''
 +
** Quiz (2 questions) on  [http://maven.smith.edu/~jfrankli/111s08/pairProgramming2000.pdf article] on pair programming.
 +
<center><videoflash>Fs1auRWlOvw</videoflash></center>
 +
** Overview of  [[CSC111 HW 1 2011| Homework #1]]
 +
** New tools!
 +
*** '''Beowulf''' and '''Emmy''': Linux servers
 +
*** Secure Shell Access ('''ssh''')
 +
*** '''Emacs''': an editor for programmers
 +
** Syntax and Semantic
 +
** Exploring '''functions'''
 +
*** A function for greeting the user
 +
*** The main function
 +
** Assignment statement: e.g. ''a = 3'', or ''a, b = 10, 20''
 +
*** what really goes on inside the computer
 +
*** multiple assignments on one line
 +
** Discussion of  [http://maven.smith.edu/~jfrankli/111s08/pairProgramming2000.pdf article] on  pair programming[[Notes on Pair Programming|.]]
 +
<br />
 +
* '''Friday'''
 +
** Computer Science lunch.  "What we did last summer'': CS Majors share their experience of the past summer.  Informal gathering with '''free food''', Ford Hall 345, 12:00-1:00 p.m.
 
----
 
----
* Lab 2, HW 2
+
* [[CSC111 Lab 2 2011 | Lab 2]], and [[CSC111 Lab 2 solutions 2011| solutions to the challenges]], [[CSC111 HW 1 2011| HW 1]] and [[CSC111 HW 1 Solutions 2011 | Solution programs for HW 1]]
 
||
 
||
 
* Reading
 
* Reading
 +
** We're starting on Tuesday with material from Chapter 2.  In particular understanding variables and assignments, and the temperature conversion program.
 +
  
<!-- ================================================================== -->
 
 
|- style="background:#ffffff" valign="top"
 
|- style="background:#ffffff" valign="top"
 
| Week 3 <br /> 9/20<br />
 
| Week 3 <br /> 9/20<br />
 
||
 
||
 
* '''Tuesday'''
 
* '''Tuesday'''
 +
** Getting to know [http://python.org/ python.org]
 +
*** [http://docs.python.org/py3k/ Python 3 Documentation]
 +
*** ''Built-In Functions''
 +
** Processor and Memory: understanding bits, characters, and numbers.
 +
** Review of the '''print''' statement.  [[CSC111 Print Exercises | Exercises]]
 +
** [[CSC111 Block and Loop Exercises | Exercises on Blocks and Loops]].  The concept of ''scope''.
 +
<br />
 
* '''Thursday'''
 
* '''Thursday'''
 +
** Continuation of [[CSC111 Print Exercises | Exercises]] on print statements.
 +
** [[CSC111 Block and Loop Exercises | Exercises on Blocks and Loops]]. 
 +
** The concept of ''scope''.
 +
** Multiple assignment
 
----
 
----
* Lab 3, HW 3
+
* [[CSC111 Lab 3 2011| Lab #3]] and [[CSC111_Lab_3_2011_Solutions|solutions to the challenges]], [[CSC111 Homework 2 2011| Hw #2]] and [[CSC111 Homework 2 Solutions 2011| Solution programs]]
 
||
 
||
 
* Reading
 
* Reading
 +
* On Tuesday we'll cover some material from Sections 2.5 (assignment) and 2.6 (definite loops) in Zele.
  
<!-- ================================================================== -->
 
 
|- style="background:#eeeeff" valign="top"
 
|- style="background:#eeeeff" valign="top"
 
| Week 4 <br /> 9/27<br />
 
| Week 4 <br /> 9/27<br />
 
||
 
||
 
* '''Tuesday'''
 
* '''Tuesday'''
 +
** Q&A About current homework
 +
** Top-Down design Exercise:
 +
*** A detailed look at the approach taken to solve a [[CSC111 A Form Generator Program|complex assignment.]]
 +
*** Debugging techniques (print statements, comments)
 +
** Some comments about the last homework assignment
 +
*** Solutions posted (BOTW)
 +
*** Header
 +
*** Documentation
 +
*** Wrap long lines
 +
<br />
 
* '''Thursday'''
 
* '''Thursday'''
 +
** How to cut Python lines: Rules
 +
** An introduction to nested loops.
 +
** Return to the  [[CSC111 A Form Generator Program|complex assignment]] of Tuesday: a look at nested loops.
 +
** [[CSC111 Nested-Loop Exercises | Some exercises on nested loops]] and [[CSC111 Nested-Loop Exercise Solutions| solutions]]
 +
** [http://www.imdb.com/title/tt0182789/ The Bicentennial Man]...
 +
<center><videoflash>BWMM9Dz_rFs</videoflash><br />(Advance video to 7-minute point and watch...)</center>
 +
 
----
 
----
* Lab 4, HW 4
+
* [[CSC111 Lab 4 2011|Lab #4]] and [[CSC111 Lab 4 Solution Programs| solution programs]], [[CSC111 Homework 3 2011 | HW #3]] and [[CSC111 Homework 3 Solution Programs 2011 | Solution Programs]]
 
||
 
||
* Reading
+
* Reading:
 +
* Read Chapter 3 in Zelle on your own.  Instead of covering the information of this chapter in a class, we'll visit this information throughout the semester as we progress with Python.
 +
* Important concepts from Chapter 3:
 +
** the math functions (abs, round), and
 +
** the fact that mixing integers and floats always yields a float result.
 +
** math operators: /, //, % (remainder)
 +
 
 +
 
  
<!-- ================================================================== -->
 
 
|- style="background:#ffffff" valign="top"
 
|- style="background:#ffffff" valign="top"
 
| Week 5 <br /> 10/4<br />
 
| Week 5 <br /> 10/4<br />
 
||
 
||
 +
[[Image:TaxiCabCSC111.png|right|150px]]
 
* '''Tuesday'''
 
* '''Tuesday'''
 +
** Understanding Python modules and syntax for using them
 +
** Graphics and Object Oriented Programming
 +
** Get the [[CSC111 Zelle graphics.py Python 3|graphics.py]] library from [http://mcsp.wartburg.edu/zelle/python/ http://mcsp.wartburg.edu/zelle/python/]
 +
[[Image:blueprint.jpg|right|150px]]
 +
** The concept of classes and objects
 +
** Encapsulating data and actions in objects
 +
<br />
 +
[[File:GraphicsCartesianSystem.gif]]
 +
<br />
 +
** Cartesian system
 +
** Graphics primitives: GraphWin, Text, Point, Rectangle, Circle, Line.
 +
** Standard methods: draw(), setWidth(), setFill(), close()
 +
** Where can I get documentation on all of the Classes and Methods?  [http://mcsp.wartburg.edu/zelle/python/graphics/graphics/index.html here!]
 +
** Playing with graphics objects: [[CSC111 First Graphics Demo Program|Demo program]] (A [http://incompetech.com/graphpaper/plain/ good place] for printing graph paper.)
 
* '''Thursday'''
 
* '''Thursday'''
 +
** [[Media:GraphicsClassesAndMethods.pdf| Handout]] on classes and methods defined in graphics.py
 +
** Continuation of exploration of graphics primitives
 +
** Point, Circle, Line, Rectangle, Text
 +
** Taxi Example
 
----
 
----
* Lab 5, HW 5
+
[[Image:CSC111MusicalScore.png|right|100px|A submitted solution]]
 +
* [[CSC111 Lab 5 2011|Lab #5]] and [[CSC111 lab 5 Solution Programs 2011|solution programs]], [[CSC111 Homework 4 2011| Homework 4]] and [[CSC111 Homework 4 Solutions 2011| Solution Programs]]
 
||
 
||
 
* Reading
 
* Reading
<!-- ================================================================== -->
+
** Chapter 4 on Graphics
 +
 
 
|- style="background:#eeeeff" valign="top"
 
|- style="background:#eeeeff" valign="top"
 
| Week 6 <br /> 10/11<br />
 
| Week 6 <br /> 10/11<br />
 
||
 
||
 
* <font color="magenta">'''Tuesday''': <b> Fall Break</b></font>
 
* <font color="magenta">'''Tuesday''': <b> Fall Break</b></font>
 +
<br />
 +
<center>
 +
[[Image:CalvinDancing.gif]]
 +
</center>
 +
[[Image:CalvinStudies.jpg|100px|right]]
 +
<br />
 
* '''Thursday'''
 
* '''Thursday'''
 +
** Pixelating George Clooney...
 +
*** A quick word about the [http://en.wikipedia.org/wiki/RGB_color_model RGB] color model.  Check out this nice [http://www.youtube.com/watch?v=2-stCNB8jT8 video] on YouTube as well...
 +
*** The Image( Point, fileName ) objects
 +
*** The color_rgb( ) and getPixel( x, y ) functions
 +
*** Result: we go from
 +
<br />[[Image:Clooney.gif|200px]]
 +
to [[Image:ClooneyPixelated.png|200px]]
 +
<br />
 +
*** [[CSC111 Pixelating Clooney| Pixelating Program]]
 +
** [[CSC111 Dot Notation and Objects| Exercise with dot notations for objects.]]
 +
** New string methods: See [http://docs.python.org/py3k/library/stdtypes.html?highlight=capitalize#str.capitalize python.org] for the complete list: center(), upper(), lower(), split() (see this week's lab for more!)
 +
** Reviewing using indexes with lists: [[CSC111 Exercises on Strings and Lists Indexes| Exercises]]
 +
 
----
 
----
* Lab 6, HW 6
+
* [[CSC111 Lab 6 2011 | Lab 6]] and [[CSC111 Lab 6 Solution Programs 2011| Solution Programs]]
 
||
 
||
 
* Reading
 
* Reading
<!-- ================================================================== -->
+
 
 
|- style="background:#ffffff" valign="top"
 
|- style="background:#ffffff" valign="top"
 
| Week 7 <br /> 10/18<br />
 
| Week 7 <br /> 10/18<br />
 
||
 
||
* '''Tuesday'''
+
* '''Tuesday: <font color=Magenta>Midterm Exam</font>''' ([[CSC111 Midterm Preparation| preparation page with various typical questions]])
 +
** in class
 +
** closed books
 +
** closed computers
 
* '''Thursday'''
 
* '''Thursday'''
 +
** [[CSC111 Exercises with If-Statements | Exercises with ''IF statements'']]
 +
** [[CSC111 Games around Functions | Functions: Games]]
 +
** [[CSC111 Exercises with functions | Exercises with Functions]]
 
----
 
----
* Lab 7, HW 7
+
* [[CSC111 Lab 7 2011| Lab #7]] and [[CSC111 Lab7 Solution Programs 2011|Solution Programs]], [[CSC111 Homework 5 2011| Homework #5]] and [[CSC111 Homework 5 Solution 2011 | solution program and sample pictures]]
 
||
 
||
 
* Reading
 
* Reading
 
+
** If statements are covered in Chapter 7
 +
** Functions are covered in Chapter 6
 +
** [http://anh.cs.luc.edu/python/hands-on/3.1/handsonHtml/ifstatements.html  A good reference on ''if'' statements]
 +
 
|}
 
|}
  
 
+
=Second Half=
  
 
{| style="width:100%" border="1"
 
{| style="width:100%" border="1"
Line 115: Line 246:
 
|width="60%"|
 
|width="60%"|
 
* '''Tuesday'''
 
* '''Tuesday'''
 +
[[Image:SusanElliott.jpg|right|100px]]
 +
* Welcome to our visitor: Susan S. Elliott, Founder & Chair, SSE, Inc., and author, ''Across the Divide: Navigating the Digital Revolution as a Woman, Entrepreneur and CEO.''
 +
* Turing and the Turing Test
 +
<br />
 +
<center><videoflash>gV67Sj2jkVg</videoflash></center>
 +
<br />
 +
* [http://en.wikipedia.org/wiki/Loebner_Prize The Loebner Prize]
 +
* And the [http://www.i-programmer.info/news/105-artificial-intelligence/3234-rosette-wins-loebner-prize-2011.html winner for 2011] is: Rosette
 +
* Introduction to [http://labs.telltalegames.com/rosette/ Rosette], the ''chatbot/chatterbot''.
 +
* Python
 +
** loops: Review the '''break''' statement, and meet a new statement: '''continue'''
 +
** '''in''' as an operator returning ''true'' or ''false'': if x in [ 1, 2, 4, 10, 20]: ...
 +
** [[Exercises on break and continue, in | Exercises]]
 +
** Eliza (demo with emacs:  hold shift and hit the escape key. Then type '''xdoctor''' and hit return)
 +
* Want to learn more about chatbots?  Check out this [http://www.chatbots.org/chatbot/ page]!
 +
* '''Wednesday''': <font color="magenta">Presentation of the CS Major</font>, 12:00 p.m., FH241.
 
* '''Thursday'''
 
* '''Thursday'''
 +
** building a chatbot similar to Eliza
 +
** something to start with: get the demo program from [[Lab 8 2011|Lab 8]].
 +
** introducing randomness in picking answers
 +
** know how to stop the conversation
 +
** Detect family members
 +
** Detect short negative answers
 +
** reflection
 +
*** reflect "I" into "you", as in "I am bored" becoming "You are bored?"
 +
*** reflect "I" into "you" and "you" into "I": tricky!
 +
** How can we make Eliza remember past answers from the user?
 +
** [[CSC111 Eliza Class program| program we developed in class]]
 
----
 
----
* Lab 8, HW 8
+
* [[Lab 8 2011|Lab 8]] and [[CSC111 Eliza Class program| solution programs]], [[Homework 6 2011| Homework 6]], and [[CSC111 Homework 6 Solution Programs 2011| Solution Programs]]
 
||
 
||
 
* Reading
 
* Reading
  
<!-- ================================================================== -->
+
 
 
|- style="background:#eeeeff" valign="top"
 
|- style="background:#eeeeff" valign="top"
 
| Week 9 <br /> 11/1<br />
 
| Week 9 <br /> 11/1<br />
 
||
 
||
 
* '''Tuesday'''
 
* '''Tuesday'''
 +
** A better AI Example: Watson!<br /><videoflash>yJptrlCVDHI</videoflash><br />
 +
** A note about HW #5: Dealing with multiple objects: Lists and Loops.  [[CSC111 List of Objects| An example program]]
 +
** Slicing strings and lists.
 +
** Functions returning values.  [[CSC111 Exercises on Functions Returning Values | Exercises]]
 +
<br />
 
* '''Thursday'''
 
* '''Thursday'''
 +
** Functions returning values.  [[CSC111 Exercises on Functions Returning Values | Exercises]]
 +
* [http://www.engadget.com/2011/11/02/stanford-program-cracks-text-based-captchas-shelters-the-replic/ captchas]
 +
* [http://infohost.nmt.edu/tcc/help/pubs/lang/pytut/str-format.html examples of %-formatting]
 
----
 
----
* Lab 9, HW 9
+
* [[CSC111 Lab 9 2011 | Lab 9]], [[CSC111 Homework 7  2011| HW 7]] and [[CSC111 Homework 7 Solution 2011| Original Program]] you had to recreate.
 
||
 
||
 
* Reading
 
* Reading
 +
** Slicing of strings is covered in Chapter 5.  Slicing of lists works exactly the same way, and is covered in Section 11.2.
 +
** Functions returning values are covered in Section 6.5.1.
 +
** Read section 6.6
  
<!-- ================================================================== -->
 
 
|- style="background:#ffffff" valign="top"
 
|- style="background:#ffffff" valign="top"
 
| Week 10 <br /> 11/8<br />
 
| Week 10 <br /> 11/8<br />
 
||
 
||
 
* '''Tuesday'''
 
* '''Tuesday'''
* <font color="magenta">'''Thursday''': '''Othelia Cromwell Day''' (no labs) </font>
+
** A [[CSC111 surprising behavior| surprising behavior]]...
 +
** Using [[CSC111 Text File Example| '''text files''']] exercises illustrating the concept.
 +
** [[CSC111 Playing with Text Files| Reading and writing text files]]: Revisiting earlier programs (presidents + Eliza)
 +
** Disks <br /><videoflash>uJKxUPlhvZY</videoflash><br />
 +
::(The disk is opened around the 4-minute time marker, power up around 5 min 30 sec., and read errors show up around 7 min.)
 +
** SSD vs. HDD ([http://www.youtube.com/watch?v=pJMGAdpCLVg YouTube video] -- go to 2 min 30 sec for dramatic vibration test)
 +
* <font color="magenta">'''Thursday''': '''Otelia Cromwell Day''' (no labs) </font>
 +
** '''Exceptions''': try/except.  [[CSC111 Exercises with Exceptions: try/except| Exercises]]
 +
** The '''While''' loop: the ''indefinite'' loop
 +
*** The syntax and how it works
 +
*** Transforming for-loops in while loops (not very useful, but illustrates well how while loops work)
 +
*** Sentinel loops (looping through numbers, looping through strings)
 +
*** Computation until some quantity reaches some value
 +
*** Making user input robust (keep on asking for something until it is one of the expected values)
 +
*** Infinite loops (while ''True'')
 +
*** '''Boolean''' variables
 +
*** [[CSC111 While Loop Exercises| Exercises]]
 +
 
 
----
 
----
* Lab 10, HW 10
+
* [[CSC111 Lab 10 2011| Lab 10]], [[CSC111 Homework 8 2011 | Homework 8]] and [[CSC111 Homework 8 Solution 2011| solution program]]
 
||
 
||
 
* Reading
 
* Reading
 +
** Exceptions: Section 7.4
 +
** Passing objects: Chapter 6 on Functions
 +
** Text file processing: Section 5.9
 +
** While loops: Chapter 8
  
<!-- ================================================================== -->
 
 
|- style="background:#eeeeff" valign="top"
 
|- style="background:#eeeeff" valign="top"
 
| Week 11 <br /> 11/15<br />
 
| Week 11 <br /> 11/15<br />
 
||
 
||
 +
[[Image:8queens.png|right|100px]]
 
* '''Tuesday'''
 
* '''Tuesday'''
 +
** A note about the current ''best 1000 movies'' homework:
 +
*** make sure program does not crash if input file does not exist
 +
*** Test, test, test!  The movie 2001 came out in 1968...
 +
** Continuation of While Loops.
 +
*** Breaking/Continuing from nested while loops
 +
*** '''Boolean''' variables
 +
*** [[CSC111 While Loop Exercises| Exercises]]
 +
 
* '''Thursday'''
 
* '''Thursday'''
 +
[[Image:BenFranklin.jpg|150px|right]]
 +
** Breaking out of double loops: break and continue only work with inner loops [[CSC111 Breaking-out-of-Loop Exercises | Example]] ( and [[CSC111_Lab_11_Solution_Programs_2011|solution programs]]).
 +
** Review of good practices for this class
 +
**# Read the sections in the textbook that cover the material we see in class
 +
**# Look at the solution programs!  There's a reason why they are posted!
 +
**# Redo the exercises we do in class.  Try to come up with the solution on your own.
 +
**# Remember [[Benjamin Franklin's Writing Style| Benjamin Franklin]]
 +
** Exceptions: Difference between '''NameError''' and '''TypeError''': http://docs.python.org/library/exceptions.html
 +
** Top-Down Design: Putting N-Queens on an NxN chessboard.  This is the first step of a more complex problem we'll revisit later and which deals with the [[CSC111 NQueens.py|N-Queens problem]].
 +
*** [[CSC111 Draw Chessboard: Rough Solution | Program ]] we created in class.
 +
*** 1 solution for an 8x8 chessboard: [3, 6, 2, 7, 1, 4, 0, 5]
 +
** An introduction to Homework 9's two problems:
 +
*** Average presidency: a rehash of an almost-ready solution
 +
*** Elevator to the Stars: revisiting old solutions with a bit of ingenuity (algorithm)
 
----
 
----
* Lab 11, HW 11
+
* [[CSC111 Lab 11 2011 | Lab 11]], and [[CSC111 Lab 11 Solution Programs 2011| Solution Programs]]
 +
* [[CSC111 Homework 9 2011 |Homework 9]] and [[CSC111 Homework 9 Solutions 2011| solution programs]]
 
||
 
||
 
* Reading
 
* Reading
 +
** Top-Down design rules are covered in Section 9.3
 +
** Common loop patterns are covered in Section 8.3
  
  
<!-- ================================================================== -->
 
 
|- style="background:#ffffff" valign="top"
 
|- style="background:#ffffff" valign="top"
 
| Week 12<br /> 11/22<br />
 
| Week 12<br /> 11/22<br />
 
||
 
||
 +
[[File:AlmostTheTruth.jpg|right|150px]]
 
* '''Tuesday'''
 
* '''Tuesday'''
 +
** [[CSC111 And now, something completely different| And now, something completely different]]
 +
** [http://processing.org/ Processing], created by Casey Reas and Benjamin Fry, at MIT.
 +
*** Overview, Examples
 +
*** Programming: [[Simple Game of Pong| a game of pong]]...
 +
 
*<b><font color="magenta"> '''Thursday''':  Thanksgiving Break</font></b>
 
*<b><font color="magenta"> '''Thursday''':  Thanksgiving Break</font></b>
 
----
 
----
*  
+
* [[CSC Make-up Homework 8 2011 | Make-up Homework 8]]
 
||
 
||
 
* Reading
 
* Reading
  
<!-- ================================================================== -->
+
 
 
|- style="background:#eeeeff" valign="top"
 
|- style="background:#eeeeff" valign="top"
 
| Week 13 <br /> 11/29<br />
 
| Week 13 <br /> 11/29<br />
 
||
 
||
 
* '''Tuesday'''
 
* '''Tuesday'''
 +
[[File:TaxiCabCSC111.png|100px|right]]
 +
** <font color="red">Office Hours today: 2:30 p.m. - 5:00 p.m.</font>
 +
** OOP with Classes!
 +
** A review and an introduction: review objects, introduce classes.
 +
** OOP and graphics
 +
** Programming Example with Classes: [[CSC111 A class for a simple car | A class for a car]]
 +
 +
* [[Image:fish0.gif|right]] '''Thursday'''
 +
** Several examples with classes:
 +
***Cars and Trees... [[CSC111 Car and Trees program|Program written in class]]
 +
*** Fish in a tank... (list of fish available [[Fish for an Aquarium|here]])
 +
** [http://mcsp.wartburg.edu/zelle/python/graphics/graphics.pdf Zelle's graphics reference]] (something handy to have around...)
 +
<center><videoflash>Ye3nuq07vq0</videoflash><br />(Advance to 2 min 10 sec)</center>
 +
 +
----
 +
* [[CSC111 Homework 10 2011| Homework 10]]
 +
* [[CSC111 Lab 12 2011| Lab 12 ]] and [[CSC111 Lab 12 Solution Program Part 1| Solution program]]
 +
||
 +
* Reading
 +
** Classes are covered in Chapter 10 of the textbook.
 +
 +
|- style="background:#ffffff" valign="top"
 +
| Week 14<br /> 12/6<br />
 +
||
 +
* '''Tuesday'''
 +
** <font color="red">Office Hours today: 2:30 p.m. - 5:00 p.m.</font>
 +
** Discussion: how to create simple animation based on the fish animation:  Look at work by [http://en.wikipedia.org/wiki/Eadweard_Muybridge Eadweard Muybridge].
 +
<center><videoflash>oGRTEjTzgBc</videoflash></center><br />
 +
** More interesting videos on YouTube if you search for Eadweard Muybridge (1830-1904), a pioneer of the capture of animal locomotion through photography...
 +
** [[CSC111 Animating A Stick Figure | Animating a stick figure]]
 +
** [http://blog.insicdesigns.com/2011/05/cinemagraph-jaw-dropping-sample-of-animated-photographs/ Animated Photographs...]<br />
 +
<center>[[Image:AnimatedDogPhoto.gif]]</center><br />
 +
** Creating a python module
 +
** Using a python module
 
* '''Thursday'''
 
* '''Thursday'''
 +
** [[CSC111 Exercises on Writing Classes| Exercises]] (only last exercise) [[CSC111 Class Exercise Sketch| (What we did in class)]]
 +
** [[CSC111 Blinking Light Example| Blinking Light]]: objects that have their own "behavior" and state
 +
 +
----
 +
* [[CSC111 Lab 13 2011| Lab 13 ]]
 +
* [[CSC111 Homework 11 2011| Homework 11]] and [[CSC111 Homework 11 solution| solution program]]
 +
* A sample of the scenes created for this week's assignment:
 +
[[Image:blinking1.png|150px]][[Image:blinking2.png|150px]][[Image:blinking3.png|150px]]
 +
||
 +
* Reading
 +
** Inheritance is covered in Section 12.4 of the textbook.
 +
** Dictionaries are covered in Section 11.6, ''Non-Sequential Collections''
 +
 +
|- style="background:#eeeeff" valign="top"
 +
| Week 15 <br /> 12/13<br />
 +
||
 +
* '''Tuesday'''
 +
** Advanced Topic 1: The concept of class ''Inheritance'': [[CSC111 Example of Inheritance: Rectangle with a label| Example]]
 +
** Advanced Topic 2: '''Dictionaries'''. A hands on introduction can be found [[CSC111_Lab_12_2010 | here]].  And here's an [[CSC111 Counting Frequencies of Occurrence| example for counting the frequency of occurrence of words or letters in a text]]
 +
*** [[CSC111_Lab_12_2010#Known_Character_Frequencies_for_different_languages | Letter frequencies for various languages]]
 +
*** Practicing with dictionaries: [[CSC111 How cold is it in England?| How cold is it in England?]]
 +
*** [[CSC111 Cold England 2 | Program we did in class]]
 +
 +
* '''Thursday''': <font color="magenta">'''Final Take-Home Exam'''</font>, will be due '''12/22/11 at 4:00 p.m.'''
 
----
 
----
*  
+
* [[CSC111_Final_Exam_2011| Final Exam]]
 +
* [[CSC111 Lab 14 2011| Lab 14 ]]
 
||
 
||
 
* Reading
 
* Reading
 +
|}
 +
 +
=Links and Resources=
 +
==Graphics Library==
 +
[[File:TaxiCabCSC111.png|right|150px]]
 +
* [http://mcsp.wartburg.edu/zelle/python/ Download] the graphics library
 +
* [http://mcsp.wartburg.edu/zelle/python/graphics/graphics/index.html Documentation] for Zelle's graphics library.
 +
<br />
 +
 +
<br />
  
|}
+
<br />
 +
 
 +
==On Line Python books==
  
<onlydft>
+
* [http://blogs.discovermagazine.com/cosmicvariance/2011/09/08/python/ disocovermagazine.com] blog.  Check out the answers posted by many readers.  They contain some interesting links that you may find useful!
[http://maven.smith.edu/~thiebaut/classes/111/index_old.html 111]
 
</onlydft>
 
  
=Links and Resources=
 
 
==Python keywords==
 
==Python keywords==
  
Line 206: Line 493:
  
 
==Software==
 
==Software==
 +
 
* Installing and using the [http://www.smith.edu/its/tara/file_transfer/ssh_sftp.html#installing Secure Shell Client] on a Windows PC[http://cs.smith.edu/~thiebaut/classes/111/SecureShell/ .]
 
* Installing and using the [http://www.smith.edu/its/tara/file_transfer/ssh_sftp.html#installing Secure Shell Client] on a Windows PC[http://cs.smith.edu/~thiebaut/classes/111/SecureShell/ .]
 
    
 
    
Line 211: Line 499:
  
 
==Math==
 
==Math==
 +
 
* [[Media:powersOfTwo.pdf | Powers of 2]]
 
* [[Media:powersOfTwo.pdf | Powers of 2]]
 
<br>
 
<br>

Latest revision as of 15:47, 19 January 2015

Main Page | Syllabus | Weekly Schedule | Links & Resources | Piazza




Prof and TAs

Dominique Thiébaut email
Dept. Computer Science
Ford Hall, 356.
Telephone: 3854
Office hours Monday, 2-4 p.m., Tuesday 1-3 p.m., and by appointments

 



To see when and where TAs are available this week, click here.


...


Weekly Schedule

Week Topics Reading


Week 1
9/8
  • Thursday
    • A look at the syllabus
    • Introduction to computer programming
    • Example of a Python program



  • Read Chapter 1 in Zelle.
    • Whenever there are examples in Python, try them out at your computer.
    • Test yourself with the Programming Exercises at the end of the chapter.
  • Read the article on pair programming. We will discuss it in class on Th 9/15.
Week 2
9/13
  • Tuesday
    • 5 minutes with Guido von Rossum



{{#widget:Google Video

docid=-7758421725489622662 width=400 height=326

}}




  • Thursday
    • Quiz (2 questions) on article on pair programming.
    • Overview of Homework #1
    • New tools!
      • Beowulf and Emmy: Linux servers
      • Secure Shell Access (ssh)
      • Emacs: an editor for programmers
    • Syntax and Semantic
    • Exploring functions
      • A function for greeting the user
      • The main function
    • Assignment statement: e.g. a = 3, or a, b = 10, 20
      • what really goes on inside the computer
      • multiple assignments on one line
    • Discussion of article on pair programming.


  • Friday
    • Computer Science lunch. "What we did last summer: CS Majors share their experience of the past summer. Informal gathering with free food, Ford Hall 345, 12:00-1:00 p.m.

  • Reading
    • We're starting on Tuesday with material from Chapter 2. In particular understanding variables and assignments, and the temperature conversion program.


Week 3
9/20



  • Reading
  • On Tuesday we'll cover some material from Sections 2.5 (assignment) and 2.6 (definite loops) in Zele.
Week 4
9/27
  • Tuesday
    • Q&A About current homework
    • Top-Down design Exercise:
      • A detailed look at the approach taken to solve a complex assignment.
      • Debugging techniques (print statements, comments)
    • Some comments about the last homework assignment
      • Solutions posted (BOTW)
      • Header
      • Documentation
      • Wrap long lines



(Advance video to 7-minute point and watch...)

  • Reading:
  • Read Chapter 3 in Zelle on your own. Instead of covering the information of this chapter in a class, we'll visit this information throughout the semester as we progress with Python.
  • Important concepts from Chapter 3:
    • the math functions (abs, round), and
    • the fact that mixing integers and floats always yields a float result.
    • math operators: /, //, % (remainder)


Week 5
10/4
TaxiCabCSC111.png
Blueprint.jpg
    • The concept of classes and objects
    • Encapsulating data and actions in objects


GraphicsCartesianSystem.gif

    • Cartesian system
    • Graphics primitives: GraphWin, Text, Point, Rectangle, Circle, Line.
    • Standard methods: draw(), setWidth(), setFill(), close()
    • Where can I get documentation on all of the Classes and Methods? here!
    • Playing with graphics objects: Demo program (A good place for printing graph paper.)
  • Thursday
    • Handout on classes and methods defined in graphics.py
    • Continuation of exploration of graphics primitives
    • Point, Circle, Line, Rectangle, Text
    • Taxi Example

A submitted solution
  • Reading
    • Chapter 4 on Graphics
Week 6
10/11
  • Tuesday: Fall Break


CalvinDancing.gif

CalvinStudies.jpg


  • Thursday
    • Pixelating George Clooney...
      • A quick word about the RGB color model. Check out this nice video on YouTube as well...
      • The Image( Point, fileName ) objects
      • The color_rgb( ) and getPixel( x, y ) functions
      • Result: we go from


Clooney.gif to ClooneyPixelated.png


  • Reading
Week 7
10/18

Second Half

Week Topics Reading
Week 8
10/25
  • Tuesday
SusanElliott.jpg
  • Welcome to our visitor: Susan S. Elliott, Founder & Chair, SSE, Inc., and author, Across the Divide: Navigating the Digital Revolution as a Woman, Entrepreneur and CEO.
  • Turing and the Turing Test



  • The Loebner Prize
  • And the winner for 2011 is: Rosette
  • Introduction to Rosette, the chatbot/chatterbot.
  • Python
    • loops: Review the break statement, and meet a new statement: continue
    • in as an operator returning true or false: if x in [ 1, 2, 4, 10, 20]: ...
    • Exercises
    • Eliza (demo with emacs: hold shift and hit the escape key. Then type xdoctor and hit return)
  • Want to learn more about chatbots? Check out this page!
  • Wednesday: Presentation of the CS Major, 12:00 p.m., FH241.
  • Thursday
    • building a chatbot similar to Eliza
    • something to start with: get the demo program from Lab 8.
    • introducing randomness in picking answers
    • know how to stop the conversation
    • Detect family members
    • Detect short negative answers
    • reflection
      • reflect "I" into "you", as in "I am bored" becoming "You are bored?"
      • reflect "I" into "you" and "you" into "I": tricky!
    • How can we make Eliza remember past answers from the user?
    • program we developed in class

  • Reading


Week 9
11/1
  • Tuesday
    • A better AI Example: Watson!

    • A note about HW #5: Dealing with multiple objects: Lists and Loops. An example program
    • Slicing strings and lists.
    • Functions returning values. Exercises



  • Reading
    • Slicing of strings is covered in Chapter 5. Slicing of lists works exactly the same way, and is covered in Section 11.2.
    • Functions returning values are covered in Section 6.5.1.
    • Read section 6.6
Week 10
11/8
(The disk is opened around the 4-minute time marker, power up around 5 min 30 sec., and read errors show up around 7 min.)
    • SSD vs. HDD (YouTube video -- go to 2 min 30 sec for dramatic vibration test)
  • Thursday: Otelia Cromwell Day (no labs)
    • Exceptions: try/except. Exercises
    • The While loop: the indefinite loop
      • The syntax and how it works
      • Transforming for-loops in while loops (not very useful, but illustrates well how while loops work)
      • Sentinel loops (looping through numbers, looping through strings)
      • Computation until some quantity reaches some value
      • Making user input robust (keep on asking for something until it is one of the expected values)
      • Infinite loops (while True)
      • Boolean variables
      • Exercises

  • Reading
    • Exceptions: Section 7.4
    • Passing objects: Chapter 6 on Functions
    • Text file processing: Section 5.9
    • While loops: Chapter 8
Week 11
11/15
8queens.png
  • Tuesday
    • A note about the current best 1000 movies homework:
      • make sure program does not crash if input file does not exist
      • Test, test, test! The movie 2001 came out in 1968...
    • Continuation of While Loops.
      • Breaking/Continuing from nested while loops
      • Boolean variables
      • Exercises
  • Thursday
BenFranklin.jpg
    • Breaking out of double loops: break and continue only work with inner loops Example ( and solution programs).
    • Review of good practices for this class
      1. Read the sections in the textbook that cover the material we see in class
      2. Look at the solution programs! There's a reason why they are posted!
      3. Redo the exercises we do in class. Try to come up with the solution on your own.
      4. Remember Benjamin Franklin
    • Exceptions: Difference between NameError and TypeError: http://docs.python.org/library/exceptions.html
    • Top-Down Design: Putting N-Queens on an NxN chessboard. This is the first step of a more complex problem we'll revisit later and which deals with the N-Queens problem.
      • Program we created in class.
      • 1 solution for an 8x8 chessboard: [3, 6, 2, 7, 1, 4, 0, 5]
    • An introduction to Homework 9's two problems:
      • Average presidency: a rehash of an almost-ready solution
      • Elevator to the Stars: revisiting old solutions with a bit of ingenuity (algorithm)

  • Reading
    • Top-Down design rules are covered in Section 9.3
    • Common loop patterns are covered in Section 8.3


Week 12
11/22
AlmostTheTruth.jpg
  • Thursday: Thanksgiving Break

  • Reading


Week 13
11/29
  • Tuesday
TaxiCabCSC111.png
    • Office Hours today: 2:30 p.m. - 5:00 p.m.
    • OOP with Classes!
    • A review and an introduction: review objects, introduce classes.
    • OOP and graphics
    • Programming Example with Classes: A class for a car

(Advance to 2 min 10 sec)

  • Reading
    • Classes are covered in Chapter 10 of the textbook.
Week 14
12/6
  • Tuesday
    • Office Hours today: 2:30 p.m. - 5:00 p.m.
    • Discussion: how to create simple animation based on the fish animation: Look at work by Eadweard Muybridge.

AnimatedDogPhoto.gif


Blinking1.pngBlinking2.pngBlinking3.png

  • Reading
    • Inheritance is covered in Section 12.4 of the textbook.
    • Dictionaries are covered in Section 11.6, Non-Sequential Collections
Week 15
12/13
  • Thursday: Final Take-Home Exam, will be due 12/22/11 at 4:00 p.m.

  • Reading

Links and Resources

Graphics Library

TaxiCabCSC111.png




On Line Python books

  • disocovermagazine.com blog. Check out the answers posted by many readers. They contain some interesting links that you may find useful!

Python keywords

The list of all the reserved words of the Python language
and del for is raise assert elif from lambda return break else global not try class except if or while continue exec import pass yield def finally in print

Linux

Misc

  • If you decide to work in pairs for the homework assignments, you need to follow the protocol for 'pair programming' as discussed in this article.
  • All the programs of Zelle's Python textbook

Software

  • Using SSH on Windows, Linux, or on a Mac with OS X

Math









Back To Main Page