All right, I'm gonna take a look at this before reading your email as you're writing out what the story is Lower that volume just a tad back. You know, it's so interesting how to me sound design helps I always say that if I wouldn't do animation out to sound design But I just love how there's just that extra layer because of the sounds. But anyway, let's watch it again So my two impressions would be This is all cool here It's a bit of a tricky pose with this stump out here We don't quite know what's going on with the legs, you know the hands It's very dark.  It's trying to get out and then here He seems dead So I'm not quite sure what's going on there and in terms of style it feels like when this happens Could be faster and snappier and just I don't know how far you want to go in terms of style and cartooniness and having bounce up and do some leg scramble, but I feel like this could be bigger and Then when this happens, it's weird because this seems like whoa like what happened there But then on this it feels more like, huh, I Guess that's where I put my corpse or whatever it is. So I'm not quite sure Either you make this less of a surprise so this seems more in character or If you want him to be surprised and shocked, I would make it bigger But then this here I would open up the door and have to take a couple steps back to kind of Be in them more like what's what's gonna happen? Why is this person in there? I don't know. That's kind of that's the reaction that I had I'm gonna read now what you wrote and pause this critique Alright, this was just a split second for you. I read your mail It's totally Different okay for those that are watching there's another couple things So you're saying he is happy and really focused while working in the kitchen. Let's turn off the sound This to me seems fairly relaxed like up. All right I'm gonna put this in here and put this away. This seems very very relaxed and kind of like I guess it's Wednesday. I gotta do this except for this which is Interesting, but if you want to say happy and focus, you know They could be a little bit of a bounce and and the way he turns this off cookie Where's my hand getting over there could be a bit of a like he's doing kind of this and Instead of just going turning it off the knob a little bit of a you know Snap to it. There's a bit more and you can probably push them this a bit And then I would probably Where is this hand here? During this I would do a switch from the cup to this to this hand because right now the silhouette is a bit muddled I was thinking imagine that hand could be here and imagine this arm, you know, I Mean you could have it open like This right if that's that's the body, but it's just something where I get my arm It's not like hitting like this, but he could do Like arc and then Like just there's more exaggerated motions and kind of like I'm putting this in here I'm gonna put that in here like those type of moves you could add to give that impression of he's really really happy Because that's what I'm reading here. That's what you're trying to do and for me. It seems a bit more relaxed Now here's the biggest change from what I got from this you are saying He wants to put the garbage away. He's really in a flow. Sure Then he opens the door and his child say his children is there, but I think you just mean his child is there and wants to scare him This given the colors, you know, excuse me. You also say it's a placeholder, but That's I was wondering what that poses but with the red eyes and the black this to me seems more like You know, it's like it's a thief or someone But then because of the ending He's knocked out or dead so for those that are watching it's his child that tries to scare him He is so freaked out, right? He's turning really he's closing his door really really fast in his reaction and basically knocks the child unconscious and Then when it opens this happens, I think it's just fairly confusing a what I mean He is smaller in scale, but it's a bit tricky, you know, I mean, it's it's like you want to put this door over there and Make this a bigger door, you know And even if it's not opening or like this it could be a door that kind of folds I would just give I'll find a way to Give this character more room and you can potentially again Scale it down even more and then definitely have the same color. So just visually understand that they're connected This just gives me a weird see if robots droid vibe, you know, I mean So That's not you want to see the kid. Okay, so yeah I would I will give this more room make him smaller so that we just see we have a room for more clear poses And when you open this I would have the kid in Very very clear poses of potentially arms, you know again I can't draw I'm gonna be horrible at this but the point being that there is a clear pose of the character waiting Anticipate this can be over two three frames this and go And you can see the animation hands doing this going Right so that it's clear that the characters alive doing this and Then when you close this You're talking about also how the timing is between this I still stand by what I said before where Let's make them happier by what I said here about this It's too slow and you said you're not a fan of this. I don't mind. I wouldn't maybe stretch out this as far. I Think you're okay with this more bent But I like this being far away.  This changes a lot But just as a thought I have right now. What if he jumps back?  You see you see the kick going And fall down so we understand visually that This character in there was alive gets knocked out and then falls down and then you could just end with You know the door will be open. He just kind of you see him wiggle falls down and He could be here. Maybe still one leg in there holding his face And that could be your trembling moving hold while all the movement is here so that the audience knows where to look This just felt really too casual opening this but again, this would change the idea of Him opening it again, but I think I Mean that that would be my thought of really big explosion jump back big arm Closing the door and just again the door hits and then immediately bounces back and slowly opens so that we We don't see this character for maybe a frame or two But then you can really focus on your animation on the kick. Oh and an arms drop and Falls down. I Think you know and as he falls down, maybe a little toy comes out rolling or there's just more stuff that you can do here While the other characters in the moving hold being freaked out that that's kind of probably what I would do and be What more fun than just they'll quick take and then slowly opening Because if you do it like this, but this is another way you can do this where it's not the kid and you know maybe this is You know, what if you have blood splatter and He's just cleaning and he's not making a pop But he's just kind of cleaning and he has a sponge in his hand He's just kind of cleaning and you want to get like what's going on with the contrast will be blood And maybe like broken parts him still happy.  There's blood everywhere and he's just kind of cleaning things and then as he opens this You can do still this maybe less of a surprise and then when that opens You have him then use the leg to kind of shove him back in close this and he continues to clean I don't know if that's a good idea, but there's something where I'm cleaning like in the audience goes Why is there so much blood and then he opens the thing and he falls out He goes out because he just killed this person and he's more relaxed going. Oh, yeah, I forgot I gotta put him back in there while I clean I don't know that could be something if you want to change the whole shot obviously that don't do that but just a thought but Yeah, that's kind of what I have you're asking about the hands definitely, I mean, you know him cleaning and Smacking the door you can do like all the big poses on the hands and it gets back where the hands are like this on His face as his concern the kid doing that with big hand poses I think there's a lot of stuff you can do there And you're also asking if it's okay to see just see the back to me It's okay because you're doing broad Silhouette moves and the character has no face except maybe eyes, but so it's okay. We don't need to see the face I think that's totally fine So yeah, that's kind of it. I'm curious what you think these are just kind of my impressions Before reading and I'm glad that you wrote spoiler So yeah, let me know let me know what you think and how you want to proceed Obviously, it's your shot and agree with what you want, but these are just my impressions on first time viewing. All right. Thank you All right, there's an email you can sign up you can start whenever you want you can submit whatever you want You get 16 submissions either way a like and subscribe would be awesome. All right. Thank you


So if you want a good, gritty, backwoods revenge type movie, this can be in. Yeah, watch House by the Lake or Death Weekend. If you can find a fucker. And until next time, keep drinking.


Get Shiny Pokemon Easy in Pokemon Scholar and Violet. First, check the interactive Scholar and Violet map on Cerebi.net. Second, check areas around the region where only one or very few Pokemon of a single type spawn. Like this Pyro, which is one of the only fire types that spawns in the Glizzard or Mountain area. Three, head to that area and make a sandwich with the Encounter Power Level 2 or Level 3 for that particular type. If you're making a sandwich with a Level 3 Encounter Power, make sure you do make one from this list that you'll see now with Level 3 Sparkling Power to give you that increased chance of a Shiny Spawning. Or run up and down this area, despawning and respawning the Pokemon in this area. You'll notice that because only that particular type spawns in the area, because you have your Encounter Power active, it will be the only Pokemon that you'll see and appearing as long as you have this sandwich power active. And this will make finding the Shiny for this Pokemon very fun and super easy. And once you've found the Shiny, then use this method on any other Pokemon that spawn in odd areas compared to their typings to get easy Shiny Pokemon in these games.


Live from San Francisco, it's theCUBE, covering Google Cloud Next 19, brought to you by Google Cloud and its ecosystem partners. Hey welcome back everyone, it's theCUBE's live coverage here in San Francisco in Moscone South, we're on the ground floor here at Google Next, Google's Cloud Conference, I'm Trevor Stu Miniman, Dave Vellante's also hosting us out there, getting stories, our next two guests, Dana Berg, Chief Operating Officer Sada, and Chris Lieman, Head of Engineering Sada, guys welcome to theCUBE, thanks for joining us, we're here on the ground floor. Thank you. This is exciting, I feel like a movie star right here. It's game day here, all the tech athletes are out there, if you look at the show, look at the demographics, hardcore developers, a lot of IT leaders also here, cloud architects, a lot of people trying to figure it out, we heard the keynote, Google's bringing a lot to the table, so what's new with you guys, you guys recently sold your Microsoft business going all in on Google, talk about that relationship. We are, this is a brand new day for Sada, the energy around this place, where we are in the market and where we are with the expanded attendance here, has actually reaffirmed our business strategy to go all in with Google, I don't know if you're aware, but Sada has been around for almost 20 years, historically have always been leaders in bringing people to the cloud, even before there was really much of a cloud, we were a pilot partner within Microsoft and Google and had a great thriving Microsoft business, but an even bigger Google business, and we looked at the tea leaves, we looked at where we wanted to be and aligned with a company that shared our mission and values and it was a clear choice, we chose Google, we made a very specific and deliberate act to sell off our Microsoft business so that we could take the horsepower of all of our engineering staff and apply them to Google. It's interesting, we've been around for 10 years doing theCUBE, we've got a lot of events, I mean Dave Vellante, Stu and I have been around for 30 years covering the IT, you guys 20 years, you guys have seen many ways of innovation come and go. Now you're going all in on Google, what is it about this wave right now that made that decision, what do you guys see? You're seeing something early here, expand on that, give us some color commentary because there's a wave here, right? There's a combination of things, we saw the client server thing, we saw that movement, we saw the internet, we saw the web, mobile, now it's cloud, what's the big wave, what are you guys riding? I think there's a couple of things and I think it's unique to philosophically how we think of our real special relationship with Google. There is a momentum, right? And not to quote like a Bernie Sanders, but seems like there's a revolution going on here, right? And I think what we see when we look around and we hear conversations and even with our customers, the way that we're all winning together is because we're winning the hearts and minds of the people inside of our customer base that are actually the ones responsible for inventing and the ones that are responsible for building. So when we're in boardrooms and we're selling and along with Google, we're talking with developers, we're talking with designers, we're talking about people that are actually driving the vision for these business applications. We're not always talking to the CIO down, like some of our other competitors seems to have only been able to sell that way. We're talking about the people responsible for not only constructing it, but maintaining it. So that revolution is there. These folks are bubbling that up and they're seeing the real value inside of Google. And what is that value from our point of view and why did we make such a bold statement just to stick with Google is, and we saw Thomas today echo this, I think there's very few cloud providers that are bold enough to actually lead with the fact that we want our customers to have full choice. Whether you're using GCP or not, we want to build, architect, and manufacture a product offering that allows you to keep your stuff in your data centers. Move your stuff to AWS. That power of choice is really not like what we've ever heard anywhere else. And then on top of that too, you got application renaissance, right, a whole new way of coding, infrastructure that's programmable and going away. I mean, if you think about what that does to the existing infrastructures, they can now mix and match and re-architect everything from scratch and accelerate the app movement. Well, that's absolutely true. And a lot of that has to do with the fact that there are managed services in the cloud which makes it dramatically easier to build applications, of course. So there's no question about that. Some of the offerings on GCP are particularly attractive for our clients, particularly the managed Kubernetes service. That's where we're seeing, perhaps, most of the interest that we're seeing, like that's a very common theme. Also the ML stack is an area that our customers are very interested in. Yeah, sure. Chris, can you bring us in some of those customer environments? You know, one of the things you hear about most customers, it's, I've got my application portfolio, modernizing that is pretty challenging. There are some things that are kind of easy, some things that take a lot more work, but migration is one of those things that makes most people that have been in IT a while cringe because there's always the devil in the details and something goes wrong once you've gotten 95% done. What do you see? What's working? What's not working? How's the role of data changing and all of that? I think migrations are usually more complex than they at first appear. And so even with best intentions, thinking that customers can just move their workloads seamlessly to the cloud have actually in practice been more challenging. So some of the areas that we find challenges are around data migrations, especially in the context of zero downtime that's always more difficult than with applications. So that's definitely an area that we're spending a lot of time working with our customers to deliver. Just to add to that, I have to keep reminding myself of the name, but obviously the Anthos announcement today sounds incredibly intriguing as a lower barrier of effort to actually migrate. Our customers have been trying to really absorb and take a hold of Kubernetes and containerized methods for a long time. Some are having a harder time doing it than others. I think Anthos promises to make that endeavor much, much easier and I think about as we leave here this week and we go back and we re-educate our own engineering teams as well as our customers, I think we might see some highly accelerated project timelines go from here down to here. And the demo that Jennifer Lynn did was pretty impressive. I mean, using the running inside a container whether it's VMs and then having service batches on the horizon coming to the table is going to change the implementation delivery piece too in a massive way. I mean you got code build run on the cloud side but this kind of changes the equation on your end. Can you guys share the insight into that equation because Google's clearly posthumant to be partner friendly.  This is an interesting dynamic because you can focus on solving customers problems. All this heavy lifting kind of goes away. Talk about the impact to you as a partner when you look at Anthem, Anthem migrate in particular some of these migration challenges with containers and Kubernetes. Seems like it's a perfect storm right now to kind of jump in and do more faster. Yeah. Well, it's certainly very interesting. We'll want to take a really hard look at it. I mean, very, very cool announcement. Moving to containers in the source prior to the migration obviously solves a lot of challenges. So for that reason it's definitely a move forward. And I think we always talk about in this industry the acceleration for consumption. But really that's a poor way of saying probably what we should be saying is an acceleration of value. So we're constantly in this battle to try and deliver value to our customers faster. That's what our customers want, right? And in essence, we see Anthos as being potentially a big game changer there. So that our CIOs that we're talking with can show to their various stakeholders that they are making very good proactive moves into the cloud at lower barriers of entry, right?  I wonder if you can help share a little bit on that. When I think back two years ago, data was really at the core of what a lot of what Google was talking about. I was actually surprised not to hear a lot of it on the main stage this morning. But AI, ML, what are you doing? What are your customers doing? Does Google have leadership in the space? Google certainly has leadership in the space. Our customers, I think, relatively universally think that their ML stack is the strongest among the competitors. But I think in practice what we're finding is there's a lot more urgency as far as just literal data migrations off of their data centers into the cloud. And I foresee a lot more AI and ML work as more move in. Yeah, so you might at our booth here, not to give a plug, but we've got a booth down at the end with a full-fledged racing car. Just to talk about the art of the possible with AI and ML, our engineering teams and the race teams that we sponsor, they're there, the driver's there. We should go down and talk to them. We've taken all of the race telemetry data for the last six months and all of his races and practices. We've aggregated that data all into GCP, run AI and ML algorithms on it, to provide his racing team some very predictive ways that he can get better and that team can get better. And so I'd invite just anybody that wants to kind of go there and take a look at, you know, even if you're in banking and if you're, or if you're in retail or if you're in healthcare, take a look at some of how that was done, because it's a very, very powerful way to answer your question, head and shoulders down why Google is actually accelerating and exceeding an AI. And one of the things that Thomas Curry and showed on stage was the recent hackathon they had with the college students with the NCAA data of the game that just finished and throughout that experience. This is a core theme of GCP and now Anthos, which is getting data in and using it easily. Yeah, right away. And scaling, at a scale level that kind of seems unprecedented. So this team seems to be the application, the new differentiator. I think it is, you know, I think that announcement, obviously the big three takeaways for us, you know, certainly scale, unmatched, certainly speed and migration with Anthos. If I could highlight one other, I was incredibly pleased with, well, I've been pleased since Thomas has a rival in general by bringing an enterprise class strategy within side of Google that I think are going to respond well to our enterprise customers. And part of enterprise class is also making sure that their partner community has amazing enhancement programs that really incentivize those partners that are actually in the full managed services space from cradle to grave, lifetime customer value. So we're very excited about even further announcements this week that no doubt have been inspired by Thomas to try and really take advantage of their partner community that are in the business of cradle to grave support of customers. So you feel comfortable with Thomas? You're talking to a lot of customers, he knows the enterprise. We've had an opportunity to meet with him. We've had some shared customers that have had a great privilege of getting to know him and support us and collectively them. He knows the partner equation pretty well by the enterprise. Without a doubt. It's about partnering because there's a monetization that's shared, go to markets together, talk about the importance of that and what's it like to be a partner? Yeah, without a doubt. Again, his embrace of the open source community that you saw today really taking advantage of highlighting partner value is wonderful but I think Thomas above anything else knows that Google needs to scale. They need to scale and then they have to have breadth and they have to have depth. And to get to where Google needs to be over the course of the next two, three years, it's wonderful, it's refreshing, it's 100% accurate that Google knows and Thomas knows that the path to do that is via partners. Partners that share in Google's vision that are 100% aligned to the same things that Google is aligned with. And I think that's why I'm so thankful to be at SOTA large in part because all of the things that we care about in terms of our customer success as well as Google's success, we all share that. So it's a great trifecta. It's a ground floor opportunity, congratulations. Guys, talk about your business. What's going on? You got some new offices I heard you opened up. What's going on in the state of the business? Obviously the Google focus that you're excited about obviously, they're at the beginning, I think, I called Google the dark horse. I think they were the tech that they have and the renewed focus on the enterprise, building on what Diane Greene had put foundationally. Thomas is meeting with hundreds of customers. He's so busy, he doesn't have time to come on the queue but he'll come on soon but he's focused. This is now a great opportunity. Talk about your business. What's the state of the union there? Tell us, give an update. I can take that one, if you don't mind. Go ahead. You can add poetic color if you want. Yeah, so, as I said, we're entering a new journey for SADA in light of renewed focus, renewed conviction to Google. We are investing more than we ever have into the common belief that Google is the one to beat in terms of momentum drive and ultimately winning the hearts and minds of who we've talked about. Over the last four months, we've opened five new offices in New York, Austin, Chicago, Denver. Our headquarters is in Los Angeles and just recently, we just opened a brand new office in Toronto so we can really help our Canadian customers really see the same type of white love treatment. We provide those customers in the States and so that's why, well, I wasn't earlier but I'm walking around with Canadian flag. We're very excited about the presence that we're going to have in Canada. It's Toronto, I always blow it. I call Toronto being the American that I am. It's Toronto. I've been a couple of times. Well, I'm glad you said it right. Good. On the engineering side, also you guys are on the front lines. There's also a sales development. There's also customer relationship. Engineering side, I'm sure you guys are hiring. There's some hard problems to solve out there. Can you guys share some color commentary on the type of solutions you guys are doing? What's the heavy, what solutions are you solving, problems that you're solving for customers? What are the key things that you got going on? Well, a lot of cloud migrations, a lot of web and application development, custom development, and data pipelines. I'd say those are really the three key focus areas that we're working on at the moment. One other thing too, so we believe that we want 100% customer retention, always. And that goes above and beyond an implementation. So the other big area of investments that we're making is in a whole revamped technical account management team. So for those of our GCP customers that have had the privilege to, we've had the privilege of working with N4, we are building out a team of individuals that will, well beyond the project, stay with that customer, work with them weekly, monthly, quarterly, and try to always find ways to expand and move workloads into the cloud. We think that provides stickiness, we think that provides ultimate value to try and help our customers identify where else they can take full advantage of the cloud. And it's a fairly new program. And in large part, I just want to thank Thomas and the partner team for new programs that are coming out to help us so that we can actually reinvest in things that go throughout the life cycle of the customer. So very good stuff. Data, Chris, thanks for coming on. Appreciate it. We'll check out your booth, the car is there with the data. Bring that data exhaust to the table. Unintended, analyzing with Google Cloud, Anthos, good commentary. Thanks for sharing. I really appreciate that being on board. All right, great. Cube coverage here live on the floor in San Francisco. Google Next 2019, this is Google's cloud conference. Customers are here, a lot of developers, more action live on the day one of three days of coverage after this short break. Stay with us.


Hello and welcome to this presentation of the STM32L5 USB 2.0 Full Speed Interface. It covers the features of this interface, which is widely used to interface with a PC. This figure shows the connections between an STM32L5 microcontroller and a USB connector. The STM32L5 features a USB 2.0 Full Speed Communication Interface, allowing the microcontroller to communicate typically with a PC. The simplest implementation is a USB peripheral device. It provides a 16 endpoint capability, which can be configured, for example, as 8 bi-directional endpoints. It also supports the battery charging detection specification version 1.2. Application benefits include crystal-less operation, a low power implementation, and faster charging, thanks to the charger detection function. Let's look at some of the key features of this USB Full Speed Interface, which is a USB 2.0 compliant interface that operates at a 12 megabit per second bit rate. A USB FS device can be implemented. Crystal-less operation is supported. A total of 16 endpoints, 8 bi-directional, can be supported. Full support for isochronous endpoints. Bulk endpoints are able to use a double buffering mode offering higher performance. Inbuilt support for link power management adds enhanced power modes on top of the USB 2.0 specification. Battery charger detection allows for increased current to be drawn from BCI 1.2 compliant chargers, allowing up to 1.5 amp charging. The block diagram of the USB Full Speed Device Controller shows the various building blocks inside along with its analog transceiver, which manages the physical layer shown above. The physical layer, or FI, handles the analog signal levels including specific level detections as well as battery charger detection functions. The USB Interrupt goes to the Cortex processor to signal various USB events. The AHB Peripheral Bus, or APB, enables read-write access of the controller. Other key elements are the packet buffer memory and the suspend timer allowing low power operation. Several related peripherals work in conjunction with the USB Device Controller to link the USB activity to the system power mode and the requirements of the software. The clock recovery system allows operation without an external crystal using the integrated HSI oscillator as the main clock source. The interrupt events are sent to the non-vector interrupt controller via a single line. The system events can cause the system to wake up from stop mode. For example, at the moment we resume from USB suspend mode. The USB Device Controller generates interrupts in different circumstances which generally require handling by software. The first two listed interrupts cover various error and warning conditions. The remaining interrupts correspond to normal USB protocol events. The USB Peripheral is fully active in run mode. After a suspend event, it is still active in sleep, stop zero, and stop one modes. Standby mode should not be used. The USB Peripheral is not available in low power run, low power sleep, and shutdown modes. Some debug help is available using a single status bit which corresponds to an interrupt event. Within the USB Device Controller, the dedicated ERR status bit provides some debug functionality in a USB application in relation to various events. The events that can trigger this debug bit are listed in this table. There is also a way to directly read the states of the D plus and D minus lines. Here is an application example of a low power peripheral device. Power is drawn directly from the USB VBUS signal. No crystal is required. For complete USB specification documents, please refer to usb.org. The USB 2.0 document home page has a zip file containing the USB 2.0 and OTG 2.0 specifications and an engineering change notice or ECN for link power management or LPM. The USB Device Class Documents page has the battery charger specification. Additional information can be found in these application notes.


What global issue do you feel most strongly about? Well, many global issues I feel very strongly about, but if there's one that I could really, in at the moment, I'd say it's probably the rise of populism. I'm specifically in focusing my degree on energy. I feel like that is the future. And the rise of ISIS, for example. I would have to say I feel more strongly about poverty and probably lack of education, because that's merely the world. Of course education is at the root of all of this. One thing, though, I think that's important is to focus on community assets and for the face development. Not us going into the center, this is how you speak, but looking for assets and neutrality. I think the most pressing issue of our time is climate change. If we don't do something about that really fast, then we're all gonna die pretty much. So yeah, I'd say climate change.


Hey everyone, no prime news today because just to be completely frank There was not enough news for me to make a prime news episode. In fact, I couldn't even find one Story I cared about talking about so why waste my time with a show that I just don't really have anything to talk about When I could talk about this and this and I'm talking was actually a topic brought up by the last dragon in our comment section One of our last live streams. That's right I actually read comments even on live streams even after the fact and this is a very interesting debate And I really want to touch on it because I'm one of these people. So it says our full-time youtubers consider true gamers Weird question, right? Here is this context for it Like can they be a fan of a game that they had to rush to finish so that they can get a review of I Honest I think this actually goes beyond youtubers, but let's we'll dive in that moment. Does that affect their enjoyment of the game? Most normal game consumers play one to two games a month They get their money's worth not to mention Saving tons of money not having to buy every semi-popular title Etc. Keep up the good work, Nathaniel Well, I can only speak for myself of course in all of this I It's a little difficult in speaking for myself because I won't consider myself to be a typical game reviewer I mean, I'm still working on a review of Yoshi's crafted world. Clearly. I didn't rush that I literally bought it a few days after it came out and here we are three weeks into April and I still don't have that review done It will be done. It will be done this week I have promised to do that, but it's not done yet because I'm not rushing it I actually don't believe in rushing a review now We had to remember what does rushing a review really mean? Well as someone who used to get review copies of games from Nintendo at Zelda informer.com back in the day I could tell you this that often you are given the game with plenty of time to not need to rush it And in fact when I played the games back then like Twilight Princess HD the Wind Waker HD Ocarina of Time those are kind of the games that I got review copies of I got them with weeks of Advanced notice before the game came out meaning that I had up to generally two weeks to play the game And if I'm being honest when a new game comes out that I really want to play I'm probably playing the hell out of it for about a week to two weeks And I'm playing it a lot In fact, I don't really play games any different for review purposes than I really do for non review purposes In fact, honestly review purposes kind of give me a reason to finish a game that I might otherwise not Finish just because I don't think you should review a game if you haven't at least beaten the main plot lines and the main story Especially if it's a story based video game So honestly, it's an interesting proposition because I don't think that your question directly applies to me Since I'm not like your typical game reviewer But even in talking to other people who do do more frequent game reviewers even thinking back to my past when I used to do More frequent game reviews I don't think I ever questioned whether or not I was a real gamer because maybe I had to play this game at a quicker Pace than I normally would ie. Oh, I had to beat Breath of the Wild say in the first two weeks that I had the game rather than waiting a year or two years to beat it like might have what might have happened typically and I honestly don't know that that really makes you any less of a gamer if nothing else being a game reviewer almost makes you a more Efficient gamer what it means is you are actually more likely to play a heck of a lot more games Then you might normally otherwise do because you can afford to do them because the justification exists because it's your job So as an example as a full-time youtuber or someone who's trying to be a full-time youtuber when I look at doing game reviews Which I only do one per month. So again, I kind of follow that category by one to two games a month like any other person I got to say that even if I was doing more than one per month All it would mean is I would force myself to find time to play more games And I don't think you could ever be punished for playing more games I don't think you could be considered less of a gamer because you're playing more games In fact, you are more likely to possibly find new games and new genres You might not have known you enjoyed because you find yourself playing more and more games So I think the real question being proposed here isn't whether or not a game reviewer a full-time video game youtuber is A gamer. I don't really think that's even a question if the question is can they relate to the typical gamer? Which as you said buys one to two new games per month, which I think that might even be a gross exaggeration I think most typical gamers buy about five games per year if that avid gamers Are usually the ones that buy at least one game per month let alone two games per month So I do think there is a disconnect between people like that and people like me especially since I've been covering video games For over a decade It's been a long time since I remember being a kid and only getting games on my birthday and Christmas And when I had to spare money every other month from a job I had in high school right like it's been a long time since I lived that typical gamer life So it's hard for me to relate necessarily to people who do live that typical gamer life that just play games for entertainment They don't really care necessarily with the conversation around them all the time They're just having fun and they just pick up games They want to play when they can afford it and I am not used to being that kind of gamer So it's hard for me to relate Directly to that type of video gaming experience, but I don't think it makes me less of a gamer Just because I can't relate to how maybe a typical average consumer might be purchasing and enjoying video games I think personally if you're someone that is a game reviewer for a living You are probably a more avid gamer than even the most avid of gamers because you literally spend all of your days Playing video games besides the day you're scripting the review the day you're recording the review and the day you're editing the review Everything else is all about playing video games. Your job is to play video games And I think that's a wonderful thing and you're not going to do that job a job By the way that you don't really make a lot of money doing in the first place just because You're not a gamer You just want to easy living or whatever being a game review is hard Especially if you want to be a day-in-date game reviewer where you get a review code You know review and Bargher comes up on a certain day and you want to get the review out at the exact time that review And Bargher goes up. Yeah, you're under a lot of pressure You sometimes only get a week with a game and you might have already been working on two other reviews When you get that review code, you're like, oh crap I got to stop these reviews because Mortal Kombat's coming tomorrow and I need to complete Mortal Kombat this past week In order to get a review out like I'm sure many other of my fellow contemporaries are currently dealing with right now So I don't really think that there is anything that makes you less of a gamer But it definitely changes how you game and it can change your approach to games It also means you are much more likely to play a bunch of games that you might not have otherwise purchased Because you know you're not going to enjoy them as an example If I was sent a review code for Mortal Kombat 11 on Nintendo switch I would have reviewed the game because look, I don't get review codes that often for these major games So I would feel an obligation both to the company who sent me the code and to you guys since I have that early access To review the game, but I have said on many occasions I don't plan to buy Mortal Kombat 11 and why is that because I don't enjoy fighting games I vaguely enjoy Smash Super Smash Bros. Ultimate and it's mostly because it has some of my favorite characters of all time in the game without those characters I probably would not play it as an example I didn't buy the Persona 5 DLC for you know Joker for Smash Bros Because it's not a character I care about from a franchise I care about So why would I waste my money on that especially as a casual fan of Smash and Mortal Kombat 11 is an awesome gruesome gory fighting game, but I just don't enjoy Fighting games. So why would I spend my money on a game? I don't enjoy when I could save it for a game that I do enjoy Yoshi's Crafted World I could tell you right now is one such game. So then this leads you to the other conundrum What can you trust from reviewer like if I review Mortal Kombat 11? But I'm only doing it because I was sent a code then am I really a gamer? Well Yes, I'm just not necessarily a fan of what I'm reviewing and that might actually affect the quality of the work And I do think this is why many youtubers you might see a wide variance in the quality of their reviews Because you'll see one review They're super passionate about because they were going to buy that game anyways Give you an example Arlo's three and a half hour review of Breath of the Wild was obviously a work of passion But then you might see other reviews by him that he doesn't seem so passionate about and some of them might be just because he Doesn't like the game and he feels like he still needs to talk about it because he got that review code or Other parts of it is just an up your obligation This is kind of the same thing that game journalism runs into when they are reviewing games Oftentimes, you know at IGN It actually is noted that there are some people that are given a game to review from a franchise They don't like imagine if I was tasked at IGN of reviewing Super Smash Bros. Ultimate when I don't really enjoy Super Smash Bros That much would I be a good person for that review of I a good fit And I think as youtubers that is something that maybe we should be more conscious of when we're doing reviews because oftentimes I think we do reviews of what we think is going to be popular. I Know Mortal Kombat 11 as an example would be a popular review for me to do It would be more pertinent for me to try to rush out a Mortal Kombat 11 review this week Then to release a review of a game that came out weeks ago in Yoshi's Craft of World The difference is I'm not interested in that and I don't want to force myself to do content I'm not interested in but if I care about my channel the most that should be what I'm talking about this week that and Dragons Dogma and gosh when would I find time to review both of those games this week? I have no idea So this leaves me in my current state of mind where I don't think that any of this has anything to do With whether or not you're a true gamer or whether or not you can relate necessarily per se to traditional gamers But what it does mean is that a lot of us end up making reviews that we just normally wouldn't be making because it's not necessarily What we want to do but we feel an obligation to you guys to do it Especially an obligation to certain publishers that might be handing us a free copy of a game It feels like you gotta do something with that right and if I have that early access I shouldn't take that early access for granted. So again, it's it's something I'm always struggling with internally especially now that I'm trying to do at least one review per month aka about 12 reviews per year maybe more than that in some months and It's something that I'm not necessarily sure that I have a good answer for and how to deal with and handle with it in spite of my experience But I will say that I don't feel like I'm any less of a gamer just because I had to rush through a game When I am doing games that aren't for reviews that I'm not doing coverage of I'll still rush through them because I Have a limited time set to play games. So when I do get a time to play a game I slam that game really hard. I'm gonna give you a nice example I haven't fired up Red Dead Redemption 2 in a few weeks and the last time I did I did a three hour play session and I Slammed through that content as quickly as I could because I know I'm never gonna have the time to sit down and play That game for hundreds of hours and I'm not reviewing that game I'm not making a video about that game that game has nothing to do with my job But I did it anyways because that is a way for me to enjoy as much of that game as I possibly can and It might mean I'm enjoying it in a different way than another gamer might but even if this wasn't my job I still would have did that because that game has nothing to do with my work So I don't think that we're less of a gamer I think we are more well versed as gamers because we have excuses or obligations to buy more games I mean I have like what almost 50 games on my Nintendo switch Strictly because I'm a Nintendo youtuber if I wasn't I'd probably only have a dozen But I feel like if I'm going to talk about certain games or cover games that really interest me I should pick them up so I can be more well versed in talking about them in the future Imagine if I was trying to make a video right now on Nintendo level VR that comes to Super Mario Odyssey and Breath of the Wild this week, but I didn't actually own Nintendo level VR. So I wasn't giving you any hands-on impressions I'm just telling you what I'm hearing. I don't think that makes me a good person to talk about this stuff So for me a lot of times when I buy games that I might not normally like I'm not sure if I would have bought Labo VR if I wasn't a youtuber It's because I feel like it helps make me more knowledgeable about the things I'm talking about and I value that More than I value rushing reviews out the door I think I've made it pretty clear at this point that I don't rush reviews out the door At least I haven't yet, but I've also haven't been given the luxury of having a review copy of the game I had a time to have time to review So I don't know what I would do if it gets to a point that I'm getting a ton of review codes of some of these major games I do get a bunch of them for indie games Obvious as you could tell you don't see a bunch of indie reviews going up So I'm not really taking advantage of those. So yeah, I I personally think it doesn't make you any less of a gamer Because you rush reviews out or you have to play a lot more games or buy a lot more games I think sometimes what can happen. However is There are certain youtubers and I won't name any names because I honestly don't know I'm not them where they can be a little bit burned out of video games because they're Overdosing themselves with them due to being a youtuber for me It's not a huge deal because I don't feel that obligation to review every game that comes out But for someone who does like Dreamcast guy or something I could understand if someday He makes a video say look I got to take a month off or whatever because guess what? I've been reviewing back to back to back to back to back games, and I'm just getting burned out on it This isn't what I would normally do as a gamer. I'm not saying that's gonna happen to him I'm just bringing up an example of you know overworking yourself when maybe you wouldn't otherwise be doing that as a gamer So I don't know I don't really feel that right now But I also know that I have to limit how much I can game so I can make these videos And so I can spend time with my family so at the end of the day I guess I don't fit into that typical mold so maybe I'm not the best person to discuss this But what I am interested in is all of your guys's thoughts and opinions on this because ultimately all of this rushing rushing reviews or Buying all these games so I can be more knowledgeable what I'm talking about or all the stuff that we do as youtubers that maybe We wouldn't be doing if we weren't youtubers I'm actually curious what you guys think about it Do you guys think we are less of gamers because hey I haven't beat Octopath Traveler or Starling battle for Atlas yet Does that bother you does it bother you that I only have 15 to 20 hours in Super Smash Bros. Ultimate compared to you or are you bothered even more that because of how many times I've livestreamed it I have over a hundred hours in fortnight on switch or is it like a shame that I only have a 170 hours in Breath of the Wild while you might have three four five hundred a thousand hours Like do you guys feel like I'm less of a gamer because maybe I'm not completing games Like I might if I didn't own so many of them I am very curious what you guys think about it when you guys think about the reviews I've done so far especially as I head into wrapping up my current review of Yoshi's Crab to World Which I don't expect to get much views, but I didn't do it for the views. It's paid for by patreon Thank you so much for all of our backers at patreon.com slash Nintendo Prime Be sure to go check that out to support other content We do that I don't really want to just sit there relying having thousands of views to Be able to afford to do it before the time, but thank you guys so much for tuning in I'm sure to enter our Nintendo switch Super Smash Bros. Ultimate Bundle giveaway through the gleam that I'll look down in the description And I will catch all of you guys in the next video


All right, it's noticeably quieter today. Is this everyone that did lab one already? Did we do lab one, hands up? OK, so I assume everyone else is panicking doing lab one. All right, well, anyways, so I synchronized with Ashton about quiz one. We are on track. We're ahead of the other section in most regards. And we're behind in a few. But for the quiz, it'll be everything we can both answer. So I'll look at the quiz. If there's anything we haven't covered yet, I'll throw it out. So yeah, it's mostly multiple choice and true, false. It's like 80% multiple choice, true, false. There's some written things. They'll probably explainations. Like why is this? What's this trade off? Blah, blah, blah. I believe you can just type it. Yeah. Is it like a Quarkis quiz? Yeah, it's a Quarkis quiz. All right, so today, this stuff will not be on the quiz because it's just tying together everything we've learned. There's some stuff that will be on the quiz towards the very end, like very conceptual things. But for the most point, we can relax for like the first half of this lecture. Yeah. Sorry? Unfortunately not. Because it's not a direct conflict, so there's an hour gap, so he's hesitant to change it. So the quiz two got changed. But quiz one, unfortunately, remains the same. All right, so let's get into some fun stuff today that might even help with lab one a bit or at least help with kind of unixy stuff. So today, we're going to talk about IPC, which is just transferring bytes between two processes. And you've been doing that already if you don't know it. Even printing hello world to the terminal is IPC because you're transferring the bytes hello world into something that can actually show them. So even reading and writing files is a form of IPC. Some process will come, be created, write to a file, and then another process that comes along much later comes, reads that file, and that's a form of IPC. The processes don't even have to be alive at the same time. And remember, from the beginning of the lecture, the read and write system calls, they just take a file descriptor and read or write bytes, and they don't really care about that. So we could make, yeah, inter-process communication. And that's just communicating between two processes. Because otherwise, remember what we saw? By default, processes are completely isolated from each other, even their memory, their address spaces are completely different, so they can't affect one another. But in some cases, you want processes to communicate with each other. And you have to do that through IPC or inter-process communication supported by the operating system. So you're actually talking to the process you want to be talking to. So we'll dive right into a code example that all it does is read from standard in. And if we remember the standard file descriptors, that's just file descriptor 0. And then it writes the standard out or file descriptor 1. And we'll see what it does and see if it kind of reminds us of something we may have used before. So here is the entire program. It declares a buffer of size 4096, which is an important number, which we'll see when it comes to memory management. But for now, it just declares a fairly big buffer, and that's all on the stack. And then it declares some variable that keeps track of the number of bytes read. And then it just calls read with passing in the address of the buffer and then the size of the buffer. So it will read at most 4,096 bytes. And then it just has it in a while loop. So it loops over and over this as long as there are some bytes left. OK. So someone complained about that before or said it was better just that. This is overwhelmingly voted for. OK. Well, sorry to whoever suggested the other thing. So this read, so it just returns the number of bytes read from it. So it's just going to infinitely go over this loop while it's still reading some bytes. After it gets some bytes read, we just write out the number of bytes that was read in. So we're just reading it in from file descriptor 0, spitting it back out on file descriptor 1. And then it just checks if bytes written, it's a standard C wrapper for that system call. So we have to check if it returns negative 1. If it does, we do the error handling stuff. And then here I was lazy. The kernel cannot write out all the bytes you give to it, and in which case you should handle it and do another write call. But I was just lazy, and I just checked that it did what I expected it to do. And if it doesn't, instead of silently failing, which is like things Java likes to do, which is really annoying to debug, I just explicitly put an assert there, and I will see something. So another neat thing about this is there's no explicit end of file character because standard end could be a file. So there's no end of file character. The only way you know if you've reached the end of input is if read returns 0 bytes read. And that means you've reached the end of the file or the file descriptor or whatever it represents. So if we go ahead and execute this program, it's going to read in things from standard in and then print them back on standard out. So I didn't do anything special. So if I just type, it should be on standard in, and then I can hit Enter. And then it just spits it back out at me. So has anyone seen this program before or used a program that behaves like this? Echo, close, anything? Scan F to C function. Although I guess we might not have, has anyone used this command cat? Oh yeah. Yeah, so if I do cat and I does the same thing, right? So we actually just wrote cat. So cat's a very, very simple program. It barely does anything. All it does is read from standard in, write to standard out, and in the unixie way, you can do a lot with that. So read write, yeah. Bites written less than bytes read, yes. It might, in this case it doesn't because I have this assert and the assert never hits. So I check if that is true. I just didn't want to write more code if I didn't have to. And this, I haven't seen this assert got been hit yet. So typically there's a limit, but it's less than that 4,000 limit, which is why I picked it, yeah. Yeah, the default C handler for an assert essentially just prints an error message related to that and then calls exit with like one, right? So that's what assert does. All right, cool. So if we go back, if we just read the documentation, right? Read again, just reads from a file descriptor by default. We just use the default ones. We use zero and one, like that's just a unix convention that those file descriptors exist. Zero, one and two are always open and they're just defined as the standard ones. So there's no end of file character. That is actually not a thing. Read just returns zero bytes read and that's how you know you're at the end of the file or the end of your network connection or at the end of whatever that file descriptor happens to represent. And again, if you do this, you need to check for errors, right? Save error number because if you use that P error to print it out, that also might contain an error because that would just do a right system call essentially we know now and it could fail for whatever reason. So you should, if you want to show the first error you just have to save it. And write does the same thing in reverse. It just returns the number of bytes written. You shouldn't always assume it's successful if you're doing big writes but we've all used printf before printf calls write. It actually returns the number of bytes it has written for you but I would bet no one's ever checked. The return value of printf. So you should but if it's small enough you don't really have to. But in this too, both ends of the read and write have a corresponding write and read. So something is writing those bytes that are read from our process as standard in and then something is reading the bytes we are writing out namely our terminal or our shell in this case. And we'll see how to actually make this communication channel later but for now it can remain a mystery. So the standard file descriptors are quite powerful, right? We could, if you wanted to you could close the standard input which closes file descriptor zero and open a file instead and you had to do an open system call for the lab one I assume, right? So if you're opening file descriptors open just returns a file descriptor and the way it works is it returns the lowest unused file descriptor. So if I close file descriptor zero and I open a file it will get file descriptor zero because it's not currently in use so it'll use the lowest number. So let's see that example. So the core code is going to be exactly the same where we have this, right? I'm not going to change even the file descriptor number the core code is going to stay exactly the same. So I'm just going to read in an infinite loop and then write at the end. And then at the beginning here I will open my file so I just take the second argument yeah index, yeah the second argument which is index one I open the file as read only and I get a file descriptor out of it. And now at this point if I printed it off here it would be file descriptor zero but I know it's file descriptor zero because I closed it right before. Yeah, it's returning the file descriptor number but the kernel as part of that open with a file name it's going to check that you have permissions that correspond to this. So this is I want to open a file for reading. So if you can't open that file for reading it'll give you an error. So no, so file descriptors are unique to a process. Yeah, so by default the only thing you know is the convention is you'll have three file descriptors open when your process starts and that's it. You don't know what they're connected to you just know that there are three valid numbers you can use and you're supposed to use them standard in, out, and error. So without changing the core code I can go ahead and be kind of meta and I can essentially if I do that I get the file back out as input. So now I change file descriptor zero to be the file and now if I write or if I run execute that same code the read is now going to read from the file instead of my terminal and it's going to read until it gets the whole file and then just dump it out on standard out, right? And this is exactly what would happen if I just catted the file, right, same idea. If I catted the file I just get the file back out. So having open files is kind of a long solution you don't have to do that if you're using a shell because there's standard file descriptors and your shell will let you change what the file descriptors are. So instead of running open example and then specifying the file and then within there I have the open that will open the file I could instead just use my shell and do this. So this is just the executable you run and then this symbol means that whatever is on the right I should feed that into standard in. So this is just replacing standard in with the file so I didn't actually need to write that open system call if I didn't want to, all right. I could have just used our first read write example and just let the shell redirect the file as standard input and then I kind of would have saved myself having to do a file handling code in my program. Other fun things you can do you can also redirect across multiple processes so I could cat that file and then do this pipe character to feed it into another one. So this basically just connects these two programs together. So anything that the command on the left outputs will get fed to the command on the right. So if I do that I could cat open example and then I could essentially that character is called a pipe which we'll see later but that just connects the standard output and standard input to the standard input of the next process, right. And I could chain those indefinitely so echo will just say whatever I put in. So if cat just like reads what it just writes whatever it reads and I do that it just should be the exact same message, right. It essentially just does nothing and I could pipe that as many times as I want I'm gonna get the same answer. I'm just creating a bunch of processes because each of these commands the shell's gonna create a process for them, right. Okay, so we'll get, yeah. So the line thing connects two processes together and the arrow to the, yeah. So there's gonna be two arrows. There is read right. So there's like the arrow to the left which is standard input. So if I put open example.c it's going to open that file and replace that process's standard input with that file, right. And then there's also, I could go the other way around. I should do a better command. Open example. So this will just read that file and spit it to standard output but I could use this arrow and this arrow will redirect standard output to whatever file name you want, right. Which I used before in another class without really explaining it. So if I do that instead of going to the terminal it's going to create a file called output.txt which should have the contents of open example.c which it does. Okay, hopefully that is okay, oops. Yeah, so you don't have to worry about the pipe things just yet. We'll see how to actually do pipes. We'll see it come up again. Yeah, yeah. And you can just chain and main them together as you want. Exactly, yeah. And one of the labs you might do is you will implement that. We'll not implement that but create pipes between different processes and launch processes and it's lots of fun. All right, so now we have to talk about signals. You'll be using signals I believe in lab three. Signals are kind of awful but this gets into our whole fun terminology where we actually get to learn the word kill today. So if I go ahead and open that open example or the read-write example that just takes input from like by default standard in and if that's my terminal, instead of pressing control D which kind of closes that connection like sends kind of end of file I could press control C, right? Who's here has ever hit control C? Okay, who knows what control C actually is? Okay, one person, two people. All right, so we'll figure out what control C actually is but for now all we know is that like kind of just interrupts our program and then hopefully stops it. We'll, sorry? Yeah, well, so we'll see. I will show you something that cannot be stopped. Yeah, that sounds more fun than it actually is. So in here, right, if I do read-write example so if I press control D that just sends end of file so read would return zero, it exits normally but if I hit control C, it does this. So it actually dies but it didn't die from any code we wrote, right? We just had an exit zero and we now know that that's the only way to end a process and this is the exit status number that got set. So some mystery happened in some code we did not write that exited with this weird number 130. So we will figure out what that actually means today. So the kernel, it's another form of IPC. It can send a signal to processes and when you press control C that actually sends a signal and we'll see how you actually handle that and what the default is but by default the kernel or C, yeah the kernel will have default signal handlers for you if you don't write them yourself and by default the control C signal handler will just kill your program. So if you don't do anything by default it will work in your case where control C didn't stop it they probably overwrote it and just ignored you they didn't, unfortunately they didn't listen to you. So if you press control C you're going to send a signal to a process and they're just like everything else in computers they're just names given to numbers it's just a number associated with something that's supposed to represent something. So one signal is called sig init which is just supposed, we're terrible at naming stuff it's just supposed to be short for interrupt so it's just interrupt from keyboard came in. So the default handler codes will just call exit for you and will set the exit status to 128 plus the signal number so we can even work backwards from this and figure out that sig init is number two because we got 130 back. So let's see the fun of writing signal handlers. So you can write your own signal handlers that is a perfectly fine thing to do and you do that with a kind of system call called sig action so we will see that in an example but basically you just declare a function that doesn't return a value and has an in argument so you can figure out what signal was sent to it and that integers is the signal number you can, some of the numbers are non-standard but on here are a few from Linux so two is that interrupt, nine which is sig kill which is like super serious you're gonna die that can't be ignored by your program so the kernel just kills your process immediately that's number nine then everyone's favorite one is this one so the kernel will actually just send your process a signal you didn't write any default signal handlers and your program just died and it returned whatever it would return error code 139 in that case but the fun thing about this is since it sends a signal and you can handle it if you wanted to you could just ignore your sag fault and keep trucking on but yeah so it depends what you do in your handler ideally you would be like oh I know why I sag faulted I will allocate memory for that but if you just ignore, if you wrote a signal handler for your sag faults and you didn't do anything it would just try and run that and then go restart that code again and then just kind of fall into an infinite loop and you'll probably be in a worse situation than you were with the sag fault ironically and then last one is sig terminate that's the nice way of saying hey program you should exit you can do some cleanup so let's go ahead and see an example of that yep, so sig term yes that's the way you're supposed to handle exiting that's like please exit now clean yourself up sig kill you can't do anything about sig kill is kernel someone from the kernel wants to kill you and you're dead yeah so that's a good point and that's one of the main things we are going to see at the end that's like valid for the quiz that's like interrupts come back so these are like interrupts except they are use or interrupts for users so this is like user land interrupts so they behave in pretty much exactly the same way except they do nothing but cause problems so in this so in this program I just make sure that there are some arguments yeah so this is essentially our open file example but I'm just going to install a signal handler in it so I registered the signal sig init and then sig term cause that is ones that I can handle and inside of the signal handler so this is just code that it's boilerplate you're just going to essentially have this provided to you or only write this once or look it up on stack overflow or something like that and never have to look at it again but basically all it does is it registers this handle signal function to run whenever whatever signal you give as an argument comes in so I installed this signal handler to run if there is a sig init which is supposed to be control C or a sig term which is supposed to be like a nice way of saying hey shut down and then here is my handle signal code isn't it wonderful so all I do is print off what signal I got and otherwise I just ignore it so let's go ahead and run that now so if I run this something weird is going to happen so I press control C it says ignoring signal two which is what I expect but I also get an error from my read system call which is kind of weird so this is why you should check the errors for all your system calls because some of them will just return immediately if they get interrupted by a signal and if you want to, you know if this was reading from standard out and you want to continue again you just have to recall read over and over again so I was nice in my head and fix that so the fix for that is that I call read and then I check if bytes read is negative one in which case there is an error and then I check it's error number and if it's error number is this error that says the system call has been interrupted I just restart the loop again and ignore it so I restart the system call so I just do another read system call because I know it's like a benign error so this is why you should be very proactive in catching your errors so you can actually figure out that the kernel does stuff like this so if I run signal example two now which is our fixed one and then I press control C it just says ignoring signal two which is probably like what your program did so no matter how many times I hit control C I really want out of this program oh okay well if you hit it too many times the kernel kind of forces the issue but if I hit it once it just sits here and it's ignored so yeah your shell can be kind of mean but otherwise this just ignores it doesn't matter even if I go into it and see where the PID of what's it called signal so I can go ahead use this command to look up its process ID and the way you send signals to processes on Linux or any other Unix system is violently you just say kill so if I want to try and end this program nicely whoops that is not the control let's type it so you just say kill process ID and that will send a signal to it to nicely ask it to end but in this case it says ignoring single 15 so it refused to do what I asked it to so the heavy handed approach is to do kill dash nine which sends that say kill so it's like kill say kill double kill like ultra kill so if I ultra kill it you'll see if I switch back it says it was killed give some weird error message from the shell and then gives this error code and it didn't have a choice to ignore it even if I went ahead and registered a signal here called SIG kill and tried to ignore it I would very much doubt that it will let me do that yeah so it says SIG action invalid argument you're not even allowed to try and install a signal handler for SIG kill because you don't get to control what happens in that case yep it's just a number it's two include signal.h so that'll just define all the numbers for you so all the signals are it's just a number and then just like everything computers right we just give meaning to a number so signals are just a number we give meaning to them so it's just right here it's the signal number so this is like your interrupt service routine so you as part of this register signal I register this function to essentially be my interrupt service routine so whenever a signal comes in this gets called and you don't know when a signal is coming in as the process so this is your interrupt handler code that you can install so this is exactly like an interrupt for a normal process I think that might be a nice idea or maybe the kernel gets uppity about it I'm not I need to double check that because last it might be the kernel because last time I bashed control C it didn't die so yeah yeah so this just does a lookup of any processes that exist and then look at their name to see if they match this and then show you the process ID see if the name matches so this is why by convention the first argument name is the name of the program because it checks the name of the program so like I could do pit of Z shell and there's three Z shells running right now so return the process ID of any name that matches that that's currently running yes but if you want to kill yourself you could just call exit yeah that just gets into how Z shell works so one's the one I'm typing in one's this one so I have two shells open right now and then one is I think my login shell so there's just three shells running there no they're they're all independent they're not like they don't depend on each other there's just three independent Z shells running okay so so the very kind of pain thing is that the signal will pause your process wherever it's running and then run that signal handler so again exactly like an interrupt and you can't control when an interrupt happens to your process you just have to deal with it so and your process can be interrupted that any single point of its execution and then as soon as your signal handler code returns it just picks up right back where it left off so this is an example of forced concurrency right where it's not exactly concurrency because this the signal handler code or your interrupt service routine has to run until it's ended it can't actually switch back and forth but the concurrency is when it switches to that program and you don't know when that is so you have to actually be like super careful about what you write there and we'll see an example of that and here is just the interrupt system call example where I didn't restart the read call and I got an error from my read and this is yeah this is how you send signals to processes through the kill command because calling it send signal would have been too clear we want to be violent and it just takes the process ID number we saw how to get the PID of any process we want and we could kill them so by default if you just kill a process ID it sends sig term which is supposed to be the nice please shut down but kill-9 is the violent please stop so this is back to the wait so most operations are non-blocking when we saw wait before it was a blocking system call right it waited for one of the children to die but if we want most of the calls you encounter and most of the ones you want to make are non-blocking system calls and they return immediately and you just check if something has happened or not so if we want to turn wait into a non-blocking call we can use wait PID which pretty much has the same semantics as wait by itself except it takes a process ID as an argument if you want to wait for some specific process to die but if you want to wait for any process to die so it behaves like wait you just put in a negative one there and we'll see that that'll be in the code just so there's no surprises when I show that and then you just give it this w no hang in the options and then suddenly it is a non-blocking system call so it will not wait until the process will die and that's how we get a process ID of zero back out of it so zero means you have a child but it's not dead yet so you should probably check again so here let's see the example signal pull example where the hell are you oh wait pull example sorry all right so in the wait pull example all I'm going to do is immediately fork because that's fun and then in the child I just sleep for two seconds and then it's going to exit for zero now we're going to have the same code as we had before where we wait except in this case we're going to have a fun while loop so we're going to while PID equals to zero which means we still have a child and it is not dead yet we'll just count how many times we call wait so every time through this loop we will increment calling wait and then say how many attempts we have and in here we're going to call wait process wait PID in this case since we know the ID of our one child and we know we only have one child because there was only one fork call we can just give it the process ID directly and say I know the ID of my child just wait for that one to die the w status as we saw before and then here's this no hang so at the end of it when we come outside of that infant while loop while it's zero wait PID will be not zero so either it'll be an error or hopefully it exited normally so if we go ahead and do that we so does this thing does this look like a smart thing to do yeah so if I did that um that waste a lot of time right so each time I call wait and it's the process isn't dead I'm essentially just wasting CPU time doing nothing very productive and this is one of the techniques you have to do if you are an operating system and essentially your your hardware will change some memory address somewhere and the only way you can see if there's a change is you have to check yourself so this is a technique called pulling which is valid for the quiz by the way and this is one technique you'd have to do to identify hardware changes so you can see the obvious drawback is it wastes a lot of time so anyone want to give me idea is how to make this you know not waste so much of my CPU time yeah unfortunately not so yeah like turn it into an interrupt yeah so that's a good idea so that we'll see later so the suggestion was to turn weight into an interrupt so we don't have to just keep on pulling it but if we had to keep on pulling it what's probably a better strategy than just trying as hard as we can if we don't want to waste a ton of time yeah yeah well in this case I could go ahead and just in this case I'll just put myself to sleep for I don't feel like typing at the whole microsecond call but the option you could have is hey just put yourself to sleep every time so I'm not trying so this is attempt one, attempt two, attempt three so I'm not wasting that much CPU time but what's the drawback of this yeah it's not instantaneous I'm almost waiting a second so if you have to pull something there's going to be some trade-off with how often you pull and how much time you waste and you know the least or the less often I pull the more responsive it's going to be if I wait forever it's not going to be responsive but it's not going to waste that much time so there's always going to be a trade-off yeah so if I do this and give it no options if I get rid of that you know that W hang it's a blocking system called like what we saw in the last lecture where it just waits until a child to die so blocking means it won't return until whatever you're waiting for has occurred so it just sits there and waits until a child has died yeah so blocking means the kernel is just preventing your process to run because you're waiting for something and you can block on weight you could block on read if it was like a slow file and so on yep uh it's on the github the the link is was in the first lecture I guess I should I'll post it on quarkis too on like the main page thing okay well the other suggestion was a good one where signals might actually save us for this because if I had right maybe I don't want to pull maybe I don't want to block on a system call maybe I just want to be interrupted so we could do that there's actually something called weight interrupt example so what happens when a child dies remember last lecture I said the kernel would kind of nudge you that a child has died while the nudging is a signal so there's a special signal called sig child don't ask me why they're missing the eye programmers are very lazy yeah no noticed it but if you try to type it you know you get compiler error so I just install a signal handler to also handle sig child and then in the signal handler I check the signal number if it's not sig child so I want to keep ignoring any interrupt I want to just run forever but if it is a sig child it means that one of my children has died and thanks for the heads up and I can call weight so I can do this no hang option because I don't need to block in this case you know it's died anyway so weight should return immediately and here's the example to turn weight PID into the exact same as weight so if I don't care about waiting on a specific child I can just give it a negative one argument that says wait for any process to die but again I only have one process in this case so I can wait for it in my interrupt essentially my interrupt handler and I should get you know weight return for that process and then I'm just gonna and then I'm just gonna also exit the current process because as far as it's concerned it's done I only wanted to wait on that process so in this case yeah so in the main loop just to see that main's not actually doing anything like the main process isn't doing anything it calls fork and then if it is the parent it just says time to go to sleep and sleeps itself for nine hundred nine thousand nine hundred ninety nine seconds so if a child didn't die in that time it would actually exit after a very long time but this shows that the process actually dies whenever the child dies so it says time to go to sleep and then two seconds later we see the calling weight and the weight return so that is immediate and that is you know that's a way to be very very responsive and pretty much if you have an option that's generally the way to go yeah yes like how it got here so the main process would be a sleep and it's an interruptable sleep and then when a signal comes in it just forces the signal handler code to run doesn't matter what your program's doing at the time doesn't matter if it was running doesn't matter if it was sleeping it's going to just be forced to run the signal handler code it will finish any atomic operation it's doing so if it's like in the middle of adding two numbers it'll finish that but otherwise it'll just get booted back up to the signal handler execute that and then it will resume from exactly where it left off all right so a bit more housekeeping for the quiz so that was our interrupt example and here I'll go back to this in a sec just to make sure that I say this so on a CPU which is what the kernel has to do there's only one kind of interrupt in user space it's just signals but on a CPU you can like classify interrupts into three different categories so an interrupt like a true interrupt is triggered by external hardware and it needs to be handled explicitly by the kernel because it needs to respond quickly so it's some external hardware source that the kernel has to deal with and you were kind of familiar with interrupts before the other category one other category is called a trap and a trap is what is triggered by users so as a user you are allowed to essentially interrupt the kernel but it's given a special name because they happen in user mode so they're handled by the user or they're handled by the kernel but user processes initiate them right the calling process gets suspended the kernel executes handles the code and doesn't doesn't need to be super super responsive because it's just your code and it doesn't really care that much about it the third category is called an exception which is usually triggered by abnormal control flow divide by zero illegal memory accesses so seg faults and fun stuff like that the default handler is in the kernel and again the calling process is going to be suspended while the kernel executes whatever code it needs to and this is where signals come in so the kernel will optionally if you install a signal handler for seg faults the kernel will allow you to handle them yourself so you're also allowed to handle divide by zero yourself even though no one's probably ever done that yeah so let's see an example of why it is tricky because again when signal handlers run they have to run to completion so let's see this close example where in our interrupt handler we open a file and then in our interrupt handler we decide to close it and be nice and say we're cleaning up our program or something in this but it's going to fail kind of badly so which one is this so in our close example all we do in our main is we say im process id and it opens a file and it really doesn't do anything else after that we'll just say what file descriptor we opened and then in the file handler code we try to close the file so we check if the file descriptor is even valid then we call close on it we error check to see our return value print and error close failed and then say we close the file and then we sleep for 10 seconds and then try and exit the program so if we do this wait interrupt example or no this is called signal close so if we do this it says hey i'm process id you know 9000 something I could send a kill to it was that its process id yeah so if I send a kill to it it's going to get a seg term and then try and close that file and do all that good fun stuff and then sleep for 10 seconds after it closes the file and then tries to exit the process so if I do that and switch over oh I didn't open a file my bad okay so now I open the file and it says it's file descriptor 3 which makes sense because it's the first one after the standard ones so if I go ahead try and kill it I'll see that says hey I'm closing the file and exiting but I could also press control C so I sent another signal to it while it was handling the first signal and these are things you're going to have to consider and this is what makes operating systems so difficult so here I opened it I essentially the main process went to sleep I tried to kill it from another you know I tried to kill it by sending a signal to it it made it to I'm closing the file and exiting the file descriptor was valid right it was file descriptor 3 got here to the close closed successfully and it said it closed the file then it slept for 10 seconds before calling exit and then I hit control C while this one was sleeping so then this interrupt handler got interrupted again so it starts executing again so it would again print off closing file and exiting the file descriptor is valid because it's still 3 now it would call close on 3 again which is an error because I've already closed it and that's why it says close bad file descriptor already closed right so that wraps it up for the day remember pulling for you we're all in this together


After months of pushing lies and peddling misinformation about the severity of COVID-19 and even doubting the efficacy of the COVID vaccines themselves, Fox News for whatever reason finally decided to do something good as it relates to COVID-19. They actually decided to encourage their viewers to take the COVID vaccine. Joking, but this actually happened. To assist them with this they brought on country music star Brad Paisley to tell Fox's conspiracy theorist, boomer audience, take the vaccine.  Here's just a quick snippet of the segment. Yeah, listen, we wanted to have you on because you've launched this effort to kind of get people to get the vaccine. What prompted you to do this? Well, you know, we've got some great plans for this summer and Nashville, we're actually playing the 4th of July, which is going to be a really amazing sort of Welcome Back Nashville show on the 4th. And I've got some good friends at Vanderbilt Hospital and a lot of a lot of people have been talking to me about this situation. I just think it's our way back. Our industry, Nashville has been hit so hard. I mean, all of the things that we've gone through from the touring industry being completely crippled to just the amazing ways that fans have been deprived of live music. I'm just really hopeful that this is the light at the end of the tunnel. Yeah, I'm going to play this public service announcement and let people see it. Empty seats can't chew. They don't tailgate and they don't know fight songs. Empty seats don't sing during seventh inning stretches. And they don't know stats or superstitions. There's a soundtrack for places like this and it isn't made in a studio. It's made by you. So when it's your turn to get the vaccine, be a fan. Take the shot. It's well done. And I tell you, Brad, I do hear from people that they're either afraid of it. Number one, they're not sure that they want to do it and or that they have to do it. And when you run into those folks, what do you tell them? Well, I mean, look, obviously this is the kind of thing that I think folks think was quickly thrown together and maybe not researched. But this is a 10 year effort on the part of these manufacturers that was luckily ready for this. We have, you know, I I I've done a lot of research myself. And it's a really scary thing to think about two things. One is that something was thrown out there, which this wasn't. And the other thing is that this pandemic goes on indefinitely and completely changes our lives.   And knowing that these these doctors have something that can change this is something that I'm really passionate about. I almost never say this, but I'm going to say it. Fox News. Good job. That was actually an excellent, responsible, fact based segment about COVID-19. Is that the first time they've ever run a responsible science based segment on COVID-19? Like I'm wondering, because all throughout the pandemic, I've been having to counter the misinformation that they've been spreading. But yet, according to YouTube, they're the authoritative news source. But I'm not. But I mean, that's neither here nor there. They've been spreading so many lies about the pandemic that it's honestly shocking to see them say something correct about COVID-19. But since they have, you know, built up their audience and led their audience to believe that, you know, the official narrative about COVID-19 is wrong, well, what do you what do you think happened? Their audience predictably revolted against this segment. So they uploaded the segment to YouTube. And as you can see, there are four times the amount of dislikes as there are likes. And as you can expect, the Fox News viewership sounded off in the comments section as well. This person says the more they push it, the more I am convinced not to take it. That's definitely a very smart way to determine whether or not you should do things that are beneficial to your own health and safety. This person says maybe he can read a country song about his love for Fauci and the jab. Got him. Never let the government stick stuff into your body. Once you take it, you can never untake it. Yes, because the vaccine, according to this person, is more scary than getting COVID-19 itself. To all the people on here that gave a thumbs down, awesome. You are awake and will not be led astray. This person says we had peer pressure from our friends when we were young to try drugs. Now we have peer pressure from famous people and athletes to jab our arm with an unknown substance. This person says, just say no. Remember that campaign? I say we bring it back. And this account is literally named Think For Yourself. I mean, it's just it's too perfect. Hey, Brad, I've done my research, too. And as a free American, I'll stick with my healthy lifestyle. Vitamin D3, zinc and exercise. For me and others, this combination has been monumental in fighting COVID-19. Good day, sir. So will he accept responsibility for all medical expenses if one of his fans has an adverse reaction to taking it because he encouraged them to?   But aren't you the same folks who voted for a reality television show start to be president? Yeah. So forgive me for actually giving Fox News a pass for thinking that dipshits like you would only listen to someone who is very famous. Because, I mean, you voted for Donald Trump. And then before Trump, conservatives voted for Ronald Reagan.  Perhaps that is what's needed. But I mean, between the stupidity that we just read and the greed of pharmaceutical giants who are fighting tooth and nail to block countries from the global south for manufacturing their own generic covid vaccines for people who actually desperately want to take them. You know, it just feels like human beings aren't long for this world. And I know that saying that sounds overly doomer and it is to an extent, but it feels like we're on the precipice of extinction as a species. And even if we know that we're doing everything we can to accelerate our own extinction. It just it feels like human beings are rooting against themselves. And I say that based on the actions, right? I mean, there are very common sense things that we can do to stop the spread of a highly contagious, deadly disease. And even the bare minimum conservatives just they fought against it at every step of the way. We lockdown. Well, they don't like lockdowns. OK, so we reopen up, but we are more cautious. We institute a social distancing and require masks. Well, they don't like the masks because that to them is tyranny. OK, well, if you don't like the masks, if you don't like the lockdowns, then the vaccine, certainly that's what's going to end the pandemic. But they don't like the vaccines either. Vaccines are bad. OK, I mean, I don't know what to tell you.  There are things that you do during a pandemic that's recommended by the experts and scientists and epidemiologists. If you don't like all of those options, then the default thing that you want us to do is to just pretend like the pandemic isn't a thing.   I mean, what's what's the takeaway? I mean, look at climate change, for example. We can even solve a pandemic. But climate change, an issue much more complicated, magnitudes more difficult to solve. They don't even acknowledge that climate change exists when we're seeing more and more severe weather patterns, more wildfires. It just, again, I have this overwhelming sense. Of dread and doom. And it feels like human beings don't want to exist. We're our own worst enemies, right? If an alien species discovered Earth and they invaded, we'd be helping them to exterminate all of the human beings.   And that's really sad. But look at the comments. I mean, maybe we shouldn't read too much in the comments because, you know, you will definitely lose faith in humanity. If you if you stay too long in the YouTube comments section, particularly under conservative videos, but it's just. I don't know what else to say. Maybe I'm doom and gloom, but the pandemic has truly made me lose whatever minimal amount of faith that I had left in humanity. It's just it's gone. Now I have no faith in humanity. Any shred of optimism I felt about whether or not human beings could come together and fight climate change, that's gone. I think it's just not possible now. And I'm grappling with the implications of of this realization.   And it's infuriating like, how do we go forward? Knowing how self-destructive we are. And I don't know. I don't know.  And it just seems like the pandemic is going to exist forever. And nothing will be done about climate change. And the situation will continue to worsen and worsen and worsen. And that's it. Yeah. Sorry, I didn't want this to be depressing, but. You know, I can't just look at the stupidity any longer and laugh at it. This has real negative implications on not just American society, but global health. I mean, and it's frustrating that you have folks dying, begging, desperate for vaccines in India right now because their right wing fascist government is also failing them.  It's just very, very depressing to say the least.  If you have optimism for human beings and you don't think that we're just marching straight off a cliff towards the apocalypse, then don't let me rub off on you. Don't listen to me if you are still hopeful. But I've been drained. My hopefulness, my optimism. I don't feel it. And I hope it comes back. But I'm not optimistic that my optimism will come back.