1 00:00:00,000 --> 00:00:07,700 2 00:00:07,700 --> 00:00:15,180 >> SPEAKER: OK, so, you won't believe it, but last week, on Monday, in Pierce, I 3 00:00:15,180 --> 00:00:16,090 was down in the basement. 4 00:00:16,090 --> 00:00:17,010 I never go to Pierce. 5 00:00:17,010 --> 00:00:20,530 And I'm never going back again, because I left my stuff alone for, 6 00:00:20,530 --> 00:00:23,950 like, five minutes and somebody stole my computer and my 7 00:00:23,950 --> 00:00:26,050 phone out of my backpack. 8 00:00:26,050 --> 00:00:28,780 Which means I got it back, and then less than a week later 9 00:00:28,780 --> 00:00:30,220 it got stolen again. 10 00:00:30,220 --> 00:00:31,570 >> And then it got turned on-- 11 00:00:31,570 --> 00:00:34,540 Find My iPhone continues to be unhelpful. 12 00:00:34,540 --> 00:00:37,340 So I continue to encourage you not to use it. 13 00:00:37,340 --> 00:00:42,270 It turned on once, and it was in MIT, like 15 minutes later, and the person 14 00:00:42,270 --> 00:00:45,770 called this phone number that showed up in my AT&T call log. 15 00:00:45,770 --> 00:00:48,830 >> So I went online, called that phone number, and it went straight to this 16 00:00:48,830 --> 00:00:50,540 answering machine in Spanish. 17 00:00:50,540 --> 00:00:52,520 And I haven't heard of it since. 18 00:00:52,520 --> 00:00:54,800 So I had to get a new computer and phone. 19 00:00:54,800 --> 00:00:55,150 I know. 20 00:00:55,150 --> 00:00:56,326 Yeah. 21 00:00:56,326 --> 00:01:00,110 But if you guys want to chip in to my computer fund after this, that's why 22 00:01:00,110 --> 00:01:01,030 I've asked you here. 23 00:01:01,030 --> 00:01:02,280 Just kidding. 24 00:01:02,280 --> 00:01:04,239 25 00:01:04,239 --> 00:01:07,420 But that was really sad and traumatic. 26 00:01:07,420 --> 00:01:10,700 >> But it's all back now, and that was why the p-set 8 took so long, because 27 00:01:10,700 --> 00:01:12,480 I didn't have a computer. 28 00:01:12,480 --> 00:01:13,730 And somebody stole it. 29 00:01:13,730 --> 00:01:16,940 And I emailed, asking if they would grade your p-set 8. 30 00:01:16,940 --> 00:01:18,790 But they said no. 31 00:01:18,790 --> 00:01:20,000 And I was like, can I have my computer back? 32 00:01:20,000 --> 00:01:21,270 And they're like, no. 33 00:01:21,270 --> 00:01:22,130 Just kidding. 34 00:01:22,130 --> 00:01:22,930 >> OK. 35 00:01:22,930 --> 00:01:28,140 This is our final section, and I have a couple of-- we only have three 36 00:01:28,140 --> 00:01:29,790 things on the agenda. 37 00:01:29,790 --> 00:01:31,330 We're going to talk a bit about the Q guide. 38 00:01:31,330 --> 00:01:33,900 Then we're going to spend 15 minutes on a cool demo. 39 00:01:33,900 --> 00:01:36,890 Then we're going to all say goodbye to one another. 40 00:01:36,890 --> 00:01:41,460 You don't really need your computers or a pen or paper to take notes, or 41 00:01:41,460 --> 00:01:42,410 follow along. 42 00:01:42,410 --> 00:01:45,620 So I assume if you have your computer up, then you're on Facebook. 43 00:01:45,620 --> 00:01:46,530 Just saying. 44 00:01:46,530 --> 00:01:49,650 Unless you're filling out the Q guide, which is first. 45 00:01:49,650 --> 00:01:50,690 >> The Q guide is open. 46 00:01:50,690 --> 00:01:53,520 You've had an email about it. 47 00:01:53,520 --> 00:01:56,930 Once all the Q stuff is submitted at the end of the year, I get all of the 48 00:01:56,930 --> 00:02:03,710 Q comments in scores from everybody who chooses to give me feedback. 49 00:02:03,710 --> 00:02:04,810 And so when you go in the Q-- 50 00:02:04,810 --> 00:02:07,440 I don't know if you can do this, Jeff, because you're and extension student. 51 00:02:07,440 --> 00:02:12,730 But when you go in the Q, if you haven't done it before, you pick your 52 00:02:12,730 --> 00:02:14,020 teacher, which is David Malan. 53 00:02:14,020 --> 00:02:14,970 You have to do him. 54 00:02:14,970 --> 00:02:15,690 >> And then you can pick TFs. 55 00:02:15,690 --> 00:02:17,750 And you can pick as many TFs as you want. 56 00:02:17,750 --> 00:02:18,990 But there are 60 of us. 57 00:02:18,990 --> 00:02:20,350 You don't have to pick everybody. 58 00:02:20,350 --> 00:02:23,090 You can just pick me, or just pick a couple other people, if you want, to 59 00:02:23,090 --> 00:02:24,470 give them feedback as well. 60 00:02:24,470 --> 00:02:27,595 And then you get scores on all these different axes, and then you can leave 61 00:02:27,595 --> 00:02:28,570 them feedback. 62 00:02:28,570 --> 00:02:31,520 >> And then, like a month later, I'll get all that feedback. 63 00:02:31,520 --> 00:02:34,570 And just like the feedback you've been giving me throughout the semester, I 64 00:02:34,570 --> 00:02:35,790 read all of that. 65 00:02:35,790 --> 00:02:39,620 And it's really helpful, and it helps me grow as a teacher and as an 66 00:02:39,620 --> 00:02:40,680 individual. 67 00:02:40,680 --> 00:02:43,360 So, please, take some time to do it. 68 00:02:43,360 --> 00:02:45,020 We're only going to be here for, like, 30 minutes. 69 00:02:45,020 --> 00:02:48,090 So if you want, at the end of this, to take five minutes, and just fill out 70 00:02:48,090 --> 00:02:49,960 the Q, because it doesn't take any more time than that. 71 00:02:49,960 --> 00:02:53,410 That would be wonderful, and you also get your grades back more quickly if 72 00:02:53,410 --> 00:02:54,620 you fill out the Q. 73 00:02:54,620 --> 00:02:56,580 >> So most of you have done that before-- 74 00:02:56,580 --> 00:02:58,240 or no, about half of you have done that before. 75 00:02:58,240 --> 00:03:00,060 But if you're a freshman, that's what that is. 76 00:03:00,060 --> 00:03:01,910 It'll be the same for all the classes. 77 00:03:01,910 --> 00:03:02,270 Do it. 78 00:03:02,270 --> 00:03:02,900 It takes five minutes. 79 00:03:02,900 --> 00:03:07,610 But also, if you do it a bit seriously, that's not the worst thing 80 00:03:07,610 --> 00:03:10,270 in the world, because I certainly take it seriously. 81 00:03:10,270 --> 00:03:13,000 >> So if you leave me a smiley face, I will appreciate that. 82 00:03:13,000 --> 00:03:17,550 But I would also appreciate if you left me more than a smiley face. 83 00:03:17,550 --> 00:03:18,270 But it's up to you. 84 00:03:18,270 --> 00:03:21,540 I can't tell you-- or like a big smiley face, with a capital D. That'd 85 00:03:21,540 --> 00:03:23,060 be even better. 86 00:03:23,060 --> 00:03:27,860 >> OK, that's all I have for the Q. If you have any questions, you can ask 87 00:03:27,860 --> 00:03:29,370 me, but pretty self-explanatory. 88 00:03:29,370 --> 00:03:31,090 Just, please, fill it out. 89 00:03:31,090 --> 00:03:34,390 I would really appreciate it, and it means a lot to me. 90 00:03:34,390 --> 00:03:38,910 >> OK, this is what we're going to spend 15 minutes going through. 91 00:03:38,910 --> 00:03:39,800 I'm going to show you some code. 92 00:03:39,800 --> 00:03:42,080 I think this is really cool, and this got me more 93 00:03:42,080 --> 00:03:43,810 excited in computer science. 94 00:03:43,810 --> 00:03:46,480 So I hope it will do the same for you all. 95 00:03:46,480 --> 00:03:51,760 >> We are going to open up-- and all this code I'll send to you later. 96 00:03:51,760 --> 00:03:52,680 But we're just going to open up-- 97 00:03:52,680 --> 00:03:54,310 I'm in my terminal-- 98 00:03:54,310 --> 00:03:56,810 we're going to open up this program called [? MySum. ?] 99 00:03:56,810 --> 00:04:01,290 100 00:04:01,290 --> 00:04:02,540 >> Can everybody read that, or should I make it bigger? 101 00:04:02,540 --> 00:04:07,670 102 00:04:07,670 --> 00:04:13,040 Can anybody tell me what this code will do when I run it, or what this 103 00:04:13,040 --> 00:04:14,320 program will do when I run it? 104 00:04:14,320 --> 00:04:30,710 105 00:04:30,710 --> 00:04:32,400 >> [? Avi, ?] what do you think it's going to do? 106 00:04:32,400 --> 00:04:33,335 Finish chewing. 107 00:04:33,335 --> 00:04:35,033 You shouldn't talk with your mouth open. 108 00:04:35,033 --> 00:04:38,330 109 00:04:38,330 --> 00:04:42,860 >> AUDIENCE: Does it take a bunch of arguments, find sum of them returning 110 00:04:42,860 --> 00:04:45,285 sum, and then print it out? 111 00:04:45,285 --> 00:04:53,045 Or it takes in two arguments, and then it does [INAUDIBLE]. 112 00:04:53,045 --> 00:04:56,460 And then it prints out whatever the results are. 113 00:04:56,460 --> 00:04:58,100 >> SPEAKER: Close, really close. 114 00:04:58,100 --> 00:04:59,840 Anybody want to add to [? what Avi ?] said? 115 00:04:59,840 --> 00:05:04,830 116 00:05:04,830 --> 00:05:07,293 Do you need to give this program any command-line arguments? 117 00:05:07,293 --> 00:05:09,145 >> AUDIENCE: No. 118 00:05:09,145 --> 00:05:09,610 >> SPEAKER: No. 119 00:05:09,610 --> 00:05:11,250 What happens if you don't give it any command-line arguments? 120 00:05:11,250 --> 00:05:12,500 I just write dot slash MySum. 121 00:05:12,500 --> 00:05:15,145 122 00:05:15,145 --> 00:05:16,630 >> AUDIENCE: 1 plus 2 equals 3. 123 00:05:16,630 --> 00:05:17,250 >> SPEAKER: 1 plus 2 equals 3. 124 00:05:17,250 --> 00:05:18,570 And it'll print that out. 125 00:05:18,570 --> 00:05:19,450 That's exactly right. 126 00:05:19,450 --> 00:05:21,370 You'll see that print f line at the bottom. 127 00:05:21,370 --> 00:05:23,450 It'll print out a, b, and then the sum of a and b. 128 00:05:23,450 --> 00:05:26,360 And I guess you assume that sum works correctly. 129 00:05:26,360 --> 00:05:28,120 Good assumption. 130 00:05:28,120 --> 00:05:32,250 >> OK, and what happens if I give it what argument? 131 00:05:32,250 --> 00:05:33,010 [? Manu? ?] 132 00:05:33,010 --> 00:05:36,230 >> AUDIENCE: It'll add whatever the first argument is to b. 133 00:05:36,230 --> 00:05:37,150 Or to 2, sorry. 134 00:05:37,150 --> 00:05:38,480 >> SPEAKER: Right, to 2. 135 00:05:38,480 --> 00:05:42,470 Does anybody know what strtol does? 136 00:05:42,470 --> 00:05:43,960 It's basically atoi. 137 00:05:43,960 --> 00:05:47,240 Atoi is actually a fancy version of-- 138 00:05:47,240 --> 00:05:49,600 or a simpler version of strtol. 139 00:05:49,600 --> 00:05:51,790 But it actually uses strtol. 140 00:05:51,790 --> 00:05:54,610 141 00:05:54,610 --> 00:05:58,010 And I found that out because I wanted something like atoi, and then when I 142 00:05:58,010 --> 00:06:01,110 did atoi, I read down here. 143 00:06:01,110 --> 00:06:04,380 And I found "this behavior is the same as" strtol. 144 00:06:04,380 --> 00:06:06,850 So it's basically atoi for all intents and purposes. 145 00:06:06,850 --> 00:06:09,320 And you see I even use null and 10. 146 00:06:09,320 --> 00:06:14,390 >> This actually lets you take a string, and turn it into a number, and choose 147 00:06:14,390 --> 00:06:15,970 what base you want to do it in. 148 00:06:15,970 --> 00:06:17,370 So this is base 10 right here. 149 00:06:17,370 --> 00:06:20,455 I could have done base two for decimal, base 16 for hexadecimal. 150 00:06:20,455 --> 00:06:22,090 It's pretty cool. 151 00:06:22,090 --> 00:06:25,860 But long story short, this takes two numbers and adds them together. 152 00:06:25,860 --> 00:06:29,260 >> So let's run it. 153 00:06:29,260 --> 00:06:32,560 And you'll also notice, there are some things-- 154 00:06:32,560 --> 00:06:37,830 so I have a makefile right here, and if you open that up, some things 155 00:06:37,830 --> 00:06:39,270 you'll notice are different. 156 00:06:39,270 --> 00:06:42,370 In particular, this argument right here, you probably 157 00:06:42,370 --> 00:06:43,010 haven't seen that before. 158 00:06:43,010 --> 00:06:45,770 Generally, we compile things with dash zero, zero. 159 00:06:45,770 --> 00:06:51,500 Dash zero, zero, means don't do any optimizations, compiler. 160 00:06:51,500 --> 00:06:54,950 Don't try and make anything fancy, or make anything run more quickly, or get 161 00:06:54,950 --> 00:06:56,530 rid of variables that are necessary. 162 00:06:56,530 --> 00:06:58,080 Don't optimize this code at all, 163 00:06:58,080 --> 00:07:00,110 >> I'm asking for third-level optimization. 164 00:07:00,110 --> 00:07:02,580 So I'm asking compiler to do a lot of optimizations. 165 00:07:02,580 --> 00:07:05,870 You can change that in the makefile when you have this code, if you want 166 00:07:05,870 --> 00:07:07,190 to see different stuff. 167 00:07:07,190 --> 00:07:08,660 Which we'll show in a second. 168 00:07:08,660 --> 00:07:12,080 So we run my sum 1 plus 2 plus 3. 169 00:07:12,080 --> 00:07:13,445 Somebody give me two arguments. 170 00:07:13,445 --> 00:07:17,221 171 00:07:17,221 --> 00:07:18,210 >> AUDIENCE: 4 and 5. 172 00:07:18,210 --> 00:07:18,966 >> SPEAKER: 4 and 5. 173 00:07:18,966 --> 00:07:19,900 Thank you. 174 00:07:19,900 --> 00:07:20,860 Great, it works. 175 00:07:20,860 --> 00:07:25,700 What are some other good arguments to try, to make sure this works? 176 00:07:25,700 --> 00:07:27,050 Anyone? 177 00:07:27,050 --> 00:07:27,430 >> AUDIENCE: 0. 178 00:07:27,430 --> 00:07:29,210 >> SPEAKER: 0 and? 179 00:07:29,210 --> 00:07:31,010 >> AUDIENCE: Negative 3. 180 00:07:31,010 --> 00:07:32,040 >> SPEAKER: It works. 181 00:07:32,040 --> 00:07:33,670 But those were good choices. 182 00:07:33,670 --> 00:07:36,600 OK, so let's go back here. 183 00:07:36,600 --> 00:07:38,540 This is mysum.c. 184 00:07:38,540 --> 00:07:42,440 You'll notice there's also something called sumfunction.c. 185 00:07:42,440 --> 00:07:48,110 And this says, oh, there's something defined in sumfunction.c. 186 00:07:48,110 --> 00:07:51,480 I don't include this file in here because I don't need to. 187 00:07:51,480 --> 00:07:54,840 But I link it in when I compile, which you noticed. 188 00:07:54,840 --> 00:07:57,380 >> Let's scroll up. 189 00:07:57,380 --> 00:08:02,880 We saw when we compiled mysum, right there, we linked in the binary from 190 00:08:02,880 --> 00:08:04,130 sumfunction.o. 191 00:08:04,130 --> 00:08:05,780 192 00:08:05,780 --> 00:08:08,470 And I don't need the header file because, of course, there's the 193 00:08:08,470 --> 00:08:09,240 function declaration. 194 00:08:09,240 --> 00:08:12,200 So sharp include normally just puts in a function declaration. 195 00:08:12,200 --> 00:08:13,730 Here I've just put it straight in the code. 196 00:08:13,730 --> 00:08:16,370 And so I need to do is link in the binary, which I do. 197 00:08:16,370 --> 00:08:19,950 >> Any guesses for what is in sumfunction.c? 198 00:08:19,950 --> 00:08:21,950 What code I've written in sumfunction.c? 199 00:08:21,950 --> 00:08:25,445 200 00:08:25,445 --> 00:08:26,695 >> AUDIENCE: [INAUDIBLE]. 201 00:08:26,695 --> 00:08:29,460 202 00:08:29,460 --> 00:08:30,630 >> SPEAKER: Any guesses? 203 00:08:30,630 --> 00:08:30,940 Yeah? 204 00:08:30,940 --> 00:08:33,710 >> AUDIENCE: I think, defines some [INAUDIBLE]. 205 00:08:33,710 --> 00:08:33,975 >> SPEAKER: Yes. 206 00:08:33,975 --> 00:08:37,650 So I do write int sum int a. 207 00:08:37,650 --> 00:08:41,120 I write this line, and then I have open curly brace, closed curly brace. 208 00:08:41,120 --> 00:08:46,160 What do you think I write inside those curly braces, inside that function? 209 00:08:46,160 --> 00:08:46,600 Yeah? 210 00:08:46,600 --> 00:08:48,150 >> AUDIENCE: Return equals a. 211 00:08:48,150 --> 00:08:50,010 >> PROCESSOR: That's a really good guess. 212 00:08:50,010 --> 00:08:51,720 Who thinks [? Manu ?] is right? 213 00:08:51,720 --> 00:08:54,122 It says return a plus b. 214 00:08:54,122 --> 00:08:55,860 OK, not everybody. 215 00:08:55,860 --> 00:08:56,520 [? Akshar, ?] 216 00:08:56,520 --> 00:08:57,390 you do, too? 217 00:08:57,390 --> 00:09:00,430 You sure? 218 00:09:00,430 --> 00:09:01,680 OK. 219 00:09:01,680 --> 00:09:09,551 220 00:09:09,551 --> 00:09:10,050 What? 221 00:09:10,050 --> 00:09:11,662 >> AUDIENCE: You spelled it wrong. 222 00:09:11,662 --> 00:09:13,000 >> SPEAKER: No, I didn't. 223 00:09:13,000 --> 00:09:13,966 Yeah, just kidding. 224 00:09:13,966 --> 00:09:15,300 You're right. 225 00:09:15,300 --> 00:09:15,930 That's exactly what it says. 226 00:09:15,930 --> 00:09:17,110 It's return a plus b. 227 00:09:17,110 --> 00:09:18,570 That makes a lot of sense. 228 00:09:18,570 --> 00:09:20,240 >> OK, let's go back here. 229 00:09:20,240 --> 00:09:21,490 We see how the header-- 230 00:09:21,490 --> 00:09:24,540 231 00:09:24,540 --> 00:09:25,660 that's the return type. 232 00:09:25,660 --> 00:09:29,100 Remember, we've seen that day one, the return type of the function, but goes 233 00:09:29,100 --> 00:09:30,160 before the name of the int function. 234 00:09:30,160 --> 00:09:31,560 Here, I've written int. 235 00:09:31,560 --> 00:09:35,680 What do you think will happen if in this function, I don't write int, but 236 00:09:35,680 --> 00:09:38,270 I write unsigned? 237 00:09:38,270 --> 00:09:41,050 The difference, of course, being that unsigned represents only positive 238 00:09:41,050 --> 00:09:43,620 integers, and int can be positive or negative. 239 00:09:43,620 --> 00:09:45,450 >> So I've changed the return type of this function. 240 00:09:45,450 --> 00:09:49,370 This code does not match this return type here. 241 00:09:49,370 --> 00:09:50,925 What do you think will happen when I compile? 242 00:09:50,925 --> 00:09:53,840 243 00:09:53,840 --> 00:09:56,240 You should yell at me. 244 00:09:56,240 --> 00:09:57,700 No yelling. 245 00:09:57,700 --> 00:10:00,050 >> What about when I run the program? 246 00:10:00,050 --> 00:10:05,810 Let's do before 0 negative 3, or negative 1. 247 00:10:05,810 --> 00:10:10,180 It still works, even though I'm saying it's returning an unsigned integer. 248 00:10:10,180 --> 00:10:12,060 Clearly it's not returning an unsigned integer. 249 00:10:12,060 --> 00:10:13,520 It's returning a signed integer. 250 00:10:13,520 --> 00:10:16,130 It's returning negative 1. 251 00:10:16,130 --> 00:10:17,830 OK, that's weird. 252 00:10:17,830 --> 00:10:27,030 >> What about if I go in here and do that? 253 00:10:27,030 --> 00:10:29,700 So I've changed everything from int to unsigned. 254 00:10:29,700 --> 00:10:31,590 It can only take unsigned integers. 255 00:10:31,590 --> 00:10:33,840 But do we still think it'll run? 256 00:10:33,840 --> 00:10:35,652 >> AUDIENCE: Yes. 257 00:10:35,652 --> 00:10:37,270 >> SPEAKER: It will. 258 00:10:37,270 --> 00:10:39,410 That's crazy. 259 00:10:39,410 --> 00:10:43,140 And we pass in a clearly assigned integer, we can pass two signed 260 00:10:43,140 --> 00:10:46,280 integer, it still works. 261 00:10:46,280 --> 00:10:52,150 >> OK, any ideas of why it still works, or what's going on? 262 00:10:52,150 --> 00:10:53,368 Yeah, Jeff. 263 00:10:53,368 --> 00:10:56,296 >> AUDIENCE: It has something to do with your optimization that you 264 00:10:56,296 --> 00:10:57,760 highlighted. 265 00:10:57,760 --> 00:10:58,210 >> SPEAKER: No. 266 00:10:58,210 --> 00:11:00,570 We could change the optimization, it would still work. 267 00:11:00,570 --> 00:11:02,240 I can do that for you, but-- 268 00:11:02,240 --> 00:11:02,930 >> AUDIENCE: I'll take your word for it. 269 00:11:02,930 --> 00:11:03,690 >> SPEAKER: Yeah. 270 00:11:03,690 --> 00:11:09,690 If you open the makefile right here, I changed the optimization. 271 00:11:09,690 --> 00:11:11,570 So you can do dash zero, zero. 272 00:11:11,570 --> 00:11:12,820 It will still work. 273 00:11:12,820 --> 00:11:16,839 274 00:11:16,839 --> 00:11:20,280 Other thoughts? 275 00:11:20,280 --> 00:11:22,600 >> You guys all expected to work, so why'd you expect it to work? 276 00:11:22,600 --> 00:11:31,210 277 00:11:31,210 --> 00:11:32,150 No? 278 00:11:32,150 --> 00:11:33,660 Silence. 279 00:11:33,660 --> 00:11:34,910 OK. 280 00:11:34,910 --> 00:11:39,271 281 00:11:39,271 --> 00:11:41,650 I have to wait seven seconds, because I asked a question. 282 00:11:41,650 --> 00:11:44,190 283 00:11:44,190 --> 00:11:48,660 >> So the cool thing about C, and you've probably experienced before-- you 284 00:11:48,660 --> 00:11:50,260 might not have, this might be the first time. 285 00:11:50,260 --> 00:11:57,030 But as you all know, when I write something in C, it does not save like 286 00:11:57,030 --> 00:11:57,760 this on the computer. 287 00:11:57,760 --> 00:11:59,440 It's saved as ones and zeroes. 288 00:11:59,440 --> 00:12:02,970 It goes from C code to assembly code. 289 00:12:02,970 --> 00:12:09,460 >> Has anybody seen assembly code before, machine assembly code? 290 00:12:09,460 --> 00:12:10,630 We'll look at in a second. 291 00:12:10,630 --> 00:12:12,040 It goes from C code to assembly code. 292 00:12:12,040 --> 00:12:13,755 And you guys know the stages of compilation. 293 00:12:13,755 --> 00:12:17,410 You had to memorize that for quiz one, and then write it out on quiz zero. 294 00:12:17,410 --> 00:12:18,240 Most people got it wrong. 295 00:12:18,240 --> 00:12:19,760 I think you guys nailed it. 296 00:12:19,760 --> 00:12:22,880 >> But, you guys are the best section for quizzes, by the way. 297 00:12:22,880 --> 00:12:25,210 Which is awesome. 298 00:12:25,210 --> 00:12:25,910 It won't hurt you. 299 00:12:25,910 --> 00:12:26,900 Don't be worried. 300 00:12:26,900 --> 00:12:28,800 But it's really cool. 301 00:12:28,800 --> 00:12:29,660 Good job. 302 00:12:29,660 --> 00:12:32,870 >> So it goes to assembly language, and then it goes to ones and zeroes. 303 00:12:32,870 --> 00:12:35,500 And the ones and zeroes are saved on the computer, and that's what saved in 304 00:12:35,500 --> 00:12:38,340 the a.out, or in this case, the executable file. 305 00:12:38,340 --> 00:12:41,040 And the computer runs ones and zeroes. 306 00:12:41,040 --> 00:12:41,670 Right? 307 00:12:41,670 --> 00:12:43,890 We've learned this before. 308 00:12:43,890 --> 00:12:47,490 >> So the cool thing is, this unsigned idea, the idea of types ints unsigned, 309 00:12:47,490 --> 00:12:50,490 et cetera, et cetera, that's up here in the C language. 310 00:12:50,490 --> 00:12:51,110 Those exist. 311 00:12:51,110 --> 00:12:53,770 But types don't exist at the ones and zeroes. 312 00:12:53,770 --> 00:12:57,110 Types don't even really exist at the assembly language level. 313 00:12:57,110 --> 00:13:00,075 So that's something that exists in C world but doesn't exist in computer 314 00:13:00,075 --> 00:13:01,640 world or processor world. 315 00:13:01,640 --> 00:13:04,660 That's some abstraction that the C language has included, to make our 316 00:13:04,660 --> 00:13:06,240 lives easier. 317 00:13:06,240 --> 00:13:09,990 >> So at the end of the day, I can write many different things here, and it 318 00:13:09,990 --> 00:13:10,700 doesn't make a difference. 319 00:13:10,700 --> 00:13:12,060 Because that only exists in the C world. 320 00:13:12,060 --> 00:13:14,100 It doesn't exist in the ones and zeroes world. 321 00:13:14,100 --> 00:13:17,310 And our program's executing in the ones and zeroes world. 322 00:13:17,310 --> 00:13:21,170 So your mind's clearly not blown yet. 323 00:13:21,170 --> 00:13:22,740 But I think that's cool. 324 00:13:22,740 --> 00:13:23,530 Yeah, Jeff. 325 00:13:23,530 --> 00:13:27,298 >> AUDIENCE: So, if instead of doing int, you do char. 326 00:13:27,298 --> 00:13:27,770 And you were-- 327 00:13:27,770 --> 00:13:29,311 >> SPEAKER: Let's do it in a sec. 328 00:13:29,311 --> 00:13:32,583 >> AUDIENCE: Because then you get an unsigned going from negative 128 to 329 00:13:32,583 --> 00:13:34,720 127 or 0 to 255. 330 00:13:34,720 --> 00:13:36,760 >> SPEAKER: So char is problematic. 331 00:13:36,760 --> 00:13:39,460 Does anybody know why char would be problematic, and it would actually 332 00:13:39,460 --> 00:13:42,930 change things in the ones and zeroes world? 333 00:13:42,930 --> 00:13:44,370 >> AUDIENCE: Because of the size of char. 334 00:13:44,370 --> 00:13:46,200 >> SPEAKER: Size of char is 1. 335 00:13:46,200 --> 00:13:48,260 So unsigned is also 4 bytes. 336 00:13:48,260 --> 00:13:50,080 So char would screw things up. 337 00:13:50,080 --> 00:13:55,660 But what is 4 bytes that's related to a char? 338 00:13:55,660 --> 00:13:57,820 Or at that adds one additional-- 339 00:13:57,820 --> 00:13:59,760 you can put one more character after char. 340 00:13:59,760 --> 00:14:00,200 >> AUDIENCE: Char star. 341 00:14:00,200 --> 00:14:01,220 >> SPEAKER: Char star has 4 bytes. 342 00:14:01,220 --> 00:14:02,490 So let's do something that's a char star. 343 00:14:02,490 --> 00:14:05,470 344 00:14:05,470 --> 00:14:07,240 >> So this would probably work, but we're going to do something even 345 00:14:07,240 --> 00:14:09,710 crazier than this. 346 00:14:09,710 --> 00:14:10,960 In my opinion, crazier. 347 00:14:10,960 --> 00:14:21,060 348 00:14:21,060 --> 00:14:24,570 >> I've now written a function that returns a pointer, and it takes a 349 00:14:24,570 --> 00:14:29,480 pointer and an unsigned value-- we'll change this back to int so we're not 350 00:14:29,480 --> 00:14:31,250 making too many changes at once. 351 00:14:31,250 --> 00:14:35,370 And it has an array called a, indexes into the array, and returns the 352 00:14:35,370 --> 00:14:35,850 address of. 353 00:14:35,850 --> 00:14:37,470 We've seen these operators before. 354 00:14:37,470 --> 00:14:43,340 This, what do you think this is going to do, in return, when I run it? 355 00:14:43,340 --> 00:14:48,280 356 00:14:48,280 --> 00:14:49,070 What do you think it's going to do? 357 00:14:49,070 --> 00:14:50,320 Any guesses? 358 00:14:50,320 --> 00:14:54,220 359 00:14:54,220 --> 00:14:55,320 >> AUDIENCE: Segfault. 360 00:14:55,320 --> 00:14:55,600 >> SPEAKER: What? 361 00:14:55,600 --> 00:14:56,660 Segfault? 362 00:14:56,660 --> 00:14:58,520 That's a good guess. 363 00:14:58,520 --> 00:14:59,430 Tom says the same thing. 364 00:14:59,430 --> 00:15:02,240 Any other guesses? 365 00:15:02,240 --> 00:15:05,260 >> Who thinks it's going to do the same thing? 366 00:15:05,260 --> 00:15:06,510 Who thinks it's going to segfault? 367 00:15:06,510 --> 00:15:09,350 368 00:15:09,350 --> 00:15:10,230 It does the same thing. 369 00:15:10,230 --> 00:15:11,880 Sorry. 370 00:15:11,880 --> 00:15:13,860 >> But, of course, we put in 1 and 2. 371 00:15:13,860 --> 00:15:16,470 And those are both valid, right? 372 00:15:16,470 --> 00:15:19,420 Let's see, we can go to the second place of an array. 373 00:15:19,420 --> 00:15:24,010 But what if we made b a negative number? 374 00:15:24,010 --> 00:15:26,380 That is probably a better guess for something segfaulting. 375 00:15:26,380 --> 00:15:30,310 376 00:15:30,310 --> 00:15:32,260 It still works. 377 00:15:32,260 --> 00:15:35,020 >> OK, this is now crazy. 378 00:15:35,020 --> 00:15:38,350 This is of equally valid sum function. 379 00:15:38,350 --> 00:15:40,470 This does the same exact thing as return a and b. 380 00:15:40,470 --> 00:15:44,600 Can anybody explain why this is a good sum function, or why this works? 381 00:15:44,600 --> 00:15:45,850 What is happening here? 382 00:15:45,850 --> 00:15:49,360 383 00:15:49,360 --> 00:15:55,750 Why does this do the exact same thing as our old sum function? 384 00:15:55,750 --> 00:15:56,890 [? Akshar, ?] 385 00:15:56,890 --> 00:15:58,155 what's going on? 386 00:15:58,155 --> 00:16:01,540 >> AUDIENCE: Because when you have an a that's an address to 387 00:16:01,540 --> 00:16:03,950 the location memory-- 388 00:16:03,950 --> 00:16:07,910 and when you do the ampersand, it goes to that memory address. 389 00:16:07,910 --> 00:16:13,610 And when you go to b, you're kind of moving steps from that memory address, 390 00:16:13,610 --> 00:16:15,550 you're returning that. 391 00:16:15,550 --> 00:16:20,083 So you're actually, in fact, adding a and b [INAUDIBLE]. 392 00:16:20,083 --> 00:16:23,300 393 00:16:23,300 --> 00:16:26,222 Where are standard operations on that return? 394 00:16:26,222 --> 00:16:27,683 Like, where do the parentheses fall? 395 00:16:27,683 --> 00:16:30,610 Is the return of the address on a before or after [INAUDIBLE]? 396 00:16:30,610 --> 00:16:32,380 >> SPEAKER: It's going to index into b-- 397 00:16:32,380 --> 00:16:34,430 or index into a-- and then return the address. 398 00:16:34,430 --> 00:16:38,800 399 00:16:38,800 --> 00:16:41,340 OK, so did everybody understand what [? Akshar ?] 400 00:16:41,340 --> 00:16:45,830 said, and explained, why this works? 401 00:16:45,830 --> 00:16:49,430 I didn't, the first time somebody explained this to me. 402 00:16:49,430 --> 00:16:51,900 Would anybody like a picture to explain this? 403 00:16:51,900 --> 00:16:55,320 We're going to draw a picture, with no markers, that's great. 404 00:16:55,320 --> 00:16:57,920 Found some. 405 00:16:57,920 --> 00:17:03,390 >> So we have an array that's a series of boxes. 406 00:17:03,390 --> 00:17:07,160 407 00:17:07,160 --> 00:17:13,710 The first one is an index 0, index 1, 2, 3, 4, dot, dot, dot. 408 00:17:13,710 --> 00:17:15,609 A typical array. 409 00:17:15,609 --> 00:17:19,540 And in addition to having indices, they all have memory addresses. 410 00:17:19,540 --> 00:17:30,190 So let's give this memory address 13, 14, 15, 16, 17, et cetera. 411 00:17:30,190 --> 00:17:32,490 Everybody's here so far. 412 00:17:32,490 --> 00:17:35,810 >> So a is an address. 413 00:17:35,810 --> 00:17:38,850 The name of an array, a pointer is saved there. 414 00:17:38,850 --> 00:17:42,730 It's a pointer, it's a memory location, to the start of the array. 415 00:17:42,730 --> 00:17:45,910 So if this were the array, a would be a value of 13. 416 00:17:45,910 --> 00:17:49,110 And, of course, we can give a any value we want. 417 00:17:49,110 --> 00:17:52,450 Char star a, we can give a any memory address we want. 418 00:17:52,450 --> 00:17:55,940 We can give it 0, we can give it negative 1-- negative 1 doesn't exist, 419 00:17:55,940 --> 00:17:58,820 so that's probably problematic, but you saw that it still worked. 420 00:17:58,820 --> 00:18:03,070 So we can give a any number we want, any memory address we want. 421 00:18:03,070 --> 00:18:08,720 >> Then, int b says, OK, go this number of steps into the array. 422 00:18:08,720 --> 00:18:13,150 So if b equals 2, and a equals 13, we're at memory address 13. 423 00:18:13,150 --> 00:18:17,330 And we go two steps in, and so we're here. 424 00:18:17,330 --> 00:18:21,150 And the ampersand means return the address of this location. 425 00:18:21,150 --> 00:18:23,990 And the address is, of course, 15. 426 00:18:23,990 --> 00:18:28,710 So we get 13 plus 2, or a plus b, which is 15. 427 00:18:28,710 --> 00:18:29,590 >> The question is, though-- 428 00:18:29,590 --> 00:18:30,250 I'm sorry. 429 00:18:30,250 --> 00:18:34,324 Does that clarify things for why this works? 430 00:18:34,324 --> 00:18:36,300 >> AUDIENCE: Why would it work going-- 431 00:18:36,300 --> 00:18:38,770 so you can have an array and go to a negative index? 432 00:18:38,770 --> 00:18:39,050 >> SPEAKER: Right. 433 00:18:39,050 --> 00:18:40,870 So we did negative numbers, so that's the-- 434 00:18:40,870 --> 00:18:42,770 does this make sense though, first, [? Avi, ?] 435 00:18:42,770 --> 00:18:43,120 for you? 436 00:18:43,120 --> 00:18:48,840 >> AUDIENCE: Yeah I'm just [INAUDIBLE], but-- 437 00:18:48,840 --> 00:18:50,440 >> SPEAKER: Yeah, this would return 15. 438 00:18:50,440 --> 00:18:53,523 If a was 13, and b was 2, this would return 15. 439 00:18:53,523 --> 00:18:58,160 >> AUDIENCE: So the zero indexing doesn't become an issue, right? 440 00:18:58,160 --> 00:19:00,160 Because you're moving from 0. 441 00:19:00,160 --> 00:19:00,470 >> SPEAKER: Right. 442 00:19:00,470 --> 00:19:05,000 So you're moving-- so if b was 0, you wouldn't move anywhere. 443 00:19:05,000 --> 00:19:06,330 And you'd just returned the address-- 444 00:19:06,330 --> 00:19:10,830 if b was 0, that's essentially returning that address of a. 445 00:19:10,830 --> 00:19:13,960 Passing in char star a and returning the address of a is just returning a, 446 00:19:13,960 --> 00:19:15,860 essentially. 447 00:19:15,860 --> 00:19:18,280 >> OK, the question is why do negative numbers work? 448 00:19:18,280 --> 00:19:21,670 And that's the really cool thing about this, because this should segfault. 449 00:19:21,670 --> 00:19:25,110 And it would segfault if we did something like this. 450 00:19:25,110 --> 00:19:28,050 451 00:19:28,050 --> 00:19:29,300 Let's say, int. 452 00:19:29,300 --> 00:19:34,390 453 00:19:34,390 --> 00:19:39,810 So this code looks identical and should behave identically. 454 00:19:39,810 --> 00:19:44,550 Essentially, x is a garbage variable, and so this should behave identically. 455 00:19:44,550 --> 00:19:46,370 >> Let's make this-- 456 00:19:46,370 --> 00:19:47,620 oops-- 457 00:19:47,620 --> 00:19:54,790 458 00:19:54,790 --> 00:19:56,040 in star. 459 00:19:56,040 --> 00:19:59,160 460 00:19:59,160 --> 00:20:02,733 OK, we're already getting errors here, because it's already going to be angry 461 00:20:02,733 --> 00:20:04,610 at me, because it already knows what's coming. 462 00:20:04,610 --> 00:20:07,060 In particular, the second one. 463 00:20:07,060 --> 00:20:09,800 Address of stacked memory associated with a local variable. 464 00:20:09,800 --> 00:20:14,220 >> Essentially, I'm not going to compile this, and then I'm going to undo do 465 00:20:14,220 --> 00:20:14,920 what we just did. 466 00:20:14,920 --> 00:20:19,130 But because we're never actually accessing what's at the memory 467 00:20:19,130 --> 00:20:21,930 location, it's not going to segfault. 468 00:20:21,930 --> 00:20:26,450 We're never actually looking at what's in the second box or what's in any box 469 00:20:26,450 --> 00:20:28,340 of this array. 470 00:20:28,340 --> 00:20:30,980 We're only saying, here's the address of the thing we're looking for and 471 00:20:30,980 --> 00:20:32,410 return that address. 472 00:20:32,410 --> 00:20:35,700 We're never actually going into the array to look at that location. 473 00:20:35,700 --> 00:20:39,140 And because we never touch the memory, we don't get in trouble. 474 00:20:39,140 --> 00:20:40,760 We don't get a segfault. 475 00:20:40,760 --> 00:20:46,225 >> If we tried to, again, touch that memory, touch what was at a or b-- 476 00:20:46,225 --> 00:20:49,940 or a bracket b, and assuming a was 0 and-- 477 00:20:49,940 --> 00:20:53,040 if a was 0, even, that would be pretty bad, because we can't go 478 00:20:53,040 --> 00:20:54,090 down all the way there. 479 00:20:54,090 --> 00:20:58,250 If a and b were both 0, and we tried to touch what was there, then we would 480 00:20:58,250 --> 00:20:59,110 get in trouble. 481 00:20:59,110 --> 00:21:02,160 But if we don't touch what's there, we just return the address, it is 482 00:21:02,160 --> 00:21:08,300 actually not going to segfault because it lets you perform those operations. 483 00:21:08,300 --> 00:21:11,920 It only gets mad at you, and gets super angry, when you try and touch 484 00:21:11,920 --> 00:21:15,740 the actual memory and return what's at that memory location. 485 00:21:15,740 --> 00:21:17,690 >> Does that make sense? 486 00:21:17,690 --> 00:21:24,820 That's just a crazy part of C. So, we have one more of these. 487 00:21:24,820 --> 00:21:27,760 488 00:21:27,760 --> 00:21:29,700 >> Who thinks this is cool? 489 00:21:29,700 --> 00:21:30,280 More people. 490 00:21:30,280 --> 00:21:31,070 That's good. 491 00:21:31,070 --> 00:21:34,860 OK, this is our last one. 492 00:21:34,860 --> 00:21:37,314 And I would like you to tell me whether or not you think this is going 493 00:21:37,314 --> 00:21:38,564 to do the same exact thing. 494 00:21:38,564 --> 00:22:06,050 495 00:22:06,050 --> 00:22:07,390 >> I have these written down somewhere. 496 00:22:07,390 --> 00:22:08,640 I'm not memorizing them. 497 00:22:08,640 --> 00:22:33,350 498 00:22:33,350 --> 00:22:42,900 >> Let's see, 8, b 4, 4, 2, 4, 0, 8, 0, 3, 4, 4, 2, 4, 0, 4. 499 00:22:42,900 --> 00:22:46,670 So this is an array, now, not a function. 500 00:22:46,670 --> 00:22:49,640 And it's an array because we have square brackets, not curly braces. 501 00:22:49,640 --> 00:22:52,360 And it's an array of what type? 502 00:22:52,360 --> 00:22:55,540 503 00:22:55,540 --> 00:22:56,862 Anyone, hmm? 504 00:22:56,862 --> 00:22:57,694 >> AUDIENCE: Their hexadecimal numbers? 505 00:22:57,694 --> 00:22:59,650 >> SPEAKER: But what's the C type? 506 00:22:59,650 --> 00:23:00,710 They all have hexadecimal numbers. 507 00:23:00,710 --> 00:23:01,960 What's the C type? 508 00:23:01,960 --> 00:23:04,730 509 00:23:04,730 --> 00:23:05,480 It tells you. 510 00:23:05,480 --> 00:23:07,350 >> AUDIENCE: It's unsigned chars. 511 00:23:07,350 --> 00:23:09,170 >> SPEAKER: Right, unsigned chars. 512 00:23:09,170 --> 00:23:13,050 And two hexadecimal numbers is one byte. 513 00:23:13,050 --> 00:23:18,540 So these are 1, 2, 3, 4, 5, 6, 7, 8, 9 bytes. 514 00:23:18,540 --> 00:23:21,360 It's an array of 9 bytes. 515 00:23:21,360 --> 00:23:25,530 >> OK, you probably already know the answer to this question. 516 00:23:25,530 --> 00:23:29,840 But, what do you think will happen when I run this? 517 00:23:29,840 --> 00:23:34,110 I say, again, in mysum.c, I'm expecting a function 518 00:23:34,110 --> 00:23:36,280 that takes two integers. 519 00:23:36,280 --> 00:23:40,265 And I'm instead saying that sum is an array of characters. 520 00:23:40,265 --> 00:23:42,780 521 00:23:42,780 --> 00:23:48,070 What is going to happen when I run ./mysum and make? 522 00:23:48,070 --> 00:23:53,230 >> Well, first, most of you will probably agree that make-- oh no, just kidding. 523 00:23:53,230 --> 00:23:54,746 What'd I do wrong? 524 00:23:54,746 --> 00:23:55,996 Uh oh. 525 00:23:55,996 --> 00:23:59,220 526 00:23:59,220 --> 00:24:01,160 That should be curly braces. 527 00:24:01,160 --> 00:24:02,790 That's how you initialize an array. 528 00:24:02,790 --> 00:24:04,040 My bad. 529 00:24:04,040 --> 00:24:07,530 530 00:24:07,530 --> 00:24:11,670 >> So we already saw before that types are a C-level abstraction, not a 531 00:24:11,670 --> 00:24:12,610 computer level abstraction. 532 00:24:12,610 --> 00:24:16,360 So most of you probably expected it to make, or assuming that it would make. 533 00:24:16,360 --> 00:24:18,680 But what when I run ./mysum? 534 00:24:18,680 --> 00:24:19,930 What's going to happen? 535 00:24:19,930 --> 00:24:21,790 536 00:24:21,790 --> 00:24:23,422 Any guesses? 537 00:24:23,422 --> 00:24:25,270 >> AUDIENCE: It's going to print out a word. 538 00:24:25,270 --> 00:24:26,310 >> SPEAKER: It's going to print out a word. 539 00:24:26,310 --> 00:24:29,335 What word? 540 00:24:29,335 --> 00:24:32,200 >> AUDIENCE: [INAUDIBLE]. 541 00:24:32,200 --> 00:24:33,240 >> SPEAKER: Any other guesses? 542 00:24:33,240 --> 00:24:34,000 OK, print out a phrase. 543 00:24:34,000 --> 00:24:35,130 You can have any phrase. 544 00:24:35,130 --> 00:24:36,240 That will be your side. 545 00:24:36,240 --> 00:24:38,480 Anybody who has a different guess? 546 00:24:38,480 --> 00:24:39,730 Anna, what's your guess? 547 00:24:39,730 --> 00:24:42,675 548 00:24:42,675 --> 00:24:44,615 >> AUDIENCE: It'll print out-- 549 00:24:44,615 --> 00:24:47,525 550 00:24:47,525 --> 00:24:49,480 two letters, or [INAUDIBLE] one letter. 551 00:24:49,480 --> 00:24:51,460 >> SPEAKER: One letter. 552 00:24:51,460 --> 00:24:53,260 >> AUDIENCE: Can I count how many [INAUDIBLE]? 553 00:24:53,260 --> 00:24:55,426 >> SPEAKER: Nine. 554 00:24:55,426 --> 00:24:56,640 Well, I'm going to run it. 555 00:24:56,640 --> 00:24:58,650 It does the same exact thing. 556 00:24:58,650 --> 00:25:00,190 It adds two numbers together. 557 00:25:00,190 --> 00:25:02,740 Well, let's pass the two arguments. 558 00:25:02,740 --> 00:25:03,710 It doesn't take arguments. 559 00:25:03,710 --> 00:25:06,080 So I don't know where it could possibly get these arguments. 560 00:25:06,080 --> 00:25:07,710 But let's pass at 100 and 0. 561 00:25:07,710 --> 00:25:09,200 And it adds 100 and 0. 562 00:25:09,200 --> 00:25:10,220 That's insane. 563 00:25:10,220 --> 00:25:12,280 I think so. 564 00:25:12,280 --> 00:25:14,480 >> Negative 4, that works too. 565 00:25:14,480 --> 00:25:15,650 You can do anything you want. 566 00:25:15,650 --> 00:25:17,920 This is an equally valid sum function. 567 00:25:17,920 --> 00:25:19,640 This is a sum function. 568 00:25:19,640 --> 00:25:21,510 But, no, you're saying it's an array of bytes. 569 00:25:21,510 --> 00:25:23,570 So what is going on here? 570 00:25:23,570 --> 00:25:27,240 >> So, again, let's go back to this idea that we said at the very beginning. 571 00:25:27,240 --> 00:25:32,050 You go from C-level code, to assembly language, to ones and zeroes. 572 00:25:32,050 --> 00:25:33,050 This is hexadecimal. 573 00:25:33,050 --> 00:25:35,780 But this is really just a lot of ones and zeroes. 574 00:25:35,780 --> 00:25:39,230 This is 72 ones and zeroes, right? 575 00:25:39,230 --> 00:25:40,550 72 ones and zeroes. 576 00:25:40,550 --> 00:25:42,160 9 bytes. 577 00:25:42,160 --> 00:25:43,740 Each byte has 8 bits. 578 00:25:43,740 --> 00:25:44,760 Each bit is a one or a zero. 579 00:25:44,760 --> 00:25:45,920 So 72 ones or zeroes. 580 00:25:45,920 --> 00:25:48,780 I've just written them like this-- rather than writing it out as a lot of 581 00:25:48,780 --> 00:25:49,730 ones and zeroes. 582 00:25:49,730 --> 00:25:53,560 >> But this will go from C-level language, to assembly 583 00:25:53,560 --> 00:25:54,620 language, to code. 584 00:25:54,620 --> 00:25:59,020 And this will print out in code, somewhere, these 72 ones and zeroes 585 00:25:59,020 --> 00:26:00,910 that I've written here. 586 00:26:00,910 --> 00:26:03,610 So somewhere in that-- 587 00:26:03,610 --> 00:26:04,850 let's go here-- 588 00:26:04,850 --> 00:26:11,240 somewhere in mysum, the program, there are these 72 ones and zeroes that I've 589 00:26:11,240 --> 00:26:14,930 written and told it to write. 590 00:26:14,930 --> 00:26:19,331 >> Now, any guesses for what those 72 ones and zeroes mean? 591 00:26:19,331 --> 00:26:21,240 >> AUDIENCE: Probably the same thing as return a plus b. 592 00:26:21,240 --> 00:26:22,890 >> SPEAKER: Probably the same thing as return a plus b. 593 00:26:22,890 --> 00:26:23,730 Let's verify that. 594 00:26:23,730 --> 00:26:25,210 Let's figure out how I did this. 595 00:26:25,210 --> 00:26:31,840 >> So if you go back here, I tell you to run this command, objdump -S 596 00:26:31,840 --> 00:26:34,290 sumfunction.o. 597 00:26:34,290 --> 00:26:36,230 Let's go run it. objdump-- 598 00:26:36,230 --> 00:26:37,990 obj, dump. 599 00:26:37,990 --> 00:26:39,840 Basically it can give me whatever I want to see. 600 00:26:39,840 --> 00:26:40,840 It can give me the assembly language. 601 00:26:40,840 --> 00:26:42,730 It can give me the ones and zeroes. 602 00:26:42,730 --> 00:26:43,840 It has a ton of flags. 603 00:26:43,840 --> 00:26:45,860 This is the one we're going to use for now. 604 00:26:45,860 --> 00:26:46,980 Dot-- 605 00:26:46,980 --> 00:26:48,810 as you see in the slides-- 606 00:26:48,810 --> 00:26:53,840 dash capital S says, intersperse, source code-- 607 00:26:53,840 --> 00:26:58,410 this line's from C-- with the assembly code and with the ones and zeroes. 608 00:26:58,410 --> 00:27:00,350 And we're going to run it on sumfunction.o. 609 00:27:00,350 --> 00:27:01,410 Because it'll be easier to see. 610 00:27:01,410 --> 00:27:02,670 Again-- hmm? 611 00:27:02,670 --> 00:27:04,700 >> AUDIENCE: You spelled it wrong. 612 00:27:04,700 --> 00:27:05,930 >> SPEAKER: But I'm actually going to clear it for a second. 613 00:27:05,930 --> 00:27:09,160 I'm first going to open just sumfuntion.o. 614 00:27:09,160 --> 00:27:11,170 >> AUDIENCE: You spelled it wrong the first time. 615 00:27:11,170 --> 00:27:12,420 >> SPEAKER: Classic. 616 00:27:12,420 --> 00:27:14,790 617 00:27:14,790 --> 00:27:15,480 Sum-- 618 00:27:15,480 --> 00:27:16,680 that is a hard word, though. 619 00:27:16,680 --> 00:27:19,050 You'd be surprised. 620 00:27:19,050 --> 00:27:21,560 OK, so this is sumfunction.o. 621 00:27:21,560 --> 00:27:24,494 622 00:27:24,494 --> 00:27:26,220 I couldn't even tell you. 623 00:27:26,220 --> 00:27:30,250 There's a lot of zeroes, clearly a lot of zeroes, and there's some other 624 00:27:30,250 --> 00:27:31,930 stuff that's not zeroes. 625 00:27:31,930 --> 00:27:33,220 But mostly zeroes. 626 00:27:33,220 --> 00:27:35,120 Looks like there's some ones. 627 00:27:35,120 --> 00:27:36,810 So clearly, this is hard to read. 628 00:27:36,810 --> 00:27:39,320 That's the binary language. 629 00:27:39,320 --> 00:27:40,710 >> Let's now open it-- 630 00:27:40,710 --> 00:27:50,190 631 00:27:50,190 --> 00:27:52,350 what? 632 00:27:52,350 --> 00:27:53,600 What am I doing wrong? 633 00:27:53,600 --> 00:27:56,955 634 00:27:56,955 --> 00:27:58,434 Did I spell it correctly? 635 00:27:58,434 --> 00:28:09,865 636 00:28:09,865 --> 00:28:11,120 OK, this is awkward. 637 00:28:11,120 --> 00:28:37,560 638 00:28:37,560 --> 00:28:40,158 I need one second to figure out what I'm doing wrong. 639 00:28:40,158 --> 00:28:46,030 640 00:28:46,030 --> 00:28:49,310 That's one error. 641 00:28:49,310 --> 00:28:50,560 That's weird. 642 00:28:50,560 --> 00:28:58,080 643 00:28:58,080 --> 00:29:01,800 Oh, that's why. 644 00:29:01,800 --> 00:29:09,880 >> I'm going to go back to our initial one, so we can look at the 645 00:29:09,880 --> 00:29:10,560 object code of this. 646 00:29:10,560 --> 00:29:13,390 Because there's not really going to be anything when we just put the 647 00:29:13,390 --> 00:29:14,640 ones and zeroes in. 648 00:29:14,640 --> 00:29:29,000 649 00:29:29,000 --> 00:29:30,200 There we go. 650 00:29:30,200 --> 00:29:32,425 OK, so everybody can see this. 651 00:29:32,425 --> 00:29:38,130 This function, as I said, put out the C lines-- 652 00:29:38,130 --> 00:29:39,060 source code lines-- 653 00:29:39,060 --> 00:29:41,000 with some assembly instructions. 654 00:29:41,000 --> 00:29:42,760 >> Here is our source code line. 655 00:29:42,760 --> 00:29:44,910 Here's one, here's another. 656 00:29:44,910 --> 00:29:46,540 Here is the assembly instruction. 657 00:29:46,540 --> 00:29:47,820 That's what they look like. 658 00:29:47,820 --> 00:29:49,010 Assembly instructions-- 659 00:29:49,010 --> 00:29:51,530 you can learn more of these if you take other CS classes, but they're 660 00:29:51,530 --> 00:29:53,500 generally an instruction. 661 00:29:53,500 --> 00:29:57,940 And then a source and a destination. 662 00:29:57,940 --> 00:30:02,740 >> And then over here is the binary code that corresponds to that assembly 663 00:30:02,740 --> 00:30:04,940 instruction. 664 00:30:04,940 --> 00:30:09,760 So as you can see, this sum function, at the end of the day, is three 665 00:30:09,760 --> 00:30:10,950 assembly instructions. 666 00:30:10,950 --> 00:30:12,870 Only three. 667 00:30:12,870 --> 00:30:14,180 One mov-- 668 00:30:14,180 --> 00:30:16,740 this m-o-v stands for a Move. 669 00:30:16,740 --> 00:30:17,780 Add stands for Add. 670 00:30:17,780 --> 00:30:20,440 And r-e-t stands for Return. 671 00:30:20,440 --> 00:30:22,540 So one mov, one add, one return. 672 00:30:22,540 --> 00:30:27,970 And these, over here, are the zeroes and ones that correspond to that code. 673 00:30:27,970 --> 00:30:31,100 >> So those zeroes and ones, if you know those, you can just put 674 00:30:31,100 --> 00:30:32,140 those straight in. 675 00:30:32,140 --> 00:30:34,130 And then it'll do the same exact thing. 676 00:30:34,130 --> 00:30:37,260 Because, at the end of the day, all you're executing is a long series of 677 00:30:37,260 --> 00:30:38,480 zeroes and ones. 678 00:30:38,480 --> 00:30:40,700 And that's what your code really is. 679 00:30:40,700 --> 00:30:41,770 >> And the reason-- 680 00:30:41,770 --> 00:30:43,680 let's look at one thing. 681 00:30:43,680 --> 00:30:45,440 Did I have the makefile open? 682 00:30:45,440 --> 00:30:48,510 So if we went back to dash zero, zero up here-- 683 00:30:48,510 --> 00:30:52,220 684 00:30:52,220 --> 00:30:57,300 sorry, capital o, capital o zero, not zero, zero. 685 00:30:57,300 --> 00:31:01,810 And we did make, it would still work the same. 686 00:31:01,810 --> 00:31:05,420 But now you notice that there are a lot more assembly instructions. 687 00:31:05,420 --> 00:31:09,090 That's because, again, I asked the compiler not to do any optimization. 688 00:31:09,090 --> 00:31:12,800 >> So I could still take all of these zeroes and ones, and throw them in, 689 00:31:12,800 --> 00:31:13,390 and that would work. 690 00:31:13,390 --> 00:31:15,850 I just did the optimizations, because it's a bit easier, then, 691 00:31:15,850 --> 00:31:17,310 to write that array. 692 00:31:17,310 --> 00:31:19,730 But this would work just as well. 693 00:31:19,730 --> 00:31:24,460 >> OK, we're going to do one final thing, because I think is the coolest part. 694 00:31:24,460 --> 00:31:27,410 Even though everybody's clearly already blown and speechless. 695 00:31:27,410 --> 00:31:30,520 696 00:31:30,520 --> 00:31:31,670 Our minds are blown. 697 00:31:31,670 --> 00:31:32,920 [INAUDIBLE] 698 00:31:32,920 --> 00:31:47,580 699 00:31:47,580 --> 00:31:51,520 >> So, these are from a different CS class, which is super interesting, 700 00:31:51,520 --> 00:31:52,970 that I have taken-- 701 00:31:52,970 --> 00:31:54,140 CS61. 702 00:31:54,140 --> 00:31:55,910 I highly encourage you to take it. 703 00:31:55,910 --> 00:31:58,990 But the cool part about this fact, that things are just zeroes and ones, 704 00:31:58,990 --> 00:32:01,270 are that everything is zeroes and ones. 705 00:32:01,270 --> 00:32:05,330 >> So you can take a file that has the correct zeroes and ones you want 706 00:32:05,330 --> 00:32:10,390 somewhere in it, and use that section of zeroes and ones as a sum function. 707 00:32:10,390 --> 00:32:11,480 >> What do I mean by that? 708 00:32:11,480 --> 00:32:15,755 I mean you can take an image file that has the correct series of zeroes and 709 00:32:15,755 --> 00:32:17,120 ones, that print something out to an image. 710 00:32:17,120 --> 00:32:20,070 And one program might interpret is an image, but you can interpret it, if 711 00:32:20,070 --> 00:32:22,040 you want, as a sum function. 712 00:32:22,040 --> 00:32:27,010 >> So if we wanted to open, for example, this image. 713 00:32:27,010 --> 00:32:37,440 Let's go, Hello Kitty. 714 00:32:37,440 --> 00:32:38,810 Wonderful little image. 715 00:32:38,810 --> 00:32:42,260 In here there is that string of zeroes and ones. 716 00:32:42,260 --> 00:32:45,500 Those 72 zeroes and ones exist in this image. 717 00:32:45,500 --> 00:32:47,695 >> So what I can do, then, is write-- 718 00:32:47,695 --> 00:32:50,510 719 00:32:50,510 --> 00:32:51,760 I have to remember where they are. 720 00:32:51,760 --> 00:32:54,550 721 00:32:54,550 --> 00:32:55,720 I'll find that in a second. 722 00:32:55,720 --> 00:32:57,840 But we do-- 723 00:32:57,840 --> 00:32:59,440 let me find out where they are. 724 00:32:59,440 --> 00:33:00,020 One sec. 725 00:33:00,020 --> 00:33:01,270 Let's do-- 726 00:33:01,270 --> 00:33:05,800 727 00:33:05,800 --> 00:33:07,240 >> AUDIENCE: [INAUDIBLE]. 728 00:33:07,240 --> 00:33:08,490 >> SPEAKER: Thanks. 729 00:33:08,490 --> 00:33:24,240 730 00:33:24,240 --> 00:33:28,740 So if we execute this program, which instead reads in a file, then it goes 731 00:33:28,740 --> 00:33:33,160 to this index in the file. 732 00:33:33,160 --> 00:33:35,500 And then, again, just like mysum, takes two numbers. 733 00:33:35,500 --> 00:33:41,410 We can add numbers exactly the same as we were doing before, which goes to 734 00:33:41,410 --> 00:33:44,850 show you how the fact that, at the end of the day, all these things are 735 00:33:44,850 --> 00:33:45,350 zeroes and ones. 736 00:33:45,350 --> 00:33:48,170 And it's just how you choose to interpret them. 737 00:33:48,170 --> 00:33:50,770 >> And if you actually look at this image-- 738 00:33:50,770 --> 00:33:52,930 let's zoom in a bit. 739 00:33:52,930 --> 00:33:53,720 Can everybody see it? 740 00:33:53,720 --> 00:33:57,570 You'll notice right here, there's some weird smudge. 741 00:33:57,570 --> 00:34:00,130 742 00:34:00,130 --> 00:34:02,290 Let's go-- this is the original image. 743 00:34:02,290 --> 00:34:04,540 You'll notice here there's no smudge. 744 00:34:04,540 --> 00:34:08,420 That is the code for the sum function, is that little smudge right there. 745 00:34:08,420 --> 00:34:13,449 >> And actually, again, if you learn more about this, you'll realize that this 746 00:34:13,449 --> 00:34:18,270 Hello Kitty, which has even a bigger smudge, has code that can take over a 747 00:34:18,270 --> 00:34:21,800 computer if it's not protected appropriately. 748 00:34:21,800 --> 00:34:23,920 So you can actually run this. 749 00:34:23,920 --> 00:34:25,380 I'm not going to run it right now. 750 00:34:25,380 --> 00:34:30,600 But you can run this Hello Kitty image, and it can 751 00:34:30,600 --> 00:34:32,429 take over your computer. 752 00:34:32,429 --> 00:34:35,159 >> So that's all for the demo. 753 00:34:35,159 --> 00:34:38,560 Does anybody have any questions, comments, concerns? 754 00:34:38,560 --> 00:34:39,515 I think this stuff is fascinating. 755 00:34:39,515 --> 00:34:41,500 It inspired me to learn more. 756 00:34:41,500 --> 00:34:44,980 I highly recommend, if you're interested at all on CS, talk to me. 757 00:34:44,980 --> 00:34:50,250 Even though I'm a Social Studies Concentrator, I'm a CS, secondary, so 758 00:34:50,250 --> 00:34:52,340 I still know a little bit. 759 00:34:52,340 --> 00:34:53,810 But I certainly know what classes you should take. 760 00:34:53,810 --> 00:34:57,940 I think it's all really interesting, and I encourage you, certainly, to 761 00:34:57,940 --> 00:35:00,330 learn more if you're interested. 762 00:35:00,330 --> 00:35:02,090 >> OK, I have one final thing. 763 00:35:02,090 --> 00:35:05,530 764 00:35:05,530 --> 00:35:05,870 Sorry. 765 00:35:05,870 --> 00:35:06,460 Any questions? 766 00:35:06,460 --> 00:35:10,010 I didn't pause to wait if anybody had any questions about that. 767 00:35:10,010 --> 00:35:13,220 768 00:35:13,220 --> 00:35:16,900 >> Is anybody going to be a CS Concentrator? 769 00:35:16,900 --> 00:35:18,580 Or thinking about it? 770 00:35:18,580 --> 00:35:20,730 One, two, three, four. 771 00:35:20,730 --> 00:35:21,620 One-- only one. 772 00:35:21,620 --> 00:35:24,680 Anna's is the only hand that's raised authoritatively. 773 00:35:24,680 --> 00:35:27,640 774 00:35:27,640 --> 00:35:29,390 OK, that's cool. 775 00:35:29,390 --> 00:35:30,110 Assam, what are you going to do? 776 00:35:30,110 --> 00:35:33,220 >> AUDIENCE: [INAUDIBLE]. 777 00:35:33,220 --> 00:35:33,910 >> SPEAKER: Constantine? 778 00:35:33,910 --> 00:35:34,990 >> AUDIENCE: Physics. 779 00:35:34,990 --> 00:35:36,720 >> SPEAKER: Whoa, that was fast. 780 00:35:36,720 --> 00:35:40,770 You had a bad experience in CS50? 781 00:35:40,770 --> 00:35:42,015 [INAUDIBLE], what are you going to do? 782 00:35:42,015 --> 00:35:42,980 >> AUDIENCE: I have no idea. 783 00:35:42,980 --> 00:35:43,924 >> SPEAKER: Curt? 784 00:35:43,924 --> 00:35:45,900 >> AUDIENCE: Econ or CS. 785 00:35:45,900 --> 00:35:46,910 >> SPEAKER: Econ or CS. 786 00:35:46,910 --> 00:35:47,840 Tom? 787 00:35:47,840 --> 00:35:48,385 >> AUDIENCE: I'm doing Stat. 788 00:35:48,385 --> 00:35:48,950 >> SPEAKER: Stat? 789 00:35:48,950 --> 00:35:50,100 OK. 790 00:35:50,100 --> 00:35:51,000 What are you? 791 00:35:51,000 --> 00:35:51,310 >> AUDIENCE: Me? 792 00:35:51,310 --> 00:35:51,750 >> SPEAKER: Yeah. 793 00:35:51,750 --> 00:35:52,190 >> AUDIENCE: Stat. 794 00:35:52,190 --> 00:35:52,520 >> SPEAKER: Stat. 795 00:35:52,520 --> 00:35:53,500 Oh, there you go. 796 00:35:53,500 --> 00:35:55,200 Tom, talk to Alden. 797 00:35:55,200 --> 00:35:56,932 Emily, what are you? 798 00:35:56,932 --> 00:35:57,396 >> AUDIENCE: Biomedical-- 799 00:35:57,396 --> 00:36:00,178 >> SPEAKER: Are you in this section? 800 00:36:00,178 --> 00:36:03,040 >> AUDIENCE: No. 801 00:36:03,040 --> 00:36:04,530 >> SPEAKER: OK, that's Emily. 802 00:36:04,530 --> 00:36:05,670 She's my friend. 803 00:36:05,670 --> 00:36:10,080 Clearly not that good of a friend, because she gives me a hard time. 804 00:36:10,080 --> 00:36:13,223 You could be nicer to me in front of everyone, my student-- 805 00:36:13,223 --> 00:36:14,580 >> AUDIENCE: I'm doing your Q guide. 806 00:36:14,580 --> 00:36:14,870 >> SPEAKER: Really? 807 00:36:14,870 --> 00:36:15,510 Uh oh. 808 00:36:15,510 --> 00:36:17,224 OK, you're amazing. 809 00:36:17,224 --> 00:36:19,380 I love you so much. 810 00:36:19,380 --> 00:36:20,600 Oh boy. 811 00:36:20,600 --> 00:36:28,320 >> Anyway, I, last night, like everything-- 812 00:36:28,320 --> 00:36:32,220 I'm sure everybody seems really stressed right now. 813 00:36:32,220 --> 00:36:35,970 I don't know, are freshman-- are you guys feeling stressed? 814 00:36:35,970 --> 00:36:36,855 I'm feeling stressed. 815 00:36:36,855 --> 00:36:37,980 It was like, you go home for Thanksgiving. 816 00:36:37,980 --> 00:36:40,660 You're like, I'm going to do all these things. 817 00:36:40,660 --> 00:36:41,530 >> AUDIENCE: It's so different. 818 00:36:41,530 --> 00:36:42,560 >> SPEAKER: Yeah, and you come back. 819 00:36:42,560 --> 00:36:45,290 Jeff, you don't feel that way? 820 00:36:45,290 --> 00:36:46,610 >> AUDIENCE: I just thought I'd do a little bit. 821 00:36:46,610 --> 00:36:48,660 >> SPEAKER: OK, great. 822 00:36:48,660 --> 00:36:51,650 So I come back, and I haven't done anything. 823 00:36:51,650 --> 00:36:53,260 And it's all super stressful. 824 00:36:53,260 --> 00:36:55,640 And I'm concerned, genuinely concerned, about whether or not I'm 825 00:36:55,640 --> 00:36:57,380 going to finish everything I have to. 826 00:36:57,380 --> 00:37:01,750 But last night, I was not stressed, I was just a little bit sad. 827 00:37:01,750 --> 00:37:04,520 So I wrote in my journal about what I was sad about. 828 00:37:04,520 --> 00:37:08,020 And I was sad about this section in this class coming to an end. 829 00:37:08,020 --> 00:37:11,100 >> So I was just going to read for you guys a little snippet of my journal, 830 00:37:11,100 --> 00:37:12,950 from last night. 831 00:37:12,950 --> 00:37:17,400 Can I get some napkins, some tissues from Tom? 832 00:37:17,400 --> 00:37:18,040 No, I'm going to cry. 833 00:37:18,040 --> 00:37:19,720 I don't cry. 834 00:37:19,720 --> 00:37:22,030 Not that you can't cry, I just don't cry. 835 00:37:22,030 --> 00:37:24,040 I don't even know if my tear glands worked-- tear ducts. 836 00:37:24,040 --> 00:37:25,630 I haven't cried in a long time. 837 00:37:25,630 --> 00:37:26,510 >> AUDIENCE: [INAUDIBLE]. 838 00:37:26,510 --> 00:37:28,920 >> SPEAKER: OK, thanks. 839 00:37:28,920 --> 00:37:30,070 OK, there's a little preface-- 840 00:37:30,070 --> 00:37:32,480 there's some other parts of my journal entry, because I try to journal every 841 00:37:32,480 --> 00:37:33,600 night before I got to bed. 842 00:37:33,600 --> 00:37:34,900 I highly recommend journaling. 843 00:37:34,900 --> 00:37:38,600 It helps you process things, and also be very appreciative of your day. 844 00:37:38,600 --> 00:37:43,063 And it makes it a lot easier to look back on your day and realize that 845 00:37:43,063 --> 00:37:44,240 there were a lot of good things that happened. 846 00:37:44,240 --> 00:37:47,240 Even if you feel really stressed at night or really upset, or 847 00:37:47,240 --> 00:37:49,022 really sad or tired. 848 00:37:49,022 --> 00:37:50,272 >> Oh, my god. 849 00:37:50,272 --> 00:37:52,546 850 00:37:52,546 --> 00:37:54,400 I don't even know if it's written that well because I didn't proofread it. 851 00:37:54,400 --> 00:37:55,780 But we'll read it. 852 00:37:55,780 --> 00:37:59,950 I usually don't read my journal, obviously. 853 00:37:59,950 --> 00:38:03,720 >> "Tomorrow, I'll teach my final CS50 section of the year. 854 00:38:03,720 --> 00:38:05,860 It's crazy how fast time flies. 855 00:38:05,860 --> 00:38:09,900 Yet, I'm struck by just how different my experience teaching this year was 856 00:38:09,900 --> 00:38:11,365 than when I was a sophomore. 857 00:38:11,365 --> 00:38:14,120 For starters, I definitely know the material better. 858 00:38:14,120 --> 00:38:16,820 But don't tell my first cohort of students that. 859 00:38:16,820 --> 00:38:20,030 More importantly, however, I realized that the joy that comes from standing 860 00:38:20,030 --> 00:38:23,160 up in front of a room of what starts out as strangers, but ends up as, at 861 00:38:23,160 --> 00:38:27,150 least, Facebook friends, is not a first-year fluke. 862 00:38:27,150 --> 00:38:29,970 Rather, it's from knowing that, in some small way, you're helping 863 00:38:29,970 --> 00:38:32,980 talented, thoughtful, delightful, and passionate people learn a bit more 864 00:38:32,980 --> 00:38:34,750 about computer science. 865 00:38:34,750 --> 00:38:37,480 >> You're shifting that light bulb just a bit in its socket, so that it's able 866 00:38:37,480 --> 00:38:42,120 to shine brighter than you, or they, could have imagined at semester start. 867 00:38:42,120 --> 00:38:45,390 You're helping turn those frowns upside down and asking questions that 868 00:38:45,390 --> 00:38:49,240 provide support, but still allow students to stand up on their own. 869 00:38:49,240 --> 00:38:52,190 >> It's certainly not an exaggeration to say that this section is my favorite 870 00:38:52,190 --> 00:38:53,190 part of the week. 871 00:38:53,190 --> 00:38:57,930 Or even that I hesitate to say, that's all, at 5:30 PM each week, knowing 872 00:38:57,930 --> 00:39:00,640 that it'll be way too long until we meet again. 873 00:39:00,640 --> 00:39:02,740 >> Yet, I'm incredibly thankful to everyone who's given me this 874 00:39:02,740 --> 00:39:05,010 opportunity to give back to others. 875 00:39:05,010 --> 00:39:07,340 To David, for his patience and trust. 876 00:39:07,340 --> 00:39:11,040 To the film and production crew, for making me look somewhat respectable. 877 00:39:11,040 --> 00:39:15,380 And, most importantly, to my students, without whom I'd have no reason to 878 00:39:15,380 --> 00:39:17,890 spend 10 hours figuring out the best way to draw pointers, or lay out a 879 00:39:17,890 --> 00:39:20,330 table of dolphins, via JavaScript. 880 00:39:20,330 --> 00:39:22,620 As always, it's been a blessing." 881 00:39:22,620 --> 00:39:25,420 >> So with that, thank you guys. 882 00:39:25,420 --> 00:39:29,000 I'll see you all at the CS50 fair, and the hackathon, if you're there. 883 00:39:29,000 --> 00:39:32,020 And if you have questions, I'll stick around until there are no more. 884 00:39:32,020 --> 00:39:33,760 But I thank you guys for a wonderful year. 885 00:39:33,760 --> 00:39:37,290 >> [APPLAUSE] 886 00:39:37,290 --> 00:39:38,540 >> SPEAKER: I might cry. 887 00:39:38,540 --> 00:39:40,800