1 00:00:00,000 --> 00:00:09,980 2 00:00:09,980 --> 00:00:11,240 DAVID MALAN: Hi. 3 00:00:11,240 --> 00:00:14,180 My name is David Malan, and this is CS50. 4 00:00:14,180 --> 00:00:16,670 So I absolutely love this course. 5 00:00:16,670 --> 00:00:19,820 This, for me, is my dream job, to be honest, now teaching this course, 6 00:00:19,820 --> 00:00:22,470 because I took this course myself about 11, 7 00:00:22,470 --> 00:00:24,480 12 years ago when I was a sophomore. 8 00:00:24,480 --> 00:00:26,870 And I actually came in to Harvard not even 9 00:00:26,870 --> 00:00:30,800 as a computer science major minded person, but I started off as gov. 10 00:00:30,800 --> 00:00:33,770 I had exited high school thinking I liked history, 11 00:00:33,770 --> 00:00:35,940 I liked constitutional law. 12 00:00:35,940 --> 00:00:38,090 And so the natural progression once I got here 13 00:00:38,090 --> 00:00:40,070 seemed to be to go into the gov department. 14 00:00:40,070 --> 00:00:42,710 And I spent freshman fall, freshman spring, 15 00:00:42,710 --> 00:00:46,700 even sophomore fall biting off a lot of the requirements for that department. 16 00:00:46,700 --> 00:00:51,410 And it was really at the last minute, shopping period during sophomore fall, 17 00:00:51,410 --> 00:00:53,755 that I decided, you know what, I'm actually 18 00:00:53,755 --> 00:00:55,130 going to give this course a shot. 19 00:00:55,130 --> 00:00:57,910 Because I've always been one of those geeky kind of kids 20 00:00:57,910 --> 00:00:59,660 and I always liked playing with computers, 21 00:00:59,660 --> 00:01:05,060 grew up with a Commodore 64 and an Apple 2 and a Mac and then PCs, eventually. 22 00:01:05,060 --> 00:01:08,540 But computer science and computer science courses, I mean, 23 00:01:08,540 --> 00:01:11,930 I actually remember looking around at some of my friends, 24 00:01:11,930 --> 00:01:14,510 actually, in high school who were taking AP computer science, 25 00:01:14,510 --> 00:01:16,802 and I thought they were a bunch of geeks, to be honest, 26 00:01:16,802 --> 00:01:19,970 and I didn't actually even consider taking that course myself. 27 00:01:19,970 --> 00:01:26,090 And freshman year when I arrived here, I still was of the certainly technically 28 00:01:26,090 --> 00:01:29,990 minded sorts, but this course CS50 had this reputation, 29 00:01:29,990 --> 00:01:33,560 and it had it for years of being ridiculously daunting, ridiculously 30 00:01:33,560 --> 00:01:35,570 time-consuming, and overall scary. 31 00:01:35,570 --> 00:01:37,610 And that-- quite honestly-- that reputation 32 00:01:37,610 --> 00:01:41,140 scared me away from taking that course my freshman fall. 33 00:01:41,140 --> 00:01:43,760 And this was, mind you, I was working as a UA. 34 00:01:43,760 --> 00:01:44,930 And if a UA-- 35 00:01:44,930 --> 00:01:46,700 a user assistant-- if a user assistant was 36 00:01:46,700 --> 00:01:49,910 sort of disinclined to take this course, well, I mean, 37 00:01:49,910 --> 00:01:52,200 maybe there was something to that. 38 00:01:52,200 --> 00:01:54,465 But finally, sophomore fall, I decided, you 39 00:01:54,465 --> 00:01:56,840 know what, I'm still going to continue on this gov track, 40 00:01:56,840 --> 00:01:59,107 I'm going to enroll in CS50, pass, fail, because it 41 00:01:59,107 --> 00:02:01,940 was going to take the edge off the course, give me a bit of freedom. 42 00:02:01,940 --> 00:02:04,250 And at the last day, literally the last moment, 43 00:02:04,250 --> 00:02:06,500 I ended up going to the registrar and filling out 44 00:02:06,500 --> 00:02:10,050 whatever paperwork was required to switch myself to a grade. 45 00:02:10,050 --> 00:02:13,820 And I ended up switching that winter to computer science as my major. 46 00:02:13,820 --> 00:02:16,340 And fast forward several years, I ended up 47 00:02:16,340 --> 00:02:19,040 in graduate school in computer science, and then of all things, 48 00:02:19,040 --> 00:02:20,510 I ended up, up here. 49 00:02:20,510 --> 00:02:23,810 And it is really a weird role reversal now 50 00:02:23,810 --> 00:02:27,830 to be up here, because it was precisely this course taught by a brilliant man, 51 00:02:27,830 --> 00:02:30,260 at the time, Brian Kernighan who was visiting, and is 52 00:02:30,260 --> 00:02:32,810 a pioneer in the world of computer science, that 53 00:02:32,810 --> 00:02:36,620 turned me on to computer science and actually got me 54 00:02:36,620 --> 00:02:37,620 into this kind of stuff. 55 00:02:37,620 --> 00:02:40,078 And then it's not to say that students who take this course 56 00:02:40,078 --> 00:02:42,290 all exit as computer science majors. 57 00:02:42,290 --> 00:02:47,630 The computer science majors among you are by far the minority in this course, 58 00:02:47,630 --> 00:02:50,280 in the single digits, maybe 10%. 59 00:02:50,280 --> 00:02:53,510 Most of the students in this course are, in fact, non majors. 60 00:02:53,510 --> 00:02:54,570 So why might that be? 61 00:02:54,570 --> 00:02:57,170 Well, you often hear whether it's in high school or college 62 00:02:57,170 --> 00:03:00,920 that this is one of those courses that teaches you how to think, 63 00:03:00,920 --> 00:03:02,130 problem-solving skills. 64 00:03:02,130 --> 00:03:02,880 But you know what? 65 00:03:02,880 --> 00:03:04,338 There's actually something to that. 66 00:03:04,338 --> 00:03:07,258 I can genuinely say, certainly as more and more years have passed 67 00:03:07,258 --> 00:03:09,800 and the more comfortable I've gotten with this kind of stuff, 68 00:03:09,800 --> 00:03:15,125 I absolutely approach life, dare say, a little more methodically 69 00:03:15,125 --> 00:03:17,000 or algorithmically, at least in terms of what 70 00:03:17,000 --> 00:03:20,378 goes on in my head when I'm thinking about some problem 71 00:03:20,378 --> 00:03:22,670 or I'm trying to give someone directions, for instance. 72 00:03:22,670 --> 00:03:24,350 I'm much more precise these days. 73 00:03:24,350 --> 00:03:26,480 But even more than that, and the fun side 74 00:03:26,480 --> 00:03:29,120 effect of courses like those in computer science, 75 00:03:29,120 --> 00:03:32,840 is that this computer that all of you have, either in your laps right now 76 00:03:32,840 --> 00:03:36,180 or on your desks at home, you, for the most part, 77 00:03:36,180 --> 00:03:40,160 use these computers in such a way that you can only do with them what 78 00:03:40,160 --> 00:03:42,590 someone else has empowered you to do. 79 00:03:42,590 --> 00:03:44,720 Whether it's Apple or Microsoft or whoever 80 00:03:44,720 --> 00:03:47,750 wrote some program that you're particularly a fan of. 81 00:03:47,750 --> 00:03:52,560 And so when you finally, though, take a course, like in computer science, CS50 82 00:03:52,560 --> 00:03:55,100 and actually learn how to program, it actually opens up 83 00:03:55,100 --> 00:03:59,820 some really interesting, geeky, but dare say fun opportunities. 84 00:03:59,820 --> 00:04:05,210 In fact, at the risk of living a little too long in the past, 85 00:04:05,210 --> 00:04:09,860 I thought I'd pull up one thing that I'm very proud of. 86 00:04:09,860 --> 00:04:12,488 And perhaps I've beaten this to-- 87 00:04:12,488 --> 00:04:14,780 I'm beating a dead horse for some number of years here. 88 00:04:14,780 --> 00:04:17,033 But when I was an undergrad, there really-- 89 00:04:17,033 --> 00:04:19,200 well, there was an internet, so I can't go that far, 90 00:04:19,200 --> 00:04:22,250 but there was no way of checking shuttle schedules at the time other 91 00:04:22,250 --> 00:04:24,180 than that printed piece of paper. 92 00:04:24,180 --> 00:04:26,420 And this was kind of a nuisance, of course, 93 00:04:26,420 --> 00:04:29,783 to have to pull up a piece of paper to find out where you can go on campus. 94 00:04:29,783 --> 00:04:31,700 And so at the time, students were really using 95 00:04:31,700 --> 00:04:35,387 what was called fas.harvard.edu, which still exists, but most of your friends 96 00:04:35,387 --> 00:04:37,220 who aren't in this room right now will never 97 00:04:37,220 --> 00:04:42,110 SSH to ffs.harvard.edu, so to speak, though you all soon will. 98 00:04:42,110 --> 00:04:47,908 But I wrote this program after taking 50 computer science 51, kind of on a whim. 99 00:04:47,908 --> 00:04:49,700 And that program was actually not this one, 100 00:04:49,700 --> 00:04:52,730 but it was this stupid program called Menu Boy. 101 00:04:52,730 --> 00:04:56,397 So at the time, back in the day, there was like 495 menu, 102 00:04:56,397 --> 00:04:57,980 which I don't know if it still exists. 103 00:04:57,980 --> 00:05:00,397 Perhaps one of you can try this later and see who you get. 104 00:05:00,397 --> 00:05:03,560 But it was this recorded voice from dining services that would tell you, 105 00:05:03,560 --> 00:05:06,743 it would recite to you every morning what was on the day's menus. 106 00:05:06,743 --> 00:05:08,660 And I'm like, all right, well Menu Man already 107 00:05:08,660 --> 00:05:10,077 exists so I went with me Menu Boy. 108 00:05:10,077 --> 00:05:13,750 And it was this Unix program that my pretty much, me, my roommate, 109 00:05:13,750 --> 00:05:16,840 and my other roommate could pull up on a computer in our dorm room 110 00:05:16,840 --> 00:05:18,760 and check what was on the dining hall menu. 111 00:05:18,760 --> 00:05:20,100 Well, mildly useful. 112 00:05:20,100 --> 00:05:22,600 That sort of evolved into what was called Weather Boy, which 113 00:05:22,600 --> 00:05:23,890 did as you might expect. 114 00:05:23,890 --> 00:05:26,320 That one was kind of a bust since we just 115 00:05:26,320 --> 00:05:29,750 used to look outside the window and Mather Tower and that was sufficient. 116 00:05:29,750 --> 00:05:33,010 So finally, I hit on, how about shuttle schedules? 117 00:05:33,010 --> 00:05:35,710 The irony being, I never actually took the shuttle myself. 118 00:05:35,710 --> 00:05:38,590 But long story short, I sat down with the printed shuttle schedule 119 00:05:38,590 --> 00:05:43,360 and I said, all right, I'm going to do this just because I can, and invented 120 00:05:43,360 --> 00:05:45,400 a program that I eventually ported to the web, 121 00:05:45,400 --> 00:05:48,520 but it still looked like this in a nutshell, as you might expect. 122 00:05:48,520 --> 00:05:50,980 You can, via a series of menus or shortcuts, 123 00:05:50,980 --> 00:05:54,100 say, all right, I'm in Memorial Hall, I want to go to the quad after this. 124 00:05:54,100 --> 00:05:55,090 Well, there we go. 125 00:05:55,090 --> 00:05:58,090 If you're already sick of this course, you can go in one minute's time 126 00:05:58,090 --> 00:05:59,950 and catch the shuttle out of here. 127 00:05:59,950 --> 00:06:02,350 And this thing updates itself every minute. 128 00:06:02,350 --> 00:06:07,030 So that's all fine and good, but not terribly sexy in 2007 and 2008. 129 00:06:07,030 --> 00:06:11,470 So the next evolution of this for me was not so much the web-based version, 130 00:06:11,470 --> 00:06:16,060 but was a version that actually allowed you to text message thing. 131 00:06:16,060 --> 00:06:17,810 So if you want to play along at home here, 132 00:06:17,810 --> 00:06:21,550 if you have a cell phone, if you dial 41-411. 133 00:06:21,550 --> 00:06:24,220 And then what you have to type is a text message as follows-- 134 00:06:24,220 --> 00:06:27,508 S boy, for Shuttle Boy, and then the first few letters of where you are 135 00:06:27,508 --> 00:06:28,550 and where you want to go. 136 00:06:28,550 --> 00:06:31,840 So mem quad for instance, is what I'll type in here. 137 00:06:31,840 --> 00:06:33,640 If you can actually see this here. 138 00:06:33,640 --> 00:06:35,890 S Boy mem quad, it's a little small. 139 00:06:35,890 --> 00:06:39,790 But if you go ahead then and hit send, if this program 140 00:06:39,790 --> 00:06:42,790 I wrote last year for CS50 has not actually 141 00:06:42,790 --> 00:06:46,330 broken in the past few minutes. 142 00:06:46,330 --> 00:06:48,770 Let's see. 143 00:06:48,770 --> 00:06:51,020 Whatever that is, we'll apparently tick the time away. 144 00:06:51,020 --> 00:06:53,670 145 00:06:53,670 --> 00:07:00,550 And oh, there we go. 146 00:07:00,550 --> 00:07:06,960 And apparently, if you can read this, there you go. 147 00:07:06,960 --> 00:07:11,700 S Boy says it's 1:21 and you can go mem hall to quad in 29 minutes at 1:50, 148 00:07:11,700 --> 00:07:13,890 so we apparently just missed that last shuttle bus. 149 00:07:13,890 --> 00:07:14,390 All right. 150 00:07:14,390 --> 00:07:17,010 So all fine and good, but come on, we can do better than this. 151 00:07:17,010 --> 00:07:20,910 And so just because I could and just because I had these skills finally 152 00:07:20,910 --> 00:07:23,400 and this, perhaps, disposition, I thought, you know what? 153 00:07:23,400 --> 00:07:26,310 There's so much freely available information out there now. 154 00:07:26,310 --> 00:07:28,350 The shuttle buses as of last year started 155 00:07:28,350 --> 00:07:32,610 having GPS transponders so that the shuttle services folks could track them 156 00:07:32,610 --> 00:07:33,310 on campus. 157 00:07:33,310 --> 00:07:35,060 And so I thought, you know what, I'm going 158 00:07:35,060 --> 00:07:38,340 to see if I can tap into that data feed, integrate it in mash up form 159 00:07:38,340 --> 00:07:41,760 with Google Maps, and late, one sad night, 160 00:07:41,760 --> 00:07:45,210 was born Shuttle Boy the GPS version. 161 00:07:45,210 --> 00:07:48,120 And I will be the first to admit, I still 162 00:07:48,120 --> 00:07:50,700 think it's the coolest thing that those red dots move 163 00:07:50,700 --> 00:07:52,740 as the shuttle buses move on campus. 164 00:07:52,740 --> 00:07:54,450 Now it's not perfect. 165 00:07:54,450 --> 00:07:56,875 So you'll quickly learn in this course what a bug is. 166 00:07:56,875 --> 00:07:59,250 And so for instance, if I actually zoom in on this, yeah, 167 00:07:59,250 --> 00:08:03,540 the shuttle is not right on Cambridge Common right now. 168 00:08:03,540 --> 00:08:06,990 So it's not quite perfect, but I was at least still 169 00:08:06,990 --> 00:08:08,820 kind of proud of that myself. 170 00:08:08,820 --> 00:08:12,240 So beyond these kinds of fun things that come by nature with the ability 171 00:08:12,240 --> 00:08:14,730 to program, I mean, you genuinely learn how to think 172 00:08:14,730 --> 00:08:16,830 and how to approach problems differently. 173 00:08:16,830 --> 00:08:19,890 Because a lot of what computer science is, it's not actually programming, 174 00:08:19,890 --> 00:08:22,038 even though I've taught entire courses in the past 175 00:08:22,038 --> 00:08:24,330 and we've surveyed students at the end of the semester, 176 00:08:24,330 --> 00:08:26,663 what did you get out of this course, what did you learn? 177 00:08:26,663 --> 00:08:28,680 And many of them in many courses have been-- 178 00:08:28,680 --> 00:08:31,500 I learned how to program in C, I learned how to program in Java, 179 00:08:31,500 --> 00:08:33,780 and that's fine, and that's true, and that's valuable, 180 00:08:33,780 --> 00:08:36,390 and that's interesting, but it's not necessarily everything. 181 00:08:36,390 --> 00:08:39,630 Because one of the more interesting aspects of a course like this 182 00:08:39,630 --> 00:08:42,730 is that in teaching you how to think differently, 183 00:08:42,730 --> 00:08:46,500 it opens you to the possibilities of solving problems more effectively, 184 00:08:46,500 --> 00:08:49,770 solving problems more efficiently, saving yourself time 185 00:08:49,770 --> 00:08:52,830 by actually writing software or making hardware 186 00:08:52,830 --> 00:08:57,810 that does things that would take a human much more time to solve on their own. 187 00:08:57,810 --> 00:09:02,205 So case in point, I thought maybe we could humor ourselves as follows. 188 00:09:02,205 --> 00:09:04,080 So a natural thing at the start of a semester 189 00:09:04,080 --> 00:09:06,000 is you've got to take attendance or you've got to take roll. 190 00:09:06,000 --> 00:09:07,625 So you start counting in the top right. 191 00:09:07,625 --> 00:09:11,250 One, two, three, four, five. 192 00:09:11,250 --> 00:09:13,750 All right, so we'll be here all day using this method. 193 00:09:13,750 --> 00:09:16,470 So what's a marginally better improvement on that? 194 00:09:16,470 --> 00:09:20,770 How could I count students in this room more quickly? 195 00:09:20,770 --> 00:09:22,840 Take a picture and do it later, sure. 196 00:09:22,840 --> 00:09:25,570 What else you got? 197 00:09:25,570 --> 00:09:27,100 What's that? 198 00:09:27,100 --> 00:09:28,292 So count them at the door. 199 00:09:28,292 --> 00:09:30,250 In retrospect, that too would have been better. 200 00:09:30,250 --> 00:09:32,110 What else? 201 00:09:32,110 --> 00:09:32,830 Something simple. 202 00:09:32,830 --> 00:09:35,250 Yeah? 203 00:09:35,250 --> 00:09:37,980 What's that? 204 00:09:37,980 --> 00:09:40,575 Oh, have everyone text a number and let my computer count. 205 00:09:40,575 --> 00:09:42,450 All right, so that's even more sophisticated. 206 00:09:42,450 --> 00:09:44,280 I'm going to go with what I learned in grade school 207 00:09:44,280 --> 00:09:45,990 and just count people two at once. 208 00:09:45,990 --> 00:09:49,530 So two, four, six, eight. 209 00:09:49,530 --> 00:09:50,550 Don't try too hard. 210 00:09:50,550 --> 00:09:53,820 I know, first day at Harvard here, but we don't need to go too far here. 211 00:09:53,820 --> 00:09:56,200 And incidentally, let's get this part out of the way. 212 00:09:56,200 --> 00:09:58,950 So this is a ridiculously large, if not intimidating room, 213 00:09:58,950 --> 00:10:00,870 and we have microphones set up down there. 214 00:10:00,870 --> 00:10:03,750 I'd much prefer if we can try to turn this course into something that 215 00:10:03,750 --> 00:10:06,420 is a bit chatty, that is a bit informal, because I can't even 216 00:10:06,420 --> 00:10:10,290 imagine the idea, of as a student, and even now as an adult, 217 00:10:10,290 --> 00:10:14,850 walking up to a microphone to admit to hundreds of people, 218 00:10:14,850 --> 00:10:17,790 so I'm kind of confused, I don't really know what you just said. 219 00:10:17,790 --> 00:10:20,490 I don't see these kinds of microphones working too well. 220 00:10:20,490 --> 00:10:22,530 You're welcome to use them, but let's see if we 221 00:10:22,530 --> 00:10:24,072 can do this a little more intimately. 222 00:10:24,072 --> 00:10:26,820 So my conclusion was I'm going to count people in two's. 223 00:10:26,820 --> 00:10:28,860 So two, four, six, eight. 224 00:10:28,860 --> 00:10:32,800 All right, so that's clearly better, because it's twice as fast. 225 00:10:32,800 --> 00:10:36,180 But if we think a little harder about this problem of counting students, 226 00:10:36,180 --> 00:10:38,270 can we do even better than that? 227 00:10:38,270 --> 00:10:40,020 I mean, wouldn't it be a really cool thing 228 00:10:40,020 --> 00:10:43,140 if instead of just doubling the speed with which 229 00:10:43,140 --> 00:10:48,000 we can count students, or equivalently, halving the amount of time 230 00:10:48,000 --> 00:10:49,170 it takes to do so. 231 00:10:49,170 --> 00:10:55,920 What if our algorithm, our approach, our method, not only started off faster, 232 00:10:55,920 --> 00:10:59,237 but as I went, it got faster and faster and faster? 233 00:10:59,237 --> 00:11:02,070 I mean, it'd be kind of neat if I could start counting in twos, then 234 00:11:02,070 --> 00:11:04,278 very quickly get comfortable with that start counting 235 00:11:04,278 --> 00:11:06,990 in fours, then maybe eights, then maybe sixteens, 236 00:11:06,990 --> 00:11:09,000 and eventually gets a little confusing. 237 00:11:09,000 --> 00:11:11,820 But if you could build up momentum like this, bam, 238 00:11:11,820 --> 00:11:14,910 we would be done counting students pretty darn fast. 239 00:11:14,910 --> 00:11:17,910 So in fact, I can't quite do that on my own fingers. 240 00:11:17,910 --> 00:11:22,530 So what I did was went ahead and put together an algorithm on paper here. 241 00:11:22,530 --> 00:11:26,190 Because there's this other opportunity in this room to solve this problem. 242 00:11:26,190 --> 00:11:30,090 We have not just me as the single brain or CPU in this room capable 243 00:11:30,090 --> 00:11:33,570 of independent thought, but we have a couple hundred of you here 244 00:11:33,570 --> 00:11:36,280 who can presumably be helping me out with this. 245 00:11:36,280 --> 00:11:39,400 And so allow me to ask two things. 246 00:11:39,400 --> 00:11:41,442 First-- this is also a very impersonal room, 247 00:11:41,442 --> 00:11:43,650 you probably don't know all of the people around you. 248 00:11:43,650 --> 00:11:46,170 So take a moment, right now, if you could, 249 00:11:46,170 --> 00:11:49,140 turn to the person on your left, to the right, say hello, 250 00:11:49,140 --> 00:11:52,607 house, concentration, all that stuff, and make a friend. 251 00:11:52,607 --> 00:11:56,086 [INTERPOSING VOICES] 252 00:11:56,086 --> 00:12:22,217 253 00:12:22,217 --> 00:12:23,175 DAVID MALAN: All right. 254 00:12:23,175 --> 00:12:26,830 255 00:12:26,830 --> 00:12:27,795 All right. 256 00:12:27,795 --> 00:12:31,270 257 00:12:31,270 --> 00:12:31,770 OK. 258 00:12:31,770 --> 00:12:36,300 259 00:12:36,300 --> 00:12:38,370 Yes, they're very interesting next to you. 260 00:12:38,370 --> 00:12:39,610 OK, now back here. 261 00:12:39,610 --> 00:12:40,110 All right. 262 00:12:40,110 --> 00:12:43,080 So you now have a friend, first of all, in computer science 50. 263 00:12:43,080 --> 00:12:45,540 Now it's going to get a little more awkward, again, 264 00:12:45,540 --> 00:12:48,660 for just a moment, because I need you all to humor me for a moment 265 00:12:48,660 --> 00:12:50,130 and please stand up. 266 00:12:50,130 --> 00:12:53,880 Step one, stand up if you would. 267 00:12:53,880 --> 00:12:56,580 So there are more of you than there are of me. 268 00:12:56,580 --> 00:12:58,980 You are all capable of counting, presumably, therefore 269 00:12:58,980 --> 00:13:01,753 you are capable of executing this computer program. 270 00:13:01,753 --> 00:13:02,920 It's pretty straightforward. 271 00:13:02,920 --> 00:13:05,550 It's only got five or so steps here. 272 00:13:05,550 --> 00:13:09,270 Four, if whoever standing in back doesn't move over to the side. 273 00:13:09,270 --> 00:13:10,320 Step one is stand up. 274 00:13:10,320 --> 00:13:14,517 Step two, think to yourself, I am the number one. 275 00:13:14,517 --> 00:13:16,350 It's probably not a stretch for some of you. 276 00:13:16,350 --> 00:13:18,930 All right. 277 00:13:18,930 --> 00:13:22,680 Step three, go ahead and pair up with someone standing near you, 278 00:13:22,680 --> 00:13:25,380 add your numbers together, take that sum as your new number. 279 00:13:25,380 --> 00:13:28,610 280 00:13:28,610 --> 00:13:29,900 A little sanity check. 281 00:13:29,900 --> 00:13:34,670 If you're following along correctly, everybody's now the number two. 282 00:13:34,670 --> 00:13:36,470 One of you should go ahead and sit down. 283 00:13:36,470 --> 00:13:49,570 284 00:13:49,570 --> 00:13:52,330 And repeat per these directions. 285 00:13:52,330 --> 00:14:02,190 286 00:14:02,190 --> 00:14:05,775 If you're standing awkwardly, look for someone you can pair up with. 287 00:14:05,775 --> 00:14:24,760 288 00:14:24,760 --> 00:14:26,725 Should be just a couple of people standing. 289 00:14:26,725 --> 00:14:40,490 290 00:14:40,490 --> 00:14:42,420 A couple people left. 291 00:14:42,420 --> 00:14:49,350 292 00:14:49,350 --> 00:14:50,105 Almost there. 293 00:14:50,105 --> 00:15:00,512 294 00:15:00,512 --> 00:15:01,220 What did you get? 295 00:15:01,220 --> 00:15:05,940 296 00:15:05,940 --> 00:15:06,510 All right. 297 00:15:06,510 --> 00:15:11,440 There should be just one awkward person standing before long. 298 00:15:11,440 --> 00:15:11,940 All right. 299 00:15:11,940 --> 00:15:15,255 These guys are using paper and pencil, that is not very Harvard. 300 00:15:15,255 --> 00:15:17,910 301 00:15:17,910 --> 00:15:19,830 That's OK. 302 00:15:19,830 --> 00:15:20,850 Just kidding. 303 00:15:20,850 --> 00:15:22,745 I'd be doing it, too. 304 00:15:22,745 --> 00:15:23,370 What do we got? 305 00:15:23,370 --> 00:15:24,325 One here, one here. 306 00:15:24,325 --> 00:15:25,950 We need a couple of people to pair off. 307 00:15:25,950 --> 00:15:27,040 One here. 308 00:15:27,040 --> 00:15:27,660 Three. 309 00:15:27,660 --> 00:15:28,350 There's three of you. 310 00:15:28,350 --> 00:15:29,642 All right, combine two numbers. 311 00:15:29,642 --> 00:15:32,755 312 00:15:32,755 --> 00:15:33,255 72. 313 00:15:33,255 --> 00:15:37,160 314 00:15:37,160 --> 00:15:38,540 Oh, OK. 315 00:15:38,540 --> 00:15:40,310 And? 316 00:15:40,310 --> 00:15:41,660 113. 317 00:15:41,660 --> 00:15:43,460 So what's that? 318 00:15:43,460 --> 00:15:44,540 Oh, and 119. 319 00:15:44,540 --> 00:15:45,290 So what do we got? 320 00:15:45,290 --> 00:15:46,850 What's the total. 321 00:15:46,850 --> 00:15:50,270 I'm not going to embarrass myself in doing it up here. 322 00:15:50,270 --> 00:15:52,310 What's our total? 323 00:15:52,310 --> 00:15:53,240 What's the total? 324 00:15:53,240 --> 00:16:01,110 325 00:16:01,110 --> 00:16:03,180 What's that? 326 00:16:03,180 --> 00:16:06,510 So the total comes to-- thanks to our diligent teaching staff-- 327 00:16:06,510 --> 00:16:09,690 399. 328 00:16:09,690 --> 00:16:11,310 So close to 400. 329 00:16:11,310 --> 00:16:16,260 And that probably took less time than it would-- 330 00:16:16,260 --> 00:16:17,019 oh. 331 00:16:17,019 --> 00:16:20,442 [APPLAUSE] 332 00:16:20,442 --> 00:16:28,760 333 00:16:28,760 --> 00:16:30,830 400 it is. 334 00:16:30,830 --> 00:16:34,080 So what can we take away from that? 335 00:16:34,080 --> 00:16:35,940 Well, how many steps did that take? 336 00:16:35,940 --> 00:16:39,830 Well, granted, each of these steps is like one big step. 337 00:16:39,830 --> 00:16:41,270 It's kind of like one iteration. 338 00:16:41,270 --> 00:16:45,260 You went through the process of finding someone, pairing up, taking on the sum 339 00:16:45,260 --> 00:16:46,590 and then sitting down. 340 00:16:46,590 --> 00:16:49,520 So if we group that together, conceptually, it's just one step. 341 00:16:49,520 --> 00:16:52,640 Let's ask ourselves, how many such steps were there? 342 00:16:52,640 --> 00:16:56,015 Well, maybe we can answer this by building from the ground up. 343 00:16:56,015 --> 00:16:57,890 This is Excel, I'm just going to use it to do 344 00:16:57,890 --> 00:16:59,670 some simple graphing for a moment. 345 00:16:59,670 --> 00:17:01,610 So if there's two of you, it really only would 346 00:17:01,610 --> 00:17:05,450 have taken one such step, one such loop or iteration, 347 00:17:05,450 --> 00:17:09,170 because the two people pair up, one sits down, done, so one step. 348 00:17:09,170 --> 00:17:11,900 If instead, though, there were, say, four of you, 349 00:17:11,900 --> 00:17:15,349 well, that too would still only take not four steps, but just 350 00:17:15,349 --> 00:17:19,710 two steps, because four people would pair, the two pairs would pair, done. 351 00:17:19,710 --> 00:17:21,390 So just a couple steps there. 352 00:17:21,390 --> 00:17:23,450 So if this number then increases-- so I'm 353 00:17:23,450 --> 00:17:26,150 going to do a little formula just to save myself some time here. 354 00:17:26,150 --> 00:17:30,230 If this pattern increases or continues along these lines-- 355 00:17:30,230 --> 00:17:34,410 whoops-- what just happened? 356 00:17:34,410 --> 00:17:41,160 If this pattern continues along these lines where this is A three times two, 357 00:17:41,160 --> 00:17:42,060 all right. 358 00:17:42,060 --> 00:17:44,000 Let's copy that. 359 00:17:44,000 --> 00:17:45,150 Paste there. 360 00:17:45,150 --> 00:17:45,900 There we go. 361 00:17:45,900 --> 00:17:48,782 So if that pattern continues, but in the right hand column, 362 00:17:48,782 --> 00:17:50,990 this just takes us one step, this takes us two steps, 363 00:17:50,990 --> 00:17:52,470 this takes us three steps. 364 00:17:52,470 --> 00:17:59,450 So this takes us, A three plus one and B three plus one, 365 00:17:59,450 --> 00:18:00,880 that pattern continues as follows. 366 00:18:00,880 --> 00:18:04,130 So in the left hand column we've got how many students there are, potentially, 367 00:18:04,130 --> 00:18:06,600 the right hand column, the total number of steps. 368 00:18:06,600 --> 00:18:07,820 And this is kind of powerful. 369 00:18:07,820 --> 00:18:08,690 I mean, look at what it's saying. 370 00:18:08,690 --> 00:18:11,030 If we've got roughly 400 students, so somewhere 371 00:18:11,030 --> 00:18:14,720 between 256 and 512 students, that only took-- 372 00:18:14,720 --> 00:18:19,820 felt like longer-- but eight steps, eight such iterations, maybe nine. 373 00:18:19,820 --> 00:18:22,970 Well, let's take a look at what this actually feels like in the long run. 374 00:18:22,970 --> 00:18:25,970 If I just quickly grab these numbers-- and this is not the kind of stuff 375 00:18:25,970 --> 00:18:28,910 we'll be doing in this course, using things like word and Excel, 376 00:18:28,910 --> 00:18:31,250 but it's useful just to illustrate this for a moment. 377 00:18:31,250 --> 00:18:34,130 I'm going to produce one of these little plots, new sheet, 378 00:18:34,130 --> 00:18:35,870 just to show you what this looks like. 379 00:18:35,870 --> 00:18:39,200 And what we have on the x-axis here is number of students, 380 00:18:39,200 --> 00:18:42,290 on the y-axis, the total number of loops or iterations. 381 00:18:42,290 --> 00:18:43,520 Notice what happens. 382 00:18:43,520 --> 00:18:46,070 Like, it kind of takes a long time for-- 383 00:18:46,070 --> 00:18:49,070 relatively speaking-- for small groups of students. 384 00:18:49,070 --> 00:18:51,680 But look at what happens in the long run. 385 00:18:51,680 --> 00:18:55,490 It feels like this algorithm, this approach, this divide 386 00:18:55,490 --> 00:18:58,640 and conquer strategy seems to gain speed. 387 00:18:58,640 --> 00:19:01,850 The bigger the problem gets, the more effective the algorithm becomes. 388 00:19:01,850 --> 00:19:05,900 If we're out at say four billion students-- 389 00:19:05,900 --> 00:19:08,780 that's a big room-- so four billion students. 390 00:19:08,780 --> 00:19:12,590 How many steps does it take to actually implement this algorithm? 391 00:19:12,590 --> 00:19:13,730 32. 392 00:19:13,730 --> 00:19:19,070 There's only 32 such steps to count four billion students, logistical issues 393 00:19:19,070 --> 00:19:19,850 aside. 394 00:19:19,850 --> 00:19:22,700 Well, let's see if we can't make this a little more concrete. 395 00:19:22,700 --> 00:19:25,250 I don't really like to reuse material, but this one 396 00:19:25,250 --> 00:19:27,255 seemed to be a popular one last year. 397 00:19:27,255 --> 00:19:28,880 This is a pretty big phone book, right? 398 00:19:28,880 --> 00:19:31,070 It's a few thousand pages. 399 00:19:31,070 --> 00:19:35,205 And this lends itself to this same thinking, the same divide 400 00:19:35,205 --> 00:19:36,080 and conquer approach. 401 00:19:36,080 --> 00:19:39,560 Suppose that I wanted to look up Drew Foust-- so 402 00:19:39,560 --> 00:19:41,330 [INAUDIBLE] Foust in this phone book. 403 00:19:41,330 --> 00:19:43,070 Granted, it's the yellow pages, just she's probably not there. 404 00:19:43,070 --> 00:19:44,695 But we'll pretend it's the White pages. 405 00:19:44,695 --> 00:19:48,380 How would you, as a fairly intelligent human being, 406 00:19:48,380 --> 00:19:52,610 go about finding someone like Drew Faust in the book here? 407 00:19:52,610 --> 00:19:53,990 Yes? 408 00:19:53,990 --> 00:19:54,680 What's that? 409 00:19:54,680 --> 00:19:55,790 Oh, page one. 410 00:19:55,790 --> 00:19:57,750 We're definitely going with the semi approach. 411 00:19:57,750 --> 00:20:00,410 So page one, we have the A's. 412 00:20:00,410 --> 00:20:02,090 Page two, still the A's. 413 00:20:02,090 --> 00:20:03,830 Page three, and dot, dot, dot. 414 00:20:03,830 --> 00:20:07,220 So right, the worst case scenario there, whoever I'm looking for 415 00:20:07,220 --> 00:20:10,460 might actually be at the end of the phone book, certainly not on page one, 416 00:20:10,460 --> 00:20:12,740 and that's going to take a good number of steps. 417 00:20:12,740 --> 00:20:16,670 Probably a slightly more clever person is going to do what? 418 00:20:16,670 --> 00:20:19,323 419 00:20:19,323 --> 00:20:21,490 Right, you're going to probably start in the middle, 420 00:20:21,490 --> 00:20:24,100 if only because it's easy to open a phone book to the middle. 421 00:20:24,100 --> 00:20:26,387 You're going to glance, it and be like, oh, M happened 422 00:20:26,387 --> 00:20:27,970 to be in the middle of the phone book. 423 00:20:27,970 --> 00:20:29,870 Well, what am I going to do next? 424 00:20:29,870 --> 00:20:33,257 Well, I already know that this was a pretty big problem a moment ago. 425 00:20:33,257 --> 00:20:35,590 But I already know that Drew is going to be to the left. 426 00:20:35,590 --> 00:20:39,283 I'm at the M's, which means she's not going to be over here. 427 00:20:39,283 --> 00:20:41,200 And this is why everyone liked this last year. 428 00:20:41,200 --> 00:20:46,580 So we can literally throw away half of the problem. 429 00:20:46,580 --> 00:20:47,710 And now it's half as big. 430 00:20:47,710 --> 00:20:48,830 Well, what do we do next? 431 00:20:48,830 --> 00:20:53,240 Well, we can resort to that page flipping approach, or we can repeat, 432 00:20:53,240 --> 00:20:55,540 we can recurse and do the same thing again. 433 00:20:55,540 --> 00:20:59,050 Smack dab into the middle here, I happened to end up at-- 434 00:20:59,050 --> 00:21:02,650 freebee-- we happen to end up in the middle here, this is the Cs. 435 00:21:02,650 --> 00:21:06,280 So yet again, I can literally take a bite out 436 00:21:06,280 --> 00:21:09,880 of this problem equal to half of its current size, throw it away. 437 00:21:09,880 --> 00:21:12,520 And in just two steps, we've halved and then halved-- 438 00:21:12,520 --> 00:21:15,200 which mean quartered the size of this problem. 439 00:21:15,200 --> 00:21:17,380 So now extrapolate to some of the data here. 440 00:21:17,380 --> 00:21:19,540 If that phone book were actually ridiculously 441 00:21:19,540 --> 00:21:23,890 large with four billion entries, four billion pages, 442 00:21:23,890 --> 00:21:28,000 how many times am I going to split and throw half of the phone book away? 443 00:21:28,000 --> 00:21:29,560 Only 32 times. 444 00:21:29,560 --> 00:21:33,800 What if there are not four billion, but eight billion people in that phone 445 00:21:33,800 --> 00:21:34,300 book? 446 00:21:34,300 --> 00:21:35,930 Eight billion pages. 447 00:21:35,930 --> 00:21:38,930 Well, 33 steps. 448 00:21:38,930 --> 00:21:40,570 And that's a really powerful thing. 449 00:21:40,570 --> 00:21:43,690 And that just hints at the types of design problems 450 00:21:43,690 --> 00:21:48,460 that come up in computer science and the types of work that ultimately come out, 451 00:21:48,460 --> 00:21:50,140 as we'll see, the course's problem sets. 452 00:21:50,140 --> 00:21:55,070 Now it's not all serious and focused on clever approaches. 453 00:21:55,070 --> 00:21:58,330 So we have made a conscious decision this semester 454 00:21:58,330 --> 00:22:04,310 to introduce as much geek culture to Harvard as possible. 455 00:22:04,310 --> 00:22:07,414 [APPLAUSE] 456 00:22:07,414 --> 00:22:09,940 457 00:22:09,940 --> 00:22:14,340 Josiah Quincy and James Otis would be so pleased to be next to this right now. 458 00:22:14,340 --> 00:22:19,130 So it all began, of course, 10 years ago when Shuttle Boy entered the Harvard 459 00:22:19,130 --> 00:22:19,770 lexicon. 460 00:22:19,770 --> 00:22:24,710 Now we're going to try to push some lolcats onto the community here. 461 00:22:24,710 --> 00:22:27,350 I'll refer you to Wikipedia for more of a backdrop here. 462 00:22:27,350 --> 00:22:30,008 But just in the spirit of this same, you know 463 00:22:30,008 --> 00:22:33,050 what, I'm going to do something just because it's neat, just because it's 464 00:22:33,050 --> 00:22:34,370 fun, just because I can. 465 00:22:34,370 --> 00:22:37,460 And along the way, I'm sure I'll encounter some interesting problems. 466 00:22:37,460 --> 00:22:41,720 I, in a moment, or in an hour of severe procrastination last night, 467 00:22:41,720 --> 00:22:45,350 decided what our website needs in the course is a lolcat of the day. 468 00:22:45,350 --> 00:22:49,010 So this didn't exist last year and this didn't exist on Saturday. 469 00:22:49,010 --> 00:22:52,580 But I decided, who's not going to click on the lolcat? 470 00:22:52,580 --> 00:22:57,950 And I will argue, I will put forth, that I bet a non-trivial number of you 471 00:22:57,950 --> 00:23:00,830 make a habit, every time you start pulling up the course's website, 472 00:23:00,830 --> 00:23:04,130 you're going to click on that link, even though it really does nothing other 473 00:23:04,130 --> 00:23:05,270 than show you, right? 474 00:23:05,270 --> 00:23:08,450 475 00:23:08,450 --> 00:23:10,820 So stupid. 476 00:23:10,820 --> 00:23:12,210 But how did I do this? 477 00:23:12,210 --> 00:23:15,290 Well, I asked a friend of mine, all right, where can I get lolcats? 478 00:23:15,290 --> 00:23:18,680 Well, it turns out that one of these sources, the canonical source, 479 00:23:18,680 --> 00:23:23,030 is icanhascheezburger.com. 480 00:23:23,030 --> 00:23:27,530 So that led me to this website here, which, if you really have a lot of time 481 00:23:27,530 --> 00:23:29,510 to kill, you can search through-- let's see 482 00:23:29,510 --> 00:23:32,690 if we go to the bottom, the 90 to infinity 483 00:23:32,690 --> 00:23:35,730 and beyond pages that have been posted here over time. 484 00:23:35,730 --> 00:23:38,540 But what I noticed, what caught my eye at the top of this page 485 00:23:38,540 --> 00:23:39,800 is this little thing here. 486 00:23:39,800 --> 00:23:41,633 So subscribe to an RSS feed. 487 00:23:41,633 --> 00:23:44,300 Now this is something some of you might already use, some of you 488 00:23:44,300 --> 00:23:47,540 might have at least seen this icon, even on cnn.com, New York Times, 489 00:23:47,540 --> 00:23:49,520 reputable sites, it's not all geekery. 490 00:23:49,520 --> 00:23:53,060 And long story short, what an RSS feed is just a big text 491 00:23:53,060 --> 00:23:57,108 file, an XML file, similar in spirit to HTML, 492 00:23:57,108 --> 00:23:59,900 which is something we'll use later in the course to make web pages. 493 00:23:59,900 --> 00:24:03,170 And inside this big text file, it's just a lot of links. 494 00:24:03,170 --> 00:24:08,178 Links to the current lolcat of the day, links to yesterday's lolcat 495 00:24:08,178 --> 00:24:08,720 and so forth. 496 00:24:08,720 --> 00:24:10,428 And I realized, you know what, if there's 497 00:24:10,428 --> 00:24:14,120 this feed that the website itself lets people subscribe to, 498 00:24:14,120 --> 00:24:17,420 well, maybe I can write a little program that just downloads that feed 499 00:24:17,420 --> 00:24:21,260 downloads, simulating a user clicking that link, 500 00:24:21,260 --> 00:24:25,634 analyzes all of that text looking for URLs, things like http, colon, 501 00:24:25,634 --> 00:24:29,150 slash, slash, grab that image and then embed it 502 00:24:29,150 --> 00:24:31,760 into our own website, along with a couple of more links, 503 00:24:31,760 --> 00:24:34,190 so it then links back to the original page. 504 00:24:34,190 --> 00:24:38,600 And long story short, that's all it took, was an idea and-- 505 00:24:38,600 --> 00:24:40,910 make it really juicy-- 506 00:24:40,910 --> 00:24:43,640 an idea and the means to actually implement it. 507 00:24:43,640 --> 00:24:46,520 And thus was born lolcat of the day. 508 00:24:46,520 --> 00:24:50,700 So more of those on an increasingly frequent basis. 509 00:24:50,700 --> 00:24:52,860 So who is in this class? 510 00:24:52,860 --> 00:24:56,120 So there has been, for years, a misconception, for instance, 511 00:24:56,120 --> 00:24:59,840 that the course is filled only with those more comfortable, so to speak. 512 00:24:59,840 --> 00:25:02,720 We adopted these euphemistic labels last year 513 00:25:02,720 --> 00:25:05,120 to refer to those students who were, quite matter 514 00:25:05,120 --> 00:25:08,570 of factly, less comfortable in a course like this with computers, 515 00:25:08,570 --> 00:25:11,810 with the internet, with the idea of even being in a computer science course. 516 00:25:11,810 --> 00:25:15,170 Then we labeled the opposite, which were those more comfortable. 517 00:25:15,170 --> 00:25:18,770 Students, like many among you, who've taken AP computer science, who, 518 00:25:18,770 --> 00:25:22,040 like me, grew up with computers and have been raring to go 519 00:25:22,040 --> 00:25:24,290 with an actual computer science degree. 520 00:25:24,290 --> 00:25:27,350 And then there's many of you who are somewhere in between. 521 00:25:27,350 --> 00:25:30,750 And being computer scientists, we like to collect data, analyze data, 522 00:25:30,750 --> 00:25:34,283 and then actually bolster our conjectures with actual numbers. 523 00:25:34,283 --> 00:25:34,950 And here you go. 524 00:25:34,950 --> 00:25:38,930 So as of last fall, 2007, the percentages of students in the course 525 00:25:38,930 --> 00:25:40,370 roughly broke down as follows. 526 00:25:40,370 --> 00:25:44,990 30%, certainly non-negligible, describe themselves as less comfortable, 527 00:25:44,990 --> 00:25:48,320 the sort who during shopping period were not coming back Wednesday. 528 00:25:48,320 --> 00:25:50,780 But fortunately, 30% of them did. 529 00:25:50,780 --> 00:25:53,670 I'm among those more comfortable, 20%. 530 00:25:53,670 --> 00:25:57,230 So also non-trivial, but certainly not even close to a majority 531 00:25:57,230 --> 00:26:00,620 of the students in the class, because the majority really is made up of about 532 00:26:00,620 --> 00:26:01,230 half-- 533 00:26:01,230 --> 00:26:04,673 a majority of the class is made up of people who are somewhere in between. 534 00:26:04,673 --> 00:26:07,340 Certainly not the least comfortable, certainly not the savviest, 535 00:26:07,340 --> 00:26:11,450 but they're somewhere in between the two, 536 00:26:11,450 --> 00:26:14,400 and we suspect that those numbers would play out the same. 537 00:26:14,400 --> 00:26:17,570 So those of you who are feeling a little less comfortable, 538 00:26:17,570 --> 00:26:20,120 I thought I'd try to put you at ease, even before we 539 00:26:20,120 --> 00:26:21,870 dive into things more sophisticated. 540 00:26:21,870 --> 00:26:24,350 This, of course, if you know, is Senator Ted Stevens 541 00:26:24,350 --> 00:26:26,510 of Alaska, who had the misfortune of being 542 00:26:26,510 --> 00:26:28,520 lampooned by Jon Stewart and the likes. 543 00:26:28,520 --> 00:26:35,090 A couple of years ago when he was quoted during a very, very boisterous speech 544 00:26:35,090 --> 00:26:37,755 about things related to the internet. 545 00:26:37,755 --> 00:26:40,130 So what I thought we'd do is sort of establish a baseline 546 00:26:40,130 --> 00:26:43,730 as to what it means to really be less comfortable, because I think that will 547 00:26:43,730 --> 00:26:46,040 perhaps put a few of you at ease. 548 00:26:46,040 --> 00:26:46,940 So let me grab this. 549 00:26:46,940 --> 00:26:48,740 It's about a three-minute clip. 550 00:26:48,740 --> 00:26:52,590 Let's go ahead and pull up the following. 551 00:26:52,590 --> 00:26:57,480 552 00:26:57,480 --> 00:26:58,620 [VIDEO PLAYBACK] 553 00:26:58,620 --> 00:27:02,685 - Oh, we got a bombshell for you tonight. 554 00:27:02,685 --> 00:27:04,180 Oh, I am delighted, here. 555 00:27:04,180 --> 00:27:07,520 556 00:27:07,520 --> 00:27:09,110 Today's show is a good one. 557 00:27:09,110 --> 00:27:12,510 Shawn Wayans, Shawn Wayans will be joining us. 558 00:27:12,510 --> 00:27:14,753 We're very excited about that. 559 00:27:14,753 --> 00:27:17,670 But I want to talk to you about this exciting thing I have discovered. 560 00:27:17,670 --> 00:27:19,020 I want to talk to you tonight about the internet. 561 00:27:19,020 --> 00:27:20,320 I'm going out on a limb here. 562 00:27:20,320 --> 00:27:22,737 I'm going to stand up and be one of the first guys to say, 563 00:27:22,737 --> 00:27:25,490 I think this is a keeper. 564 00:27:25,490 --> 00:27:26,960 I think this thing is here to say. 565 00:27:26,960 --> 00:27:29,900 Right now, two key internet related issues 566 00:27:29,900 --> 00:27:31,610 are making the rounds in Washington DC. 567 00:27:31,610 --> 00:27:34,190 One involves the Net Neutrality Act, which 568 00:27:34,190 --> 00:27:36,830 would allow larger, more powerful corporations higher speed 569 00:27:36,830 --> 00:27:40,833 access to customers, establishing a two tiered hierarchy amongst-- 570 00:27:40,833 --> 00:27:42,500 you know what, it's awfully complicated. 571 00:27:42,500 --> 00:27:45,920 Why don't I let an expert, say the head of the Senate Commerce Committee, which 572 00:27:45,920 --> 00:27:48,950 regulates e-commerce, explain. 573 00:27:48,950 --> 00:27:52,280 - The internet is not something that you just dump something on. 574 00:27:52,280 --> 00:27:53,330 It's not a big truck. 575 00:27:53,330 --> 00:27:54,920 It's a series of tubes. 576 00:27:54,920 --> 00:27:57,818 577 00:27:57,818 --> 00:28:01,199 [APPLAUSE] 578 00:28:01,199 --> 00:28:05,080 579 00:28:05,080 --> 00:28:09,280 - All right, that might have sounded more like something you'd hear from, 580 00:28:09,280 --> 00:28:13,135 let's say, a crazy old man in an airport bar at 3:00 AM. 581 00:28:13,135 --> 00:28:15,770 582 00:28:15,770 --> 00:28:19,670 Then the chairman of the Senate Commerce Committee. 583 00:28:19,670 --> 00:28:23,210 I'm sorry, sir, I don't quite think I understand your dump truck tube 584 00:28:23,210 --> 00:28:25,040 symposium. 585 00:28:25,040 --> 00:28:27,560 Do you have something a little more practical for me? 586 00:28:27,560 --> 00:28:30,080 - And if don't understand those tubes can be filled, 587 00:28:30,080 --> 00:28:33,260 and if they're filled, when you put your message in, it gets in line, 588 00:28:33,260 --> 00:28:35,990 it's going to be delayed by anyone who puts in that tube 589 00:28:35,990 --> 00:28:39,873 enormous amounts of material, enormous amounts of material. 590 00:28:39,873 --> 00:28:41,165 - And there you have it, folks. 591 00:28:41,165 --> 00:28:49,740 There's apparently-- there's apparently an enormous amount of material clogging 592 00:28:49,740 --> 00:28:52,790 Ted Stevens tubes. 593 00:28:52,790 --> 00:28:58,010 Perhaps a little fiber optic cable might be the answer. 594 00:28:58,010 --> 00:29:02,150 Stevens ended his lecture by offering a concrete example 595 00:29:02,150 --> 00:29:04,800 of the problem we face. 596 00:29:04,800 --> 00:29:08,160 - Ten movies streaming across the internet, and what 597 00:29:08,160 --> 00:29:10,890 happens to your own personal internet? 598 00:29:10,890 --> 00:29:14,720 I-- just the other day got internet was set by my staff at 10 o'clock 599 00:29:14,720 --> 00:29:17,740 in morning on Friday, I got it yesterday. 600 00:29:17,740 --> 00:29:18,240 Why? 601 00:29:18,240 --> 00:29:21,710 602 00:29:21,710 --> 00:29:26,280 - I'll tell you why, because the creek run dry is what happened. 603 00:29:26,280 --> 00:29:28,740 And there's Comanches in the [INAUDIBLE].. 604 00:29:28,740 --> 00:29:31,470 And the women of the internet. 605 00:29:31,470 --> 00:29:34,310 Actually, why didn't Senator Stevens get it until yesterday? 606 00:29:34,310 --> 00:29:36,310 Well, this is just a little bit of a guess here, 607 00:29:36,310 --> 00:29:39,660 but maybe it's because you don't seem to know jack 608 00:29:39,660 --> 00:29:42,120 about computers or the internet. 609 00:29:42,120 --> 00:29:44,070 That's OK, that's OK. 610 00:29:44,070 --> 00:29:51,737 You're just the guy in charge of regulating it. 611 00:29:51,737 --> 00:29:52,320 [END PLAYBACK] 612 00:29:52,320 --> 00:29:54,870 DAVID MALAN: So the segue there is if you 613 00:29:54,870 --> 00:29:58,200 are feeling that you don't know jack about computers and the internet, 614 00:29:58,200 --> 00:30:01,620 there's clearly people out there who know just a little bit less. 615 00:30:01,620 --> 00:30:05,580 And we make this promise now that we will not publicly lambast you 616 00:30:05,580 --> 00:30:08,520 as John did to Ted Stevens there. 617 00:30:08,520 --> 00:30:11,470 In fact, where are people really coming from who take this course? 618 00:30:11,470 --> 00:30:15,360 So almost half of the students who took this course last year 619 00:30:15,360 --> 00:30:18,660 had no prior programming experience, 43%. 620 00:30:18,660 --> 00:30:20,830 About the same number had a little experience, 621 00:30:20,830 --> 00:30:23,860 whether it was a programming class or having tinkered or not. 622 00:30:23,860 --> 00:30:27,450 And then there was only 10% of the class who had, quote unquote, a lot. 623 00:30:27,450 --> 00:30:29,970 Who maybe took not only AP computer science, 624 00:30:29,970 --> 00:30:34,620 but maybe taught AP computer science, or simply was certainly among even those 625 00:30:34,620 --> 00:30:37,860 I sort of made fun of back in high school. 626 00:30:37,860 --> 00:30:40,840 This, though, there's one other data point 627 00:30:40,840 --> 00:30:42,520 we'd like to share as well, so gender. 628 00:30:42,520 --> 00:30:45,900 So these were the numbers-- 629 00:30:45,900 --> 00:30:47,520 well, it's funny. 630 00:30:47,520 --> 00:30:50,190 So these were the numbers last year, and I would actually 631 00:30:50,190 --> 00:30:53,970 put forth that these are actually higher than they have been in years past. 632 00:30:53,970 --> 00:30:57,480 And long story short, I don't know why there's this discrepancy, because it's 633 00:30:57,480 --> 00:30:59,700 certainly not something that has just arisen, 634 00:30:59,700 --> 00:31:02,677 but it's sort of been with computer science departments for some time. 635 00:31:02,677 --> 00:31:05,760 We chatted with former female students in the course, some of the teaching 636 00:31:05,760 --> 00:31:09,690 fellows, and there's certainly perhaps some societal trends at play here. 637 00:31:09,690 --> 00:31:12,870 I think it's probably fair to say that it's not the case that guys 638 00:31:12,870 --> 00:31:17,460 are better at computer science, we've heard arguments 639 00:31:17,460 --> 00:31:18,900 like that put forth before. 640 00:31:18,900 --> 00:31:21,090 So I don't know, but I can say that we, as a course, 641 00:31:21,090 --> 00:31:24,420 will at least try to do our part to at least take a bigger bite out 642 00:31:24,420 --> 00:31:26,820 of the larger slice there to see if we can't 643 00:31:26,820 --> 00:31:28,680 try to equalize these numbers somewhat. 644 00:31:28,680 --> 00:31:31,380 So whether you're male or female, know, incidentally, 645 00:31:31,380 --> 00:31:33,885 that this Monday, today, and this afternoon, this Wednesday 646 00:31:33,885 --> 00:31:37,010 and Thursday, we're going to be having some of these very casual, should I, 647 00:31:37,010 --> 00:31:37,600 sessions. 648 00:31:37,600 --> 00:31:41,550 So if you ultimately exit this course later this afternoon thinking, 649 00:31:41,550 --> 00:31:43,710 I'm still not sure if this is for me, I'm still not 650 00:31:43,710 --> 00:31:46,210 sure if I can fit this in, or really whatever your questions 651 00:31:46,210 --> 00:31:49,140 are concerns are, the teaching fellows will be holding some casual Q&A 652 00:31:49,140 --> 00:31:51,510 sessions at these particular times. 653 00:31:51,510 --> 00:31:55,140 And you can, of course, if you're feeling a little uncomfortable even 654 00:31:55,140 --> 00:31:57,300 beyond those, you can send me an internet 655 00:31:57,300 --> 00:32:00,250 and we can talk more one-on-one. 656 00:32:00,250 --> 00:32:03,060 So let's see if we can't now begin to level the playing field, just 657 00:32:03,060 --> 00:32:03,602 a little bit. 658 00:32:03,602 --> 00:32:06,480 Even if you don't know jack about computers and the internet, 659 00:32:06,480 --> 00:32:10,260 you probably at least heard that the basic building blocks that run them are 660 00:32:10,260 --> 00:32:13,960 bits, are the binary system, are zeros and one's. 661 00:32:13,960 --> 00:32:16,060 So what does this mean and who cares? 662 00:32:16,060 --> 00:32:17,350 Why is this useful? 663 00:32:17,350 --> 00:32:20,010 Well, the easiest way to think about these basic building 664 00:32:20,010 --> 00:32:23,910 blocks of computers is like little light bulbs or little state 665 00:32:23,910 --> 00:32:25,680 machines that can either be on or off. 666 00:32:25,680 --> 00:32:28,350 Here, for instance, is an off light bulb, back in the day, 667 00:32:28,350 --> 00:32:30,360 when it was easier to turn the room's lights off 668 00:32:30,360 --> 00:32:32,910 we would just turn the lights off and say zero, turn the lights on and say 669 00:32:32,910 --> 00:32:33,568 one. 670 00:32:33,568 --> 00:32:35,610 Doesn't really work well in this particular room, 671 00:32:35,610 --> 00:32:38,310 so assume that this is our light bulb representing zero, 672 00:32:38,310 --> 00:32:40,830 this is a light bulb that's on, representing a one. 673 00:32:40,830 --> 00:32:43,950 Zero, one, off, on. 674 00:32:43,950 --> 00:32:46,200 So if you now have this ability to distinguish 675 00:32:46,200 --> 00:32:49,275 between two states, so to speak, the something that's on, 676 00:32:49,275 --> 00:32:51,900 something that's off, which certainly you can implement clearly 677 00:32:51,900 --> 00:32:54,180 with electricity, just by using something as simple 678 00:32:54,180 --> 00:32:57,533 as a light bulb or tinier like a transistor or a capacitor, 679 00:32:57,533 --> 00:32:59,700 if you're familiar with such terms, you can actually 680 00:32:59,700 --> 00:33:01,930 use these as basic building blocks. 681 00:33:01,930 --> 00:33:05,700 So how can you actually use just zeros and ones 682 00:33:05,700 --> 00:33:08,970 to do everything that that computer is capable of, whether it's 683 00:33:08,970 --> 00:33:11,250 sending instant messages, whether it's sending emails, 684 00:33:11,250 --> 00:33:12,870 whether it's browsing the web. 685 00:33:12,870 --> 00:33:17,080 Everything inside of this machine, this machine, the cell phones in your pocket 686 00:33:17,080 --> 00:33:19,770 these days boil down to zeros and ones. 687 00:33:19,770 --> 00:33:23,160 Well, how can you possibly represent such arbitrary information 688 00:33:23,160 --> 00:33:26,370 using such simple bits of information? 689 00:33:26,370 --> 00:33:30,000 Well, think back for a moment, if you will, to grade school. 690 00:33:30,000 --> 00:33:36,840 So this number here 123 in the so-called decimal system. 691 00:33:36,840 --> 00:33:37,890 Pretty straightforward. 692 00:33:37,890 --> 00:33:41,100 All right, so why does that represent the number 123? 693 00:33:41,100 --> 00:33:45,630 Well, if I recall, I was taught that this is what's called the ones column, 694 00:33:45,630 --> 00:33:49,892 this is the tens column, and this is the one hundreds column. 695 00:33:49,892 --> 00:33:50,850 Pretty straightforward. 696 00:33:50,850 --> 00:33:53,460 Why is this the number we know as 123? 697 00:33:53,460 --> 00:33:58,770 Well, that's because we have three ones, so three times one, plus two tens. 698 00:33:58,770 --> 00:34:05,010 So that's plus two times 10, that's 23, plus one hundred, So one times 100. 699 00:34:05,010 --> 00:34:07,770 And OK, didn't really get very far with that, but that gives me 700 00:34:07,770 --> 00:34:09,719 what I know to be the number one. 701 00:34:09,719 --> 00:34:11,610 But there was actually a process there. 702 00:34:11,610 --> 00:34:15,330 Each of these digits, so to speak, from zero through nine 703 00:34:15,330 --> 00:34:18,840 took on different significance based on the column that they were in. 704 00:34:18,840 --> 00:34:22,389 Well, binary, the system the computers use, is really the same thing. 705 00:34:22,389 --> 00:34:26,460 So up here, I've pre-populated the slide with different placeholders, 706 00:34:26,460 --> 00:34:29,190 different column values, because in the world of computers 707 00:34:29,190 --> 00:34:33,060 and the world of binary, where your only digits are not zero through nine 708 00:34:33,060 --> 00:34:37,120 but just zero through one, is you just treat the columns a little differently. 709 00:34:37,120 --> 00:34:39,000 So the right one is still the ones column, 710 00:34:39,000 --> 00:34:43,170 but the next one over is not the tens column but the twos column. 711 00:34:43,170 --> 00:34:46,530 To the left of that the fours, the eights, the sixteens. 712 00:34:46,530 --> 00:34:48,690 So the pattern fundamentally is the same. 713 00:34:48,690 --> 00:34:50,580 These seem to be powers of 10. 714 00:34:50,580 --> 00:34:53,830 10 to the zero, 10 to the one, 10 to the two. 715 00:34:53,830 --> 00:34:59,550 Here we have two to the zero, two to the one, two to the two, and so forth. 716 00:34:59,550 --> 00:35:00,370 But that's all. 717 00:35:00,370 --> 00:35:03,260 Everything boils down to the same system. 718 00:35:03,260 --> 00:35:07,300 So for instance, if we have eight bits or eight light bulbs arranged in a row, 719 00:35:07,300 --> 00:35:10,960 just because it's useful to think of bits as being in a clump 720 00:35:10,960 --> 00:35:15,280 so that we can count higher than one, this set of eight off light bulbs 721 00:35:15,280 --> 00:35:18,040 obviously represents the number zero. 722 00:35:18,040 --> 00:35:18,970 Not all that hard. 723 00:35:18,970 --> 00:35:21,910 This row here, instead, with the right most one on, 724 00:35:21,910 --> 00:35:24,247 that bit is a one, because the light bulb is on. 725 00:35:24,247 --> 00:35:26,080 Well, that thing just represents-- all right 726 00:35:26,080 --> 00:35:29,090 we've got a one in the one column, so that's one times one is one. 727 00:35:29,090 --> 00:35:30,400 But what about the next row? 728 00:35:30,400 --> 00:35:34,210 Well, this represents two, because one of the bits is turned on, 729 00:35:34,210 --> 00:35:37,030 is flipped, so to speak, to be a one in the twos column. 730 00:35:37,030 --> 00:35:38,710 This is going to be three. 731 00:35:38,710 --> 00:35:40,090 And then what's the pattern here? 732 00:35:40,090 --> 00:35:43,900 If there were another row, how do I get to four? 733 00:35:43,900 --> 00:35:47,350 Well, you flip one more up, you carry the one, so to speak, 734 00:35:47,350 --> 00:35:50,650 and then the other two guys become off. 735 00:35:50,650 --> 00:35:53,810 All right, well what about a little exercise here? 736 00:35:53,810 --> 00:35:56,800 So this is what the same thing-- just replacing the light bulbs 737 00:35:56,800 --> 00:35:58,390 with explicit zeros and ones. 738 00:35:58,390 --> 00:35:59,140 How about this. 739 00:35:59,140 --> 00:36:02,700 So you are in what zip code right now, freshman? 740 00:36:02,700 --> 00:36:04,260 02138. 741 00:36:04,260 --> 00:36:09,390 So on a piece of scrap paper, in your head, or not at all, what would-- 742 00:36:09,390 --> 00:36:16,880 how would we go about encoding 02138 in this particular example? 743 00:36:16,880 --> 00:36:19,340 All zeros, I heard, excellent. 744 00:36:19,340 --> 00:36:20,630 What about the next one? 745 00:36:20,630 --> 00:36:24,120 746 00:36:24,120 --> 00:36:27,460 OK, so I'll give you 10 seconds of an at home exercise. 747 00:36:27,460 --> 00:36:30,990 And if you're finding this a little too easy, skip ahead to, oh, the eight, 748 00:36:30,990 --> 00:36:33,988 do the last one. 749 00:36:33,988 --> 00:36:37,030 So you're going to be putting on each of these dashed lines, in your head 750 00:36:37,030 --> 00:36:39,960 or on a piece of paper, the value of zero or one. 751 00:36:39,960 --> 00:36:46,190 752 00:36:46,190 --> 00:36:50,178 02138. 753 00:36:50,178 --> 00:36:52,270 All right, not so hard. 754 00:36:52,270 --> 00:36:53,080 OK, so that's it. 755 00:36:53,080 --> 00:36:53,580 02138. 756 00:36:53,580 --> 00:36:56,850 Now realize, we're talking about bits for the most part here. 757 00:36:56,850 --> 00:37:00,660 You're more used, probably, to talking about bytes and kilobytes and megabytes 758 00:37:00,660 --> 00:37:02,680 and gigabytes and now terabytes. 759 00:37:02,680 --> 00:37:05,850 Well, a byte is just eight bits. 760 00:37:05,850 --> 00:37:09,672 And a kilobyte is just 1,000 bytes and so forth, 761 00:37:09,672 --> 00:37:11,380 and we'll revisit these kinds of numbers, 762 00:37:11,380 --> 00:37:15,070 particularly later in the semester when we start talking about data and such. 763 00:37:15,070 --> 00:37:17,760 Now I thought I'd give you a little comic strip that 764 00:37:17,760 --> 00:37:19,320 was actually printed in a newspaper. 765 00:37:19,320 --> 00:37:25,580 If you chuckle at this, you belong in CS50. 766 00:37:25,580 --> 00:37:28,370 So now you understand a little bit. 767 00:37:28,370 --> 00:37:30,650 Wow, this did not go over funny at all this year. 768 00:37:30,650 --> 00:37:34,070 Everyone last year thought this was hilarious. 769 00:37:34,070 --> 00:37:36,350 If you're not quite sure what it means, maybe you 770 00:37:36,350 --> 00:37:40,130 should ask the person more comfortable to your right or left. 771 00:37:40,130 --> 00:37:41,870 So who cares about zeros and ones? 772 00:37:41,870 --> 00:37:45,170 Who cares about the fact that we can represent numbers greater than one 773 00:37:45,170 --> 00:37:47,840 using multiple zeros and ones? 774 00:37:47,840 --> 00:37:49,650 Well, this is intentionally scary. 775 00:37:49,650 --> 00:37:51,620 This is what's called the ASCII table. 776 00:37:51,620 --> 00:37:54,140 So way back when, some people decided, you know what? 777 00:37:54,140 --> 00:37:57,350 So that computers are useful and not just calculators, 778 00:37:57,350 --> 00:38:01,080 but can actually display alphabetic information, symbolic information 779 00:38:01,080 --> 00:38:04,970 and the like, why don't we use longer sequences of zeros and ones, 780 00:38:04,970 --> 00:38:10,140 like entire bytes, for instance, and map them to say, letters of the alphabet. 781 00:38:10,140 --> 00:38:14,247 So if you look down the middle column or the third column here, 782 00:38:14,247 --> 00:38:15,830 you'll see this is the decimal column. 783 00:38:15,830 --> 00:38:18,247 You can pretty much ignore most of the other columns here. 784 00:38:18,247 --> 00:38:22,790 But notice that the decimal number 65, some years ago, was semi-arbitrarily 785 00:38:22,790 --> 00:38:27,170 decided to henceforth represent capital A. Which is to say, 786 00:38:27,170 --> 00:38:29,840 if a computer ever encounters on its hard drive 787 00:38:29,840 --> 00:38:33,200 or in RAM a sequence of eight bits that, when 788 00:38:33,200 --> 00:38:35,810 you do all the math with the placeholders and whatnot, 789 00:38:35,810 --> 00:38:40,490 gives you the number 65, what that means is the computer should display not 790 00:38:40,490 --> 00:38:44,480 the value 65 in that context, but the letter A. And thus 791 00:38:44,480 --> 00:38:47,330 was born the concept of word processing and the ability 792 00:38:47,330 --> 00:38:50,570 to actually communicate in English and other languages. 793 00:38:50,570 --> 00:38:54,890 If we fast forward to 97, that was decided to represent lowercase A. 794 00:38:54,890 --> 00:38:57,200 And you'll certainly-- no computer scientists 795 00:38:57,200 --> 00:39:00,290 would memorize say, this entire chart, but turns out with just those two, 796 00:39:00,290 --> 00:39:03,590 you can kind of bootstrap yourself and figure out many of the other ones. 797 00:39:03,590 --> 00:39:07,040 But fortunately, computers generally do that for us. 798 00:39:07,040 --> 00:39:11,210 Well, if you have the ability to count in binary, represent larger numbers, 799 00:39:11,210 --> 00:39:14,955 in turn, represent letters of the alphabet, well, 800 00:39:14,955 --> 00:39:16,580 how do you actually store these things? 801 00:39:16,580 --> 00:39:20,750 Because certainly, our computers don't have millions of light bulbs, per se. 802 00:39:20,750 --> 00:39:24,390 So what I thought I would do is take a video here, 803 00:39:24,390 --> 00:39:26,660 which is a little cheesy with its voiceover, 804 00:39:26,660 --> 00:39:29,485 but nonetheless, gives an interesting view inside of a hard drive. 805 00:39:29,485 --> 00:39:30,152 [VIDEO PLAYBACK] 806 00:39:30,152 --> 00:39:33,930 - The hard drive is where your PC stores most of its permanent data. 807 00:39:33,930 --> 00:39:36,980 To do that, the data travels from RAM along 808 00:39:36,980 --> 00:39:41,300 with software signals that tell the hard drive how to store that data. 809 00:39:41,300 --> 00:39:46,230 The hard drive circuits translate those signals into voltage fluctuations. 810 00:39:46,230 --> 00:39:49,400 These, in turn, control the hard drives moving parts. 811 00:39:49,400 --> 00:39:53,100 Some of the few moving parts left in the modern computer. 812 00:39:53,100 --> 00:39:57,440 Some of the signals control a motor which spins metal coded platters. 813 00:39:57,440 --> 00:40:00,710 Their data is actually stored on these platters. 814 00:40:00,710 --> 00:40:05,930 Other signals move the read write heads, to read or write data on the platters. 815 00:40:05,930 --> 00:40:09,980 This machinery is so precise that a human hair couldn't even 816 00:40:09,980 --> 00:40:12,440 pass between the heads and spinning platters. 817 00:40:12,440 --> 00:40:15,157 Yet, it all works at terrific speeds. 818 00:40:15,157 --> 00:40:15,740 [END PLAYBACK] 819 00:40:15,740 --> 00:40:20,473 DAVID MALAN: And part two of that goes a little bit deeper. 820 00:40:20,473 --> 00:40:21,140 [VIDEO PLAYBACK] 821 00:40:21,140 --> 00:40:23,960 - Let's look at what we just saw in slow motion. 822 00:40:23,960 --> 00:40:27,470 When a brief pulse of electricity is sent to the read/write head, 823 00:40:27,470 --> 00:40:31,280 it flips on a tiny electromagnet for a fraction of a second. 824 00:40:31,280 --> 00:40:34,490 The magnet creates a field which changes the polarity 825 00:40:34,490 --> 00:40:37,010 of a tiny, tiny portion of the metal particles 826 00:40:37,010 --> 00:40:39,350 which coat each platter surface. 827 00:40:39,350 --> 00:40:42,380 A pattern series of these tiny charged up areas on the disk 828 00:40:42,380 --> 00:40:47,010 represents a single bit of data in the binary number system used by computers. 829 00:40:47,010 --> 00:40:49,790 Now, if the current is sent one way through the read/write head, 830 00:40:49,790 --> 00:40:52,308 the area's polarized in one direction. 831 00:40:52,308 --> 00:40:54,350 If the current is sent in the opposite direction, 832 00:40:54,350 --> 00:40:56,450 the polarization is reversed. 833 00:40:56,450 --> 00:40:58,790 How do you get data off the hard disk? 834 00:40:58,790 --> 00:41:00,630 Just reverse the process. 835 00:41:00,630 --> 00:41:02,900 So it's the particles on the disk that get the current 836 00:41:02,900 --> 00:41:04,640 in the read/write head moving. 837 00:41:04,640 --> 00:41:08,540 Put together millions of this magnetized segments, and you've got a file. 838 00:41:08,540 --> 00:41:13,340 Now the pieces of a single file may be scattered all over drive's platters, 839 00:41:13,340 --> 00:41:16,630 kind of like the mess of papers on your desk. 840 00:41:16,630 --> 00:41:19,950 So a special extra file keeps track of where everything is. 841 00:41:19,950 --> 00:41:23,567 Don't you wish you had something like that? 842 00:41:23,567 --> 00:41:24,150 [END PLAYBACK] 843 00:41:24,150 --> 00:41:27,120 DAVID MALAN: It's so educational up until that last part. 844 00:41:27,120 --> 00:41:28,650 I did come prepared, incidentally. 845 00:41:28,650 --> 00:41:30,990 If you were a little unnerved by all this talk 846 00:41:30,990 --> 00:41:33,110 of low-level magnetic particles, I did bring this. 847 00:41:33,110 --> 00:41:35,964 I don't think we really need it though. 848 00:41:35,964 --> 00:41:36,840 [VIDEO PLAYBACK] 849 00:41:36,840 --> 00:41:40,140 - This is the on/off switch. 850 00:41:40,140 --> 00:41:42,410 [END PLAYBACK] 851 00:41:42,410 --> 00:41:44,160 DAVID MALAN: So what's the takeaway there? 852 00:41:44,160 --> 00:41:46,860 Well, inside of hard drives, there are these metal platters. 853 00:41:46,860 --> 00:41:49,250 On those metal platters are magnetic particles, 854 00:41:49,250 --> 00:41:51,750 and those particles, essentially, can be arranged say North, 855 00:41:51,750 --> 00:41:55,650 South, representing a one, or South, North, representing a zero. 856 00:41:55,650 --> 00:41:58,110 And out of those basic physical building blocks 857 00:41:58,110 --> 00:42:02,070 can you begin to represent those logical entities, those conceptual entities 858 00:42:02,070 --> 00:42:04,350 like zeros and ones and bits. 859 00:42:04,350 --> 00:42:06,150 So enough on that for now. 860 00:42:06,150 --> 00:42:07,800 What is CS50? 861 00:42:07,800 --> 00:42:11,230 The course catalog description kind of scares with a bit of terms. 862 00:42:11,230 --> 00:42:12,600 What does this actually mean? 863 00:42:12,600 --> 00:42:15,600 Well, the course's expectations are to attend all lectures and sections, 864 00:42:15,600 --> 00:42:19,620 complete nine problem sets, take two quizzes, and produce the final project. 865 00:42:19,620 --> 00:42:21,720 There is no final exam in this course. 866 00:42:21,720 --> 00:42:23,640 How are grades computed? 867 00:42:23,640 --> 00:42:27,450 Most of the grade in this course is weighted toward the problem sets, 868 00:42:27,450 --> 00:42:30,640 because that is by far where you will spend most of your time. 869 00:42:30,640 --> 00:42:34,470 We are all quite familiar with the idea of either bombing a problem set or just 870 00:42:34,470 --> 00:42:36,370 being a bad week or something to that effect. 871 00:42:36,370 --> 00:42:38,412 So know that you will be able to drop your lowest 872 00:42:38,412 --> 00:42:41,130 score on one of these problem sets at the end of the semester 873 00:42:41,130 --> 00:42:42,300 when your grade is computed. 874 00:42:42,300 --> 00:42:45,060 The quizzes and the final project are weighted as follows, 875 00:42:45,060 --> 00:42:46,920 and you may take this course pass, fail. 876 00:42:46,920 --> 00:42:49,320 Look to the courses FAQ section in the syllabus 877 00:42:49,320 --> 00:42:51,270 for a little discussion on this. 878 00:42:51,270 --> 00:42:53,220 Realize that this is-- 879 00:42:53,220 --> 00:42:56,020 the TFs can confirm or deny this more one-on-one, 880 00:42:56,020 --> 00:43:00,930 this course is not so much hard, I think, as it is time consuming. 881 00:43:00,930 --> 00:43:03,450 And that was the case when I took the course, 882 00:43:03,450 --> 00:43:05,670 and I do think that's the case these days, 883 00:43:05,670 --> 00:43:08,520 but more on that in just a little bit. 884 00:43:08,520 --> 00:43:10,890 The course's website is at cs50.net. 885 00:43:10,890 --> 00:43:12,958 More on that as time passes, since there's 886 00:43:12,958 --> 00:43:15,000 a particularly interesting architecture as you'll 887 00:43:15,000 --> 00:43:16,590 see underlying that this year. 888 00:43:16,590 --> 00:43:18,750 Cloud computing will be the buzz word there. 889 00:43:18,750 --> 00:43:19,660 What about books? 890 00:43:19,660 --> 00:43:22,600 So there are no required books for this course. 891 00:43:22,600 --> 00:43:25,320 You will get plenty of information, we assure you, from lectures, 892 00:43:25,320 --> 00:43:27,610 sections, the internet, and so forth. 893 00:43:27,610 --> 00:43:29,640 However, if you are the type of student who 894 00:43:29,640 --> 00:43:32,850 likes the comfort of a book, who needs to have a book in order to take 895 00:43:32,850 --> 00:43:35,070 a class, we do recommend a few books. 896 00:43:35,070 --> 00:43:37,960 And we recommend them along two different tracks, so to speak. 897 00:43:37,960 --> 00:43:41,820 So those of you who are a little uncomfortable or very uncomfortable 898 00:43:41,820 --> 00:43:44,880 with the mere idea that you're in this core shopping it today, 899 00:43:44,880 --> 00:43:47,280 if you decide to take it and want to start 900 00:43:47,280 --> 00:43:49,830 the course with a bit of hand-holding and textual form, 901 00:43:49,830 --> 00:43:52,552 know that this is the book that we recommend. 902 00:43:52,552 --> 00:43:55,260 There is no shame in buying a book called The Absolute Beginner's 903 00:43:55,260 --> 00:43:58,530 Guide to C, just realize that this book is not really a reference book. 904 00:43:58,530 --> 00:44:02,160 You'll chew it up, learn it, and then that 905 00:44:02,160 --> 00:44:04,110 will be it for that particular book. 906 00:44:04,110 --> 00:44:07,590 But it's very good for gaining a bit of comfort early on. 907 00:44:07,590 --> 00:44:10,140 For those more comfortable, so to speak, this 908 00:44:10,140 --> 00:44:11,940 is the sort of book that risks putting you 909 00:44:11,940 --> 00:44:14,100 to sleep if you try to read it from cover to cover, 910 00:44:14,100 --> 00:44:15,855 but it's a wonderful reference. 911 00:44:15,855 --> 00:44:17,730 And it's not really the type of book that you 912 00:44:17,730 --> 00:44:20,910 would curl up in bed with and read from cover to cover, but rather, 913 00:44:20,910 --> 00:44:23,430 turn to the chapter, turn to the index for whatever topic 914 00:44:23,430 --> 00:44:25,530 is of particular interest to you there. 915 00:44:25,530 --> 00:44:30,510 Do you realize that free, if not superior resources do 916 00:44:30,510 --> 00:44:34,740 exist on the interwebs, and we link to those on the course's website 917 00:44:34,740 --> 00:44:35,700 under Resources. 918 00:44:35,700 --> 00:44:37,560 For everyone, we recommend this book. 919 00:44:37,560 --> 00:44:40,320 This is a wonderfully fun book that goes more into depth 920 00:44:40,320 --> 00:44:42,360 on things like those videos we just showed. 921 00:44:42,360 --> 00:44:45,540 How does a hard drive work, how does an iPhone work, and things 922 00:44:45,540 --> 00:44:48,990 like this, which are rather tangential to the ultimate goals of the course, 923 00:44:48,990 --> 00:44:52,260 but are nonetheless interesting and certainly 924 00:44:52,260 --> 00:44:55,350 help take the fear factor, or at least the unfamiliarity, 925 00:44:55,350 --> 00:44:58,650 around some of the toys that we ourselves carry every day. 926 00:44:58,650 --> 00:45:02,180 And for that 10% or even fewer of you who 927 00:45:02,180 --> 00:45:05,910 were the true hacker-minded types in this course who 928 00:45:05,910 --> 00:45:09,960 care about shaving milliseconds off of the running time of your code, 929 00:45:09,960 --> 00:45:12,880 know that this is actually a really valuable reference book. 930 00:45:12,880 --> 00:45:15,480 And for those types, frankly, a good curl up in bed 931 00:45:15,480 --> 00:45:17,460 cover to cover kind of read. 932 00:45:17,460 --> 00:45:20,970 I use this myself in grad school to optimize some research 933 00:45:20,970 --> 00:45:24,660 code that I wrote, and it's a wonderfully valuable, geeky type book 934 00:45:24,660 --> 00:45:25,240 to have. 935 00:45:25,240 --> 00:45:27,810 So those are at the Coop, but don't tell them I said this, 936 00:45:27,810 --> 00:45:30,600 you'll find them much cheaper online, at say amazon.com, which 937 00:45:30,600 --> 00:45:32,820 is where the course website links. 938 00:45:32,820 --> 00:45:38,920 So Coops not here, though we are, of course, on two cameras here. 939 00:45:38,920 --> 00:45:41,460 So speaking of cameras. 940 00:45:41,460 --> 00:45:44,340 So this course will take place here. 941 00:45:44,340 --> 00:45:47,190 It is, however, filmed for students who either can't make a class 942 00:45:47,190 --> 00:45:49,440 or who want to review some class. 943 00:45:49,440 --> 00:45:52,560 Know that in addition to the courses lectures and these videos, 944 00:45:52,560 --> 00:45:55,980 one of the teaching fellows will also take scribe notes during each lecture 945 00:45:55,980 --> 00:45:59,280 and then those will be posted online within a few days, too, not only 946 00:45:59,280 --> 00:46:01,590 as a valuable reference when it comes time for quizzes 947 00:46:01,590 --> 00:46:03,960 or if you want to fast forward to certain parts 948 00:46:03,960 --> 00:46:06,630 or maybe slow down certain parts during which I was confusing, 949 00:46:06,630 --> 00:46:08,255 or fast forward through certain parts-- 950 00:46:08,255 --> 00:46:13,800 951 00:46:13,800 --> 00:46:17,040 --take place on Mondays and Wednesdays, no lectures on Fridays. 952 00:46:17,040 --> 00:46:18,690 But what we thought we'd do during-- 953 00:46:18,690 --> 00:46:24,770 954 00:46:24,770 --> 00:46:27,320 --suggested in some Q-guide like forms that we 955 00:46:27,320 --> 00:46:29,540 have tea with David once a week. 956 00:46:29,540 --> 00:46:31,850 I don't really do tea, but I'll do lunch. 957 00:46:31,850 --> 00:46:34,880 So what we thought we would do-- and we'll see if anyone comes-- 958 00:46:34,880 --> 00:46:38,420 is at least I would plant myself in one of the dining halls or the faculty club 959 00:46:38,420 --> 00:46:41,540 or somewhere on campus on Fridays, during what would otherwise 960 00:46:41,540 --> 00:46:45,200 be class time, to just do sort of casual office hours, grab a bite, 961 00:46:45,200 --> 00:46:49,760 and see if we can't get a few people to come spend lunch time with me, 962 00:46:49,760 --> 00:46:52,400 just so we know who to expect so that we can plan accordingly. 963 00:46:52,400 --> 00:46:54,410 If you ever do take us up on such an offer, 964 00:46:54,410 --> 00:46:56,980 email that address there just so we know who to expect. 965 00:46:56,980 --> 00:47:00,260 It's not so much that we think we're going to be overloaded with requests 966 00:47:00,260 --> 00:47:02,930 of people wanting to eat lunch with me. 967 00:47:02,930 --> 00:47:04,170 So what about this thing? 968 00:47:04,170 --> 00:47:08,360 So we are very technically minded people here. 969 00:47:08,360 --> 00:47:11,960 And so last year, we started podcasting the course. 970 00:47:11,960 --> 00:47:14,630 And what that means is these videos are available online 971 00:47:14,630 --> 00:47:18,770 in QuickTime format, MP3 format, as well as in Flash format. 972 00:47:18,770 --> 00:47:25,940 If you are particularly inclined, you can pull up, God forbid, me, on your-- 973 00:47:25,940 --> 00:47:28,068 is that good? 974 00:47:28,068 --> 00:47:29,360 I still get a kick out of that. 975 00:47:29,360 --> 00:47:33,350 But I don't know who would want to watch a computer science 976 00:47:33,350 --> 00:47:36,410 course on an iPod or an iPhone, or at least admit to it. 977 00:47:36,410 --> 00:47:40,730 I, frankly, if you can see, actually, lest 978 00:47:40,730 --> 00:47:44,490 you think that I am completely out there. 979 00:47:44,490 --> 00:47:47,690 So that's what I have on mine, here. 980 00:47:47,690 --> 00:47:49,820 Besides that one video of me. 981 00:47:49,820 --> 00:47:51,680 But know that that is possible. 982 00:47:51,680 --> 00:47:53,900 More interesting than that, though, perhaps is 983 00:47:53,900 --> 00:47:56,630 the fact that one, CS50 for the first time this year 984 00:47:56,630 --> 00:47:59,000 will also be offered through Harvard's Extension School 985 00:47:59,000 --> 00:48:01,698 to students who want to enroll, partake in the course remotely, 986 00:48:01,698 --> 00:48:03,740 via the internet, wherever they are in the world, 987 00:48:03,740 --> 00:48:05,780 and receive credit through the Extension School. 988 00:48:05,780 --> 00:48:08,720 Because the course is podcasted, we also had 989 00:48:08,720 --> 00:48:11,630 random people on the interwebs tuning into the course. 990 00:48:11,630 --> 00:48:14,600 And we're going to take things one step further this year, 991 00:48:14,600 --> 00:48:19,187 really in an effort to give something back, so to speak, to those out there. 992 00:48:19,187 --> 00:48:21,770 In addition to the course being filmed and all of the handouts 993 00:48:21,770 --> 00:48:24,370 and all of the problems that's being made available online, 994 00:48:24,370 --> 00:48:26,870 we're going to try to take things one step further this year 995 00:48:26,870 --> 00:48:31,110 and use technology to further package up a course like this and its content 996 00:48:31,110 --> 00:48:34,280 for really, anyone who wants to turn in and bootstrap themselves out there, 997 00:48:34,280 --> 00:48:38,030 who might not have the fortune, frankly, of sitting down in a room like this. 998 00:48:38,030 --> 00:48:42,650 And we will make use of things called virtual machines, whereby long story 999 00:48:42,650 --> 00:48:44,460 short, more on this later in the semester, 1000 00:48:44,460 --> 00:48:48,530 we will create images of computers that people-- anyone out there-- 1001 00:48:48,530 --> 00:48:52,560 can download onto their own Macs, PCs, Linux boxes, double click an icon. 1002 00:48:52,560 --> 00:48:56,450 And what they will get inside of their own Macintosh or inside of their own PC 1003 00:48:56,450 --> 00:49:01,340 is a window inside of which is our own copy of, say Windows or Linux 1004 00:49:01,340 --> 00:49:04,460 or whatever operating system we decide to deploy so that they really 1005 00:49:04,460 --> 00:49:07,748 have their own sandbox environment with which to engage in the class. 1006 00:49:07,748 --> 00:49:10,040 And we will also make such images available to students 1007 00:49:10,040 --> 00:49:13,580 in the course, who, even though we provide cs50.net 1008 00:49:13,580 --> 00:49:15,350 as a course-wide computing structure. 1009 00:49:15,350 --> 00:49:18,860 If you are particularly geeky and so inclined, 1010 00:49:18,860 --> 00:49:21,860 you'll be able to really test out these fairly nascent technologies 1011 00:49:21,860 --> 00:49:25,760 on your own systems as well and administer your own Linux machine, 1012 00:49:25,760 --> 00:49:28,880 for instance, within your own Mac or PC. 1013 00:49:28,880 --> 00:49:30,050 So what about sections? 1014 00:49:30,050 --> 00:49:32,180 So sections and the course's teaching fellows 1015 00:49:32,180 --> 00:49:34,010 are an integral part of the core sections, 1016 00:49:34,010 --> 00:49:36,890 will supplement the courses lectures and dive into more depth 1017 00:49:36,890 --> 00:49:38,122 on problem sets and material. 1018 00:49:38,122 --> 00:49:39,830 For the first time this year, we're going 1019 00:49:39,830 --> 00:49:43,280 to borrow an idea from [INAUDIBLE],, which 1020 00:49:43,280 --> 00:49:45,800 is another class that meets in here, and that's about music, 1021 00:49:45,800 --> 00:49:48,830 and it too has a range of students' backgrounds. 1022 00:49:48,830 --> 00:49:51,500 The A sections, the B sections, and the C sections. 1023 00:49:51,500 --> 00:49:54,620 When I took that course years ago, I was in A or C, 1024 00:49:54,620 --> 00:49:57,592 whatever the people who don't know much about music were in. 1025 00:49:57,592 --> 00:50:00,800 We're going to borrow that same idea, and we're not going to use A, B, and C, 1026 00:50:00,800 --> 00:50:04,068 but describe them as sections for those more, those less comfortable, 1027 00:50:04,068 --> 00:50:05,360 and those somewhere in between. 1028 00:50:05,360 --> 00:50:07,790 And we'll take care of sectioning this Wednesday 1029 00:50:07,790 --> 00:50:10,460 or thereafter, more on that as time comes. 1030 00:50:10,460 --> 00:50:12,830 The goal for these multiple tracks is one, 1031 00:50:12,830 --> 00:50:15,800 we can handle it now, given that the course is sufficiently large. 1032 00:50:15,800 --> 00:50:20,420 And two, it's to provide not only the more comfortable people with a forum, 1033 00:50:20,420 --> 00:50:23,570 an environment where they can really ask those questions that might scare 1034 00:50:23,570 --> 00:50:26,362 the hell out of the less comfortable students sometime, or at least 1035 00:50:26,362 --> 00:50:29,310 annoy the less comfortable, even students somewhere in between, 1036 00:50:29,310 --> 00:50:32,300 but can further stimulate themselves by being 1037 00:50:32,300 --> 00:50:34,070 in a room full of other people who really 1038 00:50:34,070 --> 00:50:36,710 want to get their hands dirty with some technical minutia, 1039 00:50:36,710 --> 00:50:39,200 led by a teaching fellow who's just as, if not more 1040 00:50:39,200 --> 00:50:40,700 comfortable with that kind of stuff. 1041 00:50:40,700 --> 00:50:42,700 And on the other hand, we'll have other sections 1042 00:50:42,700 --> 00:50:45,140 that cater also to the comfort levels of students 1043 00:50:45,140 --> 00:50:48,140 who just don't have that background or that level of comfort 1044 00:50:48,140 --> 00:50:49,700 with that material. 1045 00:50:49,700 --> 00:50:51,810 So more on that later this week. 1046 00:50:51,810 --> 00:50:53,630 So the course's staff. 1047 00:50:53,630 --> 00:51:01,670 So this course's staff is perhaps bigger than the average class size at Harvard. 1048 00:51:01,670 --> 00:51:05,720 So we have over 50 people involved in the day-to-day operation 1049 00:51:05,720 --> 00:51:07,250 of this course. 1050 00:51:07,250 --> 00:51:10,440 Some of them are sitting here today who aren't shopping their own classes-- 1051 00:51:10,440 --> 00:51:13,670 can the courses teaching fellows who are here stand up for a moment? 1052 00:51:13,670 --> 00:51:15,830 We're mostly grouped here. 1053 00:51:15,830 --> 00:51:16,804 Oh, wow. 1054 00:51:16,804 --> 00:51:20,052 [APPLAUSE] 1055 00:51:20,052 --> 00:51:21,910 1056 00:51:21,910 --> 00:51:26,320 So these are just a few of the faces that you will never forget. 1057 00:51:26,320 --> 00:51:29,710 [INAUDIBLE],, in 1996, was my teaching fellow, thank you guys. 1058 00:51:29,710 --> 00:51:33,460 And I have never forgot the day that sitting in the back right hand 1059 00:51:33,460 --> 00:51:36,910 corner of Elliott Dining Hall, he was taking time out of his day 1060 00:51:36,910 --> 00:51:40,930 to deal with me, who still didn't get these things called pointers. 1061 00:51:40,930 --> 00:51:43,870 But that was the day where things finally clicked for me. 1062 00:51:43,870 --> 00:51:47,080 And this is absolutely the course that long after lectures 1063 00:51:47,080 --> 00:51:50,710 are over and long after, daresay, you've graduated from Harvard, 1064 00:51:50,710 --> 00:51:53,740 will you remember your teaching fellow in this, and perhaps 1065 00:51:53,740 --> 00:51:56,140 a few other, courses as well. 1066 00:51:56,140 --> 00:51:58,953 [INAUDIBLE] is the course's head teaching fellow 1067 00:51:58,953 --> 00:52:01,370 and will be helping with the administration of the course, 1068 00:52:01,370 --> 00:52:02,703 a lot of the sectioning details. 1069 00:52:02,703 --> 00:52:04,630 And so she is a face that-- 1070 00:52:04,630 --> 00:52:08,032 [APPLAUSE] 1071 00:52:08,032 --> 00:52:11,440 1072 00:52:11,440 --> 00:52:13,992 Many of you, I'm sure, will become well familiar with, 1073 00:52:13,992 --> 00:52:17,200 over time-- do know that in addition to myself and the other teaching fellows 1074 00:52:17,200 --> 00:52:20,252 and course assistants and anyone involved in the courses production, 1075 00:52:20,252 --> 00:52:22,960 know that you can turn to any of us, in particularly, [INAUDIBLE] 1076 00:52:22,960 --> 00:52:25,370 for questions you have, for concerns that you have, 1077 00:52:25,370 --> 00:52:27,190 particularly even this first week. 1078 00:52:27,190 --> 00:52:30,370 I think she'll be the first to admit that she was certainly, at one point, 1079 00:52:30,370 --> 00:52:32,410 among those of you less comfortable. 1080 00:52:32,410 --> 00:52:35,230 And so if you're feeling a bit of apprehension along those lines, 1081 00:52:35,230 --> 00:52:39,010 by all means, strike up a conversation with any of us. 1082 00:52:39,010 --> 00:52:41,230 So what else exists in the way of support? 1083 00:52:41,230 --> 00:52:44,230 This is perhaps the most beautiful you will ever see the Science Center. 1084 00:52:44,230 --> 00:52:48,760 So if you look at this photo online, the skies are bluer than they've ever been, 1085 00:52:48,760 --> 00:52:49,818 the grass is greener. 1086 00:52:49,818 --> 00:52:53,110 And you will spend time in the basement of this building for this course, where 1087 00:52:53,110 --> 00:52:55,900 we have dozens of computers that students 1088 00:52:55,900 --> 00:53:00,340 log into for one-on-one assistance with the courses problem sets 1089 00:53:00,340 --> 00:53:01,690 in the form of office hours. 1090 00:53:01,690 --> 00:53:04,480 More on that once we get to problem set one, really. 1091 00:53:04,480 --> 00:53:07,390 But we also introduced last year virtual office hours, whereby 1092 00:53:07,390 --> 00:53:09,670 you can log into the course's website, pull up 1093 00:53:09,670 --> 00:53:13,030 some platform independent Java-based software called Illuminate. 1094 00:53:13,030 --> 00:53:15,820 Log into what's really a glorified chat room, but one in which 1095 00:53:15,820 --> 00:53:18,400 you can click an icon to raise your hand, so to speak. 1096 00:53:18,400 --> 00:53:20,920 A little icon will flash on the teaching fellows screen. 1097 00:53:20,920 --> 00:53:24,010 And we can then, not only chat with you via this instant messaging 1098 00:53:24,010 --> 00:53:27,530 window on the bottom left corner, but also see what's on your screen, 1099 00:53:27,530 --> 00:53:30,160 and even, if you let us, take control of your screen 1100 00:53:30,160 --> 00:53:33,400 and help you troubleshoot whatever bug is hanging you up at that time, 1101 00:53:33,400 --> 00:53:36,950 whether you are at brain break in your dorm room or even off campus. 1102 00:53:36,950 --> 00:53:38,450 So we'll be using those as well. 1103 00:53:38,450 --> 00:53:40,670 So what do we expect in return? 1104 00:53:40,670 --> 00:53:42,950 So this is the course's workload. 1105 00:53:42,950 --> 00:53:46,120 This is the kind of course that you learn-- 1106 00:53:46,120 --> 00:53:50,560 it's the sort of material that you learn only by doing. 1107 00:53:50,560 --> 00:53:52,990 In the course's lectures, I try to present 1108 00:53:52,990 --> 00:53:54,910 a mental framework for the week, introduce 1109 00:53:54,910 --> 00:53:58,900 concepts that give you a sense of what the course's content is about. 1110 00:53:58,900 --> 00:54:02,710 In sections, we'll elaborate on that, go into additional examples and details. 1111 00:54:02,710 --> 00:54:05,050 But it's truly in the course's problem sets 1112 00:54:05,050 --> 00:54:07,677 where you will take the most away from this course. 1113 00:54:07,677 --> 00:54:10,510 And even though, to some of you, particularly freshmen, might think, 1114 00:54:10,510 --> 00:54:14,440 my god, five to 10 hours per week on a class? 1115 00:54:14,440 --> 00:54:15,670 There are other extremes. 1116 00:54:15,670 --> 00:54:19,040 So computer science 161 years ago, when I was a senior, 1117 00:54:19,040 --> 00:54:21,580 I took, it was like 40 hours a week. 1118 00:54:21,580 --> 00:54:25,000 Now that's not representative of all of the computer science courses here, 1119 00:54:25,000 --> 00:54:27,820 but it at least makes this look like a walk in the park. 1120 00:54:27,820 --> 00:54:31,690 But the upside is-- and you can look to the courses syllabus and website 1121 00:54:31,690 --> 00:54:33,190 and even to past teaching-- 1122 00:54:33,190 --> 00:54:35,470 current and past teaching fellows and students, 1123 00:54:35,470 --> 00:54:37,580 we like to think they're a lot of fun. 1124 00:54:37,580 --> 00:54:39,670 We'll give you a quick survey of them today. 1125 00:54:39,670 --> 00:54:42,640 But this is absolutely the type of the course where 1126 00:54:42,640 --> 00:54:46,330 if you do loan us some portion of your life for the semester, 1127 00:54:46,330 --> 00:54:49,600 we're pretty comfortable promising that you will not only get it back, 1128 00:54:49,600 --> 00:54:52,210 eventually, but also a lot more. 1129 00:54:52,210 --> 00:54:53,980 So more on that as time proceeds. 1130 00:54:53,980 --> 00:54:56,650 What, then, will we be doing in this course? 1131 00:54:56,650 --> 00:54:58,990 Well, in the first week and including today, 1132 00:54:58,990 --> 00:55:00,460 we'll bite off some of the basics. 1133 00:55:00,460 --> 00:55:05,530 And the course will start in a fairly friendly way. 1134 00:55:05,530 --> 00:55:08,170 Oh, this is an example of this interwebs technology. 1135 00:55:08,170 --> 00:55:11,140 Hi world is what we'll use this year instead of hello world-- 1136 00:55:11,140 --> 00:55:12,625 more on that to come. 1137 00:55:12,625 --> 00:55:14,690 What we'll use in the course's first week, 1138 00:55:14,690 --> 00:55:17,140 namely Wednesday, is introducing programming itself, 1139 00:55:17,140 --> 00:55:19,480 by a way of a really interesting programming 1140 00:55:19,480 --> 00:55:23,650 environment that was developed a couple of years ago by MIT'S Media Lab. 1141 00:55:23,650 --> 00:55:28,450 So we will very quickly next week dive into the C programming language, where 1142 00:55:28,450 --> 00:55:30,070 we will spend much of the semester. 1143 00:55:30,070 --> 00:55:34,330 But just to set the stage, I thought I'd pull up this programming environment, 1144 00:55:34,330 --> 00:55:36,700 which literally allows you to program things 1145 00:55:36,700 --> 00:55:40,000 by dragging and dropping puzzle pieces that lock together, 1146 00:55:40,000 --> 00:55:42,310 if that makes logical sense. 1147 00:55:42,310 --> 00:55:44,892 This is not what programming, ultimately, tends to be about, 1148 00:55:44,892 --> 00:55:47,350 because clearly, this is not the most sophisticated program 1149 00:55:47,350 --> 00:55:48,340 that one might make. 1150 00:55:48,340 --> 00:55:51,970 But what it allows us-- what it allows you to do in the course's first week, 1151 00:55:51,970 --> 00:55:55,510 frankly, is one, hopefully have a bit of fun with actual programming, 1152 00:55:55,510 --> 00:55:57,310 albeit in a playful context. 1153 00:55:57,310 --> 00:56:01,060 But two, also give you a sense, frankly, of gratification. 1154 00:56:01,060 --> 00:56:05,680 It's very hard to impress people by typing a command at a blinking cursor 1155 00:56:05,680 --> 00:56:08,980 and then getting back some hello world kind of response. 1156 00:56:08,980 --> 00:56:14,514 Much more interesting is, for instance, something like this. 1157 00:56:14,514 --> 00:56:15,181 [VIDEO PLAYBACK] 1158 00:56:15,181 --> 00:56:18,590 [MUSIC PLAYING] 1159 00:56:18,590 --> 00:56:29,697 1160 00:56:29,697 --> 00:56:30,280 [END PLAYBACK] 1161 00:56:30,280 --> 00:56:33,820 OK, much more interesting for some definition of much more interesting. 1162 00:56:33,820 --> 00:56:34,750 That's all it does. 1163 00:56:34,750 --> 00:56:36,790 I will say, the music and the flashing lights, 1164 00:56:36,790 --> 00:56:39,290 frankly, if you watch it late at night, gets kind of trippy. 1165 00:56:39,290 --> 00:56:42,310 So you might want to pull that one up. 1166 00:56:42,310 --> 00:56:48,550 Let me pull up one that wasn't made by a student who then distributed 1167 00:56:48,550 --> 00:56:52,630 the software with Scratch, but rather, pull up this, which one of our courses 1168 00:56:52,630 --> 00:56:55,420 teaching fellows, now CAs, Andrew Berry, one 1169 00:56:55,420 --> 00:56:58,660 of Harvard's football stars, actually, made during our staff training 1170 00:56:58,660 --> 00:56:59,818 last year. 1171 00:56:59,818 --> 00:57:02,110 I love all of the teaching fellows, equally, of course, 1172 00:57:02,110 --> 00:57:04,550 but this is kind of my favorite. 1173 00:57:04,550 --> 00:57:08,624 So let's take a look at what Andrew did. 1174 00:57:08,624 --> 00:57:12,103 [MUSIC - THE WEATHER GIRLS, "IT'S RAINING MEN"] 1175 00:57:12,103 --> 00:57:37,338 1176 00:57:37,338 --> 00:57:37,880 (SINGING) Hi. 1177 00:57:37,880 --> 00:57:38,380 Hi. 1178 00:57:38,380 --> 00:57:39,785 We're your weather girls. 1179 00:57:39,785 --> 00:57:42,810 And have we got news for you. 1180 00:57:42,810 --> 00:57:44,010 You better listen. 1181 00:57:44,010 --> 00:57:48,826 Get ready, all you lonely girls and leave those umbrella's at home. 1182 00:57:48,826 --> 00:57:50,824 All right. 1183 00:57:50,824 --> 00:57:51,788 Humidity's rising. 1184 00:57:51,788 --> 00:57:54,680 1185 00:57:54,680 --> 00:57:56,608 Barometer's getting low. 1186 00:57:56,608 --> 00:57:58,550 How low, girl? 1187 00:57:58,550 --> 00:57:59,688 According to all sources. 1188 00:57:59,688 --> 00:58:01,520 What sources now? 1189 00:58:01,520 --> 00:58:03,287 The street's the place to go. 1190 00:58:03,287 --> 00:58:05,042 We better hurry up. 1191 00:58:05,042 --> 00:58:11,592 'Cause tonight for the first time just about half past ten. 1192 00:58:11,592 --> 00:58:19,400 For the first time in history it's gonna start raining men. 1193 00:58:19,400 --> 00:58:21,329 It's raining men. 1194 00:58:21,329 --> 00:58:25,161 Hallelujah it's raining men. 1195 00:58:25,161 --> 00:58:27,080 Amen. 1196 00:58:27,080 --> 00:58:28,155 I'm going to go-- 1197 00:58:28,155 --> 00:58:30,530 DAVID MALAN: So we'll make that available on the course's 1198 00:58:30,530 --> 00:58:32,511 website for you if you'd like. 1199 00:58:32,511 --> 00:58:35,878 [APPLAUSE] 1200 00:58:35,878 --> 00:58:37,330 1201 00:58:37,330 --> 00:58:39,670 Let me ask, at the risk of putting you in, 1202 00:58:39,670 --> 00:58:44,350 what's by nature, a little uncomfortable for one volunteer, to join me up here. 1203 00:58:44,350 --> 00:58:45,700 I need one volunteer. 1204 00:58:45,700 --> 00:58:47,140 Yes, come on down. 1205 00:58:47,140 --> 00:58:49,240 What is your name? 1206 00:58:49,240 --> 00:58:50,050 Greg, OK. 1207 00:58:50,050 --> 00:58:51,820 Greg is going to join me up here for just a moment. 1208 00:58:51,820 --> 00:58:53,110 Greg, you have to be comfortable before you 1209 00:58:53,110 --> 00:58:56,020 walk in front of two video cameras and the entire internet, 1210 00:58:56,020 --> 00:58:57,760 being on the internet. 1211 00:58:57,760 --> 00:59:02,200 And we'll need you to sign a piece of paper from the lawyers after this. 1212 00:59:02,200 --> 00:59:03,320 But come on up. 1213 00:59:03,320 --> 00:59:05,750 So not only with this programming environment 1214 00:59:05,750 --> 00:59:08,950 can you create these animations, these interactions, 1215 00:59:08,950 --> 00:59:12,512 you can also take user input and actually create interactive games. 1216 00:59:12,512 --> 00:59:14,470 So for instance, this was made by [INAUDIBLE],, 1217 00:59:14,470 --> 00:59:18,880 one of our students, now CAs this year, or now virtual teaching fellows. 1218 00:59:18,880 --> 00:59:20,560 The rules are fairly straightforward. 1219 00:59:20,560 --> 00:59:23,570 This is Scratch Scratch Revolution, similar, of course, 1220 00:59:23,570 --> 00:59:25,060 to DDR, if you're familiar. 1221 00:59:25,060 --> 00:59:28,210 You're simply going to use the left, right, down, and up arrows, 1222 00:59:28,210 --> 00:59:30,160 so that as things are flowing on the screen, 1223 00:59:30,160 --> 00:59:33,850 you want to hit the key exactly as the colored arrow is lined up on the top. 1224 00:59:33,850 --> 00:59:34,630 Makes sense? 1225 00:59:34,630 --> 00:59:35,200 All right. 1226 00:59:35,200 --> 00:59:35,855 All yours. 1227 00:59:35,855 --> 00:59:36,730 Let's see how you do. 1228 00:59:36,730 --> 00:59:38,063 [MUSIC - KANYE WEST, "STRONGER"] 1229 00:59:38,063 --> 00:59:42,490 (SINGING) Work it, make it, do it, makes us, harder, better, faster, stronger. 1230 00:59:42,490 --> 00:59:45,908 Now that, that don't kill me, can only make me stronger, 1231 00:59:45,908 --> 00:59:50,600 I need you to hurry up now, because I can't wait much longer. 1232 00:59:50,600 --> 00:59:56,124 I know I got to be right now, 'cause I can't wait much longer, man, I've 1233 00:59:56,124 --> 00:59:59,666 been waiting all night, now, that's how long I've been on you. 1234 00:59:59,666 --> 01:00:04,620 You know how long I've been on you, since Prince was on Apollonia, 1235 01:00:04,620 --> 01:00:09,000 since OJ had Isotoners, don't act like I never told you. 1236 01:00:09,000 --> 01:00:13,588 You know how long I've been on you, since Prince was on Apollonia, 1237 01:00:13,588 --> 01:00:18,503 since OJ had Isotoners, don't act like I never told you. 1238 01:00:18,503 --> 01:00:20,400 Told you, never told you. 1239 01:00:20,400 --> 01:00:23,080 Told you, never told you. 1240 01:00:23,080 --> 01:00:24,860 Told you, told you, never told you. 1241 01:00:24,860 --> 01:00:27,590 Told you, told you, never told. 1242 01:00:27,590 --> 01:00:31,280 DAVID MALAN: How about a big hand for Greg? 1243 01:00:31,280 --> 01:00:31,940 Thank you. 1244 01:00:31,940 --> 01:00:36,730 1245 01:00:36,730 --> 01:00:39,632 So we'll make that one available on the course's website as well. 1246 01:00:39,632 --> 01:00:42,340 And so that's how we'll spend not only this Wednesday in lecture, 1247 01:00:42,340 --> 01:00:44,350 presenting some of the interesting concepts that 1248 01:00:44,350 --> 01:00:45,980 arise as a result of that. 1249 01:00:45,980 --> 01:00:48,160 But also, to set the stage for problem set 1250 01:00:48,160 --> 01:00:50,830 zero, which this semester will similarly task you 1251 01:00:50,830 --> 01:00:53,320 with really taking that environment out for a spin 1252 01:00:53,320 --> 01:00:55,450 and doing something that is of interest to you. 1253 01:00:55,450 --> 01:00:58,720 In fact, for what we'll call a hacker edition, more on that in a moment, 1254 01:00:58,720 --> 01:01:02,080 we will also make available these little circuit boards which have sensors 1255 01:01:02,080 --> 01:01:05,950 built into them like this little slider, little sockets for alligator clips, 1256 01:01:05,950 --> 01:01:10,150 a button here, it's got a microphone as well, as well as 1257 01:01:10,150 --> 01:01:11,795 a couple of light sensor, too. 1258 01:01:11,795 --> 01:01:14,920 So that you can actually integrate not only human input with, say, fingers, 1259 01:01:14,920 --> 01:01:17,330 but also environmental input as well. 1260 01:01:17,330 --> 01:01:20,650 So we'll be curious to see what those hackers among you do with that. 1261 01:01:20,650 --> 01:01:24,400 The week after will be very rapidly dive into C. This programming 1262 01:01:24,400 --> 01:01:27,370 language called C, where we'll spend much of the semester exploring 1263 01:01:27,370 --> 01:01:30,850 the fundamentals of computer science, and in turn, programming. 1264 01:01:30,850 --> 01:01:33,040 In week two, we will continue that discussion, 1265 01:01:33,040 --> 01:01:36,400 but also talk about some real-world applications of the same, 1266 01:01:36,400 --> 01:01:39,820 focusing particularly on cryptography. 1267 01:01:39,820 --> 01:01:43,150 Focusing in week three, then, we will look at-- 1268 01:01:43,150 --> 01:01:46,390 and week three will we then focus on some of those ideas 1269 01:01:46,390 --> 01:01:49,090 that I hinted at before, things involving phone books 1270 01:01:49,090 --> 01:01:51,580 and counting millions or billions of students, 1271 01:01:51,580 --> 01:01:53,470 searching and sorting, and actually trying 1272 01:01:53,470 --> 01:01:57,100 to get a sense of just how good or bad your program is 1273 01:01:57,100 --> 01:02:01,750 based on its running time, given some increasingly large inputs. 1274 01:02:01,750 --> 01:02:04,120 In week four, we'll look at data structures, 1275 01:02:04,120 --> 01:02:07,300 clever ways of implementing programs that 1276 01:02:07,300 --> 01:02:11,410 need to store more than just numbers and say, words in memory. 1277 01:02:11,410 --> 01:02:14,560 We'll also talk about some low-level details like memory management. 1278 01:02:14,560 --> 01:02:17,650 How a computer actually moves those zeros and ones around, 1279 01:02:17,650 --> 01:02:21,110 and what risks your computer is at when you, the programmer, 1280 01:02:21,110 --> 01:02:24,050 don't move those zeros and ones around very safely. 1281 01:02:24,050 --> 01:02:28,270 Many of the so-called hacks or compromises of websites and servers 1282 01:02:28,270 --> 01:02:32,410 these days often boil down, still today, to what are called buffer overflow 1283 01:02:32,410 --> 01:02:37,510 exploits, which relate directly to the world's popular use of C, C++, 1284 01:02:37,510 --> 01:02:40,480 and similar language, that puts you at risk, albeit, 1285 01:02:40,480 --> 01:02:45,190 giving you at the same time more power over your program of hackers actually 1286 01:02:45,190 --> 01:02:46,390 getting into your system. 1287 01:02:46,390 --> 01:02:50,200 Well, in week five, we'll introduce another element of realism. 1288 01:02:50,200 --> 01:02:54,100 I spent summer a few years ago interning for the district attorney's office 1289 01:02:54,100 --> 01:02:57,880 in Middlesex County, where quite literally, the local police would 1290 01:02:57,880 --> 01:03:02,380 bring in hard drives and memory sticks, and sometimes monitors and mice. 1291 01:03:02,380 --> 01:03:06,460 But we would then look at the data on those machines 1292 01:03:06,460 --> 01:03:09,770 and try to provide the prosecutors with whatever tidbit of information 1293 01:03:09,770 --> 01:03:11,800 it was they were looking for. 1294 01:03:11,800 --> 01:03:16,660 Truth be told, sometimes forensics is not as sexy as it seems to be on TV. 1295 01:03:16,660 --> 01:03:19,120 Sometimes we literally double clicked on My Documents, 1296 01:03:19,120 --> 01:03:22,420 and there was the evidence. 1297 01:03:22,420 --> 01:03:24,070 We, though, will dive a bit deeper. 1298 01:03:24,070 --> 01:03:27,070 In fact, this is an excerpt from one of the problem sets from the course 1299 01:03:27,070 --> 01:03:28,280 last year. 1300 01:03:28,280 --> 01:03:33,070 This was an image we made and embedded a secret murder mystery in. 1301 01:03:33,070 --> 01:03:35,440 If you think back to childhood, and if you're 1302 01:03:35,440 --> 01:03:38,710 kind of doing that thing where you focus your eyes, 1303 01:03:38,710 --> 01:03:42,160 trying to stare through the projector screen, it's not that thing at all. 1304 01:03:42,160 --> 01:03:46,150 So it's actually the thing where you get like that red piece 1305 01:03:46,150 --> 01:03:49,150 of cellophane plastic in like a cereal box, 1306 01:03:49,150 --> 01:03:52,480 and then if you hold the piece of red plastic over some otherwise red piece 1307 01:03:52,480 --> 01:03:54,040 of paper, a message pops through. 1308 01:03:54,040 --> 01:03:58,962 Well, we gave everyone a graphical image, a digital image like this, 1309 01:03:58,962 --> 01:04:00,670 and they then had to write a program that 1310 01:04:00,670 --> 01:04:03,610 simulated that red piece of plastic, so as to reveal 1311 01:04:03,610 --> 01:04:05,320 who it was that had done it. 1312 01:04:05,320 --> 01:04:07,600 And I think last year, it was Colonel Mustard 1313 01:04:07,600 --> 01:04:09,640 in the study with the candlestick. 1314 01:04:09,640 --> 01:04:11,548 So that was the solution to that problem. 1315 01:04:11,548 --> 01:04:14,590 In week six, we'll return our focus to data structures, talk about things 1316 01:04:14,590 --> 01:04:17,230 called linked lists and techniques with which 1317 01:04:17,230 --> 01:04:20,710 you can solve increasingly sophisticated and interesting problems. 1318 01:04:20,710 --> 01:04:23,140 We'll look in week seven at things called hash tables 1319 01:04:23,140 --> 01:04:25,720 and binary search trees, compression algorithms, 1320 01:04:25,720 --> 01:04:27,790 heaps and tries, as they're called. 1321 01:04:27,790 --> 01:04:31,330 In week eight, then, we'll be transition away from our world 1322 01:04:31,330 --> 01:04:34,900 and focus on C into one that is web-based, 1323 01:04:34,900 --> 01:04:37,877 where the web is clearly increasingly the place to be 1324 01:04:37,877 --> 01:04:39,460 when it comes to software development. 1325 01:04:39,460 --> 01:04:42,880 Google, for instance, has been a pioneer in terms of buying or implementing 1326 01:04:42,880 --> 01:04:44,860 things like Google Docs and spreadsheets, 1327 01:04:44,860 --> 01:04:47,360 and even Microsoft has begun to take those same initiatives. 1328 01:04:47,360 --> 01:04:50,830 So if you don't know it already, we will teach you how to make web pages. 1329 01:04:50,830 --> 01:04:55,420 XHTML, HTML, we'll teach you a little bit about HTTP and TCP/IP, 1330 01:04:55,420 --> 01:04:57,310 things you've probably heard about, but maybe 1331 01:04:57,310 --> 01:04:59,140 have not gotten your hands dirty with. 1332 01:04:59,140 --> 01:05:04,360 We'll introduce at that point PHP, and a database query language called SQL. 1333 01:05:04,360 --> 01:05:07,540 With these languages will we be able to transition the problem 1334 01:05:07,540 --> 01:05:12,080 sets from an interesting and powerful, but command-line environment, 1335 01:05:12,080 --> 01:05:15,730 so to speak, to one that is browser based, and spend a couple of problems 1336 01:05:15,730 --> 01:05:16,480 sets there. 1337 01:05:16,480 --> 01:05:20,080 In fact, in week nine, will we introduced 1338 01:05:20,080 --> 01:05:22,660 the notion or the context of mashups, which 1339 01:05:22,660 --> 01:05:25,930 is this increasingly popular phenomenon whereby people make 1340 01:05:25,930 --> 01:05:29,230 available different types of programming code online, 1341 01:05:29,230 --> 01:05:32,380 different data sets, Google being one of them, Yahoo and the like, 1342 01:05:32,380 --> 01:05:36,160 and you can take all these different data sets and all these different code 1343 01:05:36,160 --> 01:05:39,700 that other people have written and mash them up together 1344 01:05:39,700 --> 01:05:41,680 to do yet more interesting things. 1345 01:05:41,680 --> 01:05:45,370 A canonical one in the world of mashups is taking Craigslist 1346 01:05:45,370 --> 01:05:48,100 and taking Google Maps and actually overlaying 1347 01:05:48,100 --> 01:05:50,140 markers on Google Maps wherever there are 1348 01:05:50,140 --> 01:05:52,300 apartments that are available for rent. 1349 01:05:52,300 --> 01:05:55,810 But things are increasingly sophisticated these days. 1350 01:05:55,810 --> 01:05:59,230 Some of you might be familiar with Google Earth. 1351 01:05:59,230 --> 01:06:02,260 So Google Earth is this wonderfully fun tool 1352 01:06:02,260 --> 01:06:04,660 that I was actually introduced to a few years ago 1353 01:06:04,660 --> 01:06:07,570 when I was just auditing an archeology course here. 1354 01:06:07,570 --> 01:06:10,660 We can, for instance, go to one Oxford Street in 02138, 1355 01:06:10,660 --> 01:06:13,720 which is roughly where we are, it's the Science Center's address. 1356 01:06:13,720 --> 01:06:15,730 If you've never played with this program before, 1357 01:06:15,730 --> 01:06:18,272 I urge you to spend the next one or two days playing with it, 1358 01:06:18,272 --> 01:06:22,030 just because you can literally take virtual vacations in your dorm room. 1359 01:06:22,030 --> 01:06:25,390 Here we are hovering over the Science Center. 1360 01:06:25,390 --> 01:06:30,550 Using the controls here, we can zoom in, we can re-angle ourselves, 1361 01:06:30,550 --> 01:06:32,942 we can see some interesting 3D topologies there. 1362 01:06:32,942 --> 01:06:34,900 There's a link to this on the course's website. 1363 01:06:34,900 --> 01:06:37,790 But what Google recently introduced, for instance, 1364 01:06:37,790 --> 01:06:41,200 is not only their Google Maps API, with which I did things 1365 01:06:41,200 --> 01:06:46,540 like Shuttle Boy and the GPS setup, but they also introduced a plug-in 1366 01:06:46,540 --> 01:06:48,820 for web browsers for Google Earth. 1367 01:06:48,820 --> 01:06:51,610 And one of the things I thought would be fun to show 1368 01:06:51,610 --> 01:06:54,460 is something that we may end up playing with, 1369 01:06:54,460 --> 01:06:57,760 this notion of using Google Earth's plugin-- 1370 01:06:57,760 --> 01:07:01,120 which I wonder if this is going to work here. 1371 01:07:01,120 --> 01:07:03,310 Oh, had such good momentum there. 1372 01:07:03,310 --> 01:07:08,130 Let's see if we can do it in IE, if it's going to work. 1373 01:07:08,130 --> 01:07:10,130 OK, no. 1374 01:07:10,130 --> 01:07:10,630 All right. 1375 01:07:10,630 --> 01:07:13,380 We're going to run this in the background and we're going to-- oh, 1376 01:07:13,380 --> 01:07:16,310 so close to having every demo actually work correctly. 1377 01:07:16,310 --> 01:07:19,150 So we might end up playing with one or more of Google's APIs 1378 01:07:19,150 --> 01:07:20,230 is the takeaway there. 1379 01:07:20,230 --> 01:07:22,840 If you haven't already played with something like this, 1380 01:07:22,840 --> 01:07:26,800 I urge you to play not only with Google Earth, or this slowly downloading 1381 01:07:26,800 --> 01:07:29,710 plug-in, but we'll also revisit that later in the semester. 1382 01:07:29,710 --> 01:07:32,440 And near course's end will we actually look a bit at hardware. 1383 01:07:32,440 --> 01:07:35,770 We will take for granted the fact that there is some machine underneath it all 1384 01:07:35,770 --> 01:07:38,530 that's actually running our code and in making possible 1385 01:07:38,530 --> 01:07:40,390 all the things that we do and talk about, 1386 01:07:40,390 --> 01:07:44,200 what it means to compile your code and what it means to be a CPU. 1387 01:07:44,200 --> 01:07:48,040 And in the course's second to last week will we take things up a notch 1388 01:07:48,040 --> 01:07:50,020 and talk about enterprise architectures. 1389 01:07:50,020 --> 01:07:52,145 Talking about, well, what do you need when you want 1390 01:07:52,145 --> 01:07:53,673 to go run, say, a tech-type startup. 1391 01:07:53,673 --> 01:07:56,590 What do you actually need to build, what do you need to wire together, 1392 01:07:56,590 --> 01:07:57,790 what are your alternatives? 1393 01:07:57,790 --> 01:08:01,000 We'll talk in this week about cloud computing and virtualization. 1394 01:08:01,000 --> 01:08:03,970 The idea that you don't need to necessarily buy computers 1395 01:08:03,970 --> 01:08:07,840 anymore and connect them, you don't need to buy hard drives and storage anymore. 1396 01:08:07,840 --> 01:08:11,200 You can rather pay someone else a few cents on the dollar 1397 01:08:11,200 --> 01:08:15,550 and just rent computing cycles, rent memory, rent space. 1398 01:08:15,550 --> 01:08:19,240 And in fact, that is what we'll be doing with cs50.net this semester. 1399 01:08:19,240 --> 01:08:21,670 Rather than use Harvard's own computing infrastructure, 1400 01:08:21,670 --> 01:08:27,580 we will literally pay Amazon about $0.10 an hour to use one of their super fancy 1401 01:08:27,580 --> 01:08:31,930 virtual machines and multiple such instances that we will virtually wire 1402 01:08:31,930 --> 01:08:36,234 together and create for you all the illusion of one computing cluster that 1403 01:08:36,234 --> 01:08:38,859 you can then connect to, to actually work on your problem sets. 1404 01:08:38,859 --> 01:08:40,689 And the neat thing about this approach is 1405 01:08:40,689 --> 01:08:44,740 that for problem sets that involve a particularly lot of computation, 1406 01:08:44,740 --> 01:08:47,290 a lot of use of disk, well, we just have to type 1407 01:08:47,290 --> 01:08:49,540 a few commands, double the number of computers, 1408 01:08:49,540 --> 01:08:51,790 quote unquote, that are actually in the cluster. 1409 01:08:51,790 --> 01:08:53,680 We can then handle that load for that week, 1410 01:08:53,680 --> 01:08:56,013 and as soon as the problem set's submitted, we turn off. 1411 01:08:56,013 --> 01:08:59,310 Those virtual machines, they're no longer ours but available 1412 01:08:59,310 --> 01:09:00,310 for someone else to use. 1413 01:09:00,310 --> 01:09:02,628 And we'll of course, in week 12, conclude the course. 1414 01:09:02,628 --> 01:09:04,420 Well, what about the course's problem sets, 1415 01:09:04,420 --> 01:09:08,229 where we'll spend most of the outside of class time? 1416 01:09:08,229 --> 01:09:11,830 Well, problem set zero will be released later this week on Wednesday. 1417 01:09:11,830 --> 01:09:15,370 Next week will we look at C and problem set one. 1418 01:09:15,370 --> 01:09:16,090 Crypto. 1419 01:09:16,090 --> 01:09:18,819 In one of the problems this year will you actually 1420 01:09:18,819 --> 01:09:24,340 try to crack passwords, so to speak, where you will implement software 1421 01:09:24,340 --> 01:09:28,149 with which to decrypt and/or encrypt information, sensitive information, 1422 01:09:28,149 --> 01:09:29,470 and see what gets revealed. 1423 01:09:29,470 --> 01:09:30,950 We'll look also at forensics. 1424 01:09:30,950 --> 01:09:33,670 So in addition to maybe doing that red cellophane tape thing, 1425 01:09:33,670 --> 01:09:37,120 I will also, likely, like last fall, take a stroll 1426 01:09:37,120 --> 01:09:38,920 throughout campus with my digital camera, 1427 01:09:38,920 --> 01:09:42,160 snapping photos of some interesting spots on campus 1428 01:09:42,160 --> 01:09:45,430 onto a normal digital-- like Canon digital camera with a compact flash 1429 01:09:45,430 --> 01:09:45,979 card. 1430 01:09:45,979 --> 01:09:49,720 Unfortunately, I will likely accidentally format that compact flash 1431 01:09:49,720 --> 01:09:51,310 card, like I did last fall. 1432 01:09:51,310 --> 01:09:54,850 I'll then make an image-- a forensic image of that compact flash card, 1433 01:09:54,850 --> 01:09:57,880 post it, essentially, on the course's website for you all to download, 1434 01:09:57,880 --> 01:10:00,700 and then write your own forensic tool with which 1435 01:10:00,700 --> 01:10:05,620 to go recover all of the JPEGs, all of the photographs, that for a noob, 1436 01:10:05,620 --> 01:10:08,500 so to speak, would otherwise be completely lost. 1437 01:10:08,500 --> 01:10:11,740 We'll look in problems set six at the idea of implementing not just a spell 1438 01:10:11,740 --> 01:10:15,190 checker, but the fastest possible spell checker. 1439 01:10:15,190 --> 01:10:17,740 Even engaging in a bit of competition, optionally, 1440 01:10:17,740 --> 01:10:20,080 with your peers, whereby we'll benchmark your code, 1441 01:10:20,080 --> 01:10:22,010 post the results on the course's website, 1442 01:10:22,010 --> 01:10:24,400 and see if we can't get you to obsessively fine 1443 01:10:24,400 --> 01:10:28,000 tune your code, right up until the time of submission. 1444 01:10:28,000 --> 01:10:31,690 Last year toward the end of the semester, the course's final problem 1445 01:10:31,690 --> 01:10:35,080 set was to implement what we called CS50 finance, which 1446 01:10:35,080 --> 01:10:38,860 was an e-trade like web-based program with which students, once they 1447 01:10:38,860 --> 01:10:42,100 implemented it, could get real-time stock quotes from Yahoo, 1448 01:10:42,100 --> 01:10:45,610 could be given 10,000 virtual dollars in their portfolio 1449 01:10:45,610 --> 01:10:48,350 that they could then use to buy stocks, sell stocks. 1450 01:10:48,350 --> 01:10:50,350 So it was an online portfolio management tool, 1451 01:10:50,350 --> 01:10:52,267 so we'll likely do something like that, again. 1452 01:10:52,267 --> 01:10:54,700 As well as in the last problem set introduced 1453 01:10:54,700 --> 01:10:56,860 JavaScript and object-oriented programming. 1454 01:10:56,860 --> 01:11:00,400 Likely the idea of mash-ups and do something similar in spirit 1455 01:11:00,400 --> 01:11:02,920 to what Shuttle Boy, for instance, was. 1456 01:11:02,920 --> 01:11:06,920 But the climax of this course is absolutely its final project. 1457 01:11:06,920 --> 01:11:09,070 So the final project will be your opportunity 1458 01:11:09,070 --> 01:11:12,760 to take your newfound skills and savvy with programming out for a spin 1459 01:11:12,760 --> 01:11:15,880 and actually make something that's purely of interest 1460 01:11:15,880 --> 01:11:18,517 to you, subject to just a few guidelines. 1461 01:11:18,517 --> 01:11:21,600 We'll encourage you, at that point, to build something that interests you, 1462 01:11:21,600 --> 01:11:23,392 something that's actually useful, something 1463 01:11:23,392 --> 01:11:26,710 that solves an actual problem, be it for this course, for your research, 1464 01:11:26,710 --> 01:11:27,610 just for fun. 1465 01:11:27,610 --> 01:11:31,360 But ideally, somehow impact campus. 1466 01:11:31,360 --> 01:11:34,300 In fact, next year, as most of you probably know, 1467 01:11:34,300 --> 01:11:38,200 the University is changing its calendar, whereby it's a good thing. 1468 01:11:38,200 --> 01:11:40,210 Exams will come before winter break, which 1469 01:11:40,210 --> 01:11:44,097 means there will no longer be this month of either slacking or stressing, 1470 01:11:44,097 --> 01:11:46,180 depending on the type of personality that you are. 1471 01:11:46,180 --> 01:11:48,620 But it does put a wrinkle in the course's 10, 1472 01:11:48,620 --> 01:11:50,678 15 year tradition of having a final project 1473 01:11:50,678 --> 01:11:53,470 in the course, because we tend to use reading period, if not break, 1474 01:11:53,470 --> 01:11:58,190 to actually allow you this opportunity to dive in to your own work of art. 1475 01:11:58,190 --> 01:12:01,750 So what we will do for the first and maybe last time ever 1476 01:12:01,750 --> 01:12:05,830 is culminate the course in what we're calling a the CS50 Fair. 1477 01:12:05,830 --> 01:12:09,820 Think back to middle school science fair, but not so cheesy with test tubes 1478 01:12:09,820 --> 01:12:10,390 and whatnot. 1479 01:12:10,390 --> 01:12:13,810 But rather, an exhibition where we book some really big space on campus, 1480 01:12:13,810 --> 01:12:17,170 get a couple hundred tables, a couple hundred power cords, maybe 1481 01:12:17,170 --> 01:12:18,280 a few dozen pizzas. 1482 01:12:18,280 --> 01:12:21,650 Maybe invite our friends at Amazon, Google, Microsoft, Facebook, 1483 01:12:21,650 --> 01:12:24,670 and the like to maybe bring some t-shirts, maybe some job opportunities, 1484 01:12:24,670 --> 01:12:26,620 maybe those little squishy balls. 1485 01:12:26,620 --> 01:12:34,300 And we will invite everyone on campus to see this semester's final project 1486 01:12:34,300 --> 01:12:34,820 submission. 1487 01:12:34,820 --> 01:12:36,910 So it's your opportunity to not only show off 1488 01:12:36,910 --> 01:12:41,140 your work to your fellow classmates, but also to others on campus as well. 1489 01:12:41,140 --> 01:12:44,710 Not quite sure what will happen with the final project in semester's future, 1490 01:12:44,710 --> 01:12:49,640 but we will certainly, I think, this semester go out with a bang. 1491 01:12:49,640 --> 01:12:52,780 So welcome to CS50. 1492 01:12:52,780 --> 01:12:53,950 We'll see you Wednesday. 1493 01:12:53,950 --> 01:12:55,822 [APPLAUSE] 1494 01:12:55,822 --> 01:12:58,170 [MUSIC - KANYE WEST, "STRONGER"] 1495 01:12:58,170 --> 01:12:59,760 (SINGING) Faster, stronger. 1496 01:12:59,760 --> 01:13:04,480 Now, now that that don't kill me, can only make me stronger. 1497 01:13:04,480 --> 01:13:09,490 I need you to hurry up now, because I can't wait much longer. 1498 01:13:09,490 --> 01:13:15,200