Fall 2022 Course Overview

Class time: Tuesdays and Thursdays 4:10pm–5:25pm

Class location: 417 International Affairs Building (IAB)

Recitations:

  • Fridays 7pm–8:30pm in Mudd 524
  • Sundays 7pm–8:30pm in CSB 451
  • Mondays 7:10pm–8:40pm in Uris 301

Instructor: John Hui

Instructor office hours:

  • Tuesdays 5:30pm–7pm in CSB 488
  • Fridays 2pm–3:30pm in CSB 488
  • See also Office Hours

Exams

There will be three synchronous, in-person exams:

  • Oct 06 (Thursday), 4:10pm–5:25pm: Midterm #1
  • Nov 17 (Thursday), 4:10pm–5:25pm: Midterm #2
  • Dec 20 (Tuesday), 4:10pm–7:00pm: Final

All registered students must take the exams at those times. There are no make-up or alternate exams. If you cannot make any of those exams, please take the course next semester.

Labs

  • Lab 1 (80 points), due Sep 20 (Tuesday)
  • Lab 2 (101 points), due Oct 02 (Sunday)

Course Essentials

Course Schedule

Note: schedule for upcoming lectures are subject to change.

Lecture 1: Tuesday Sep 6

Course overview slides and lecture notes

  • Course overview, administrivia, and logistics
  • Introduction to command line

Lecture 2: Thursday Sep 8

Lecture notes

  • Review UNIX commands
  • Reading man pages
  • Version control with Git

Recitation 1: Weekend of Sep 9

Lecture 3: Tuesday Sep 13

Lecture notes

  • printf() debugging in C
  • Makefiles
  • Separate compilation

You can obtain a sample project built using Make on CLAC by running:

git clone ~j-hui/cs3157-pub/examples/myadd

Reading: K&R chapter 1

Lecture 4: Thursday Sep 15

Lecture notes

  • Storage classes and sizeof
  • Bits, binary, and endianness

Reading: K&R chapters 2, 3, 4

Recitation 2: Weekend of Sep 16

Recitation notes

  • Review: Git, Make, C preprocessor, and header files

Lecture 5: Tuesday Sep 20

Lecture notes

  • Pointers and addresses
  • Stack allocation
  • Global variables and static allocation

Reading: K&R chapter 5

Lecture 6: Thursday Sep 22

Lecture notes

  • Heap allocation
  • malloc() and free()
  • Memory safety

Reading: K&R chapter 5

Recitation 3: Weekend of Sep 23

Recitation notes

  • Using bit operations
  • Understanding evaluation order
  • Debugging memory leaks and errors with Valgrind

Lecture 7: Tuesday Sep 27

Lecture notes

  • Pointer arithmetic
  • Arrays
  • Null-terminated arrays and strings

Reading: K&R chapter 5

Lecture 8: Thursday Sep 29

Lecture notes

  • Pointers to pointers
  • Structs
  • Function pointers

Reading: K&R chapter 6

Recitation 4: Weekend of Sep 30

Recitation notes

  • Address space layout
  • String and array operations

Midterm 1 Review: Tuesday Oct 4

Midterm 1: Thursday Oct 6

Recitation 5: Weekend of Oct 7

  • Objects and methods in C
  • “Inheritance” in C

Lecture 9: Tuesday Oct 11

  • Libraries and linkage
  • Global vs static variables

Lecture 10: Thursday Oct 13

  • Standard I/O
  • Buffering

Reading: K&R chapter 7

Recitation 6: Weekend of Oct 14

  • Shell scripting with pipes and redirection

Lecture 11: Tuesday Oct 18

  • File I/O with strings
  • fopen()
  • fgets() and fputs()
  • File permissions

Reading: K&R chapter 7

Lecture 12: Thursday Oct 20

  • File I/O with binary data
  • fread() and fwrite()
  • Demo: mdb

Reading: K&R chapter 7

Recitation 7: Weekend of Oct 21

  • Exercise: mdb-compress

Lecture 13: Tuesday Oct 25

  • File pointers vs file descriptors
  • TCP/IP Networking
  • netcat
  • Endianness redux: host and network byte-order

Reading: K&R chapter 8

Lecture 14: Thursday Oct 27

  • C sockets API
  • socket(), bind(), listen(), accept()

Recitation 8: Weekend of Oct 28

  • TCP/IP networking in the shell using netcat

Lecture 15: Tuesday Nov 1

  • Application layer networking
  • HTTP 1.0

Lecture 16: Thursday Nov 3

  • HTTP client and HTTP server

Recitation 9: Weekend of Nov 4

  • File transfer using TCP
  • Exercise: tcp-sender, tcp-receiver

Election Day Holiday: Tuesday Nov 8

Lecture 17: Thursday Nov 10

  • Dynamic web pages
  • UNIX, servers, and the bigger picture

Recitation 10: Weekend of Nov 11

  • Dynamic server statistics

Midterm 2 Review: Tuesday Nov 15

Midterm 2: Thursday Nov 17

Recitation 11: Weekend of Nov 18

  • Executing other programs (exec())

Unplanned: Tuesday Nov 22

Thanksgiving Holiday: Thursday Nov 24

Lecture 18: Tuesday Nov 29

  • Concurrency and process management
  • fork() and waitpid()

Lecture 19: Thursday Dec 1

  • Performance and benchmarking

Recitation 12: Weekend of Dec 2

  • fork() and exec()
  • Exercise: jsh

Unplanned: Tuesday Dec 6

Wrap Up: Thursday Dec 8

  • Recap
  • Beyond 3157