teaching machines

CS 330 Lecture 1 – Hello, Shell

Agenda

• what ?s
• me
• you
• this class
• questions
• shell exercises

TODO

Before next class:

• Read the syllabus.
• Set up a Bitbucket account and make your homework repository, described below.
• Cut a piece of paper in half vertically. Cut the two strips in half again, horizontally. On one of these 1/4 sheets of paper, write down three or four questions or observations you have about the syllabus, the course topics, Bitbucket, or Git. Feel free to share fun pro-tips that you learn, like this one: what’s a shell command that tells you who else is logged in to a machine? Turn this sheet in at the beginning of next lecture.

Setting up a Repository

1. Find an SSH client (PuTTY or Terminal or otherwise).
2. Log in to thing-04.cs.uwec.edu. Or 05 or 06.
3. Complete the steps shown in the following videos, using https://bitbucket.org/twodee/cs330_2016a as the base repository. (Feel free to watch the videos at faster speeds—I do.)

Note

Welcome to CS 330: Programming Languages! Let’s start with some introductions. I’ll tell you about me and the class. Please tell me the following about you:

2. If I haven’t had you in class before, where are you from?
3. You are commissioned to write a book. What would it be on?

As I get older, I feel less and less like I have any important knowledge to share. Instead, I understand that my role as a teacher is to guide you into danger and then pretend to sprain my ankle. I am not gone, but my role is less direct. At this point, you take over as leader and must construct your own knowledge through first-hand experience. So, expect lots of in-class activities and homework and few slides.

Speaking of in-class activity, let’s do one. Think for a moment about this question:

Why do you think we have this course CS 330: Programming Languages in the curriculum? Write down 3+ reasons. Write them down.

Next question, this time with a partner:

Pick an audience. In one sentence to this audience, what is a programming language? Write it down. Argue about it. Nitpick. Finesse.

For the rest our time, we’ll discuss the shell. It’s the “backstage” of your computer, where the lights are dim and the doors aren’t labeled. What’s something you might want to do at the shell? How can you do it?

Code

foo.c

#include <stdio.h>
#include <stdlib.h>
#include <time.h>

int main(int argc, char **argv) {
srand(time(NULL));
rand();
int ok = (int) (127.0f * rand() / (float) RAND_MAX);
return ok;
}

Haiku

C had just one job
Hide the electricity
With semi-colons