Working From Home

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.

Opening a Telnet Session to Arizona

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:

telnet://arizona.princeton.edu
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:
phoenix.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.Student's Choice

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 backspace and 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.

Opening an Ftp Session to Arizona

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.

Writing and Running Programs on Arizona

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.

Writing Programs from Home, Compiling and Running on Arizona

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.

Student's ChoiceEditing.  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.

  • ftp. Use an ftp application to download or upload files. Be sure to transfer your text files in ASCII mode; otherwise your files may have "strange" characters in them that will irritate your grader.

    Student's Choice

  • samba server. A more seamless solution is to use the samba server. This enables you to view and access files on the arizona system as if it were a local hard drive. To do this follow CIT's instructions for using the samba server. Note that your computer needs to be logged in to the Princeton NT domain (dormnet) for this to work.
  • Printing. Print from your Windows text editor as usual.

    Writing, Compiling, and Running Programs from Home

    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).

  • lcc. The free ANSI C compiler lcc-win32 is available for Windows. It comes with integrated editing and debugging tools.

  • Commerical compilers. There are a number of commerical C compilers, including Microsoft Visual Studio, Borland C++ Builder, and Code Warrior. Many come with integrated editing and debugging tools. Your programs must be written in ANSI C, so that they can be compiled with any ANSI C compiler (e.g., gcc). It is your responsibilty to ensure that you do not use any compiler or operating system specific features.

  • Linux. You can install Linux on your home PC. This is not for the squeamish, but once you install it, you will have all the standard Unix tools at your disposal including gcc, emacs, and gs along with a X-Windows desktop environment.

    Writing and Running Programs on Arizona: Advanced Configuration

    We describe a more advanced setup, that is used by most cs grad students and faculty.

  • ssh. If you value your privacy, use ssh instead of telnet. It's basically the same as telnet, except that all communication between your home PC and the arizona network is encrypted. With telnet, an eavesdropper can see everything you type, including your password! The CS department uses SecureCRT as their ssh application. If you are a Princeton student, you can download a licensed version of Secure Shell 2.3.0 here.

  • X-Windows emulator. An X-Windows emulator enables you to enjoy a graphical user interface that is similar to the one in the CS 101 lab. This means that graphical programs like xemacs and gs will now work from home, as they do in the CS 101 lab. The CS department uses Exceed from Hummingbird Communications. Another competing product is X-Win32 from StarNet Communications: they offer a 4-year student license for $75. The X-Windows emulator MI/X is installed on CIT Windows clusters; it is also available for the Macintosh (although a few Mac users have reported problems when used with gs).
  • Viewing and Printing PostScript Files

     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.Student's Choice

    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, go to the Ghostscript home page and download AFPL Ghostscript 6.50 and the PostScript viewer GSview 3.6. Be sure to download the version for your platform (Unix, Windows, DOS, Mac). For Windows systems, download the self-extracting EXE files gs650w32.exe, then gsv36w32.exe.



    Kevin Wayne