Notes From Class
Week 1: August 31, September 2 and 4, 2009
Week 2: September 7, 9 and 11, 2009
The "problem solving with computers" handout in your green "class reader" will one-day be a replacement for Chapters 1 and 2.
Week 3: September 14, 16 and 18, 2009
Please get a copy of the class notes from a friend.
You can download a trial version from http://www.tucows.com .
You will need to adjust the program settings so that the connection to school is secure -- use sftp and socket 22 (not socket 21).
Site IP addresses
--------------------------------------------------
glue.umd.edu 128.8.10.68
128.8.10.71
--------------------------------------------------
Insert them into the (ftp program) site manager.
prompt >> ssh glue.umd.edu
Once logged in you can transfer files back and forth with the "scp" command.
To transfer a file from your laptop to glue:
prompt >> scp file-name glue.umd.edu:
The file will be put in your home directory.
To copy a whole directory/folder of content:
prompt >> scp -r folder-name glue.umd.edu:
Again, the folder will be put in your home directory.
To download a file from glue to your laptop, type:
prompt >> scp glue.umd.edu:file-name .
The dot (.) at the end of the command means ... put the file in my present working directory (command pwd).
Week 4: September 21, 23, and 25.
Read the instructions for creating a personal home page (pg. 23 of the green class reader). Then start to read the "A Beginners Guide to HTML" tutorial.
Use a text editor (vi or pico) to type in the minimal html document on pages 27-28 of the class reader.
Then go to the "meet the class page" and make sure that the link from your entry to your home page works.
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 <-- remove/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 ce-systems.html
moves your shell to the public directory and then systemantically creates the
HTML files for your home page, resume page, and a write-up on ce-systems.
Notice that each file name has the "html" extension -- web browsers need this information.
The class reader contains a list of basic editor commands.
--------------------------------------------------------------------------------
You will need the latter to build your web page for homework 1.
Please get a copy of the class notes from a friend.
Week 5: September 28 and 30. October 2.
cd ../pub
cd images
and then giving the command:
mv ~your-login-name/image-file .
The dot (.) means move the named file to the present working directory (/pub/images).
scp image-file-name your-login-name@glue.umd.edu:
You will be prompted for your glue account password, and that's it.
If the account name on your Mac just happens to be the same as the login name on your glue account (e.g., I use austin in both cases), then the "scp" commands simplify to those shown above (see Week 3).
Here's what I found on a web tutorial:
If you are pasting INTO a putty session, you should just be able to paste into the putty session with the middle (or both) mouse button(s). So, for instance, you can find a command somewhere on my web site using a browser, highlight it and hit CTRL-C then paste that command directly into the putty window at the shell prompt by hitting the middle mouse button.
Week 6: October 5, 7 and 9.
Week 7: October 12, 14 and 16.
whereis javac
whereis java
If you don't have java, then you can download it from: http://java.sun.com/
Click on "downloads" and then go to the section entitled "JDK 6 Update 16" and click on the "Download" button.
Please let me know if that doesn't work!!
Week 8: October 19, 21 and 23.
If you missed a few classes, please get the notes from a friend.
Week 9: October 26, 28 and 30.
From Seoul, South Korea. The Internet is set to undergo one of the biggest changes in its four-decade history with the expected approval this week of international domain names -- or addresses -- that can be written in languages other than English, an official said Monday.
The Internet Corporation for Assigned Names and Numbers, or ICANN -- the non-profit group that oversees domain names -- is holding a meeting this week in Seoul. Domain names are the monikers behind every Web site, e-mail address and Twitter post, such as ".com" and other suffixes.
One of the key issues to be taken up by ICANN's board at this week's gathering is whether to allow for the first time entire Internet addresses to be in scripts that are not based on Latin letters. That could potentially open up the Web to more people around the world as addresses could be in characters as diverse as Arabic, Korean, Japanese, Greek, Hindi and Cyrillic -- in which Russian is written.
This is the biggest change technically to the Internet since it was invented 40 years ago," Peter Dengate Thrush, chairman of the ICANN board, told reporters, calling it a "fantastically complicated technical feature." He said he expects the board to grant approval on Friday, the conference's final day.
Week 11: November 9, 11, and 13.
Week 12: November 16, 18, and 20.
I have asked the CE department to make the xerox copies again!!!
Sorry about that.
Week 13: November 23, 25, and 27.
Week 14: November 30. December 2 and 4.
Week 15: December 7, 9 and 11.
public double getX() {
return c.dX;
}
The (abbreviated) output that I get for Problem 4 is as follows:
prompt >> java EngineeringProperties .... details of output omitted .... Total Area = 5.86 --------------------------------- Moments of Inertia (about coordinate axes) I_xx = 51.840 I_yy = 91.070 I_xy = 64.550 Centroid(X) = 3.84 Centroid(Y) = 2.84 Moments of Inertia (about centroid) I_xx = 4.380 I_yy = 4.380 I_xy = 0.408 Orientation of Principal Axes Angle = 0.785 radians Angle = 45.000 degrees prompt >>
A
collection
is an object that groups multiple elements into a single unit.
Collections are used to store, retrieve, manipulate, and communicate aggregate data.
Typically, they represent data items that form a natural group:
A collections framework is a unified architecture for representing and manipulating collections. This framework provides the following benefits:
All collections frameworks contain the following:
In the Java Collecctions Framework the interfaces are organized as follows:
Figure 1. Hierarchy of interfaces in the Java Collections Framework.
Units include:
Collections are used to store, retrieve, manipulate, and communicate aggregate data. Typically, they represent data items that form a natural group.
General Purpose Implementations
A simplified view of the relationship between containers and the Set, List and Map interfaces is as follows:
| Interfaces | Hash Table |
Resizeable Array |
Balanced Tree |
Linked List |
| Set | HashSet | TreeSet | ||
| List | ArrayList | LinkedList | ||
| Map | HashMap | TreeMap |
In practice, an implementation will follow:
Figure 2. Taxonomy of interfaces, abstract classes, and concrete classes in the Java Collections Framework.
Points to note:
Bottom Line/Review
Containers provided in the standard Java library (Adapted from Eckel, Edition 3):
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
public class EngineeringProperties2 {
public static void main ( String args[] ) {
// Create and initialize a grid of ten shapes
List shapes = new ArrayList();
Shape s0 = new Rectangle( 0.25, 0.25, 0.0, 2.0 );
shapes.add ( s0 );
.... etc ....
imports the appropriate packages and initializes an arraylist with the first item. To compute the engineering properties we walk along the array, retrieve the items and make the appropriate calculation, e.g.,
double dArea = 0.0;
for (int ii = 1; ii <= shapes.size(); ii = ii + 1) {
Shape s = (Shape) shapes.get(ii-1);
dArea = dArea + s.area();
}
Week 17: .....
Hope you have a happy holiday.
Developed in August 2009 by Mark Austin
Copyright © 2009, Department of Civil and Environmental Engineering,
University of Maryland