Round after the keyword about missing. So that allows you to Salt Lake City. >> Goal is solid number like this you and that you in my reg X to kill people characters, one of them was println is repetitive, MJ. >> Yeah, it's gotta be I. >> If you do law, you probably always you do what you've always done, you'll get what you've always got. >> Oh, snap minute 48, reagan crazy. >> All right, welcome to class o. >> Here we go. >> Alright. >> Feels a little sparser, told us sort of mirrored Cluster II desks that accumulate is like a source and sink theory of life, right? >> Like wary to slay the vector field. You gotta call independent what class you play with vector fields in math? 2.3.3. >> Yep. Okay. >> Alright, so does the vector field. >> There's some sort of late PLO spot over there where desks, if you can't get back out, so we can invent an elevator. >> I'd be dumb. >> I want to do a stress test with y'all, your terminal day. Thanks to so ESP back from last time that I think we found what was going on, which is 32 people who got the same box would look right, but you wouldn't have any control. >> So now we use random number generators. >> So everybody, if you wouldn't mind, spawn up a three terminal. >> It's not for ij's paying, but I had little quotes over there, a lot of texture. These'll be like tutorials to the left-hand side, like cyber problems in the right hand side. So like I'll do anything free stuff isn't Sandra Bullock. >> Thank us. From speed? Keanu Reeves. Okay. I'll just fire this up and let me know. >> Isn't working for you working? >> Yes. We any problems anywhere? >> Awesome. >> It's performant. Fantastic. That's great. >> Well done. >> J three or four stress tests. >> Then we're ready to roll. >> I actually kind of the stress tests one of my other piece of software to it is pure. I'll just do it at the end of class if we've got time because it does not help you anyway. >> This actually helps you bet. Like this epistle. Besides what? It's just purely for my benefit. >> Nicely I want. >> Ok, so then we've got our free terminals. Let's use them. >> Here's my goal today. >> I don't have my podium thing, so it makes me want to sit. >> If I sit in the body language is all wrong. >> It's dry day, you can crush it this week, That's pretty wildly did that that data is cancel to get parents compensated. Yeah, we're not going things up. You're gonna get its first grader, right? >> So it's just like, tell me how wonderful my daughter is doing great, right? >> Like this whenever I teach. >> And I think that yes, my daughter has no secrets are flawed. >> But this will be really healthy preparedness psychologists Wednesday. >> Okay, so here's a job today. >> What I want to do, this is kind of the official beginning of the end of our like sea deep dive. Does everybody feel good about your CD38? >> I feel like you've seen enough to go do, of course, like always being a passive recipient of lesson that some teachers ****. >> But you have to do is going to do it right? >> And so then you go back and reference after you're like, oh, what do I need that? >> By the way, I thought like, I'm sorry, I'm taking babbling a bit today. Excuse my whole schedule was off like little schedulers. >> So it's just like inlier for 20 minutes to kill at times. Very time mode, but science class time. >> And I saw like a programmer humor Reddit thing picture. And they were talking about how like the earth was made by a programmer. And, and like they hacked in, like the light attached to the earth and they added water and it flooded the light. Now they're in the dark stack overflowing and stuff like that. >> But the only thing that worked in the whole time is when they used the STL from C plus plus that just work perfectly. >> You know, like maybe more of the story is that this is, this is where the real product. >> So here's the job today as we transition out of glossed as like a thing into kind of the security side of stuff. >> This first, this, like this. >> I call this like a halfway lecture because these two are things that I use all the time. >> And it's just like an open source library developer. >> And but we also use them all the time. It's just like CTF. >> Pawn Stars is that term. >> Pensively like I just like edgy enough anyway, whatever become so anyway, so I'm going to do these things. >> So here's we're going to do, I'm going to give you a series of like seriously flawed programs and the jobs to figure out what's wrong with them. Because pretty much every time there's gonna be some malware that works off of your code that you've installed the space shuttle or whatever, or the pacemaker of heaven forbid, then that malware is foothold is going to be a mistake you made, right? So these are different flavors of mistakes. Some of them are career costing and we're going to hunt them down and tools and things like that and just visit inspection. >> You could probably visually inspect at first just to like, fight them and that's fine too, right? >> So, so let's go to the terminal, let's do error one, compile it, something will go wrong. >> So here's that program one. So scrap this. I'm gonna go to my three terminal. >> Well, for me, oh ****. J, when I change the tab and to come back to the web server is disconnected. >> This shouldn't I can't cite now initiative that started to keep her tab now refusing air-conditioner. Alright. Okay. Alright. >> And I can make the connection sticky because what we get, and yeah, I just like switch tabs. >> And when I switch tabs that came back into his daughter and I did the same thing or I'm going to roll with it. >> I'm gonna roll with it. >> By the way, if ever again, I said this before and nobody took me up on it. >> If ever you want to spend 5-10 minutes the ed class, especially on a Friday, drink then golf like it's just really valuable for insights. And why vim is so valuable? >> When we were talking with the higher ups at JPMorgan cybersecurity, they're saying, hey, one of the things that you need to train on as you build out your training software is like living off the land, they'll call it. >> So if you exploited, if you're doing offensive or whatever and you've exploited box, you've gotta build whatever you've got on the system you're in, right? And so the reason BIM is nice, because most of the time of day text editing, it's because I'm at a terminal. I gotta do what's exiting from the terminal. So you know your Visual Basic I've installed or, or Visual Studio, whatever it is you, you kids views, you hipsters. It's, it's like a GUI talk with GUI and pushing it to my server. >> It's like that. >> Whatever, I'm a sensation to some place where I've just made a reverse shell, right? So I'm going to edit it on their stuff. >> So let's see what goes wrong. Nothing. Okay, here's the subtlety. >> The random number generator should be generated. >> Evens and odds not so random. >> Go ahead and find me the error. >> Probability. >> You get data group up and up and handed me a scientist? >> Yes, yes. >> So my best friend in the world, he's also a professor here, whatever. >> And, and Brian Yaos, he was once in your shoes, Computer Science or you're in his class. >> He had to go and, and he was telling me a story that this particular error almost cost in the entire career, right? >> Like when he was your age in a CS class, he had this somewhere. >> And it's a bug in this code, the single equals looking for it everywhere it compiles. Okay? >> The problem is not there. And then, you know, after like two days, I think I'm ready to quit this major or whatever anyway. >> So just be careful that even if these errors are curricula like I remember, sorry. >> Okay, so now we're going to do it in this other way. So, so By the way, I just like this image. >> I think that your generation is just like in a very savvy place. >> Especially becomes like means embeddedness and things like that or whatever else. Like, you know, if I had loss built into this image, you don't be like, wow, if launch. >> And it's like, where's my generation we've been talking about is the HA is. >> So this is always going to say everything's contiguous, like behind all the open source tools that we're using on our command line here. >> I'm gonna do is we're gonna do is not Unix, which I just think it's like a greatest acronym of all time because its recursively impossible. >> Anyway, by the way, that's also since I'm in such a badly mood, forgive me the most valuable lesson I ever had when I was learning how to code or whatever else is learning how to think. >> I would say like as computer scientists is recursion works when you just pretend like it works. >> And so to some extent, like that sentence has been with me forever. >> You want it to work, just pretend like it works and it does, which is to say you're gonna call yourself, where you're gonna stop something. >> Just pretend like the stuff that you've written is going to do its job and trusted do, just like the tiny little stuff you have to do once he does its job and any handled one base case in your dust like that. >> There's something magical in that, like learning to trust and fibers and painfully something non-religious version of faith. >> Right-click and edit and it's helpful. >> Okay, that's I install GDB and we go r, j, say You don't deserve this much to direct the song. >> They're trying it. >> Hey, I'm losing sleep over here. >> Lose sleep and money to provide you this beautiful resurface, do **** on me? >> Yes. Yes. >> Welcome to being a creator. By the way, there's a lesson in that to your generation is full of critics. >> Don't be a critic BY a builder o, but now my own web, well, I bounce back and forth a lot and it'll be on the other. Why did just like gone for a while and I was like, I'll go over here, instant. >> Alright, so we've just installed TTP. >> Gtp is really powerful little tool and let us do this carefully. >> So I'm gonna have you recompile, run whatever terminal you're at. >> Width minus G. Minus G is basically going to be the debug mode. >> It's going to put a, it's kinda like keep the source code in the execute. >> So any executed like, and I see what you wrote and things like that. >> Little flags relate, line numbers and replica. >> And so now we're going to use GDB. A dot out is everybody at the station this actually, this might be a good time delay. >> If you are not there, find the person next to you. >> And in fact, I'm just gonna make me think going like CircleUp, let's circle up talking to people around you, you guys, there's a cluster, there's a cluster, here's a cluster, cluster. >> You have a choice individually. >> I think habitually drift, drift that way. >> He's like Joachim into me. He has turned around, said show me its back, which is defined like animal weakness. >> Yeah. I know. >> I know whenever I'm like in the middle of a feud with an enemy, I also keep my back to the wall. >> I mean, you could also not seen as a credit pool. >> But he does like it obviously does because it does not want to show me his back. So it's a very successfully like at this stage. >> That said, the reason I got two in a group is that you can hold each other accountable. >> If not, you will sit and think on not Facebook, but whatever it is. >> Get the courage to take on instagram, take talk. >> I don't know, I don't know what you guys are up to. >> Okay, so step one, type list and it'll just some source code. And I think if I just type L, it will show some source code. >> Also almost everything that's like human. >> There's like a shorthand for it in GDB parlance. >> And now if we go list 15, that's going to give me some source code centered around line 15 >> We've already found that the problems were just kinda like synthesising as if we're looking for the problem. >> But now we can break 15. This will set a breakpoint at line 15. >> And I'm like, okay, breakpoint set. >> I feel like I'm really going to make some sort of a joke centered around growth, point blank or Keanu Reeves surfing movie, which was 1 break. >> That's exactly right. >> So like one of those two would be perfect here, but neither is actually good. >> Happens right now, when I am ready, I've set a breakpoint to another break, break, break, break 0.16. Our r is going to run on what operation not permitted. It's everybody else having that error. Do I need to be GDB plan that you ever seen this or no trace? >> Yep. All right. I'm going to do control D to get out there. >> I'm going to hit up, I'm gonna do the whole thing right? >> At every 0.15. Right? >> Okay. >> Alright. >> That's okay. That's okay. I really appreciate you were cool. Yeah. Yeah, that's fine. All right. >> So our terminal is working all right. >> Analyses on me to configure a test inside our wacky environment. >> I am GDB, just like on my terminal. >> All a lot of folks probably will everybody have a backup terminal? >> We can go to the cloud. >> That means my crazy S website is good. >> That's not a dams left and right. >> That is i0 dot cloud destroyed. >> Now I've got my server to Tokyo. What a Shame, Shame. That's Again, this is, but actually this is one of those like profit into lessons though, right? Like, like so the reality is that it's built out anything. >> You have to stumble 1000 times, right? And so one of the things I hate about classes and the way that guys think Book raid and things like that is that the whole lesson, it's never fail, ever screw that, right? >> So real deal here. >> But did my natural sort of nervousness of having a public failure cause me to make that leap to pass you guys falling with me. I'm jumping over two pi e. >> If I'm on like terminal base browser, if you have used your own terminal RBM or whatever else and work there, how many of you are on your own like terminal or VM already. So that's more than app, right? >> That's what I like to go to, the place where I can meet. >> Hey, by the way, I was just having this conversation, the guys in my very bizarre personality today, the lowest common denominator is like a thing that will say about groups of humans. And it's saying, you know, length of sorts or whatever like the thing that will appeal to everybody or that anybody could do. >> But I'm a mathematician, that lowest common denominator is actually the least common multiple. >> And select what is greatest common divisor in terms of humans. >> So like, you know, like what will be the greatest common divisor of you all as a group anyway, right? >> Like just just food for thought. >> Adp came in pre-installed. >> Does that pretty cool. >> I have no idea whether or not the same permissioning problems here on Piazza di cloud. >> So let's find out problems. >> Okay, I can, you know, make sure that you get to that stage where we run it. >> We got the breakpoint line. Probably we've been there for ten minutes while I would read stalling a patient club. Now this is like my favorite part of this first little GDB tutorial here, which is that from this moment in time, I can now print x, print x M two. >> Now I happened to set a break 0.15 partially because right here I can see this is an odd value, this mod two, I should end up with a 0 there when it would break 16. >> And take one more step, step go and now print x and 2x. >> So that's there. So at this point I could like, you know, we already know what the problem is. >> There's an assignment where there should be a comparator, but I can like see it for myself, right? So I walked into line 15, look at some values, see that it's not like this is actually okay. >> There's a bug here yet. >> Take a step. >> I wanted to hit Run. >> Run was not the right thing because it's like, oh, you wanna restart? No. >> How about step >> Step that'll do and that'll just go to the next break point. >> Take a look at my stuff. >> Go to the next breakpoint ticket looks and stuff. Okay, cool. There is a lot more power and GDB than what I'm showing you here, right? >> And, and I think like when I was getting what I was going to get good at them. That's with an I and a you. I had a mug mug that shrink my coffee all the time, like my cheat sheet on it until it's an internalized in my head. >> I think the same thing can be true for GDP. >> The, I should probably have a link like this somewhere in their discipline on GitHub set arcs R1 with ours three directly support reasonably standard IO channel. >> Oh, I did not talk standard IO and all that. >> You guys are you guys comfortable with Blake backup command line piping? >> Like it's going to print to screen. >> You can run your program. >> This is just I can like take this program and take the results and dump it into a pile. >> And now instead of showing on the screen is in the file, right? >> And I could do that with like the error channel or I could like read from a file or whatever and things like that. >> So you can use these piping to kind of replace any of the places where it would be a keyboard with some sort of other streams of data in the file or like a serial forward or some other wacky thing. Sorry, I just realized never said that my like C stuff. >> And that's kind of a cool concept if you haven't seen important. >> Okay, yeah, we've already solved the careers. >> That takes the whole bought out of doing that challenge next up. >> So the next little thing is that tool-based day. >> The next one is called Valgrind. >> Let's see if I use the cloud as it naturally occurring, Valgrind is nothing. >> Okay? >> Install R e root rho Valgrind, which isn't real. Well, let's take the Stack Overflow, outgrowing install sudo apt-get, install Valgrind, that it'll work. Continues. >> Machine upbeat >> My view apt-get update that'll download all the packet isn't crap. >> These are technical getters or tensile. >> Okay, sorry. >> So that the commanded it to install this. >> We're only using apt-get update, apt-get install Belgrade. >> And this is the one that prevents you from crashing the 747, right? So this is the one where you're building for where you've got your thing. >> It's gonna go to the Space Shuttle. And if it runs for 287 days, everybody dies. This is how you prevent them from dying after 287 days. >> This is my memory leak detector. >> So again, if you'd like to release manager, go check. >> So to some extent I think I'm going to say error two has a memory leak. >> Your job is to use Valgrind, figure out all the flack need to add to it until you can solve the memory leak in error to write GF, right? >> You're not going to solve it just by looking. >> But the intention is that in practice with a tool, not just by the end, you'll probably want the minus Gian. >> But after you run it, they're like, oh, hey, check the week trick pole or whatever. And you can keep like adding flags until you've got enough information. >> We're just telling you exactly where things are getting released. I promise you guys this. Before that, when you're pocketing a whole bunch of open source libraries, the repercussions of time running out. Oh, that's right. >> You guys wanted to go get a good thanks when you throw a bunch of flags and they're eventually gets there. >> This is the way that you can test the hundreds of dependency hearing like packaged up and give to the world to see if any of them are leaking memory, right? >> So you need a tool to be able to do this automatically rather than just scan it with your eyes on here a lot of chatter, making progress or not attempting. >> Typically, that means not attempting or means you already like really dirty none which of those worlds by living. >> It >> It's easier to never mind. >> So what's nice, it's like okay, here mindset. >> And here's the thing about all this data. >> If I want to say it, definitely recognize this is the malloc that never got fried. Okay, cool. >> No least possible. I feel good about that. That's Valgrind, right? >> Again, oodles of power in both of these tools that you can go dive into and you can Ash's, let's take a look at this one here. >> Three. >> If you run it in my REPL it here, I find this to be one of the least useful error message. >> If one of the things that happen, kids, they like learning a new code or whatever your job is to see what you see every error message right here. >> So simple, that's another one of those classic thing that you guys are all going to make a bunch of seg faults as you build out your markup that go by the way, okay, well, by next Friday I won't be here. >> And so people will be here either. >> You know, it's just the two of us won't be here. >> Then if you guys want to like work or whatever else or something like that, I can get a guest lecture, but just like work anymore. >> Cupcake on Monday. >> But you'll have a space where you could get together with your partners are okay. So here we go. Here's the job. >> Which of these tools is more appropriate for solving error-free? >> What's the essence of the problem? How do you identify it and how exalted it's probably not hard enough of an error message. >> Actually need anything worth visual inspection. But soon it will be hard. >> That is Valgrind proper GDB problem, I suppose. >> I think, I think of it as a GDB problem. >> And I think I'm at GDB problem because segfaults decrement happen when you're doing something you shouldn't be doing. >> They're almost always going to happen when you are going to a spot in memory that you have no business going to. >> Or it just didn't even know how to interpret your address proper. So in that case, like if I can set break points and go through and see what happened here and what were the values that feels right to me? >> So what's the essence of this problem? >> By the way, I see what you're reading, you're kind of b. Now this is okay. >> This line is perfectly legit by these two lines are totally fine. >> Typically returned to access the memory located, right? >> This one? >> No, I'm actually not trying to access memory locations. >> I never allocated memory in the first place. I've gotta, I've got a pointer that's on initialized. So like I'm dereferencing an uninitialized pointer. >> That's the essence of this April. So when I'm going to a place that just should not be going. And so this is the line where going to a place they should not be going, right? And you can see that by doing like setting break points, you just like walking through GDB, like what happened with my sexual, like what I'm going to solve segfaults. >> What I do is I just start littering my program with C out anywhere they like, kind of in a binary search style, Probably like C out here. >> Made it 0.1 to 0.2.3 minutes. >> Two but not three going in between here made it they made it there until I find the very line where it's like did something you shouldn't be doing and then look at what it did try to do. >> Ok, that's the uninitialized thing or that's like, you know, I I deleted this and then reference it afterward or whatever it is that makes the sexual segfaults will happen to you getting good at solving. >> So here's real practice. >> So here's my final task for the day. >> You got 15 minutes in a group. >> Here's an implementation of a linked list. >> It has several problems. >> Find them all, solve them. Let me know what they are using. Gdb, Valgrind, and both really? >> Oh yeah, this, by the way, has also served as subversive goal, which is that this is how you can declare a templated class function outside of the class definition. >> And just notice what that syntax, and this is the part that I think it's unexpected. There will come a day when you want to look at that exact list snippet when you find that from this day coding interview challenge. >> If you're going to come work for me at the applied physics lab. >> I wasn't listening. Advance me on the way to class today. >> Like boring study or borrowing. >> Justin Timberlake hits appealing. >> Okay, What does core dump? Texting picture Star Trek Bikes link. >> We have dumped the work ord order increment pointing up or whatever else. >> So a central place to put my first break-point here, we're just putting a break points wrong. >> Definitely pretty functions do something wrong. >> And what I saw I saw this stuff come out and at a seg fault at the end. >> So I kinda wanna do my light-like line. >> Well, let's do one for each English or recreate the earth coming out about Grindr a lot easier because once I right about that, but okay. So there's two there's two areas going on here. Saul's lost a 176 bytes in the United States, open up within, in this life, so that you're going off to the right for them. >> So what's the fix to this? >> Can you guys recognize what the essence of the problem is? >> So when we get a seg fault that you're gonna get a lot. >> It happens because your de-referencing something you shouldn't be referencing. >> So what is the thing that is wrong with this kind of linked lists? >> To the way this linked list is working, they're gonna address. >> And at that spot, at that node, I'm going to store an address to the next node and like a value. So I'm just gonna print the value and go to the next node. >> Go to the next step and I'm going to go until my last address is 0. >> So whenever I have my next address 0, that means I'm at the end of my LinkedLists. >> So here this is going to walk through until I get a 0 variable. So what's the essence of the problem? >> That good will the next initializes things like either knowledge 0 here, like when you, or your brilliance, I wonder, oh no, I'm going to do much simpler. >> I'm just going to swap these two lines. >> So this line is the one that's walking me through the linked list, but this one is referencing the data. So if I get to the end of the linked list, I'm going to have a 0, but I'm now trying to look up data from a 0. So if I just take this line out and drop it here, everything should be fine. In terms of the Saint Paul >> All right. >> But we're not out of the woods yet now. >> Would definitely losing 16 bytes and probably a 160 bytes. Okay, alright, so we have a memory leak problem. >> How are we going to solve our memory leak problem? >> I told you before that if you're using new, you need to use delete. >> All right, so this thing is kinda like instantiate. >> This thing will act delay deconstructed at some point. >> But this is the LinkedList. >> So if you've got a deconstruct a LinkedList, I can't just forget about the first node. I'm going to have to go to every other node and forget about it to probably even in reverse order. Once I forget about it, they don't have the next one or whatever. >> So you're going to have to write it d constructor that clear as each note as it goes in order to avoid losing that memory. It's not actually that part, but it's a little bit since you've thought that way. >> Does it take to 20? >> I'm going to selfishly take the last four minutes and have you stress test a web app forming. David and I built this one together. And I'm next Friday I'm going to be in New York talking to a bunch of business schools or whatever else to show this software. >> And the last two times I have gone to New York to show the software. >> I've been late, traumatically embarrassed during the thing, so I want to make sure I'm not traumatically embarrassed. >> Now, this is the latest version. This is our client and Singapore, Oh, I lost my notes. >> Alright, should we all had to NTU that each redirects.com, you can log in anonymously. >> You can even edit your name and it everybody would make one solid hair session. Your solid here session will be sort of colored differently than everybody else's, right? >> And then you click this arrow to join. >> Once the VM is sort of ready to go, sort of battling it people for a little bit here happening than, than we click sparked that work. >> If everybody that were popping up in the right way, that's all good. Alright, minus. Now ready? >> Click start. >> The way this works, by the way, and this is how an order book works when you're trading stocks. Is that this market your, you have a mission like I did buy 500 herself by b. And in order to do that buying you can either buy from the market, commuting by this price where you can sit and wait the market to come to you. >> So I can go over here typing 100 and hit Enter. I'm going and take one of these things, type in a number and hit enter and tell me how laggy as being or not being. And ten I'm going to ask for a better number. And your Edinburg? >> Yes. >> You can't tell factorial remember over it. That's that's, that's a feature, not a bug. And it's actually probably my Cookie Clicker that's causing mind to be a little laggy. >> Like I don't know if anybody else having laggy stuff relationships, your people outbreak immediately alone. It took a while to be able to get started. >> That's true, that's just the VMs, but once you're playing, it responds that airlines definitely a little bit.
cpeg476-010-20200228-101000.mp4
From Andrew Novocin February 28, 2020
8 plays
8
0 comments
0
You unliked the media.