Homework 0

due 2013/1/25


This homework is mostly to exercise the mechanics of using Eclipse, loading a project, editing a file, and turning in your results using turnin. There is very little work to do, but successfully executing it will assure you and us that the mechanics will not interfere with the more challenging homeworks to come. Please follow all steps carefully, and consult via Piazza to see if there are comments, clarifications, or corrections.

You are going to install a piece of software that contains a giant network with a million edges in it. With that software you will display a selected node along with its neighbors and all the edges between those nodes. You will answer a couple of simple questions about the sub network displayed. Then you will repeat the investigation for another selected node.

Setting up your Environment

First, you must get yourself to a machine that runs Eclipse. All the lab machines have it installed.
(If you prefer to use your personal computer, you will have to install it yourself without our help. Follow the download-and-install instructions at and it shouldn't be hard.)

Getting the Project

Second, download the zip file at

Opening the Project

Now open Eclipse. If it asks you for a workspace, use whatever you like (the default is fine) but remember where it is!
Under the File menu select Import. A panel pops up; click the triangle beside General to open its sublist and highlight Existing Projects into Workspace; click Next. Another panel pops up; click the radio button beside Select archive file; then hit the Browse button and navigate to the file you just downloaded (; press Open; make sure that mkse is checked; and hit Finish.

Compiling and Running

The Package Explorer will now show a Java directory called mkse; click on the triangle to see what's in there; open the triangle beside src, then the one beside edu.upenn.cis.mkse150.hw0, and then highlight the file called
Now under the Run menu, choose RunAs and its (only) subitem JavaApplication.
Wait a few seconds; you should see a couple of lines of output followed by a window popping up that displays a network, which is a representation of node 337 and all its neighbors in a much much larger network (not all rendered, thankfully).
Count how many neighbors 337 has.
Double click on answers.txt (in the Package Explorer) to open that file, and type some answers to questions 1abc.
Quit the Java application called edu.upenn.cis.mkse.hw0.HelloFriends (not Eclipse!).

Editing a file

Edit the line in to change the favorite node number to 13.
Now go and repeat the previous paragraph to compile and run it again; count the neighbors. Answer questions 2abc in answers.txt. Save.

Turning work in

Finally, it's time to turn in your work.

(Skip this step if you are working on a lab machine.) Move these two files to :
[your eclipse workspace]/mkse/src/edu/upenn/cis/mkse150/hw0/ and
[your eclipse workspace]/mkse/answers.txt
If you need to find out what [your eclipse workspace] is, pull down the menu File-->Switch Workspace-->Other... and you will find the current workspace listed prominently (and you can easily copy it). Then be SURE to hit Cancel to get out of there!
If you need a refresher of how to copy files to remote machines, type man scp.

Now log in to and type
turnin -c mkse150 answers.txt
Of course, what is meant by "" is the whole path to that file relative to your current working directory. If you need it, here is some extra help with the turnin command.
If you mess something up, just type the command again. Only your last submission is saved.


All done. But you are welcome to browse around in those .java files under src/ ... you will be seeing more of them.