Archive

Archive for the ‘Eclipse’ Category

How to use git to solve and submit your exercises

February 25th, 2010

You need git to send in assignments. You will receive the skeletons for your solution through git, presumably use git to version your intermediate steps, and when you’re all done, you’ll push your changes to the server, where we’ll grade them. This file tells you the few basic commands that you’ll need to solve the exercises.

This article is also available as a presentation: Git tutorial.

Where to get git

Download:

  • Cygwin for Windows (don’t forget to include the git package)
  • Git everyone else

Generate your ssh key

Here, and in the rest of this text, lines that start with a dollar sign ($) are to be issued on the command line (without the dollar sign itself, of course).

If you know what you’re doing, you can skip this. This creates your ssh key:

$ ssh-keygen -t rsa

Send us your ssh key

Mail the ~/.ssh/id_rsa.pub (note: only .pub file!) to: patrik.rauber@students.unibe.ch. Then, receive your confirmation.

Clone your group’s repository

$ git clone git@pinocchio.unibe.ch:groupXY

(where XY is your group number)

$ cd groupXY

Configure git

Issue the following commands:

$ git config --global user.name "YOUR NAME"
$ git config --global user.email "your@email.com"

$ git remote add p2ubungen git@pinocchio.unibe.ch:p2ubungen


Get exercise skeletons

These are the code skeletons that you will have to adapt or look at for completing your tasks. The following command copies the skeleton into your repository.

$ git pull p2ubungen master

Set up Eclipse

Eclipse is the program where you’ll write your code. Get it from eclipse.org/galileo.

Now, open Eclipse. Set your workspace to the folder: “groupXY”, i.e. the repository root.

Import p2regex project with by choosing from the menu:
File > Import … > General > Existing Projects into Workspace.

Workflow

Here are the commands that will get the code into your local repository, and into the public server, that your group and the TAs can see.

Retrieve latest exercise skeletons from server

$ git pull p2ubungen master

Retrieve your group’s changes from server

$ git pull

Commit to your local repository ###

$ git add *
$ git commit -m “I changed something!”

Retrieve your group’s changes from server

$ git pull

Upload to server

$ git push

Verify that everything went good with git

As you work, to see the status of git (what it’s about to commit, what’s in the repository and what isn’t, etc.) you can issue:

$ git status

Verify thoroughly that everything went good with git

After finishing your work, check that everything was pushed:
$ cd /tmp
$ git clone git@pinocchio.unibe.ch:groupXY
$ cd groupXY
$ ls -lh

More info on git

http://sunoano.name/ws/public_xhtml/scm.html.

Here, replace “I changed something” with a good and long description of what you changed.

nes1983 Eclipse, P2

How to branch with Subclipse

March 16th, 2009

On the command line, you can create a branch with

svn cp http://popeye.unibe.ch/svn/p2/Group23/week04 http://popeye.unibe.ch/svn/p2/Group23/ludo01

The same is done with Subclipse as follows

  • Goto the Subclipse perspective
  • Open your group repository.
  • Select the folder you want to branch.
  • Right-click and choose “Branch/Tag”
  • In the dialog, enter the full name of the new folder.
  • Finish, and done.

PS, using the command line you should also be able to copy folders from /Common to your group account. Alas, in Subclipse this wont work.

akuhn Eclipse, P2, Tools

Test Coverage

March 6th, 2009

Programmers love writing tests. If you have a progress-o-meter, writing tests is even more fun. Code coverage tools report how much and which parts of your code are covered by tests.

Eclemma is a coverage tool for Eclipse. You can run both your application or your test cases with Eclemma, and get a coverage report.

Eclemma screenshot.

Eclemma is open source. Go get it!

admin Eclipse, Tools

Enabling assertions in Eclipse

March 1st, 2008

To turn assertions on in Eclipse

  • Go to menu Window > Preferences
  • In the dialogue that appears, select Installed JREs
  • Select your JRE, and click Edit. A new dialog opens.
  • Enter -ea under Default VM Arguments
  • Click Ok to save the change.

Your assertions will now be checked when you run your programs.

admin Eclipse