Quick & Dirty Guide to Getting Started in CSE 341

Reflection X

We'll use Reflection X to run X Window, which will give you a graphical interface for your Unix session on Attu (attu.cs.washington.edu).

Logging in from the basement labs.

If you're going to be using the labs, everything is all set up for you. Simply go to Start Menu --> All Programs --> Internet & Remote Connections --> SSH --> X Connections --> SSH-X Attu

Type in your CSE account password and you're all set. Now type "xterm &" without the quotation marks to get an xterm.

Logging in from elsewhere

If you want to set up Reflection X to use on some other computer, or to use at home, check the CSE support pages, particularly here, for useful info. If you're having trouble with this, check CSE Support's page on Starting UNIX X Clients From Windows XP.

Basic Unix commands

To move around through the directory structure in your xterm window, you'll need to know a few basic Unix commands.
attu4% mkdir mydir
attu4% ls
mail  mydir
attu4% cd mydir
attu4% pwd
/homes/iws/sbfan/mydir
attu4% exit
In the above (the things within the quotation marks are commands to type, don't type the quotation marks themselves): These are just the very minimum basics. For more info on Unix, look at the course help page on Unix.

SML/NJ

This is all in the course help page for SML/NJ, but here it is in condensed form:

To run SML/NJ from Unix/Linux, just type "sml" at your terminal command prompt. To get out of SML/NJ, type C-d.

To run it from Windows in the labs, you can find SML/NJ (Standard ML of New Jersey) in Programs under the Start Menu.

To load a .sml file into SML, type "use "filename.sml";" while within SML/NJ.

Emacs

Now that you have your xterm open, let's open Emacs.

Type "emacs &" to open emacs in a new window. Note what happens if you don't type the "&"--you can't do anything in your xterm window. The "&" runs your program, in this case, emacs, in the background.

The following stuff on Emacs is lifted straight from Keunwoo's Spring 2001 section notes:

[GNU Emacs: a labeled diagram]

Emacs uses many key combinations involving the Control and Meta keys. Such key combinations are denoted C-x (Control-x (lowercase)) or M-x (Meta-x). On keyboards that don't have Meta, Alt is usually an acceptable substitute. If Alt doesn't work, ESC-x is equivalent to M-x.

A sequence of key presses is written like C-a C-b M-x, which would mean do the three actions in sequence.

The most important keys in Emacs Getting help in Emacs (the next most important keys)

SML/NJ in Emacs

Remember the Emacs modes we were talking about earlier? You can run emacs in SML mode, but you'll have to set up a few things first. You can read all about it on the course help page for SML/NJ, but to get you up and running, do the following: If you're using Linux/Unix from the CSE labs: That's it. To check if it works, you need to restart Emacs. Save your file (C-x C-s) and quit Emacs (C-x C-c), and open it up again. Open any file with a .sml extension (type "C-x C-f" and then "test.sml"). See how your mode line says "(SML)"? Yay! You're set!

The following is, again, info straight from a previous quarter, repeated here for your convenience:

There are two ways to run SML/NJ from within Emacs

Save an SML/NJ transcript

Often, you will want to save output of an entire SML/NJ session. How can you do this? Here's a few alternatives:

Method 1: Saving within Emacs

If you use the method described above for running SML/NJ under Emacs, you can save the *sml* buffer the same way you save any other buffer: switch to the buffer's window and hit C-x C-s. You will be prompted for a filename. You can save as many times as you wish.

Method 2: Copy and paste

In the X Window System, the idiom for "copy and paste" is to select a region, and then click the middle mouse button (the mouse wheel on an MS mouse suffices) at the spot you want to paste the selected region:

[GNU Emacs in sml-mode with a child SML process]

Method 3: Pipes

This method is only suitable if you want to run a single file through SML/NJ and capture the results, without actually interacting manually with SML/NJ. Invoke SML/NJ as follows:

sml < myinputfile.sml > myoutputfile.txt

The < sign means "redirect standard input from this file", and the > sign means "redirect standard output to this file". Pipes are a very important and powerful feature of Unix. Learn to use them!

Method 4: if you are in SML/NJ for Windows

Right-clicking within the window should bring up options for selecting all, copy/pasting, etc.

Accessing your UNIX home directories from Windows XP

If you're in the basement labs, your O: drive should already be mapped to your Unix home directory. Look under for the O: drive under "My Computer" in the Start Menu. To accesss your files, go to O:\unix\homes\iws\userid, replacing "userid" with your own CSE account username. All the files you saved while working on Attu should be there.

If you're in the labs and your O: drive isn't mapped, open up a Windows Explorer window (by clicking the "My Computer" from the Start Menu) and in the Tools menu item, select "Map Network Drive" and enter O: for drive and \\ntdfs\cs for folder. Click Finish. If you're at a computer that does not use CSE's name servers, for example in Mary Gates Hall or at home, you will need to use the fully qualified name, \\ntdfs.cs.washington.edu\cs.

For more info on this, see the CSE support page that discusses Microsoft DFS, which is what we just used.


Finally, above all, if you need help, there's always the course help pages as well as the CS Lab and Support pages. Read through to see if your question hasn't already been answered!