MC27L Lab 0: Getting Started (Spring 1997)

February 11, 1997

Introduction

The purpose of this lab is to familiarize you with the computer facilities and simple programming in Scheme. You do not need to hand anything in and you will not be graded on your work (except if you choose to work in part on your first homework). The lab itself consists of a number of tasks which will help you gain familiarity with the SGI computers you will be using in this course. Although we assume in the following that you have never logged into an SGI computer on the campus, these computers have a reasonably intuitive user interface. Therefore, rather than explaining how to do each task in gory details, we will simply give you the tasks together with some optional explanations you can refer to if you find the tasks obscure or otherwise difficult. However, we encourage you to try to figure out how to do the tasks on your own. When that doesn't work, don't be shy: ask!

Resources

The classroom/lab we will be using for the lab sessions consists of 17 computer workstations which are part of the campus-wide computer network; of these 17 computers, 16 are SGIs (the blue or purple computers with cream or grey monitors) and one is a NeXT (the black one). There are two types of SGI computers: 13 are Indys (the ones with the monitor on top of the blue box) and three are Indigos (the ones with a purple box to the side of the monitor). All of the computers are usable for MC27, but the software is somewhat different, so you will need to recognize the distinction. Since you will generally be using the SGIs during the labs, this handout will focus on how to use them. A separate handout will describe how to use the NeXTs, since you might well need to use them (for example if this lab is otherwise scheduled and you need to work in the other lab, which has 16 NeXTs).

There is a printer in the small room adjoining the classroom/lab; it's name is mcs_next_lab, so if you need to select a printer to print to, that is the one you should use when in this area.

Each Gustavus student has been given a computer account; this handout assumes that you already have read your account letter and changed your password. If not, and you need help with this, let one of us know. It does not matter which workstation you log into; you will have access to all your files on all computers, since they are stored on a central ``file server.''

The following instructions assume some familiarity with such terms as double-click and drag which refer to the use of the mouse (the small doohickey next to the keyboard). If you don't understand something or if the instructions seem impenetrable, don't worry. These are examples of things better shown than described in words. Ask your lab instructor or one of the tutors to explain it to you. Also, feel free to talk with your fellow students. Computers are unfortunately fraught with many arcane terms, and defining them all would unduly clutter these handouts. Fortunately, if you are not shy about asking someone when you have a question, you should get the hang of it fairly quickly.

In lab

  1. Login to an SGI.

    Use your username and password. There may be a delay after you enter your username before the computer asks for your password; this is normal if the computer hasn't been in use for a while.

  2. View your home directory.

    The Unix computers on campus (among which are the SGIs and NeXTs) have a tree structured file system. This means that the files on the computers are located in directories, which may themselves include files and subdirectories, which may contain files and other subdirectories, .... When your account was created, you were given a home directory in which you can store and create files and subdirectories. You can view your home directory by selecting the ``Desktop/Home Directory'' submenu item in the ``Desk 1'' menu, as described in more detail below. Do so and see what it shows you. One important note on the detailed instructions below: whenever a mouse action is called for, use the left mouse button. Unless told otherwise, you should assume this throughout.

    You can access most of the applications on the SGIs using the ``Desk 1'' menu in the upper left-hand corner of your screen. If you click on the ``Desktop'' item in this menu, you will see a submenu that includes ``Home Directory.'' After clicking on that submenu item, the directory window will appear on the screen. It will initially just be an outline, which you can position wherever you'd like it. Click the mouse button when the outline is where you want it. You can later reposition the window by dragging the bar at the top of the window while holding down the left mouse button. You can resize the window by dragging its extreme outer edge.

    There are two especially useful buttons on the top of (nearly) every window: in the top left is a button which allows you to close the window and stop the application; simply double-click on this button if you want to do this. The other useful button, which is nearly in the top right-hand corner, allows you to miniaturize the window. Click on this button. A small icon will be created which, when clicked on, will pop the window back up. The SGIs allow you to have many applications running simultaneously, and miniaturization lets you keep your computer ``desktop'' (the main portion of the computer's screen) reasonably clean.

  3. Add some sub-directories (also known as folders) to your home directory.

    Rather than storing all the files you create directly in your home directory, it is much better to take organize the files in subdirectories. For example, you can create a subdirectory called ``MC27'' for this course by selecting the ``New Directory'' menu item in the ``Selected'' menu in the home directory viewer. Do this. Notice that a new directory called ``empty.dir'' is created in your home directory. You can change the name of this directory to ``MC27'' by directly selecting and changing its name, ending with the Enter (carriage return) key. Do this as well.

  4. Change the file viewer to the MC27 subdirectory and create a subdirectory called ``Lab0.''

    You can open up a separate file viewer for the MC27 subdirectory by double clicking on the MC27 icon. Alternatively, you can zoom in the focus of your existing viewer from the home directory to the MC27 subdirectory by dragging the MC27 icon onto the open file foler at the top of the viewer. Either way, once you have a viewer for the MC27 subdirectory, you can create a new directory inside it and rename it Lab0.

  5. Find SchematiX and add it to your desktop.

    Next, you need to add a program called SchematiX to your desktop. chematiX is the programming environment you will be using in MC27, on the SGIs. To add SchematiX to your desktop, select the ``Find/An Icon'' submenu item in the Desk 1 menu. Point the mouse arrow into the pink area of the ``Find an Icon'' window and type ``SchematiX'' there. A white, roughly kite-shaped, icon should appear in the blue square to the left of the pink area where you're typing. (See the illustration that follows: (screen image).) That is the SchematiX icon; drag it using the mouse to any vacant area on the desktop, i.e., the blank background of the screen. (Do not drag it into your folder in the file viewer, or onto your folder's icon on the desktop background. That would make your own copy, which is undesirable. Just drag SchematiX into blank background space.) You can now make the ``Find an Icon'' window go away if you want, by double-clicking on the horizontal bar that is to the left of the title ``Find an Icon.''

    Your account is now set up. Whenever you login, all you need to do to start SchematiX is to double-click on its icon; the rigamarole of finding it is over. At least, that is true on this one SGI, and it can be true on all the SGIs if you want. All you have to do is the first time you log in on a new SGI that you haven't used before, respond to the panel that pops up upon login by saying that you want to ``share'' the same desktop. (Ask for help with this the first time you login on a different SGI if you need it; for now it isn't an issue.)

  6. Start up SchematiX and play around.

    Start SchematiX by double-clicking on its icon. Wait for a while for SchematiX to finish starting up; you'll know its done when it prints out a line starting with ;SchematiX Gambit. Try evaluating some expressions, such as those on pages 15--17 of the text. To evaluate an expression, you just type it in and then press the Enter key that is in the numeric keypad. For example, if you wanted to know what 5+12 equals, you would type in

                (+ 5 12) 
    
    and then press the Enter key on the far right of the keyboard (in the numeric keypad). Scheme then responds with
                ;Value: 17
    
    What happens if you try to evaluate just a plain number? Try several expressions, of varying degrees of difficulty. Try some nested expressions. Try breaking a big complicated nested expression into several lines to see how the automatic indentation works. To break onto a new line, use the the normal carriage-return key (also labeled ``Enter'') on the main part of the keyboard.

    By the way, there are other ways you can evaluate as well, as alternatives to the Enter key on the keypad. If you are a touch typist, you might prefer to hold down the Ctrl key as though it were a shift key, and with it down press the normal carriage-return key on the main part of the keyboard. (Without the Ctrl key, this would just start another line, rather than evaluating anything.) Try this. Also try using the mouse by selecting the Evaluate option in the Actions menu. (If you want to evaluate an expression other than the one where the blinking insertion bar is, or if you want to evaluate just one part of a larger expression, you will first have to select the expression using the mouse.)

  7. Create and save a file titled ``lab0.scm'' in Schematix in your MC27/Lab0 subdirectory.

    You can create a new file in SchematiX by selecting the ``File/New'' submenu item. A new window will pop up for this file, which is not yet named. You can name it by selecting the ``File/Save'' submenu item, and then saving it as ``lab0'' in the MC27/Lab0 subdirectory (note that ``.scm'' is automatically appended at the end, indicating this is a Scheme file).

  8. Evaluate an expression in ``lab0.scm'' window.

    Notice that the output goes to the interaction window even when the evaluated expression is in another window.

  9. Print the contents of one of the window.

    Select the ``File/Print'' submenu item and, when asked for the printer, select mcs_next_lab.

  10. Evaluate an erroneous expression.

    Sometimes Scheme can't understand your request or carry it out. For example, if you try to evaluate (/ 1 0) an Error panel will appear, telling you that division by 0 is an error. (Try this.) Often you won't understand the messages in error panels; in these cases ask your lab instructor or assistant. For now, the rule for how to respond to an error is simple: ``just say yes.'' In other words, always click the Yess button telling Scheme to abort out of the erroneous computation. Later we'll tell you when and why you might want to use the ``no'' option, but for now, just say yes.

  11. Continue experimenting with expressions.

    Try using define to define some names and then use those names in other expressions. What happens if you use a name that you haven't defined?

    Make sure you are comfortable with Scheme's prefix notation by finding the value of (3 * 5 - 6 * 2) * 5 and other expressions like that. Also, do exercise 1.1 from the book (page 17), predicting each answer before you try it out on the computer.

    If you have additional time after completing the tasks above, you may want to use some of your time to work through the examples from section 1.2 of the text or to try out your solutions to the first homework assignment. Also, feel free to come back at another time to get better acquainted with the SGI computers and the SchematiX programming environment. The hours are posted outside the lab. Another possibility would be to let this lab 0 spill over a bit into Thursday, when we'll be starting lab 1.

  12. Do some web surfing using netscape.

    First, use the icon-finder to find the program netscape, and move its icon to your desktop. Launch netscape. The first time you launch netscape you'll need to agree to a contract and ok some suggestions. In short, the contract says, ``Don't take advantage of the Gustavus' site-license agreement.''

    Locate the Gustavus Adolphus College homepage by entering http://www.gac.edu/ in the Location box and pressing Enter. Since you may not want to remember this address for next time, select ``Add Bookmark'' under the Bookmarks menu. Next time you want to find the Gustavus homepage, select ``Gustavus Adolphus College Homepage'' under the Bookmark menu.

    Now, navigate to Max Hailperin's homepage. Hint: First click on ``People'' in the Gustavus's homepage; this is called following a link. As you work your way towards Max Hailperin's homepage and from there to the page of MC27L materials, try clicking the ``Back'' and ``Forward'' along the top row of buttons. Once you find the homepage, you may want to add another Bookmark. Find the MC27L course materials and look at a copy of this lab assignment.

  13. When you are finished, quit SchematiX.

    A panel will pop up asking whether you want to save the interaction window. (If you modified the lab0.scm file after saving it, you'll be asked about it as well.) After choosing one of the options (excepting Cancel, which puts you back in SchematiX), you can then logout. The logout option is again in the Desk 1 menu's Desktop submenu. Be sure to respond to the ``Do you want to log out now?'' confirmation panel by clicking the ``Yes'' button.

Follow-up

The SGI and NeXT workstations are general purpose computers which have a wide range of applications, including word processing, electronic mail, a mathematical application called Mathematica, and programming tools, to name just a few. As long as you remain a responsible user, you are welcome to use these applications as you please for other academic purposes. However, if you are working on something other than a math or computer science project, and all the machines fill up, please give your machine up for a student working on math or computer science. That way, with a little common courtesy, we can get the maximum benefit out of these facilities and still respect the fact that they've been funded for use in mathematics and computer science.

One problem you will encounter is how to make yourself aware of all of the applications available to you. This is a rather daunting task, and one which we will not directly address in this course. Instead, we suggest that you make use of the main source of useful computer arcana and trivia we have found, namely your fellow computer users. We are always learning new things from our students. So don't be shy!


Course labs web site: http://www.gac.edu/~max/courses/S97/MC27L/
One lab instructor: Karl Knight <karl@gac.edu>
The other lab instructor: Max Hailperin <max@gac.edu>