Apply Now!
 

Department of Computer Science

Syllabus · Schedule · Policies · Resources · Assignments · Course Description ··· Printable Page

Exam 1 Review: Topics, Questions

Book website
 (slides, programming practice)
 
Sorting Demos:

Demos at Harvard (Can compare multiple)
Smith College demos (Can control speed -- 1 at a time)

Color Table
Color Palette Applet


Downloads (for working at home):

  1. Eclipse IDE for Java Developers (Galileo Package). Choose the Eclipse IDE for Java Developers package after following the preceding link. The appropriate download for your platform (Win32 or Mac) will be determined by the web page. Save the zip file to disk, then extract it to your hard drive (C:/Eclipse works well). You can launch Eclipse by double-clicking C:/Eclipse/eclipse.exe.
  2. Latest Java Runtime Environment (JRE) for Windows. You likely do not need to download this. If you run Windows XP or Vista you likely have a recent JRE installed via the Java Update utility that runs in the system tray (bottom-right area of screen). The latest system update for Mac OS X includes an updated JRE. Accept the license agreement, then choose the Windows Offline Installation installer (e.g., jre-6u20-windows-i586-p.exe). After downloading, run the installer.
  3. Files you create on non-lab computers can be transferred to the lab using a USB flash (thumb) drive. Before you transfer the files, create a new directory on your Linux account to store the files (e.g., mkdir ~/ProjectName). Transfer only the files that have a ".java" extension to your newly created directory. You can then launch Eclipse and create a New Java Project. Select "Create project from existing source" under Contents. Then "Browse..." to the directory where you stored the transferred files (e.g., ProjectName).

Creating a project in Eclipse:
   See "Lab_1a" and "Lab_1b" for more information on creating projects.

  1. Create a new project in Eclipse by selecting "File->New->Project...", then select "Java Project" and click the "Next" button.
  2. Enter the project name. Avoid using spaces, using underscores instead.
  3. Check "Use project folder as root for sources and class files" under "Project Layout".
  4. Click the "Finish" button. Unless you wish to import Java source files (that, e.g., you transferred from another computer), you are done.
  5. If you want to import existing files into the project, right-click the newly-created project in the Package Explorer.
  6. Select "Import...", expand the General folder, and choose File System. Click the "Next" button.
  7. For the "From directory", browse to the directory that contains the files you wish to import.
  8. Check the folder name and only the ".java" files you wish to import. Click "Finish".


Submitting a Project

  1. Type cd ~/161/ProjectName, replacing "ProjectName" with the name of the project you created in Eclipse (note the tilde before the first forward slash). Avoid using spaces in project names (prefer underscores). If you mistakenly used a space, you must type cd "~/161/ProjectName". Spaces in file names can cause various complications and problems.
  2. Type ls -l (i.e., "el ess space minus el") to view a long listing of the directory contents. Verify that the files you wish to submit are listed, have a non-zero size, and the appropriate date. To ensure a file contains what you think it does, type cat FileName, replacing "FileName" with the name of the file you wish to view.
  3. Enter submit.
  4. Enter, for example, elzer161 (please choose the correct professor!).
  5. The file names that will be submitted are displayed (e.g., myinfo.txt and Hello.java). Verify that they are correct. If they are correct, enter y.
  6. Note the message that indicates which files have been submitted.
  7. You can type submitlog at any time, in any directory, to view your submit history.

Transferring files from home

  1. Obtain the software to transfer the files: SSH Secure Shell Client for Win XP and Vista. Install the executable and use one of the Linux machine names here. After installing SSH, you should have two icons on your desktop: SSH Secure Shell Client and Secure File Transfer Client.
  2. Launch SSH Secure Shell Client. Click "Quick Connect" and specify a "Host Name" from this list.
  3. Enter your CS "User Name" and ensure port number is set to 22.
  4. Click the "Connect" button and enter your password. You should now be logged onto your CS account.
  5. Create a new directory with "mkdir ~/ProjectName" (the squiggle is a tilde, which represents your home directory).
  6. Click on the "New File Transfer Window" icon on the toolbar. It's the yellow folder with blue dots emanating from it.
  7. You now have a file transfer window with two panes. The left pane shows files from your computer, and the right pane shows files on your CS account. In the left pane, locate the file you wish to transfer (it's likely in your Eclipse workspace on your home computer). Then drag the file to the folder you created in the right pane.
  8. The copied file should now be located in "~/ProjectName" on your CS account. Switch to the SSH Secure Shell console, "cd" into "~/ProjectName" and type submit.
  9. Close the File Transfer window and type "exit" in the console.
  10. If later you're working in the lab and wish to import a transferred file into Eclipse, follow the instructions on creating a project and importing files.

Return to Dr. Stephanie Elzer's website