To use any of the computers in the Mathematics Local-Area Network, one must log in, identifying oneself by giving a user name and a password. At the first meeting of the class, you will receive a MathLAN user name and password from the instructor if you did not already have one.
When a MathLAN workstation is not in use, it displays a login screen, with a space (initially labelled `Username:') into which one can type one's user name and, later, one's password. If the workstation's monitor is dark, pressing the Shift key or moving the mouse usually causes the workstation to display the login screen.
Moving the mouse around on its pad causes a mouse-controlled pointer to move around in a corresponding way on the screen. Use the mouse to move this pointer into the center of the screen, then type in your user name, in lower-case letters, and press the 〈Enter〉 key that has a bent arrow on it. The label changes to `Password'. Type your password into the space provided and press the same 〈Enter〉 key. (Because no one else should see your password, it is not displayed on screen as you type it in.)
At this point, a computer program that is running on the workstation consults a table of valid user names and passwords. If it does not find the particular combination that you have supplied, it reports that the attempt to log in was unsuccessful (``Authentication failed''). Wait until the `Username' label reappears and then try again.
When the login program has verified your user name and password, it activates a user interface, a program through which one manages various programs and resources that the workstation can access. Our user interface is called GNOME. It takes a few seconds to prepare this interface; during this short period of preparation, the workstation displays a blue transition screen.
When GNOME takes over, you see at the bottom of the screen a front panel decorated with a variety of icons. You can use most of these icons to activate computer programs. If one places the mouse pointer on top of one of the icons and clicks on the leftmost of the three buttons on the mouse (pressing and releasing it immediately), the program represented by the icon starts to run.
The programs that you start in this way display their output in windows -- rectangles drawn onto the screen, as if superimposed on the colored background. Each window is enclosed in a frame, with a title bar at the top that is drawn in one of two contrasting colors, depending on whether or not the window is active: At any given moment, the active window is the one to which whatever words or symbols the user types in are directed. A window becomes active when you move the pointer to some exposed point inside the boundary of its frame.
If you want to put a window aside for the moment, with the possibility of returning to it later, look closely at the upper right-hand corner of the window, where the frame contains a small square with a horizontal line, like an underscore, in it. If you move the pointer into that square and click on the left mouse button, you minimize the window, closing it up into a small rectangle on the front panel. An iconified window can be restored by moving the pointer onto that small rectangle and clicking the left mouse button.
When you are done using a workstation, you must log out in order
to allow other people to use it. To log out, move the pointer onto the
arrow-on-door icon at the right end of the front panel and click the left
mouse button. A confirmation box pops up, asking you to
verify that you're ready to log out; move the pointer onto the word
OK near the bottom of this box and click the left mouse button.
GNOME vanishes, and after a few seconds the login screen reappears. This
confirms that you're really logged out.
It is not necessary to turn off the workstation when you are finished. MathLAN workstations can and usually do operate continuously. Turning them off and on may actually shorten their life expectancy.
Once you're logged in, it would be a good idea to change your password to something more memorable (but still difficult for others to guess -- think of something arbitrary but vivid). The program that changes passwords is not represented by an icon on the front panel; to run it, you must invoke it by name. A computer program that reads and responds to such invocations is called a shell, and your interactions with the shell takes place in a window generated by a program called a terminal emulator.
Fortunately, there is an icon that starts the terminal emulator -- it's the icon that looks like an old-fashioned monitor, near the left end of the front panel. Move the pointer onto this icon and click the left mouse button. Shortly a window appears, displaying the shell prompt -- the name of the workstation on which the shell is running, followed by a dollar sign. This prompt indicates that the shell is ready to receive instructions.
You type in such instructions using the keyboard. Move the pointer into the terminal emulator window to make it active. Notice that the window frame's title bar changes color when the pointer crosses it, indicating that the window has become active.
To shut down the terminal emulator, press 〈Ctrl/D〉 -- that is, hold down either of the keys marked 〈Ctrl〉, just below the 〈Shift〉 keys, and simultaneously press the 〈D〉 key. (On our workstations' keyboards, the keys marked 〈Ctrl〉 (``control'') and 〈Alt〉 (``alternate,'' sometimes called ``meta'') are somewhat like 〈Shift〉 keys, in the sense that they modify the effect of other keys that are pressed simultaneously.) The shell program interprets 〈Ctrl/D〉 as a signal that you have no more instructions for it and halts, and the terminal emulator closes the window automatically once the shell stops running.
It is a good idea to change the password associated with your account
shortly after you receive it and every few months thereafter. The program
that one uses to change one's password is also invoked by its name,
password.
Open a terminal emulator, move the pointer into it, and type the word
password. The password program prompts you once
for your old password -- the one you logged in with -- and twice for your
new password. If you give your old password correctly and the two copies
of your new password match, the program substitutes the new password for
the old one in the table that the login program consults. The old password
is discarded and will not be recognized in subsequent logins. (If the
attempt to change the password fails for any reason, however, the old
password is retained.)
After a successful attempt to change your password, the terminal emulator looks like this:
After running the password program, the shell takes over again and
issues another prompt. You can invoke as many programs as you like from
the shell, one after another, before pressing 〈Ctrl/D〉 to leave the
shell.
Many of the handouts and other materials for this course will be distributed over the World Wide Web rather than in paper copies. You can display World Wide Web documents in a window on a MathLAN workstation by invoking the Firefox browser, a computer program designed specifically to display such documents. (Actually, you can read the handouts for this course on any computer that has a connection to the Internet, and use any browser to display them.)
To start Firefox, move the pointer onto the blue globe icon on the front panel and click the left mouse button.
Initially, Firefox displays a World Wide Web document entitled ``The origin,'' which is an entry point to Web site of the Department of Mathematics and Computer Science. In the left-hand column of this document, under the heading ``Course front doors,'' you'll see the underlined listing ``CSC 151: Fundamentals of computer science I (Mr. Stone).'' Move the pointer onto this listing and click the left mouse button. ``The origin'' is replaced with the document entitled ``CSC 151: Fundamentals of computer science I,'' which currently matches the paper handout that you received at the beginning of class. This is the course's front-door page. Its contents will change from time to time during the semester. It is convenient to start from this page whenever you're looking for a World Wide Web document related to the course.
Most users of the World Wide Web load most of the documents they examine in just this way -- by clicking on an underlined phrase in the currently displayed document that links to another document of interest. You can follow links in this way indefinitely.
At the top of the window, just below the frame, is a menu bar, providing ways of activating various operations that Firefox can perform. Eventually you may want to explore a number of these, but for the moment let's just look at one that you're certain to need: the operation of shutting down the program.
Move the pointer onto the word File at the left end of the
menu bar, and click the left mouse button. A small menu
appears. Move the pointer onto the word Quit at the bottom of
this menu and click the left mouse button. The Firefox window disappears.
Firefox maintains a list of documents that you have previously loaded, so that if you decide you want to look at one of them again, you can back up to it. Clicking on the green leftward-pointing arrow at the left end of one of the bars near the top of the Firefox window re-loads the document from which you reached the one currently displayed. If you move the pointer onto the tiny black upside-down triangle next to that arrow and click the left mouse button, Firefox displays a menu of the titles of recoverable documents, from which you can select the one you want by moving the pointer onto it and left-clicking again.
After having moved back in this way, you can advance through the same list by clicking on the green rightward-pointing arrow.
Firefox can display many of the documents on the World Wide Web. One way to refer to a document is to give its Uniform Resource Locator, or URL, which is a kind of address by which Firefox locates and requests the document. For example, the URL for this very document, the one you're now reading, is
http://www.cs.grinnell.edu/~stone/courses/scheme/getting-started.xhtml
To direct Firefox to load a document for which you know the URL, move the pointer into the white rectangle to the right of the house icon and click twice, rapidly, with the left mouse button, press the 〈Backspace〉 key, and finally type in the URL and press the [keymap Enter] key. Firefox will find the server that distributes the document, request a copy, and display it if the server can grant the request.
Because URLs are notoriously hard to remember and to type accurately,
Firefox allows you to place a bookmark on any interesting or
important document that you reach. To place a bookmark on the document
currently displayed, move the pointer onto the word Bookmarks above
the main display window, click the left mouse button to bring up the
corresponding menu, and select the Bookmark This Page... operation.
A new window, with the title ``Add Bookmark'' will appear. Move the
pointer onto the button marked Add in the new window and click the
left mouse button. You can subsequently return to that document by
bringing up the Bookmarks menu again and selecting from it the title
of the document.
For instance, I recommend that you bookmark the front-door page for this
course, so that you can return to it easily, no matter what document is
currently displayed. Load it into the Firefox window (perhaps by using the
backing up to it) and then use Bookmark This Page....
Many of the fundamental ideas of computer science are best learned by reading, writing, and executing small computer programs that illustrate them. One of our most important tools, therefore, is a computer program designed specifically to make it easier to read, write, and execute other computer programs: a programming environment named DrScheme.
To start DrScheme, move the pointer onto the red, white, and blue lambda-in-a circle icon on the front panel and click the left mouse button. It takes a few seconds for DrScheme to start up completely. When it does, if you're entering DrScheme for the first time, a new window will appear with the title ``Welcome to DrScheme'':
Move the pointer onto the Next button in this window and left-click.
The contents of the window are replaced with an invitation to check to see
whether there have been any updates to DrScheme since it was last installed
on MathLAN. Ignore this invitation and left-click on the Next
button again.
DrScheme can deal with computer programs written in any of a number of dialects of the Scheme programming language. When you start it up for the first time, it expects you to use ``Beginning Student'' Scheme, which is a kind of training-wheels dialect that enables DrScheme to catch and diagnose some common mistakes of novice programmers.
In order to be consistent with our textbook and the other course materials, however, we're going to proceed directly to the complete standard language. Move the pointer onto the phrase ``Standard (R5RS)'' near the top of the window and left-click, so that the window looks like this:
Now left-click on the Finish button to complete the setup. DrScheme
retains the information that you prefer to use full Scheme, so that when
you log in again tomorrow and start DrScheme again, it will automatically
expect programs in that dialect.
DrScheme now closes its welcome window and starts the main interface, which consists mainly of two large white rectangles, one above the other:
The upper rectangle is called ``Definitions'' and the lower one ``Interactions,'' reflecting the different purposes to which we'll be putting them.
At the top of the window, just below the frame, is a menu bar, providing
ways of activating various operations that DrScheme can perform. When
you're ready to leave DrScheme, move the
pointer onto the word File at the left end of the menu bar and
click the left mouse button to bring up a menu. Move the pointer
onto the word Quit at the bottom of this menu and click the left
mouse button.