You must register for 6.170 via the student-setup script before 8pm on the day of the first lecture. (You must also register with the MIT registrar.)
Before doing any work (problem sets, labs, etc.) for 6.170, you need to run a script to set up your Athena environment. Type the following commands at your athena% prompt:
add 6.170 student-setup.pl
If you see the message "6.170 setup complete!", you are all set! You must logout and login again for the changes to take effect. This script will create a 6.170 sub-directory in your home directory and modify your .environment file to set up the appropriate environment variables required for this class.
If you see an error message, contact the course staff for assistance. (The best way to get help is to visit an LA during lab hours. Alternately, see the staff list for email information, or ask for help on the 6.170 forum.)
We do not recommend it, but you may choose to make the changes by hand rather than using the staff-supplied script. In that case, see the comments at the top of the student-setup.pl (/mit/6.170/arch/common/student-setup.pl) file, which describe in detail all the actions of the script.
Sun Microsystems' Java Development Kit (JDK) is available on Athena, and may be used for coding 6.170 problem set solutions. This semester, 6.170 will use version 1.5.0 of the JDK.
Please see the document Tools Handout: Editing, Compiling, Running, and Testing Java Programs for detailed instructions.
Sun's Java Development Kit includes javadoc, a tool that produces specifications from source code annotated with special comments. The comments may include "tags", which are introduced by an at-sign (@).
We have extended the javadoc program to recognize additional 6.170 tags, as well as all the tags accepted by the Sun Standard Doclet. These additional tags declare specification fields for classes and requires, modifies, and effects clauses for methods. Note that these tags must appear after all non-tag comments for classes and methods.
| @specfield name : T // text | Indicates that name is a abstract specification field of type T for the class, adding text as a comment if present |
| @derivedfield name : T // text | Same as specfield, except that this also adds the property "derived" to the output information |
Derived fields can be viewed as functions on preexisting state; thus if a class had a specfield @specfield n : integer we could define a derived field:
@derivedfield pos : boolean // pos = true iff n > 0
Derived fields are not allowed to hold any information that could not be already calculated from the already existing state in the object. Thus, you use specfields to introduce new state variables and derived fields to introduce functions on those state variables.
Derived fields are not strictly needed in specifications, but they may reduce complexity and redundancy.
| @requires X | Declares X to be a precondition for the method |
| @modifies Y | Declares that nothing besides Y will be modified by the method (as long as X holds when it is invoked) |
| @effects Z | Declares that Z will hold at exit from the method (as long as X holds when it is invoked) |
The preferred way to generate api documentation with the 6.170-extended javadoc is to use the ant doc target for your problem set. See running automated tasks with ant in the "editing, compiling, running and testing" handout. The instructions for eclipse, briefly:
Alternatively, you can use the javadoc6170 tool from the command-line. The javadoc6170 tool uses the same syntax as Sun's original javadoc tool, except that you invoke javadoc6170 instead of javadoc. Thus, if you would normally generate specifications by typing:
athena% javadoc -d ~/6.170/psets/api -sourcepath ~/6.170/psets ps1 ps2 ps3
then to make use of javadoc6170 you would type:
athena% javadoc6170 -d ~/6.170/psets/api -sourcepath ~/6.170/psets ps1 ps2 ps3
After running javadoc6170 or the ant doc target, you should check the output. You may find that you need to add line breaks (<br>) or paragraph breaks (<p>) to your javadoc comments for readability. Also, if you omit certain tags, subsequent text may fail to appear in the output. Finally, since much of the text of javadoc comments is inserted in a HTML document, you must be careful with text that can be interpreted as HTML markup, such as the less-than (<) and greater-than (>) characters. For instance, if you write:
@effects Adds <x> and <y>
then <x> and <y> will be interpreted as HTML tags in the output (and won't be displayed by a browser).
Report any weird behavior or complaints about javadoc6170 to 6.170-tas@mit.edu.
Eclipse is an integrated development environment (IDE) on Athena that you can use to develop your Java code. Please consult the following documentation:
See the separate Daikon handout.
Emacs is a richly-featured text editor that can be used as a Java development environment. Please consult the following documentation:
Please consult the Tools Handout: Version Control Reference for details on using CVS to manage your source code.
The 6.170 forums are a great place to post technical questions about the problem sets, Java, and the course in general. The LAs, TAs, lecturers, and other students monitor the forums, so responses can arrive relatively quickly and be shared with all members of the class.
Please register for the forums here: http://scripts.mit.edu/~6.170/forums/ST07/
When you are posting to the forums, please provide as much detail as required so that others can reproduce your problem. Strive to post the most succinct message that gets your point across. Extraneous details such as pages of obscure compiler warnings can distract from your question and make it less likely for others to look at it carefully on first glance.
Keep in mind that lab assistant hours may be more appropriate for getting help with coding bugs and environment problems.
When you are at the Athena cluster, you may use Zephyr to contact LAs who are on duty by typing:
zwrite LA-username
Please respect the LAs by only contacting them during the hours when they are on duty. You may get a more immediate response if you place yourself on the LA Help Queue or (if the queue is empty) walk up to the LAs in person to ask for help.
We strongly encourage you to use the 6.170 forums instead of Zephyr for long or detailed questions.
You may submit diagrams (or other non-code homework) electronically in PDF form. You can convert PostScript to PDF by running Adobe Acrobat Distiller, as follows:
athena% add acro athena% distill file.ps
which produces file.pdf.
Please note that distill is only available for the Sun platforms. If this is a problem, you may choose to run it on a dialup server, or may also use the ps2pdf utility in the gnu locker.
You may occasionally wish to draw diagrams, such as object models and module dependency diagrams. One fast and effective way to do this is to draw in longhand, then scan your results in order to submit them electronically. Alternately, you may wish to use a drawing program. Here are some suggestions. Many others exist; you are welcome to use any one that you feel comfortable with.
Microsoft Visio is a diagramming and drawing application for Microsoft Windows.
Visio templates and stencils for 6.170 are available as zip files. See the README file in the zip archive for instructions; essentially, the files should be placed in the Solutions subdirectory of your Visio installation.
OmniGraffle is a diagramming and drawing application for Mac OS X.
Here are some OmniGraffle templates and stencils you might find helpful when drawing diagrams for 6.170: OmniGraffle stencils
Dia is a cross-platform (Unix, Mac, Windows) diagramming and drawing application.
On Athena, if you have added the 6.170 locker and are on a Sun or Linux machine, then you should be able to run Dia by typing
athena% dia &
You can also download Dia from its homepage at http://www.gnome.org/projects/dia/.
Dia can export its diagrams as Encapsulated PostScript files, which you can then convert to PDF. Or, you can print the diagrams from Dia itself.
If you have problems using Dia, see the below links:
xwrits is a program that reminds you to take typing breaks, which are important for your health. It runs on Unix/X-window systems, and is available on Athena in the outland locker. There are lots of ways to customize and use xwrits; here is one way which is strict about preventing you from typing:
athena% add outland athena% xwrits typetime=5 breaktime=0.50 +beep +clock +idle +mouse maxhands=5 +multiply +noiconify +lock &
You can also put the xwrits command in your .startup.X file.
If you choose to do some or all of your work on your own computer, instead of on Athena, then see the document on working at home.