Revision 2 as of 2014-03-14 11:18:12

Clear message

Here we give an overview of some of the programming tools we have at UCC and tricks you can use.

Servers and Desktops --- Home and Away ---

This bit talks a bit about the computers. You can probably skip it.

You can of course use Windows computers for programming, if you are lucky/bossy enough to actually get a computer not being used for DoTa. We will focus on Linux because it is objectively better, and also you are more likely to actually be able to use this for non-gaming purposes in the clubroom.

There are usually 3 or 4 desktops in the clubroom that boot various Linux distributions. Currently, these are: cabellera, clownfish, porcupine, pinball. These have a variety of desktop environments and graphical programs.

When you are logged into a linux desktop, you can reach your "home" directory at /home/ucc/username. You can use a graphical file browser, or the terminal, to manage files in this directory.

UCC servers are more powerful and have more tools for programming. You can connect to them via SSH. Motsugo is the most powerful and most commonly used; you could also try one of heathred, mylah, medico, mussel, mantis.

The downside to using a server may seem that you can't use graphical tools. However! If you cd (Change directory) to /away/ucc/username you will be able to access all the files as seen on a desktop.

So, a common approach is to open a terminal, SSH into a server, and run commands (such as gcc, make, python, etc) from there, but keep all your files in the /away directory so you can edit them on a desktop with a graphical editor.

If you are using a Windows desktop (lucky!) to edit files and SSH to run things, the directory you'll want starts with /away/ucc/username/Windows/profiles/My\ Documents/. (Spaces start to get annoying).

The general process

To actually program, you need:

  1. A text editor ii. A terminal iii. A compiler or an interpreter

Non-graphical text editors: vim, nano, emacs (scary), sed (not recommended). Graphical text editors we have: gedit, kate, notepad++ (windows). Compilers: gcc (C), g++ (C++), gfortran (FORTRAN), gcj (Java (yes you can compile java)) Interpreters: python (Python 2.6 or 2.7 depending on machine), python3 (usually Python 3.2), java (Java) Other things: man, make

Write the program. Then in a terminal run the compiler (or make if you have a Makefile) to compile it. Then run it. $$$$$

Example Programs

TODO

SSHFS for Freedom and Glory

If you want to use the servers to compile/run things, but are at home and want to keep your own fancy graphical environment instead of using vim, look into SSHFS which works on Linux and might not break on Windows.

mkdir ~/sshfs/motsugo; sshfs [email protected]:/away/ucc/username ~/sshfs/motsugo

Then as if by magic you can edit files seemingly on your own computer and have them magically show up by magic on motsugo as if by magic.