Labs
Labs help students gain initial familiarity with applying course concepts. Many labs are focused on specific skills needed for the assignments.
Expand for Lab directions
Lab directions
- Submit your completed lab online to CourSys (not Canvas, not GitHub).
- Labs are marked on completion, not correctness, so complete each part to the best of your ability and learn.
- Labs are due Sunday 11:59pm. Extensions possible only in exceptional cases.
- It is recommended that students attend in-person lab sections for lots of support!
- You are invited to come to any (or more than one) lab section.
- There is no need to attend the section you are enrolled in.
- There is no need to attend any lab sections: there is no attendance taken.
- You can complete each lab on your own time or own computer if you like.
- While completing these labs, you are encouraged to help your classmates and receive as much help as you like. Assignments, however, are individual work and you must not work with another person on assignments.
- I recommend coming to the lab and working with someone.
- Failing that, I recommend getting together with someone in the class outside of lab time to work through the lab together.
- Failing that, you are welcome to complete the lab exercises without any collaboration.
- Each student must submit their lab to get marks.
- Academic honesty expectations for labs are that each student types their own lab solution. It is OK to share ideas and help each others with specific coding issues and design. It is not permitted to submit another student's file for credit.
- If using CSIL lab PC:
- [Only CSIL PC] If in Windows, reboot to Linux; while booting, select Ubuntu from boot menu.
- [Only CSIL PC] Don't setup GitHub tokens in the
cmpt201
container because it may be shared with other users. - [Only CSIL PC] Delete any possible previous docker container before starting the lab:
docker rm cmpt201
- [Only CSIL PC] When done your lab, copy your solution out of the container, then execute the above docker command to delete your docker container to leave it clean for the next user.
- You do not need to use
.record
Labs
- Lab 0 (Week of May 12) - Getting Started
- There are no in-person labs this week! Do not go to any lab sections this week.
- This lab is not for credit: it is to help you get writing C code.
- Lab 1 (Week of May 19) -
getline()
,strtok_r()
- Lab 2 (Week of May 26) - `fork()', 'exec()', 'wait()'
- Lab 3 (Week of June 2) - Input History
- Preparation Material:
- getline()
- C arrays
- Preparation Material:
- Lab 4 (Week of June 9) - Heap Memory / Memory Allocation
- Preparation Material:
- Know
sbrk()
function. - Understand memory allocation from notes, see slides.
- C Skills
- Able to create and use structs.
- Able to use pointers: type cast, dereference, pointer arithmetic.
- Know
- Preparation Material:
- Lab 5 (Week of June 16) - Memory Allocation Algorithms
- Preparation Material:
- Understand memory allocation from notes, see slides.
- Able to work with a C linked-list.
See YouTube Video on Linked List in C
- Preparation Material:
- Lab 6 (Week of June 23) - Debugging & Asserts
- Preparation Material:
- Able to work with a C linked-list.
See YouTube Video on Linked List in C
- Able to work with a C linked-list.
- Preparation Material:
- Lab 7 (Week of June 30) - MapReduce
- Lab 8 (Week of July 7) - Threading Activity with uthash
- Preparation Material:
- Read about the
uthash
library. - C Skills
- Able to use structs, arrays, pointers
- Able to compile, run, and debug C programs using CMake.
- Read about the
- Preparation Material:
- Lab 9 (Week of July 14) - Socket Programming
- Preparation Material:
- Linux socket programming.
- C Skills
- Able to use structs, arrays, pointers
- Able to compile, run, and debug C programs using CMake.
- Preparation Material:
- Lab 10 (Week of July 21) - Multiple-Client socket programming
- Preparation Material:
- Linux socket programming.
- C Skills
- Able to use structs, arrays, pointers
- Able to compile, run, and debug C programs using CMake.
- Preparation Material:
- Lab 11 (Week of July 28) - Two Truths and a Lie = Signature Verification
- Read how to verify a message by its signature: OpenSSL Wiki re EVP Signing and Verifying.
- Focus on the section about Asymmetric Key, specifically about Verifying a message digest.
- You should really do this reading! It shows sample code (the first one under Verifying is very helpful)! Read the section, not just the code.
- Good to have some initial familiarity with:
- C Skills
- Able to use files, arrays, pointers.
- Able to compile, run, and debug C programs using CMake.
- Read how to verify a message by its signature: OpenSSL Wiki re EVP Signing and Verifying.