COMP11 C++ Styleguide
The Official COMP11 C++ Style Guide (TM) will feature prominently in many assignments; writing good code is just as important as writing functional code. We'll usually cite a specific section you need to pay attention to with each assignment, so make sure you read it carefully before you turn your program in.
Exam Review Sheets
Some more code to write, just for fun!
Writing Code for This Class
You will do your work for Comp11 with the Linux
computers at Halligan Hall. You can use the workstations
in the labs, and you can connect to the servers
over the Internet. Don't worry if you're not familiar with Linux! On our first day of class, we'll get some hands-on practice with the Linux workstations.
Software To Install
You do not need your own computer for COMP 11. The computers in the labs in Halligan Hall have all the software you need for the course. If you plan to work from your own computer, you need a remote-connection program.
If you're logging into the Halligan machines using the Terminal (Mac) or puTTY (Windows),here's what you need to do:
- Open PuTTy to start a new session.
homework.cs.tufts.edu into "Host Name (or IP address)".
- Type a fun name for your new SSH settings into the box under "Saved Settings".
- Now hit "Save" over on the left.
- Frow now on, when you open PuTTY, simply click the name that you created for your settings and hit "Load", then "Open".
- Open up your terminal from Applications > Utilities > Terminal and type:
ssh -X firstname.lastname@example.org
If you want to work on your own machine without logging into the Halligan machines, you can do that, too. BUT... CAUTION! We compile and grade ALL of your assignments on the Halligan machines using
clang++ -Wall -Wextra. There are likely to be small differences between your own computer and ours; always always ALWAYS test your code on the Halligan machines before providing it.
- Set up sublime
- Download sublime: https://www.sublimetext.com/3
- Read the tutorial: https://github.com/jroth01/TuftsCS_SublimeSFTP. This demonstrates how to set-up sublime with the tufts server. Packed with good information on the SFTP part!
- If you follow the SFTP instructions with the link, then all of the work you do on your laptops will sync with the system immediately each time you press save.
Random Programming Resources
Below are a handful of resources to consider while writing your homework. There are many more useful tips and tricks for thinking computationally and writing good C++ code, so feel free to take a look around on the internet for good ideas. If you find a good (great?) resource, post it on piazza so your classmates can learn from it, too!
Emacs Tab Setup
Is Emacs your editor of choice? We like it too, but the default tab settings aren't great --when you hit 'tab', it puts in an actual tab instead of 4 or 8 spaces. Spaces are much better. Here's how to fix it:
Save the file, and you're done! Be careful to only edit the text itself and not the spaces or tabs in the .emacs file.
- Go to your home directory:
- Open up the file .emacs:
- Look for a line that says "setq-default indent-tabs-mode t"
- Edit that line to say
setq-default indent-tabs-mode nil
- Look for a line that says "tab-width"
- Edit that line to say
tab-width 4 (or 8, whatever your preference is).
What to do about "Disk Quota Exceeded"
A common problem that comes up when working on the Halligan servers is getting the error "Disk Quota Exceeded" when attempting to create folders / other files. Here's a few tips:
Save the file, and you're done!
- Make sure you delete any "core dump" files (they're huge!(
- Change into your home directory:
- Open the file .cshrc:
- At the bottom of the file, add the line:
limit coredumpsize 0
How to recover old files (sometimes)
Something go wrong when saving your file? You might be able to recover it!
- There is a folder in your home directory called
.snapshot (it will appear in the list when you type the command
ls -al). cd into this folder and type
- There should be a folder called
every_four_hours.2017-xxx. cd into this folder, type
ls, and you should see a copy of your home directory.
- Check to see if this version of the file you were editing has the edits you lost. If so, copy it into the directory where you were hoping it existed in the first place.
Last updated October 16, 2017 17:07:41 EDT