CSE 115 - Spring 2010 - Banner
UB -
University at Buffalo, The State University of New York Computer Science and Engineering
  • CSE 115 - Spring 2010
CSE 115 - Spring 2010 - Navigation
CSE 115 - Spring 2010 - Announcements

Lab 1

CSE 115 - Spring 2010 - Lab 1

For the first week of recitation, work on the exercises described here: Week 1 exercises

Introduction

In this lab you will primarily do some set-up of the development tool you will be using in the course, called Eclipse.  You will also learn how to extract a Java project from a CVS repository, and how to submit a Java project using Web-CAT.  This will ensure that you know how to do the basics with Eclipse and also how to submit your work in this course.


Lab Tasks

Log in

Your first lab task is to log in to your CSE computer account.

Running a Program on Linux

The first thing we want to do is do some set-up for your account.  To do this we will run a program.  At the Linux prompt in a terminal window (refer back to last week’s lab if you don’t remember how to do this) type the command

/projects/CSE115/Setup/115setup

This command runs a script on the Linux system that does a number of things behind the scenes to get you set up to work on the labs. The one thing that you can immediately notice is the creation of a file called cse115.epf in your home directory (use the ls command at the Linux prompt to see it). After you type the command and press Enter/Return (the EnterKey.JPG  or ReturnKey.JPG  key), you simply get the Linux prompt back. This is typical: most Linux commands give no report back if the command was a success; only failures are reported.

Beginning Your Setup of Eclipse

Last week you learned how to use some basic Linux commands to navigate and manipulate the directory structure.  Now you need to learn to run Eclipse. First open a terminal window and then type the following command to launch the program at the Linux prompt:

eclipse &

The ampersand ‘&’ causes Eclipse to run in the background – in practical terms this means that right after you press Enter/Return you get the Linux prompt back.

 

When you start up Eclipse, you will see a splash screen similar to this one:


Eclipse Splash Screen

Then you will see a window that will ask you which workspace you want to open. The workspace is the folder/directory where Eclipse keeps the files for your projects.  By default, it will probably say something like this:


Workspace Launcher

Be sure to check the box "Use as default and don't ask me again", and then click "OK".  After you click “OK” you will see a screen that looks like this:


Eclipse Opening Screen

Click on the arrow on the right-hand side to take you to the Eclipse workbench.  After doing this you will see the default workbench setup, shown in the screenshot below. The TAs will talk about customizing this and changing it around throughout the semester. You don't have to customize the Eclipse workbench, but we have some suggestions for making life easier when working on projects for this course.


Eclipse Workbench

Import preferences file

The first think you will want to do is tell Eclipse a few things about how you want it to behave. This is a one-time process. In other words, once you have successfully carried out these steps you will NOT need to repeat them in lab.

Earlier while working on this lab, you ran a script at the Linux prompt. This script put a file in your home directory named cse115.epf. This file contains some preferences for Eclipse. If you did not do this above, you should check now to see that this file is in your home directory by typing ls (or ls ~ if you changed your directory) at the Linux prompt. If you do not have this file in your home directory, you should run the script again by doing the following: at the Linux prompt, type

/projects/CSE115/Setup/115setup

and press the Enter/Return key. After you do this, the file named cse115.epf should be in your home directory.

To import the preference settings contained in this file, you will first need to open the Import dialog. Do this by selecting "Import..." from the "File" menu.

It is common practice to abbreviate menu selections that you need to make in instructions like these. For example, we can abbreviate

select "Import..." from the "File" menu

by simply writing "File" -> "Import".

 

This time we'll show the screen shot of the menu item being selected, but from now on we'll simply write menu selections using this abbreviated method. Your teaching assistant can help you if you have trouble locating the correct menu selections.

 

File-Import

An "Import" dialog window should appear.

Import Dialog

Select the + sign (or the > symbol depending on your OS) and expand the "General" Folder. Note that there is now an option for "Preferences", as below. Select it and then click "Next".

Import Dialog Preferences

This opens up an "Import Preferences" dialog window.

Import Preferences

 

Click "Browse" and select the cse115.epf file from your home directory:

ImportPreferencesWithFilename

 

The rest of the options should be OK as they are (they should be as in the screenshot above - if not, make them the same). Click "Finish".

 

 

Seeing the connections to code repositories

Eclipse has different perspectives.  Each perspective shows you “views” (sub-windows) related to a particular task.  Your default perspective is likely the Java perspective.  We’ll learn much about the Java perspective over the next few labs, but right now you want to access what are called CVS repositories.  To do this, we will open up a CVS Repositories View at the bottom of the screen.  In order to do this select Window -> Show View -> Other from the menus at the top of Eclipse.

The window that pops up looks like this:

Show

Expand “CVS” and select “CVS Repositories”, and click OK.  Your Eclipse window should now look something like this:

21

If you encounter problems, ask your recitation TA for help.

Custom labels for the repository locations

The default labels for the CVS repositories are very long.  You can set custom labels.  Right click on the LabSkeletons repository, and select “Properties”. This opens a window like this (make sure “CVS” is selected on the left):

CustomLabelLabs

 

Select “Use a custom label:” and type the name “Lab Skeletons” in the text field.  Click “OK” to finish.

 

Now name the LectureCode respository “LectureCode”.  Your CVS View should look something like this:

 

CVSRepositoriesShortNames

 

When you have completed this step, please ask the TA to come over and view your Eclipse window.  This will serve two purposes, the first is to get you credit for attending recitation this week.  The second is to make sure that you have everything you need to keep working on this lab.


Getting a project from a CVS repository

The next thing for you to do is learn how to retrieve a Java project from the Labs repository.  Open the Labs repository (click on the icon to the left of “Labs”), and then HEAD (click on the icon to the left of “HEAD”); you will probably be prompted for a password:

 

CVSPassword.gif

 

Once you have successfully entered your CSE account password, click “OK” and you will see the contents of the repository displayed in the view:

 

25

 

 

To retrieve the Lab1 project that I have set up, right click on it, and select “Check Out” from the menu which pops up.

 

CVSLabsOpenCheckOut.GIF

 

Once finished, you will see the file in the Package Explorer part of the Eclipse screen; if you wish, you can open the project and see what’s there.

 

21

 


Submitting your project to Web-CAT

The last main thing we want you to learn how to do as part of this lab is to submit your work.  In this lab this involved just submitting the project that you checked out from the Labs repository.

 

First, set up the Web-CAT’s Eclipse submitter:  Windows->Preferences.  Select “Electronic Submission”. Cut and paste the following into the field marked “Assignment definition URL”:

 

http://web-cat.cse.buffalo.edu:8180/Web-CAT/WebObjects/Web-CAT.woa/wa/assignments/eclipse

 

Enter your username in the “Default username” field.  When done, click “OK”:

EclipseSubmitterPreferences.gif

 

You should see the Lab 1 project in your Package Explorer on the left side of your screen.  Right-click on the project name “Lab1” and drag down to “Submit…”.

Submission0.GIF

 

Once you have done this Eclipse talks to our Web-CAT server and gets information about available assignments that can be submitted to.  When I took the screenshot there was only this one CSE115 lab open for submission.  Since other courses use Web-CAT for submission too, it is possible that you will see other courses’ assignments listed too.  Whatever the case, as long as Eclipse can communicate with the Web-CAT server this will open an “Electronic Submission” window:

 

ElectronicSubmission.jpg

 

 

Select the correct one based on your lab session.  Enter your username (which may already be filled in – it will be the same as your CSE username) and your password, and then click “Finish”.   Note that this is your Web-CAT password, NOT your CSE account password.  Your Web-CAT password was sent to you via e-mail, but if you do not still have this, you can go to:

 

http://web-cat.cse.buffalo.edu:8180/Web-CAT

 

to reset your password (click on the “Forgot your password?” link).  Note that you do NOT need to go to this website to submit your work – visit this website only if you need to reset your Web-CAT password.  Do NOT make this password the same as your CSE account password, as it is NOT encrypted.

 

If your submission was successfully sent to the Web-CAT server, you will see this window:

 

Submission1.gif

 

Once you click “Finish”, if your submission was successfully received by the Web-CAT server you will see this in your Eclipse window:

 

Submission2.gif

 

Otherwise you will see a failure message.  This means your submission did NOT go through.  The most common problem is an incorrect password.  If this is the case, you must attempt your submission again.

 

Once your submission has been accepted by Web-CAT, you can click on the link shown in the screenshot above, and you will see a grading screen that looks something like this:

 

Submission3.gif

 

For this lab you will receive full credit if you are able to submit this project successfully, before it is due.  Late submissions will be penalized, as indicated in the course syllabus.  Please note that your submission will indicate that you received 0/100 as credit.  This is because Web-CAT automatically grades some portions of some labs and produces a grade result immediately.  Because there is nothing for Web-CAT to grade for this lab, it assigns 0 points and waits for the TA to assign the remainder of the points.  In this case, the TA will assign 100 points if you simply submitted the lab.  You know that you submitted the lab when you see the screen with your score on it.

 

Note: Another requirement to receive full credit on this lab is the successful completion of the signature form from the last page of the course syllabus. You must have turned in the last page of the syllabus by the end of lecture, Friday, January 29th to be able to earn full credit on this lab. Those students that do not turn in the signed form will face a penalty on this lab assignment.


Due dates

This lab is due to be submitted by Sunday, January 31, 2010 at 11:59:59pm for ALL recitation sections.


 

 

CSE 115 - Spring 2010 - Footer

Page maintained by Adrienne Decker

Contact: adrienne@buffalo.edu | 130 Bell Hall | (716)645-3184