This lab will guide you through the fundamentals that you need to perform your lab and class assignments.
If you need help during the week, you are welcome to go to
Office Hours posted for lab instructors.
Every U of R student recieves an Hyperion account and can keep that account for as long as they are a student at the University. You need a Hyperion account to:
To get your Hyperion Account setup or to change your Hyperion password, click on this Link to Web Services for Students. You can select one of:
Check your email regularly.Your class and lab instructor send email regarding class and lab related information. For example, the midterm date, lecture notes, and lab tests reminders. Click check email
In order to print in the labs, you must Enable Printing. You only need to do this once to use any University lab printer such as the 'cl136' printer. Once you have enabled printing, you can use any lab printer, including the ones in the library and the Education Building labs. Remember, you need to select the How do I enable printing in the labsfrom Computing Services Main FAQs
Note to lab instructors: Use this link if you need to reset a student's Hyperion password: Reset
A UNIX operating system by Sun Microsystems. Solaris is a popular operating system for higher-end computers called workstations as well as Web servers. It is an alternative to other operating systems, like Windows and Mac OS. Solaris is not a program like a word processor and or a set of programs like an office suite; it is an Operating System.
The computers in CL136 are running Solaris 9 Operating System.
To access the Solaris system, you must have a username and a password. The Computer Science department provides you with a Hercules UNIX account. Hercules is just the name of the Computer Science computer. If you don't have a Hercules account, contact your lab instructor in the lab or in CL119 during Office Hours.
You will see something similar to the following image. It is called the Front Panel.
The Front Panel is your “dashboard” or control area for the CDE desktop. It gives you
point-and-click and drag-and-drop access to the majority of applications on your system;
it allows you to switch workspaces; and it displays information such as time and date,
printer status, and so on. You can customize your Front Panel to include your favorite
applications, and you can move or minimize the Front Panel.
The Front Panel comprises the Main Panel (displayed by default) and several subpanels that roll-up when you click their tab on the main panel.
There are many Web browsers available for Solaris. The one we are going to use is Netscape. It is the globe icon on the Main Panel.
To start, simply click on the icon. The default Webpage should be the CS department Homepage.
If it is not, to set the default webpage to
CS110 or CS130 online material, go Edit--> Preferences,
http://www.cs.uregina.ca/Links/class-info/110-130/ in the Location field box.
Make sure there are no mistakes, then press OK. Now when you click on the Home button, you will be taken to the CS110-130 material.
To start a terminal from File Manager, you need to click the File Manager control on the Main Panel.
The File Manager window appears. Choose Open Terminal from the File Manager File menu.
If you want to perform the operations directly on Hercules, use the ssh Hercules command described in the next section of these notes.
ssh herculesThis allows you to work directly on Hercules, rather that working on a Solaris machine and using the Hercules disk space. This is important if you want to access Hercules at home or in other labs on campus. When you enter the ssh hercules you are logging on to that computer and will have to enter your password again. You will see a different prompt on your Terminal when you are connected.
cp /net/data/ftp/pub/class/110-130/ftp/cpp/hello.cpp hello.cpp
The Pico Editor is a user-friendly text editor on Solaris and UNIX
It can be used for creating or editing files.
The most common commands are listed at the bottom of the pico screen.
To open a file in the pico text editor type:
For example, if you have the hello.cpp program in your account, type the following command:
Pico text editor screen with hello.cpp file displaying:
In pico, you can move up, down, left or right using the arrows on
your keyboard. You cannot use your mouse!
To edit, you can backspace over text and then enter new text. You can also delete an entire row of text at once time using Ctrl k.
To exit from pico, Ctrl^X will
Creating a New File:
To create a new file using the pico editor, type at the command prompt:
pico newfilename.cppA blank pico editor session will display. Add C++ code to create a new program. When you save the file, it will be given the filename that you entered in the command above.
The command to compile your C++ program on Solaris is:
CC program_name -o executable filenameFor example, to compile your hello.cpp program, you enter
CC hello.cpp -o helloTo run the program, type
helloIf you have entered ssh Hercules to work directly on Hercules, the compile and run commands are the same. Using the hello.cpp example again, here are the commands to compile and run directly on Hercules, or from home or from another computer on campus.
CC hello.cpp -o hello hello
The command to print files in ClassRoom 136 is
lpr -Pcl136 filenameFor example,
lpr -Pcl136 hello.cppIn the next lab, you will see how to print from other labs on campus and at home.
Back to Highlights
ssh Herculescommand to connect directly to Hercules.
The path: pub/class/110-130/ftp/cpp The file: hello.cpp
CC hello.cpp -o hello
pico hello.cppUse your arrow keys to move around the file, and to exit from Pico use the command Ctrl^X
When you are done, always remember to logout,
click on the icon on the Main Panel. Click OK
Copyright: Department of Computer Science, University of Regina.