C programming basics
Lectures:
- Roles of preprocessor, compiler and linker
- Data types in C
- Expressions and statements
- Storage classes: automatic and static variables
- Process address space: stack and heap
Reading:
Lab 1:
- Basic UNIX commands
- Remote login using ssh
- Setting up the shell environment
- Managing source files using Subversion
- Writing a Makefile
Arrays and pointers in C
Lectures:
- Basics of memory addresses, pointers and arrays
- Relationship between arrays and pointers
- Simulating call-by-reference using pointers
- char array, aka the string
- Heap memory allocation
- Pointer to pointer
Reading:
Lab 2:
- Working with heap-allocated arrays of integers
- Working with char arrays
- Working with pointer to pointer: creating and
destroying a copy of argv structure
- Debugging memory errors using Valgrind
Data structures in C
Lectures:
- Pointer to function
- Complicated declarations
- Struct and union
- Self-referential structure
Lab 3:
- Implementing a singly linked list
- Holding any type of data using void*
- Callback functions
- Creating and using libraries
I/O in C
Lectures:
- stdin, stdout and stderr
- I/O redirection and pipes in UNIX shell
- Formatted I/O
- File I/O
Reading:
Lab 4:
- Implementing mdb-lookup, a program to access a
database of one-liners
- Accessing a binary file of fixed-length records
- Creating files with holes
- Measuring the effect of I/O buffering
Introduction to UNIX and TCP/IP networking
Lectures:
- Roles of an operating system
- UNIX I/O using file descriptors
- Process control using fork() and exec()
- Inter-process communication using pipes and signals
- TCP/IP networking overview
Lab 5:
- Turning mdb-lookup into a network server using Netcat
and a named pipe
- Working with fork(), exec() and waitpid()
- Creating orphan and zombie processes
Sockets API and HTTP protocol
Lectures:
- Simple TCP client/server example using sockets API
- HTTP protocol
Reading:
Lab 6:
- Writing mdb-lookup network server using sockets API
- Writing a HTTP client, a web page downloader
Web-based software architecture
Lectures:
- Generating dynamic contents
- User input through HTML forms
- Managing sessions with cookie
- Software architectures
- From stand-alone programs to web application
servers
- Architectural evolution of our mdb-lookup
Lab 7:
- Writing a web server from scratch
- Serving static pages
- Serving dynamic pages: mdb-lookup
Lab 8 (Optional):
- Writing an Apache module
- Building and configuring Apache open-source web
server
- Writing mdb-lookup as an Apache module
Introduction to C++
Lectures:
- Basic-4: constructor, destructor, copy constructor and
assignment operator
- Stack v. Heap allocations
- Pointer v. Reference
- Example: MyString class
Reading:
- C++ Primer 4th Ed., by Lippman, et al.
- chapter 12: classes
- chapter 13: copy control
- chapter 14.1 - 14.5: operator overloading
Lab 9:
- Understanding object construction and destruction by
tracing basic-4 calls
- Implementing some member functions in MyString class
Real-world C++
Lectures:
- Generic programming using templates
- Standard sequential containers: string, vector, list, deque
- Standard associative container: map
- Quintessential C++: Smart pointer using reference counting
Reading:
- C++ Primer 4th Ed., by Lippman, et al.
(1) 3.1 - 3.4: string, vector and iterator
(2) 16.1 - 16.4: Templates
(3) 9.1 - 9.5: Sequential containers
(4) 10.1 - 10.3: Associative container (map)
Lab 10:
- Wrapping the C linked list from lab 3 with a C++ class
interface
- From pointer-based interface to value-based
interface
- Upgrading implementation without changing interface
- Replacing the legacy C linked list with the standard
container