CPSC 225: Intermediate Programming
Fall 2006

Instructor

Stina Bridgeman
bridgeman@hws.edu
Lansing 312, x3614

Course Description

This course continues the study of programming begun in CPSC 124. We switch to C++, a language widely used by professional programmers. C++ is similar to Java in many ways, but is a more complex language and offers many low-level features (such as direct manipulation of the computer's memory) that Java does not. C++ also removes some of the automatic checks and "safety belts" that Java provides.

The goal of this course is to build on your skills as a programmer, by reviewing and extending object-oriented programming concepts from CPSC 124 (including classes, inheritance, and polymorphism) and by adding new language features (including pointers, reference parameters, operator overloading, and templates), new algorithmic techniques (recursion), and new data structures (including linked lists, stacks, queues, trees, and, time permitting, the Standard Template Library). Continued attention will also be given to "how to think like a programmer" - that is, the fundamental logical thinking and problem-solving skills which are independent of the particular language being used.

Office Hours

M 12:30-1:30pm, W 3-4:30pm, R 10:30am-noon, F 9:30-10:30am
or by appointment (schedule)

Tutor Hours

TBD

Class Hours and Meeting Place

Lecture MWF 1:55pm-2:50pm, Lansing 301
Lab R 8:45-10:10am, Gulick 208


Course Links

Unix Links


Announcements

[11/9] The ssh gremlins are back. If you ssh -X and get permission denied errors when you try to access your files, do the following:

  1. log out from the machine you've sshed to (type "logout" or "exit" or press control-D in your shell)
  2. ssh cslab1 (or one of the other cslab machines; not specifying -X means you don't have to wait while something that isn't going to succeed times out)
  3. answer yes if you get the message about not being able to establish the authenticity of the host
  4. enter your password when prompted
  5. run kinit and aklog as directed below
  6. log out from the machine you've sshed to (type "logout" or "exit" or press control-D in your shell)
  7. ssh -X cslab1 (or one of the other cslab machines - use the same machine you used in the first step; now you need the -X so that you'll be able to pop windows up)
  8. happily run your program (you don't need to run kinit and aklog again - the first time established a token good for 24 hours)

[9/28] ssh should now be fixed, so that there is no need to run kinit or aklog and you do not need to log in twice so that programs like Darwin's World will run. To summarize: for Darwin's World, you will need to ssh -X to one of the cslab machines (cslab1, cslab2, etc) in order to compile your program; for Bug Hunt you still need to ssh to math in order to compile both sortedtester and bugchecker. Let me know if you have problems.

[9/28] While the Darwin's World demo seems to run fine on the Gulick machines, you'll need to be logged in on one of the Lansing lab machines in order to compile your own program. Using the ssh -X method outlined below works great for that if you aren't actually sitting in front of the right computer, but trying to actually run your program doesn't work (you get an error message about a broken or rejected X11 connection). Here's the fix:

  1. ssh cslab1 (or one of the other cslab machines; not specifying -X means you don't have to wait while something that isn't going to succeed times out)
  2. answer yes if you get the message about not being able to establish the authenticity of the host
  3. enter your password when prompted
  4. run kinit and aklog as directed below
  5. log out
  6. ssh -X cslab1 (or one of the other cslab machines - use the same machine you used in the first step; now you need the -X so that you'll be able to pop windows up)
  7. happily run your program (you don't need to run kinit and aklog again - the first time established a token good for 24 hours)

[9/28] Bug Hunt update: for a variety of reasons due to incompatibilities and missing libraries, you need to ssh to math (ssh -X math) in order to compile and run both sortedtester and bugchecker. The Lansing lab machines don't (at this point) work, nor do the Gulick or library computers. If you compiled any part of your program on a machine other than math, you should delete the sortedcollection.o and sortedtester.o files (but just those - leave the other .o files) and then recompile on math.

[9/28] Bug Hunt logfile update: I think the permissions are finally worked out on the log file. Let me know if you get any more "cannot open log file" error messages when you try to run bugchecker.

[9/21] Lab 4 (Bug Hunt) makes use of precompiled files which are not compatible with the Gulick machines (and likely also the computers in the library). If you are not in the Lansing lab (or haven't used VNC to connect to one of the Lansing lab computers), you will need to ssh to one of them in order to successfully compile the bugchecker part of lab 4. See below for information about how to do this.

[9/21] To log in to one of the Lansing lab machines remotely, use ssh:

ssh -X machine

where "machine" is the name of the computer you want to log in to. The Lansing lab machines are named cslab1, cslab2, cslab3, etc up to cslab12 or so. Please do not use math - this is the math department server, and overloading it will cause things to run slowly for everyone.

If it is the first time you are connecting to a computer, you'll get a message like the following:

The authenticity of host 'cslab3 (172.30.217.103)' can't be established.
RSA key fingerprint is a6:57:45:4b:f1:c9:ef:9b:0c:71:3c:e0:29:d0:51:89.
Are you sure you want to continue connecting (yes/no)?

Answer yes.

You'll then be prompted for your password.

Once you get a shell prompt, you'll need to do two things so that you can access your files:

kinit
aklog

kinit will prompt you for your password again; aklog should complete silently.

You now should be ready to go.

[9/15] Review information for the first midterm has been posted on the syllabus page. It is still almost two weeks off (and we haven't covered all of the material yet), but it doesn't hurt to start thinking about it - particularly if there are topics you don't yet feel comfortable with.

[9/14] In order to have more time to discuss program design involving classes, the deadline for homework #3 (Scrbl) has been extended - it is now due at 11:59pm on Monday 9/25. (But don't use this as an excuse to delay starting on it!)

[9/7] Two links about Benford's Law have been added on the syllabus page - this law describes the (perhaps) surprising property of digit frequency that you observed in homework #1. Check out at least the first article!

[8/28] Homework #0: Two tasks -

  1. Make sure that you have an account on the department Linux machines, can remember your password, and can login successfully. Inform me of any problems by Wednesday 8/30.

  2. Send me (bridgeman@hws.edu) an email telling me the following:

[8/28] Office hours will end early on Wednesday 8/30 because of Convocation.

[8/28] Welcome to CPSC 225! This web page is your source for a great deal of important and useful material, so you should take a few minutes to familiarize yourself with the website. Check back often for announcements and new information.


Valid HTML 4.01!