CPSC 221: Basic Algorithms and Data Structures
2015 Winter Term 2
Computing


Home Learning Goals Schedule Administration Readings Lab/Lecture Notes Assignments Computing UBC Connect
Working from Home

For access from home (or elsewhere), you can use an SSH client (with the -Y flag for GUIs like emacs) to give you access. Mac and Linux users can ssh from their Terminal (Mac users may want to install X11 if they are using the -Y flag); Windows users can install XManager or another SSH client. We recommend editing and compiling from the server using, e.g., gedit, jedit (cross-platform, since it's in Java!), or kate or the challenging but rewarding emacs or vim.

Windows: Two handy notes for using XManager: (1) You can edit files directly on remote computers using Xftp. Try right-clicking on the file in the right-side of the display and opening it with your editor. (2) In Xshell, in the File menu under Properties, under Terminal, use UTF-8 as your "Encoding" to get rid of the strange characters you sometimes see in compilation errors. If you ever need to transfer files between the server and your computer, Xftp can do that too.

Mac: Since Max OS is built on Unix, many Mac users like to work directly on their machines when they can. If you don't have g++ installed, installing the massive Xcode can help, and don't forget to install cmake too. With Xcode, follow OS X -> Application -> Command Line Tool to create your new xxxxx.cc file. You can compile and run it using Xcode's tools, or go to the command-line and follow our usual instructions for g++. When it is time to debug, instead of using gdb (which probably won't be available, and even if it is, will require sudo-ing to use it), try using lldb, which is similar.

If you really want to, you may try working from your own machine directly using an IDE like Eclipse, NetBeans, or Visual Studio, or a non-unixy text editor, such as Notepad++, or Sublime Text. If you choose to do this, however, remember that you will be marked based on your program's compilation and performance on the ugrad servers, so upload your files and compile and test on one of our servers!!!

Using the servers

Two good servers to use are lulu.ugrad.cs.ubc.ca and annacis.ugrad.cs.ubc.ca (or any other Linux ugrad.cs.ubc.ca server).

One advantage to doing your work on the ugrad servers is that they make automatic backups. Once you are logged into our servers, try opening the .snapshot directory:

cd .snapshot

You'll enter a directory containing weekly, nightly, and even hourly backups. So if you ever accidentally delete a file, you can always retrieve it (provided it's at least an hour old). And it's not only available at the top level. You can open .snapshot in any of your subdirectories too (e.g., ~/cs221). If you have trouble using this, please ask for help from the course staff or from help@cs.ubc.ca!

g++ and UNIX

For the most part, we will be using g++ under the UNIX (Linux) operating system.

If you need to get a new ugrad.cs.ubc.ca account, first sign up for a Campus-Wide Login and then follow the department's account activation instructions.

UNIX and C++ tips:

Here are some useful links and quick tip pages about tools you are likely to use. These documents and links have been compiled over the years by various teaching staff and are neither complete nor guaranteed to be accurate. If you find errors or serious omissions in the documents, please let us know.

Some dated but useful local references:

C++ for Java Programmers

You've all learned Java already, and C++ is a very similar language. A quick web search for "C++ for Java" turns up many helpful links. We like this one by Beck Hasti at the University of Wisconsin. There's also this one which is by Cay Horstmann, the author of the Big Java book. It's shorter, but I think it's harder to read, with fewer examples. Some of the other pages were out-of-date, but the above two are good places to start.

 

cs221@ugrad.cs.ubc.ca
Last Modified: Sun 21 Dec, 2014