This is the archived website of SI 413 from the Fall 2012 semester. Feel free to browse around; you may also find more recent offerings at my teaching page.
All code for labs and projects must be submitted electronically, from the USNA cs linux environment. The resources page has some information on how to access the USNA linux environment remotely. The Coding style rubric also has specific requirements for things like whitespace and commenting. Ignore it at your own peril!
I've set up some useful aliases for you so you don't have to
type so many directories every time. To get these aliases at your
command prompt, add the following line to the file $HOME/.bashrc
:
source /home/roche/413/bashlines.sh
This will define aliases to run the programs as I describe them below.
The program you will use to submit is located at
/home/roche/submit
, but can be run by typing
413sub
if you edited your .bashrc
file as
described above. This program is accessible
from the usna CS linux environment. You can use it from the MI 302 lab
or log into one of the machines remotely (see above).
When you run 413sub
with no arguments, it will display
something like
Submissions open for class 413: lab 01This means, unsurprisingly, that SI 413 has one thing open for submission, it's a lab, and it's number 01. To submit your file or files for this lab, you make a directory in your account (like
mkdir lab01
),
then put any files to submit in there.
(It is probably easiest if you make this directory
at the beginning of your lab, and just keep your files for this lab in there.)
Once you have your local directory, and you confirm that the assignment
is open for submission, you cd
to that directory and
run
413sub lab 01(for example) to submit your files. This will check your files, run the public "sanity testing" (see below), and then finally bundle and submit your files. At the end you will see something like:
Submitting 413 lab 01 for user roche to Dr. Roche.. roche/ roche/hi.txt Submission successful.You can see that there is one file that was submitted, called
hi.txt
. Note the last line, telling me that it was successful. If you don't
see this line, then something went wrong.
All this does is put all your files in a place where I can see them, with a timestamp and your username. You are free to submit the same assignment repeatedly, and I will only look at the most recent submission for grading purposes.
Most labs will have a testing component. This means that you must turn in
tests for your code along with the code. These tests will all be individual files
in a subdirectory of your assignment called tests
.
You should name each file according to what it is testing,
like "ex4-easy.scm" or something like that. At the very least, it should be
obvious from the file name which exercise is being tested.
Each test file will have two parts. At the top is some expression to
be run through the submitted code and tested. At the bottom is whatever
you expect should be produced and returned by the top part, if the submission
is correct. These two parts are separated by a single line that contains just
a single semicolon, ;
. For example:
(squares 2 12) ; '(4 9 16 25 36 49 64 81 100 121 144)
Say you have a Scheme program called lab2.scm
that you want
to test, and you have two test files (formatted as above) in
tests/ex1.scm
and tests/ex2.scm
. You can run your code
on both of those tests to see how you do by typing:
schemetest lab2.scm tests/ex1.scm tests/ex2.scmat the command line. Try it!
Testing your code against both the "public" tests as well as any tests you have created is called a "sanity test". The idea is that it provides a way to check that you haven't misspelled something important or forgotten part of the lab. Hence the "sanity" part. To run a sanity test is easy: just go into your directory for that lab, and type
sanity lab 02(or whatever the current lab is). Then sit back and watch the results fly in. This is also automatically run every time you try to submit.
The coding style rubric is the general guide by which the style of all your code for this class will be judged. Particular requirements follow.
Every file you submit should start with comment lines indicating your name(s) and the purpose of the file. Remember that comments in Scheme are indicated by semicolons. So if you start a line with one or more semicolons, that line is a comment. For these labs, write the exercise solutions in order, and indicate with comments where each exercise begins. So I should see lines that look like
;;; Exercise 1 ;;;;;;;;;;;;;;;;;;;;;;;;;;or something like that, to make it easy to find each part of the lab.
All code you submit must be plain text. This should be self-explanatory. However, Dr. Scheme will sometimes try to save things in its own binary format, for instance if you try to insert a comment box in your definitions. (Don't do that.)
To protect against this, I suggest two actions: