308-208 Development Team - Employee Handbook

This reference material is designed to acquaint any new students working on professor Ratzer's 308-208 course with the work done to date, to make their self-training more efficient. It is expected that if this manual finds good use, it will be updated as more work is done, to always provide an up to date reference from year to year.

The material has been divided up into the sections of 1) introduction (including a survey of the computers used to work on the course), 2) the book (FORTRAN, C and algorithms), and 3) the WWW site. In practice, since there is a lot of overlap, I have elected to write the manual around the different programs which you will have to use to get the work done. You may want to skim the material beforehand, to get an idea of which program does what, and then use this material for reference purposes only.


Most of the work done on the book and the website was under the UNIX operating system. This is an operating system, like DOS or Windows, which runs on a vast number of computers, particularly mainframe and minicomputers. It has also been implemented on INTEL 386 and higher architectures in the form of Linux, a gem of the public-domain. In the opinion of the current writer of this manual, UNIX is by far the superior operating system of all those I have used, including MS-DOS, Windows 3.1, Windows NT, Windows 95 and the Mac. Before you delete that line from the manual, at least learn to use UNIX - and then reassess it. I have found that exposure to the UNIX operating system is perhaps the greatest benefit I have gained from holding this job, because in the mechanical engineering curriculum or even in the laboratories, there are no opportunities to learn how to use it, although it may be critical to learn it on the job later. Enough said.

UNIX is a bit harder to learn than DOS because there are many more, powerful commands whose syntax is critical. It does not shield the users from the operating system like Windows does, and for most areas of the work done, the applications available on this operating system have been on par with their windows equivalent, or better. They have however required more training time. A brief overview of the programs which are critical to this course updating work will be given, as well as a bibliography of reference and learning materials.

UNIX provides a graphical interface in the form of the x-windows interface, but unlike Microsoft windows, not all x-windows programs have the same form (with the same file and edit buttons, for instance). Most of the time, however, UNIX is run in text mode. It is not the intention of this manual, at least at the present, to give you a UNIX primer; only to supplement any UNIX primer you may read with information that is specific to the systems we have used to work on the course, in order to cut down on our dependance on the support staff.

Recommended is the book Learning the UNIX operating system (single session overview), available at the PS&E library or at Coles. Any UNIX primer is good, and you may want to keep an intermediate level UNIX book as a handy reference.

There are several computers maintained by the school of computer science, which we have used. The main computer is called marge.cs.mcgill.ca, and it has been necessary to procure an account on this computer to carry out the work. Accounts are available if professor Ratzer approves the account request, and then you have to deal with the systems support staff. If you have such an account, you will be able to access most of the computers in the SOCS arsenal, but marge is the most important one, and it is the one you must use for e-mail.

Professor Ratzer's terminal, in his office, allows access to amadeus.cs.mcgill.ca and to opus.cs.mcgill.ca. These two computers will appear at first glace to be the same, particularly because they have access to the same files (the files are actually stored on susie.cs.mcgill.ca). There are differences, however, particularly on which programs will run in what mode on which machine. I will go into more detail on this later.

Here are some subdirectories which you will need familiarize yourself with, depending on which area of the course you are working on:

Please note that common courtesy will prevent employees from snooping around professor Ratzer's personal directory. In any and all cases, it is possible to get all work done without doing so much as a directory listing of this subdirectory. Also, please note that if opus is to be logged on to, the first screen to come up is a version of elm, an e-mail program that accesses professor Ratzer's e-mail. If this happens, carefully read the function menu at the bottom of the screen, and you can usually exit simply by pressing `q'. The last thing you want to do is erase or affect the professor's personal e-mail, so avoid logging on to opus when unnecesary. Best of all, do not use the workstation in his office until you have an adequate knowledge of UNIX. It is better to make mistakes while using your own .cs.mcgill.ca account.

In general, opus and amadeus are continuously logged into on professor Ratzer's workstation in his office. To log onto either of these machines requires professor Ratzer's username and his secret password. This is why YOU NEVER WANT TO TOTALLY LOG OFF AMADEUS OR OPUS. If you do, you will not be able to log on again unless professor Ratzer personally comes to the office. If it becomes necessary to be able to log on to these computers yourself, you will have to make special arrangements with the support staff. For instance, in my case, the whole workstation crashed while the professor was on a two-week vacation, so I was given my own username and password on amadeus and opus. In all likelyhood, you will be able to do all kinds of work on the book with only a key to the office, which will get you in and give you access to the computers, since they are logged on with the ratzer username all the time.

Opus vs. Amadeus

If you have to do any serious work with prof. Ratzer's terminal in room 330, you must know what the subtle differences between opus and amadeus are.

They will both have access to the same data files, that is, the /auto/export/susie/prof/ratzer and its subdirectories. However, they do not necessarily have access to the same program files, depending on how the computers have last been set up. Amadeus is the computer which works best with the x-terminal protocol, which means that the graphics programs will likely only open in an amadeus x-term window. Unfortunately, often times amadeus does not have access to the graphics programs which will run on it, so you have to run the program with opus, and display it in an amadeus x-term window. Here are the commands -

from the amadeus prompt type
xhost + opus

This may or may not solicit an error message, depending on whether it is necessary or not (I think).

from an opus prompt type
setenv DISPLAY amadeus:0
That's a zero, not an O!

Now, when you want to run your program, do it from an opus prompt, and it will automatically open in an ``amadeus-sponsored'' window. There will be a description of useful graphics programs used in conjunction with course work briefly.

What to do if Workstation crashes

If the workstation in room 330 crashes, do this:

Please note that if you had to reboot the station, you will not be able to log back on unless professor Ratzer supplies his own personal password, or you have been added to the group of users with an account on amadeus and opus.


Emacs is the name of the text editor we generally use in the UNIX operating system. It is very powerful, although not terribly user-friendly. I suggest reading an emacs primer, and keeping a reference manual near-by. The best way to run emacs is in an x-window, because it will give you a menu bar with basic file and editing items, and will allow you to easily load up several documents and cut and paste between them. Normally, if you are using prof. Ratzer's office terminal, you just have to run emacs from amadeus. If you are using another terminal which allows x-term windows, you may have to check your emacs manual on how to run the xterm version of emacs.

One final note on emacs that doesn't appear in most books, but that you must know. To save your file, you must use the sequences Ctrl-x S or Ctrl-x Ctrl-s. The capital S is necessary in the first instance. Sounds dumb but this could have saved me a lot of time... To quit, of course, use Ctrl-x Ctrl-c.


This is a drawing program which we used to create and edit the heading graphics in Prof. Ratzer's book. It is very simple and powerful. It runs in an x-terminal window, and to run it you must type xfig . A few special notes on graphics protocols merit attention.

Illustrations with the .fig extension are in a simple format which allows them to be loaded and edited with the xfig program. To be included in the book, however, they must be stored in the PostScript protocol, with a .ps extension. Please note that this is not Encapsulated PostScript. When you have edited or created an illustration in xfig and want to use it in the book, go to the export menu and export it as a PostScript figure, and avoid any of the other options, although it may look like they are more appropriate for the book. One final note - we have used widths to scale the pictures, and for this reason, make certain that the xfig program is in Portrait mode rather than Landscape mode before you issue the PostScript export command. Otherwise, the book will look like a banner! Just trust me on that --- it could have saved considerable time!


Ghostview is like a print preview, the kind that you get when you hit Shft-F7 6 in WordPerfect. It may be useful if you are experimenting with the book and want to avoid printing out unnecessary copies. It runs in an x-terminal window, and you just type ghostview . Please note that this program will only allow you to view PostScript format files, such as root.ps. More on that in the TeX section.

TeX / LaTeX

The book was written with a simple text editor by prof.Ratzer, and then was modified with embedded codes to be read by TeX. TeX is a desktop publishing system which in effect acts as a compiler, like a C compiler, for example. It accepts a simple, ASCII text input file, which is filled with text and also special formatting codes, and then "compiles" this code into well-layed out pages.

TeX is great because it does a lot of work for you. It sets up the index and the Table of Contents, and it really doesn't care how badly formatted the input text is - it will construct well layed out paragraphs all by itself.

It is also extremely powerful, in that you can make the most sophisticated of tables and mathematical formulae come out looking like truly professional work, but it must be said that the codes which must be imbedded in documents to get all this done can be very complex and non-intuitive.

First rule - if you know what you want to do about any detail of the book formatting - TeX will do it for you; you only have to learn to tell TeX what you want.

To understand the basic modes of operation of TeX, what it does with your input file, and which codes will do what, I suggest that you start by briefly skimming
The TeXbook by Donald Knuth
Be warned that Mr. Knuth wrote TeX and the book, and he may try to make you believe that not only is he a genius, but that TeX is the answer to every question every asked by intelligent man. Yeah Right! Next I recommend that you loan out the following book as a permanent reference guide (and it also makes better reading):
TeX for the Impatient by Abrahams, Paul W
These are available at the PS & E Library

By the way, when we compile the book, we actually use LaTeX. It is a sort of shell that runs over TeX to try to make it more practical and less obtuse. Think of it as TeX for laypeople.

Now, some UNIX tricks:
Any time you want to compile any part of the book, you must give LaTeX the file called root.tex, with the command latex root.tex, because it contains new commands that we have created in order to make some of the embedded book codes less tedious. The new commands work like macros. You really don't have to worry about these commands or how they work, but they will make your life easier.... root.tex explains these new commands to TeX, and then tells it to go get whichever chapters you want to include in the book.

The chapters each have a seperate file, and are called ch?.tex. Here is a special note, one which could have saved me some time: When you want to edit a chapter, and you load it into emacs while it has a .tex extension, emacs will flip into TeX mode, and it may not respond the way that you are used to having it respond. I found that this was a pure source of irritation, so if you want to have full control over the editing of new chapters, you can either figure out how to change the mode in which emacs is running, or just rename the chapter file with another extension, edit it in emacs, and then revert back to the .tex name when you are done. Trust me!

TeX will compile your book and put it in root.dvi, which is a ``device independant" format. Now you want to put it in a format that our printers can understand, so you must convert it to a Postscript file. This is done with the following command.
dvips root.dvi -o root.ps
The command is pretty self-explanatory. To send this new file to the printer, use the command
lpr -Plw root.ps
lw is the name of the Apple Laserwriter in room 317. This room is opened to you only during normal business hours.

While LaTeX is compiling the book, it will generally scream 2912 lines of complaints about your lines being too wide or too narrow and so on. These messages scrolling by can be blissfully ignored. When LaTeX encounters something in your input file that it really doesn't like, it will suspend its activity and give you an error message coded in 12th century Russian slang, and a prompt which suggests ``and what do you intend to do about it?" If you just press enter, TeX will generally keep going. Take note of any clues you were given about what went wrong, or at least where the error was encountered in the document, and you can start troubleshooting your chapter from there. Keep in mind that one error, one misplaced backslash or letter may generate twenty or more error messages, so don't be too alarmed.

The book, by itself, as of last editing, should compile with no error interruptions. However, as it stands right now, there is some kind of logical problem in chapter 14 that TeX doesn't like, so it will interrupt compilation. Please note that this problem does not seem to affect the quality of the book output at all. If you press enter at the error prompt, the book will compile perfectly.

PS: If you want to check and make sure the book is on its way to the printer after issuing the lpr command, type in the lq command. It gives you information about the printer queue.


If you are doing any serious amount of work in professor Ratzer's office, there are times where you may want to use the Pentium, especially if working on the Website. Netscape performs impeccably on the Pentium, thanks to the direct connection to .cs.mcgill.ca, and the great graphics.

If you need to use the Pentium, and it's shut off, there is a special sequence to start it. Otherwise it will start up in Linux mode, and you do not have a password that will let you into synergy.cs.mcgill.ca, the place it connects to. You want the Windows 95 mode. Start up the computer, and right after the BIOS box comes up, you will see a Lilo prompt. You have a few seconds to hit SHIFT, and then you must type in DOS. Select the first item on the next menu that comes up, and Windows 95 will boot up.

Microsoft Internet Assistant

I loaded this program into the Pentium to make it "easier" to convert the files in Microsoft word to HTML. It appears to be just added menu items in Microsoft Word. To translate a lecture foil from WORD to HTML, this is the way I do it. It may seem complicated, and feel free to experiment, but this is what works!

  1. Load the file into Microsoft Word
  2. Highlite the entire Document and make its font size 10
  3. Save the file as *.HTML . After doing this, the display might be a little different, because the program knows it's dealing with an HTML document.
  4. Highlite all the program examples which need to show correct indentations, and choose STYLE from the menu. Then, choose PRE. This means the HTML pre-formatted font, which is not proportionally spaced, and which respects the amount of spaces that you have put in while typing the programs.
  5. Add any extra formatting that you want - you may want to add HR lines so that they will appear with the Web Browser, or make some heading bigger, etc.
  6. Save the file again as an HTML document.
  7. Load the file in a more simple Windows editor - you will see the embedded HTML codes.
  8. You must get rid of the following codes: Get rid of all SUB and /SUB codes using a search and replace command in text editor. Get rid of any and all FONT SIZE=2 or FONT FACE="Book Antiqua" SIZE=2 and /FONT inside the program examples. If you check what the page will look like without doing this, all the program examples look microscopicly small, because FONT SIZE=2 is reasonable with the standard font but if it applied to the PRE region it makes it much too small. Please note - You want to get rid of FONT SIZE=2 codes only inside the PRE formatted program examples.
  9. This is basically it. If you want to do any other editing, you cannot do it from Microsoft WORD because the ******* program will undo all the special corrections that you have done above, without even telling you!

Web Site Security Permission

The files contained on the Web site need to be marked in a special way so that everybody will have access to them, not only the person who created them. When you do a detailed directory listing, you will see a section which will contain information like drwxrwxrwx. It means the following - first, the file in question is a directory (d). Second, the person who created it has the permission to read it, edit it and destroy it, as well as execute it (this has a different meaning depending on whether the file as a directory that you want to look in, or if it is a file you want to execute. Get the detail in a good UNIX primer. The next rwx refers to the permissions of the ``group", the group being a specially defined group of users who might have a use for this particular file. The next rwx refers to all other users, including anonymous people who want to browse your Web page. They are refered to as the ``others" group. It follows that if you want to have other people access your Web page, it must be in a readable (executable) directory, and must have read access for ``all" people, which includes the creator, the group and the others. There is a UNIX command that you use to change the file permissions, called chmod. The particular command that we usually use will be:
chmod a+r filename.ext
This will add read access to all these three categories. The intention here is to just tell you that this command exists - and that if the Web browser says ``Permission" denied, you know where to look. By all means, get the details of this command by consulting a good UNIX primer. Finally, the command umask 002 will give all new files created in the working directory the desired file permissions automatically.


For now, that brings us to the end of our brief but hopefully useful reference manual for the computer work done with 308-208 developments to date. If you have any information to add, or corrections to make/points to make more clear - plase do so.