Computer Science 60
Introduction to C, C++, and Unix
Spring Quarter 2005
Prof. Matthew Turk (contact info)
Office hours: Mon 10-11am, Wed 2-3pm
Ryan Dixon (rsd @ cs.ucsb.edu), Office Hours: Tues 10:30am-12:30pm (CSIL)
Arun Qamra (arun @ cs.ucsb.edu), Office Hours: Tues 3:00-5:00pm (Engr I room 2164)
Onur Sakarya (osakarya @ gmail.com), Office Hours: Thur 12:30-2:30pm (Phelps 1413B)
Meeting Times and Locations
Lecture: MWF 9:00-9:50am, South Hall 1431 Discussion:
Wed 4:00-4:50pm, Phelps 3515
Fri 11:00-11:50am, Bldg 387 Room 101
Questions: email@example.com goes to the instructor and the TAs
Course mailing list: http://lists.cs.ucsb.edu/mailman/listinfo/cs60
One last typo - the grades were updated at 7:15pm. A few grades were changed slightly, since I hadn't included HW#7 in the calculations at first.
[Jun 13, 6pm] The final grades are now posted on the Grades page. If you have any questions about the grading of HW#7 or Project #3, please see the graders (listed on the same page). I hope everyone has a great summer, and thanks for an interesting class this quarter!
Answers to the final exam will be posted here for a limited time.
[Jun 12] Grading has taken longer than expected.... But the end is in sight - we'll finish double-checking the exam grades and then post everything by Monday night.
Grades are updated through HW#6 and Project#2. The others
will be there ASAP (probably by
Thursday). Note the green numbers,
indicating where the 17-hour extension was taken.
The exam starts at 8:00am on Wednesday in North Hall room 1006.
[Jun 6] I wanted to clarify my response (in the review session) to the T/F question (B) regarding the friend keyword. The specific reason the question is false is because the friend declaration gives the function access to private data (as well as public and protected data). [When answering, I misread the question to be about class functions, but it's about non-class functions accessing class members.] But, again, we did not explicitly cover friend, and there will not be any exam questions about this.
[Jun 6] Notes from the review session are now posted on the Schedule page.
[Jun 6] There was a question at the review about which Wed. quiz had the error that pointed out the main difference between an array and a pointer. It was the May 4th quiz. (See the lecture notes, where there is a page of explanation after the quiz question.)
[Jun 3] In the True/False questions at the end of the sample final exam questions, some changes were made to questions J. L, and T (and N was deleted).
[Jun 2] Here are outputs for all the sample programs of Project #3. (There are also some "imdata" and "pixels" commands after some of them to show the results.)
[Jun 1] Solution to HW#7 is now posted.
[Jun 1] Here are some sample final exam questions.
[Jun 1] Here's a little example of using exception handling for you to play around with. (Try taking out all of the "try" and "catch" code, or just the "catch" code, and see what happens.) Replace the "throw" with an assert and see how it acts differently (remember to include <cassert> or <assert.h>).
[Jun 1] Note from class today: When compiled with the -DNDEBUG flag, the complete "assert" statement is ignored - the expression inside assert(expr) is NOT executed.
[May 27] Confirming a couple questions from class today:
Copy constructors cannot be declared virtual (compiler error).
If the destructor is declared virtual in the base class, it will still be called after the derived class destructor (when an object is deleted or goes out of scope). Here is a small program that you can play around with (delete the virtual keyword and see how it changes).
[May 26] There will be a final exam review session on Monday, June 6th from 9-10am in Webb Hall 1100. Bring questions.
[May 25] Assignment #7 is available on the web (due Tuesday, May 31). There is code there that will get you started.
[May 25] Project #3 is now available on the Assignments page (due Friday, June 3).
[May 23] A solution to Assignments #6 (bits.cpp) has been posted on the Assignments page. I was surprised by how much trouble some people had with this, especially since the basic algorithm was given. Please look at this program carefully and make sure you understand what was done and why. Feel free to bring questions about it to class or to office hours.
[May 23] Regarding slides 2-4 of today's lecture: I had indeed left out something in the code for the function "func", so we were right that the output should have been "CC CC func D D". Go through these examples again (especially if you weren't in class today!) and make sure that you understand them - or bring questions about them to class on Wednesday. Here is a C++ source file that includes this code (plus an extra function).
[May 16] Be sure to note the "Comments/changes" at the top of Project #2.
[May 13] The schedule of assignments for the rest of the
quarter is on the Schedule page. (There are several, but they are smaller
than previous assignments.) Assignment #6
is due next Wednesday, and Project #2
next Friday Monday, May 23rd. Get going on these ASAP!
[May 9] Assignment #5 is due on Friday, May 13
[May 9] Get going on the C++ reading!
[May 6] Here's an advanced one - see if you can figure out what this is doing and why. Can you predict what it will print out (if anything)?
[May 6] Check out this file for a code example that plays around with function pointers. Try it out - see if you can predict what will be printed out before you run it!
[May 4] The Grades page has been updated through HW#4 (including the updated HW#3 grades).
[May 4] Every student has one "17 hour free pass" that may be used once this quarter, starting with Project #1. That is, you can turn in Project #1 (or another later assignment) up to 17 hours late without a late penalty. We will automatically "cash in" this pass for a late assignment. (Bottom line: If you want to use this for Project #1, then it's due on Thursday at 5pm.)
[May 4] Today's quiz question #2 did indeed have an illegal statement - see the lecture notes for comments on it.
[May 2] Added a fourth sample program for testing (tests the region of interest copy) for Project #1 - and some new comments on the Project #1 page.
[May 1] Outputs for the three sample programs of Project #1 are now posted (next to the sample code on the Project #1 page).
[Apr 25] There are some new notes on memory management useful for Project #1.
[Apr 20] There are now three sample programs on the Project #1 page (near the bottom) that you can use to test some parts of your Image library (and to see how these functions might be used).
[Apr 19] The previous version of "taxman1.c" (the quick-and-dirty solution to HW#3, see the Assignments page) had a bug in the tax computation. This has been fixed. (I hope.)
[Apr 19] There are some scheduling modifications for next week (April 25 - April 29):
There will be no class on Friday, April 29. (No change in the discussion sessions.)
Prof. Turk will not have office hours on April 25 or April 27.
Arun Qamra's office hours will be Monday Apr 25 10am-noon (instead of the normal Tues 3-5pm)
[Apr 19] Homework assignment #4 is now available, due on Tuesday, April 26.
[Apr 19] Project #1 is now available, due on Wednesday, May 4.
[Apr 14] There are some new comments about HW#3 at the top of the assignment - some helpful functions dealing with strings, and especially a note about what's most important in the assignment (with respect to grading).
[Apr 13] I definitely misspoke in class today about how to use the "->" in accessing structure elements. If "p" is a pointer to a structure which has an element declared as "int x", this element is accessed via "p->x", which is equivalent to "(*p).x". (But not "*p.x", since "." has a higher precedence than "*" - so that would be interpreted as "*(p.x)" which is an error.) So you could write "int val = p->x" or "int val = (*p).x" - these are the same. More on this when we actually get to pointers....
[Apr 11] The Grades page is now up and running. Check your grades so far - if anything seem amiss, please contact the grader for that quiz or assignment. Blanks mean that we don't think we received it. (See the instructions for converting your perm number to an index. Those of you without perm numbers, I'll send you email telling you what number to use.)
[Apr 11] Homework assignment #3 is now up, due Friday.
[Apr 8] The "-save-temps" flag to "gcc" will keep around the intermediate files: the preprocessed file (.i), the assembly code file (.s), and the object file (.o).
[Apr 7] For HW#2, note that you can't go too high (in the summing) before you get overflow problems. (If you use an "unsigned long int" for the sum, you can do the sum only for the first 26 Fibonacci numbers.) For this assignment, don't worry about it - we'll deal with these issues later.
[Apr 7] There is a new "Useful Software" section on the Links page, including some software for a Linux-like environment on Windows and C compiling on Windows. (Let us know if you have other suggestions for useful software.)
[Apr 6] A note on HW#2 - "the sum of 1 through 0" is ambiguous. (Should it be 1, 0, or undefined?) For this assignment, it should be 0.
[Apr 5] Homework assignment #2 is now available, due on Friday. See the Assignments page.
[Apr 5] We have a change in the TA staff due to some shifts in other courses - Onur Sakarya has replaced Steve DiVerdi.
[Apr 4] Here is a simple example of using header constants to protect from an inadvertent infinite loop during compiling: files. Copy these files and try compiling and running the program. Then take out (or comment out) the preprocessor directives that define and use the _INC1_H and _INC2_H constants. What happens???
[Apr 4] These students should get your add codes from the CS office: Brian Graham and Gabriel Nunez
[Mar 31] The turnin command may not be on all the machines, but it's definitely on csil.cs.ucsb.edu (at /usr/bin/turnin). So, if necessary, first ssh to csil.cs.ucsb.edu.
[Mar 31] The bookstore says they should have "Programming with GNU Software" any day this week (meaning, I hope, tomorrow). "The C Programming Language" should arrive mid-week next week. Meanwhile, has anyone checked the Isla Vista Bookstore?
Note that you may have to be on a CSIL machine for the "turnin" command to work properly (for turning in HW#1).
In HW#1, an inconsistency has been fixed - the first file created should be called "student1.info" (not "student.info").
Computer accounts: Those of you who already had Engineering accounts will be given access to CSIL from those accounts (rather than brand new accounts). I assume that this access is now available.
ADDING THE COURSE: All those who have been on the wait list WHO FULLY QUALIFY FOR THE COURSE (i.e., have the prerequisites - no exceptions) may add the course. Contact Sandy Jacobs in the CS office for your add code. [If there are exchange students still interested in adding, please talk to me at class on Friday.]
Decisions on wait listed people who want to add the course will be made Wednesday afternoon.
Computer accounts update (as of 8am Tues): The CSIL accounts (for applications that were submitted Monday) should be ready sometime late Tuesday or perhaps Wednesday morning. (It's taking them longer than expected.) People who already had Engineering accounts will continue to use those, and those account will be given access to CSIL. Many of those, however, will be required to change your password, because the password checker found them to be insecure. If you are in this situation, see Roy Washburn in Engr I room 3110 to change your password.
The command "ssh <username>@csil.cs.ucsb.edu" should get you to CSIL remotely.
Rumor has it that the bookstore is out of two books - (1) The C Programming Language (Kernighan and Ritchie) and (2) Programming with GNU Software (Loukides and Oram). We'll check on this first thing Tuesday. Meanwhile, for those of you who aren't able to get these, your best bet might be to borrow them from a classmate. You can use the course mailing list to find someone willing to lend you theirs for a couple hours. (For those of you who do have them - please be nice to your classmates and give them a hand!)
Change in the reading assignment for Wednesday - Siever (et al.) chapters 1 and 6 (not 1 and 2)
Remember, to view the lecture notes click on the date on the Schedule page.
Note that Assignment #0 is due on Wednesday (by midnight).
Here is info on the CSIL lab (including its schedule and how to access it remotely).
Various announcements will be posted here on a regular basis. Be sure to bookmark this web site and visit it often!
The first class meeting is on Monday at 9:00am in South Hall 1431.
The textbooks for the course are listed on the Syllabus page.