Class Overview
The upper-level computer science classes at Rowan used to use the
University's Silicon Graphics machines, which run a version of the
Unix operating system. (The company later renamed
themselves to their initials, "SGI", but when we bought the machines
they were still "Silicon Graphics".)
In summer 2002, Elvis (the main CS server which is feeding this
web page to you right now) was replaced by a new and more powerful
machine from Sun Microsystems. Lots of things changed, but most
things didn't.
These computers have some powerful programming tools on them, but
making complete use of that power requires understanding a your way
around. This class covers many of the fundamentals needed to get
maximum use out of advanced Unix machines. Ideally, students will be
able to go into their later classes (Compiler Design, Operating
Systems, Algorithms, and so on) without having to worry about getting
started. When you're in Programming Languages, I hope that you can
focus on learning the Programming Language material, instead of having
to learn both the PL material and how to use the computers
you'll be expected to work on.
Additionally, Unix machines have always been in use by companies that
need heavy-duty computing. With the increasing popularity of open-source
Unix-like systems such as Linux and BSD, the things covered in Lab
Techniques will still be useful after you graduate and enter the job
market. Part of my goal in Computer Lab Techniques is that everything we
cover will be useful outside of the class: I don't always succeed, but I
try every semester to teach only things which will still be useful to you
in your next class, and in your job after you graduate.
What I plan to cover, approximately in this order, is as follows:
-
Managing your files: creating, renaming, moving, and removing files
and directories. Unix systems make it easy to create files: lots and lots
of files. You can easily create so many files it later becomes hard to
remember what you put where; but there is a program designed to look through
your directories and find things for you after you lose them. Combined
with the shell's ability to specify groups of files, this lets you do tasks
which could be tedious in just a few seconds. (For example, some classes
involve running programs which create temporary data files, which can be
quite large. During the Fall of 1999, several students reached their disk
quota because of their temporary files. Instead of having to delete all
of the hundreds of files and directories individually, it was easy to have
them removed by the computer -- without also accidentally removing files
which were supposed to be kept.) Additionally, unlike other computer
systems you may be familiar with, Unix systems make it possible for you
to read (and even change) other users' files, and for them to read yours.
This can be convenient, but (as with all powerful tools) it requires
attention and understand to ensure that it doesn't create other
problems. We will therefore give careful attention to file permissions.
-
Revision management: keeping track of different versions of the same
file. Many modern programs are far too complex
to be completed in one step. As a result, programs
are written in many parts, usually with different people working
on different portions. Additionally,
even if a program is working correctly, you may find that you have to
make changes to add a new feature, or to change how the program works.
Most students find themselves with directories that contain files with
names like "homework1.c", "homework1b.c", "homework1b2.c",
"homework1b2works.c", "homework1old.c", and so on. It quickly
becomes a confusing mess. If you imagine working at a company, and being
told to add changes -- and then told later to remove them -- it becomes
obvious that what is needed is a tool to keep track of different versions
of a program, making the computer do the tedious work of keeping track
of what was changed when, while at the same time allowing you to get an
old version whenever you want one.
-
Compiling tools: programs that help build other programs. Many
projects are broken down into separate files, especially in the case of
group projects. One student writes one part, another student writes
another part, and so on. When it's time to compile all these separate
pieces into one working program, how do you remember what goes where?
How do you figure out what parts were changed, and what parts weren't,
since the last time you compiled? You don't have to remember what parts
depend on what other parts, you don't have to figure out what parts were
changed. The program "make" will do all of that for you. All you have
to do is write a description of your program in the language "make"
understands, and it will do the work.
-
Debugging tools: programs that help find problems in other
programs. Many students, when a program turns out to be buggy, start
putting in print statements everywhere in the hopes of finding out
what's going wrong. Or worse, they start making random changes in the
the hopes of fixing their programs, which is rarely of any help. In
many cases, debugging programs can take you directly to the line of
your program where the error occurs. They can show you which function
called which other function, what the values of your variables are,
what's in your arrays. Some can even draw your linked lists on the
screen (yes, "draw", just like your instructors do on the
blackboard). You can often save hours or even days of time and effort
by letting the computer do the work of debugging your programs -- once
you know how to use the tools.
-
The Command-Line Interface, also known as "the shell", which is
the primary method of giving instructions to the system. The shell lets
you do sophisticated file matching, write your own commands, and make
custom modifications of commands that already exist. It remembers what
commands you've run, can re-run them without much typing, and will even
let you edit your old commands to correct spelling errors without typing
them in again. The shell lets you run several programs at once, stop and
re-start what you are doing, and even run programs when you are not logged
in to the computer at all.
-
The standard Unix filters; programs which can accept many
lines of input and filter out the parts you don't want. You can easily have
a program which generates 10,000 lines of output, and have a filter set
up to show you only the lines you want, and only the parts of those lines
that you are interested in. Instead of skimming, or (worse) reading all
10,000 lines -- or, even worse, reading all 10,000 lines only to discover
that what you wanted wasn't there -- you can have the computer scan the
output for you and locate what you want, often so quickly that you won't
have released the "enter" key before the job is done.
-
Shell scripting. The command-line interface is more than just a
program to read interactive instructions from the keyboard. It can also
be used to write small programs. You can work out the commands you'll
need interactively, and then combine them into a "shell script" which
will execute the same sequence of commands whenever it's needed. One
example of this is when you have files with names in ALL UPPERCASE
LETTERS, and you want to convert them to lowercase letters. Another
example would be when you have two directories, and you need to combine
the files in them into one directory. Usually, this means eliminating
any files which are duplicated, but keeping files which are slightly
different -- and not stomping files just because they have the same names.
Done by hand, something like this could take hours. Programmed into a
simple script, it can be done in seconds.
-
The World Wide Web. Elvis, the main computer science server
(which is hosting this page as you are reading it) allows every user to
have their own web page. In addition to static pages with a fixed
content, you can write small programs,
to generate a new web page every time someone visits, or a page
customized for a particular user. The files you use have to be kept
organized, and when you make changes you often want to keep an archived
version of the old file for reference purposes. This gives you an
opportunity to write scripts, use the file
management tools and revision management tools, and exercise the other
things covered in the class.
The reading list is attached separately. Since some classes meet weekly,
and others several times a week, this overview is designed to be general.
See the page for your specific class section for reading assignments.
|