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