Important course announcements will be posted below and announced in class. You are responsible for all material that appears here and should check this page for updates frequently.
Assignment 5 Grades Released Sat. June 13 by Nick Assignment 5 grades have been posted to the Gradebook page, along with feedback for the readmes. The quartiles of scores were as follows (/84): 1st quartile = 67, second quartile = 76, third quartile = 80. We've also updated the Gradebook overall scores with these new points. Congratulations on defusing your bombs and finding vulnerabilities in ATM!
CS107 Recap Page and Q&A Lecture Posted Tues. June 9 by Nick We've posted the video from yesterday's wrap-up and Q&A to the Course Videos page, and the slides to the schedule page. We've also create a new CS107 Recap Page that sums up everything we did this quarter, where you could go next, and ways to explore the CS107 material further if you're interested. We encourage you to check it out! We also hope you can take the time to fill out the end-quarter CS 107 course evaluation. We sincerely appreciate any feedback you have about the course and read every piece of feedback we receive. We are always looking for ways to improve! To fill out the course evaluation, go to Axess, and from there click the "Student" tab and select "Course and Section Evaluations". Thank you in advance for any feedback you have!
Course Policy Updates Thurs. June 4 by Nick We have several course policy updates to announce:
- we are extending the late deadline for assign5 to be Wed. 6/10 at 11:59PM PDT
- we are making the final project optional
- we are giving full credit for lecture 15 quizzes
- we are postponing the last lecture to instead be an open Q&A during Mon. 6/8 lecture time
- we have posted partial grades for assign5 in gradebook along with further overview scores
Please see the discussion forum for the full note from the staff.
Lab 7 Posted Mon. June 1 by Nick We’ve posted the materials for lab7, which is all about exploring optimizations and profiling. There is no prelab for this week, and as announced earlier, attending this lab in person is optional - you will receive lab credit whether or not you attend, though if you do not attend we highly recommend working through the lab on your own. The exercises give you practice with profiling and optimizing code, which will be useful for fine-tuning your heap allocators. Feel free to post on the discussion forum if you have questions while working!
Course Policy Updates Sun. May 31 by Nick We have several course policy updates to anounce:
- we are extending the late deadline for assign5 to be Tues. 6/2 at 11:59PM PDT
- we are waiving any late penalties for assign5, allowing you to submit through Tues. without penalty
- we are extending the on-time deadline for the final project to be Wed. 6/10 at 11:59PM PDT
- if needed, we will accept and will not penalize late final project submissions that come in on Thurs. 6/11 if you need the time for any reason.
- in order to provide this extra time on the final project while still allowing us to grade your work in a timely manner, if (and only if) you are submitting late (on Thurs.) we ask that you PLEASE SPECIFY AS MUCH IN YOUR README (e.g. "I am submitting on Thurs., this is not my final submission"). This way, the course staff can begin grading final submissions submitted Wed. and grade submissions coming in Thurs. starting later.
- lab attendance this week will be optional. In other words, we will give you credit for lab whether or not you attend. We of course highly encourage you to attend if you can, or work through the material if you cannot, as it is useful for learning more about optimizations and for fine-tuning your allocators.
Please see the discussion forum for the full note from the staff.
One Extra Free Late Day Fri. May 29 by Nick We are providing 1 additional "free late day" (for a total of 6) for you to use this quarter. This will be applied "retroactively" - in other words, if you took more than 5 late days already, this late day will be automatically applied to when you previously took your "sixth" late day, in place of otherwise being deducted. Otherwise, you can choose to use this on either assign5 or the final project if you'd like. We know everyone has been working incredibly hard on the assignments, and we want to help you finish strong. You can do it!
Final Project Posted Fri. May 29 by Nick The Final Project has been posted on the assignments page. It is mean to act as a capstone for all the topics we've covered this quarter by implementing our very own heap allocator! We hope you have fun with it. It is due Tues. 6/9 at 11:59PM PST. Because it is the end of the quarter, at most one late day may be used on this project. You can find more details on the assignment page. Important note: we have decided to remove the following language from the general information handout regarding the final project: "You must do the final project in order to pass the class.". Instead, we rely solely on the 20% weight of the final project to communicate its importance to the course, and its significance in determining your final course score.
Assignment 4 Grades Released Fri. May 29 by Nick Assignment 4 grades have been posted to the Gradebook page, along with style feedback for the assignments. The quartiles of scores on the functionality portion of the assignment were as follows (/92): 1st quartile = 79, second quartile = 88, third quartile = 92. Awesome job!
(Optional) Midterm Practice Materials Posted Fri. May 22 by Nick We have posted the same midterm practice materials that we typically post each quarter roughly around this time (the midterm is usually at the end of week 6, during assignment 4) to the midterm practice materials page. If you'd like, you are welcome to use these materials for additional review, studying or self-assessment of the material through lab4 and assign4. Note: these materials are for optional additional studying, review or self-assessment only. There is no midterm exam being administered this quarter!
Gradebook Updates Fri. May 22 by Nick You can now visit your Gradebook page to see your overall assignments score through assign3, your total late days used through assign3, your total labs attended through lab6, and your lecture quiz scores through lecture 13. We hope you find this information helpful! As a reminder, more information about our grading weights and procedures can be found in the general information handout, linked further down on this page. If you see anything incorrect, please let us know as soon as possible. Thank you!
Assignment 5 Posted Tue. May 19 by Nick Assignment 5 has been posted on the assignments page. It is meant to reinforce the topics of assembly translation and reverse engineering. There are two parts to this assignment. The first part is about an ATM withdrawal program containing some vulnerabilities - you'll need to use your C and assembly skills to find and demonstrate how to exploit these vulnerabilities. The second part is the binary bomb program, where you're given an executable "bomb" program to "deactivate" using your assembly and reverse-engineering skills. These problems are like C/assembly "puzzles" to solve, and we hope you enjoy solving them and exploring this material as much as we enjoyed creating them! The assignment is due Fri. 5/29 at 11:59PM PST. You can find more details on the assignment page.
Assignment 3 Grades Released Mon. May 18 by Nick Assignment 3 grades have been posted to the Gradebook page, along with style feedback for the assignments. The quartiles of scores on the functionality portion of the assignment were as follows (/95): 1st quartile = 83, second quartile = 90, third quartile = 94. Rock on!
Lab 6 + Pre-lab Posted Sun. May 17 by Nick We’ve posted the materials for lab6, which is all about exploring assembly's interactions with the stack. In preparation for labs next week, please make sure to set aside 20-30min beforehand to complete the pre-lab exercises; you can find them on the lab6 page. The exercises will be essential to the further problems you'll work through during your lab session and for the next assignment. Feel free to post on the discussion forum if you have questions while working!
Lab 5 + Pre-lab Posted Sun. May 10 by Nick We’ve posted the materials for lab5, which is all about assembly. In preparation for labs next week, please make sure to set aside 20-30min beforehand to complete the pre-lab exercises; you can find them on the lab5 page. The exercises will be essential to the further problems you'll work through during your lab session. Feel free to post on the discussion forum if you have questions while working!
Assignment 4 Posted Fri. May 8 by Nick Assignment 4 has been posted on the assignments page. It is meant to reinforce the topic of generics,
void *pointers and function pointers, with exercises ranging from implementing your own version of the
lscommand to implementing your own version of the
sortcommand. We hope you have fun with it! The assignment is due Mon. 5/18 at 11:59PM PST. You can find more details on the assignment page.
Assignment 2 Grades Released Fri. May 8 by Nick Assignment 2 grades have been posted to the Gradebook page, along with style feedback for the assignments. The quartiles of scores on the functionality portion of the assignment were as follows (/80): 1st quartile = 67, second quartile = 76, third quartile = 80. Nice work!
Mid-Quarter Evaluation Tues. May 5 by Nick For this week's pre-lab, we ask that you take 15-20 minutes to individually fill out the CS107 mid-quarter evaluation (MQE). This evaluation is important in letting the instructor and TAs know what they're doing well and what they can improve. The evaluation is anonymous, and we appreciate any feedback that you have. Submitting the evaluation is required to get lab credit for the week. Please see the lab4 page for more information.
Assignment 3 Posted Thurs. April 30 by Nick Assignment 3 has been posted on the assignments page. It is meant to reinforce the topic of pointers, arrays and heap allocation, with exercises ranging from implementing a convenient version of a C file I/O function to implementing your own versions of the Unix "tail" and "uniq" commands. We hope you have fun with it! The assignment is due Fri. 5/8 at 11:59PM PST. You can find more details on the assignment page.
Note: Through helper hours and the discussion forum, our focus will be on supporting you so that you can track down your own bugs. Please ask us how to best use tools, what strategies to consider, and advice about how to improve your debugging process or track down your bug, but we want you to take ownership of your own code and drive your own debugging. For this reason, if you have debugging questions during helper hours, you should make sure to gather information and explore the issue on your own first using the debugging checklist discussed in lab and in the assignment spec, and fill out the QueueStatus questions with this information. This is required for any debugging questions in helper hours starting with assign3 so that the course staff can effectively help with debugging questions. If you don't provide enough information, we will ask you to please re-sign up in the queue once you can provide more information so that we can better help you. We are looking for information like - what have you observed from running GDB? Have you found a simple, reproducible test case? Etc. If you are eager to sign up for Helper Hours as soon as they open, we recommend preparing responses ahead of time to the questions: "What question do you have? Please provide as much information as possible." and "What steps have you already taken to try and answer your question? (e.g. running gdb/valgrind, reading Resources page, etc.). This information is required for help with debugging questions."
Assignment 1 Grades Released Wed. April 29 by Nick Assignment 1 grades have been posted to the Gradebook page, along with style feedback for the assignments. The quartiles of scores on the functionality portion of the assignment were as follows (/80): 1st quartile = 68, second quartile = 76, third quartile = 80. Awesome job!
Lab 3 + Pre-lab Posted Sat. April 25 by Nick We’ve just posted the materials for lab3, which is all about pointers, arrays and the heap. In preparation for labs next week, please make sure to set aside 20-30min beforehand to complete the pre-lab exercises; you can find them on the lab3 page. The exercises will be essential to the further problems you'll work through during your lab session. Feel free to post on the discussion forum if you have questions while working! Going forward, we plan to post each week's lab, including pre-lab exercises, the Saturday before the lab.
Lecture Quizzes Now Always Viewable Thurs. April 23 by Nick We've gotten some feedback and we've changed the Canvas settings so that quizzes are always viewable, even if you missed doing a quiz and its deadline has passed. The deadlines remain the same, and late submissions will not receive credit. We hope this is helpful! We also greatly appreciate those who have reached out with any feedback they have about the class by sending us an email, filling out our optional homework surveys (linked at the bottom of each homework spec), or filling out our anonymous feedback form (further down on this page). We read every piece of feedback we receive and are constantly working to make the class better. Thank you!
Assignment 2 Posted Wed. April 22 by Nick Assignment 2 has been posted on the assignments page. It is meant to reinforce the topic of C Strings, with exercises ranging from implementing tools to display environment variables to implementing your own version of the Unix "which" command. We hope you have fun with it! The assignment is due Wed. 4/29 at 11:59PM PST. You can find more details on the assignment page.
Assignment 0 Grades Released Wed. April 22 by Nick Assignment 0 grades have been posted to the Gradebook page, along with style feedback for the assignments. The quartiles of scores on the functionality portion of the assignment were as follows (/25): 1st quartile = 24, second quartile = 25, third quartile = 25. Way to go!
Lab 2 + Pre-lab Posted Sun. April 19 by Nick We’ve just posted the materials for lab2, which is all about strings. In preparation for labs next week, please make sure to set aside 20-30min beforehand to complete the pre-lab exercises; you can find them on the lab2 page. The exercises will be essential to the further problems you'll work through during your lab session. Feel free to post on the discussion forum if you have questions while working! Going forward, we plan to post each week's lab, including pre-lab exercises, the Saturday before the lab.
Assignment 1 Posted Mon. April 13 by Nick Assignment 1 has been posted on the assignments page. It is meant to reinforce the topics of bits, bitwise operators and integer representations, with exercises ranging from implementing the core "saturated arithmetic" algorithm to a bit-level cell simulation to a modern-day character encoding. We hope you have fun with it! The assignment is due Wed. 4/22 at 11:59PM PST. You can find more details on the assignment page.
Here are a few resources that might be helpful while you get started: this is the first assignment where our late day policy applies. You can read more about the late day policy, including new additions about the policy after all free late days are exhausted (applying a cap of 80% or 60%), in the General Information handout. Additionally, we want to include a reminder about the course style guide; it contains an in-depth reference about how to ensure your programs have great style. Lastly, beginning with assign1, we will be creating and updating a "discussion forum table-of-contents" post for each assignment that will be pinned at the top, and will be updated periodically with links to helpful posts from others related to that assignment. We hope this helps surface helpful posts in the discussion forum!
Lab Assignments PostedMon. April 13 by Nick We have posted lab assignments on the labs page of the course website. You can view your assignment here. We did our best to assign everyone to one of their top choices; your enrolled lab will be bolded on this page. On this form, if you'd like, you can also join a different lab with space available. Unfortunately, if a lab is full, we are not able to accommodate additional students at this time, but check back later, as enrollments may shift over time.
Labs start tomorrow - note that for this week, because labs were just assigned, there is no pre-lab exercise to complete before lab. Going forward, labs will be published each Saturday, including the pre-lab exercise (a short activity that should take 20-30min) to complete before lab. You can find more information about labs and lab policies on the labs page. Zoom links to join labs will be on Canvas under the Zoom tab. We'll see you in lab this week!
Lab Preferences Signups ExtendedSat. April 11 by Nick We've extended the deadline for submitting preferences to 11:59PM PST Sat. April 11 - please make sure to submit your preferences by then if you haven't already.
Lecture 3 Advance Materials PostedSat. April 11 by Nick We've posted the set of pre-recorded lecture videos and quizzes for lecture 3 this Monday on Canvas (under "Course Videos" and "Assignments" - note that we have moved quizzes to the Assignments tab, which lets you organize quizzes by Lecture, useful as more quizzes are added). The associated slides can be found on the schedule page. The quizzes will be open through next Saturday. While working through the materials, we highly encourage you to post questions on the discussion forum or stop by helper hours! The more questions you ask, the more information we have for how to make the live sessions more useful for you.
Note that starting with the next (not this) set of lecture videos (for Friday), we have decided to modify the quizzes to streamline the amount of work where possible, and instead make them due by that lecture. In other words, Friday's videos will be released this coming Tuesday, and you will have until the start of Friday's live session to watch the videos and complete the quizzes. This change will help us make the live sessions more useful for you.
Free Online CTL Tutoring Fri. April 10 by Nick We've been asked to post the following message from the Center for Teaching and Learning: "Want to meet with an experienced peer to discuss course concepts, think through a problem set, or prepare for an upcoming exam? CTL offers appointment tutoring for CS 107, in addition to tutoring for a number of other courses. For more information and to schedule an appointment, visit our tutoring appointments and drop-in schedule page. We also have a variety of remote learning resources and academic coaching available to assist with all of your learning needs!"
Lecture 2 Advance Materials PostedWed. April 8 by Nick We've posted the set of pre-recorded lecture videos for lecture 2 this Friday on Canvas (under "Course Videos"). The associated slides can be found on the schedule page. There are 6 videos, each with a short, low-stakes associated check-in quiz under the "Quizzes" tab on Canvas. The quizzes will be open through next Tuesday. Going forward, we'll aim to have Friday pre-recorded materials posted by end-of-day the Tuesday before, and Monday pre-recorded materials posted by end-of-day the Thursday before. The live lectures will now be about 30min and focus on concept review and additional practice. While working through the materials, we highly encourage you to post questions on the discussion forum or stop by helper hours! The more questions you ask, the more information we have for how to make the live sessions more useful for you. Please let us know if you have any feedback on this process!
Lab Signups Open Tues. 5PM Tues. April 7 by Nick Update: we've added 2 more Thurs. labs at 3:30PM PST (a second one) and 8PM PST.
Lab preferences submissions open at 5PM PST today. From then until Saturday at 5PM PST, please submit your lab preferences for which lab you would prefer to attend this quarter. Note that preferences are not first-come first-serve; you may fill out your preferences anytime between those dates, and you may come back to update your preferences later as well. Beginning at 5PM, you can access the lab signup page via the link on the labs page here.
Helper Hours Schedule Posted Tues. April 7 by Nick We have posted our helper hours schedule for the quarter on the Getting Help webpage. The schedule may fluctuate slightly as we finalize times, so please check the calendar on that page for the latest updates. Please feel free to join in!
Assignment 0 Posted Mon. April 6 by Nick Assignment 0 has been posted on the assignments page. It is meant as an introduction to Unix and C, with exercises ranging from uncovering who got unauthorized access to a filesystem to modifying a provided C program to accept command-line arguments. We hope you have fun! The assignment is due Mon. 4/13 at 11:59PM PST, and there are no late submissions accepted for this assignment (late days or otherwise), so please make sure to submit by the deadline.
Welcome! Fri. April 3 by Nick Welcome to CS107! Class starts remotely on Monday, April 6th. We are looking forward to meeting you and starting off a great quarter together! We'll have more details to come about the format of CS107's remote spring offering. In the meantime, please feel free to check out the FAQ. It covers questions about recorded lectures, conflicting classes, CS107E, CS107A, and more. We hope you find it helpful!
CS107 is the third course in Stanford's introductory programming sequence. The CS106 courses provide you with a solid foundation in programming methodology and abstractions, and CS107 follows on this to build up and expand your breadth and depth of programming experience and techniques. The course will work from the C programming language down to the microprocessor to de-mystify the machine. With a complete understanding of how computer systems execute programs and manipulate data, you will become a more effective programmer, especially in dealing with issues of debugging, performance, portability, and robustness. Topics covered include: the C programming language, data representation, machine-level code, computer arithmetic, elements of code compilation, optimization of memory and runtime performance, and memory organization and management.
The class has two lectures a week and a weekly lab designed for hands-on learning and experimentation. There will be significant programming assignments and you can expect to work hard and be challenged by this course. Your effort can really pay off - once you master the machine and advance your programming skills to the next level, you will have powerful mojo to bring to any future project!
Lectures: Mon & Fri 12:30PM-1:50PM via Zoom; Note that this is shorter than what Axess says.
Labs: Tue/Wed/Thu at various times via Zoom; students sign up for labs after the quarter begins.
- Handout 1 - General Information contains a summary of the course logistics and policies
- Honor Code and Collaboration details how the Honor Code applies in this course, including specific examples of acceptable and unacceptable collaboration
- The FAQ contains answers to course questions and information about CS107E and CS107A.
- How are we doing? Submit anonymous feedback here.
Visit the Getting Help page for information about how to contact the course staff.