This page describes how the on-site tests will look like and eventually will also contain description of the (big) homework assignment. Small homework assignments are mentioned in the respective lab pages.

Please, have a look at the course guide page for details how the grading works.

On-site tests

This is the schedule for the on-site tests. The test will be held at the beginning of the lab (duration of the test is 45 minutes).

Week (date) Topic
08 (April 7 - April 11) T1: Git versioning system
12 (May 5 - May 7 + May 15) T2: Shell scripting
14 (May 19 - May 23) T3: make build tool

You are expected to come to the lab you have enrolled to.

Because of state holiday on May 8, the T2 examination for Thursday labs will be postponed by a week. We are aware it is not optimal but the schedule for this semester has virtually no complete week (i.e., teaching in all days of a week) during the second half of the semester.

Test will be written on school machines. Make sure you can login there and that your environment is setup comfortably.

Your solution will be submitted through GitLab or through other Git repository: make sure you can perform a clone via a command-line client.

You are allowed to use our webpages, off-line manpages and you can consult your notes and solutions to examples that are part of the lab materials.

You are not allowed to use any other devices (cell phones, your own laptops etc.), consult other on-line resources (the machines will have restricted access to the Internet anyway) or communicate your solution to other students (and vice versa).

In other words, the on-site tests require that you can solve the tasks on your own with technical documentation only.

Any attempt to bypass the above rules (e.g. trying to search StackOverflow on your cell phone) means failing the course on the spot.

You are free to ask for clarification from your teacher if you do not understand the assignment, obviously. We can provide limited hints if it is clear that you are heading in the right direction and need only a little push.

Please, see also the general rules in the course guide.

Notes for the Git CLI exam

Information for students enrolled to the special 24bNSWI177x15 Tuesday lab.

If your SIS/GitLab username starts with [a-j], please, come at 8:50; if your login starts with [k-z], please, come at 9:40.

Update: instructions for the exam will be probably provided in a printed form. Please, let us know in advance (week at least) if this might be an issue for you (e.g., you need a bigger font). Thank you.

You will be expected to perform the following tasks in Git from the command-line (some might be required to execute on the remote machine linux.ms.mff.cuni.cz).

  • Configure your Git environment (author and e-mail)
  • Clone a repository (from gitolite3@linux.ms.mff.cuni.cz or from GitLab or generic HTTPS)
  • Create a commit
  • Create a branch
  • Switch between branches
  • Merge a branch (and solve any conflicts)
  • Push changes (branches) to server

Ensure that you can clone from gitolite3@linux.ms.mff.cuni.cz when using the school machines. Only authentication via public key will be available (i.e. upload your keys to keys/key.[0-9].pub files in your repository before the exam as explained in Lab 05).

To check that this works for you, please, perform the following steps.

Execute ssh -o ForwardAgent=no LOGIN@u-pl1.ms.mff.cuni.cz.

  • This will ask for your regular SIS password and will log you to u-pl1.ms.
  • u-pl1.ms is a virtually the same as any computer in the lab (i.e., the same files in ~).

Execute ssh gitolite3@linux.ms.mff.cuni.cz.

  • This will try to SSH using your keys on u-pl1 to the Gitolite repository.

  • You should see something like the following in the output. The important part is that Gitolite will greet you with your SIS login in the message (even though you are logging in as gitolite3 user); the list of repositories might differ.

    PTY allocation request failed on channel 0
    hello LOGIN, this is gitolite3@linux running gitolite3 3.6.13-5.fc41 on git 2.48.1
    
    R   lab05-LOGIN
    R   lab06-group-sum-ng
    
  • If you see the following, your keys are not setup correctly.

    gitolite3@linux.ms.mff.cuni.cz: Permission denied (publickey,password).
    

Feel free to store the URL gitolite3@linux.ms.mff.cuni.cz somewhere on the local disk in your $HOME so that you do not have to copy it manually during the exam.

You can even setup an alias in your ~/.ssh/config like this which would allow you to clone via git clone exam:lab05-LOGIN.

Host exam
    Hostname linux.ms.mff.cuni.cz
    User gitolite3

The focus of the exam is on working with Git. You will not be required to write any script on your own but we will be working with a repository containing the following script for printing simple bar charts in the console. You will be required to make some small modifications (such as fixing typos) but we will always guide you to the right place in the code.

import argparse
import sys

def parse_config():
    args = argparse.ArgumentParser(description='Console bar plot')
    args.add_argument('--columns', default=60, type=int, metavar='N')
    return args.parse_args()

def load_input(inp):
    values = []
    for line_raw in inp:
        line = line_raw.strip()
        if line.startswith('#') or not line:
            continue
        try:
            val = float(line)
        except ValueError:
            print(f"WARNING: ignoring invalid line '{line}'.", file=sys.stderr)
            continue
        values.append(val)
    return values

def print_barplot(values, scale, symbol):
    for val in values:
        print(symbol * round(val / scale))

def main():
    config = parse_config()
    values = load_input(sys.stdin)
    if not values:
        sys.exit(0)
    coef = max(values) / config.columns
    print_barplot(values, coef, '#')

if __name__ == '__main__':
    main()

Quizzes

Quizzes will be given on labs 02, 03, 04, 05, 06 and 07.

Small homework tasks