Adventures in Computing
Yo, baby!
Yo, baby!
Adventures in Computing
Adventures in Computing
Adventures in Computing
Adventures in Computing
Tue Dec 04
Notes as we wrote them in class today.

Take this xml file and run this program on it.

Here's the script to make individual appointments.

Today we wrap up the discussion we started last time.

We cover:

  • Java Server Pages (JSPs)
  • Java Servlets
  • JDBC (Java Database Connection)

Next time: XML-related topics.

Link, link, link, link, link, link. And link.

Thu Nov 29
Add this to your ~/.bashrc then source it:
export JAVA_HOME
Relevant for this week's class(es):

  • make sure your Tomcat is installed (we do that in class on Thu)
  • create a new context and make it reloadable
  • add a servlet to the classes folder
  • add a description in the associated web.xml for the servlet
  • compile and access the servlet, change and recompile the servlet until done

One can then start to understand Java syntax for servlets and JSPs as follow:

Tue Nov 27
List of ports for the rest of the semester.

Things we will use today:

After this we can install Tomcat.

Wed-Sun Nov 21-25
Thanksgiving Recess.

Thu Nov 15
The last of the notes for this week.

Example of code format I want to rewrite some of the notes as/in.

Also, relevant for the lab this week:

  • make sure your Tomcat is installed
  • create a new context and make it reloadable
  • add a servlet to the classes folder
  • add a description in the associated web.xml for the servlet
  • compile and access the servlet, change and recompile the servlet until done

A JSP that implements the Flag Quiz.

Wed Nov 14
Experiment tomorrow in class, we will start by downloading:

  • the application chat.jar java archive file
  • the java.policy security policy file (if you start a server)

Then I will be starting the server on the instructor workstation (while you wait and watch):

java -classpath chat.jar NetworkServer 12009
You know what that means:

  • only one of us does this (me, from the instructor workstation, first)
  • my port number is 12009
  • the server's name is implicit, somewhere in the code of both the client and the server
  • usually we leave that up to be specified by command line arguments, for flexibility
  • having it wired in the code here likely will streamline the experiment a bit more
  • you don't see it, or know it, and can't even guess it, but my IP is

Next each one of you will start a client and connect as your IU username. For example, me:

java -classpath chat.jar NetworkClient 12009 dgerman
The order of arguments on the command line is obviously important. The rest, in class, tomorrow night.

Tue Nov 13
Lecture notes for today.

Six pages about Tomcat installation:

Sat-Mon Nov 10-12
Class notes have been updated with brief explanations for each program posted.

This should make it easier for you to choose, and ask questions.

Here are additional notes that could be especially useful for this week's classes.

Fri Nov 09
Sequence of programs discussed/developed in class on Thu:

  1. command line arguments; using an array of Strings

  2. storing more than one type in an array; intro to interfaces
    (Notice that the same can be achieved with a regular, or an abstract class.)

  3. event-handling; setting up a MouseMotionListener

  4. how we can combine the two classes from the previous example.

Thu Nov 08
Installing java on your computer (PC instructions).

Wed Nov 07
Brief review of the Java we know so far.

Tomorrow we use this in the context of: graphics and event handling.

Tue Nov 06
  1. We started with this code.
    We compile it (javac then run (appletviewer to start it.
    The paint method in Five is like the talk method in Unicorn. (Applets are Horses.)
    All of this was to study when paint method gets invoked. We count those invocations.

  2. The exact same thing can be noticed in this program.
    You see though that a JFrame is not meant to be written on directly.
    It doesn't take care of its raw inside, unless it has a component there.
    And that's what we usually do: we create a panel and place it in there, draw in it.

  3. Next time: why Applet and not JApplet. What's paintComponent? Event-handling.

Thu Nov 01
Code developed in class today:

  1. We started with this file, containing two classes.
    Notice the instance members (variables and methods) and the static methods.
    Constructors are like methods only they don't have a return type.

  2. We then made a change. One class has gone away(... hey, hey, hey)!
    Static members are accessed through the class they belong to.
    Instance members are accessed through a variable that points to the instance.
    The distance method we have developed takes two points, does all the work.
    Points are passive, yet they can hold methods too. Could that change anything?

  3. Sure, so we said: let's make the distance method non-static.
    Then we'd have to access distance through one of the objects, let's say... a. And this works just fine.
    But isn't it weird to have to give a to a.distance(...), as if a didn't know anything about itself?
    Itself... That sounds like the this keyword! Of course any object knows about itself!

  4. So we make one more change, leading to the final version of our program.
    Notice that one argument only is needed for the distance method: the other point.
    Notice we calculate the distance twice: we first ask a how far it is from b, ...
    ... and then we ask b how far it is from a. The results are the same. Pretty cool, I'd say...
    And that concludes our review of classes and objects.

  5. As a conclusion we can say: classes are containers, they hold static members and a blueprint.
    The blueprint is made of all non-static members. Constructors are not members (static or non-static).
    The blueprint can be empty, a class also can be empty. There is a default no-args constructor.
    If at least one constructor is specified no other constructor is provided automatically.

  6. Finally, we developed this program.
    It gave us a chance to discuss the class extension mechanism, inheritance and dynamic method lookup.
    Polymorphism was exemplified, see the last line in the main program of class Story, and a couple of lines above.
    Polymorphism and dynamic method lookup are inter-related concepts.

  7. Next week: a) abstract classes, interfaces, b) graphics and event handling.
    With b) we finally see all these concepts coming to life (being put to good use, that is).

Tue Oct 30
Code developed in class today:

  • (we need to have at least one main, we could have several)
  • (simple modeling, instance members, return, this)
  • (constructors, void, unit-testing)

Mon Oct 29
Office hours for this class: MTWRF 10:30-11:30am in LH201D.

Sun Oct 28
Java API documentation can be found here (jdk1.6).

Check the What's Due? for reading assignments through Lecture Six (Thu, Nov 10).

Sat Oct 27
Thanks to John Meylor for sending to me the code of the programs developed in class this Thu:

Fri Oct 26
Reading assignments for the first four lectures have been posted (see What's Due?)

Thu Oct 25
Useful link. Requires IUB network ID.

Things there that you might be able to use in this class:

I may refer to these books when I write to you, in our weekly e-mail colloquies.

Wed Oct 24
Slides for tommorow's class.

Tue Oct 23
Eclipse tutorial.

Mon Oct 22
Class starts tomorrow at 7:00pm in LH115 (see section 29146).

There is also a graduate section for this course (see section 30448).

The class will provide basic coverage of:

  • Object-oriented programming
  • Inheritance and dynamic method lookup
  • Interfaces and inner classes
  • The event listener model
  • Graphical user-interface (GUI) design
  • Exception handling
  • Generic programming
  • Stream input/output (I/O) and object serialization

Along with specialized coverage of:

  • Multithreading
  • Distributed objects
  • Databases
  • Network Programming
  • XML Processing

The main purpose of this class is to:

  • gently introduce these topics to students who need to know about them.