Computer Science 50
lab assignments 

Typically, labs are given out after the lecture on Monday and are returned the following Sunday at midnight; exceptions to this are Lab3 (9 days), Lab 6  (10 days) and Lab7 (2 days). Labs are graded and returned one week later.  Each student is given two free passes for 48 hour extensions with no penalty. But you do not want to use these if possible since you will fall behind; see policy for late assignments.

Warning -- do not submit segfaulted code: No grade will be given to labs submitted that segfault. There is no way for us to grade a segfaulted program. If you submit a program that segfaults there is the penalty: a student will be asked to resubmit their segfaulted code. The resubmitted code will be graded out of 50% of the original grade. This is a significant penalty so make sure that you double check that your code compiles and runs correctly without segfaults before submission.

Lab                                              Assigned Date               Due Date
Lab1 - Shell Commands                           Monday, March 30                  Not graded but complete Monday April 6

Lab2 - Shell Programming                        Monday, April 6                      Monday April 13  (11.59 PM)  

Lab3 - C Programming                             Monday, April 13                    Tuesday, April 21 (11.59 PM)  

Lab4 - Crawler                                         Wednesday, April 22               Monday,  May 4   (11.59 PM)  -- 12 days

Lab5 - Indexer                                          Monday, May 4                       Monday, May  11  (11.59 PM)

Lab6 - Query Engine                                Monday,  May  11                   Monday,  May 18  (11.59 PM)

Lab 7 is optional and will be for extra credit

Lab7 - Socket Programming                     Monday May 18                      Wed,  May 20   (11.59 PM)

As mentioned above labs are given out on Monday at class and are due (typically) midnight Monday. There are a couple of exceptions
with Lab6 (which is hard) and Lab7 (which challenging but a breeze in comparison to Lab6).

Labs 4-6 are the TinySearchEngine set. You will code the crawler and indexer.  We will design these components
in class together. You will do the design for the query engine and code it. Then you will put  all three components
together and you'll have your TinySearchEngine. Now you are ready to take on google! This is an extremely cool
set of assignments. It is, however, very challenging but you will learn how to design, implement, test and debug a
complex software system. You will gain significant coding chops doing this. It will be painful but we promise you will get there.

You will write a lot of C code in this course: approximately 500 lines of bash scripts and 3000 lines of C
for the assignments and 1000 lines for the joint project - these are counts of C code, excluding comments.
Note, there is some code reuse/ refactoring between the TinySearchEngine set of labs.

Lab 2 (Shell): 
Lab 3 (C): 387
Lab 4 (Crawler): 692
Lab 5 (Indexer): 1002
Lab 6 (Query Engine): 587
Lab 7 (Sockets): 389
Project: 1063

One more item before you get your cs50 hackers medal:

Embedded Linux programming, network programming - now for flying copters ..... and project time.

See the project page for the remaining schedule and for important milestones and what is needed for those

How to submit programming assignments

We are using Subversion Version Control (SVN) for the submission of programming assignments. SVN is a tool for source code management. How are we going to submit programming labs using SVN? First,  create a directory for each new lab (viz. lab1, lab2, lab3, lab3, lab5, lab6 and lab7). We will make a copy of your SVN directory after the deadline for submission.

Please make sure that each lab directory (e.g., lab2) contains a simple text file (called README) briefly describing the source code in the directory and anything “unusual” about how your solution should be located, executed, and considered. Essentially, your README gives us a quick overview of the content on the directory and how to run your programs. Note that from Lab 4 onward you also need to include a Makefile in your submission directory.

Your svn repository root is at For example: Note, repo in yourreponame is short for respository. But replace campbell with your repsoitory account username. You should have received this from Wayne or the TA. When you click on the svn URL above you will be asked to enter a username and password: enter your full DND (also blitz name) as your username and Blitz password as your password; DO NOT use your CS account name and password to login to the svn server - it will not work.

NOTE, for classes after 2012 this is relevant: change cs50-s12 to the correct year and term for example W13 changes the svn commands below to cs50-W13.

We will have a lecture on how to use svn but you do can read the notes in advance in you like.

Section information

In addition to the TA lab hours we have sections that will meet where you can come with your questions and the section leaders will help with design and coding issues. Please take full advantage of these sessions because the design and coding gets challenging very quickly. See below for which section you are in and when and where the section meets.

When and where the sections meet:

x section will meet 10-11 am in Sudikoff 115
x section will meet 1.45-2.45 pm in Sudikoff 214
x section will meet 3-4 pm in Sudikoff 214
x section will meet 5-6pm in Sudikoff 212

Some suggestions:

1. If you have trouble with remote login to lab 001 linux pc  using windows laptop then please refer to this link

2. We also encourage students to run their code on their laptops as a first priority. Then remote login to make sure your code work on the lab 001 linux machines. Otherwise, the lab machines will be pretty slow if all the students write and run code on them.

3. If you have coding questions, please email in this order: section leader first, then TA and then professor.