The following is information, tutorials, and help links for tools that we will use in for remote course activites and course work. More course-specific information is available off the CS 41 webpage, and from individual assignment pages.

Remote Access and Code Envirnoment Tools:

ssh and scp

ssh is useful for remotely logging into the CS lab machines. scp is useful for copying files between your local system and the CS system.

ssh

You can remotely connect to any machine by sshing in as you to lab.cs.swarthmore.edu or to a particular machine by logging in as you to a specific machinename.cs.swarthmore.edu. For example:

# log into some lab machine:
ssh yourusername@lab.cs.swarthmore.edu
# log into owl:
ssh yourusername@owl.cs.swarthmore.edu

You can find the names of lab machines here: cs lab machines

scp

scp is like the cp command, but for copying files between two different machines.

# copy a file named "bio.txt" from the "cs41/labs/lab01" directory on a lab machine to your machine
scp yourusername@cs.swarthmore.edu:cs41/labs/lab01/bio.txt .
# copy a file named "bio2.txt" from current directory on your machine onto a lab machine
# Note: by default, this will place the file in your home directory; i.e.,  "/home/yourusername"
scp bio2.txt yourusername@cs.swarthmore.edu:
# copy a file named "bio3.txt" from current directory on your machine onto a lab machine in the "cs41/labs/lab01" directory
scp bio3.txt yourusername@cs.swarthmore.edu:cs41/labs/lab01

ssh and scp links


Tools for lab work

Piazza and GitHub

As in most CS courses, we will use piazza for Q&A and github for lab assignments. Here is some more information about both, and links to piazza and git hub for CS 41:

piazza resources


Git and the college’s Enterprise GitHub are used for lab work.

git resources

  • using git for CS labs contains some basic (and verbose) git instructions for using git for CS course lab work. It is written using cs31 as an example, but replace with your own course number.

  • git on our system and git help. This is a more complete reference for using git on our system.


LaTeX

LaTeX is the standard tool for scientific writing and typesetting. Here is a sample LaTex file. LaTeX is a markup language, which means that you provide text along with commands to typeset or markup that text. You then need to compile a LaTeX document.

Compiling LaTeX

The easiest and most direct way to compile is via pdflatex. Here’s an example:

pdflatex LearningLaTeX.tex

This will either produce a pdf document you can read with a standard pdf reader such as Acroread, or will print out error(s) encountered during the LaTeX compilation process.

Working with LaTeX remotely.

If you are working with LaTeX remotely, you might not have LaTeX installed on your local machine. In this case, you have a couple of options:

  • Edit/Compile your LaTeX file on lab machines. To this, you’ll need to ssh into a lab machine, and edit/compile your LaTeX file from there. Then, you can use scp to copy your compiled pdf to a local machine to read it.

  • Use an online LaTeX editor such as Overleaf. In past years, several students have used overleaf to write their LaTeX. It is convenient for writing partered assignments. Warning: Overleaf tends to ignore compilation errors and give you the best pdf it can render. Before submitting a LaTeX file, make sure you can compile it using pdflatex and it looks the way you’d like.

  • Install pdflatex on your home machine.

The basic structure of a LaTeX file

It is likely that you will modify an existing LaTeX template file (e.g. this template) rather than starting from scratch. However, if you do start from scratch, the following snippet of LaTeX illustrates the minimal code needed to get started.

\documentclass{article}
\usepackage{amsmath} % Math notation from the American Mathematical Society.
\usepackage{amssymb} % Typographical symbols from the same.
\begin{document}
  Hello!
\end{document}

Brief explanations of each line lie below:

  • The line \documentclass{article} tells LaTeX you want to write an "article" document. LaTeX documents start with this line.

  • The next few lines add LaTeX packages, which are similar in spirit to #include lines in C++ or import in Python.

  • \begin{document} and \end{document} specify where the content of your document starts and stops.

Formatting

LaTeX has several formatting commands that make your file look nicer. A few are listed below:

  • \textit{this is italicized.} renders 'this text' in italic. Here is what gets produced \(\textit{this is italicized.}\)

  • \textbf{this is boldface.} gets rendered as \(\textbf{this is boldface.}\)

LaTeX has environments for bullet lists and numbered lists.

  • The itemize environment gives unordered bullet-lists.

Here is an unordered list.
\begin{itemize}
  \item Your first item is here.
  \item This is your second item.
  \item This is the third item.
\end{itemize}

Here is the compiled LaTeX.

Here is an ordered list.
\begin{enumerate}
  \item Item One.
  \item Item Two.
  \item Item Three.
\end{enumerate}

Here is the compiled LaTeX.

Math

One of the real strengths of LaTeX is its ability to easily typeset mathematical notation. To render mathematics in LaTeX, enclose the math in dollar signs e.g.

The quadratic equation is $ax^2 + bx + c = 0.$

Which gets rendered as: \(\text{The quadratic equation is }ax^2 + bx +c.\)

Sometimes, it’s nicer to put the math on its own line, cenetered in the page. Do this using double dollar signs:

The quadratic equation lies below: $$ax^2 + bx + c=0\ .$$

Here is the compiled LaTeX.

The align* Environment

If your LaTeX math runs across multiple lines of text, LaTeX provides an elegant way of typesetting this nicely called the align\* environment. Here is some sample LaTeX code:

\begin{align*}
  (n+1)(n-1) &= n^2 + n - n -1 \\
  &= n^2-1
\end{align*}

which gets rendered as:

\(\begin{align*} (n+1)(n-1) &= n^2 + n - n -1 \\ &= n^2-1\end{align*}\)

Make sure to put a double backslash '\\' to denote the end of each line of your math equations. (no double-backslash is needed after the last line). The ampersand '&' is a control character that specifies vertical alignment. When this LaTeX is compiled, it will line up each line where the ampersands are. In this example, the equal sign in the second line of math will line up immediately below the equal sign in the first line.

Subscripts and Superscripts

In math mode, it is common to use subscripts and superscripts. You can do this in LaTeX using '_' and '^'. For example:

$a_0 = x^2 + 4$

gets rendered as \(a_0 = x^2 + 4\)

Summations

If you want to write summations, use the \sum command. For example,

$\sum_{i=1}^n i = \frac{n(n+1)}{2}.$

is rendered as \(\sum_{i=1}^n i = \frac{n(n+1)}{2}.\)

Including Images

To include an image, use the graphicsx package and the \includegraphics command.

...
\usepackage{graphicsx}
...
\includegraphics{bunny.jpg}
...

Remote Lecture, Lab, and Office hours

These are tools that we will use for lecture, lab mettings and office hours in CS 41:

zoom

You will receive an email with information about how to find our class zoom link before the start of class.

There are instructions for using zoom off the college’s Working Remotely page.

Try it out:

Set-up and try out a zoom meeting with your lab partner or project group members

  1. one of you should create a zoom meeting for your lab work:

    • Name the meeting something like labXmeeting where X is the number of your lab assignment

    • Make it a Recurring meeting with the Recurrence→No Fixed Time option.

    • Enable join before host in the Meeting options

    • Save and send your lab partner the zoom link (Join URL associated with your meeting or copy the invitation link)

  2. contact each other to find a time for a 10 minute practice zoom meeting.

  3. at the time you arranged to meet, join your zoom meeting (because "join before host" is selected any of you can start the meeting).


slack

Joining Slack

You will receive an invitation to join the class slack page prior to the start of the semester.

Navigating Slack

Slack breaks up workspace into channels, which are listed in the sidebar on the left. Some channels we will use in this course are:

  • '#general' for general announcements about the class, you can select pinned announcements to find links to the course zoom page

  • '#office-hours' for class office hours. You can send a quick message to the professor here and start a zoom session to which s/he will attach.

  • '#lab-X' we will often move to slack after starting each lab session on the course zoom page. Here you can get individual help on your lab work, and we will check in with each lab group. You can type in short questions, but typically we will have you start a /zoom session to which we will attach.

To start a zoom session in slack:

First choose the slack channel for the type of session (lab or office hours), then you can start a zoom session to which the professor/lab instructor/TA/ninja will attach and help you with your specific question(s) or just check in with you. To start a zoom session just type '/zoom'. If you are working on a partnered lab one of you and your partner can start, and the other can join.

In zoom you can share your screen to display and run your code, or display your homework to your instructor.

Accessibility

The course staff is committed to making all course material accessible to you. To access Slack’s accessibility settings, start by clicking on the workspace name at the top of the navigation pane on a laptop or desktop.

Then from the dropdown menu choose “Preferences”, then select “Accessibility” from the navigation bar on the left.

Options include:

  • Content magnification (“Zoom”). Allows you to enlarge content shown in Slack

  • Animation. Please uncheck this box if you are sensitive to animated images.

  • Keyboard. Options for non-mouse navigation.

To direct message someone:

By default, messages posted on Slack are visible to all members of the workspace. But for smaller conversations, you can use Slack’s direct messaging (DM) feature to start a private conversation with one person or a small group.

Code of Conduct

The course Slack workspace is accessed by a wide variety of people all working in different environments and timezones. We ask that you be respectful of the staff as well as your fellow students. We expect you to follow these general rules:

  • Do not use Slack to harass faculty, staff, or other students.

  • Do not spam any channels or direct messages with garbage. Try to make posts in academic channels concise.

  • Follow channel guidelines. E.g. do not post idle conversations in the #lab-X channel.

  • Respect others’ time. When you are in lab, or in office hours, try to respond promptly to messages directed to you.

  • Note that any messages you post in a channel will be visible to everyone in that channel. Think before you post!

If there is a problem where someone is violating the code of conduct or otherwise failing to respect others, please raise the issue to one of the class professors or instructors.

Slack Links

Here is some documentation on using slack

Here is some documentation on using zoom in slack (scroll past the how to install zoom to "Use Zoom in Slack" part)