David J. Malan , Instructor
dmalan@harvard.edu
http://www.cs.harvard.edu/malan/
Harvard College
Introduction to the intellectual enterprises of computer science and the art of programming. This course teaches students how to think algorithmically and solve problems efficiently. Topics include abstraction, encapsulation, data structures, databases, memory management, software development, virtualization, and websites. Languages include C, PHP, and JavaScript plus SQL, CSS, and XHTML. Problem sets inspired by real-world domains of biology, cryptography, finance, forensics, and gaming. Designed for concentrators and non-concentrators alike, with or without prior programming experience.
These lectures were filmed in Sanders Theatre in Memorial Hall . (Week 2 onward were filmed in HDV by Chris Thayer.) Notes were taken by Andrew Sellergren '08.
If you have questions or would like to discuss the material with others, you may want to join the Google Group at right.
Week 0 ▶ Wednesday ▶ Friday ▾ expand all Introduction. Bits. Binary. ASCII. Programming. Algorithms. Scratch. Statements. Boolean
expressions. Conditions. Loops. Variables. Threads. Events.
Demos Notes Scratch Projects Videos Week 1 ▶ Wednesday ▶ Friday ▾ expand all C. Source code. Compilers. Object code. SSH. SFTP. GCC. Functions. Comments. Standard
output. Arithmetic operators. Precedence. Associativity. Local variables. Types. Casting.
Standard input. Libraries. Boolean expressions, continued. Conditions, continued. Loops,
continued.
Demos Downloads Notes Source Code Videos Week 2 ▶ Monday ▶ Wednesday ▾ expand all Functions, continued. Global variables. Parameters. Return values. Stack. Frames. Scope. Arrays. Strings. Command-line arguments. Cryptography.
Demos Notes Source Code Videos Week 3 ▶ Monday ▶ Wednesday ▾ expand all Linear search. Binary search. Asymptotic notation. Recursion. Pseudorandomness. Bubble
sort. Selection sort. Insertion sort. Merge sort. Debugging.
Demos Notes Source Code Videos Week 4 ▶ Monday ▶ Wednesday ▾ expand all Structures. Dynamic memory allocation. Stack and heap. Pointers. Debugging,
continued.
Demos Notes Source Code Videos Week 5 ▶ Monday ▶ Wednesday ▾ expand all File I/O. Forensics. Linked lists. Stacks. Queues.
Demos Notes Source Code Videos Week 6 Week 7 ▶ Monday ▶ Wednesday ▾ expand all Valgrind. Bitwise operators. Hash tables. Trees. Binary search trees. Tries. Huffman
coding.
Demos Notes Source Code Videos Week 8 ▶ Monday ▶ Wednesday ▾ expand all HTTP. XHTML. PHP. SQL.
Demos Notes Source Code Videos Week 9 ▶ Monday ▶ Wednesday ▾ expand all CSS. Inheritance. JavaScript. Events, continued. Ajax.
Demos Notes Source Code Videos Week 10 ▶ play ▾ expand all Preprocessing. Compiling. Assembling. Linking. CPUs.
Week 11 ▶ play ▾ expand all Week 12 ▶ play ▾ expand all Exciting conclusion.
Demos Scavengers Scratch Picks Videos
Sections (otherwise known as "recitations" or "precepts" at other universities) supplement lectures . Led by Matthew Chartier '12, these sections were filmed in Harvard Hall .
Because Computer Science 50 is offered through Harvard Extension School as "Computer Science E-52", you may sometimes hear Matt refer to the latter. The courses are one and the same.
Week 1 ▶ play Week 2 ▶ play Week 3 ▶ play Week 4 ▶ play Week 5 Week 6 ▶ play Week 7 ▶ play Week 8 ▶ play Week 9 ▶ play Week 10 ▶ play
In order to accommodate students with different backgrounds, some problem sets are released in two editions: a standard edition intended for most students and a "Hacker Edition" intended for some students. Both editions essentially cover the same material. But the Hacker Edition typically presents that material from a more technical angle and poses more sophisticated questions. Most standard editions, though, are accompanied by code "walkthroughs" during which students receive direction on where to begin and how to approach the problem set. Led by Marta Bralic '11, these walkthroughs were filmed in Emerson Hall .
If you have questions or would like to discuss the material with others, you may want to join the Google Group at right. And if you'd like to implement these problem sets, you'll likely want to download the CS50 Appliance .
Problem Set 0: Scratch Create your own animation, game, or interactive art.
Problem Set 1: C ▶ play ▾ expand all Meet Linux and C.
standard edition Hacker Edition Problem Set 2: Crypto ▶ play ▾ expand all Encrypt and decrypt sensitive information.
standard edition Hacker Edition Problem Set 3: The Game of Fifteen ▶ play ▾ expand all Implement a party favor.
standard editionSource Code Tests Walkthrough Hacker Edition Problem Set 4: Sudoku ▶ play ▾ expand all 数字は独身に限る。
standard edition Hacker Edition Problem Set 5: Forensics ▶ play ▾ expand all Recover lost photos. Solve a murder mystery.
standard edition Hacker Edition Problem Set 6: Mispellings ▶ play ▾ expand all Implement a spell-checker that’s faster than your classmates'.
standard editionKeys Source Code Walkthrough Problem Set 7: C$50 Finance ▶ play ▾ expand all Design a database. Build a dynamic website.
Problem Set 8: Mashup ▶ play ▾ expand all Google Maps meet Google News. And Ajax.
Below are quizzes; other answers may be possible. Reviews were led by Rose Cao '11, Matthew Chartier '12, Jesse Cohen '10, Derek Lietz '09, and Mike Teodorescu '11.
If you have questions or would like to discuss the material with others, you may want to join the Google Group at right.
Quiz 0 ▶ play ▾ expand all Covers weeks 0 through 5.
Quiz 1 ▶ play ▾ expand all Covers weeks 0 through 10 with emphasis on 7 onward.
Seminars cover material beyond the scope of the course. Fall 2007's seminars and Fall 2008's seminars are also available.
Android Apps with App Inventor ▶ play by Alex Hugon '11 and Filip Zembowicz '11
App Inventor for Android is a Scratch -like environment that lets you create new mobile
applications. With it, you can explore communication, location-awareness, social networking,
and massive Web-based data collections. This is a great way to try out mobile apps, and to
collaborate with a community of developers at Google and other colleges participating in the
App Inventor alpha.
Android Apps with Java ▶ play by Kent Rakip '11
Android is a software stack for mobile devices that includes an operating system, middleware and key applications. The Android SDK provides the tools and APIs necessary to begin developing applications that run on Android-powered devices.
Beginning iPhone Development: Resources, Tips & Tricks ▶ play by Winston Yan '10 and Jonathan Yip '12
Interested in developing an app for the iPhone or iPod touch? This seminar aims to not only be a tutorial on beginning iPhone development, but will also 1) introduce a number of resources we've found useful during the development of Rover and 2) provide you with a number of tips, tricks, and customizations that we've learned through trial and error. Hopefully from our experience, we can make your life a lot easier!
Building Social Applications with the Facebook Platform ▶ play by Keito Uchiyama '11
When you "SuperPoke" someone on Facebook or play "Farmville", you're using applications built on the Facebook Platform , an extensive infrastructure designed to make it easy for developers to leverage the social graph of the world's largest social networking website. Now that the Facebook Platform is available outside facebook.com as Facebook Connect and in many other languages beyond PHP, an increasingly large number of notable websites are using the Platform to add the social element to their websites and other applications. Learn how to create such an application yourself and join the social web.
Dynamic Websites on Rails ▶ play Hadoop for Large-Scale Computation ▶ play by Zak Stone
Welcome to the era of Big Data, in which petabytes of information are accumulating at an accelerating rate and desperately need you to analyze them. Computation on billions of web pages or photos or log entries requires new tools and a new way of thinking about programming; this seminar will introduce you to Hadoop , the most prominent open-source ecosystem of tools for working with exciting new large-scale datasets.
Interactive Data Applications ▶ play by Mike Tucker '03
Build an interactive, data-driven application using Endeca 's commercial-grade data tools with XQuery , a standards-based programming language tuned to working with XML .
Endeca provides a platform for search applications that allows users to navigate through data based on record attributes. This means that you can take any dataset that you have in mind and open it up to the world with the type of high quality text search and faceted navigation that you find on the top e-commerce and media sites including HomeDepot.com , NewEgg.com , NewsSift.com and Time.com .
Endeca provides access to these features and more through APIs that are exposed in a standard query language for XML databases called XQuery, in which you can write arbitrarily complex programs. These programs can then be hosted in your Endeca application as web-services, meaning that they can be invoked from your AJAX or Flex -based User Interface.
Scraping Data from the Internet ▶ play by Keito Uchiyama '11
Stocks, sports scores, dining menus--there's a plethora of information out there on the Internet that's not available by easily accessible Application Programming Interfaces (APIs). Web scraping , or screen scraping in general, helps extract that data by parsing the HTML on web pages, making data from any website on the Internet accessible to your application and prime for mashing up in whatever creative way you can imagine. We'll go over an example, CrimsonDining.org , which uses robust scraping to retrieve menu data from Dining Services. The techniques covered in this seminar will apply to any programming language or framework.
Visualizing Data and Data Art with Processing ▶ play by Filip Zembowicz '11
Processing is an open-source programming language based on Java and designed with visualization in mind. It is for students, artists, designers, researchers, and hobbyists for learning, prototyping, and production of graphics, both static and interactive. It is used intensively in the class CS 171: Visualization, taught by Hanspeter Pfister. This tutorial will cover basic processing fundamentals, including loading data, drawing complex shapes from primitives, physics, and handling user interaction. These programs can then be run online or through downloadable executables.
Visualizing Data Interactively: A Primer on Actionscript, Flex, and the Flare
Visualization Library ▶ play by Filip Zembowicz '11
Large datasets are everywhere nowadays: information on populations, biology, voting, prices, and distances are just a few of the various categories of data easily accessible online. However, many of these resources suffer from poor user interface design--it is hard for a user to see the information holistically, to see patterns in data, to observe how the data changes over time, and to remain engaged with static blocks of text and images. Information visualization allows for the facile design of engaging ways to explore data. In this tutorial, I will introduce Actionscript (the language that powers Flash animations) and Flex (an Adobe product that allows rapid development of web-based flash apps), specifically focusing on how the Flare visualization library can be utilized to load, display, and interact with quantitative, qualitative, and relative data. Examples of beautiful visualizations: http://www.visualcomplexity.com/vc/ .
Adobe has recently announced that the forthcoming Flash CS5 will be able to run on iPhone -- this represents a tremendous opportunity for getting into the mobile wave.
Voice Application Development ▶ play by Wellie Chao '98
Provide information and services to users over the phone using speech synthesis, dual-tone multi-frequency (DTMF) capture, and public switched telephone network (PSTN) connectivity. Build voice telephony applications using scripting languages such as Perl and Python configured with XML. FreeSWITCH is a SIP -compliant softswitch that lets you talk to other softswitches, softphones, IP phones, and (via SIP) the PSTN to reach (or be reached by) any mobile phone or landline around the world. The CS50 Shuttleboy Voice application (617-BUG-CS50 / 617-284-2750) is built on FreeSWITCH. Organizations such as Delta Airlines , Capital One , Citibank , and even Harvard use interactive voice response (IVR) systems to provide information to customers such as flight times, bank balances, and dinner menus, and to allow customers to perform transactions such as booking tickets, transferring money, making payments. With FreeSWITCH and your favorite programming language (C/Java/Perl/Python/PHP/Javascript/Ruby/etc.), building such systems is a snap. In addition, FreeSWITCH has some cool features such as receiving faxes, sending dynamically generated faxes, integration with Google Talk , mixing of audio streams from multiple sources such as other phone lines for conferencing or local files/shoutcast.
Below are papers about CS50.
Grading Qualitatively with Tablet PCs in CS 50 Workshop on the Impact of Pen-Based Technology on Education. Blacksburg, Virginia. October
2009.
Moving CS50 into the Cloud 15th Annual Conference of the Northeast Region of the Consortium for Computing Sciences in
Colleges. Hartford, Connecticut. April 2010.
Reinventing CS50 41st Annual ACM Technical Symposium on Computer Science Education. Milwaukee, Wisconsin.
March 2010.
Virtualizing Office Hours in CS 50 14th Annual ACM Conference on Innovation and Technology in Computer Science Education.
Paris, France. July 2009.
This is CS50.
Computer Science 50 (otherwise known as CS50) is Harvard College 's introductory course for majors and non-majors alike, a one-semester amalgam of courses generally known as CS1 and CS2 taught mostly in C.
Even if you are not a student at Harvard, you are welcome to "take" this course via cs50.tv by following along via the Internet. (The course's own website is at www.cs50.net .) Available at left are videos of lectures , sections (aka "recitations" or "precepts"), and seminars along with PDFs of all handouts. You can even tackle the course's problem sets at home using the CS50 Appliance , a freely downloadable virtual machine that will let you run (Ubuntu ) Linux inside a window on your own computer, whether you yourself run Linux, Mac OS, or Windows.
If you have questions or would like to discuss the material with others, do join the course's Google Group . You can even tackle the a
If you're a teacher, you are welcome to adopt or adapt these materials for your own course, per the license .
If you'd like to take this course for real (on Harvard's campus or via the Internet) in order to receive feedback on work, grades, and a transcript, the course will next be offered through Harvard Extension School (as "Computer Science E-52") in Fall 2010. You can register online starting in August 2010.
Special thanks to Chris Thayer and Harvard Extension School for the course's videos and to Cansu Aydede '11 and Yuhki Yamashita '11, Fall 2009's heads.
djm
For The CS50 Blog "on the intellectual enterprises of computer science and the art of programming," head to blog.cs50.net .
Copyright © 2009 – 2010,
David J. Malan
This course's content is licensed by
David J. Malan under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License , which means that you are not only welcome to watch, listen to, download, and/or read this content,
you are free
to Share — to copy, distribute, and transmit this content
to Remix — to adapt this content
under the following conditions
Attribution — You must attribute this content to
David J. Malan of Harvard University .
Noncommercial — You may not use this content for commercial purposes.
Share Alike — If you alter, transform, or build upon this work, you may distribute the resulting work only under the same or similar license to this one.
with the understanding that
Waiver — Any of the above conditions can be waived if you get permission from
David J. Malan .
Other Rights — In no way are any of the following rights affected by the license:
Your fair dealing or fair use rights;
Apart from the remix rights granted under this license, the author's moral rights;
Rights other persons may have either in the work itself or in how the work is used, such as publicity or privacy rights.
Notice — For any reuse or distribution, you must make clear to others the license terms of this work. The best way to do this is with a link to this web page .