Reference Material

Configuring Terminal

  1. From Terminal → Preferences → Profiles → Keyboard, check the "Option Sends Meta" box. This allows you to use the Alt/Option key as Meta in Emacs.
  2. Add the following lines to ~/.bash_profile, so that you will always know the machine and directory that you are in:
                  PS1="\h:\w -> "
                  export PS1
                  
                  # Access icompile and printpreview scripts
                  export PATH=/opt/local/bin:/usr/mac-cs-local/share/cs371/G3D/bin:/usr/mac-cs-local/share/cs136/bin:$PATH
                

Configuring Emacs

Ensure that the following appear in your ~/.emacs file:

          ;; Use four spaces instead of tabs for indenting
          (setq-default indent-tabs-mode nil)
          (setq tab-stop-list (number-sequence 4 120 4))
          (setq c-basic-offset 4)

          ;; get C and C++ editting to work on the proper files                     
          (setq auto-mode-alist
             (append '(("\\.c$" . c-mode)
                ("\\.h$" . c++-mode)
                ("\\.C$" . c++-mode)
                ("\\.c[+][+]$" . c++-mode))
              auto-mode-alist))
        

Previewing Your Code

Extra-long lines or a mixture of tabs and spaces can make code that appears reasonable in your editor look poorly-formatted when we print it for grading.

Run the printpreview script on your files to see what they'll look like when submitted.

If you want to run this script on your own Mac or Linux computer, its contents are:

          #!/bin/sh                                                                                                                                          TMPFILE=$(mktemp /tmp/pretty.XXXXXXXXXX).pdf
          enscript -E -r -2 $1 -o - | ps2pdf - > $TMPFILE
          open $TMPFILE
        
Put those lines in a file and set the execute bit to run it. On Linux you'll need to change the "open" command to the name of your favorite PDF viewer.

The Turnin Folder

Submit your work by mounting the cs136/Turnin folder and dragging a complete, properly named folder onto it before the deadline.

If something does go wrong with the submission process, e-mail morgan@cs.williams.edu and mary@cs.williams.edu immediately, do not panic, do not attempt to submit your work in an alternative way, and do not work past the deadline. Specifically, if something goes wrong, do not e-mail your work to the professor or the TAs, leave it on a USB disk in a mailbox, or put printouts in mailboxes. See the course policies and honor code statement in the syllabus for details.

  1. Name your submission folder (not file--there must be a folder) nn-username-hw-rr for homework and nn-username-lab-rr for programming labs, where:
    • nn is the two-digit lab number
    • rr is the two-digit revision number
    • username is the name that you logged into the CS department Mac with
    For example, if you log in with then name msm1, then you would submit a folder named 00-msm1-hw-00 for the first homework assignment. If you then discovered an error in your solution and wished to overwrite it, you would submit a new folder named 00-msm1-hw-01.
  2. Remove any extraneous or generated files from your folder before submitting it. Homework may only contain ASCII .txt, .pdf, and .jpg files (the last are handy if you do your homework by hand and scan it at Schow or using a mobile phone camera. Do not hand in RTF, Unicode, or other non-ASCII text files). Projects should contain only necessary source files, documentation, and data. (e.g., run icompile --clean and delete any files ending in ~ or .pyc)
  3. If you performed bonus work, have known bugs in your solution, or wish to bring other elements of it to our attention specially, explain that in a plain text file named readme.txt in your solution directory.
  4. From the Finder menu bar, select the "Go" menu
  5. Select "Connect to Server" from the Go menu
  6. Type "afp://fuji.cs.williams.edu/" in the Server Address text box.
  7. (Optionally push the "+" button to save this choice)
  8. Push "Ok"
  9. Log in with the dialog that appears.
  10. Select the "Courses" volume and press "Ok".
  11. In Finder, open the cs136/Turnin folder.
  12. Copy your project folder into Turnin. You will not be able to see it once dropped. The original should remain on your own CS account (don't delete it--you'll want to look back at your work later!)
  13. If you need to update your solution, increment the revision number and re-upload.

Our scripts will only download the highest-numbered revision that was submitted before the deadline; all other folders on the server are deleted each week.

This process is a specification, which contains the kind of details that a programmer must attend to all of the time. Part of the assignment is following this process correctly, which will affect your grade. Obviously, it is also important to submit work correctly so that I can evaluate and return it to you in a timely fashion and to be fair to your peers.