Library and Information Web Development:UNIX-based Scripting and Programming
Short title:
Web Master UNIX Stuff
Spring 2000 Duty List
Course Goals
What is this course about? This course focuses on the rapidly developing area of Internet scripting and programming languages. For the Spring 2000 version of this course, we will focus on Perl, CGI (The Common Gateway Interface), JavaScript, and Java.
What are the course materials? The course is completely online; there is no textbook or course pack. Various helpful links and book purchase suggestions are found below. Items in red are recommended for the beginner. The University BookStore is perhaps the best place to find books that can supply background explanation and background.
Do you need to be a programmer to take this course? No. The treatment is introductory with the aim of starting you on your own exploration of these rapidly changing WWW technologies. Recommended entering skills would include some work with HTML and a general understanding of the World Wide Web. The most important asset is a desire to become a skilled user of web tools.
What will you learn in this course? We will look at a series of programmer's cliches (these are examples of basic functions) illustrating how these scripting and programming languages work. The goal is to increase your fluency in information technology, not turn you into a programmer. At the end of the course you will understand the various advantages/disadvantages of these tools based on your hands-on experiences with them. For example, you will be able to speak knowledgeably about the uses of JavaScript, what can be done with CGI and what can be done with a Java Applet.
How useful is the stuff you learn in this course? Lots of people will pay you big bucks to build web sites, etc.
What do you have to do in this course? Assignments and Grading Schedule
Some background information and skills:
Practice using UNIX
First Day Exercise
Perl p-Sources
- Learning Perl, Second Edition. Randal L. Schwartz and Tom Christiansen. O'Reilly, 1997. The first Perl book to buy.
- Programming Perl, Second Edition. Larry Wall, Tom Christiansen, and Randal L. Schwartz. O'Reilly, 1996. The Perl reference source.
- Perl Cookbook. Tom Christiansen and Nathan Torkington. O'Reilly, 1998. Illustrates many common programmer's cliches.
Perl e-Sources
Ramp Up to Perl
Perl Examples
- prog1receives some input and then prints it out.
- prog2 illustrates how a variable can hold a string, then an integer, then a real number.
- prog3 calculates book overdue fines with a series of if-else statements.
- prog4 illustrates while and until loops.
- prog5 illustrates the use of some logical operators to make a decision about input.
- prog6 illustrates string concatenation.
- prog7 illustrates the difference between a variable and an array.
- prog8 breaks a multiterm string into an array of individual words.
- prog9 reads a file and numbers the output. This is the data file.
- prog10 stores entries in a hash and retrieves one for the user.
CGI
eSource and pSources
CGI Examples
- FormPage.cgi Illustrates a textfield and a checkbox. Reports contents on same HTML document. The code.
- Popup.cgi Illustrates a check box group and a popup menu. The code.
- Form2.cgi Illustrates a radio button group and a scrolling list. The parameters are sent to another file to be interpreted. The code of Form2.cgi. The code of CatchForm2.cgi.
- Doubles.cgi Pick a baseball player from a popup menu. The program opens a file of data and reports how many doubles the player hit. The code of doubles.cgi. The code of catchdoubles.cgi.
Other interesting CGI applications
CGI Security
JavaScript Sources
- Flanagan, David. JavaScript: The Definitive Guide. O'Reilly, 1998.
. I recommend Part II "Client-side JavaScript."
- HotSyte promotes JavaScript knowledge through the open exchange of ideas, research, scripts, and links beneficial to the advancement of JavaScript understanding and experimentation.
- JSP 5.0iWe currently have 696 JavaScripts and 37 dHTML Scripts
- JavaScript.comThe Definitive JavaScript Resource
- The JavaScript SourceThe JavaScript Source is an excellent JavaScript resource with tons of "cut and paste" JavaScript examples for your web pages. All for free!
JavaScript Ramp
JavaScript Examples
- Using_variables.html illustrates JavaScript variables. The Code.
- Conditional_operators.html illustrates how to test the value of a variable. The Code.
- Function.html illustrates how to write a function in JavaScript. The Code.
- Recursive.html illustrates how to write a recursive call that fails after an arbitrary number of times. The Code.
- Form_example.html illustrates how JavaScript can capture form output. The Code.
- Button events that increment or decrement a counter. The code.
- Using JavaScript to validate form entries. The code.
- pageTosser uses a JavaScript function to toss html pages. The code.
Other Interesting JavaScript Applications
Java Books
(I've found these three books very useful.)
- Winston, Patrick H. & Narasimhan, Sundar. On to Java. Reading, MA: Addison-Wesley, 1996. [There is a later edition available.]The best book that I've found for learning Java. I've read it at least five times. I intend to read several more times. Almost a programmed text with lots of small examples that cumulate into one large program
.
- Horton, Ivor. Beginning Java 2. Wrox Press, 1999. Excellent introduction to programming in Java. (I'm on my second reading!)
- Kanerva, Jonni. The Java FAQ. Reading, MA: Addison-Wesley, 1997. Clears up misunderstandings, puts everything in context, very readable.
- Chan, Patrick & Lee, Rosanna. The Java Class Libraries, 2d ed. Volume 2: java.applet, java.awt, java.beans. A terrific reference resource that illustrates how to use various classes. Once you start to program, you'll need a book like this.
Java Sources
Java Development Kit (JDK). Can't do Java without it! Download your copy today. 1.2 beta
Gamelan: The Java Directory Official directory to all things java.
The Java Tutorial: A Practical Guide for Programmers.
Ramp Up to Java
Java Applets
The HelloWorld Applet. The Java source code. This is a simple Java applet that writes a message. All Java applets appear as parts of html pages. Here is a typical HTML document that hosts the HelloWorld applet.
The First Canvas Applet. The Java source code. This applet creates a separate canvas class. The Canvas is visible because the html page is colored red.
The Click Me Applet. The Java source code. This applet has a clickable button that changes the text on a canvas.
The Nelson Applet. Presents four images that are displayed on a canvas at the press of a button. The Java source code and the HTML document surrounding the applet.
The Four Colors Applet. The Java Source code. This applet has four buttons that produce text and colors changes. Note the use of various methods to produce the effects. This applet can also be written in an object version so that the text change and color change are given to an object called colorMessage class. As a result, the object version has fewer methods and is more elegant. Here is the object version of the Four Colors Applet.
The Oscars Applet. The Java Source Code. This applet stores a simple object in an array. It fills the array with the names of the Oscar winners. The html page has text flowing around the applet.
The Whizzo Number Guesser Applet. The Java Source Code. This applet uses textboxes to accept user input, compare the input to a randomly generated number and then deliver the output to another textbox. The layout is a GridBagLayout.
The Grades Applet. The Java Source Code. This applet lets you choose to select LIS503 or LIS528 labels and then you can enter the number of points off each assignment. A grade for the course is calculated.
The arrayStuff Applet. The Java Source Code. This applet illustrates how data in an array can be displayed at the press of a button. The data are structured as Dat data.
The (primitive) Query Tutor Applet. The Java Source Code. The individual records are structured as Dat class. An array of this type is filled in a separate Storage class. Once the array is filled with records, they are presented to the user, one at a time.
Assignments
Your assignment is to write three WWW applications that will "astonish Terry Brooks". This is actually easy to do. Students wishing to know more about what Terry Brooks considers to be astonishing can check with me.
Guidelines for the term assignments:
- You must complete three assignments
. Completion means that you deliver to me the computer code with a printout of three working WWW applications. Ideally, each of the applications will be demonstrated either to our class or demonstrated to me in my office. These demonstrations are contingent on available time.
- The three projects should not use the identical language or procedures. A single project can include many things - a bit of Perl, some CGI and a touch of JavaScript, etc. But I would like to see three projects that are strongly identifiable as:
- A project that is strongly Perl and/or Perl-CGI.
- A project that is strongly JavaScript
- A project that is strongly Java.
Grading Schedule
One of the delightful aspects of this course is that you can grade your own work as you hand it in, thus you are in total control of the grade you receive for this course.
Here are the letter grades used for each assignment:
- A+ - A working program that does not duplicate any of our class work (although it can be based on some example found in a book). It employs at least 5 major aspects of a language. It is longer than the examples that we have discussed in class. Zero points off
- A - As above, but employs only 4 major aspects of a language.1 point off
- A- -As above, but employs only 3 major aspects of a language.2 points off
- B+ -A working program that does not duplicate our class work. It employs 2 major aspects of a language.3 points off
- B -As above, with 1 major aspect of a language, but it is more elaborate than our class examples.4 points off
- B- Illustrates 1 major aspect of a language in an example as big as our class examples.5 points off
- C+ -A non-working program, but there is evidence of struggle.6 points off
- Incomplete - Has yet to hand in three programs.
As part of each assignment, please include a short paragraph detailing how your project satisfies one of the letter requirements. That is, for an A+, merely list the five major language elements, indicate that your work was not based on any class work, indicate if you based it on some other example, etc. You could even include all this material as an extended comment at the top of your program.
To calculate your course grade, use the following. For your three term assignments, you have a total number of points off. Thus you can calculate your course grade:
- 4.0 - Zero points off.
- 3.9 - One point off.
- 3.8 - Two points off.
- 3.7 - Three points off.
- 3.6 - Four points off.
- 3.5 - Five points off.
- 3.4 - Six points off.
- 3.3 - Seven points off.
- 3.2 - Eight points off.
- 3.1 - Nine points off.
- 3.0 - Ten points off.
- 2.9 - More than eleven points off.
The impartial observer would be correct in concluding that the only thing separating a student from a 4.0 in this course is application and industry.