|
It is possible to do all of your programming in COS 126 from home. In this document, we provide some instructions to help you do this. We assume you are running Windows 95/98/00/NT/ME and have some familiarity with it. Most of the techniques below also apply if you are using Mac OS. We've marked with a blue ribbon the programs and configurations that we think a majority of students will find most comfortable. Future CS majors may wish to experiment with more advanced configurations.
|
Most of you will not have Unix loaded on your hard-drive. So, if you want to work from home, the easiest solution is to connect your computer to another, more powerful computer (arizona system), which already has Unix. This will enable you to edit, compile, run, and submit your programming assignments. You can connect through telnet, a protocol (similar to http and ftp) for communicating between computers.
Running telnet. The simplest way to open a telnet session is to type the following in the URL line of your web browser:
A new window should pop up, prompting you for your arizona login name and password. Once you are connected, you should see the arizona prompt:telnet://arizona.princeton.edu
and a blinking cursor. Note that the name phoenix might be replaced by the name of another (equivalent) server. At this prompt, you type commands, which is the Unix equivalent of clicking on an icon in Windows.phoenix.Princeton.EDU%
QVT/Term. The officially supported Windows telnet client at Princeton is the shareware program QVT/Term. If you are a Princeton student, you can download a licensed version from the DORMPRINT server or from here. One benefit of using QVT/Term is that the arrow keys will work properly.
No GUI. Some of the commands that work in the CS 101 lab will not work from home. This is because telnet only transfers text back and forth between your machine and the arizona system, so you lose the graphical user interface (GUI) that you are accustomed to. For example, you won't be able to directly display the PostScript graphics files that you create. The rest of this document addresses different methods for coping with this.
|
ftp is a file transfer protocol for transferring files back and forth between your home PC and a remote computer (e.g., arizona). The officially supported Windows ftp client at Princeton is the shareware program WS_FTP. If you are a Princeton student, you can download a licensed version from the DORMPRINT server or from here. Follow this link to for CIT's instructions on using ftp.
|
The most common method for working from home involves using two telnet sessions, one for editing your programs, and one for running them.
Editing. The simplest (but not necessarily the most fun) way to edit your programs is to use the emacs editor on the arizona system. If you use telnet, you will lose the graphical user interface, and the mouse will not work. This means that you will need to remember a few keystroke combinations to manipulate files and edit text. Here are some of the most useful ones:
C-x, C-s save C-spacebar set mark C-x, C-c quit C-w cut from cursor to mark C-x, C-f open file M-w copy from cursor to mark C-x, C-s save C-k cut from cursor to end of line C-g quit minibuffer C-y paste C-_ undo C-s search C-c C-c compile C-2 make two windows C-c C-n find next error C-1 make one window C-x o goto other window
Printing. The Unix printing commands (lpr, enscript) will continue to send output to the printer in the CS 101 lab. To output a text file to your own printer, use ftp to transfer the file to your home PC, then launch any text editor (e.g., Notepad), and print your file.
|
Instead of writing your programs on arizona using emacs, you can use any Windows text editor. You will still use one telnet session to compile and run your program. The advantage of this approach is that you don't need to remember the arcane emacs commands. The downside is that you need to transfer files back and forth between your PC and the arizona system each time you wish to compile them.
Editing. You can use any text editor to write your programs. However, we strongly recommend installing a "programmer friendly" text editor, instead of Notepad or MS Word. The shareware text editor Ultra Edit supports many of the same features as emacs, including: line numbering, syntax highlighting, auto-indenting, brace-matching, block commenting, and function listing. Ultra Edit also allows you to convert the DOS carriage return to a Unix newline (Use the menu option File-Conversions-DOS to Unix). This may be necessary in order for your files to compile and print properly on arizona. Be sure to set the permissions of your files appropriately, so that they are not world readable.
Transferring files. There are two common methods for transferring your files between your home PC and the arizona system.
Printing. Print from your Windows text editor as usual.
|
In order to run and compile your programs from home, you need to install a compiler. There are a few different options. You will only need to use arizona to submit your programming assignments (and check that they work on arizona).
|
We describe a more advanced setup, that is used by most cs grad students and faculty.
|
The Unix commands gs and lpr allow you to view and print PostScript files. To accomplish the same effect at home, you need to transfer the PostScript files to your computer (using ftp or sambaserver), and then launch a PostScript viewer for Windows.
Alladin GhostView. Alladin GhostView is installed on the Windows NT clusters: go to Special Software / Courseware GhostScript / GhostView. To install it on your home PC, download the Ghostscript 5.50 / GS View 2.7 bundle. Be sure to download the version for your platform (Unix, Windows, DOS, Mac). Also note that version 6.0 does not yet come bundled with a viewer, so the easiest thing to do is use version 5.50.