Computer_Science
 Home | People | Curriculum | Projects | Resources | Media

NOT Using Eclipse for the CS Teaching Lab

These instructions should be used to work on computer science assignments if you want or need to avoid using Eclipse (either because you are using a computer outside of the lab that doesn't have it, or because you are having trouble with it as seems to be the case in the fall of 2007).

GETTING AND SUBMITTING PROJECTS WITHOUT HAVING ECLIPSE RUN CVS FOR YOU

NOTE that CVS support is one of the most reliable and useful parts of Eclipse, and we recommend using Eclipse to get and submit your projects even if you can't edit them in Eclipse ... but if you must do without this, you can do so via command-line usage of the CVS version control software in a terminal window (e.g. via "xterm" on a linux system, or either the "Terminal" application the "X" application with an "xterm" on a Macintosh), Before using any of the following commands, you may need to use either
export CVS_RSH=ssh
(for "bash" or "sh" shells --- type "echo $SHELL" to check if you don't know), or
setenv CVS_RSH=ssh
(for "csh" or "tcsh" shells).

Obtaining projects
Use cvs checkout to obtain a project. You will need to specify your repository via the "-d" option, and your project name after the word checkout. For example, if your user name is "davew", your course is "cs105", and the project you want is "1-intersect", you would use the command

cvs -d davew@moe.cs.haverford.edu:/home/davew/cs105/Repository checkout 1-intersect

you can then use cd 1-intersect to move into the folder for your project and run your programs (see further below) and then submit your work (see directly below).

Submitting your work
Use cvs add and cvs commit to sumbit your work. You will first need to use cvs add to identify any files that you want to submit that have been created since you obtained the project or since your last cvs commit. Then, use cvs commit to actually submit your work. For example, if I've created a file "my_new_stuff.py", and made changes to "circle.py", I would type cvs add my_new_stuff.py and then cvs commit -m "done with the lab to submit my work (including the comment "done with the lab"). The entire sequence might look like this in my terminal:

[ip165-82-176-19:~/tmp/1-intersect] davew% cvs add my_new_stuff.py
cvs add: scheduling file `my_new_stuff.py' for addition
cvs add: use `cvs commit' to add this file permanently
[ip165-82-176-19:~/tmp/1-intersect] davew% cvs commit -m "done with the lab!"
cvs commit: Examining .
/home/davew/cs105/Repository/1-intersect/circle.py,v <-- circle.py
new revision: 1.2; previous revision: 1.1
/home/davew/cs105/Repository/1-intersect/my_new_stuff.py,v <-- my_new_stuff.py
initial revision: 1.1

Seeing what you've changed
To see what you've done since the last time you committed something, type cvs diff. There are ways to see differences compared to various other older versions, or see the comments you used when you committed, but they are much nicer in Eclipse and I'm tired of describing things.
Working on several different computers
You can edit your project on several different computers if you are very careful to do the following:
  • BEFORE each time you start to work, do Team->Update in Eclipse or type cvs update.
  • AT THE END of each work session, do Team->Commit in Eclipse or follow the "submitting your work" instructions above. If you do each of those every time you start or stop work, you should always have the latest version of your files. (Note that you don't need to worry about this within the H110 lab, where all the computers share files automatically).

    EDITING PROGRAMS WITHOUT ECLIPSE

    You should be able to edit programs in most computer languages in any editor that can save as "plain text" without any formatting instructions. Simple editors include gedit on linux, TextEdit on a Macintosh, or whatever opens a ".txt" file on MS Windows. The "emacs" editor can be somewhat tricky to learn, but it will automatically select an editing mode based on the file name, and then highlight programming language keywords and indent an appropriate amount (when you press tab), so it may be worth your while to learn this if you'll need to do a lot of programming without a graphical IDE.

    RUNNING PYTHON PROGRAMS WITHOUT ECLIPSE

    If you can open a terminal window (e.g. via "xterm" on a linux system, or either the "Terminal" application the "X" application with an "xterm" on a Macintosh), and get to the folder containing your programs (e.g. via the "cd" command), you should be able to run the python language via the python command. For example, you would type python circle.py to run the circle.py program.

    RUNNING C++ PROGRAMS WITHOUT ECLIPSE

    The proper way to do this is to learn how to construct your own "Makefile", and then do that and use it. Then you'd just need to know to set the include directory (used with -I) to "/home/courses/include", the library directory (used with -L) to "/home/courses/lib", and the default library (with -l) to "courses". But who has time to go all the way to the Degobah system and learn the secrets from Yoda? So...

    Note that, if you have obtained the project via Eclipse and compiled it once, Eclipse will have built a Makefile for you, and you can use "(cd Debug ; make all)" (in the project directory) to compile, as long as you haven't added or removed any files from the project (if you have, you could run Eclipse once and do a "refresh" on the project, and let it compile once, and then quit Eclipse, or figure out how to edit the Makefile that Eclipse created.

    If you don't even have the Makefile from Eclipse, you may be able to get by with the command line g++ -I /home/courses/include *.cc -L /home/courses/lib -l courses and then run the the program by typing a.out.

    Haverford College Page maintained by John Dougherty, David Wonnacott, and Rachel Heaton.
    Computer Science Department, Haverford College.