Notes From Class
Week 1: August 30 and September 1, 2006
Week 2: September 6 and 8, 2006
Site IP addresses
--------------------------------------------------
wam.umd.edu 128.8.10.141
128.8.10.142
128.8.10.143
glue.umd.edu 128.8.10.68
128.8.10.71
--------------------------------------------------
Week 3: September 11, 13 and 15, 2006
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.
--------------------------------------------------------------------------------
Week 5: September 25, 27 and 29, 2006
Week 6: October 2, 4 and 6, 2006
Week 7: October 9, 11 and 13, 2006
Week 8: October 16, 18 and 20, 2006
Week 9: October 23, 25 and 27, 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().
Week 10: October 30. November 1 and 3, 2006
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
Week 12: November 13, 15 and 17, 2006
Week 13: November 20 and 22, 2006
Week 13: November 27 and 29; December 1. 2006
Week 14: December 4, 6 and 8, 2006.
A
collection
is an object that groups multiple elements into a single unit.
Units include:
Collections are used to store, retrieve, manipulate, and communicate aggregate data. Typically, they represent data items that form a natural group.
/**
* ==============================================================
* 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 );
}
}
}
Week 14: December 11, 2006.
Week 15: December 18, 2006.
Developed in August 2006 by Mark Austin
Copyright © 2006, Department of Civil and Environmental Engineering,
University of Maryland