Select a category to the left.



Light or dark? Choose how the site looks to you by clicking an image below.

Light Dark


Preferred Language

All content on is originally in UK English. However, if content exists in your preferred language, it will display as that instead. Feel free to choose that below. This will require a page refresh to take effect.


"" details

Domain Name:
Site Version: 3.0.1
Last Updated: 2019/08/18

Labs are an integral part of class. Obviously, to have them graded, you will have to submit them. Since the TAs are the ones who grade these, I'll layout the rules of how submissions are going to work.

We will use the Tar container format for assignment submissions (unless otherwise stated). And you will upload Tar files to Instructure Canvas. This will count as your lab submission. I will discuss more about what Tar is and how to make one below.

There is a lot of information here, but it's written as a sort of "guide" that you can refer back to if you are in doubt later on in the semester. Read carefully!


These rules may come across as harsh at first... but they will allows us to automate extracting submissions, as well as compilation. Usually this step is one of the many time-consuming and tedious parts of grading. If it's eliminated, TAs can get grades back to you all in a much more reasonable time frame.

Failure to follow these lead to point deductions. Some result in an instant 0 (and they are specified below).

  1. For lab assignments, a single Tar file containing all files needed to successfully compile your lab is required.
    • I don't care what the name of your tar is as long as it ends with .tar. We mass-download from Canvas and it scrambles the names anyways.
    • Ask yourself, "If I download this Tar from Canvas, can I compile my program with just the files inside it via g++?"
  2. You may assume that we have our own makefiles to compile lab submissions. You do not need to include a makefile unless specified.
  3. The files inside the Tar must be named accordingly to the assignment instructions. You can find the filenames in the lab write-ups.
    • Unlike Windows, UNIX-like operating systems use files that are case sensitive. So, prog1b.cpp and Prog1b.cpp are NOT the same, and will cause problems. Make sure your filenames match casing.
  4. Your code must compile on Hydra via g++ (specifically /usr/bin/g++). I can't stress this enough. Code that compiles via other compilers (e.g. Visual Studio's compiler) is NOT GUARANTEED to compile with g++ (and vice versa). Every semester, we encounter students with problems like these. You're welcome to work on your labs locally if you wish. But they must compile on Hydra for the final submission.
    • If your code doesn't compile on Hydra, it's a 0.
    • "But it compiles on my machine!" is NOT a valid excuse, unfortunately. If you get a 0 for a compilation issue, download your submission from Canvas and see if you can compile that on Hydra. If that doesn't work, you know why you got the 0. If you are within a day or two and have a grace day(s) to spare, you can resubmit a fixed version at the cost of them. This also applies with the late penalty. If you are able to compile a submission downloaded from Canvas, feel free to email ALL TAs about it. Mistakes are possible on our end.
  5. No... you can't change the extension of a cpp file from .cpp to .tar. If we see that a Tar doesn't extract, we'll assume it's corrupt. If the file is corrupt, we can't grade it and have to issue a 0.
  6. You may submit as many times as you want up until the late due date. We will only look at the most recent submission, and deduct accordingly if it's late. If there are accidents with submissions (e.g. submitting the wrong assignment), students should email ALL TAs about it so one of us can take care of it.
What is Tar?

Tar files are package files that store multiple files inside itself. You can think of them like Zip files, if you are aware of those. This way, if a lab requires multiple files to be submitted, throw all of the required files into a Tar and submit that one file instead.

How to package files up via Tar (In a nutshell)

Let's say I completed Lab 1, Part 1 (Prog1a, Prog1b, Prog1c) and I want to submit it. The lab writeup states to only submit Prog1b.cpp and Prog1c.cpp. So...

UNIX Command
UNIX> ls -la
total 24
drwxr-xr-x. 2 cnguyen graduate   89 Jan 15 19:24 .
drwxr-xr-x. 5 cnguyen graduate   48 Jan 12 05:20 ..
-rw-------. 1 cnguyen graduate  120 Jan 12 05:22 Prog1a.cpp
-rw-------. 1 cnguyen graduate  526 Jan 13 01:52 Prog1b.cpp
-rw-------. 1 cnguyen graduate  685 Jan 13 01:55 Prog1c.cpp
-rw-------. 1 cnguyen graduate 1056 Jan 13 01:58 Prog1d.cpp
-rwxr-xr-x. 1 cnguyen graduate 6352 Jan 12 05:21 prog1_ints
From the files above, Prog1b.cpp and Prog1c.cpp are what we want. Let's tar them into a single file called lab1.tar:
UNIX Command
UNIX> tar -cvf lab1.tar Prog1b.cpp Prog1c.cpp
This will create lab1.tar, including all files specified after "lab1.tar" specified in the command. So it'll include both Prog1b.cpp and Prog1c.cpp in it!

Because someone will be curious, the arguments "cvf" stand for:

  • "c" means "create". It's telling tar we are making a tar file ("x" is for "extracting").
  • "v" means "verbose". It will tell you what files are going into the tar file.
  • "f" means "file". The argument that comes after this one is the filename of the tar that will be written to (e.g. "lab1.tar").

MAKE SURE THE NAME OF THE TAR COMES AFTER -cvf! Otherwise, you'll accidentally overwrite a file. Tar does not prompt you to overwrite files. It just does it. If I did tar -cvf Prog1b.cpp Prog1c.cpp, then it'll obliterate Prog1b.cpp and make it into a tar file that only has Prog1c.cpp in it. We cannot help you if you accidentally overwrite your source code (IT can though. They back up directories daily).

Check if your Tar file is valid (In a nutshell)

Method 1: You can use "tar -tf FILE" to check:

UNIX Command
UNIX> tar -tf lab1.tar
"t", for some reason, means "list" in tar. It lists all files packaged into the tar file.

Method 2:

  • If you're on Windows, just download 7zip and open the Tar file with it.
  • If you're on a Mac, it has tar support embedded right in the OS. You can just open the file.
  • If you're on Linux, it depends on what software packages you have. But if you're on Linux, I'll assume you know what you're doing.

Make sure you don't include a directory

Whenever you submit, please make sure you don't put the files in a directory and tar the directory unless specified.

Let's use tar -tf to show what I mean. This isn't a valid submission:

UNIX Command
UNIX> tar -tf lab1.tar

The reason why is because, upon extraction, it will create lab as a directory and then put files in that directory. You can tell by the "lab/" before each file. It would extract to this:

File Structure


"But Clara, why Tar?"

When you submit a file on Canvas, it messes with the filename, adding in more information to it. This is invisible to the users, but not the TAs. It looks kind of like this nguyenclara_12345_1234567_lab.tar. Yuck! Now imagine if you submitted multiple files in a single submission. Yeah, we'd have to rename those before we even begin to grade.

Fortunately, the files inside the Tar file are not renamed by Canvas, so they are preserved entirely! On top of that, we can take advantage of Canvas putting names on the files to know which Tar file belongs to which student.

Lastly, Tar stores additional information about each file that might just save your grade in the event of a mistake in submission (and it has on many occasions). Think about that.

"I don't know what to submit."

Feel free to ask on Piazza. I actually appreciate when students do that, as others may have the same question. It's better to ask and submit the assignment correctly than it is to mess up the initial submission, waste grace days, or take a 0 due to a silly mistake.

Guide Information
Basic Information
Name: Lab Submission Guidelines
Description: Know how to submit labs the right way...
ID: submission_guidelines_gregor
File Information
File Size: 10.46 KB (10709 bytes)
Last Modified: 2019/06/12 21:33:10
Version: 1.0.0
en-gb Clara Nguyen (iDestyKK)