lab00 : Getting started

num ready? description assigned due
lab00 true Getting started Thu 10/05 10:00AM Wed 10/11 11:59PM

Introduction

Your first lab for this week is an introduction to programming on CSIL and tools for this course. The intended outcomes are:

This lab will count towards 1% of your total lab grade. All other labs are weighed equally.

This lab must be completed INDIVIDUALLY.

Get setup with the tools for this course

Create a CoE account if you don’t have one already

We encourage you to complete all programming assignments by logging in to the machines in the Computer Science labs, or to connect remotely. To do this you will need a College of Engineering account.

Everyone enrolled in CS24 should already have an account. If your account was created when you tool CS16, use that account (there is nothing else you need to do). Otherwise, check your email for an invitation from the college of Engineering Help Desk.

If you still don’t have an account, use the links below to either request one or reset your password.

https://ucsb-engr.atlassian.net/wiki/spaces/EPK/pages/575373516/New+UCSB+Community+Member+Information?src=search

Get setup with github

We will be using github.com in this course. We have created an organization called ucsb-cs24-f23 on github.com where you can create repositories (repos) for your assignments in this course. The advantage of creating private repos under that organization is that the course staff (your instructors, TAs and mentors) will be able to see your code and provide you with help, without you having to do anything special.

To join this organization, you need to do three things.

  1. If you don’t already have a github.com account, create one on the “free” plan. Visit www.github.com

  2. If you don’t already have your @umail.ucsb.edu email address associated with your github.com account. go to “settings”, add that email, and confirm that email address.

  3. Visit our Github Sign Up Tool: https://ucsb-cs-github-linker.herokuapp.com/, login with your github.com account, click “Home”, find the CS24 F23 course, and click the “join course button”. That will automatically send you an invitation to join the course organization on github.

  4. Accept the invitation that appears in your browser (from step 3) or log into your account on www.github.com to accept the invitation.

Get setup with gradescope

We will use gradescope to grade all your homeworks, exams and lab/programming assignments. You should have received an email notification with instructions about logging into gradescope.

Log into our class site on www.gradescope.com: CS24 Fall 2023 and navigate to the lab00 assignment

Implement and submit a simple C++ program

Download and install VSCode on your local computer

Download and VSCode at this link: https://code.visualstudio.com/download

If you have MAC OS or Linux with g++ installed, skip to Step 1A below

If you have a Windows system and don’t have a g++ compiler, follow this tutorial to use your local version of VSCode with the g++ compiler on the CSIL Servers: https://code.visualstudio.com/docs/remote/ssh-tutorial

If you would like to use vim or emacs instead of VSCode follow the instructions in the next section.

Open a Terminal and ssh into CSIL Servers

Open a terminal window, which will be the environment you use to write, compile, and run your programs.

If you are working on your laptop, whether Windows, Mac or Linux, the instructions below will tell you how to connect to csil.cs.ucsb.edu.

If you are on a Mac laptop, open a terminal and type the following ssh command to connect to one of the servers remotely

ssh -X yourCoEaccount@csil.cs.ucsb.edu

If you are using a Windows, you will need to install the program MobaXterm If your ssh command is hanging, try using cstl.cs.ucsb.edu with the following command

ssh -X yourCoEaccount@cstl.cs.ucsb.edu

Step 1a: Do some initial ONE-TIME git configurations

To create your CS24 directory, use the mkdir command, then change into that directory:

$ mkdir cs24
$ cd cs24
git config --global user.name "Alex Triton"

git config --global user.email "atriton@cs.ucsb.edu"

Step 1b: Create a new repo and clone it on your local machine

For this lab and all subsequent programming assignments, you should start by creating a repo in the ucsb-cs24-f23 organization following these steps

new-repo

submit

git clone git@github.com:ucsb-cs24-f23/lab00_jgaucho.git
cd lab00_jgaucho

You will write all the code for this assignment in this directory

Step 1c: Complete the assignment

Create a new file called hello.cpp using an editor of your choice (either vim or emacs)

Useful links related to emacs

Useful information related to vim for UNIX-based OS

cp /cs/faculty/dimirza/vim-configuration/example_dotvimrc/.vimrc ~/

This assignment only needs you to write a program in hello.cpp that prints out two lines on the display, and nothing else. The output should look exactly as follows (no space before or after each line, except the 2 newlines):

Hello, world!
I am ready for CS24!

Step 1d: Push your code to github

In furture labs we will refer to all the steps in this section as “push your code to github”. What we really mean is that you sync up a current version of your code with your repo on https://github.com. Follow these steps to sync the current version of your code:

git status

You should see the following output:

On branch main
Your branch is up to date with 'origin/main'.

Untracked files:
(use "git add ..." to include in what will be committed)

hello.cpp

nothing added to commit but untracked files present (use "git add" to track)
git add hello.cpp

OR

git add .

Type git status again and you should see that the file appears in green. This means it is ready to be “saved” locally as a new version of your project.

git commit -m "Initial version of lab00"
git push origin main

Navigate to your repo and refresh your browser. You should see the new file that you added to your repo appear in your repo online. You may find this cheatsheet of git commands handy.

Your code is now accessible to the CS24 teaching staff for feedback. This is the primary reason we are using github in this class. As you write new code in your local repo, repeat the steps in this section to sync your changes with your repo on github.

Submit your program for grading to gradescope

It’s time to submit your program to gradescope. Go to www.gradescope.com. Log into your account and navigate to our course site. Select this assignment. Then click on the “Submit” button on the bottom right corner to make a submission.

You will be given the option of directly uploading files from your local machine or submitting the code that is in a github repo. We recommend that you choose the latter option as shown in the figure below. This will ensure that our staff sees the version of code on github that you submitted to gradescope.

submit

You should receive 50 points on this part of the assignment.

Congratulations on completing the workflow for CS24 programming assignments using the tools that we will be using in this class i.e. gradescope and github.

Find a partner for lab01

Please read the information below. Then, use the dedicated Piazza thread called Search for Teammates to find a partner for the next lab. Refrain from creating new threads to avoid clutter on Piazza. You can also try to find a partner by connecting with students in your section on Thursday.

About pair programming in the real world

Note: this is also in the syllabus!

Most of the programming work in this course will be done using a style of programming known as "pair programming". This is where two people (in rare cases, three) work together at the same terminal to solve a programming problem. It is similar, in some ways, to having a "lab partner" in a Biology, Chemistry or Physics course. For the assignments where pair programming is mentioned, it is optional. But here’s why we recommend it:

About pair programming in CS24

For CS24 in particular, please read each lab carefully to learn how pair programming will work for that lab. Some labs may require you to work by yourself, others may require you to work with a partner, and still others may allow you to do either. In addition, some labs may allow you to work with a prior partner, while others may not.

For all labs, you MUST