image University of Washington Computer Science & Engineering
  CSE 401Sp '04:  PL/0 - Printing
  CSE Home   About Us    Search    Contact Info 

What/How to Print For Project Turnins

  1. For each portion of the project, you need to turn in listings of your code. You only need to print the modified portions of the C++ implementation, with your changes highlighted, either with highlighter pen or using a tool such as diffpp, described below.

  2. Write a brief description of what eventualities your test cases tested. It is not necessary to print your test cases nor the output from these tests; a paragraph of text is sufficient.

  3. To save paper, please use enscript and lpr -Zduplex to make two-column double-sided printouts. Sieg 329 and 232 both have HP LaserJet 4 printers capable of printing double sided.
      enscript -2rG -p - file1 file2 ... | lpr -Zduplex -Pps232
    The -2rG options specify 2 column rotated (landscape) "Gauddy" output, including file name and username (can be left out). The -Zduplex option makes the printer print double-sided. Adjust the printer name with the -P option or leave it out for your default printer.

  4. Include the header page (the one with your username on it) on the front of the printout, and write your real name at the top. If you are working with a group, also includes your group number and your partner(s) real names and usernames.

Extra Credit Turnins:

For extra credit turnins, please highlight changes with respect to corresponding files for the required version of the project at the corresponding phase (scanner, parser, etc.). Only print the subset of files that are most relevant for the given phase. E.g., when turning in your EC parser, we don't need to see printouts of your EC scanner files again, unless you made big changes to them. (If you made small changes, you can just write us a short note. Also, in case you might have omitted printouts that we will want to see, you can use diffpp (below) to compare all files, and save the resulting .ps file(s) to disk in your turnin directory so we can consult it if questions come up about parts you didn't print.)

Optional: diffpp Highlighting

Thanks to Mark Reay for the following tip: The program diffpp(1) included with the enscript(1) package can be used together with diff(1), rcsdiff(1) or cvs(1) diff and enscript(1) to produce a "pretty-printed" listing of diffs between your files and their baseline version or versions turned in with the previous phase of the project. See the relevant man pages for details, but the outline below should give you the gist of it.

The basic picture is that diffpp processes a newfile together with the diff of oldfile vs newfile, producing input to enscript that includes special formatting instructions. Mark's script (below) may be convenient.

    #! /bin/tcsh

    set diffopt = "-r Proj3 -r Proj4"
    set files = ()
    set allfiles = ({decl,expr,stmt}.tc.c symtab.{h,c} type.{h,c})

    foreach file ($allfiles)
        if ( { ( cvs diff $diffopt $file > /dev/null ) } > 0 )
        set files = ($files $file)
        echo $file

    enscript -2rG -e -h -o - \
        --filter="cvs diff $diffopt %s | tail +7 | diffpp %s" \
        $files | ps2pdf - changed_files.pdf 

The enscript options -2rG are as above, -e enables processing of the formatting escape codes produced by diffpp in the "--filter" pipline. This script assumes you are using CVS, with successive releases of your project tagged Proj3, etc.; if you use RCS instead, change cvs diff to rcsdiff, diffopt as needed, and remove tail +7 (which strips off 7 lines of CVS-specific stuff). Please proofread the output carefully; as the scripts get more elaborate there's of course increased chance of omitting important files, comparing/printing the wrong versions, etc.

Suggestions for improvements are welcome.

CSE logo Computer Science & Engineering
University of Washington
Box 352350
Seattle, WA  98195-2350
(206) 543-1695 voice, (206) 543-2969 FAX
[comments to cse401-webmaster at]