CSC 105 Grinnell College Spring, 2005
 
An Algorithmic and Social Overview of Computer Science
 

Laboratory Exercise on Getting Started with MathLAN

and Experiments with Numeric Processing


As the first laboratory exercise for CSC 105, this lab has two parts:

  1. Getting started with MathLAN, including experience with logging into the system, using a terminal window, and opening a browser.

  2. Experimenting with integers.

This file contains the background material for using the MathLAN computers. The above link leads to the instructions related to integer storage and processing.

Acknowledgment: Most of the following material is a mildly edited version of the document, Getting Started, written by John David Stone for CSC 151.


Logging in and out

Discussion

Suggestion: Please read this section on logging in completely first. Then log in following the steps at the end of this section.

To use any of the computers in the Mathematics Local-Area Network (MathLAN), one must log in, identifying oneself by giving a user name and a password. Before or during the first laboratory session in CSC 105, 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. (You may also have to click the left mouse button to make the window active.)

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.

Steps for this Lab

With the above as background, you will want the system to use the GNOME user interface when you log into your account on MathLAN. To accomplish this, please follow these steps when you first long in:

  1. Before logging in, move your mouse to the Session tab on the log in window.

  2. Use the mouse to select GNOME as the desired option.

  3. Provide your username and password as you log in.

  4. If asked, confirm that you do indeed want to use the GNOME user interface.

The shell and the terminal emulator

Discussion

Note Again, it is suggested that you read this section about terminal windows before typing at your computer.

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.

Steps for this Lab

Now that you have read about the terminal window, try activating a terminal window with these steps.

  1. After logging in, open a terminal window by moving the mouse onto the small monitor icon on the bottom row of the front panel, and clicking with the left mouse button.

  2. Try closing the terminal window by typing <Ctrl/D> at the prompt.

Changing your password

Discussion

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:

(screenshot)

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.

Steps for this Lab

At this point, you should consider changing your password (unless you have already changed your MathLAN password recently).

  1. Open a terminal window again. Then change your password by typing password in a terminal window and following the prompts that follow.

Firefox

Discussion

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

Starting up and shutting down

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 105: An algorithmic and social overview of computer science (Mr. Walker)." Move the pointer onto this listing and click the left mouse button. "The origin" is replaced with the document entitled "An algorithmic and social overview of computer science," which currently matches the paper handout that you received on the first day of this course. 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.

Backing up

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.

URLs

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.walker.cs.grinnell.edu/courses/105.sp05/labs/getting-started.shtml

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.

Bookmarks

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

Steps for this Lab

  1. Open the Mozilla Firefox browser by clicking on the Firefox icon (the picture with a world globe at the bottom panel of the screen).

  2. If this is your first time running Mozilla Firefox on MathLAN, you may encounter two message boxes, asking your consent to the Firefox licensing agreement and requesting permission to create some configuration files in your home directory. You should approve both of these requests by clicking on the appropriate response box.

  3. Initially, Firefox should show this department's origin page:

         http://www.cs.grinnell.edu/origin.xhtml
    

    Examine the course listings on the left to find the home page for this course.

  4. Use the Bookmarks option at the top of the browser to Bookmark This Page for future reference.

Experiments with Numeric Processing

Now that you have logged into MathLAN and gained experience with a terminal window and with Mozilla Firefox, you are ready to move ahead to experiments with integer processing.


This document is available on the World Wide Web as

http://www.walker.cs.grinnell.edu/courses/105.sp05/getting-started.shtml

created January 30, 2005
last revised February 13, 2005

Valid HTML 4.01! Valid CSS!
For more information, please contact Henry M. Walker at walker@cs.grinnell.edu.