Spring Semester 2009


Link to individual appointments script.

Fri Jun 19
Second summer session starts here's the list of port numbers:
44039 Brumbaugh, Margaret Susan
44040 Sorosky, Nicholas Tyler
44041 Turner, Sarah Megan
44042 Amanbayev, Talgat
44043 Baker, Jordan Keith
44044 Castner, Dean A
44045 Fernandez, Francis Paul
44046 Jefford, Logan Nance
44047 Kang, Yoon Mo
44048 Skaggs, Timothy Lee
44049 Al-Azdee, Mohammed
44050 Liu, Hongliu
44051 Nehrt, Nathan
44052 Pejaver, Vikas
44053 Rectanus, Lauren Caitlin
44054 Wright, Scott N
44055 Huang, Gang
44056 Keif, Echo Marie
44057 Paulraj, Sushmitha
44058 Sabetti, Leonard
44059 Sankaranarayanan, Madhuvanthi
44060 Shah, Neethu
44061 Sobieralski, Joseph Bernard
44062 Swaminathan, Rajeswari
44063 German, Dan-Adrian 
The text can be found here.

Mon Apr 27
Here's the JSP we developed in class today.

Appointments will continue until and including Wed May 6 around 6pm.

Here's where you can read on how to set up Java on your computer.

Wed Apr 22
Correct code for the problem discussed today:
import java.util.*;

class Student implements Comparable {
  double gpa; 
  Student(double gpa) {
    this.gpa = gpa; 
  } 
  public String toString() {
    return "S(" + this.gpa + ")"; 
  } 
  public int compareTo(Student other) { 
    if (this.gpa - other.gpa > 0) return 1; 
    else if (this.gpa - other.gpa < 0) return -1;
    else return 0; 
    // return (int) (this.gpa - other.gpa); does not work well!
    // 3.9 - 3.1 = 0.8 truncates to 0 instead of 1 and so on...
  } 
}

class One {
  public static void main(String[] args) {
    ArrayList students = new ArrayList();
    students.add(new Student(2.1)); 
    students.add(new Student(3.9)); 
    students.add(new Student(2.5)); 
    students.add(new Student(1.1)); 
    students.add(new Student(3.1)); 
    students.add(new Student(1.9)); 
    students.add(new Student(0.3)); 
    System.out.println( students );

    Collections.sort( students );

    System.out.println( students );    

  }
}
Code we will discuss in class today, also some slides from the past.

Mon Apr 20
Code developed in class today:
/* <applet code=One.class width=400 height=400>
   </applet>
 */

import java.applet.*; 
import java.awt.*; 
import java.awt.event.*; 

public class One extends Applet {
  public void init() {
    Umpire a = new Umpire(this); 
    this.addMouseMotionListener(a); 
  }
  public void paint(Graphics g) {
    
  }
}

class Umpire implements MouseMotionListener {
  One a; 
  Umpire(One a) {
    this.a = a; 
  } 
  public void mouseMoved(MouseEvent e) { 
    int x = e.getX(), y = e.getY();  
    xOld = -1; 
  }
  int xOld = -1, yOld = -1;
  public void mouseDragged(MouseEvent e) { 
    int x = e.getX(), y = e.getY(); 
    Graphics g = this.a.getGraphics(); 
    if (xOld >= 0) 
      g.drawLine(xOld, yOld, x, y); 
    xOld = x;
    yOld = y; 
  }
} 
Thu Apr 16
Notes from the lab today.

Wed Apr 15
Notes from today's class.

Mon Apr 13
Notes from today's class.

Thu Apr 09
Notes from yesterday's class and individual appointments:

Mon Apr 06
Slides used in class today.

Notes from today's class.

Wed Apr 01
Here's a hint on how you can sort using built-in Java utilities.

Here's a simplification of it (note the use of java.util.Arrays.toString()).

Also, here's how you print formatted output:

import java.util.*;

class One {
  public static void main(String[] args) {
    int[][] m = {{1, 2, 3}, {4, 5, 6}, {7, 8, 9}};
    System.out.println(Arrays.deepToString(m));
    for (int i = 0; i < m.length; i++) {
      for (int j = 0; j < m[i].length; j++) 
        System.out.printf("%4d ", m[i][j]);
      System.out.println(); 
    }
  } 
}

Wed Apr 01
Here's a selection of snapshots from our discussion in class:

Mon Mar 30
Notes from today's class.

Fri Mar 27
Reading assignment for next week: Ivor Horton book chapters 1-4, 5.

Older notes about for loops and patterns: here.

Here's a more comprehensive set of older notes for total beginners:

(Note: these are from an older book I wrote with Nick Boyce a few years ago.)

  1. What computers can do and how. Programming. Java
  2. Algorithms. Programs. Mechanics of implementation in Java
  3. Objects and classes, and other basic stuff in Java
  4. Numbers. String. Before Scanners
  5. Syntax. The structure of main
  6. Boolean values, expressions, if statements
  7. Introduction to user-defined types. Classes
  8. Diagrams for an operational perspective
  9. Reality Check (Part One)
  10. Classes, objects, constructors
  11. Branches and paths. Ifs
  12. Java review by Dilbert (Part One)
  13. Loops
  14. More practice with loops. Tokenizers
  15. Nested loops, other loops, loops and a half, scalable patterns
  16. Developing a simple interactive game
  17. Another case study: designing fractions
  18. Milestones Review (with diagrams)
  19. Java arrays
  20. Partially filled arrays. Array parameters and return values. Simple array algorithms
  21. Java Fandango (Review, Andy Kaufman style)
  22. Parallel arrays. Arrays of object data. Vectors.
  23. Inheritance and the class extension mechanism
  24. Vectors, hashtables, leftovers
  25. Basic event handling and such Java review by Dilbert (Part Two)

Some quizzes from the past as well:

  1. Batch One
  2. Batch Two
  3. Batch Three
  4. Batch Four
  5. Batch Five
  6. Batch Six
  7. Batch Seven (try this if you think you know for loops)
  8. Batch Eight
  9. Batch Nine
  10. Batch Ten

  11. An older exam

Mon-Wed Mar 23-25
What's Due and Class Notes pages now including information about the remaining assignments.

Individual e-mail messages sent Tue at about noon. Available times for appointments also posted, above.

Here's one of the programs developed in class today:

class One {
  public static void main(String[] args) {
    int size = 15; 
    for (int line = 0; line < size; line++) { 
      for (int col = 0; col < size; col++) {
        if (line == size-1 || line == 0 || col == 0 || col == size-1) 
          System.out.print("* "); 
        else 
          System.out.print("  "); 
      } 
      System.out.println(); 
    } 
  } 
}

Thu Mar 12
Notes from this past week to be posted here.

Today in lab we looked at these past notes.

Thu Mar 05
Discussion on how to structure the program from lab today.

Wed Mar 04
Code we developed in class on Monday: first, second program.

Code we developed in class today: first, second program.

Tue Mar 03
How to provide Homework Three database access from the web: notes.

Mon Mar 02
Today in class we'll discuss:

Meanwhile appointments for the week can still be made here.

Thu Feb 26
Things brought up in lab today:

Wed Feb 25
Today in class we discuss the midterm prototype.

We also finish implementing Homework Five: notes from today's class.

Tue Feb 24
Notes from yesterday's class.

Mon Feb 23
Office hours, individual appointments times for this and next week.

Today we wrap up the homework assignments with Homework No. 5.

Thu Feb 19
We discussed Homework Four in class today: program one, program two.

We also reviewed the PHP installation steps for those who didn't have PHP installed already.

Wed Feb 18
Things discussed in class today.

Tue Feb 17
Please read this document, sample SQL query development for Homework Three.

Mon Feb 16
We start discussing Homework Three.

Thu Feb 12
These are the notes from the lab today.

Wed Feb 11
Notes for today's class.

Tue Feb 10
Office hours today: 9:00am-12:30pm in Lindley Hall 201D.

Mon Feb 9
Today's set of notes.

Thu Feb 5
Notes from yesterday's class.

Notes from today's lab.

Mon Feb 2
Notes from today's class, and the working program.

Wed Jan 28
Campus is closed until noon today due to snowy conditions. Updates.

Class is cancelled. It would have been taught by Richard Pinapati.

Hope you can make it to the lab tomorrow, to be taught by Josh LaMar.

Mon Jan 26
Here's the set of notes for this week.

I'm in North Carolina (at Emergent, the maker of Gamebryo) until Friday night.

Josh LaMar will teach Mon lecture and Thu lab. Richard Pinapati will teach Wed lecture.

They're both outstanding teachers and will help you with everything, including Homework Two.

Sat-Sun Jan 24-25
Homework Two is actually due on 02/01 -- typo fixed on the What's Due? page.

Notes (as written for last semester's class) for all assignments posted now.

Notes for next week to be posted (and to be announced here) shortly.

Thu Jan 22
Notes to be used in lab today.

Wed Jan 21
Notes for the week:

Local copies of the Univ. of Virginia tutorial: one, two, three, four, five, six, seven, eight.

Mon Jan 19
Martin Luther King Day. Classes do not meet.

Thu Jan 15
Lab today started a bit late, due to inclement weather.

Here are the notes we used for the second part of the lab.

Wed Jan 14
Here's a link to notes we might use in class today.

Office hours will likely be: MTWRF 9:00-10:00am in LH201D (Lindley Hall 2nd floor, 201 suite).

Office hours also by appointment (e-mail dgerman@indiana.edu to determine a convenient time).

Tue Jan 13
List of students and ports for the semester.

Requested information about the lab (venue and time).

Mon Jan 12
Class starts today in I107 at 11:15am.


Updated by Adrian German for A202/A598