WEBVTT 00:00:00.000 --> 00:00:06.913 Alright, welcome to the last CS1 Lecture Session. There's not going to be exercises 00:00:06.913 --> 00:00:10.909 for this section. I'm just going to try in, I don't know, summarize what it all 00:00:10.909 --> 00:00:15.283 means and talk about some next steps. So, for CS101, I took the strategy of just 00:00:15.283 --> 00:00:19.656 jumping right in with code really and we got into the detail of codes and played 00:00:19.656 --> 00:00:23.814 with the code and my plan was that as you played with code and have bugs and 00:00:23.814 --> 00:00:28.566 experimented that you would gradually just come to see what some of the features are 00:00:28.566 --> 00:00:33.435 of the computer. So, I hope that works. Today I'm going to step back and talk a 00:00:33.435 --> 00:00:38.360 little bit about what it means and [inaudible] and things so first thing I 00:00:38.360 --> 00:00:43.811 want to talk about is this word algorithm. I may have used here and there. Algorithm 00:00:43.811 --> 00:00:48.867 actually it's named after a Baghdad astronomer Al-Khwarizmi. Some of his work 00:00:48.867 --> 00:00:54.362 ends up in the word algebra so he's rather influential. So the given algorithm Refers 00:00:54.362 --> 00:00:58.570 to the steps to take to get something done. So, not just saying well I want this 00:00:58.570 --> 00:01:02.990 script to be you know blue. That's just saying what the goal is. The algorithm is 00:01:02.990 --> 00:01:07.464 really figuring out something to describe one step sort of. Now it's not the same as 00:01:07.570 --> 00:01:12.044 syntax. Syntax is really a computer language feature so algorithms I would say 00:01:12.044 --> 00:01:16.411 capture really human, human creativity of how I might going to solve something And 00:01:16.411 --> 00:01:20.377 really, for CS101, very often for the exercises are in lecture examples. I've 00:01:20.377 --> 00:01:24.184 been describing an algorithm. Oh, take the picks and do this and do that, whatever 00:01:24.184 --> 00:01:27.799 describing the, describe is going to be And then I've left it to you to, to then 00:01:27.799 --> 00:01:31.558 phrase into code and that, that's just a totally classic computer system way to 00:01:31.558 --> 00:01:35.269 work. You have human, you have the idea, unless you get phrased in the code. I'll 00:01:35.269 --> 00:01:39.826 have other bunch of examples sort of. Hit that pattern. So this is an example, I 00:01:39.826 --> 00:01:45.623 won't go to the details exactly but here's the code from the Monkey Moon example and 00:01:45.623 --> 00:01:51.283 so we had the strategy of like computing average and then trying and find the blue 00:01:51.283 --> 00:01:56.808 background behind the monkey and then copy the red, green, and blue pixels that is 00:01:56.808 --> 00:02:02.468 over. So such thin g is that, that's the idea which was pretty complicated and you 00:02:02.468 --> 00:02:07.160 know effective and then here it is expressed into code And party, I mean, 00:02:07.160 --> 00:02:10.971 it's a little bit of amazing that we did and my code is fairly complicated, right? 00:02:10.971 --> 00:02:15.422 So, at least a couple of weeks ago, you didn't, you didn't understand this so it 00:02:15.422 --> 00:02:21.475 also shows the gap where we had this plan, what we're going to do but then look at 00:02:21.475 --> 00:02:26.638 the individual steps in the code. Pixel dot got red. You know, average times 00:02:26.638 --> 00:02:31.259 you're pointing on too. The building blocks that the computer has are really 00:02:31.259 --> 00:02:36.307 pretty simple and I just get that. There's no insight, it's just mechanical and then 00:02:36.307 --> 00:02:40.928 in a way, they get what a computer programmer does. I've taken an idea that's 00:02:40.928 --> 00:02:45.610 interesting and valuable and sort of phrase it down to the computer, break it 00:02:45.610 --> 00:02:50.657 down into the little mechanical steps that the computer can do to sort of build up 00:02:50.657 --> 00:02:55.153 the program that we like one And that's. That's a key example. That is what, that's 00:02:55.153 --> 00:02:59.180 what the modern world looks like in terms of the computers, computers doing some 00:02:59.180 --> 00:03:03.357 usual stuff. So, as long as I was talking about code, you know, having an algorithm 00:03:03.357 --> 00:03:07.283 for phrasing them to code, I also thought I could revisit the word bug. I'm sure 00:03:07.283 --> 00:03:11.411 this is a word you've all heard at one time or another. Here's a little example 00:03:11.411 --> 00:03:16.473 of a bug where I, I have to [inaudible] over the image. And then here I've 00:03:16.473 --> 00:03:21.452 mentioned I'm trying to change the image to gray. So, I could help the line of 00:03:21.452 --> 00:03:26.820 average equal pixels to get red plus get green plus get blue/3. The problem here 00:03:26.820 --> 00:03:30.943 This code does something. It just doesn't compute the averages I intended. The 00:03:30.943 --> 00:03:35.389 problem here is that the slash three only applies to get blue. We would need to put 00:03:35.389 --> 00:03:40.102 [inaudible] in here to make it work right. So the results is that was [inaudible] and 00:03:40.102 --> 00:03:44.333 so the numbers going to come up like 450, just way too big and so setting it in to 00:03:44.333 --> 00:03:48.885 the image makes the image come out almost near white. This is just an example of a 00:03:48.885 --> 00:03:53.170 bug where there was intent, well here's the other thing that I might want to do. 00:03:53.170 --> 00:03:58.516 But the code I typed in Said something else. It, it said something but it had 00:03:58.516 --> 00:04:03.110 steps the computer could follow but it wasn't the ones I intended. And that's. 00:04:03.110 --> 00:04:07.628 That's very often what bugs looks like and I'm sure you've have run in the bugs all 00:04:07.628 --> 00:04:11.985 the time. So there's a little insight of how, where the gap was between the intent 00:04:11.985 --> 00:04:16.449 of the programmer and running out the steps for the, the computer actually do so 00:04:16.449 --> 00:04:21.021 this sort connection I'm talking about is at the very start of the class I made this 00:04:21.021 --> 00:04:25.539 kind of a provocative claim well you know computer is to powerful plus two. Computer 00:04:25.539 --> 00:04:29.788 is so stupid and limited and I stand out of that I think because you have seen 00:04:29.788 --> 00:04:34.000 [inaudible] limitations and yet. That was very useful we have e-mail and the 00:04:34.000 --> 00:04:38.642 Internet and computer games. All of these are phenomenally valuable awesome useful 00:04:38.642 --> 00:04:42.887 stuff so how that works? And I guess ultimately the answer is humans, That a 00:04:42.887 --> 00:04:47.415 human programmer had a creative, an idea of like here's what I'm going to do and 00:04:47.415 --> 00:04:51.434 this is going to be great and that's really where, that's what computer 00:04:51.434 --> 00:04:55.906 programming are, that's what computer programmers are and that's where computer 00:04:55.906 --> 00:05:00.490 science is about and then it gets broken under these steps with the computer can 00:05:00.490 --> 00:05:06.342 actually do it. So I just have some, some examples here. Grab some of theses from 00:05:06.342 --> 00:05:10.679 Stanford so these are examples where you have the computer installing these 00:05:10.679 --> 00:05:14.906 mechanical stuff between something [inaudible] it's kind of professional. So 00:05:15.071 --> 00:05:19.682 Daphne [inaudible] at Stanford has this awesome research on grading cancer cells. 00:05:19.682 --> 00:05:24.315 So basically, you have a [inaudible] dish with some sample cells in it. And you show 00:05:24.315 --> 00:05:27.925 a computer an image of it and then the computer is going to eventually, she 00:05:27.925 --> 00:05:31.486 trains the computer to do great, so something that normal humans do that's 00:05:31.486 --> 00:05:35.577 actually pretty difficult and humans have a tough time doing a good job out of it. 00:05:35.721 --> 00:05:39.379 And so, but when I get that, this looks like a little bit like our image code. 00:05:39.379 --> 00:05:42.941 It's not that you just say that the computer, hey, I want you to grade this. 00:05:42.941 --> 00:05:46.949 Really, you know, the computer just has. Values, you know, bunch of numbers and can 00:05:46.949 --> 00:05:51.308 do less than and gr eater than, you know, loops are those building blocks and so the 00:05:51.308 --> 00:05:55.349 [inaudible] ingenuity to phrase up an algorithm for the computer using it's 00:05:55.349 --> 00:05:59.495 simple [inaudible] to do something profoundly useful like [inaudible]. I'll, 00:05:59.495 --> 00:06:04.014 I'm just putting links here. If you want to visit the document then you could try 00:06:04.014 --> 00:06:08.603 this up. Another example of this just sort of amazing is there's a treatment for 00:06:08.603 --> 00:06:12.988 certain forms of deafness called the cochlear implant and this is a little bit 00:06:12.988 --> 00:06:17.595 of controversy about the deaf community about if this is a good idea or not but it 00:06:17.595 --> 00:06:21.869 is amazing. Other works is there is a microphone that takes in sounds and the 00:06:21.869 --> 00:06:26.532 sound waive is kind of like we saw in the analog and digital lectures are processed 00:06:26.532 --> 00:06:30.695 by a computer and eventually ultimately ending up going into wires that go 00:06:30.695 --> 00:06:35.549 directly in to the, the sense organ in the head and so. It's, it's possible to give, 00:06:35.549 --> 00:06:40.335 not exactly hearing but sort of hearing for someone who is potentially completely 00:06:40.335 --> 00:06:45.177 deaf before. So there's, I gotta say, a fairly amazing video Youtube video clip 00:06:45.177 --> 00:06:49.625 here of the baby hearing their mother's voice for the first time. And so it's, 00:06:49.794 --> 00:06:54.523 it's what's saying, future is about that. I gotta say, if I was an engineer who had 00:06:54.523 --> 00:06:58.971 anything to do with this project, I would very proud. Like that is a, it's such a 00:06:58.971 --> 00:07:03.420 vivid example of the technology really changing someone's life Last example. 00:07:03.420 --> 00:07:08.599 Also, a part from Stanford is this idea of self-driving car. So this involves, the 00:07:08.599 --> 00:07:12.396 car has all sorts of cameras and range finders on it and it's sort of, I'll put 00:07:12.396 --> 00:07:15.953 it in quote. It's Kind of seeing surrounding and trying to understand what 00:07:15.953 --> 00:07:19.846 the obstacles and pedestrians, whatever are and then making decision in real time 00:07:19.846 --> 00:07:23.911 like it has to decide right now what to do. That's profoundly a hard problem. But 00:07:24.087 --> 00:07:29.433 so Sebastian's run at Stanford and now we can do this in Google he has made a lot of 00:07:29.433 --> 00:07:34.074 partners with this and I gotta say, I'm sort of a national optimist but I think 00:07:34.074 --> 00:07:38.304 this is all going to happen. I think it's going to happen because although the 00:07:38.304 --> 00:07:42.660 technological challenges are enormous, ultimately it will sa ve time And as 00:07:42.660 --> 00:07:47.640 society becomes more wealthy, time is just something everyone values. I think that's 00:07:47.640 --> 00:07:52.440 going to provide a lot of pressure to make, make this work so I'll be, I'll be 00:07:52.440 --> 00:07:57.600 interested to deliver long enough to see that working. All right So I want to talk 00:07:57.600 --> 00:08:03.820 a little bit about you know post C101, things you might want to think about. So 00:08:03.820 --> 00:08:08.095 Most people are not going to be computer programmers, That's fun we need more but 00:08:08.095 --> 00:08:12.242 life certainly is not for everyone. So I think there is kind of a skill to just 00:08:12.242 --> 00:08:15.984 working with computers. Computers obviously have the sort of mechanical, 00:08:15.984 --> 00:08:19.928 slightly fragile and I think that just have to be just so way that are. And my 00:08:19.928 --> 00:08:24.075 hope is that, with CS101, you've seen how that is at times and in different ways 00:08:24.075 --> 00:08:27.969 that you, it's [inaudible] you a little bit of confidence and a little bit of 00:08:27.969 --> 00:08:31.964 patience. I think sometimes, people [inaudible] something in the computer and 00:08:31.964 --> 00:08:35.958 I click the button and it doesn't do what it's supposed to. And there's, there's 00:08:35.958 --> 00:08:39.681 sort of stuck of well what I do know. And I think they can get past that stuff 00:08:39.817 --> 00:08:43.339 whereas now, I think you've seen the, the kind of the mechanical quality of the 00:08:43.339 --> 00:08:46.727 computer. My hope is to have a little patience. So, okay, well, we're not doing 00:08:46.727 --> 00:08:50.250 what it's supposed to, let me read the docs again, there's probably some little. 00:08:50.250 --> 00:08:55.286 Dumb thing right I'm missing semi colon or whatever. Some little detail that computer 00:08:55.286 --> 00:08:59.967 is going to get trip by and so I think there is a skill to no getting derailed 00:08:59.967 --> 00:09:04.707 when a computer messes up like that and I'd like to thank that CS1 on help. I'll 00:09:04.707 --> 00:09:09.388 give you what skill a little bit. It's certainly a very handy life skill since 00:09:09.388 --> 00:09:14.326 computers are everywhere. So finally let me list of. Classes where thing, things 00:09:14.326 --> 00:09:18.964 you might want to study after CS101, I have bad news about this. There is not a 00:09:18.964 --> 00:09:23.803 class which I think is really a good fit to just be right after CS101 there is just 00:09:23.803 --> 00:09:28.238 one that I know of so I'm not going to recommend the specific one but there's a 00:09:28.238 --> 00:09:33.077 lot of research and activity in that area. Someday day maybe I'll create one but I'm 00:09:33.077 --> 00:09:37.340 done yeah. So I'm just going to mention things that you could look at sort of 00:09:37.340 --> 00:09:41.786 Poseus point of view. So one thing I'll mention is spread sheet. Spreadsheets are 00:09:41.786 --> 00:09:45.628 very commonly used to organize data or do computations or whatever; you probably, 00:09:45.628 --> 00:09:49.663 probably heard them. So the next time you see a problem where someone says oh hey, 00:09:49.663 --> 00:09:53.361 we could do a spreadsheet for this I'd say, you might want you know, you could 00:09:53.361 --> 00:09:56.963 consider. You might want to take a shot of that. The sort of "programming in 00:09:56.963 --> 00:10:00.805 spreadsheets" is not that different from what we've done. Microsoft Excel is a 00:10:00.805 --> 00:10:04.791 super popular spreadsheet but it's not free. The Google Docs spreadsheet is free 00:10:04.791 --> 00:10:08.834 and actually it uses JavaScript which is the language we've been using so. Is just 00:10:08.834 --> 00:10:12.025 so I guess have a question of, of confidence of being open like, be open to 00:10:12.025 --> 00:10:15.647 reading the docs and reading some examples I'm trying to use them specially I think 00:10:15.647 --> 00:10:19.311 would not be much a lot of them from what we've done and they're very common. Very 00:10:19.311 --> 00:10:23.763 commonly used for, for problems, for problems like that. So another next step 00:10:23.763 --> 00:10:30.206 is to take a sort of your general college introduction to [inaudible] course. A lot 00:10:30.206 --> 00:10:36.636 of colleges just have this and I think some high schools to. So Cs101 is not a 00:10:36.636 --> 00:10:43.606 general programming course. I had the analogy somewhere that it's as if there is 00:10:43.606 --> 00:10:48.756 this island and it has. Hundred miles of trails on it which represent all the 00:10:48.756 --> 00:10:53.533 different types of program you might want to do and a way when a time with CS101 is 00:10:53.533 --> 00:10:58.195 I've, I have very carefully chosen fifteen miles of trail. So, I've showed you, you 00:10:58.195 --> 00:11:02.681 have seen real programming issues. You definitely have the sense of what bugs 00:11:02.681 --> 00:11:06.992 are, what those are and those are absolutely vital core programming and of 00:11:06.992 --> 00:11:11.788 course, you, you have done them [inaudible]. However There is the 85 other 00:11:11.788 --> 00:11:15.227 miles all sorts of stuff. I didn't talk about it. I sort of constructed my 00:11:15.227 --> 00:11:18.942 examples and the way the lectures work to just carefully use the things I talked 00:11:18.942 --> 00:11:22.794 about and not trying to get distracted by all of the stuff I didn't talked about. So 00:11:22.794 --> 00:11:26.279 you just know. That's kind of CS101 leave you versus the regular program and c 00:11:26.279 --> 00:11:29.947 ourse. In a way you've been a nice head start. You've seen all these computer 00:11:29.947 --> 00:11:33.570 stuff. You have seen loops or whatever setting. You have got a bit of a tail end. 00:11:33.570 --> 00:11:37.719 Going to it, general programming course You would expect it to move faster than 00:11:37.719 --> 00:11:41.974 CS101. I was pretty, I tried to keep CS101 at a pretty measured hay anybody can do 00:11:41.974 --> 00:11:45.809 this. I don't want to be able to, stressful experience. So you, you would 00:11:45.809 --> 00:11:50.064 expect a bump up in the speed but certainly something I'm sure many of you 00:11:50.064 --> 00:11:56.096 would enjoy doing. So something about I'm just going to mention a couple other, a 00:11:56.096 --> 00:12:02.904 sort of specific type of programming that people talked about. So HTML five or first 00:12:02.904 --> 00:12:09.095 to web page programming that's done with HTML, Javascript and CSS. We've done 00:12:09.095 --> 00:12:13.605 JavaScript in CS101 but I gotta tell you, the JavaScript for web pages is going to 00:12:13.605 --> 00:12:17.941 look more complicated, have more going out. We, we do this very stripped down 00:12:18.114 --> 00:12:22.861 very focused type of JavaScript. So, for lot of these kind of topics that I 00:12:22.861 --> 00:12:27.462 mentioned here. A, the [inaudible] college students when we think about it is that 00:12:27.462 --> 00:12:32.118 you take the General Programming course to just sort of get a general loop statement 00:12:32.118 --> 00:12:36.227 sort of experience to have a sort of generic ability and then you make the 00:12:36.227 --> 00:12:40.883 specialized and learn about web pages or something. It happens when programming is 00:12:40.883 --> 00:12:45.374 not that hard and so it's possible to just to skip in the web portal in like just 00:12:45.374 --> 00:12:49.866 have a HTML five or whatever. Of course and just sort of just learn the Javascript 00:12:49.866 --> 00:12:54.356 in the contents to that. So. Other than that, I've gotten questions about sort of 00:12:54.356 --> 00:12:58.953 various areas and I, I, I find it hard to identify anyone in particular I say, yeah, 00:12:58.953 --> 00:13:02.621 there's phone programming, game programming, finance programming and 00:13:02.621 --> 00:13:07.123 science programming, that, that, that. What I can tell you is. It's a huge field. 00:13:07.123 --> 00:13:11.582 There's at you know, science, air dynamics, finance, I mean, any, anything 00:13:11.582 --> 00:13:16.235 you could mention. There's, there's computers going on and generally, it's 00:13:16.235 --> 00:13:21.792 regard to there's tends to be a shortage of people and so if you are interested 00:13:21.792 --> 00:13:26.445 about computer, you know, if you learn about computers and y ou want to work 00:13:26.445 --> 00:13:32.068 with, anyways, there's a good chance that you could. There is demand for people who 00:13:32.068 --> 00:13:37.110 know that stuff. So I guess I have to sort of summarize the, the course here so I 00:13:37.110 --> 00:13:41.805 might claim at the very start of the class was the CS1, CS101 teaches the essential 00:13:41.805 --> 00:13:46.443 qualities of computers by playing with code. You've certainly played with a lot 00:13:46.443 --> 00:13:51.241 of code at this point so I hope that sort of holds up my fear Is that people go 00:13:51.241 --> 00:13:55.524 through life. They use computers all the time but they see the computers are sort 00:13:55.524 --> 00:13:59.649 of opaque and not comprehensive but something they could never understand and 00:13:59.649 --> 00:14:04.038 I hope I hope I have put that down. That you can sort of see through the other side 00:14:04.038 --> 00:14:08.494 and appreciate oh The computer is working this way and then I can know this sort of 00:14:08.494 --> 00:14:12.689 thing, Whatever so just sort of pretty in context of how computers work in your 00:14:12.689 --> 00:14:16.619 life. So as I said before I also hope that, with that knowledge CS101 gives 00:14:16.619 --> 00:14:20.814 everyone a little bit of confidence and maybe a little bit of patients to work 00:14:20.814 --> 00:14:25.328 with their computers and kind of get them, get computers to work for them. They are, 00:14:25.328 --> 00:14:29.503 as what I've said they are stupid mechanical but. They're also incredible 00:14:29.503 --> 00:14:31.142 useful. Alright, take care.