CSCI 373 Take Home Final

Welcome to the take home section of the CSCI 373 final.

Rules

If you have any questions about these rules, press here to send mail to the CSCI 373 instructor.

All source materials you will need should be available through either the Readings page for CSCI 373, the Unix man command, or your previous CSCI 373 assignments.

By now, the file /usr/users/brock/csci/373/takehome/index.html should hold the HTML source for this page. You can access the page through the URL file:/usr/users/brock/csci/373/takehome/index.html.

You must complete three problems in this portion of the final. Everyone does the first two problems. For problem three, you have the choice of doing 3A, a CGI program, or 3B, a Motif program. There are 75 total points in this section of the exam. The remaining 25 points will come from the closed book section.

Each problem will be completed in its own directory. The directories are called:

All three directories should already exist.

Problem 1 (25 points)

In this problem you start with a plain ASCII file and add the necessary HTML tags, <H2>, <LI>, <I>, etc., to create a nice page. The plain ASCII file is stored in

Edit the file and store your answer into

If you do a faultless job on a problem, you'll get 20 of the 25 points. To get the full 25 points, you'll have to do something a tad special!

After you have completed Problem 1, press here to review your answer.

Problem 2 (15 points)

This problem is similar to Homework #2. Here you will create an HTML form to vary the color of the spots on the following well-drawn animal:

silly animal

The CGI script to generate the image, with user selected colors, is stored in the file /usr/users/brock/scripts/animal.cgi. You really don't need to look at the file. Here's what you need to know.

If you don't set spot_color at all, the CGI script will return an error message. If you set spot_color to something that isn't a legitimate X11 color, the CGI script will return no useful information.

Store your form in the file

Your form should allow the user to select a color for the spots and display the newly painted animal. Be sure to restrict the user to a set of legal colors!

After you have completed the Problem 2, press here to view the results of your answer.

Problem 3A (35 points)

If you don't do this problem, do Problem 3B.

This problem is also similar to Homework #2; however, this time you will modify a CGI program stored in the prob3 directory. The C source of the program is stored in prob3/getquota.c. The program comes with a Makefile that compiles getquota.c and puts the result in getquota.cgi. Unfortunately, you cannot run the CGI file from prob3/getquota.cgi. You must copy it into your public_html directory under the file name getquota.cgi. Don't worry. A Makefile is provided to make this very simple.

Because our HTTP server is an Alpha AXP computer, you must compile your program on one of the Alpha AXP machines. The Alpha AXP computers are

If you are not logged into one of these machines now, remotely connect to one using either rlogin or telnet in order to perform the compilations.

Once you are connected to an Alpha machine, execute the following commands:

The make install will compile the program and then copy the executable image to the file getquota.cgi of your public_html directory. Now you should be able to press here to execute the CGI script. Each time you modify your C code do a make install.

Presently the getquota.cgi program reads information about the disk space used by each CSCI workstation user into an array called diskhogs and then prints out this information in a rather boring HTML-less fashion. Your problem is to modify the CGI program so that it prints out a much more interesting display of the information using all the bells and whistles of HTML.

A ho-hum solution would merely stick in a few <LI>'s into the file. You can't expect 35 points for that. More exciting programs will flag the real disk hogs in boldface or flashing text. Charts are also a possibility, if you don't want to sleep tonight.

Once again, after you are done press here to view the results of your effort.

Problem 3B (35 points)

If you don't do this problem, do Problem 3A.

Modify the fabulous mtween program you worked on in Homeworks #4 and #5 to allow the user to vary either the style (dashed, solid, etc.) or the color of the line segments. You'll find it easiest to modify the line style. The three style choices there are

The mask for the XCreateGC and XChangeGC functions is GCLineStyle.

Store your code, along with an appropriate Makefile, in the directory prob3.

Quick check

To view your answers, press the following buttons