Notes From Class
Week 1: August 30 and September 1, 2006
-
If you do not have a Glue or Wam computer account, please get one.
See the FAQ's for step-by-step instructions.
-
I have put your picture on the meet the class page.
If you have any objections (e.g., the mug shot isn't up to
your usual GQ/Vogue standards), please let me know.
-
If you can't find Austin/Chancogne at the local bookstore,
you can buy it online.
For a list of online bookstores and prices, see
BookHQ.
Week 2: September 6 and 8, 2006
Week 3: September 11, 13 and 15, 2006
-
Reading
Please read chapters 1 and 2 of Austin/Chancogne.
Although some of the numbers are now five years old,
the underlying story remains the same.
-
Prelude to Homework 1 ....
Make sure that you know how to log in to either your glue or wam account.
Read the instructions for creating a personal home page (pg. 23 of the yellow
class reader). Then start to read the HTML tutorial .. use a text editor (vi or
pico) to type in the minimal html document on pages 27-28 of the yellow reader.
Then go to the "meet the class page" and make sure that the link from your
entry to your home page works.
-
You can test the speed of your internet connection with
http://www.dslreports.com/stest .
-
Here are a few basic UNIX commands:
Unix Commands
--------------------------------------------------------------------------------
1. cd <-- change to home directory
2. cd file1 <-- change to directory file1
3. ls and ls -ls and ls -tl <-- list contents of a directory
4. mkdir file1 <-- make a directory called file1
5. rmdir file1 <-- remove directory file1
6. cp file1 file2 <-- copy file1 to file2
7. mv file1 file2 <-- move file1 to file2
--------------------------------------------------------------------------------
Note. Directories cannot be removed unless they are empty.
Let's suppose that you have created a file and now you want to remove it. Try:
8. rm file1 <-- remoove/delete file1
Text editor commands
--------------------------------------------------------------------------------
1. vi filename <-- use vi editor to change contents of filename.
For example, the command sequence:
prompt >> cd ../pub
prompt >> vi Welcome.html
prompt >> vi resume.html
prompt >> vi australia.html
moves your shell to the public directory and then systemantically creates the
HTML files for your home page, resume and trip page. Notice that each file
name has the "html" extension -- web browsers need this information.
The class reader contains a list of basic editor commands.
--------------------------------------------------------------------------------
-
On Friday I will demo the vi editor in class ... we will also begin working
on a simple web page.
-
Homework 1 is available.
Due date is 9am, September 22, 2006.
Week 5: September 25, 27 and 29, 2006
-
Read the new web page on spreadsheets
-
Homework 2 is available.
Due date is 9am, October 4, 2006.
-
On Wednesday we will cover high- and low-level computer languages.
Please read Section 2.3 in Austin/Chancogne (pg's 30-34).
Week 6: October 2, 4 and 6, 2006
-
Please read the article for Scientific American entitled: XML and the Second Generation.
-
Click here to see my notes on systems of systems
and the second generation of the web.
Week 7: October 9, 11 and 13, 2006
-
Java has eight basic data types. We will be covering the details in class.
For background reading, see Question 7 in the FAQ web page.
The IEEE 754 standard defines how floating point numbers will be stored.
For details, see pg's 78-79 of Austin/Chancogne.
Week 8: October 16, 18 and 20, 2006
-
October 18. We will cover variables and basic arithmetic.
Basic arithmetic in Java is almost exactly the same as in C.
A summary of the operators can be found on pg. 59 of Austin/Chancogne.
-
The first midterm has been moved to Monday!
Week 9: October 23, 25 and 27, 2006
-
October 23.
Midterm I. The midterm exam will be closed book. It will cover Chapters
1 and 2 of Austin/Chancogne and anything written on the board during
the first seven weeks of class.
-
Homework 3 is available.
Due date is 9am, November 6, 2006.
Most of what you need can be found on the "java examples" web page
and in the yellow class reader.
In past years, we have employed the method keyboardInput() to read
input typed at the keyboard.
Now that Java 5 is available, you should replace the
method keyboardInput() with getTextFromConsole().
-
If you want to do your Java Programming on your laptop,
I suggest that you download and install Eclipse.
Instructions may be found on the
Internet Resources page.
Week 10: October 30. November 1 and 3, 2006
-
A note on Problem 14
Someone in class asked a very sensible question -- how do we show
the series approach a given value. For problem 14 I would create a
simple table, perhaps something like:
Homework 14
No Terms Summation
=======================================
1 0.5
2 0.67
3 .....
.... .....
=======================================
with a sufficient number of terms to show the summation approaches 1.
(e.g., just do 20-30 terms).
Week 11: November 6, 8 and 10, 2006
-
Homework 4 is available.
Due date is 9am, November 17, 2006. No extensions -- I will
hand out solutions next Friday. If you cannot complete the
entire assignment, then just hand in what you have completed.
Week 12: November 13, 15 and 17, 2006
-
On Monday we will cover arrays and strings.
On Wednesday we will start working with objects.
-
Most of you will use either Java 1.4 or Java 5 this semester.
Click here
for a peak at the new features in Java 6.
-
Click here to visit a web site
with lots of Java examples. Some of them will be useful for your homework.
Week 13: November 20 and 22, 2006
-
November 20.
Midterm II--Open book. The midterm has two questions.
Question one covers your basic understanding of
Java (e.g., loops, branching constructs, arrays).
In question two you have to answer questions about a java program that
solves a problem.
-
No class on Wednesday. Spend the day traveling....
Week 13: November 27 and 29; December 1. 2006
Week 14: December 4, 6 and 8, 2006.
-
Now that we know how to create objects,
the next thing to think about is their organization.
How, for example, do you organize large numbers of
objects so that things are easy to find and modify?
A
collection
is an object that groups multiple elements into a single unit.
Units include:
-
Sets.
A set is a collection that cannot contain duplicate elements.
-
Lists.
An ordered collection (sometimes called a sequence).
Lists can contain duplicate elements.
The user of a List generally has precise control over
where in the list each element is inserted and can
access elements by their integer index (position).
-
Queues.
Queues typically order elements in a FIFO (first-in-first-out) manner.
-
Maps.
An object that maps keys to values.
A Map cannot contain duplicate keys.
Each key can map to at most one value.
-
SortedSet
A Set that maintains its elements in ascending order.
Several additional operations are provided to take
advantage of the ordering.
Sorted sets are used for naturally ordered sets,
such as word lists and membership rolls.
-
SortedMap
A Map that maintains its mappings in ascending key order.
This is the Map analog of SortedSet.
Sorted maps are used for naturally ordered collections of key/value pairs,
such as dictionaries and telephone directories.
Collections are used to store, retrieve, manipulate, and communicate aggregate data.
Typically, they represent data items that form a natural group.
-
Here are the essential details of an arraylist of strings.
/**
* ==============================================================
* ArrayTest3.java: Demo ArrayList Example in Handout...
*
* Written by: Mark Austin April 2006
* ==============================================================
*/
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
public class ArrayTest3 {
public static void main( String args[] ) {
// Create and print a simple array of strings .....
List stringList = new ArrayList();
stringList.add("A");
stringList.add("Red");
stringList.add("Indian");
stringList.add("Thought");
stringList.add("He");
stringList.add("Might");
stringList.add("Eat");
stringList.add("Toffee");
stringList.add("In");
stringList.add("Church");
System.out.println("Use for loop to walk along list" );
System.out.println("=================================" );
for ( int i = 0; i < stringList.size(); i = i + 1 )
System.out.println("Name = " + stringList.get(i) );
System.out.println("Use Iterator to walk along list" );
System.out.println("=================================" );
Iterator iterator1 = stringList.iterator();
while ( iterator1.hasNext() != false ) {
String s = (String) iterator1.next();
System.out.println("Name = " + s );
}
}
}
-
Here is homework 5 from last semester (Spring 2006).
Week 14: December 11, 2006.
Week 15: December 18, 2006.
-
Final Exam
December 18, 8-10am in our regular classroom.
Developed in August 2006 by Mark Austin
Copyright © 2006, Department of Civil and Environmental Engineering,
University of Maryland