Questions and answers for CS270

Contents: Course logistics | Course content | Virtual Machine | Laboratory 1 | Laboratory 4 | Project 1 | Project 2 | Project 3 | Project 4 | Project 5

Course logistics

  1. What are the TA's hours and contact information?
    Anton Vinogradov
    anton.vinogradov@uky.edu
    W 2-4p, F 2-3p
    205 Engineering Annex
    

Course content

Virtual machine

  1. What is my VM name? What is my login name?
    If your UKID is abc123, your VM is named abc123.cs.uky.edu. Your login on that machine is abc123. Your password on that machine is your LinkBlue password; you can also establish a local password for that login on that VM. If you use ssh, you can connect as follows:
            ssh abc123@abc123.cs.uky.edu
    
    This command combines your login name with the VM name. It's a shorthand for this command:
            ssh abc123.cs.uky.edu -l abc123
    
    which explicitly separates the VM name from the login name.
  2. I've been unable to log in to my VM when not on campus. Is this expected behavior? If so, is there a workaround?
    Yes, this behavior is expected. See www.cs.uky.edu/docs/users/vpn.html, which is also referred to from the class web page.
  3. How can I reset NoMachine?
    Method 1: connect to your VM via ssh, then:
    	sudo /usr/NX/bin/nxserver --restart nxd
    
    Method 2, if that fails to help: again, connect to your VM via ssh, then:
    	ps -ef | grep "nxserver.bin --daemon"
    		discover the process ID of the server, such as 1656
    	sudo pkill -9 PID
    		where PID is the process ID you discovered in the previous step
    
    Method 3: reboot your VM. Connect to it via ssh, then:
    	sudo reboot
    

Laboratory 1

  1. What is the deadline for Lab 1?
    I am extending the deadline for Lab 1 to Monday night at midnight.
  2. Are there any alternatives to Putty besides NoMachine?
    I am told that recent versions of Microsoft Windows™ have a version of ssh installed. If so, you might be able to avoid using Putty.
  3. Have the problems we had getting the VM to work during Lab 1 been resolved?
    The CS staff has reloaded the dashboard software; if you had problems using it, perhaps the problem have been fixed.
  4. How can I upload mysession.txt to csportal without starting a browser on the VM?
    To copy your mysession.txt file to your laptop, you might want to install a program on your Windows™ laptop like WinSCP or Filezilla. Your file is most likely at /home/abc123/mysession.txt on the VM (as usual, I say abc123 where you would put your LinkBlue ID). Once you have copied mysession.txt to your laptop, you can easily use a browser there to upload it to the csportal site.
  5. Why can't I resume an existing session on the console, but I can log in via Putty? Is there a workaround?
    If you have started a session via the dashboard console or NoMachine and come back to it later, you get a screen asking for your password. Apparently, your LinkBlue password won't work there. However, you can set a local password on your VM. When you log in, you can then use either the LinkBlue password or your local password. The screen that won't take your LinkBlue password will, I think, take your local password. To set up your local password, use ssh or Putty or something, and at the VM command line type
    	sudo passwd abc123
    
    It will prompt twice for your new password. That sets your local password. It does not affect your LinkBlue password.
  6. Why does step D.4 fail?
    As many of you found out, when you optimize with -O3, step D.4 might fail, saying:
    	gprof: gmon.out file is missing call-graph data
    
    This behavior is expected; the program finishes without generating any data.
  7. Why does step E.2 fail?
    If you are connecting via Putty or ssh, step E.2 fails with
    	Could not connect to any X display.
    
    Don't worry about this step in that case. If you connect via the OpenStack console or NoMachine, this step should succeed. See if you can figure out what kcachegrind shows you.

Laboratory 4

  1. I'm having some trouble debugging the last part of lab4. gdb is not stopping for any of the breakpoints I set. Do you know why this is happening?
    My guess is that your output is longer than 10 lines (mostly blank), and when the head program terminates, it causes the debugged program to terminate normally, without ever reaching your breakpoints. That is a symptom of an input string that is not doing what you want. If you are not seeing the empty lines, then try removing the redirection of stdout through head.

Project 1

  1. In program 1, Is it acceptable to exit with an unexpected character message for cases where the first parameter is a letter or punctuation mark?
    Yes. My program is not quite as careful as it could be.
  2. May we use your error messages or would this be considered plagiarism? If we may do so, is it necessary to document this in the comments?
    You may use my error messages. It would be nice to document that fact in the comments or external documentation.
  3. I prefer to use lowercase letters with underscores when necessary for file, variable, and function names, as opposed to camel case. Is this acceptable style in this course?
    Yes.

Project 2

Project 3

Project 4

Project 5