UNB/ CS/ David Bremner/ teaching/ cs2613/ labs/ Lab 1

Before the lab

Before every lab in this course, you will be given tasks to complete. These will generally be easy tasks like watching videos, but you need to complete them in order to keep with the class.

Using the CS2613 Virtual Machine

  1. Figure out your preferred method(s) of running the VM.

  2. Watch the video tour of the CS2613 VM This video is from 2020, so a few things will be slightly different, in particular

    • we won't be using remote access by default, so there is no "first video"
    • vscodium is not installed in this year's VM.

Command Line Familiarity Check

  1. In the cs2613 VM, start a terminal

  2. Make a directory *

  3. Create a file in that directory using one of the available text editors

  4. Now clean up, removing the file and the directory.

If any of this was new to you, then please take the time to go through parts 1 to 5 of the Learning the Shell Tutorial.

Read the course syllabus.

The Course Syllabus is available on line. Please read it, and bring any questions you have about it to the first lab.

Background Reading

For every lab there will be some related reading. I'll point these out as we go through the lab, but I'll also collect them at the start of the lab in case you want to get a head start (or refer back to them later).

About the course

10 minutes
Q&A, discuss course syllabus.
  1. What's similar to other CS courses you've taken?

  2. What's different?

  3. Key point, how are marks assigned for the lab we're just starting?

Frog Tutorial

30 minutes
Individual work
Getting started with frog

We'll be using frog frog to keep a journal of what we learn in this course.

  1. Make a directory under fcshome that will keep all of your work for cs2613. For the rest of this lab we'll assume that directory is ~/fcshome/cs2613 viewed from fcs-vm-cs2613-dev (or ~/cs2613, viewed from your normal FCS Linux account).

  2. Follow the frog quick start to create a frog project in a directory ~/fcshome/cs2613/journal (in the tutorial this is called frog-project rather than journal. Please make things easy on the TA by using the name specified here).

  3. Start a new blog page for today's lab, and delete the fake entry created by the frog setup command. Note that you may have to refresh the browser after running raco frog -bp.

Git background

10 minutes
Reading, Discussion

Take a quick read of - Section 1.3 from Pro Git Don't worry if you don't get every detail now; you can always go back and re-read it later.

Answer the following questions in your journal:

  1. What are two important concepts discussed in this reading?

  2. Relate to previous experience; answer any of the following that apply. Note that at least one applies to everyone.

    1. If you have used a version control system other than git before, what is one important difference between that system and git?

    2. If you have used git before, what is one thing about git you like, and one you don't?

    3. If you have never used a version control system before, what strategies have you used to keep versions of files?

      • copies of files?
      • track changes in an office suite?

Setting up a git repo

30 minutes
Individual work
This is where we create the git repository used for the rest of the term to hand things in.
  1. Change to ~/fcshome/cs2613. This directory should have one subdirectory called journal, which has the results of your experiments above with frog.

  2. Create the git repository

     $ git init

    Git will reply

     Initialized empty Git repository in /media/sf_FCS-HomeDir/cs2613/.git/

    You’ve now initialized the working directory — you may notice a new directory created, named ".git". The path starting with /media has to do with with way that VirtualBox shared folders work.

  3. Read the git-quickref page, and follow the initial configuration steps there.

    • note that the "--wait" option for gedit is important here.
    • One important technical detail is that your home directory on fcs-vm-cs2613-dev is not preserved between reboots of the VM. For this reason you should not use --global configuration.
  4. Next, tell Git to take a snapshot of the contents of all files under the journal, with git add:

    $ git add journal
Many revision control systems provide an add command that tells the system to start tracking changes to a new file. Git’s add command does something simpler and more powerful: git add is used both for new and newly modified files, and in both cases it takes a snapshot of the given files and stages that content in the index, ready for inclusion in the next commit.

This snapshot is now stored in a temporary staging area which Git calls the "index". You can permanently store the contents of the index in the repository with git commit:

   $ git commit

This will open and editor and prompt you for a commit message. Enter one and exit the editor. You’ve now stored the first version of your project in Git. See §5.2 of Pro Git for some hints about writing good commit messages. As mentioned in the class git policy, you will be marked on your commit messages, so you may as well get started with good habits.

If you have extra time, start the next part

Pushing to a central repo

Learn how to upload your work to a server
20 minutes
Individual work
You absolutely have to understand this before continuing in the course, since all marks in the course will be based on work pushed to the coursegit repos.

Since we are using the FCS git repositories there is an existing repository for all students who registered early enough. If it turns out there is no repository for you, you may need to do the last step later.

Next steps

We'll pick next time with some more practice using Git, but you should have the bare minimum to hand in your work at this point. Don't forget that your first journal entry is due tomorrow.