Computer Science 351: Questions and Answers

Frequently asked questions about lab assignments, homeworks, lectures, or any other topic of CS 351 will be posted here.

If you have a question you'd like answered send email to compsci-351@uwm.edu

Homework #3

NB: In the destructor for Team make sure you don't "saw off the branch you are sitting on." In other words, make sure you don't iterate through a sequence while removing things from the sequence.

Q: When compiling the destructor for Player I get an error:

Player.cpp: In destructor 'Player::~Player()':
Player.cpp:17: error: invalid use of undefined type 'struct Team'
Player.h:14: error: forward declaration of 'struct Team'

A: The problem is that the compiler hasn't seen the definition of class Team, since (as I asked you to), the .h file only declares class Team without including Team.h. You can't fix this by including Team.h in Player.h but you can include it in Player.cpp. Do that.

Q: What does it mean to "declare class Player" ?

A: This was mentioned in lecture. It means to write

class Player;

Homework #2

NB: Please see long and involved help on debugging using the driver.

NB: Don't make the mistake of running the Homwork #1 driver with Homework #2, rather than using the new Homework #2 driver. The Homework #1 driver doesn't test teams.

Homework #1

Q: When we implement the is_item( ) function, how are we suppose to determine if an object is "valid"?

A: It's not so much the object in the array being valid, it's whether the current position in the sequence is valid.

In other words, if the sequence has 2 elements and we start the cursor at the beginning, the current position is valid (it refers to the first player). if we advance the cursor it is still valid (it refers to the second player). If we advance the cursor again (legal!), the current position is no longer valid. Advancing the cursor one more time is NOT allowed, since the precondition of advance is that the (old) position is valid.


AFS and Kerberos problems

Q: On my WIndows Vista PC, I can get a kerberos ticket, but don't get permission to access CS 351 files.

A: You need an AFS token. The network identity manager defaults to openafs.org, but you need to change that (File>AFS>Preferences) to cs.uwm.edu. Then add 'cs.uwm.edu' as a cell to automatically get tickets for. Once you have a kerberos ticket, it will get your AFS tokens for you.

Q: How do I get to the CS 351 from my windows PC?

A: Use the ANC path: \\afs\cs.uwm.edu\users\classes\cs351\...

Q: On my Mac, I got the kerberos tickets; now how do I get AFS access.

A: Use "aklog" from a terminal window, or use one of the Third Party tools mentioned on the OpenAFS download page for MacOSX.

Q: On my Mac, I can get Kerberos tickets, but running "aklog" gives an error when trying to authenticate to MIT.EDU.

A: For some reason, the OpenAFS installation doesn't give you a chance to change the default cell. The only way I know how to change the default cell is to edit the following file (using "sudo" since it is a system file) and then rebooting:

/var/db/openafs/etc/ThisCell
The contents of this file should be the single line
cs.uwm.edu
If anyone figures out the proper way to do this, let me know.

Q: When I try to get a token, it says "Authentication server not available."

A: Assuming you have network connectivity and all outgoing ports are open, the most likely cause of the problem is that you aren't using the "Network Identity Manager" to get your tokens. You need to download Kerberos for Windows.

Q: lpr says ``permission denied'' when I try to print files!

A: This is because you don't have a PAG (Google "AFS PAG" to get more info).. Workarounds include:

Q: I changed my kerberos password using Window's Leash Tool (or Network Identity Manager) and now I can't get 'klog' to work with either the new or old password. Help!

A: The problem is that Leash/NIM uses an encoding technique for your new password that the backward compatibility hack of 'klog' can't handle. The easy way to fix the problem is to log onto weise and use

/usr/afsws/bin/kpasswd.uwmcs ePantherID
This command handles all encodings but changes the password to use the old encoding. So if you type the new password three times, then 'klog' will work again.


CS 351 FAQ / John Tang Boyland boyland@cs.uwm.edu