Getting started

Goals: This lab reviews some mechanics related to the use of the Mathematics Local-Area Network (MathLAN) for CS 151. Specifically, this lab discusses:


Logging in

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. You will have received a MathLAN user name and password from the instructor if you did not already have one. If you have not received a MathLAN user name and password, or if you have forgotten either one, please tell the instructor.

When it is not in use, a MathLAN workstation displays a login screen with a space into which one can type one's user name and, later, one's password. (If the workstation's monitor is dark, press the <Shift> key or move the mouse and the login screen will appear.) Typically, this space is outlined in red; this means that it is ready to receive a user name. Type in your user name, in lower-case letters, and press the <Enter> key. The login screen will be redrawn to acknowledge your user name and to ask for your password; type it into the space provided and press <Enter>. (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 pops up a message box saying that the attempt to log in was unsuccessful and inviting you to try again. Press the <Enter> key to dismiss the message and re-enter your user name and password. Consult the instructor or the system administrator if your attempts to log in are still unsuccessful.


The Common Desktop Environment

When the login program has validated 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 the Common Desktop Environment, or CDE.) It takes a few seconds to prepare this interface; during this short period of preparation, the workstation displays a blue transition screen.

When CDE 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. Moving the mouse around on its pad causes a mouse-controlled pointer to move around in a corresponding way on the screen. If one places this 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, superimposed on the pastel background. (One such window, labeled dtterm, appears automatically the first time you log in. We'll discuss dtterm shortly.) Each window is enclosed in a frame 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 anything the user types will be directed. A window becomes active when you move the pointer to some exposed point inside the boundary of the window frame.

If you want to set 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 dot 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 rectangular icon along the left-hand edge of the screen. A minimized window can be restored by moving the pointer onto its icon and clicking the left mouse button twice in rapid succession.


Netscape Navigator

Many materials for this course will be distributed over the World Wide Web rather than in paper copies. To view materials, such as this course's syllabus and this lab, you may follow these steps:

  1. Prepare to utilize the World Wide Web by clicking on the Netscape icon (the picture with N at the bottom panel of the screen).

  2. The first time you run Netscape Navigator on MathLAN, two message boxes pop up.
    1. One box asks you to consent to the terms of Netscape Communications Corporation's licensing agreement;
    2. One box requests permission to create some configuration files in your home directory.
    You should approve both of these requests by clicking on the appropriate word. The pop-up boxes then disappear; you won't see them on subsequent uses of Netscape Navigator.

  3. Initially, Netscape Navigator displays a World Wide Web document containing its logo, version number, copyright notice, and such like. After a minute or so, or sooner if you click inside its window, the program replaces this document with a startup page entitled ``The origin,'' which is an entry point to the Mathematics and Computer Science Department's web site.

  4. Practice scrolling material shown in the window up and down:
    • Scroll down by moving the mouse to the bottom part of the scroll bar and clicking the left mouse button.
    • Scroll up by moving the mouse to the top part of the scroll bar and clicking the left mouse button.
    • Move up or down by moving the mouse to the shaded part of the scroll bar, holding the middle mouse button down, and sliding the mouse up and down.

  5. Practice moving and resizing the Netscape window.
    • Move the Netscape window by moving the mouse to the labeled bar near the top of the window, depressing the left mouse button, and dragging the window around the screen.
    • Resize the Netscape window by moving the mouse to the small border of a window or to the small corner border, pressing the left mouse button, and moving the border to a new position.
    • In the future, you may find it convenient to move the Netscape window to the upper left of the screen.

  6. To find material for this course, scroll down the "origin" page for the Mathematics and Computer Science Department, click on the line Computer Science and Mathematics Courses; this takes you to the department's home page. Now scroll down this page to find the entry for this course, Fundamentals of Computer Science I, and click on it to locate the syllabus for this course. Next, click on one of the Schedule links to view the current class schedule. (The .dvi format displays material in one type of viewer, while the postscript link uses another viewer. If you use the postscript option and the schedule appears upside down, the schedule may be flipped over by moving the mouse to the "orientation" menu and selecting the "swap landscape" option.)

  7. Click on the line Labs to find a listing of all labs currently developed for this course. Check that this lab is available as Lab 1.

Netscape Navigator options

Each MathLAN user can configure Netscape Navigator to reflect her or his own preferences. Between logins, these preferences are stored in a file in the user's home directory; when Netscape Navigator is started during a later session, they are reinstated from that file.

Every user of Netscape Navigator on MathLAN should at some point perform two specific configuration steps:

  1. Establish a base page -- a starting point for browsing. Here are the Uniform Resource Locators or URLs of some good choices:

    To establish your base page, within Netscape, bring up the Edit menu from the menu bar and select the Preferences operation. A pop-up window appears, allowing you to configure many features of the general appearance of Netscape Navigator. Choose the Navigator option. The rectangle labeled Home Page Location contains the URL of the ``Welcome to Netscape'' document at Netscape Communications Corporation; this is what Netscape Navigator uses by default as a base page. Replace the contents of this rectangle with one of the URLs shown above. (This does not have to be a permanent change; you can change your mind about this configuration at any time within Netscape Navigator.)

    To erase the current contents of the Home Page Location box, move the mouse pointer to the left of the first character in the box, press the left mouse button and hold it down, and drag the mouse pointer rightwards until the entire URL is displayed in reverse video, white letters on a black background. Then release the left mouse button and type the new URL; the old one will vanish as soon as you start typing. Once you have entered the new URL, move the mouse pointer onto the button marked OK at the bottom of the pop-up window and click on it with the left mouse button.

  2. Reduce the disk cache to zero. (The disk cache is a collection of files, stored in your account, containing copies of recently examined documents and graphics. MathLAN does not have enough disk space to allow all users to maintain large disk caches, and they have little effect on the performance of Netscape Navigator in most cases.)

    To reduce the size of the disk cache, bring up the Edit menu again and select the Preferences operation. Again a pop-up window appears. Click on the right-pointing triangle next to Advanced and then click on the Cache option. Erase the number (typically 5000) that appears in the rectangle labeled Disk Cache and replace it with 0. Finally, click on the OK button at the bottom of the pop-up window.


The dtterm terminal emulator

The Scheme system that we shall use in this course is not represented by any icon on the front panel. To run it, one must invoke it by name. The computer program that reads and responds to such invocations is called the shell, and one's interactions with the shell take place in a window generated by a program called a terminal emulator. The particular terminal emulator that we shall use is named dtterm.

You may already have a dtterm window on screen. If not, you can start one at any time by moving the pointer onto the small monitor-and-keyboard icon, fourth from the right on the front panel, and click with the left mouse button. Shortly a window will appear, displaying the shell prompt -- the name of the workstation on which the shell is running, followed by a percentage sign. This prompt indicates that the shell is ready to receive instructions.

One types in such instructions using the keyboard. Move the mouse pointer into the dtterm window to make it active. Notice that the window frame changes color when the pointer crosses it, indicating that the window has become active.

To shut down dtterm, 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> (``alt'' or ``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 dtterm terminal emulator closes the window automatically once the shell stops running.


Practice with dtterm: Changing your password

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.

Choose a new password. Make it something that you can easily remember, but not an English word or a name, since it is easy for system crackers to break in by guessing your password if you choose it from one of those categories.

Open an dtterm window, move the pointer into it, and type the word password. The password program will prompt 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 will substitute the new password for the old one in the table that the login program consults. The old password will be discarded and will not be recognized in subsequent logins. (If the attempt to change the password fails for any reason, however, the old password will be retained.)

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.


The next two sections of this lab are optional today.

  1. If you have time, these sections will help you run the Scheme system and make a few simple experiments.

  2. If you are out of time, do not panic -- there is no need to rush ahead at this time!
Regardless of what time you have now, be sure to read sections 1.1-1.2 of the textbook before the next class.


[Optional -- If You Have Time] Running Scheme

Preparation: Read sections 1.1-1.2 of the textbook.

To run the Scheme system, move the pointer into the dtterm window, type the word scheme (all in lower-case letters), and press the <Enter> key. Scheme will print out a header and then issue its own prompt (a greater-than sign), indicating that it is ready to examine and process any Scheme program that you submit to it:

Chez Scheme Version 5.0c
Copyright (c) 1994 Cadence Research Systems

>

To shut down Scheme, press <Ctrl/d> at the Scheme prompt. The shell comes back and generates another prompt once Scheme has stopped.


[Optional -- If You Have Time] Numbers in Scheme

  1. In Scheme, processing proceeds by typing expressions into the Scheme environment. After each expression is entered, Scheme
    • reads the expression,
    • evaluates the expression to determine its value, and
    • prints the resulting value.
    This read-eval-print cycle forms the basis for all processing within Scheme.

    Numbers are expressions, whose value or meaning is the number itself.
    Type several numbers into Chez Scheme, typing one number at a time. For example, at the Scheme prompt, type

        7
        -10
        3.1415926535
    
    In each case, note how Chez Scheme responds.

  2. Accuracy: Enter a read number with many digits. How many digits are printed in the answer for integers? For reals?

  3. Fractions: Determine what happens when you enter a fraction. For example, what value is returned when you enter:
        3/5
        -18/19
        10/34
    
    How many digits are printed in the answer for rational numbers?


Closing up/Logging Out

If you've successfully logged in, started up and shut down dtterm, changed your password, started Netscape Navigator, selected your base page, reduced the Netscape Navigator disk cache to zero, exited from Netscape, and logged out, you've completed the lab for today.

When one is done using a workstation, one must log out in order to allow other people to use it. To log out, move the pointer onto the EXIT icon near the middle of the front panel and click the left mouse button. A confirmation box will pop 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. CDE 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 are designed to operate continuously; turning them off and on frequently actually shortens their life expectancy.


This document is available on the World Wide Web as

http://www.cs.grinnell.edu/~walker/courses/151.sp99/getting-started.html

created December 29, 1996 by John David Stone
last revised January 21, 1999 by Henry M. Walker

Henry M. Walker (walker@cs.grinnell.edu)