Spring Semester 2002


Fri Apr 26
A reminder:

  1. The Final Exam is take-home.

    Implement the program from the midterm exam, using either Java servlets or JSP. Choose one or the other. Turn in a printed copy of your code in person to Adrian. Post your code on-line in the protected directory, and have the program available for testing on-line in Tomcat. You can turn in your print-out either during your individual appointment next week, or during the time scheduled for the final exam (Thu May 3, 7:15pm-9:15pm in LH102).

  2. Sat Apr 27 I will have office hours from 2-4pm in LH016.

  3. Sun Apr 28 I will have office hours 6-8pm in LH016.

Tue Apr 23
Review notes posted.

Make final appointment for next week (Apr 29-May  3) here.

Final Exam is scheduled for May 2 between 7:15pm-9:15pm in LH102.

Date: Tue, 23 Apr 2002 13:31:51 -0500 (EST)
From: Adrian German <dgerman@cs.indiana.edu>
To: Undisclosed recipients:  ;
Subject: a348/a548 final update


I posted a set of review notes yesterday. We will go over
them in class today. You can use them as your project for
the semester if you want, as described in the notes. I've
printed enough for everybody - and I will distribute them
tonight in class. If you can't come tonight just come and
get one from me later.

You need to make an appointment for next week, the script
is at: burrowww.cs.indiana.edu:36000/cgi-bin/schedule and
you can choose any of the open slots all of next week. In
your time slot I will ask you a couple of questions about
the project you chose, and about the final exam.

The final exam will be a take home and I will describe it
in class tonight. You can turn it when you come next week
for your appointment, or in LH102 Thu May 2, 7:15-9:15pm.
(That's when our final is scheduled). Turn in a print-out
of your code. You will have to implement the program from
midterm with servlets or JSP (graduate students - both).

Let me know if you have any questions and concerns and/or
if you have trouble using the sign-on script (as burrowww
seems a bit slow right now). Thanks again and all the best.

... Adrian

Sat Apr 20
Date: Sat, 20 Apr 2002 12:27:38 -0500 (EST)
From: Adrian German 
To: Undisclosed recipients:  ;
Subject: A348/A548 Final Weeks


Dear A348 Friends,

The class is coming to an end.

If you have late homework that you need to turn in it will
be accepted for near-full credit if you put together all the
missing pieces on a special page on your Apache web site for
my review (and let me know about it) before next Sunday, Apr
28, at midnight. (Sun Apr 28 is when we observe Catch-up Day
this semester).

Grades for the two parts of the midterm exam will be posted
in the evening. There will be an optional take-home midterm
make-up that I will distribute on Thursday in class that we
can discuss in class, and which needs to be turned in on or
before the final exam, for full credit. The final exam will
be on Thu May 2 7:15-9:15pm in class (LH102).

The optional midterm make-up will be a good preparation for
the final exam. If you decide to turn it in and if your score
on it is higher than the original midterm, the higher score
will be kept for your midterm grade.

The final project is due the week of the final and you need to
make an appointment with me and discuss it. I will send details
of that soon, as it will involve your registering through a CGI
script on the web, the script should be up within a day or two.

Let me now briefly describe what you need to turn in for
your semester group project.

Option A.

If you have been working on a project turn in what you have
at the time of the appointment (programs, design documents,
mock-ups, experiments, early drafts, etc).

Option B.

If you have not done much work on any group project of your
own here's what you can do - write a detailed report on any
of the projects that have been presented in class, and come
prepared to discuss it with me. Topics you can choose from:

a) the PHP shopping cart (Mar 21, Lab 10)

b) the Javascript shopping cart (Mar 19)

c) the Daytime applet/servlet communication (Lab Twelve)

d) the Http chat application (as in Apr 2 notes)

e) the triple chat application (as in Apr 9 notes)

f) Java RMI (as in Apr 11 notes and What's New entry for Apr 4)

g) Tomcat and server-side Java programming (Lab 11, 13)

So if you don't have any project that you've been working on
it's perfectly acceptable (and recommended) that you review one
of the 7 projects listed above, prepare a tutorial or report on
the topic you have chosen (up to 10 pages of text, diagrams, and
possibly code) and bring it with you to the appointment that you
will make. I will look at your report, ask you a few questions,
and that will be your project for this semester.

Feel free to work in groups but please turn in your own report.
The report need not be too glitzy, it need not be spiffy, it only
needs to be honest, direct, operational (i.e., meaningful,) and
true. Handwritten is fine, and if it contains diagrams it is also
perfectly acceptable if they are drawn by hand. I'm only interested
in your complete/thorough understanding of the topic you have chosen
to present/defend. The code presented in the class notes from the
topic you have chosen for discussion should obviously be known and
understood inside out. Let me know if I can be of help in any way.

You could also choose the following topics, if you want, if none
of the topics above seem attractive to you:

h) Perl, CGI, CGI.pm, and DBI.pm

i) Java and XML for business to business applications

So to summarize here's what we have:

0. Catch-up Day falls on Sun Apr 28 this semester.

1. Grades will be updated tonight

2. Optional Take-home Midterm Make-Up becomes available Thu 4/25
and is due a week later at Final Exam time (it prepares you for the
Final Exam, and counts towards your grade only if you do better in it
than you did on the midterm)

3. Final Exam is on Thu May 2, 7:15-9:15pm in LH102. Written exam,
open-book, open-notes, involves short answers or multiple-choice.

4. Project is due week of May 2, individual appointments will be
made over the web throughout that week (Mon-Fri 8am-5pm) and will
be about 10-15' in length per person.

5. List of topics for the project defense is listed above.

If you have any questions or concerns please let me know.

... Adrian

Thu Apr 18
The lab notes for today focus on the last assignment for one more time.

Wed Apr 17
Here's some help with the last homework assignment:
import javax.servlet.*;
import javax.servlet.http.*;
import java.io.*; 

public class One extends HttpServlet {

    public void doGet(HttpServletRequest req, 
                      HttpServletResponse res) 

        throws ServletException, 
               IOException {
        
        res.setContentType("text/html"); 
        PrintWriter out = res.getWriter(); 

        String one, two; 

        String what = req.getParameter("picture"); 

        if (what == null) {
            what = ""; 
        }

        if (what.equals("one")) { one = "One"; } else {
            one = "<a href=\"/examples/servlet/One?picture=one\">One</a>"; 
        } 

        if (what.equals("two")) { two = "Two"; } else {
            two = "<a href=\"/examples/servlet/One?picture=two\">Two</a>"; 
        } 

        out.println("<html><head><title>Mamma mia!</title></head><body bgcolor=\"white\">" + 
                    "<table border><tr><td>" + 

                    one + 

                    "</td><td>" + 

                    two +

                    "</td><td>Three</td><td>Four</td></tr>" + 
                    "<tr><td colspan=4 align=center>Picture</td></tr>" + 
                    "<tr><td colspan=4 align=center>Caption</td></tr>" + 
                    "</table></body></html>"); 
        
        

    }
This was for the portfolio, as a servlet, and you need a JSP version of it, too.

Now help for the calculator, as JSP.

<html><head><title>My calculator</title></head><body>

<% Integer a = (Integer)session.getAttribute("acc");

   if (a == null) { a = new Integer(0); } 

   String argument = request.getParameter("arg"); 

   if (argument == null) { argument = "0"; }

   int conv; 

   try { 
     conv = Integer.parseInt(argument); 
   } catch(Exception e) { conv = 0; } 

   a = new Integer(a.intValue() + conv); 

   session.setAttribute("acc", a);

 %>

 <form>
 
   The accumulator is now: <%= a %> <p> 

   <input type="text" name="arg"> <p> 

 </form>

</body></html>
This is only the starting point, and you need a servlet version of it as well.

Tue Apr 16
Lecture notes for today, Thursday, posted.

Mon Apr 15
Here's a program that's listing the remote objects registered in a registry:
import java.rmi.registry.*; 

class One {
    public static void main(String[] args) {
        Registry a = null; 
        try { 
            a = LocateRegistry.getRegistry( Integer.parseInt(args[0])
                                           //Registry.REGISTRY_PORT
                );  
            
            String[] u = a.list(); 

            for (int i = 0; i < u.length; i++) {
                System.out.println(i + ": " + u[i]); 
            }

        } catch (Exception e) {
            System.out.println(e); 
        }
        System.out.println("Good-bye!"); 
    }
}

Thu Apr 11
Today we will wrap up Java networking (including applet to servlet communication).

For reference only (a few notes already existing):

  1. Terminal I/O (July 21, 1999)
  2. Networking (July 26, 1999)
  3. Basic Networking continued.

Tue Apr 9
Lecture notes for today also posted.

Homework assignments Five and Six (last) posted.

Lab Notes for this week posted.

Thu Apr 4
Here's a code walk of the web chat application.

Two documents (one, two) about RMI.

Mon Apr 2
Lecture notes 22, 23, 24 posted.

The notes are almost exact, except in a few places links need to be updated.

Sat Mar 30-31
The server.xml.username files have been generated, you can pick up yours from
/u/dgerman/public/tomcats
on (burrowww.cs.indiana.edu). You can now install Tomcat!

Fri Mar 29
A list of ports, as promised, has been posted, on the the students and servers page. You can now install Tomcat (providing your own server.xml, or wait until I generate them for you).

Thu Mar 28
Lab Notes for next week posted, will be covered in class today.

A list of ports, as promised, will be posted tomorrow on the students and servers page.

Wed Mar 27
Creating a table that has a combination of columns as the primary key:
create table catboo (
  isbn char(6), 
  catid int unsigned, 
  primary key (isbn, catid)
) 

Tue Mar 26
Lecture, lab notes for today, this week, posted.

Thu Mar 21
Lecture, lab notes for today, tomorrow, posted.

Wed Mar 20
Minute papers count updated in MyGrades.

Midterm grades to follow soon.

Tue Mar 19
Here's a PHP shopping cart we will discuss this week (shop Physics).

Here's the Javascript shopping cart we will describe this week.

Notes for this week are being posted.

Sat-Sun Mar 8-17
SPRING BREAK

Tue Mar 5
Lecture Notes Seventeen also posted.

Lecture Notes Eighteen, Lab Notes Nine posted.

Mon Mar 4
Homework Four posted.

Sun Mar 3
The reference for the next section is

Sat Mar 2
The midterm exam of Thursday has been posted on-line.

Fri Mar 1
Old lecture notes need to be updated. We need to take a look at the PHP MySQL API and compare it with the DBI API. We develop the library project and start on the on-line bookstore. When that is done we need to move to Javascript. Since Homework Four needs to be posted soon we will probably start discussing it in class sooner rather than later.

Thu Feb 28
Midterm Exam today: in class, LH102 (5:45-7:00pm).

Date: Wed, 27 Feb 2002 16:09:32 -0500 (EST)
From: Adrian German <dgerman@cs.indiana.edu>
To: ac.csci.a348@cs.indiana.edu
Subject: A348/A548 Midterm Exam<

Lab Eight, posted, offers a complete solution to Lab Seven. This
way everybody gets enough feedback on Lab Seven and will likely do
well on it as well. Lab Seven is due this week in lab.

The exam tomorrow will ask you to write a program like the one we
develop in Lab Seven. Graduate students will get an extra question,
as indicated on the Grading page. Studying Lab Seven will make sure
you do well on the exam. The exam is open-book, open-notes. Having
a solution posted for Lab Seven keeps the Thu and Fri sessions at
the same level. Exam tomorrow is at 5:45 in LH102.

Please review PHP, Perl, CGI (perhaps CGI.pm) and Lab Seven.

Let me know if you have any questions. See you tomorrow.

... Adrian

Wed Feb 27
Lab Notes Eight posted, help with the Midterm Exam.

There won't be much SQL (if any) on the exam. Once the exam is behind us I will bring all the notes up to date, including lab notes. My main concern right now is to make sure we are all clear on what the exam's covering: Unix, Apache, HTTP, Perl, CGI, CGI.pm, PHP.

Tue Feb 26
Lecture notes for today posted.

Mon Feb 25
Here are some sample midterm exams from years past:

  1. Fall 2000 Midterm Exam
  2. Fall 1999 Midterm Exam

More about this in the lecture notes, tomorrow.

Sat-Sun Feb 23-24
Minute papers count updated.

Fri Feb 22
The exam next week might be multiple-choice, might require writing code.

Thu Feb 21
Lab Notes Seven posted, help prepare for the Midterm Exam.

Wed Feb 20
QuizSite now collects project proposals, will stay open for five days.

Tue Feb 19
A set of Project Guidelines and ideas have been put together and posted.

Mon Feb 18
Second set of lecture notes about PHP being worked on, will be posted tomorrow.

Sat-Sun Feb 16-17
Minute papers count updated.

Fri Feb 15
Homework Three posted.

Thu Feb 14
Lecture Notes for Tuesday posted.

Wed Feb 13
Homework Three will be posted tomorrow night.

Some of the examples in Lab Five have been wiped out.

I will try to reactivate them, tomorrow night.

Tue Feb 12
Lab and lecture notes for this week posted.

Mon Feb 11
SQL notes for last Thursday posted (comprehensive material).

Sun Feb 10
For PHP (that we will start studying next week) we will also use this book:

Sat Feb 9
Minute papers count updated.

Fri Feb 8
Here's the code we developed at the end of the class on Thu.

burrowww.cs.indiana.edu% cat data.txt
this
is a
file
isn't 
it
burrowww.cs.indiana.edu% cat one    
#!/usr/bin/perl

open (AB, "data.txt");

open (BC, ">out.txt"); 

while ($line = <AB>) {
  
  print "***($line)***"; 

  print BC $line; 

}

close(AB); 

close(BC); 
burrowww.cs.indiana.edu% ./one       
***(this
)******(is a
)******(file
)******(isn't 
)******(it
)***burrowww.cs.indiana.edu% diff out.txt data.txt
burrowww.cs.indiana.edu% 

Thu Feb 7
Here's the code we developed Tuesday in class.

#!/usr/bin/perl

&printTop; $me = $ENV{SCRIPT_NAME}; 

print qq{ 
  <form method="GET" action="$me">
    Type your username <input type="text" name="a" size=8>
    and password <input type="text" name="b" size=14"> then
    press <input type="submit" value="Proceed"> 
  </form>
}; 

&readParse; # %in is created, contains user input 

print "<table border cellpadding=6>";

foreach $key (keys %in) {

  print "<tr><td> $key <td>", $in{$key}, "\n";  

}

print "</table>"; 
&printBot;

sub printTop { print "Content-type: text/html\n\n<html><body>"; } 

sub printBot { print "</body></html>"; }

sub readParse { 
  if ($ENV{REQUEST_METHOD} eq "GET") {
    $abc = $ENV{QUERY_STRING};
  } elsif ($ENV{REQUEST_METHOD} eq "POST") {
    read(STDIN, $abc, $ENV{CONTENT_LENGTH}); 
  } else { print "Method not supported." &printBot; exit; }

  $abc =~ s/\+/ /g; 

  @pairs = split(/&/, $abc); 
  foreach $pair (@pairs) {

    ($name, $value) = split(/=/, $pair); 

    $value =~ s/%(..)/ chr(hex($1)) /ge;

    $in{$name} = $value; 

  }  
} 

Wed Feb 6
You need to start thinking about semester projects.

We will collect information from you through QuizSite.

Tue Feb 5
Lab and lecture notes for this week to be posted today.

This week we completely design and implement a sample semester project.

Mon Feb 4
Here are three references for the material we will present this week.

Sat-Sun Feb 2-3
The minute papers count is now up to date.

The quizzes are not assigned homework but they will help with the midterm.

Fri Feb 1
The quizzes posted are not due per se but they will expire on Feb 15 at the end of the day (11:59pm) so work with them before then. You have a total of 10 attempts per quiz.

Thu Jan 31
Perl and Unix quizzes posted in QuizSite today.

Wed Jan 30
Here's a diagram of your server that I built this morning with Jimmy Yulius and Bobby Bonslater, that summarizes what your server filesystem looks like, and what purpose each important folder or file has.

Here's the book I will use for MySQL:

Tue Jan 29
Lab and lecture notes for the rest of the week posted.

Two more labs from the past: Unix intro and a basic quiz.

Mon Jan 28
Lecture notes for Tuesday posted.

Sun Jan 27
Here are some books that may help with Unix:

Sat Jan 26
The Learning Perl book now is in the library, it will be available (from what I have been told) for checking out on Monday or Tuesday. It is on a 24 hours reserve. Here is a free tutorial book that can be downloaded from the web (PDF format is available too).

Fri Jan 25
Here's a couple more Perl pointers from lecture notes in years past:

  1. A review of Perl from Spring 2001 (and before)
  2. Here's a lab from Fall of 1998 (and its Spring 2001 version).

Thu Jan 24
Here's the code we developed in class today (two parts).

First, the second part (called two).

#!/usr/bin/perl

&printTop; # take care of the browser first (you are a CGI script!)

$me = $ENV{"SCRIPT_NAME"}; # who am I? 

# now get the input from the user
if ($ENV{"REQUEST_METHOD"} eq "GET") { # USPO letter vs. UPS package here! 
       $showMe = $ENV{"QUERY_STRING"}; 
} else { # assume it's POST! 
       read(STDIN, $showMe, $ENV{"CONTENT_LENGTH"}); 
}

# now let's take things apart
@pairs = split(/&/, $showMe); 

# we've opened the packet and now we read the message
foreach $pair (@pairs) {
  # print $pair, "<p>";                      # used only to debug
  ($name, $value) = split(/=/, $pair); 
  # print "The value of $name is $value<p>"; # used only to debug
  $in{$name} = $value; 
}

# now the %in hashtable contains what they sent us! 
foreach $key (keys %in) { 
  # so let's look at it, verify it contains what it should.
  print "The value of ", $key, " is ", $in{$key}, "<p>"; 
} # this is also used only to debug

print qq{ # the rest is only simply output 

($showMe) <p> 

<form method=POST action="$me"> 

<table>

<tr> <td> One:   <td> <input type="text" name="one" size=14> 

<tr> <td> Two:   <td> <input type="text" name="two" size=14> 

<tr> <td> Three: <td> <input type="text" name="three" size=14> 

<tr> <td> Four:  <td> <input type="text" name="four" size=14> 

</table> 

When finished please  <input type="submit" value=" Go for it!"> <p> 

</form>

}; 

&printBot; # finish your HTML

# the two procedures needed 

sub printTop { 
  print "Content-type: text/html\n\n<html><body>"; 
}

sub printBot{
  print "</body></html>"; 
}# end of procedure, end of program 
(This program gets you started on Homework Two-Part One).

Then the first one below is easier, simpler, and corresponds to Homework Two-Part One.

#!/usr/bin/perl

&printTop;

$me = $ENV{"SCRIPT_NAME"}; 

print "<pre>"; 

foreach $key (keys %ENV) {

  if ($ENV{"QUERY_STRING"} eq $key) { # plain text it's what they asked for 

    print "<font size=+3>$key</font>", ": ", $ENV{$key}, "\n";     

  } else { # link as before 

    print "<a href=\"$me?$key\">$key</a>\n";#, ": ", $ENV{$key}, "\n"; 

  }

}

print "</pre>"; 

&printBot;

# and the helpers we always need

sub printTop { 
  print "Content-type: text/html\n\n<html><body>"; 
}

sub printBot{
  print "</body></html>"; 
}

Wed Jan 23
Here's a book I will be putting on reserve at Swain:

Tue Jan 22
Here's the program that we developed in class today.

#!/usr/bin/perl

print "Content-type: text/html\n\n<html><body>"; 
$acc = 10; 
$input = $ENV{"QUERY_STRING"}; 

($name, $value) = split(/=/, $input); 

$acc = $value + 1; 

print qq{

  Your accumulator is: $acc <p> 

  ($input) 

  <form method=GET action=/cgi-bin/a2/two>

    <input type="hidden" name="acc" value="$acc"> 
    <input type="submit" value="AddOne!"> 

  </form>

};

Mon Jan 21
Tomorrow when we start CGI, we need to discuss this too:
#!/usr/bin/perl
 
while ($x = <STDIN>) {
  ($com, $arg) = split(/ /, $x); 
  print "You have typed: $x"; 
  if ($com =~ /^bye/i) { print "Good-bye!\n"; exit; }
  elsif($com =~ /^add/i) { $acc += $arg; print "Acc is now $acc\n"; }
  elsif($com =~ /^sub/i) { $acc -= $arg; print "Acc is now $acc\n"; } 
  else { print "Acc stays $acc\n"; } 
}

Sat-Sun Jan 19-20
Lecture and lab notes for next week posted.

Fri Jan 18
Homework Two posted.

Thu Jan 17
You can also check the ac.csci.a348 newsgroup from here.

Wed Jan 16
I have created a distribution list for the class and sent this message to it:
Date: Wed, 16 Jan 2002 13:32:01 -0500 (EST)
From: Adrian German <dgerman@cs.indiana.edu>
To: Undisclosed recipients:  ;
Subject: a348/a548 distribution list 


Greetings,

I have created a distribution list for A34/A548 and I plan to
use it once in a while when I need to communicate something for
which the web site would be too slow a medium.

There is also a newsgroup for this class (ac.csci.a348) and I plan
to check it daily. Should you have questions please e-mail us or
come and see us or post to the newsgroup.

The web site is now up to date with office hours and instructor
assignments to labs. We have a new AI for Thu SE 045 where Fulya
Erdinc is replacing Brian Keese. Fulya will be also be teaching
with Chengxiu on Fridays in SB230.

It is always good to work in groups for A348 since you can check
things like file permissions and availability of files and get to
know each other in anticipation of the project.

Welcome to the distribution list.

If I can be of any help please let me know. 

... Adrian
Please let me know if you have not received the message.

Tue Jan 15
Lecture notes for the week, lab notes, homework assignment one, posted.

Mon Jan 14
Here's how you make your archive available for Lab One:
burrowww.cs.indiana.edu% chmod 711 ~
burrowww.cs.indiana.edu% chmod 711 ~/public
burrowww.cs.indiana.edu% chmod 644 ~/public/whoa.tar.gz
Don't forget to move the file there, first (from lab1).

Links to notes from previous semesters: Fall 2001, Spr 2001, Fall 2000, Fall 1999, Fall 1998.

The single most significant set of notes for this semester will be the one from Fall 2001.

Sun Jan 13
Here's some info about SSH at IUB.

Here's where you can download it from (IUB Network ID required).

Sat Jan 12
I have now finished looking through, and have posted grades for, most of the minute papers collected last week. A few more updates on the A348 website are forthcoming on Sunday, when I will also send a few answers to some of the questions received in the minute papers.

Fri Jan 11
I am sorry if you tried to find me today and couldn't. I had to undergo an endoscopyin the morning and the medication didn't allow me to do anything for the rest of the day.

Thu Jan 10
Lab and lecture notes for the week have been posted.

Updated by Adrian German for A348/A548