(Updated: 2006/09/21)

CPSC 101 Lab: Getting Started

Last updated by: Michael Chiang

Comments to: Holger Hoos

 


Sources and contributions: Some of the lab materials were taken from the CPSC 100-101 lab manual. The first version of this lab was created by Shelly Zhao. Revisions were made by Tanya Ellchuk, Holger Hoos and Steve Wolfman.

 


Contents

 


Objectives

The purpose of this lab session is to acquaint you with basic things you should know to do when using a computer to create documents or explore the web. You will learn how to interact with different elements of the Graphical User Interface (GUI). These include icons, windows, menus, files, folders, documents, and applications. The main activity of the lab will be to create a simple document about you and your interests. The lab covers the following topics:

 


Before the Lab

Read through all of the lab instructions prior to your lab session. Fully understand the Lab Etiquette described below. Chapters 2 and 3 of the textbook provide useful background.

 

Lab Etiquette

Things you should do:

You will not hurt or damage the equipment through normal use.

Things you shouldn't do:

 

Getting Comfortable

You needn't be involved in heavy lifting to develop back, neck, shoulder or leg problems; try working at a computer day after day! Sitting too long in incorrect positions is one of the chief causes of aches and pains in your muscles and joints from computer work. Small strains that are hardly noticeable accumulate and can become unbearable.

Take note of the illustration and the following suggestions for maintaining proper posture when using a computer. Some of these may not feel as comfortable as your current posture. But after a while your muscles will be trained to the new position, and you'll feel comfortable again. Also, check with a computer or office store for specific ergonomic devices that may help you.
1 Sit directly in front of the keyboard and computer screen.
2 Situate the monitor so it will be 18" to 24" from your eyes and you have to look slightly down to see it.
3 Make sure your legs fit beneath the desk with your feet flat on the floor. Use a foot rest if necessary.
4 Adjust the chair seat height so your thighs are parallel to the floor with your knees at about 90° and slightly lower than your hips. Make sure your chair seat isn't too deep.
5 Use a work surface that allows your elbows to maintain about a 90° angle.
6 Sit upright, maintaining the natural curves of your back.
7 Make sure you have adequate lower back support.
8 Keep your shoulders relaxed. Don't slump forward.
9 Relax your wrists and keep them in a neutral position. Don't flex them up or down.
10 Keep your knees shoulder width apart or closer.

Web pages on this topic are at the end of the lab.

 


During the Lab

Remember, get comfortable!

 

Start the Computer

Before you can begin to use the computer, you may need to turn it on. In addition, because you are working in a multi-user environment, you must also login. 

You must provide your username and password in the Login dialog box. Your username identifies you to the computer and can be shared with others. Your password protects your account and should be kept secret! If this is your first time logging on, you need to create an account.

 

Create an Account

Because you don't yet have a login id, at the log in prompt, type getacct.  Follow the instructions on screen.  You will be prompted to enter your student number and last name and will then be asked to create a password. The password should be 8 characters long.   Once this process is complete, you can log out, and use the username and password you have just created to log into the Windows environment. (Making a good password can be challenging! Check out the References section for more information on passwords.)

IMPORTANT: The login id assigned to you by 'getacct' then forms your UBC computer science email address, please make note of this. For example, if your login is "r2d2", then your new email address is "r2d2@ugrad.cs.ubc.ca", without the quotation marks.

 

Logging out of your account

Click on the left-bottom of the window, and choose ShutDown... , and choose Log off from the pop window, then click OK.

Note: Do not click any other option except log off.

 

Use Notepad to create a text file

A file is a collection of bytes stored as an individual entity. All data on disk is stored as a file with an assigned file name that is unique within the folder (directory) it resides in. A text file is a file that contains only characters meant for displaying and formatting text. Now we will create a simple text file using Notepad.

Open Notepad: click , , ,

Type the following information about yourself into the document:

After finishing all the input, click File from the menu bar, choose Save or Save as,

choose disk/drive Z in the Save in window, and click on the Create New Folder Icon , type lab0 and press enter.

There should be a folder called "lab0" now. Double click on this folder to open it and type lab0.txt as your File name. Then click Save.

Close the file by choosing File -> Exit, if it asks "Do you want to save the change?" Click Yes.

Find the "My Computer" icon on the desktop.  Double click on My Computer, find Disk Z, make sure there is a folder "lab0" that has a file lab0.txt in it. If not, you need to create the file again.

IMPORTANT: Please note Disk Z represents the storage space you are allocated with the creation of you computer science account. Aside from what you place in this space, administrative files will also exist (which you should not remove/alter).

 

 

Create directories (folders)

In a graphical user interface (GUI), a folder holds data, applications and other folders. Folders were introduced on the Xerox Star, then popularized on the Macintosh and later adapted to Windows and UNIX. In Unix, DOS and Windows 3.1 (an old Windows), a folder is known as a directory, and a subfolder (folder within a folder) is a subdirectory. (Folders aren't the only metaphor for arranging information, however! Check out the References section for more information on Flickr and tagging.)

Windows Folders:
Folders on the hard disk are pictured as manila file folders, but they are not fixed in size and can hold as much data as there is room on the entire disk.

You can use My Computer in future labs when you will need to create folders (directories).  As described above, double click the My Computer icon, double click Disk Z.  All file and folders that belong to your home directory will be displayed.  To select a directory to see its contents, double click on it.  To create a new directory, click on the File menu, select New, then select Folder and give your new folder a name.  To rename an existing folder, select it (by clicking on it once).  Once selected, you can do one of the following:

and enter the new name for your folder.  You can also use Windows Explorer to view, rename, or delete your files, as well as create new ones.  To open Windows Explorer click  Start  --  Programs  --  Accessories  --  Windows Explorer

 

 

Open a new file or existing file

Open a new file:

Open an existing file:

Tip: To open a document you've used recently, click History on the Places Bar in the Open dialog box.

Now, open the file lab0.txt you just created, and add more content by answering each of the questions listed below.  Each question will need to be started with a separate paragraph. Press the "Enter" key at the end of each paragraph. Don't worry about the format of the file; we will take care of it in later labs. Remember to save the file after finishing each paragraph. See the next section for how to save a document as you work.

Answer the following to add content to your lab0.txt file:

 

 

Save files

 

Locate a folder

When you open or save a file, you can locate a folder in the following ways.

To Do this
Go to any location available from your computer Click a drive, folder, or Internet location in the Look in box (Open or Insert dialog box) or Save in drop-down list box (Save As dialog box).
Create a new folder Click Create New Folder .
Open a folder in the folder list Double-click the folder.

 

Close files and applications

To close a file, choose File on your application's menu bar, and choose close in the pop-up menu. Ctrl-F4 has the same function in most applications.

To close an application, choose File on your application's menu bar, and choose Exit in the pop-up menu. Alt-F4 has the same function in most applications.

In some applications, there may not be a close, you can always choose Exit after you save.

You can also click the icon on the top right of your window to close an application or a window.

 

File Types

Here is a sample of some of the different file types you may encounter or need to use.

File Type suffix Application examples
Text files .txt Notepad, Wordpad myfile.txt
Word Document .doc MS Word myfile.doc
Spread Sheet .xls MS excel myfile.xls
Presentation .ppt MS PowerPoint myfile.ppt
webpage .html, .htm Internet Explorer, Netscape myfile.html
images .jpg, .gif, .bmp MS Paint, Imaging, Ultimate Paint myfile.jpg, myfile.gif, myfile.bmp
audio .wav myfile.wav
video .avi myfile.avi
executable .exe myfile.exe

 

Internet basics

Several web browsers are available on this system, including Mozilla/Firefox, Netscape, or Internet Explorer (IE). The following steps are written for Mozilla/Firefox, but are applicable to other browsers. For the purposes of this lab, choose Firefox (located on 'desktop').


 

Unix introduction and SecureCRT

We won't learn Unix in this course, however, we may need to use some of its features through our labs. If you are out of time to do this in the first lab, don't worry - you know where to find the information when you need it. Here is what you need to do.

Launching

SecureCRT

SecureCRT (found by clicking on Start) will enable you to work in the Unix environment while still in Windows. Your lab TA will help you set up the connection for the first time.

When you first open SecureCRT you will most likely see the following:

If you see

instead, pressing the right mouse button on the word Sessions and selecting Quick Connect from the shortcut menu that pops up should give you the following

Changing the protocol to ssh2 will change the window to reflect the first Quick Connect window shown.

Alternatively, you can select Quick Connect from the File menu to get the windows described above.

Once you have a Quick Connect window open, change the Protocol to ssh2;  the content of the window should change.  Complete the fields to reflect this sample below:

Press OK when you are finished.  Make sure that you save this session; otherwise you will have to go through this process each time you open SecureCRT.

You will need to provide your username and password again to login to the server. They are the same ones you use to login to the PC.

 

Unix commands

> Viewing files and directories

Type the following at the xterm window:

ls -l

then the following information might be displayed:

    -rw-r--r-- 4 a1a1 guest 9512 May 10 15:21   banner.gif
drwx------ 1 a1a1 guest 512 May 13 09:59   document
-rwx------ 1 a1a1 guest 5275326 May 27 15:53   emacs
-rw------- 5 a1a1 guest 11512 May 28 15:28 hello.cpp
-rw-r--r-- 4 a1a1 guest 512 May 19 15:27   homepage.html
drwx------ 1 a1a1 guest 25194 Jun 16 09:59   temp

If you want to learn more about what the output means, try typing ls --help or man ls. The man command (short for "instruction manual") can also give you help on other commands. Try man man for more information!

> Making and removing directories

The Command "mkdir"

As you start a new project, you might need to create a new directory for storing files. To make a new directory, use the make directory command, mkdir. The directory will be created as a subdirectory of the current working directory. If you want to create the directory "cs101" inside your home directory, then while you are in your home directory, you should type:

mkdir cs101

Unix makes a new directory named "cs101", located in your home directory.

The Command "rmdir"

To remove a directory, you use the remove directory command, rmdir. The command name is followed by the name of the target directory. For example,

rmdir ~/cs101

will remove the "cs101" directory located in the home directory. If the target directory contains files or subdirectories, rmdir will display the error message:

Directory not empty

Sometimes rmdir will report a more cryptic error, such as:

rmdir: cs101: File exists

You must delete all the files and subdirectories in the target directory before removing the directory.

> Copying, moving and removing files

Unix allows you to copy, move, rename, and remove files. You can make a copy of a document before experimenting with format changes. You can move files into or out of a directory, and rename files to better organize them. When a file is no longer needed, you can remove it.

Copying Files

To duplicate a file, use the copy command, cp. The format of the command is:

cp source_filename destination_filename

where source_filename is the name of the original file and destination_filename is the name of the resulting copy.

Moving (or Renaming) Files

To move a file to a different location, use the move command, mv. The format of the command is:

mv source_filename destination_filename

where source_filename is the name of the original file and destination_filename is the name of the file to move to.

Removing Files

To remove a file, use the remove command rm. This command has the following form:

rm filename

where filename is the name of a file you want to remove.

Note: rm is very powerful and permanent; use it with extreme caution. It is difficult and sometimes impossible to recover a removed file in a Unix system!

> Summary of commands

The following table summarizes some especially useful commands for managing files:

Command Function
man To get help on other commands.
man -k To get help on commands matching a keyword.
ls To list the contents of the current directory.
ls -F To list the contents of the current directory in terms of files, directories and executable programs.
ls -a To list the contents of the current directory, including hidden files.
ls -l To list the contents of the current directory in details.
pwd To list the pathname of the current directory.
cd To navigate to another directory.
mkdir To make a directory.
rmdir To remove an empty directory.
cp To copy files.
mv To move(rename) files.
rm To remove files.
rm -i To remove files with confirmation.
rm -r To remove a directory. The contents of the directory is also removed.
rm -f To remove files, overidding any confirmation.

 


Deliverables

  1. Send an e-mail to your TA.
  2. Keep your lab0.txt file under your lab0 folder/directory.
  3. Your TA may ask you to demonstrate some of the things you've learned in this lab. Be prepared to do so.

 


Resources and Reference Links

  1. CPSC 101 / WMST 201 Course Web Page
  2. The Computer Science Undergraduate Student Web Page: has information about the CS undergraduate program and facilities For problems with your undergraduate account, e-mail help@ugrad.cs.ubc.ca or ask your TA.
  3. You will be provided 30 units of printing quota for the first lab. You can purchase more printing coupons from the bookstore or Copyright.
  4. For more information on undergraduate accounts, printing, and lab availability, check www.ugrad.cs.ubc.ca or ask your TA for details.
  5. Computer Ergonomics:

    Ergonomics is the study of the relationship between people and their work with the goal of designing job tasks, work stations, tools and equipment to fit the physical capabilities of people. Creating a good ergonomic working arrangement is important to protecting your health. Following is a useful link for information on computer ergonomics:

    Cornell University Ergonomics Web: http://ergo.human.cornell.edu/ergoguide.html

  6. Making a good password is a difficult task. The CS department has some advice on passwords. The need for good passwords is often at odds with the human mind's ability to create and recall them, as described in The Strong Password Dilemma by Richard Smith. One solution called biometrics moves toward using people's physical properties (from fingerprints to physical dimensions of the body to voice patterns and beyond). Another solution is to let people create passwords using more expressive media than text.. art to the rescue! For example, Vibha Sazawal did some preliminary work on using doodles for passwords. You should be able to access that last paper from the lab, but you may not be able to get at it from home. (Vibha also works on getting diverse groups of students interested in Computer Science!)
  7. The "folder" metaphor lets us arrange files in a manageable way. (For example, Holger currently has 59088 files in his account. (How did he count them? Check out the "find" and "wc" commands on UNIX.) If he didn't have folders, he'd have to sift through all of those at once! Instead, he has only 91 files and folders in the "root" of his account. The other files are somewhere inside the subfolders.) However, folders aren't the ONLY solution to organizing our data. "Tagging" is becoming more and more popular. In tagging, you define attributes of a file that are important, and you can find the file based on those attributes later. Flickr uses tagging to organize a huge, collaborative database of images. Try finding puppies!
  8. Bookmarks are a bit like files and folders. (In fact, many browsers store their bookmars as files and folders!) So, naturally, there are also alternatives to traditional bookmarks out there. Check out del.icio.us for a huge, collaborative database of bookmarks.