Course Information

This handout was adapted from Jerry Cain’s Spring 2018 offering.

Instructor: Ryan Eberhardt

Email: rebs (at) cs (dot) stanford

Office: Gates 192

Office hours: Sundays from 6-8pm in Huang Basement; Wednesdays from 1-3pm in Gates 192

Lectures: Monday/Wednesday/Friday 3:30-5:20pm in Gates B03

Units: 5 units. Only matriculated graduate students may register for fewer than five. The course requirements are the same for all students, including those who take the course for 3 or 4 units.

Course Assistants: Audrey Ho, Hemanth Kini, Matthew Katzman, Michael Straka

CS110 CAs attend lectures, lead discussion sections, hold office hours, evaluate homework submissions, monitor Piazza, and grade exams. Be glad they’re here, because all of them have either taken CS110 before, CA’ed CS110 before, or both, and they know the material so well they already know what your questions are going to be.

Prerequisites

Formally, the prerequisite for the course is CS 107. Less formally, you need to be familiar with the C and C++ programming languages, Unix/Linux, make, Makefiles, gcc/g++, valgrind, gdb, and have some experience with basic computer architecture (x86 as it’s taught in CS107, or exposure to some other architecture with the confidence and ability to pick up x86 as I reference it). If you have not taken CS 107, please email me at the beginning of the quarter to let me know.

We’ll be coding in a mixture of C and C++ throughout the quarter. We rely on C, because the libraries needed to interface with system resources are written in C. We rely on C++, because the projects become large enough that I prefer to go with a more mature language that supports encapsulation and generic programming better than C does. You should understand pointers, dynamic memory allocation (malloc/realloc/free), and C strings perfectly. You should understand C++ classes, methods, references, templates, and C++’s new and delete operators. There are many C++ features you’re not expected to know, but you should have enough programming maturity to pick those features up and search the web for reference materials as needed.

The CS 107 course website is still up and may be a good reference. If you have not taken CS 107 and find yourself struggling, get help as soon as possible! This class moves quickly, and you will not want to fall behind. Email me and I may be able to point you to helpful resources.

Readings

Readings are optional this quarter. However, as summer quarter moves particularly quickly, you will probably benefit from skimming readings before lecture or reviewing readings afterwards to reinforce concepts. For relevant lectures, I will list associated readings from the following textbooks:

Software

You will do most of your work on the myth machines (reachable over SSH at myth.stanford.edu), although I may occasionally reference the more powerful rice, wheat, and barley machines to clarify the impact that more processors and larger caches have on execution.

I recognize that you are probably used to working on your own machine and would prefer to complete your assignment on your computer before eventually copying it to the myths and submitting there. However, I strongly urge you to code, test, and debug directly on the myths via ssh. The myths provide us with a consistent execution environment, whereas if you develop on your machine, you may have problems with missing libraries, old compiler versions, or possibly even architectural differences that cause subtle differences in program behavior. (As an added bonus, you won’t lose your code from a catastrophic laptop failure if you develop on the myths.)

You should also spend some time getting to know your tools of choice (this includes gdb and valgrind, but also your terminal emulator and text editor). One important goal of CS 110 is to make you a stronger programmer in general, and part of this is learning your tools so you can be more efficient.

Student Forums

We’re using Piazza for the class forum. When you have a question that might be of interest to other students, please post it there for a speedy response. Please note that you should never include snippets of code directly from your own homework submissions, since that’s code sharing and a huge no-no.

We also have a Slack workspace for CS110. We’ll use Slack as a less formal question-and-answer forum where some nonempty subset of CS110 students is likely to be paying attention at all times, and you can rely on it to ask questions when you’re confident other students will know the answer. If you think your question will be of any use to more than a few other CS110 students or you really want a course staff member to answer, then you should rely on Piazza for that. As with Piazza, you should never include snippets of code in any conversation – public or private – if that snippet is contributing to an assignment solution.

Grading

You can take the course for a letter grade, or CR/NC. The grade breakdown is:

To receive a passing grade, you must pass both of my exams. Restated, if you fail either exam, that exam effectively counts 100%. (I will be clear what a passing grade is for the midterm so you can withdraw from the course before the deadline.) If you’re taking the course CR/NC, your final grade is computed precisely the same way as it is for those taking a letter grade, and you need a C- or better to get the CR.

Programming Assignments

There will be 6 or 7 programming assignments over summer quarter, which is reduced from the 8 programming assignments during the school year. Assignments will require roughly 10-15 hours/week to complete and will help you become intimately familiar with some section of material from the class. We have tried to make each assignment as rewarding as possible; each assignment requires you to draw upon your systems knowledge to build something you yourself might encounter regularly, such as a shell, a proxy, or a debugging tracer (a la strace/dtrace).

Assignment grades have two components: functionality and style. Functionality is graded by a series of automated tests and is worth 5/6 of each assignment grade. Style is graded on a bucket system (solid, minor problems, or major problems) and is worth 1/6 of your grade. Style is quite important (and you may not arrive at a functional solution if your style is particularly bad), but in the end, we care most that your code works.

All programming assignments are due at the stroke of midnight unless otherwise stated, and you’ll always be given at least 7 days to complete any one of them. Please submit assignments on time. We understand everyone here is busy, but falling behind on assignments is bad for us (interferes with our ability to turn around grades quickly) and bad for you (the quarter moves so fast that you will quickly run into trouble). Unlike many other CS classes, we provide no late days, but you may still submit assignments late, subject to a cap on the maximum number of points you can earn:

Note that requests for extensions will be denied unless something truly extenuating – a family emergency, severe illness – presents itself, in which case you can email me directly and I’ll do what I can to make your life easier while being fair to everyone else.

Additionally, note that unlike previous CS classes, course staff will not look at your code in office hours or over email. In this class, the assignments become complicated enough that although a CA could debug your code, it would take a very long time and would be of little long-term benefit to you. (These systems are complicated enough that a CA might need to read and understand nearly all of your code before figuring out your bug.) Instead, we want to train you to code very carefully and test very frequently. Test your program every time you write a few lines of code to verify that it works as intended. If you write 500 lines of code before discovering your program is broken, it may very well be faster to start from scratch, even if a CA reads your code to debug it for you. With that in mind, to help you learn best and out of respect for your peers, CAs are instructed to not look at assignment code in office hours.

Midterm Exam

The two-hour midterm is scheduled for Monday, July 23rd from 7-9pm in Hewlett 201. The midterm is closed book, closed notes, and closed computer, save for the fact that I’ll allow you to prepare and refer to a single 8.5”-by-11” cheat sheet containing any information you can cram onto each of its two sides. I will include all relevant prototypes and type definitions (C functions, C++ classes, etc.) on the exam, and you’re welcome to ask a staff member for a function or method prototype if I don’t include it. If you can’t take the midterm during that time because of a competing class or serious obligation, then you can arrange to take the exam sometime earlier that same day by emailing me directly.

Final Exam

The three-hour final exam is scheduled for Friday, August 17th from 7-10pm, location TBD. I don’t plan on making exceptions for people to take it another time, but if you have an extreme circumstance, email me as soon as possible.

The final is also closed book, closed notes, and closed computer, but I’ll allow you to bring and refer to the four sides of the two 8.5”-by-11” cheat sheets you prepare ahead of time. As with the midterm, I will include all relevant prototypes and type definitions (C functions, C++ classes, etc.) and you’re welcome to ask a staff member for any function or method prototype.

Discussion Sections

I have decided to make labs optional this quarter, since a significant number of students are taking the class remotely. However, they are very strongly recommended; unless you are very on top of the material, I think they will be quite worth your time.

Each 80-minute section will have approximately 20 students. You’ll be expected to bring your laptop or pair up with someone who has one, as the section will be a combination of written problems, coding exercises, and software engineering tips to ensure that you understand the material and how to successfully complete the assignments with minimal drama. The lab signups are here, and you should sign up within the first week of class (labs begin Thursday, 6/28).

If you are an SCPD student or are talking the class remotely, fear not; our excellent CA Hemanth will be recording video walkthroughs as a substitute.

Students with Documented Disabilities

Students who may need an academic accommodation based on the impact of a disability should initiate the request with the Office of Accessible Education (OAE). Professional staff will evaluate the request with required documentation, recommend reasonable accommodations, and prepare an Accommodation Letter for faculty. Unless the student has a temporary disability, accommodation letters are issued for the entire academic year. Students should contact the OAE as soon as possible since timely notice is needed to coordinate accommodations. The OAE is located at 563 Salvatierra Walk, and their website is located right here.

Honor Code

Although you are encouraged to discuss ideas with others, your programs are to be completed independently and should represent fully original work. Whenever you obtain help (from current or previous CS110 students, the CA’s, students in other classes, etc.) you should credit those who helped directly in your program, e.g. in a program comment, type “The idea to use a mutex-guarded linked list of file descriptors came from a discussion with my CS110 CA, Hemanth Kini”.

Any assistance that is not given proper citation is considered plagiarism, and a violation of the Stanford Honor Code. To be even more specific, you are not allowed to collaborate on the coding of your programs, nor are you allowed to copy programs or even minute snippets of programs from other students, past or present. The following activities are among the many I consider to be Honor Code violations:

  1. Looking at another student’s code.
  2. Showing another student your code.
  3. Discussing assignments in such detail that you duplicate a portion of someone else’s code in your own program.
  4. Uploading your code to a public repository (e.g. github.com or bitbucket.com) so that others can easily discover it via word of mouth or search engines. If you’d like to upload your code to a private repository, you can do so on github or some other hosting service that provides free-of-charge private hosting.

Unfortunately, the CS department sees more than its fair share of Honor Code violations. Because it’s important that all cases of academic dishonesty be identified for the sake of those playing by the rules, we exercise our right to use software tools to compare your submissions against those of all other current and past CS110 students, including any we might find online. While we certainly don’t want to create some Big Brother environment, we do need to be clear how far we’ll go to make sure the consistently honest feel that honesty is valued and respected.

If the thought of copying code has never crossed your mind, then you needn’t worry, because I’ve never seen a false accusation go beyond a single conversation. But if you’re ever tempted to share code – whether it’s because you don’t understand the material, or you do understand but just don’t have enough time to get the work done – then you need to remember these paragraphs are here.