Computer Science 2

Section 1: 8:30 - 9:20 TTh @ 110 MLH
Section 4: 12:30 - 1:20 TTh @ 114 MLH

Code from 10/14
Multiply.java
Sentence.java

Collections code
LinkedListTest.java
UniqueWords.java

Net code
DayClient.java
HTTPClient.java
PortTest.java
SMTPClient.java

Thread code
HerkyThread.java
TenThreads.java

Project Requirements

UPDATED
  1. Hand in a paper copy of your source code, i.e. all files with a ".java" extension, along with any other files necessary to run the program. Make sure that you submit an electronic copy of your source code as well.
  2. Your source code should have your name, section number, ID, and project number listed in a comments block at the beginning of the code.
  3. Your code is graded on both correctnes and clarity.

Submitting Projects

  1. Go to the folder where you've written your source code using the "cd" command. For example, if you've created a folder named "CS2" in your home directory, and this directory is where your source code is, go there.
  2. Make a new directory for submitting using the "mkdir" command.
  3. Copy your source code into the directory using the "cp" command.
  4. Submit the folder using the "submit" command.
  5. Enter the course number (in this case, c020).
  6. Enter the submit directory.
That's all!
Dr. Slonneger's Very Tiny Java Graphics Program
public class VTiny
{
   public static void main(String [] args)
   {
      javax.swing.JFrame jf = new javax.swing.JFrame();
      
      //Notice the anonymous class!
      jf.getContentPane().add(new javax.swing.JPanel()
      {
         public void paintComponent(java.awt.Graphics g)
	 {
	    super.paintComponent(g);
	    setBackground(java.awt.Color.cyan);
	    g.setColor(java.awt.Color.blue);
	    g.setFont(new java.awt.Font("Serif", java.awt.Font.BOLD, 250));
	    g.drawString("J", 50, 200);
	 }
       });

       jf.setSize(250,300);
       jf.setVisible(true);
}

A Short Guide to UNIX
   Useful commands:

        cntl-d      -- quit

        cntl-c      -- break

        cat         -- list a file on the screen at full speed

        more        -- list a file on the screen, one page at a time

        rm f        -- remove file f from a directory

        cp f1 f2    -- make copy of a file

        cp path/f . -- make copy of a file from somewhere else with same name

        ls          -- list the current directory on the screen

        ls -l       -- list the current our directory with dates and permissions

        mv f1 f2    -- rename a file or directory

        cd subd     -- change to subdirectory

        cd ..       -- change to parent directory

        cd          -- return to home directory

        mkdir dir   -- create a new directory

        rmdir dir   -- remove an empty directory

        chmod 644 f -- change permissions on a file or directory

        ps          -- show processes running in current shell

        kill pn     -- kill process with number pn

        man cmd     -- display documentation from the manual on the screen

   For help on the use of any command, use the "man" (short for manual)
   command. For example, "man man" will tell how to use "man". Some
   "man pages" (output from the man command) are longer than a screenfull;
   for these use "man man | more", which sends the result of man to the
   more command.

Permissions are describe by 9 bits rwxrwxrwx. The first three are you, the middle three are your group, and the last three are the world. To make a file readable, use "chmod 644 filename", to make a directory passable, use "chmod 711 dirname". and to make a directory passable and readable, use "chmod 755 dirname".

For printing in 301 MLH, use the command: lp -dp301 filename.