CSCI 151 - Lab 00 - Spring 2008 Meet the lab and its tools

No due date, but you're expected to know this

If this is here, I'm still updating the lab.

Assignment Description

This lab is intended to be a bit of a review of the things that you've done in CS 150 and to introduce you to some new tools.


Part 1 - Getting started

Lab access, computer accounts

You'll need to see Jackie Fortino in King 223 about getting a lab pass and building access for the semester.

If you don't have a CS account, see Nate Daniels in the OCTET office about getting one.

Create directory

Make yourself a directory to put your class work in.

% cd
% mkdir cs151
% cd cs151
% mkdir lab0
% cd lab0

Download start files

Here are some files to start you out: lab0.jar.

I like to just copy the URL and then download the files from the command line using wget.

% wget http://www.cs.oberlin.edu/~kuperman/csci151/labs/lab0.jar

Now unpack the files.

% pwd                # be sure you are in ~/cs151/lab0/
% jar xvf lab0.jar
% rm lab0.jar        # don't need this anymore

Part 2 - Eclipse

Now you should start Eclipse. This is a Java IDE that is used world-wide. It has a number of very useful features including automatic compilation, error detection, built-in debugger, autocomplete, and many other features.

Start eclipse

Just run it from the command line.

% eclipse

You can accept the default for workspace. It'll take a bit to start up.

Do tutorial

Try out a couple of the overview and tutorials. At least the "hello world" tutorial.

Create project

Now we should create a project from existing source like we'll be doing in many of the labs.

  1. Select "File", "New", "Project"
  2. Call it "lab0" (or whatever you want)
  3. Create it from existing source. Use the "Browse" button to select the lab0 folder you created earlier
  4. Now just select "Finish"

Eclipse exercises

Ok, I'll try and give details later, but these are things I want you to end up being able to do.

Set preferences

First, you should set the preferences in the editor. Select the menu "window", "preferences". Then click on the triangles in front of "Java", "Editor" and click on "Typing".

Notice that it will automatically insert closing braces, quotes, and the like by default. The second section "automatically insert at correct position" has things that I really like to enable. When you type either ; or a brace, it'll jump to the right spot for it most of the time.

If you take advantage of the auto-Javadoc comments, you'll probably want to also change the settings under "Java", "Code style", "Code Templates", "Comments", "Overriding methods" to match "methods".

Fixing output to be more sane

By default, Eclipse uses tabs for indentation. However, it displays them as being only 4 spaces, when most other things will display them as 8. A minor detail, but changing this will make things much more readable outside of eclipse. The easiest way is to change the preferences "Java", "Code Style", "Formatter" and then select "Java conventions" as the Active profile.

do some editing

While you are working on stuff, you'll probably find that there are lots of functions you might want to use via the pull down menus. Note that the keyboard shortcuts are listed on the right hand side. Learning to use them will speed up your work.

Here are some useful things to know:

You might also want to read through this Eclipse Tutorial - Useful Programming Functions

Running Java

For this class, we'll be exercising more than the usual amount of memory in Java programs. You should be familiar with the -X family of arguments to use with Java.

% java -Xmx1g MyProg     # use up to 1 gigabyte of memory
% java -Xmx500m MyProg   # use up to 500 megabytes of memory

Part 3 - Lab tools

Snapshots

The CS server will be making periodic backups of your files for you. You can access these backups in the folder

~/.zfs/snapshots/

This is an exact copy of your files at the time the snapshot was made. It'll be useful if you accidently delete something in lab.

handin / lshand

handin is the right way to submit your work in this class. If you talk to other students, they might tell you about a web based version of handin. Please don't use this as it is unsupported and has resulted in more than one student submission being discarded last semester.

I'll probably give you instructions on how to use handin as shown below, but I suspect you've got the hang of it by now.

Also, always use lshand to verify that your submission was received. If it does not show you your latest submission, then we don't have it.

Should handin be broken at the deadline, email us ASAP and stop editing stuff in your lab directory (or email the files in lieu of a submission).

Version control

Might be worth looking at later.


Part 4 - Email

Now that you're familiar with the lab, I'd like you to share some info with me. When you send me an email, please include cs151 in the subject as that should bypass my spam filter and make it stand out in my inbox. Please send me an email with the following information:

  1. Your name as I'd see it in Oberlin paperwork (especially for non-@oberlin addresses) and what you prefer to be called in class. Give hints as to the pronunciation if needed.
  2. Briefly tell me why you are taking this class and what you hope to get out of it.
  3. Tell me a little bit about your programming background
  4. Tell me what you are majoring in or thinking of majoring in.
  5. Tell me if you are part of a performance group, sports team, etc.
  6. Tell me something interesting about yourself that you would like to share with me.

handin

Instructions for handing things in usually goes here. Let's not worry about it this time.

I affirm that I have adhered to the Honor Code in this assignment.

handin

You now just need to electronically handin all your files.

    % cd          # changes to your home directory
    % cd cs151    # goes to your cs151 folder
    % handin      # starts the handin program
                            # class is 151
                            # assignment is 0
                            # file/directory is lab0

    % lshand      # should show that you've handed in something

You can also specify the options to handin from the command line

    % cd ~/cs151                 # goes to your cs151 folder
    % handin -c 151 -a 0 lab0

Lab Goals

This lab is intended to:


Last Modified: February 05, 2008 - Benjamin A. KupermanVI Powered