Dec-04: There is a strange issue with reading and writing text files with Python that may affect your encrypt/decrypt code for Project 3 in a small and subtle way. It requires a little explanation, so bear with me:
The character \n\ is known as the newline character, and it's represented (inside of Python) as character #10. Meanwhile, \r is the carriage return character, and it's represented as character #13. Annoyingly, these characters are used differently by different operating systems to represent the end of a line of text in a file. To whit:
This discrepency is silly, but everyone just lives with it. To help work around the issue, Python tries to automatically convert any instances of two of these into the third, which it considered "preferred". But for us, characters are just characters, and we don't want Python messing with them (especially when they're the result of encryption, and the usual sense of an "end of a line" has been jettisoned). Its conversion can prevent a decrypted result from exactly matching the original encryption for one particular character (usually \r).
How do you fix this problem? By telling Python to knock it off when you open the files that you want to read or write. Specifically, the open() function can take an option newline parameter, allowing you to specify which form you want it to prefer, and thus convert the others two it. There is particularly an option to specify that no newline form is preferred, and no conversion should occur. Do so like this, passing the empty string as the preferred newline character (thus specifying no preference):
f = open(filename, newline='')
Nov-13: Check the Projects page to find some sample Sudoku puzzle (board) files.
Nov-10: At long last, Project 2a is finally posted. 2b coming soon.
Nov-02: Here are three solutions to binary search for your consideration and review.
Oct-26: I have posted a short Lab 5 document. Note that the due date is Monday, Oct-27, at 11:59 pm.
Oct-22: After a bit of delay, I've posted Lab 4 for those who would like a better, written account of what is sought. Coming soon, mid-term solutions...
And here they are: solutions to the mid-term exam. You will see that the answers are provided to each question, but that the discussion about common errors and other issues has been labeled as to be added (tba) later, when the grading (which is in progress) has been compeleted.
Oct-10: There has been confusion and, more importantly, some inconsistency on my part regarding the due date for Project 1. So, it seems only fair that the latter of the two due dates that I seem to have expounded should be the one that we officially adopt. Thus, Project 1 is due by 1 pm on Wednesday, Oct-15.
Oct-06: Visit the course's Moodle page, on which you will see a link for a mid-term review forum. I will be following this forum, answering the questions that you post as you prepare for the exam, tonight, from 7 to 9 pm.
Oct-03: See the Readings page for a list of textbook sections/chapters that address what we've covered. Use these sections as needed for review for the mid-term exam on Wednesday.
Oct-01: Check the Documents page for the sample mid-term and its solutions. Don't panic that you don't know about lists yet -- the order of topics and timing for last semester and this one are a bit different.
Aug-28: Because sections 03/04 of this course seem to be getting quite large, please note that the lectures, including the first class meeting on Wednesday, Sep-03, will be in Merrill 2. On that point, if either or both of sections 03/04 have too many students for the lab to handle, I will work with the group of you to create additional lab sections that meet at times available to a sufficient number of students. In other words, go ahead and register -- we'll adjust for reality during add/drop. Nobody will be forced out of the course for want of a lab section with available space that fits your schedule.
Aug-10: Welcome to Introduction to Computer Science I! There are two key pieces of information that you should know before our first class meetings:
Our first class meeting will be on Wednesday, Sep-03, in our usual lecture room (Seeley Mudd 206). We will spend only a little time discussing an overview of the class, because the majority will be spent getting started on real material. Since we only have this one class meeting before the first lab on Friday, it will be critical that we cover a few preliminary topics.
Before our first class meeting on Friday, Sep-05, read the Course Information. This document covers the course topics, expectations, structure, grading, etc. You are expected to have reviewed this document thoroughly.