Welcome to CS35 Lab. This week is a little unusual in that we haven't really learned enough to start a typical CS35 lab. A typical lab session usually consists of a few small exercises or demos, followed by a short introduction to the week's lab. Afterwards, you will have time to read the lab in detail and begin working on your solutions. While we do have a short lab exercise for you this week, the focus of this lab session is configuring your CS and Swarthmore Github accounts so you can retrieve and submit code with partners, instructors, and graders.
If this is your first CS course, note that the CS machines are on a different network than other campus machines hosted by ITS. Your username will be the same as your ITS login, but you will have a different password. We provide a random password for new accounts, but once you login, you can open a terminal and change it to something easier by typing the command passwd and following the prompts. If you forget your password later, you can reset it online at password.cs.swarthmore.edu.
Once you are logged in, open a browser and a terminal. For additional help on understanding the CS environment, CS students are hosting two Using Unix sessions
You are free to use any editor you want. I will tend to use vim.
Git is a popular piece of open-source software which is installed on the Swarthmore CS computers. Git is a version control system---it can be used to manage changes and updates in software and facilitate collaborative programming across large teams of developers. We'll be using git to manage assignment distribution and submission. When you start an assignment, you'll execute a git command to grab some starting files. Similarly, when you want to submit an assignment, you'll execute a couple of git commands. Later on in the course, you'll be using git to facilitate paired lab assignments.
Git is a large piece of software, and there is a lot to learn with git. Fortunately, it is easy to get up and running on git with just a small number of commands.
cd ~/ mkdir cs35 cd cs35 mkdir labs
This might seem like a lengthy sequence of commands to remember, but don't worry! We'll go over this in lab next week, and the commands will be the same for each assignment during the semester.
To recap, the git commit cycle is git add, git commit, git push. Don't forget to git push when you have completed an assignment.
git clone git@github.swarthmore.edu:CS35-F17/examples-<user>.git ./exampleswhere <user> is your username.
cd ~/cs35/labs git clone git@github.swarthmore.edu:CS35-F17/lab00-<user>.git ./lab00where <user> is your username.
You are encouraged to configure your git profile on github. Please at least add your preferred name and email.
Practice breaking some of the example programs in controlled ways and see what error messages are generated. Recognizing common compiler error messages now will help you debug programs later as they become bigger and more complex.
Test the robustness of cin in C++. By giving invalid input. While handling all forms of user input correctly will not be a focus of this course, it is handy to know how to terminate a program that hangs. Try Ctrl-C if things get stuck.