>> David: All right. We are back. This is week 12. So this is the end. So nice to see so many of you again. We will adjourn ultimately to cake in the pub downstairs, but what I thought I'd do is begin us today with a little something some of your teaching fellows made. First, a little reminder as to what inspired this particular clip. So, you'll recall this painful experience from a few weeks prior. So we'll just do a minute or so of this. I'm sorry. [Laughter] >> Hey. Welcome to the party. The four of us along with [inaudible] and you are launching Windows 7 Ultimate Software. So, you know what? Let's take a minute or so to tell you about how great it is to host a launch party. You can use House Party Tools to build your guest list. Upload your pictures, which is [inaudible], right? Right? [Laughter] And you can even get a fun pack. Though you're in your own home, you'll be able to participate with others in this exciting event around the world. >> In a lot of ways, just throwing a party with Windows 7 as an honored guest. >> David: That sort of says it all. So, as you know, the CS50 Fair is coming up, and so to get folks excited about this, a few of our staff decided to put the following together for you. It's about 6 minutes long. Here we go. [ Pause ] >> [Laughter] [Background noise] Oh hi. Welcome to the party. [Inaudible] launching [inaudible] 2009 edition. Let's take a minute or so to tell you how big it is to be part of the fair. You can use the [inaudible] website to check the guest list and [inaudible] to host your website which is his favorite. >> It's my favorite. [Laughter] >> And you can even get a stress ball. [ Inaudible ] >> You know, in a lot of ways, it's just like throwing a [inaudible] party with CS50 as our honored guest. Sounds easy. [Background conversation] And it is. We thought you'd probably need to know to get ready, and how some students will want [ inaudible] to flow. >> Now the four of us did our presentations in past years [background conversation]. You know, tried everything out. So we thought we'd give you some pointers of how to make your fun project presentation really, really fun. >> Now the first thing you're going to want to do is finish your project. >> [Laughter] Duh! >> Make sure you do this at least a day before coming to the fair, preferably by [inaudible] 11 am. Talk to your TF's, us or consult the bulletin board if you have any questions. You've got a play with your final project before actually coming to the fair. >> Second, look at the list of projects that you and your friends can try at your CS50 fair and visit the ones that seem most interesting to you. >> On [inaudible] a list of all final projects at the fair and then the [inaudible] set of specs [inaudible] that sort of tells you at the time what you'll be needing for your presentation. >> Hey, again, you don't need to do all the things specified in the project specs. You can just choose your favorites and try them out. >> [Inaudible] >> Yeah, for the first part of the fair, we let the guests come in and they just came in and kind of drink and snack, just mingled around for a little bit just like they would at any party. [Background conversation] Then they gathered around, and I was able to show my project to whover came by. >> Exactly. I just gave an overview of how my project worked, and it only took me a minute or two, and you know what was great? It was totally informal, and everyone was just crowded around the table, and after my overview, I went straight to an activity. >> Oh. You went to an activity? >> Well I just let everyone fool around with my project for a while. >> Whoa. >> [Laughter] I did the same. >> And then we started an activity a minute or two later. >> Well, either case works, right? You just have to figure out what your guests want and play it by ear. >> We each did a demo or two. >> I did three. [Background noise] The demos go for a brief time. Every once in awhile when other people come by. As for the rest of the party, you just let your guests play around for a while, and your guests may have some questions, or you may want to show them some things, but it's completely informal. >> Informal, yeah. Again, there are several ways to [inaudible] your time at the CS50 fair, but in the end, it's all up to you.. >> You know, the four of us learned a lot of things to make our part of the fair a lot of fun. >> Yeah, here's mine. Make the thing you're demonstrating personal to the person you're showing, like the way I helped someone register for a user name to make an order on my online dining hall ordering site webpage program application. >> Or how I let students arrange their own custom made [inaudible] on my project and gave them [inaudible] user ids. >> Ok, on a more serious note. [Laughter] [Inaudible] your demos and prepare a little information you want to talk about and make sure you have all the equipment you need. >> Sure. You have to have your computer to show off your project. [Laughter] >> Of course. >> In any case, none of this is too hard. You just need to make sure that you're ready to go when you're guests arrive. >> And, hey, help me to remember, I'm not at a salesman at this party. I'm not supposed to be a total expert either. I mean, this is a brand new implementation, and part of the fun of the CS50 fair is seeing what you already know and what you can figure out. It's so simple, anyone can do it. >> And that is one of the great things about being a part of the fair that's amongst your peers. >> I think the greatest thing is to be totally creative and open to your project and how you present it at the fair. After all, it is your fair. >> Can you guys believe that David [inaudible] launched the CS50 fair in our hands? [Laughter] Is that crazy? >> Man, you be involved. >> Oh. >> I mean, it does make total sense, right? CS50's all about the students and the community, and it's all about thinking about every day problems in new ways and making new things possible. >> This really is our fair. >> Hmm. You're right. >> So it ought to be a party. Have fun out there. >> Cheers. >> Oh, I'm hungry. Let's eat. [Background noise] >> This was CS50. >> No TF's were harmed during the production of this movie except me, who was just starved to death. [ Inaudible ] [Applause] >> David: So actually just notice that Matt did like three wardrobe changes during that film. But so the CS50 Fair is indeed coming up. A little, even more, just as funny as that was the photo shoot that went on afterward. So we have a lot of clips of like this year, and perhaps something will end up floating around on You-tube at some point. Before long. But as for this thing, what to expect. So the week of the fair, you guys will all get an email with some additional instruction, so if you're wondering what do I do on that day, just check your email on Monday, December 7. The fair, again, is on Tuesday, December 8, and essentially it will go as follows. You will enter Northwest Science, which is the relatively new science building down the street. Roughly 900 people attended the fair last year including last year's students. You will be plummeted with CS50 stress balls as the TF's greet you as you come in. Little things like this, and [inaudible], and you'll be handed a program, and with the things you are handed, you will be have instructions, and essentially out of the 300+ students in the class, about half of you will be directed to show up at the beginning of the fair, which is going to be 1:00, and then half of you will be instructed to show up roughly half way during the fair, so there'll be intentionally a bit of overlap, and there will be essentially a scene change where all of you guys show up with your laptop and projects on it for exhibition, and then roughly half way through, the other people will take your place, and it was actually really quite fun as you may have seen from the Facebook videos online, and hopefully this little teaser today will get you all the more excited. Coming at the end of lecture are two cakes this time, both chocolate and vanilla, so do stick around underneath. We have decorated Happy Cat in the CS50 garb of this year. That's at store.CS50.net, and let me go ahead and do the sentimental part rather than leaving that for the end. So, a huge thanks to the staff of this course over the past several months who have really made this all of the magic in this course happen, right? So I may be the talking face at the front of lecture a couple of times per week, but it's the 60+ undergraduates and graduates and alumni who have really made this course run so smoothly behind the scenes. So even though just a few of them don't have conflicts with class and the rest of them are cutting the cake downstairs at the moment, could we please at least on camera give them a huge round of applause. [ Applause ] If interested in joining precisely that team, go to CS50.net/apply, and the roles we're looking for, again, are teaching fellows who'd lead sections, who grade, who hold office hours, and really get to know a group of students over the course of the semester, CA's, who are alumni who hold 2 hours of office hours per week, pretty much self scheduled by a Google calendar, and that's a way of sort of keeping one foot in CS50 while still focusing, if you so choose, on other extracurriculars, and then graders, as well. I wanted to read a little excerpt of a couple of emails I got, one in February of 2008 and one in November of 2007, and this student wrote me-I'll read just a couple of excerpts here. "Hello, David, thank you very much for your email. It really made my long computer science less boring, my long CS-less boring day. I was in Model United Nations conference at McGill when I found out about my grade. I couldn't help but shriek right in the middle of my committee. It was a very embarrassing moment, and all the other 99 delegates looked at me, and I simply pretended that nothing had happened. Everything about CS50 in my life involves some kind of drama." Now a few months prior, that same student had written me this note here, and, incidentally, they approved my reading excerpts from these, so don't worry about ever sending me an email again. [Laughter] "Hello, David." Let's see..."After our dinner yesterday," faculty dinner, faculty/student dinner, "I asked myself why I was about to drop the course." So this was in the fall of 2007, "considering how much I adore the course. The main reason why I was about to drop the course was rather personal, but here is the entire story." It's pretty long. So, excerpts thereof. "Even though I was always interested in the material, around the third week, right before the midterm, I felt overwhelmed and exhausted by the load of work I had to do. I tried finishing my PS2 on Wednesday because I was leaving on Thursday for Columbia for a Model United Nations conference. I spent an entire day in the terminal room trying to get help. I hadn't developed the office hours technique yet back then. Maybe I was just unlucky, but I only got helped once, and the poor TF, overwhelmed by the number of students in office hours, could only talk to me for a few minutes. I tried the virtual terminal room that night, and for some reason, 20 people were online and around 1:00 am in the morning I realized that it was a lost cause, so I tried doing it on my own, but somehow I couldn't figure out a way to make visionaire [assumed spelling] work!!! In Columbia, I literally locked myself in the hotel room to come up with a logical solution to my problems, but it seemed the more I tried, the more I failed miserably. I tried virtual office hours again, and well the poor TF's again trying to help two students at a time, weren't really able to help me. Honestly, I was really frustrated that I needed so much time to get a relatively easy pset done, so I said to myself, if I can't do the problem sets in the beginning of the year, I won't be able to handle the course." So, dot, dot, dots, and this, recall, same student wrote us at semester's end with a much more gratified note, but I wanted to excerpt one last quote here. Since I had asked this student if she could give me her perspectives on the course two years ago, which was the first year I taught the course...what suggestions she might have, and she wrote, "If the sections could be designed in such a way to put all of the less comfortable students together in a small section, it might work better. I feel that sections are important because there you can ask more questions without feeling intimidated by 200 other comp sci experts looking at you, and once you, and also once you feel like you are not the only one, you feel better about yourself. Smiley face." So it was largely the result of this student having written and other students having echoed the same sentiments that we did introduce last year these three tracks for those less and those more comfortable and for those somewhere in between, and I want to take a moment to read these excerpts really just to show you the before and after because in the course syllabus, we do make that promise that what matters in the course is not so much where you end up relative to that CS expert to your right and the CS expert to your left, but rather where you end up relative to yourself, and week 12, today, vis-a-vis week zero. So the students who wrote me this note is named Jensu [inaudible] who has been the course's head teaching fellow for the past couple of years, and so I just wanted to thank her very wholeheartedly and very sentimentally for having written this note and for having done such a wonderfully and apparently awkward job the past couple of years. So, Jansu. [ Applause ] And finally though I do, finally, though I do love all of the TF's and CA's equally, I did want to a moment to just recognize the boy who has wardrobed Happy Cat and of all us this year. CS50 honestly would not be as beautiful or as branded as it has become over the past two years, and you've seen perhaps the limited extent of my web skills, and it's really thanks to this fellow, [inaudible], that the course looks the way it does. So a huge round of applause would be good for him as well. [ Applause ] And, lastly, there are many, many people on this sheet of paper who are never in front of the camera but behind it, but Chris and John and Barry, the team downstairs, many, many thanks for having made this semester so flawless, and I apologize myself for any technical [inaudible]. They have been have been mine and never the crew that supports us, so thank you. [ Applause ] So, now, it's all about you guys. So we look back at several problem sets, and there were various fun competitive aspects and various interesting submissions over time, and we wanted to take a moment to recognize a few of the submissions that had come in over the course of the semester. This is not to say that these were necessarily the best. This is not to say these were the worst, but they certainly stood out in the staff's mind for better or for worse, and today for the better. So we wanted to take a moment to recognize this scratch project from many weeks ago. None of these students were among those more comfortable, but what we went ahead and did was dig up a few. This one here was one of our favorites, and actually let me go ahead and pull up the client's side version. As some of you may recall, things seem to run better on the local client, and is Tom Rice here? Tom? So this is Tom Rice's Space Invaders, and if we can invite him up for a second, and then would someone like to play Space Invaders up here, albeit on camera, for just a moment. It's your last chance to volunteer. Tom, pick someone who you think would love to come up on stage with you. [Background conversation] All right, come on down here. Tom? If you would like to come up here and explain, if need be, exactly how this is played. We thought we would feature for just a moment your version of Space Invaders. >> Tom: [Pause] Hi, what's your name? >> Art: Art. >> Tom: Hi, I'm Tom. Uh, ok. There's a microphone. So the controls are right here. [Laughter] You move. Shoot to start. >> Art: Ok. >> Tom: We'll have to click the green flag first. [Pause] The sound on. You have sound on? >> [Background noise] Yes. >> Tom: You should shoot at the aliens. [Laughter] And don't let them hit you. You're going to hold down the space bar [ Music ] [ Laughter ] All right. [ Music ] [Inaudible] [ Music ] >> Now you can shoot twice as fast. [ Music ] You're doing fantastic. [ Music ] >> You're doing great. Everything that's happening is excellent. [ Music ] Two shields left. [ Applause ] >> So thank you to Tom and to Art. We have a little parting gift for them today, so congrats on such a job well done. [Background conversation] Oh, thank you, Art. All right, so we have two other scratch projects we wanted to recognize, and, again, even though it might not be your project up here, do think back to what week zero of this course was like. You may recall especially poignantly in week one just how damn hard it was to get a simple, little, relatively, simply little pyramid of stars just to appear on the screen and if you now think back to pset 7, pset 8, do appreciate those of you who feel this way just how far you've come in these 12 or so weeks. So this next one is actually a bit musical. In fact, both of these are musical along these lines. So this here is Anastasia Rhoda's [assumed spelling]. Is Anastasia here? Do you mind coming up for a second? Come on up, Anastasia. [ Applause ] So this is called Music Composer. I'm having some technical difficulties. Hello. Let me fix. There we go. Ok. Little heavy on my computer here. So this I was particularly struck by. I don't play piano very well, but it allows you to program essentially a piano by way of some music, and I'm guessing you do know some piano? So this might be a little bit of pressure here, but would you like to program us a little, few chords? Anastasia, music composer. [ Background noise ] [Music] Various letters represent the musical notes per the legend on the side. [ Music ] [ Background laughter ] [ Music ] That's got to be hard under pressure, so a big round of applause for Anastasia. [Applause] Thank you. In retrospect, I probably should have told Anastasia that I would need her to write a song on stage. [Laughter] So I hope that wasn't too much pressure. And then finally, this one I actually played with myself. Another one that's musical in nature that caught our eye, but, again, we love them all equally. This one is by Ivan Buckov [assumed spelling]. Apologies if I've mispronounced. Let's let this one load, too, and this one, too, can be programmed. I thought I would go ahead and do what I did last night while tinkering. Go ahead and hit the green flag here. I wanted to...so this is a program that one run moves this little bar from left to right, and anytime it encounters a note, it plays that note. [Background music] So each of these boxes represents a different note. It is pretty. So what I thought I would see is what CS50, the musical, sounds like. [Laughter] So I got to playing like this, and then I did this. All right...that's...oops. I left some space last night, so let's do this again. All right. So that looks like an s kind of. All right. Now I did this. Let's see. That's a decent 5 and 0 and 0. And now is Ivan here? Do you mind joining us up on stage? And I'll let you hit play. [Laughter] So this, too, is actually very addictive, and I'm frankly very amazed when I look at the source code, the puzzle pieces, the [inaudible] that you guys implemented. There are many that are far more sophisticated certainly than what I once did. So, Ivan, do you want to explain in just a couple of words what motivated this or how it works and then go to town? >> Ivan: Well, I'd love to take full credit for this, but, unfortunately, I found it on the Internet. [Laughter] And it's something that's called the tone matrix and tone scratchix, and it's essentially what you see here, except it's even bigger. It's a grid of 16 by 16 of these little dots It's based on a pentatonic scale, so essentially anything, any combination of squares that you press are kind of almost guaranteed to make a good sound. I'm not sure if [inaudible]. [Laughter] >> David: And to be clear, you found the tool or the game online, not this particular scratch project [inaudible]. [Laughter] All right. >> Ivan: I thought I'd implement like a few other functions to it to make it not just like a clone of the actual thing, so I have these other buttons which [inaudible], reset, you can change the tempo which is just changing the speed of the bars that moves along, and if you click on sound, it gives you a different instrument to play. >> David: Ooh. How about that? Show us. [ Music ] David: So that is [laughter] what 50 sounds like. Do you want to play with tempo and sound perhaps? [ Music ] [ Background conversation ] [ Music ] >> David: Let's end on a good note. [ Applause ] Thank you. Congrats to Ivan. It was really quite fun to play with. So these are all linked on today's lecture [inaudible]. Congrats. So that was pset zero. That then brought us to problem set 5, which, recall, involved this guy in many different places on campus. So frankly the fact that, well never mind, the fact that we own our own Happy Cat from icanhascheezburger.com [assumed spelling], but in years past, we simply took photographs of fairly inanimate things, not people, but places and things. This year we decided to just spice it up by putting Happy Cats all around campus and at the very last minute. So we gave everyone like 4 weeks to find these photos, and literally, at like 11:23 pm, 11:49 pm, all of the submissions from sections started coming in and so the four sections who really took this to heart were these four here, Lee's, John's, Drew, and Rose's section which I thought I'd do is pull up each of these links. Lee's section was, in fact, the first to submit, and almost everyone got most all of them. I thought I'd bring up their album here. Yea, Lee's section. [Laughter] Just us. All right. [Background noise] There you go. [Laughter] So you may recognize...this was actually fairly common. Almost all of the groups submitted a photo that looked like this. So this, of course, was the statue outside of Boylston Science Center. It actually looks kind of cool when looked at from this angle here. What else do we have? This, of course, is a favorite. All right. What else do we have here? You did find the bike racks. What else did we have here? Oh, and of course, those of you who have never seen Winnie the Pooh. Pooh seems to disappear every couple of years, but his door has been there for many, many years. This is a little gem outside of the science center by the law school. So it's a little dark on this screen, but that's Pooh's corner there. So, congrats to Lee's section, but also congrats to the other couple of sections. Let me pull up just a few of their photos. This is John's section who strolled around campus, similarly found most of the locations. Most of these were taken by, or featuring, Shea [assumed spelling] who actually did find the apple tree in Radcliffe Yard. I had never know that there was an apple tree on Harvard's campus, and that there is is not necessarily all that interesting, but she did find it, and this is over near the Admission's office these days, taken at dark, apparently, but there are, or were, apples there. This was not quite the intention. When you go into Cambridge Common when we decided we were getting bored at this point in the day, ad so we just started throwing Happy Cat and taking pictures, but she had decided to take this to heart [laughter]. So congrats to her section there. Just a couple of others. The next submission came from our Drew Rob section, by Mark, so pretty much Mark seems to have shouldered the entire project himself. Here is Mark in Maxwell Dworkin. Here is Mark outside Maxwell Dworkin. [Laughter] Here is Mark in Northwest Science, alone there. Here is Mark in Northwest Science sliding down the pole. Here is Mark hiding, and, again, there's just a theme. Here is Mark checking his voicemail, and, lastly, here is Mark with his head in the statue. So congrats to Mark and Drew's section, and, lastly, Rose's section. They used this neat feature of Google maps where you can actually pinpoint where you found things, so if you're curious as to where all the photos you didn't go find were, do take a look at this particular link, and what you'll see in just a moment, hopefully, is a bunch of blue markers. Still loading. Yes, it's slow, and what you'll see on the map...come on...come on, Google maps. What this section may have...at least one section did, or may have done because I may have mentioned this at one point, is when it was getting hard to fined the photos, especially the ones at the tops of buildings, which frankly I actually forgot, too, where they were, so we were hoping you would find them. What you can do is actually look at what's called the exit data inside of a jpegs [assumed spelling], so in addition to recovering the data of the jpegs, jpegs also have some metadata, which is things like the name of the file, the type of camera that took it, and the date and time at which the photo was taken. So, in fact, if you assumed, reasonably, that we followed a path through campus and didn't randomly run around campus taking photos and then revisiting those places, you can actually kind of trace or infer our steps based on these time stamps in the photos. Now 2 years ago, this didn't even occur to us, and there's a little emblem on the back of the John Harvard statue that even no tourist had ever seen. We found this. We photographed it, and we were amazed that one of the sections actually found it, and it was because of that trick. Well, last year we decided to mess with students, so we altered all of the time stamps just to kind of send them every which way. That kind of hurt participation, so we didn't do that this year, and unfortunately Google maps doesn't seem to be cooperating here, but you will eventually see from Rose's section a sprinkling of markers all over Harvard's campus, and inside of those little cartoon bubbles are the directions to them. So, we'll defer to that one online. So with...oh...so, there were four sections. I used my computer to make four certificates of distinction this morning. Could...if the TF's are here or one student from each section from Lee, John's, Drew, and Rose's section, would you like to come on up, and we'll be taking these sections to a meal in the square right after Thanksgiving break as their prize for their stroll. I see Drew. I see Rose. I don't see Lee or John, which means someone from Lee... oh, Mark. Mark is here. [Laughter] Come on up. [Applause] Congrats to these guys. Very nicely done. We'll be in touch. This is Mark. [Laughter] Ok. Congrats. Oh, and do you mind...the TF's...do you...oh, there we go. Ok. Rose. [Background conversation] Oh, you're together. Drew is right there though. What are you going to make me come down? All right. There we go. There we go. Congrats to you guys. So, we'll have a nice meal before long. [ Applause ] All right. So, if that weren't enough fun problem sets, six challenged you to memorize RAM and CPU time, and it's probably just as well because now it will get a bit awkward because not only did Drew Rob, now Teaching Fellow, win all of these contests last year as a student, he seems to have done so again, but this is not a bad thing because, frankly, we definitely noticed that it seemed to have incentivized a number of your classmates, namely Kevin and Allen up here at the top of the list to really try to best that time, and even though they didn't, this is damn remarkable, and so are Kevin and Allen here who would like to come up and recognize for this accomplishment? Come on down. [ Applause ] So the catch is, if you don't mind, just giving us a couple of sentences on how you minimized your CPU time if you're up for it. >> Kevin: Ok. >> David: Kevin? >> Kevin: So I actually coded my program in Assembly. [Laughter] I used this X86 instruction that [inaudible]. >> David: You didn't think of that, did you? >> Yeah, I didn't think of that either. Yeah, I don't know. I talked to my TF, who's actually Drew, [laughter]. He gave us good tips. [Applause] >> David: Congrats. All right. And here. This is perhaps even more fitting than before. So, here you are. [Laughter] So congrats. So realize that winning the big board was not what that was all about. It was fairly [inaudible] and just making it to the big board even if you were at the very bottom, props to you nonetheless. So congrats though nonetheless to these guys who really went above and beyond in putting in the time. So, Drew, again, walks away this year with 113 quintillion dollars, having grown that from 10,000. Allen, don't go too far because I think we'll put you on the spot and answer the question everyone might have wondered at the time which was how did you earn only 11 quintillion dollars? If you wouldn't mind returning to the stage for a moment. [ Background noise ] >> Allen: So, yeah, what I did is I stole Charles' idea of just trading volume indices, but Drew did better than me because he figured out you didn't even need to wait for them to improve because if you put like a bunch of like random characters in there, it like only remembered it some of the time, so Drew basically made a bunch of trades where he basically immediately made like, I don't know, like a quintillion dollars every time, and then just made a ton of them and crushed me. [Laughter] >> David: Well congrats nonetheless. [Applause] All right. So, admittedly there's some bugs in our big board. We'll perhaps take care of that next year, but this is by far the first time that someone so completely vanquished all previous records. So we wanted to recognize one other student. We...take a look at the big statistics for the bulletin board, which is, if you never tuned in, and now that we know that you did or didn't because we looked at the statistics, is the synonymous bulletin board by which you can ask questions, answer questions, and there was three folks in particular, and I'm happy now to pat myself on the back that I blew you all away when it came to posting to the bulletin board, followed by Glen Holloway, who you never see, but who's also been invaluable as sort of my behind the scenes consularie in the course, but Jeremy Cushman, if he's here, with 162 answers really. There was an occasional question, but we're quite grateful that he would often pluck off questions before we even had a chance. So Jeremy, we made you a certificate, too. [ Applause ] Very nicely done. >> Jeremy: Thank you. >> David: Have another...we always get them afterward. All right. So with that and hopefully at this point, you have filled out a few questions on this piece of paper because you only have a couple more minutes to do so. So you have in your hands from when you walked in probably a piece of paper, and the bottom corner of which is either the number one or the number two on the back. This was an accident. This is what happens when I send an email to have something photocopied and don't think we only wanted you to get side 2 or side 1, so we thought we'd leverage some probability here, and we're just saying go ahead and fill out with questions and answers either side 1 or side 2, and we're hoping purely by chance that roughly 50% of you will choose 1 and 50% of you will choose 2. So if you haven't done that, take the last couple of minutes here to do so and come up with a couple of quiz show like questions, and what I thought I would do then as you finish that up is this here. So we looked at the surveys from problem set 5, and you'll be hit with one more toward the end of the semester because it's invaluable data for us as we improve this semester, and I wanted to give this student his or her 15 seconds of fame, too. So this is respondent number 29 who wanted their survey put up just like the birthday boy from a couple of weeks ago. This was interesting, and whenever we see nonsense, we tend to assume that it's something like route 13, so, yep, we pulled this up here, route 13 converter. I'll just go with the top link here. Nope, not working. We'll go for the second link here. We could do this by hand, of course. We know how, but I'm just going to go ahead and fill in that blank like route 13, and this student had this to say. [Laughter] So your 15 seconds are now up, but thank you for your feedback, and this was also a theme here, too, in the survey. So I only took one of these quotes, but throughout the surveys for pset 5 were comments along these lines. So you recall that the course website for some time featured a whole bunch of wall cats which, no, of course the website featured for a whole bunch of time some staffs, so teaching fellows, [inaudible] course assistants, and occasionally me, we decided to swap ourselves out recently with a wall cat of the day. [Laughter] So, this is from a very popular, funny website called icanhascheezburger.com, and they provide what's called an RSS feed. RSS is an XML based language, a tag based language, and you know, we had a bit of free time so we went to their website. We found the link to RSS feed. We then wrote a little PHP program that every few minutes queries their website, grabs at that RSS feed, and much like our proxy for pset 8, traverse the RSS that came back from Google news, so do we traverse the RSS that comes back from icanhascheezburger. We look for the most recent jpeg that they've imbedded in their RSS feed, and then we save in our local database a copy of that URL, and then we proceed to imbed it in our own website, and so this thing doesn't change every minute or so, but any time they update their feed, within a few minutes, we've actually captured these changes as well. And we also dove in and played around with some other things which we thought we'd draw your attention to because, as you exit this course, there will come a point where you're certainly not going to be handed a PDF that tells you exactly how to proceed to tackle some problem, so we've been having great fun this year building out these various API's, application programming interfaces, and this is really just to lower the bar to getting data that's interesting on campus, but as this Wiki page, which is linked on the course's website reveals, there are so many fun data sets and tools that you can patch into whether it's for the iPhone or Facebook or calendars or finance or maps or any number of things, and so just to inspire your, oh, forthcoming final projects, I thought I'd draw your attention to the solving of two problems, for instance. So we have a number of students who want to implement some food based projects for their final project, and by that, we mean doing something with the dining hall, and you may recall crimsondining.org was made by a former CS50 student and TF that does something along these lines, but we decided that, you know, it's not going to be the best use of time if a whole bunch of students go to wub, wub, wub dining.harvard.edu. They pull up the menu, and then you have to figure out somehow how to get this data into your website. So a number of you at this point in the term are probably a, not thinking about final projects at all or 2, are but really have no idea how you're going to implement what you proposed implementing in your proposal. So just to help you realize that you now have underneath your belt a whole bunch of tools and building blocks with which you can figure these things out on your own, I thought I'd in just 60 or so seconds explain how we went about grabbing all of the data from Harvard dining website, Harvard dining's website, so that we now reexpose it to any student who wants it in CSE format or in Jason format via that Wiki page before. So I went to this website, and I said, wow, I'd really like to start screen scraping, as it's called-grabbing data from this website so I can get it into my own database, some turkey sausage, some egg beater, some egg whites, so I took a look at the source code for this page, and in the source code of this page is, all right, some HTML, or XHTML, and then I noticed, all right, let me search for sausage. So I knew that that's in the webpage, so here's my turkey sausage, and I realized that there seems to be a structure to this page. It's a bit messy. It's kind of indented all over the place, but notice that turkey sausage is inside of an anchor tag, a link. That's inside of a span. That's inside of a dib, but even more interesting is that that dib has sort of a special moniker. It's of class item wrap, and, sure enough, if I continued scrolling down through the file, pretty much any piece of food-here's egg beaters-was similarly inside of a dib whose class is item wrap. So I noticed this pattern, and I figured, oh, if I can now somehow go after this XHTML looking for this pattern, I can do what's called screen scrape. So I went to my command line, and I pulled up a little PHP. I pulled up my text editor, and I ended up writing something that looks a little something like this. And how all this code works doesn't matter so much now. I'm happy to send this to folks by email if you'd like to take a closer look, but, in a nutshell, I went ahead and I grabbed the URL, I pasted the URL from the browser into this script somewhere in a constant, and then I proceed to fetch that using file get contents or something similar which actually then goes and grabs the data, and then I did this trick and this is your little hint. If you ever have to do this in life, when you have XML data, there are ways of querying that XML data using a language called XPATH, and XPATH essentially lets you say something like this. If you want to get out all the dibs in the page, you use a query like slash HTML, slash body, and then you can do something like slash, slash, dib, and this expression, it's sort of like a file system path-c, colon, backslash or whatever-that path there will return to me an array of all of the dibs inside of the body, and so this slash notation is very similar in spirits any file system. So long story short, I wrote a script that searches through this source code, grabs all of the dibs, and then I check. Are you a type class item wrap? Are you? Are you? And then using very similar syntax then I pluck out turkey sausage and egg beaters and egg whites, and then finally I did an insert into my SQL tables. So the end result is that if you ever want to find out what's coming up for breakfast, you can execute a query of CS50 zone server, get back a CSB file that looks much more machine friendly, a CSB file with rows and columns and dates and food types and all of this. So, again, you now have the ability to at least identify potential problems, and hopefully now you have heard enough details that even if you have no idea about how to go about using XPATH, it's really just a Google search or Wikipedia article away at this point. Finally, we also had some fun this weekend given that so many of you have been diving into your own final projects, we decided to take our own map site, research from Mather House, and now we integrate Wikipedia articles automatically into the thing. Why? Just because. And also for official photographs of all of the buildings and so you get little pop ups like this from Mather House, and if you'd really like to engage dynamically in something like this and don't like the fact that Wikipedia's telling the world that Mather is the box that dumpster came in, quote, unquote, well hey. [Laughter] We don't sensor in 50. Well, hey if you don't like it, Matherites, go change it. We'll notice the change within an hour or so of it getting edited on Wikipedia, so perhaps we'll induce some changes to all the houses. We can, let's see what Lowell House has to say in Wikipedia...one of the twelve, dat, dat, dat. It's actually a very nice flattering article. So [laughter] Lowell House is a little nicer there. And then finally, did we do anything else? No. That's enough for now. So, hopefully, at this point in the story, you've filled out this form, yea or nay. So we had a few volunteers from staff, so could our staff contestants come on up? A few faces may look quite familiar, and really any of the staff who are seated here are welcome to come up on stage-the more the merrier, and now we need at least two, maybe three, of those less comfortable, more comfortable, or somewhere in between to take the remaining chairs up here for our finale quiz show of sorts, for which you, hopefully, just wrote the questions. Any volunteers who would like to match wits with the staff? >> Down here. >> David: Yep. Ok. Come on. Ok. You, too, and three, and is there someone down here? Four. Come on down. All right. I think we have enough chairs for everyone. Oh we have five. Fifth, fifth contestant? Oh, ok. Five and six. Come on up. All right. So it's now six versus four. Let me go ahead and ask Jansu and the remaining TF's who are a little too shy apparently to come on up. Could you guys just collect the forms that people have filled out and bring them on up front, ideally flipping them for the right side based on what's been filled out? Come on up. That's very nice. Oscar. [Background noise] All right. So, can you grab a couple, two chairs? In just a moment, you'll see another website we've been working on which looks a little like this. Very high tech. This is all HTML based, and in just...this is the biggest Jeopardy competition we've ever had. Ok. So in just a moment, we will have the following. >> And now here is the host of Jeopardy. And now here... >> David: Oh. My iPod is on loop. Awkward. All right. Normally that sounds better. All right. Here we go. >> [Background noise] This is Jeopardy. >> David: Thank you. [Background noise] Thank you. Any [inaudible]? All right. So ok you don't have to stand there awkwardly. You may take your seats. So we have just a few minutes before we adjourn to some cake downstairs. What you have in front of you are two huge teams...oh no. We can get another...oh, get a chair. Yeah. Thank you. Thank you. Ok. So, why don't we very quickly go down the row here and say who you are and say one interesting thing. Interpret as you will. You. Oh, and be sure to speak very deliberately into the speakers. >> Matthew: My name's Matthew [inaudible], and I'm a CS50 TF >> Rose: Hi, I'm Rose Cowl, and I'm also a CS50 TF. >> David: Excellent. [Laughter] Keep it going. >> Mike: Hi. Mike, and I'm also a CS50 TF. >> David: Ok, this is no longer interesting. [Laughter] >> Greg: Hey, I'm Greg, and I enjoy making juice. >> Kevin: Hi, I'm Kevin, and I'm Greg's roommate. >> Robert: Hi, I'm Robert, and I thought it was really interesting how today in EC10 Professor Mankiw alluded to a set with measure zero. [Laughter] >> John: Hi, I'm John. I'm from Liver House. >> Michael: Hi, I'm Michael. I'm an econ concentrator who hates econ. [Laughter] >> Josh: Hi, I'm Josh. I have conducted an orchestra while wearing a gorilla suit. [Laughter] >> I'm [inaudible.] I'm from New Mexico, and some people don't realize it's part of the United States. [Laughter] >> Anna: I'm Anna. I'm from Utah, which used to not want any part of the United States. [Laughter] >> David: Very nice. And we have Jensu [inaudible] who's going to run our scoreboard here. We'll have the staff score on the left, the students' score on the right. We did a little coin toss before class, and the students won the toss, which means you students have control of the board. We're kind of going to butcher the logistics of Jeopardy here and kind of just go with what works. So, with that said, go ahead and pick a category. If you need a little cheat sheet, you probably...we'll get you some blank sheets of paper, so you know what week was what. Go ahead and pick a week and a dollar amount. Anyone on the students' team. >> Week 2, 1000. >> Week 2 for 1000, going in strong. So your question for week 2-should've said write legibly. Your question for week 2...ok we'll start off with this. Rock[assumed spelling] 13 plus rock 13 equals...first hand up gets it. Ok, students? >> Rock zero. >> David: Actually the answer is awesomeness. [Laughter] We'll give it to them. So Jansen will be our judge. A thousand dollars to the students. Ok, and you're still in control of the board. We came prepared with this. [Applause] Very nice. Ok, you're in control. What would you like next? [Background noise] IQuality [assumed spelling] is on automatic play now. What the? [Background noise] Not very good with technology. Ok, students, what would you like? >> Week 3, 800 >> David: Oh wait, I'm not doing this right, am I? Ok. Week 2, what? Sorry? >> Week 3, 1000. >> David: Week 3 for 1000? Ok. Week 3. Your question is what is the lower bound on the running time of bubble sort? Matt. >> Matt: Omega of N. >> David: Omega of N. Audience, what do you think? [Background noise] Who's going to answer? Yes? No? Ok, yes. Do we want this to evolve into one of these things where we... [Background noise] Uh, all right. Sanders has never been so proud. All right. TF's, you are in control. What category would you like? >> Week 4 for 1000. >> David: Week 4 for 1000. What happens if you don't allocate memory before signing...Robert? >> [inaudible] >> David: Bad things. [Laughter] Very good for 1000. Students are in control. Oh, sorry...I'm not...there we go. What's left? Everything except those 2. Higher? Oh, was it week 4? All right. Well, there's no week 3 for 1000 any more. User error. >> Week 0 for 1000. >> David: Well 0 for 1000. All right. So, oh my goodness. What is...this is really not week 0 material, but ok. What is the ASCII value of the open curly brace? [Laughter] No, funnier is, who knows this? Yes, students. >> Cast, open curly brace. >> David: Ooh. >> No. >> David: No? Rejected, so that's minus 1000 for students. It's been rejected. Audience? [Background noise] 198? Is that...90? No? I don't think so. Minus 1000. [Laughter] Anyone? Who wrote the question? Come on, fess up. >> One, two, three. >> David: Oh, wait. Huh? What's the answer? 123 is in fact...I'm not going to throw correctly, but here you go. Wow. [Applause] Nice. Um, yeah I think we should take off the points. Yeah, yeah, they were wrong. So it's tied at 1000. We have time for a couple more questions in Single Jeopardy. What would you like your next category to be? >> 1000. >> David: Week 1 for 1000. Your question here is, oh...what does GCC stand for? Greg's hand went up first and then went down quickly. [Laughter] >> GNU Compilation Compiler...GNU C Compiler. >> David: Audience? [Background noise] Did you know that though? Yes it's true, so, 1000, that is correct. The GNU C Compiler, so extra credit if you go figure out what the GNU stands for some day. >> GNU's not UNIX. >> David: Ok, you're all very smart now. All right. Ok, staff is in the lead by 2000. We have time for one more single Jeopardy question. What's it going to be, staff? >> Something 800. Week 4, 800. >> David: Oh sorry. >> Week 4, 800. >> David: What? Week 4 for 800. So week 4 for 800, and your question's going to be...week 4 for 800. Blank. Week. What? I do need help. What, oh, what is the name...we're going to take today very seriously... what is the name of the pointer video we watched from Stanford? [Laughter] I saw Rose's hand. Yep? >> Blinky's Pointer Fun? >> David: Judges? [Background noise] Rejected for minus 800. Students? >> Fun with pointers? >> David: No. [Laughter] And the answer was Pointer Fun with Blinky. Who knows that? All right. So now we transition to Double Jeopardy where the scores on the board double. Why don't we take a moment to ask students how's the game going for you thus far? If you'd like to step up and field this kind of question. What's your strategy moving forward? >> Sudoku? >> David: What was that? >> We'll just write some sudoku? >> David: And, staff, what's your strategy for taking these guys down? >> We're just going to continue dominating, David. I think this is working for us pretty well thus far and, you know, we're just going to stick to it. >> David: Yes, your $200 lead is massive here. All right. So, let's see. I think the staffers still in control? So, staff, what's your choice of weeks here? New weeks on the board. [ Background conversation ] Yes, Matt, 2000 it is. [Laughter] So, week 10 for 2000. Oh, softball. What does CPU stand for? Jensu picked the students. Ok, students? >> Central processing unit? >> David: Audience? >> Yes. >> David: Yes. Very nicely done. So now it's 3000 to 1200, Matt. Students, what's it going to be? Time for a couple more questions. Students? Oh, sorry. What's it going to be? The one with the...[background noise]. Oh, you want to know what this is. Well, wait, I came prepared. That's going to be an audio daily double, and that period is my clue to myself to remember that. [Laughter] Ok. One moment. Got to find...ummm. Ok. For $1200, who is...let's see. This is the students. Name this tune. [Background noise] I think the students get the chance to answer this. This is the Hamster Dance for $1200. All right we have time for one more question before...that's 1200. All right. Matt, it's time to dominate. Students, you are in control. >> Week 9, 2000 >> David: Week 9 for $2000. In week 9, your question is going to be...let's see if we can pick a winner here. Your question is going to [laughter]...this is just a question...this is just an opinion. Is the music played during lecture breaks pseudo random? Justify. [Laughter] Ok. All right. No, that's not the question. The question will be...all right...this person drew pictures-very well, including a toilet, a hammer, a tree, a star, a rainbow, a lollipop. That was a [laughter]. Ok. Glad you enjoyed the first part of lecture. All right. Finally, week , what are we in, 9? So your question is going to be...your question for week 9...ok. Perfect. This is quality. Week 9. First hand up gets it Ready? How awesome is Ajax? Max. >> Max: Really, really awesome, David. >> David: Very. [Laughter] That's ok. Why don't we go ahead and...why don't we go ahead and officially adjourn here after Double Jeopardy because yeah...that just...yeah. I think it's time for cake. Congratulations on a wonderful semester. We will see you downstairs in the pub if you would like a snack. [Applause] [ Music ] [ Background conversation] [ Music ] ==== Transcribed by Automatic Sync Technologies ====