![]() |
![]() Spring Semester 2009 |
Link to individual appointments script.
Fri Jun 19The text can be found here.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
Mon Apr 27Appointments 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 22Code we will discuss in class today, also some slides from the past.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 ); } }
Mon Apr 20/* <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
Wed Apr 15
Mon Apr 13
Thu Apr 09
Mon Apr 06Notes from today's class.
Wed Apr 01
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
Mon Mar 30
Fri Mar 27Older 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.)
Some quizzes from the past as well:
Mon-Wed Mar 23-25Individual 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 12Today in lab we looked at these past notes.
Thu Mar 05
Wed Mar 04Code we developed in class today: first, second program.
Tue Mar 03
Mon Mar 02
Meanwhile appointments for the week can still be made here.
Thu Feb 26
Wed Feb 25We also finish implementing Homework Five: notes from today's class.
Tue Feb 24
Mon Feb 23Today we wrap up the homework assignments with Homework No. 5.
Thu Feb 19We also reviewed the PHP installation steps for those who didn't have PHP installed already.
Wed Feb 18
Tue Feb 17
Mon Feb 16
Thu Feb 12
Wed Feb 11
Tue Feb 10
Mon Feb 9
Thu Feb 5
Mon Feb 2
Wed Jan 28Class 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 26I'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-25Notes (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
Wed Jan 21Local copies of the Univ. of Virginia tutorial: one, two, three, four, five, six, seven, eight.
Mon Jan 19
Thu Jan 15Here are the notes we used for the second part of the lab.
Wed Jan 14Office 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 13Requested information about the lab (venue and time).
Mon Jan 12