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.
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.
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.
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.
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!
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.