Quick & Dirty Guide to Getting Started in CSE 303

Acknowledgment: These notes have evolved over the last few years, but are largely based on notes written by Keunwoo Lee in 2001. They started as a guide to CSE 341; information on SML has been removed.

Reflection X

We'll use Reflection X to give you a graphical interface for your Linux 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 double-click the "SSH-X attu" icon on the desktop. Type in your CSE account password and you're all set. Now type "xterm &" without the quotation marks to get an xterm (a shell).

Working elsewhere

We recommend you work in the basement labs where we have checked that the right software is already installed and the directions we provide are correct. If you still want to work elsewhere you have a few options. You should test your homework on attu.
  1. Install the necessary software on your computer. Linux and everything we will use in this course is freely available.
  2. Install Reflection X on your computer, using the CSE department instructions. What a Reflection X session does is connect you to a CSE UNIX server. Everything you type or click is sent to the server, which sends back to your computer what to display. So you're using the department's software installation.
  3. For those savvy with terminals and ssh, it is possible to run emacs and sml directly in terminals after connecting via ssh to the department, but it is not particularly pleasant.
  4. You can change your desire to avoid the department labs.

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, or course.

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.

[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) Some other useful keys:

Font-coloring in Emacs

Remember the Emacs modes we were talking about earlier? The modes for shell-scripting and C programming do a pretty good job of coloring your code, but you may need to say you want that: 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 a file that starts with
#!/bin/csh
(or create one, close it, and reopen it). Builtins like if and set should be in different colors.

Accessing your Linux 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, there are other resrouces, including the CS Lab and Support pages.