Fall Semester 2002


Mon Dec 23
Final grades have finally been posted.

Sat-Sun Dec 21-22

I have been reading the exams

... amd grading them and grades are going to be up soon.

Fri Dec 20
FINAL EXAM today in Lindley 102 5-7pm.

Next semester I will be teaching a class on Networked Game Design with Java.

Here's a copy of the class web page in INSITE as of last week.

(Here's what was covered in this class last semester).

The two books used are:

  1. Friedl Markus, On-line Game Interactivity Theory

  2. Petchel Thomas, Java 2 Game Programming

The class has two goals:

  1. To define the term game engine and to develop one from scratch, and

  2. To work with a variety of already existing professional game engines

The first goal is achieved using Petchel, the second using Friedl.

Note: the class also meets with T580 (Interactive Storytelling and Computer Games Design, this is the writers' class, ours is definitely for programmers,) one hour per week on Mondays. Students are expected to create a multiplayer game (working alone or in teams, under the guidance of an instructor) and present it at MIME 2003 in May.

Thu Dec 19
Here's some help with the question on the PHP shopping cart project.

(The help is in the explanation of the output).

Wed Dec 18
Apache takes its SOAP implementation to new heights.

Tue Dec 17
Don't forget the message of yesterday:

Date: Mon, 16 Dec 2002 11:58:24 -0500 (EST)
From: Adrian German <dgerman@cs.indiana.edu>
To: A348/A548 Fall 2002 Distribution List <dgerman@indiana.edu>
Subject: A348/A548 Update (Re: [system #121] high server load (fwd))

Dear A348 Friends,

The Tomcat stop/start process being so resource intensive it is not
advisable that we all start and stop the servers at the same time (see
message below). So what I am going to ask of you in anticipation of all
our individual appointments this week would be to please choose a random
hour and minute during the day and stop your Tomcat then and restart it
five minutes later. When you come here for your individual appointment
we will check it. But please make this change as soon as possible so
everybody else can work.

Thank you very much for your help (and attention to this matter).

... Adrian

---------- Forwarded message ----------
Date: Mon, 16 Dec 2002 09:37:10 -0500 (EST)
From: Rob Henderson <robh>
To: kmdaily@indiana.edu
Cc: dgerman@cs.indiana.edu
Subject: Re: [system #121] high server load

Your request #121 was resolved by robh:

It turns out this particular problem is likely due to the
way students are using cron jobs on burrowww.  It turns out
that about 70 people are restarting their servers at the
exact same time every hour (ie. every hour, on the hour)
and that puts quite a load on the machine when all of these
shutdown/restarts fire off at the same time.  You may want
to change your crontab so that it runs at a different time
than on the hour (shutdown) and 2 minutes after the hour
(startup) which is exactly what everyone else is doing.

I went ahead and added some additional swap space that should
help prevent the machine from running out of memory again.

Adrian, I don't know that anything needs to be done this
semester.  However, in the future you should probably get
students to pick random times to restart the server and also
do it less frequently than every hour (like once per day).
It looks like the tomcat restart process is quite resource
intensive.

Thanks!

  --Rob

Mon Dec 16
Text of take-home final exam is final.

Fri-Sun Dec 13-15
Most grades updated. Next week: individual appointments.

Wed-Thu Dec 11-12
Click here to make an appointment for turning in the final and the project.

Second Practical Exam is today, in lab.

Tue Dec 10
Take-home final exam in the making.

Sat-Mon Dec 7-9
Date: Mon, 9 Dec 2002 23:10:01 -0500 (EST)
From: Adrian German <dgerman@cs.indiana.edu>
To: A348 Fall2002 Distribution List <dgerman@indiana.edu>
Subject: A348 Update


There is a Practical this week. The task for the Practical
is to set up your Tomcat for automatic stop/restart as shown
in class on Thursday. Labs this week are supposed to help you
achieve this. More details tomorrow (on the web site and in
class).

The assignment for this week's lab is to write up a document
that summarizes MySQL access from CGI, PHP, and Java.

The final exam will be take-home and will consist of a large
set of questions to be posted tomorrow on the web site. You
can turn the answers in next week, in person or on Fri 12/20
at the time of the Final Exam.

A script will be installed shortly that will allow you to
choose a time for a 10' individual appointment next week. The
A348 web site will contain a link to this script, and it will
be presented in class this week as well.

The Lab Coordinators will stop grading on Friday. Make sure you
clear your accounts with them  by the end of the day on Thu this
week so you can get all the credit you can get.

... Adrian

Fri Dec 6
IBM's WebSphere 5.0 ships. (What's that?)

Thu Dec 5
Today we will discuss Java RMI.

A set of notes discussing the implementation of a MUD has also been posted.

Wed Dec 4
There are three things (see Notes) that we need to do today:

  1. First, determine a way to start and stop Tomcat with cron
    (You need to work with setclasspath.sh)

  2. Post an assignment for today's lab, due next week.
    (Summarize database access in Perl, PHP and JDBC).

  3. Post the list of questions for the project.
    (I will do this today).

Also, I should install the scheduler script, for individual appointments on the projects.

Mon-Tue Dec 2-3
Written Final Exam in Lindley 102 on Friday Dec 20 between 5pm-7pm.

The exam is comprehensive and cumulative.

The list of questions for the Project will be posted on Class Notes web page on Wednesday. Turn your answers in person in written form, and include the URL of your project. The Final Exam is in class on Fri Dec 20 between 5pm-7pm. You need to turn in the answers to the Project questions before going into the Final Exam.

Topics for the last week of classes (Dec 9-13):

  1. The Java browser/web server revisited
  2. JDBC vs. DBI.pm and PHP database access
  3. Understanding the purpose and use of XSLT
  4. Web services: why web, what services?
  5. Axis vs. XML-RPC. SOAP vs. HTTP.

Topics for the week before the last (Dec 2-7):

  1. Describing the Web Chat
  2. Understanding Java RMI
  3. Understanding the purpose and use of XML
  4. The Content Syndication Project

Also, in an attempt to simplify software distribution I'm placing everything in

/l/www/classes/a348-dger/fall2002/software
So you should find there everything that's needed regardless of the project.

Mon Dec 2
Here's the code developed in class on Tuesday:

We started from a simple servlet:

import javax.servlet.http.*;
import javax.servlet.*;
import java.io.*;

public class One extends HttpServlet {

    int count; 

    public void doGet(HttpServletRequest  request,
                      HttpServletResponse response) 
                throws  ServletException,
                        IOException {

        response.setContentType("text/html");

        PrintWriter out = response.getWriter();

        count += 1; 

        out.println("Counter is: " + count);

    }
}
easily and quickly transformed into a JSP:
<%! 
    int count; 
 %>

<%
        count += 1; 
 %>

<html>
  <head><title>My Page</title></head>
  <body bgcolor="lightgrey">
    Counter is now even bigger: <%= count %>
  </body>
</html>
So we wrote a servlet for the portfolio
import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*; 

public class Port extends HttpServlet {

  public void doGet(HttpServletRequest request, 
                    HttpServletResponse response) 
              throws ServletException, IOException {

    response.setContentType("text/html");
    PrintWriter out = response.getWriter();
    String url = request.getContextPath() + request.getServletPath();
    String link1 = "<a href=\"" + url + "?pic=one\">One</a>", 
           link2 = "<a href=\"" + url + "?pic=two\">Two</a>", 
           link3 = "<a href=\"" + url + "?pic=thr\">Three</a>", 
           link4 = "<a href=\"" + url + "?pic=fou\">Four</a>";
    String pic = "<img src=\"http://www.cc.columbia.edu/low3.gif\">"; 

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

    if (arg.equals("one")) { link1 = "One"; }
    else if (arg.equals("two")) { link2 = "Two"; }
    else if (arg.equals("thr")) { link3 = "Three"; }
    else if (arg.equals("fou")) { link4 = "Four"; }
    else { } 

    out.println(link1 + link2 + link3 + link4 + "<p>");
    out.println(pic);


  }
}
which was easily and immediately transformed into a JSP:
<%
    String url = request.getContextPath() + request.getServletPath();
    String link1 = "<a href=\"" + url + "?pic=one\">One</a>", 
           link2 = "<a href=\"" + url + "?pic=two\">Two</a>", 
           link3 = "<a href=\"" + url + "?pic=thr\">Three</a>", 
           link4 = "<a href=\"" + url + "?pic=fou\">Four</a>";
    String pic = "<img src=\"http://www.cc.columbia.edu/low3.gif\">"; 

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

    if (arg == null) { } else { 
      if (arg.equals("one")) { link1 = "One"; }
      else if (arg.equals("two")) { link2 = "Two"; }
      else if (arg.equals("thr")) { link3 = "Three"; }
      else if (arg.equals("fou")) { link4 = "Four"; }
      else { } 
    }
  %>

<html>
  <head><title>My Page</title></head>
  <body bgcolor="lightgrey">
    <table>
      <tr> <td> <%=link1%> 
           <td> <%=link2%> 
           <td> <%=link3%> 
           <td> <%=link4%> 
      <tr> <td colspan=4 align=center> <%=pic%>
    </table>
  </body>
</html>
With all this under our belt we easily wrote the following JSP:
<%
   String bAlance = request.getParameter("balance"); 
   String url = request.getContextPath() + request.getServletPath();
   String arg = request.getParameter("arg"); 

   int res; 
   int bal = 0; 
   int argument = 0; 

   try { bal = Integer.parseInt(bAlance); } catch (Exception e) { } 
   try { argument = Integer.parseInt(arg); } catch (Exception e) { }
   res = argument + bal; 
   
   bAlance = res + ""; 

 %> 

<html>
  <head><title>My Page</title></head>
  <body bgcolor="lightgrey">
    Accumulator is now: <%= bAlance %> 
    <form method="GET" action="<%= url %>"> 
      Enter number <input type="text" name="arg"> 
      <input type="hidden" name="balance" value="<%=bAlance%>">
    </form>
  </body>
</html>
without ever needing a servlet to start from.

Wed-Sun Nov 27-Dec 1

Happy Thanksgiving Break!

Tue Nov 26
Lecture today will try to help with Homework Six and tie some loose ends.

Sat-Mon Nov 23-25
An older set of notes that code walk the web chat application posted.

Fri Nov 22
Homework Five is due today. Homework Six is due Tuesday.

Here's a JSP we posted before and (I am sure) has passed unnoticed:

<% int count, right; String message = "Hello and welcome to the addition quiz!"; 
   if (session.getAttribute("count") == null || request.getParameter("reset") != null) { 
     session.setAttribute("count", new Integer(0)); count = 0; 
     session.setAttribute("right", new Integer(0)); right = 0; 
   } else { 
     count = ((Integer)(session.getAttribute("count"))).intValue(); 
     right = ((Integer)(session.getAttribute("right"))).intValue(); 
     try { 
        if (Integer.parseInt(request.getParameter("answer")) == ((Integer)(session.getAttribute("answerKey"))).intValue())
              right += 1;
        else 
              right += 0; 
     } catch (Exception e) { } 
     count += 1; 
     message = right + " out of " + count; 
     if (count == 10) { 
       message = "Final result: " + message + ". New game started "; count = 0; right = 0; 
     } else 
       message = "Your performance thus far: " + message;
     session.setAttribute("count", new Integer(count)); 
     session.setAttribute("right", new Integer(right)); 
   }
   int one = (int) (Math.random() * 100 - 50), 
       two = (int) (Math.random() * 100 - 50); 
   session.setAttribute("answerKey", new Integer(one + two)); 
 %>
<html>
  <body>
    <form action="<%=request.getContextPath() + request.getServletPath()%>">
      <%=message%> <p> 
      Question <%=count+1%>. <%=one%> + <%=two%> = <input type="text" name="answer"> <p> 
      <input type="submit" value="Proceed">  <input type="submit" name="reset" value="Reset"> <p> 
    </form>
  </body>
</html>
It is clean and compact, and a pleasure to study (I hope).

(The long lines, you ask? I am really happy it's so easy to use them on the web.)

Thu Nov 21
Lab Assignment Eleven has been posted.

Wed Nov 20
We've done a lot of programming thus far (and a little more is forthcoming) and I suspect it is at this point in time that one could get a bit surprised if I were to say that the client-server model that we've been using is a bit simplistic, perhaps a little too simplistic. And that, in spite of a collection of interesting network programming methodologies that Java has to offer, that we will be exploring (sockets, sockets with serialized objects, RMI). Consider, if you will, the following situation:

  1. You buy a book from amazon.com
  2. (Good for you, and good for them)
  3. You pay by credit card
  4. The transaction is encrypted
  5. (So nobody can find out your credit card number and what you bought)
  6. But suppose amazon should not know the card no. either!
  7. Then (may I ask) what do you do?
  8. (You card is a National Geographic Platinum Mastercard)
  9. amazon should be able to pass your card data to NGPM.
  10. And in doing so it should not be able to find out the card no.
  11. amazon should just send the encrypted data to NGPM.
  12. They should be able to do all the processing (pay amazon, charge your account.)
  13. After that amazon ships the book (to you).
  14. End of transaction

Note that this includes some B2C but also some B2B.

Well, web services are simply made for that.

The difficulty here is that NGPM and amazon.com are two different entities. Their programs have been developed by different people with different technologies. Their integration must be done in a smooth and reliable manner. You can't ever hope that perhaps everybody will be using the same language, the same systems, the same type of servers, and the same programming technologies. So elegant approaches like Java RMI are doomed from the start. So are any strongly coupled methodologies (CORBA, DCOM).

It's here where web services enter the stage.

As we are approaching the topic we need to maintain the same clinical attitude that we currently have.

Don't get too excited, don't get too depressed (or indifferent).

Relax.

Tue Nov 19
Lecture notes have reached final form (Dec 12 notes changed, updated).

This is where we stop developing lecture notes for this semester.

In the next weeks we will only focus on:

  1. Presenting all the posted material very clearly
  2. Re-organizing the entire web site so it can be printed as a ClassPak
  3. Examples that will add to the class notes will be posted here (under What's New)

Really, the class notes are in their final stage now.

Mon Nov 18
Perhaps Mr. Borge will be coming to class one of these days.

We never know.

(That would be twoderful, though).

Tomorrow's lecture: Help with Homework Five and Six.

Fri-Sun Nov 15-17
Most of the Lab Nine and Homework Four grades uploaded, the rest to come soon.

Homework Five due date pushed to Fri Nov 22 at the end of the day.

Thu Nov 14
Minute papers from Tuesday ask about the name of the Jakarta project.

Jakarta I suspect is named so because it offers Java server-side support. Java - Jakarta, you get the idea. Why was Java named Java even though the creator is from Canada originally? Apache is named so because NCSA's httpd was considered 'a patchy' server and Apache derived from it (through the removal of all bugs). So it's not that it's Native American or whatever but see the cartoon below. Hope this helps, let me know if you have more questions.

Stop making fun of Apache!

Here's the original announcement, from June 22, 1999.

``Sun Microsystems and the Apache Group have announced an agreement whereby Sun's Servlet and JavaServer Pages reference implementation source code will be made available from Apache under the open Apache license. This marks the first time that proprietary Java source code from Sun will enter the fully open development process of the Apache Group. This article covers the details of this unprecedented event.''

This new project has been named Jakarta

Doesn't this read as if taken straight from

(Bullets everywhere.)

Wed Nov 13
Some resources for the next few weeks:

Tue Nov 12
Things done last Friday with relevance to what we do today:

  1. individual messages about the project(s) have been sent
  2. web services notes, under development, have been made available

Also, good comment by David Mellinger: var url; in one of the functions discussed on Thursday (that would be show) completely eliminates the problems we experienced in Internet Explorer. Why is this relevant? Well, for one thing this particular problem wouldn't have occurred in PHP. In that case we would have had to use global to create the problem. This simply justifies the PHP point of view, and this basically completes our discussion (and analysis) of Homework Four.

Mon Nov 11
I have to clean Lab Ten installation instructions as soon as possible. There aren't probably many typos but those that are should not be there. And if there's anything missing we should be adding it now. Thanks to Matt Hottell for reminding me of the conflict of names (url is taken in IE) in Lab Nine and that tomcat needs to be unarchived with gnu's tar (same with make at PHP). And while I'm at it I could generate server.xml files for everybody.

Sat-Sun Nov 9-10
Interesting URLs:
http://registrar.indiana.edu/Calendars/102finex.html#schedule

http://events.iu.edu/webevent.cgi?cmd=opencal&cal=cal22

Fri Nov 8
Mail processing with PHP:

  1. Source Code One
  2. Source Code Two
  3. The Prototype

Thu Nov 7
Here's a link to David Flanagan's utility class for working with cookies.

Local copy (place this in the context of the first Hangman lectures).

Wed Nov 6
By now everybody should have received their updated grades and an e-mail about the project. Please also note that the homework assignments have all been posted, and the projects can be turned in as early as next week (starting on Fri, Nov 15). The project page should also contain links to all the notes that can help with each individual project.

Tue Nov 5
The last topic to be covered in this class is: building web services with Java. We'll try to make sense of WSDL, UDDI, SOAP, XML and, of course, Axis. Notes are under development and will be finised soon. Let me mark this reminder with a pointer to one of the major vendors in the industry. Oracle adds support for building Web services to JDeveloper. This simply shows that the momentum is for real. This is the right time to get started with web services. Tangential as they may be to the HTTP web, they share some characteristics, and are the wave of the future. And as it so often happens, the future is now. (Here's a link for the necessary warmpup).

Mon Nov 4

Tomorrow we will describe the Javascript shopping cart.

Here are some useful Javascript links:

  1. Javascript Developer Central

  2. Tools/Guides listed on the IU Webmaster home page.

Sat-Sun Nov 2-3
Thanks to David Mellinger for reminding me of the assignment for next lab. Please take a look at this. Feel free to include it in your shopping carts. Can you see how it works? What does it most resemble of the code that you already had?

<?
   function get_book_cats($isbn) {

       $conn = db_connect(); 

       $query = "select dgerman_php_catboo.catid, catname 
                 from dgerman_php_categories, dgerman_php_catboo 
                 where '$isbn' = dgerman_php_catboo.isbn and
                       dgerman_php_categories.catid = dgerman_php_catboo.catid"; 

       $result = @mysql_query($query); 


       if (! $result) return false;



       $num_cats = @mysql_num_rows($result); 
       if ($num_cats == 0) return false; 



              $cat_array = array(); 

              for (
                   $count = 0; 
                   $row = @mysql_fetch_array($result); 
                   $count++
                  ) 
                $cat_array[$count] = $row; 

       if (! is_array($cat_array)) {
                     echo "No categories currently available. <br>"; 
              }



              foreach ($cat_array as $row) {

                     $url = "show_cat.php?catid=".($row["catid"]); 
                     $title = $row["catname"]; 



                     do_html_url($url, $title); 

              }


   } 
 ?>
Also, a note: links in the notes to working versions of the prototypes may not work because I have not had the time to re-install the code. But you can do that. And we have done this consistently in class. So you should have a fairly clear understanding of that too. (Except that for the code above one needs a working demo, which I have now presented).

Wed-Fri Oct 30 - Nov 1
Most of the grades posted, feedback is coming to you by e-mail soon.

Tue Oct 29
  1. Midterm grading finished.
  2. Grades to be posted in the evening.
  3. Midterm exams will be returned to you in lab.
  4. You have until Thursday to make sure your Reality Check works.

  5. Lab Eight Notes updated.

Sat-Mon Oct 26-28
I am grading the
  1. Practical and
  2. Written Midterm Exams
and will have the grades ready for you by tomorrow morning.

Meanwhile you should keep working on the Reality Check part of the Midterm to have it finished by the due date.

Also, remember that there's now one more Project available:

  1. called Content Syndication, it's
  2. under Lecture Notes 26 (Dec 5) and
  3. describes how one can make a Perl/CGI based business communicate with
  4. a Java Servlets oriented business in a direct, program to program way.

But there are two more projects under development:
  1. a simple networked game in Java (that resembles the chat application in some ways) and
  2. the big Web Services project.

Expect both to be posted as soon as the grading is done.

Fri Oct 25
Here's the Java program used in the Midterm example:

import java.io.*;
import java.util.*; 

class Two {
    public static void main(String[] args) throws IOException {
	BufferedReader b = 
	    new BufferedReader(new InputStreamReader(System.in));
	String line; 
        int user, computer, pointsUser = 0, pointsComputer = 0; 
        String[] choices = { "stone", "scissors", "paper" }; 
        Hashtable h = new Hashtable(); 
        h.put("stone"   , new Integer(0)); 
        h.put("scissors", new Integer(1)); 
        h.put("paper"   , new Integer(2)); 
	Object choice; 
	System.out.println("Hello and welcome to the game.");           
	do {
	    computer = (int)(Math.random() * choices.length); 
            System.out.println("*** The computer has chosen. "); 
            System.out.println("Now it's your turn.");
	    System.out.println("Paper, scissors, or stone...");
	    System.out.print("Which will it be? Type here: ");
            line = b.readLine(); 
            choice = h.get(line); 
	    String message = "*** The computer's choice was: " + choices[computer];
            if (choice == null) {
		System.out.println("Sorry, this is not a valid choice."); 
		System.out.println("The computer has just scored one on you.");
                System.out.println("Its choice was: " + choices[computer]);
                pointsComputer += 1;                 
	    } else {
		user = ((Integer)choice).intValue();               
                if ((user + 1) % 3 == computer) {
		    System.out.println("Very good.\n" + message);
		    System.out.println("***(So, you win.)***"); 
                    pointsUser += 1; 
		} else if ((computer + 1) % 3 == user) {
		    System.out.println("Too bad.\n" + message);
		    System.out.println("***(So, you lose.)***"); 
                    pointsComputer += 1; 
                } else {
		    System.out.println(message + "\n***(This game's a draw.)***"); 
		}
		System.out.println("The score is now: "); 
		System.out.println("  Computer: " + pointsComputer); 
		System.out.println("  You     : " + pointsUser); 
            }            
	} while (true);   
    }
}
Please look at it and make a note of anything new in it.

Thu Oct 24
Midterm Exam today in class is open-book.

Practical Exam is due today.

Wed Oct 23
Take a look at this JSP as an example of clean compact design of the addition quiz program.

The Practical Exam is listed where the Lab for this week would have been.

Tue Oct 22
Grades updated, tonight the Practical Exam is to be posted.

All (but one set of) lecture notes have been posted.

The only thing that remains to be posted is the Web Services project.

That may take one more weekend to be put together.

Here's the e-mail message of Sunday:

Date: Sun, 20 Oct 2002 22:40:28 -0500 (EST)
From: Adrian German <dgerman@cs.indiana.edu>
To: Undisclosed recipients:  ;
Subject: A348/A548 Fall2002 Projects 


Dear A348/A548 Friends,

All but one (the very last one, for Dec 12) set of lecture
notes have been posted and all projects (minus the Axis web
services with WSDL and UDDI project to be described in the
Dec 12 last set of notes) can be started now.

The Axis set of notes might take me all of next week but I
anticipate it to be fully posted by Oct 27. Also, for Axis and
for everything server-side Java we need to install Tomcat (and
that is described in the notes too) and so if you are eager to
start, write to me and I will advise what to do between now and
then. (Start by installing Tomcat, essentially).

Please create a folder under protected and index it clearly on
your main web page (Project). Place this message under Oct 20, and
provide a brief answer on your web site to the following question(s):

a) What Project have you chosen? Why? What do you need to get started?
If you have started already where can I read about what you have done
thus far? If you are actively working on your project, what part of
it are you working on at this time? If you are stuck currently,
what do you think you need to resume working on the project
actively again?

... Adrian

P.S. If you no longer need to be on this list please let me know and
I will remove your username from my list. Thanks and all the best!

Mon Oct 21
Lab and Lecture notes posted up to (and through) Thanksgiving week.

Sun Oct 20
We are trying to bring all the grades to the most up to date present.

Please check them and let us know if you see any problems.

Sat Oct 19
Here's the code developed at the beginning of lecture on Thu (10/17):

<?
   $acc 
$acc $arg
 
?>
<html>
  <body>

    <table><tr><td> <a href="<?=$SCRIPT_NAME?>?arg=1&acc=<?=$acc?>">Add One</a>
               <td> <a href="<?=$SCRIPT_NAME?>?arg=-1&acc=<?=$acc?>">SubOne</a>
           <tr><td align=center colspan=2> <font size=+6><?=$acc?></font>
    </table>

  </body>
</html>
Remember that there was a first version that we turned into this.

I might be posting the sessions version over the weekend.

Fri Oct 18
The exams next week will run as follows:

  1. On Tuesday the Practical Exam is announced.

  2. You have until Thursday at lecture time to implement it.

  3. By that I mean you need to post it on your web site.

  4. Then, on Thursday, you will have to solve a scaled version of it in class.

  5. The written exam is open notes, and is a scaled down version of the practical.

  6. You can use your notes (but not a computer) and you need to finish in 75'.

I will post a few examples over the weekend.

Thu Oct 17
Lecture Notes Sixteen posted.

Wed Oct 16
PHP documentation is available here.

Tue Oct 15
Here's the Midterm Exam from last semester.

Mon Oct 14
Lecture Notes Fifteen posted, help some more with the exams next week.

Sat-Sun Oct 12-13
Lab Notes Seven posted, aim to prepare for the exam.

More to come soon.

Wed-Fri Oct 9-11
Here are a few more books of relevance to topics past, present and near future.


Tue Oct 8
Homework Three posted, is due next week.

Mon Oct 7
Lecture Notes Thirteen posted.

Sat-Sun Oct 5-6
Lecture Notes Twelve posted describe installation of PHP-4.1.0.

Fri Oct 4
Effective Monday my office hours for the rest of semester become:
MTWR 1-2pm LH201D
I am going to change the page of office hours tonight accordingly.

Thu Oct 3
As announced in class today Lab Assignment Four has been extended a bit: you have until Friday at the end of the day (midnight) to finish the document and you can include anything from the lecture today.

Wed Oct 2
Some of the things discussed yesterday, in a nutshell.

1. An example of polymorphism:

class Player { }

class Center extends Player { }

class Guard extends Player { }

class Atlanta {
  public static void main(String[] args) {

    Player a = new Center();
    Guard b = new Guard();

  }
}
Imagine an array of Players: Centers, Guards, etc.

2. An example of dynamic method lookup:

class Horse {

  void neigh() { System.out.println("Howdy."); }

  int numberOfLegs = 4;
}

class Unicorn extends Horse {
  Horn horn = new Horn();

  void neigh() {
    // super.neigh();
    System.out.println("Bonjour.");
  }

}

class Horn { }
The tester class is named after a famous playwright.

class Ionesco {
  public static void main(String[] args) {

    Unicorn b = new Unicorn();
    b.neigh();

    Horse   a = new Horse();
    a.neigh();

    Horse   c = new Unicorn(); // polymorphism
    c.neigh();

    // Unicorn d = new Horse();

  }
}
His plays were famous for their able pursuit of the absurd.

Minute paper for the day was: why do they put bells on cows?
(Answer: their horns don't work).

Tue Oct 1
As of 4:00pm today 21 students have made a tentative project choice.

Here's the breakdown as of that timestamp:

ProjectCount
Maintaining state with Perl/CGI and MySQL 1
PHP database access on the web. A shopping cart. 4
Client-side programming with Javascript. A shopping cart. 3
HTTP and Java networking: a network client, a web server, a simple browser. -
Distributed processing with Java: Chat with RMI (Remote Method Invocation). 2
Web chat using HTTP and Java. Applet to servlet communication. 2
Web discussion forum with Java servlets, JDBC, XML, XSLT. 5
XML-RPC, SOAP and other distributed computing alternatives. 1
Axis and Web Services. WSDL and UDDI. -
Other Project (please fill in the field in the question below). 3

I will have more details in class today.

Mon Sep 30
Many thanks to Tim for asking about the QuizSite activity regarding the project. The activity is now indexed and we're ready to collect your input. Personally I am looking forward to read it (the feedback). Please follow these steps to provide the feedback: access QuizSite, choose dgerman-A348, then select Project. You will find three questions. The first one is asking you to select one of listed topics for your projects. (Other is listed as an option). The second question is asking for clarifications, and the last one is trying to collect even more feedback.

Please try to offer this feedback as soon as you can so we can discuss it in class.

Sat-Sun Sep 28-29
Here are some books that cover material discussed in class thus far.


And here's the main Java sources thus far:

Fri Sep 27
Please think about your semester project. What will it be?

(Check the list of topics for which we have default projects).

Thu Sep 26
Starting Java, we reviewed that much. The rest will come next week.

frilled.cs.indiana.edu%ls -l
total 1
-rw-------   1 dgerman       762 Sep 28 00:19 One.java
frilled.cs.indiana.edu%cat One.java
import java.awt.*; 

class One {
    public static void main(String[] args) {
	int a = 2, b = a; 
	System.out.println("a = " + a + ", b = " + b); 
	System.out.println("Now we change a..."); 
	a = 3; 
	System.out.println("a = " + a + ", b = " + b); 
	System.out.println("... and that does not change b!\n"); 
	Rectangle p = new Rectangle(5, 5, 10, 10), q = p; 
	System.out.println("p is equal to " + p + ",\n      and q = " + q); 
	System.out.println("Let's change p (p.translate(-2, 4))...");
        p.translate(-2, 4); 
	System.out.println("p is equal to " + p + ",\n      and q = " + q); 
	System.out.println("... and that changes q, too!\n"); 
	System.out.println("That's the difference between reference and " + 
			   "primitive types in Java."); 
    }
}
frilled.cs.indiana.edu%javac One.java
frilled.cs.indiana.edu%java One
a = 2, b = 2
Now we change a...
a = 3, b = 2
... and that does not change b!

p is equal to java.awt.Rectangle[x=5,y=5,width=10,height=10],
      and q = java.awt.Rectangle[x=5,y=5,width=10,height=10]
Let's change p (p.translate(-2, 4))...
p is equal to java.awt.Rectangle[x=3,y=9,width=10,height=10],
      and q = java.awt.Rectangle[x=3,y=9,width=10,height=10]
... and that changes q, too!

That's the difference between reference and primitive types in Java.
frilled.cs.indiana.edu%

Wed Sep 25
Grades updated, please let me know if you have questions.

Tue Sep 24
Here's the program developed in class today:
#!/usr/bin/perl

print chr(61), " ", hex(26), " ", chr(hex(26)); 
(That was the helper, and now the big one).

#!/usr/bin/perl

&header; 

if ($ENV{"REQUEST_METHOD"} eq "POST") { 

  read(STDIN, $input, $ENV{"CONTENT_LENGTH"}); 

} elsif ($ENV{"REQUEST_METHOD"} eq "GET") { 

  $input = $ENV{"QUERY_STRING"}; 

} else { print "Sorry."; &trailer; exit; } 

@pairs = split(/&/, $input); 

foreach $pair (@pairs) {
  ($name, $value) = split(/=/, $pair); 
  $value =~ s/%(..)/chr(hex($1))/ge; 
   $in{$name} = $value; 
  print "***($name)*** goes with ***(", $in{$name}, ")***<br>"; 
}

$program = $ENV{"SCRIPT_NAME"}; 

print qq{  $input <p> 

<form action=$program method=POST>

Argument: <input type="text" name="arg" size=8> <p> 

Function: <select name="fun"> 
<option value="non"> Click me! 
<option value="add"> Deposit 
<option value="sub"> Withdraw 
</select> <p> 

When done push <input type="submit" value="Proceed"> 

</form>

}; 

&trailer; 

sub header {
  print "Content-type: text/html\n\n<html>" . 
        "<head><title>CGI Processor</title></head><body>"; 
}

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

Mon Sep 23
Lab and lecture notes for the week after also posted.

Sat-Sun Sep 21-22
Lecture, lab notes for next week posted.

Fri Sep 20
Minute papers and grades (some) updated in Postem.

Thu Sep 19
Here's the code we developed in class today.

Second program first, that keeps state:

#!/usr/bin/perl

print qq{Content-type: text/html\n\n<html>
<head><title>One</title>
<body>};

$me = $ENV{"SCRIPT_NAME"}; 
$what = $ENV{"QUERY_STRING"}; 

$number = $what + 1; 

print qq{
  You have accessed this page $number times. 

  <a href="$me?$number">Add One</a> 
}; 

print qq{</body></html}; 
Then the first one, that uses a menu:
#!/usr/bin/perl

print qq{Content-type: text/html\n\n<html>
<head><title>One</title>
<body>};

$me = $ENV{"SCRIPT_NAME"}; 
$what = $ENV{"QUERY_STRING"}; 

# print $me, "<br>\n$what<br>\n"; 

foreach $x (keys %ENV) {
  if ($x eq $what) { 
    print qq{<font size=+3>$x</font>}, " --> ", $ENV{$x}, "<br>\n"; 
  } else {
    print qq{<a href="$me?$x">$x</a>}, "<br>\n"; 
  }
}

print qq{</body></html}; 

Wed Sep 18
Grades posted, please use the next 7-10 days to make adjustments.

Tue Sep 17
Here's the program developed in class today:
#!/usr/bin/perl

$acc = 0; 

print "Welcome to the ATM! Your balance is $acc.\n"; 

print "Type something: "; 

while ($line = <STDIN>) {
  if ($line =~ /^bye$/i) {
    last; 
  } 
  if ($line =~ /^add (\d+)/) { 
    $arg = $1; 
    $acc = $acc + $arg; 
    print "Your balance now is: ", $acc, "\n"; 
  } elsif ($line =~ /^sub (\d+)/) {
    $arg = $1; 
    $acc = $acc - $arg; 
    print "Your balance now is: ", $acc, "\n";     
  } else {
    print "Perhaps you want to do something else.\n"; 
  }

  print "Type something: "; 
}
Remember you can also find it here (log in as lbird/dribl).

Mon Sep 16
Notes for this week (lectures, lab) posted.

Sat-Sun Sep 14-15
I am in Columbus, OH, for the weekend, returning Sunday night.

Fri Sep 13
Postem initialized, section is A348-1324 (includes A548 students).

Minute papers will be posted soon, notes for next week.

Thu Sep 12
Here are the prototypes for Homework Two:

A unix quiz has been posted for your practice in QuizSite.

Wed Sep 11
Is your Lab One properly done? Find out here.

Tue Sep 10
Don't forget to chmod 711 ~ before turning in Lab One.

Sketch of this week's notes (lab, lecture) posted.

Complete schedule of office hours has been posted last night.

Mon Sep 9
Class distribution list created, and first message sent (below):
Date: Mon, 9 Sep 2002 18:56:59 -0500 (EST)
From: Adrian German <dgerman@cs.indiana.edu>
To: Undisclosed recipients:  ;
Subject: Welcome to A348/A548 Fall 2002 Distribution List


Dear A348 and A548 Friends,

Greetings, and welcome to the class distribution list!

I will be using this list throughout the semester to send
announcements, short reviews and updates. Everything that
is sent to this list will also be posted on the web site,
under the "What's New?" heading. But by using this list I
hope to get information across faster, when needed.

I expect to use this list up to once a week, for messages
which are short, such as this one.

If you have dropped the class, or if you do not want your
username to be on this list please let me know and I will
update the list right away (simply reply to this message).

Thanks and let us know when we can be of help.

... Adrian

P.S. Office hours will be posted on the web site tonight,
all usernames are now listed and have been granted access to
open burrowww accounts and ports have now been assigned to all
the usernames enrolled or auditing associated with the class.
(The Students page is not in alphabetical order, though).
Please send an e-mail message to
dgerman@indiana.edu
if you

Sun Sep 8
List of students completely up-to-date.

Everybody now has a burrowww account and a port assigned.

Sat Sep 7
Here's a copy of A348's INSITE entry (note that this is just a copy).

Also note that the labs on Thursday are now (both) in Swain East 140 (SE140).

Fri Sep 6
Please use the following link if you want to download and install SSH:
http://kb.indiana.edu/data/aelc.html
The necessary info is somewhere on that page.

Thu Sep 5
Note that both labs on Thu are now in SE045.

Make-up Lab on Saturday 10am-noon in LH115 for Gan's section.

Hope to see you there!

Wed Sep 4
We'll try to set up a makeup time for Gan's lab, likely for Saturday.

Tue Sep 3
Lecture and lab notes for this week posted.

Here's a link to a (basically) complete set of notes, as last taught (Summer 2002).

Mon Sep 2
Fall Semester 2002 starts.

Updated by Adrian German for A348/A548