The following is information for computer science lab courses, COSC 1123 and COSC 2125, at St. Edward's University. This overview includes material on the use of the computing system currently available through the Computer Sciences Department. The system is currently housed in Woodward Office Building (WOB) room 114. The CS computer system is available for remote access through the SEU dial-up connection and through any other internet service connection. The Computer Science classes will be using three Linux computing nodes which are named cn01, cn02, and cn03 respectively. These nodes are only supported by secure shell access remotely, so you cannot use a non-secured telnet program for remote login. Instead you must use some sort of secure shell connection program from a remote site. The easiest and very popular freeware program, Putty is available here, it's very small and easy to use.
For information about using St. Edward's university dial-in connection see the IT department site. Students in the Computer Sciences Department are all given a student account to use on any of the three computing nodes, the respective nodes are named:Typically student accounts will be assigned the same username from the academic system (this is your email name) and will then choose a password for their account after an inital login. Students should review the acceptable use policy and the computing responsiblity policy that is in effect for all computer useage on campus.
Most of the lab materials here should be independent of operating system and Java compiler, except for obtaining data files and knowing basic unix (linux) commands and features. There is no particular text for the lab course, rather the actual labs themselves, posted on the class website (see below), are the main focus of the lab courses. The labs are matched to the material covered in lectures. However, most of these labs should be useful with other texts as well. These lab materials have been revised and developed by Laura Baker and John Camden at St. Edward's University .
COSC 1123 is a semester-long computer science laboratory course which will introduce students to more programming and computer science and it is directly related to the lecture course, COSC 1323. COSC 2125 is a lab course directly related to the COSC 2325 lecture course. Students will learn the programming language Java in COSC 1123 and COSC 2125. The textbooks for the lab courses are the labs themselves and you should also use the textbook for the corresponding lecture course for reference during labs.
The laboratory courses meet 1 time per week for 1.5 hours in addition to the lecture class which meets 3 hours per week. Students are expected to attend EVERY laboratory, no absences are allowed. Any work missed must be made up through arrangement with the instructor of the course. The lecture classes and laboratories are closely coordinated and you must satisfactorily complete both to continue to the next course in the computer science curriculum, which is either COSC 2325 or COSC 3339, depending on which lab course you are currently enrolled.
Each student will be responsible for maintaining their computer science system account as well as checking SEU email regularly for notices from instructors regarding lectures and labs. See Dr. Camden's COSC 1323 for related Computing Concepts I information and Dr. Baker's COSC 2325 for related Computing Concepts II information.
There will be approximately 8-12 lab units. Note that labs will begin on the first meeting day of the lab time you are registered in. You should print out and read carefully each lab BEFORE coming to the lab so that you already know what the lab is about and you can spend your time working on problems rather than reading. All laboratories will have a due date and MUST be completed by that date, no exceptions. Grades are determined as stated on the first day handout for the course.
Not all of the assignments are designed to be completed during the laboratory period. This is part of the "work outside of class" expected for this course. In situations where you have not completed the lab during the scheduled lab time, you should finish it and turn it in ON time according to the assignment due date.
The operating system that is installed on the computers you use in either the academic or computer sciences lab is a flavor of the Unix operating system. We will be using the computer science lab machines in our courses, and we are strongly urging students to use one of the two Linux computing nodes, cn01 or cn02 respectively. The most common tasks (unix commands) you must become familiar with include:
A more comprehensive Unix index is available on the web, you should visit and use this alphabetical unix command help index to learn more about other unix commands.
Basic help index for navagating St. Edward's computing resource help is at SEU Computing and a few help pages on common tasks have also been created for your reference.
| Command | Description | Useage |
|---|---|---|
| mkdir | make directory | creates a new
sub-directory. To use, type mkdir |
| pwd | pprint working directory. | Displays WHICH directory you are in (Shows the current directory location). |
| ls | list current directory contents (short view) | Shows list of files in current directory in column view
If a sub-directory is given after the ls command, the
files listed will be those in the given directory. Otherwise, files in
the working directory are used. -C used with ls, shows file
names in Columns. -a When used with ls, lists hidden files also. |
| ls -l | Long List of files | Gives file names, as well as mode, owner, group, size, and creation date and time. |
| cd | Change directory | Type the name of the directory after the command (e.g., cd Mail to go the Mail sub-directory of your home directory). When used alone, it returns you to your home directory. Or use cd $HOME to get to your home directory cd .. moves you up one level in a directory tree (.. is parent directory) |
| cp | Copy files. | Type the command cp
followed by the old file and the new file names, in that order, such as cp    oldfile    newfile, and press <Enter>. |
| mv | Move files | Type the command
followed by the old file and the new file names, in that order, such as mv    oldfile   newfile, and press <Enter>. |
| rm | remove file | Type the command
followed by the file name, such as rm filename, and press <Enter> Can be used with wildcard -- rm *.o would remove all files ending with .o extension (these are usually object files) |
| cat | concatenate files | Without redirection, cat prints the file or files to standard output (terminal display). With redirection, files are concatenated to the specified location. For example, cat file1 file2 > file3 copies file1 and file2 into a new file, file3. |
| more | displays contents of file to screen 1 page at a time. | Used instead of cat command so that entire file can be seen page by page on the screen. Example: more hello.cpp displays the contents of file hello.cpp to the screen 1 page at a time. |
| a2ps | print file in WOB 114 at printer 2 pages per sheet in landscape mode, saves paper. | example: a2ps hello.cpp would print file hello.cpp |
|    r | Repeat command | Used with a command to REPEAT last command. Example: r g++ Repeats the last g++ command you gave. Note using the up arrow key also recalls commands in the bash shell. |
| history | Gives a history of commands used | Gives the last 20 commands you have typed at the terminal. Used in conjuction with r command r 123 means repeat the command 123 (you get the number of the command from history) |
| passwd | Changes password on system | System prompts for old password, then for new password then asks for a verification of new password. Passwords must have 6 or more characters, at least 1 must be a NON-LETTER. Passwords are CASE-SENSITIVE as are ALL unix commands.! |
| emacs | powerful text editor used for creating, editing, compiling programs for many languages. | Used to create files containing a program or any text. Example: emacs Test1.java opens the emacs editor and creates/edits a file called "Test1.java". REMEMBER all unix names are case sensitive especially java files. |
| exit | logout (exit or kill) of the terminal session. | In window manager environment make sure you logout of the Windows session also on the start menu under "shutdown". |
Printable version of Basic help
For more online information on Unix, see the following
links:
| C-xC-c | Exit from editor |
| C-xC-s | Save (output) file |
| C-xC-f | Find file (opens it into emacs window) |
| C-xC-w | Write to file (save under new name similar to "save as") |
| M-v | Page UP 1 screen |
| C-e | Move cursor to END of LINE |
| C-a | Move cursor to BEGINNING of LINE |
| C-d | Delete character AT cursor |
| M- > | Move to END OF WHOLE TEXT |
| M- < | Move to BEGINNING of WHole TEXT |
| C-k | Delete to end of current line (Cut) |
| C-y | Paste (yank from buffer) last item Cut |
| C-g | Kill current command, or STOP when stuck |
| C-x u | Undo previous command (allows several in a row) |
| C-s | Search for string in file (forward search) |
| C-r | Search for string in file (reverse search) |
| C-h | Get help on emacs commands |
| M-x insert-file | Inserts a File into current location |
| M-x compile | Runs compile command from within emacs |
| M-x shell | Runs the unix command line (shell) within emacs |
If you have a home computer and will connect from your home, there is information available to dial in to the academic system.
The name of a file should remind you of the contents of the file, i.e., it should be mnemonic. The extension should indicate the type of the file. For a file with java code in it, it should have the extension .java , a file containing C++ source code .cpp, plain text information .txt, a make file .make object code .o or executable .out When writing a C++ program you must specify ".cpp" as the file extension. This ensures that the correct compiler is invoked when you translate your program to its executable form. When writing a java program or a java applet you MUST use the extension .java and you must name your file the same name as the class containing the code. Remember to be careful to capitalize the first letter of any java program as the class name should have the first letter capitalized also.
First connect to one of the computing nodes, cn01 or cn02. Remember, you username should be the same username as you have on the academic system for your student email account. On your first login, your password will automatically be changed so be prepared to give a new password on your first login, after that your password will remain the same unless you change it. Once connected to one of the nodes you may work within any of the available window managers and themes that you choose. By default the cn01 and cn02 nodes will use the KDE windows manager and on top of the XTERMINAL in the lab. When you remotely connect to any of these nodes, you will be at a terminal window NOT in a window manager environment. So you will need to know basic unix commands to manipulate files, edit programs, print, and compile programs. When you connect with an XERMINAL FROM THE LAB your login session will look very similar to a windows environment that you probably are familar with. The main differences are the programs, applications and options that are available to use under this Linux system.
When connected to a node with an XTERMINAL you can do the usual
START --> Programs -->
and choose what to do from the drop down menus. To the right you will see a toolbar with commonly used task icons including web browser, text editor, file manager, and other miscellaneous tasks. You can get to some programs from the toolbar, and many others from the drop down start menu.
Remember to create a new program or to edit an existing program you will use the text editor, emacs . There are 2 general ways to get to the emacs editor.
Once you have finished the emacs tutorial read about how to compile a java or c++ program using the appropriate compiler shown below, then follow the directions to copy a birthday program and compile and execute it.