The moment you experience unhappiness, you start thinking more thoughts that correspond with that emotion, which produces additional chemicals and continues to draw energy from the brain and store it in your body. If you react negatively to people in your life and you feel anger, frustration, whether it's traffic, the news, parents, boyfriend, whatever it is, as you use this electromagnetic field by drawing from it, you're tapping that resource and creating chemistry with it, which causes the field to shrink. The body is no longer a magnet as a result of doing that and living in survival mode. As a result, your brain has very little energy right now. In actuality, the brain contains five percent of all energy. The body then stores 95 percent of it. The body is now emotionally conditioned.


Community Matters here at 11 o'clock rock with Jane Sugimura, a member of the Democratic Party. Jane, thanks for coming down today. It's very important that we talk to you about things democratic. Yes, thank you for having me and I'm always glad to talk about things democratic. I know that. So the first thing we really need to talk about this at least a little bit is the Mark Takaya funeral going on. He was a very popular guy. He was well liked. I think part of the reason is he was a genuine, genuine human being and he meant what he said and he said what he meant and he tried hard. He always tried hard. Yes, he did. And I lived in his district. In fact, when he first ran for office, I was in his district and I'm no longer in his district because of reapportionment, but he still represented the district in my part of town, IA Pro City. So I've known him for a long, long time. What's going on now with the funeral and the... Well, there was a public viewing yesterday at the State Capitol and that was live streamed on the Internet and I know many, many people went and right now there's a funeral going on. I just came from visitation and there were lots of people there. There were people from Congress and Senator Schatz was there and Aaron Johansson who started off as a Republican in the House of Representatives but a very, very, very good friend of Mark Takaya's. He's going to give one of the eulogies at the funeral. They were very, very close. You said Nancy Pelosi was here. Nancy Pelosi was here yesterday and one of the speakers at today's funeral is Tammy Duckworth and I saw where a lot of congressional people were coming and they were already arriving as I was leaving. Remarkable. He was a young man. He was about 50, wasn't he? 49. 49. And he had two teenage children. Yeah. So it's very sad. Yeah. And I think it's just another case with what do you call it, pancreatic cancer. Right. And he's so quickly. It went very fast. I was really shocked because I was a supporter of Mark. I was there when he started his campaign for reelection in Congress. I think it was February. And there was a big party at a country club and then he made the announcement in May and when he died, I mean, two weeks ago, no, a month ago, it was so fast. It was just a shock. Yeah. That's the way February had a cancer worse. It was very shocking to me. Remarkable that he achieved the friends and connections that he did in Washington in a relatively short period of time. And you know, I'm on the neighborhood board and so Mark was at all of our meetings over all of the years. And one of the interesting things that we will all remember Mark for and for people who serve on neighborhood boards or go to neighborhood board meetings, they will appreciate this. Mark was able to coordinate all highway and road repairs with the city and county. He had a committee and anything that happened in IAEA because, you know, there are people who were grumbling. We have two roads in IAEA. We have Cam Highway and we have Montelua Road. And people couldn't understand why if the electric company, the water supply had to dig up a road, you know, to fix a pipe.  And it was like, why? Why can't you do it at the same time? Don't you guys talk to each other?  You know, we have the means to get the city and the county and the state and everybody to get together and work together to say, okay, we're going to do this repair. Who has to go in? And everybody work together and go in and do the repairs. And that way you inconvenience the community only once, right, instead of inconveniencing them multiple times while multiple agencies and whatever have to go in and rip up the roads and fix them up again. He's a good guy. He was. He was a friend of ThinkTech. He appeared on ThinkTech a number of times in both the state jobs and the federal job. And he was good to us. He appeared early in our evolution. And so he believed in us. And I certainly appreciated that from him. Anyway, let's move on to your experience in Philadelphia. That is, if you hadn't noticed, it was the city. It is the city of brotherly love. Yes. And it was a strange convention, wasn't it? Well, it is a city of brotherly love. And I think Philadelphia did welcome the delegates and put on quite an affair for the delegates. I know the opening night affair was at the Art Museum. And people who have seen the Rocky movies might remember the stairway where Rocky runs up. That's the Philadelphia Museum of Art. They had an extraordinary event there to welcome the delegates. And so they had people playing music. The Art Museum was open. And the docents were taking people around. And they had food. All these various food vendors. And they had rock music outside, classical music inside. So you had the violins inside. You had the rap and whatever outside. And you had the mimes on the stairway. And it was just beautiful. And the weather was beautiful that day. Most of the other days it was either very, very humid and muggy or thundershowers. You went as a staff member of the Hawaii delegation. Yes, I did. And what was it like from your point of view? Was everything as good under the hood as it was to public appearance? Well, I think so. And I have been to several national conventions. Every single one that I can remember, as a matter of fact. This one was different because we had a lot of new people who had never been to a national convention before. And these were the Bernie Sanders delegates. So they had enough clout to get in? Oh, yes. They were persuasive in the party so they could get into the convention. Right. We choose our delegates through a process that's authorized by the Democratic National Committee. And so we do it like a year ahead of time. It's called the Delegate Selection Plan. And we had our caucuses in March of this year. And the Bernie Sanders people, they mobilized and they were able to get 70 percent. I remember that. 70 percent. It was a phenomenon. Right. The caucus vote. Right. And yet, when it came time to really step up, they had already, you know, dissolved. Well, no. At our state convention, they were there. I mean, we had over a thousand people at our state convention. A thousand delegates. And a lot of them were Bernie supporters. Bernie Sanders. And they were able to elect the party chair. Are they still powerful? Well, they're not as active anymore. I mean, we had an event in Kailua that the party usually participates in. And there were some precincts that had the Bernie Sanders people who were elected. And they didn't, you know, get involved. And that's too bad. That means it's kind of ephemeral, which I mean, sure, Bernie wants better than that. We all want better than that. We want to see them continue and keep, you know, keep on. But what about in the convention itself? Were they instrumental in the votes? Were they instrumental in devising platform points? Well, you know, prior to the convention, the Democratic Party, the Democratic National Committee had these meetings to establish the platform and the rules that are going to govern the race. And the platform that the now candidate, Hillary Clinton, has to defend and advocate for. And Bernie Sanders, because he had the 1900 delegates, was able to effectuate change on the platform. And she bought into a lot of it. She had to buy into it because, you know, he had that many people. And so they were able to negotiate with the Hillary Clinton campaign. And I guess I understand they managed to get most everything in except the issue about the trade plans. I think that was the only one that they didn't negotiate in. And, you know, he would not have been able to do that, but for the fact that he had a substantial number of delegates at the convention. Did you see the Hawaii Bernie Sanders guys in action? Did you see them involved in the negotiation? How did they express themselves? Well, I don't think they were involved in the negotiations, but I mean, because all of this happens before you get to the convention. And the entire convention votes on it. And that happened on Monday. And that happened with a little bit of angst. I mean, there were some demonstrations and protests. Outside? No, inside and outside. And who was demonstrating and protesting? The Bernie Sanders people.  And in fact... They were not completely convinced of that. Well, I think they were disappointed. And a lot of them, this was their first political foray. The first time they got involved in a political party, the first time they... They didn't want to see him capitulate. And for those of us who have been, you know, party members for a long time, we've been through disappointments. And you know that you just have to start all over again and, you know, work harder. Now, what about the lady with the finger? Oh, that... Well, that's an important... She was in a national press with the finger right in the middle of the Hawaii delegation. Well, what was going on there? Well, first of all, the people who were in the picture really didn't know about it. They didn't see what she was doing. No, they didn't see what she was doing.  And in fact, they didn't really know about it. We were driving home.  We didn't go in the bus with the delegates. We were in a car. And Governor John was getting text from his wife wanting to know what the hell was going on, basically. And then somebody else was in the car. They were getting text from Hawaii to, What's going on in Hawaii? Why are we on national television with this obscene gesture? And we're passing the phone around and saying, Oh my goodness, this is how we found out. And it was a shock. It was kind of like an embarrassment. It was... And, you know, the chair... It doesn't speak of solidarity, that's for sure. Well, no. And the chair did take action where he gave that delegate a choice of apologizing or, you know, turning in her credentials, and she wouldn't apologize so she gave up her credentials. And left. And no, she stayed for the convention. She just wasn't allowed on the floor. We understood she stayed. But, you know, she... I didn't see her anymore that week in our events. What was her point in that? I mean, I know she wrote an op-ed piece for the Star Advertiser a week later, but what was her point in making the gesture there on the floor? Just before the convention began in Philadelphia, I think there was a hacking of the DNC and there were some emails that were disclosed. And that showed that the DNC favored Hillary's campaign over Bernie Sanders. And that led to the resignation of Debbie Wasserman Schmidt, who was a DNC chair. And so my understanding is the delegate was mad at the DNC. Why she chose to make the obscene gesture during the time when, you know, the Hawaii delegation was on national television during the roll call doesn't really make any sense. If she's mad at the DNC, she should go and march in front of the DNC with her obscene gesture, you know, not do it in a group, you know, that represents the state. And, you know... And it's on national television and so are our images there. We're not going to do that here in Think Tech. We're not even going to show you what the obscene gesture was, but we will take a break. We'll come back. Maybe we can do it during the break, Shayne. Aloha. My name is John Wahee. And I used to be a part of all the things that you might be angry at. I served in government here and may have made decisions that affects you. So I want to invite you in. I want to invite you in to talk story with me and some very special guests every other Monday here at Talk Story with John Wahee. Come on in, join us, express your opinion, learn more about your state, and then do something about it. Aloha. Aloha. I'm Kaui Lucas, host of Hawaii is My Mainland every Friday here on Think Tech Hawaii. I also have a blog of the same name at kauilukas.com where you can see all of my past shows. Join me this Friday and every Friday at 3 p.m. Aloha. So you were there among the delegation from Hawaii at the floor in the city of Brotherly Love three weeks ago, I guess. What was it like? And what was the delegation like?  So, you know, everybody kind of got along, but we didn't see a whole lot of the burning people. And I was told it was because they couldn't afford to stay in the hotels. And so they were staying other places. You know those burning people.  Usually, you know, our hotel, for one thing, was way outside. We were an hour away from the city. No kidding. We were in Valley Forge. Well, it has historical significance. Right. So I can see why maybe the Congressional might want to stay in town because, you know, that way, but typically, you know, we're all kind of like in the same place. In years past. In years past. Yeah. The Congressional. Does that have an effect on your ability to communicate? No. I mean, because we would get together for caucuses and they would show up at the convention. The Congressional's would be there.  I know the Bernie Sanders people had events during the day. Their own events. Own events. The protests in the park and things like that. This is strange.  Everybody's on the same page. Right. And in Hawaii with Democratic Party is king. Everybody's on the same page. Right.  We know what we're going to vote for. We know where our position on things. But in this case, it wasn't like that at all. Right. Well, you know, there were these protest groups that, you know, had their events. And so I'm not saying that all the Bernie delegates went to those. I mean, and they went to other events because the various caucuses met at convention center. The women's caucus, the LGBT caucus, the labor caucus. So if anybody was interested in any of them, they could attend those meetings. But these caucuses were about platform points, I assume. Right. You said the platform points were decided before the convention ever met. Right. So what's the point? Well, they have other issues that they want to pursue.  And, you know, basically the first two days of the election is political, right? After the roll call, which is... What's political? What do you mean by that? Who's going to be the national candidate? Selecting leaders. Selecting leaders, you know, voting for the platform. And then the after, you know, you have the roll call and the person is nominated to be the national candidate. The rest of the three days is a political advertisement. For the world. For the world. And to rally the troops and get them already... Excited. All excited to go back to their homes and get ready to campaign for the candidate. Yeah. So did that happen? Yes. Did that make your blood run faster? Yes.  What do you think?  And, you know, this was the first time. I can remember. Nevada was behind us. And Nevada, for some reason, were very raucous. And for some reason, some reason they kept chanting No More War. And I don't understand why they were chanting that No More War, because there weren't people up there talking about war. And so we were getting text messages... It was like a chanting at the Republican National Convention. They would put Hillary in jail or whatever they could say. Yeah. So we were getting text messages. And this is something new, right? We were getting text messages saying, when they chant this, then you chant this. And so you have... Competitive chanting. Competitive chanting. Yes. So that's the new norm.  Because it's loud and noisy in the convention. Yeah, yeah, yeah. So when you talk to people, sometimes you have to yell. But now you don't have to yell. You can just text. That's, you know, that's a lesson.  Somebody came up with a good chant. Somebody else heard it. And now you have a lot of people chanting, No, it doesn't work that way anymore. No. It's all social media. Right. Cell phones. You get a text saying, when they say No More War, you chant this.  And, and so it was, it was, it was fun.  And we were told they were going to walk out of the convention. That would have been very disruptive for the whole effort. Very disruptive for the Hillary and very disrespectful on the very last day. And, you know, I have to give credit to our group. What they did is they said, you know, really don't, you know, we're going to work for Hillary, we really don't want to go into the speech. They turned over their credentials so that the family members of the other delegates could attend that last night. Oh, good. So, you know. That's fair. Yeah. So, so if they didn't want to go, that's fine. And, and, and, you know, one of the delegates, the Bernie delegates, wrote a nice message to the executive director of the, of our group. And she basically thanked us for, you know, making the, her first national convention an enjoyable event, that she was disappointed that her candidate, that Bernie Sanders, you know, didn't become the national candidate, but she was grateful for the opportunity to come and they were going to go home all energized and work to elect Hillary Clinton. And so, you know, to me, that's, that's a positive. Yeah. Well, you're going to make the best action you can with the circumstances. Right. And that's a good attitude.  These are, these are college kids. Well, Bernie's going to come back, don't you think? And, and, and I think that this is a credit to Bernie.  I like some of the stuff he said. You mean him? He did. He came to our, came to our caucus on the last day. Bernie Sanders came to our, and we were at a hotel, at our hotel we were there with West Virginia, North and South Dakota, Utah. And I think Wyoming, or Idaho, one of those states. But anyway, he came to our caucus. And he was a big hit. And he, he, he was very, very insightful. And he thanked his, there were a lot of Bernie people in the room. And he thanked his, his supporters.  And I figured, okay, something is going on. What does that mean? What does that mean? And they waited for the very last. And I thought, okay, now they're going to make the motion. This way Bernie Sanders delegates were able to register their votes, at least to take, In a more powerful way. No, they were in favor of Hillary. No, no, they registered their votes for Bernie. They were allowed to do that. And then at the end he was going to do this gesture, or the state was going to do a unified vote for Hillary. Is that what happened? And it did. It was him who made the motion. And I thought that was very honorable. It was cool. Yeah, I remember that. Very cool that he did that. What about Hillary? She suffered some slings and arrows lately. And some people say that at the convention, in order to accommodate the Bernie people, she made the tent too big. She accepted everybody's position about everything. It's hard to do that. And maybe some of the other side didn't like it too much when she capitulated to the Bernie people. Well, the Democrats have always bragged about, we have a big tent. And we fight. I mean, we historically, we fight amongst each other. But when it comes down to the nitty gritty, we come together. And sometimes we reluctantly vote the way we do, but we stick together because we all believe in certain basic principles. And I think the fact that she is advocating this broad tent is a good thing. Because I mean, we should invite... She saw her position on a number of things. She did. And it was due to the fact that Bernie Sanders demonstrated that there were people out there who cared very strongly for these ideas and these principles and these policies. And so she has to listen if she's going to be representing them as the candidate. Is she now? Is it that peace now where everybody under the tent agrees that she's the candidate? I don't think so. There are some Bernie people who at the National Convention were holding signs for, I think, the green candidate. Dr. Jill, I don't know what her name was, but I know I saw the signs. And I'm told that there are some people who... And there are complaints filed with the local Oahu County Committee against certain Bernie Sanders people because they represent... I mean, they're campaigning for the green candidate. So the essential party, though, the core party here in Hawaii, how is it affected by all of this? Is it strong? Is it stronger or weaker? How is it getting along with the millennials? I think we're in this transition period and we do have more members. We do have more members. And I think if the convention demonstrates anything, it means that we're getting along.  Except with the woman with the finger. Well, no, she's still in the party, I guess. And although people have filed complaints against her, I don't know what her status is going to be. I think people are saying that if she doesn't like it, she should resign. But, you know, like I said, we have a broad tent and we invite everybody and we can fight amongst ourselves. So this was not all that disruptive to the party in general? I don't think so. And it's part of the growing pains. What it does is it means that you've got a younger generation coming in and they think differently. And the party, well, they think more to the liberal side, I guess, because of the burning. And you have to accommodate. You need to learn to accommodate. But what about the problem of one party? Does this help that problem? I mean, some people firmly believe that we have a sort of a fatal flaw here. We have one party in the state running everything and in response to the unions. And so we really don't have two hands clapping on anything and the decisions are made in the back room instead of, you know, an open conversation between two separate, two hands clapping. And so I really wonder how this whole affair with the Bernie people and what happened in Philadelphia affects that. Well, I don't, what I think is what it shows is that, you know, we're a dynamic party and we are flexible. And, you know, the thing about this back room, if there were back room deals, there wouldn't be these lawsuits between UPW and the state of Hawaii about the privatization of the Maui hospital.  And there is, you know, there's not always agreement between the unions and the Democratic elected. And what it is, is, what it is, is the connection is access. They support Democratic candidates. I mean, that doesn't mean that they get what they want, but they have access. They have access to elected officials and, you know, and maybe more than a stranger because they're the, you know, they have supported the Democrats because in general Democrats have supported the super movement historically. People have also expressed concern about the fact that whatever the system is, it doesn't yield candidates who run against other candidates. And we have had several elections in the campaigns in the, I guess, the primary where it was unopposed, several. I mean, for important positions, unopposed. And whatever your party is, even in a primary, you know, you want to see some action there. You want to see new people come up, you know, and disappoint me if I can use that word, is that the millennials and the Bernie people who, you know, have a lot to offer and who are thinking and acting and, you know, active at the convention, why don't they run for office? What's holding them back? They have. There are several who ran for office and they, you know, were in the primaries. They didn't, I don't think, I can't think of any who ran, who won their races. But the thing is, is they participated. Okay, so now they got their feet wet. Now they know the process.  And I was just as disappointed as you saw those numbers coming up on Saturday. Thirty-four percent. Yeah, thirty-four, that's terrible. You can't do that. You can't do that. No, that's terrible. And I agree with you. I mean, that's, you know, that's a terrible reflection on the people here. What that means is that they're either satisfied with what the status quo, or they don't care. I don't know which is worse, you know? Yeah. But it is. It's very disturbing. That's something we all have to work on. Yeah, that's something we all have to work on. And ThinkTech will work on that. I mean, I think we have to remind people that they, as citizens in a democratic society, I don't mean democratic party.  And they have to connect with the government. They have to vote at the very least. Jane, thank you so much for coming around. Oh, thank you for having me. Will you come around again and talk story with me again? Yes. Yes. That's Jane Sugimura, my law partner and also a great supporter of ThinkTech, and she's associated also with Kano Insider. We'd love to have her come around. Thank you, Jane.


What is going on guys welcome back to the channel critical overlord here since I'm about Jeepers Creepers 4 in this video here again today Jeepers Creepers You're born now This this information here is gonna be good and bad depending on how I guess you interpret whatever I'm about to say in this video So two things one I was sent a recent update of Teemo's comments over on Twitter as you see here on your screen And I was also informed about a potential test screening that mayor may not again have occurred for Jeepers Creepers You're born now to talk about the test screening really quick and a tangent. I don't know Well for one, I don't know who would be Attending a test screening for this. I also know I guess that sometimes they don't reveal well probably most of time They don't even reveal. I guess the movie that you're test screening to the people in attendance. Sometimes it can be a surprise So like I don't I just really don't know who would willingly attend a test screening for this But just to talk about this tweet you see you're on your screen first a fan kindly reached out to Teemo a few days ago asking Could you please release more news about Jeepers Creepers? We're born we are we are already in the middle of this year and we don't have the trailer nothing He said no unfortunately I can't and they responded okay But can you guarantee that it will be released this year because that's the release year that was shown in the teaser Teemo himself has already came out and said that there is a release date scheduled for this year And it's confirmed. They just cannot Announce it yet that that's what he told us not too long ago like a month or two ago He responded to that response from the fan saying no, I'm in no I'm not in a position to guarantee anything. It's all in the hands of the distributors Someone else chimed into this chat and said Teemo are you saying that it might not come out in 2022? Now I don't have the rest of this chat. So if you know what that what was said in response to that Let me know but there there we are again the the run around it's nothing but run around here with this movie I feel nothing but effing run around the movie itself I don't believe we are gonna see this movie and again I'm at a point where I'm like, maybe it's for the best, you know There's so many people who will say oh just wait for it to come out just wait for it to come out Yeah, yeah, we can all wait for it to come out But at the end of the day, there's still stuff going on that I'm not saying you need to you need to lose sleep over but Still can't ignore the things here that that went on to get get us to this point if everything was in place as it should have been prior to them shooting this movie and Having all their ducks in a row. You would have a Jeepers creepers for right now you would have that you would not have a bunch of run around in rigmaroo and BS after BS and a movie that's just getting shelved actors who participated in the movie probably thinking they had a chance to Do something and monumental to push their careers forward Just looking to do that being in the dark about it, too I'd imagine it's just all a mess with this movie Jonathan Brett going out to conventions and admitting that he's not he's not in the movie I know I told I showed you screenshots of his manager actually telling me he's not in the movie I made a video about that as well I've revealed basically half the cast before it was ever announced and Because they're they're not doing anything So I know a lot of you watch my videos in the past and right now probably if you're watching and you've appreciated all the details I've been able to bring to you because they weren't doing it There was also a time when this was like earlier earlier late 2021 When they were releasing stuff starting to pick up what we thought was gonna be a lot of promotion They sent messages to certain people me included Asking us to take down certain videos. We've uploaded take down certain images. We've shared now with the lawsuit knowledge I'm like bro. Is this why you wanted to take it out because at first out of respect. I did take certain things down I will not be doing that ever going forward because it doesn't need to be taken down There's something going on that they don't want to be made public for whatever reason and you know If the fans are the ones doing it sure Maybe the fans shouldn't be sharing certain things publicly. I can understand and respect that Why did why do you now those seem like there was an alternative motive there? Because of now knowing about this lawsuit and everything else It seems like there was an alternative motive to that telling people to take things down into leaked videos. No and then just to Transition into something else here because again, it does not seem that gibberish for us coming out this year so far He's told us team on himself is told as there's a release date hasn't announced it I don't know if it will be announced now again. He's back to the Talks of he well, I won't say he ever went away from it He he's back to saying that it's all up in the hands of distributor No, no, no, no, I believe it's all up in the hands of whatever's going on with this with this lawsuit there might actually be something going on in Internally where they want to do something here with this lawsuit first before they release this movie Just to transition over to something else again the whole test screening tobacco The other message here that you have here on your screen shout up to you as Blake because I know you send it to me It's from Jason Raymond. I don't actually know how a hundred percent legit This is because of a certain word that's also included in on the screen But this is his actual profile picture So I'm just again gonna just say take this with a grain of salt And I don't mind talking about this and speculating on it because of how dead and in the ground this franchise is but Someone reached out and said hey I spoke to people from Russia and Germany about the release date and they confirmed it Do you know how the movie is going now? Remember Jason Raymond worked on the movie as like a visual effects supervisor And I think he was also like assisting with the editing maybe in some other final touches that went along with Completing the movie He said that's exciting the movie was finished in March and looks good test screening was positive now again, I Just find it to be a joke at this point a test screening for this movie was positive After everything we've seen so far and again, I know that's just judging it all off of surface level things I don't know why anyone at a test screening would give this a good review But then again like I've stated before test screening audiences They And I'll just say a lot of audience members they eat up anything They're not really gonna have an in-depth conversation with you about why they liked it or didn't like it They're not gonna really go into any real true details if you're someone who really wants to Understand if a movie is truly good or bad. They a lot of people they do stick to the bare minimum responses when they want to talk about a movie Oh, I liked it. I didn't like it. Oh, that was trash. That was good. Okay. Why? Oh, I don't know I just liked it. Why was it bad? I don't know. I just didn't like it You know, a lot of people like that. So a test screening for a movie like this is wrapped in all this controversy And hymns claiming it was positive. I wouldn't get too excited about anything like that I wouldn't expect this movie to come out this year either so that way if it actually does it I guess it will be a pleasant surprise this Halloween season look forward to all the other treats though If you haven't already, of course, make sure you subscribe turn on post notification You never miss a video in the description. I'll leave some social media accounts on Facebook Twitter and Instagram You can message me there, of course There's any movies or reviews I'm gonna cover in the future with all that in mind guys. I will see you in the next video


Hey all you cool cats and kittens, today we're going to talk about the difference between an RDL and a straight leg deadlift. So the difference with the RDL is that it starts from the top. So we're going to go ahead, set the bar up in the rack. We're going to unrack the bar, take a small step backwards, and then from this position we're going to take a big breath, we're going to set that back nice and tight, and we're going to reach our hips back to the bar that's just below our knees. Right there, we're going to come right back up.  So the benefit with these is that we can use these to help someone set their back better on the deadlift. If they have issues setting their back from the floor, this helps because it's easier to set your back at the top and hold it as we slowly lower that weight down and then come back to that starting position. And the RDL is great for a hypertrophy phase in your program, specifically for the glutes and the hamstrings. So conversely with the straight leg deadlift, we're going to start from the floor this time. So Erin's going to bend down, grab the bar, she's going to keep her knees almost straight so that there's almost no knee extension coming off the floor. Whereas in the deadlift, we're going to have a little bit of knee extension to help push that bar off the floor. Here we're not, so those hamstrings are going to get worked a whole lot here. So you've got to be careful with how you load the volume and intensity on these so you're not really sore.  Okay, slow, lower, back down.  While the RDL and the straight leg deadlift are both good for hypertrophy, the RDL is focusing on setting the upper back and extension. So for the RDL, we're going to be better off using five sets of three or something along those lines. With the straight leg deadlift, we're using more muscle mass over a greater range of motion. So for the straight leg deadlift, we're going to do three sets of eight reps. For more how-to deadlift videos, click the link up here.


Hey, everybody, what's up? It's Rob Dodson. Welcome back to The AliCast Show. Today, I want to talk about managing focus in a single-page web application. So this is an interesting topic. I had a Googler reach out to me recently. They were like, hey, I'm building a single-page web app, meaning they click on a piece of navigation, and it just loads more content into the page without refreshing the browser. And they were wondering, for someone using a screen reader, what is the best way to convey, like, hey, this content has loaded. It is ready to interact with. So I wanted to put together a little example and walk through the process that I typically use when I'm doing something like this. So follow me over here on my laptop, and I've got this little site that I've created. If you've ever seen Lorem ipsum, which is just placeholder text that people oftentimes use in their designs, there's a bunch of fun Lorem ipsums out there for bacon and hipsters and zombies. And so this is a site that just loads different Lorem ipsums. So you've got hipster ipsum, bacon ipsum, zombies ipsum. And the thing that I really want to show off, though, is what this experience is like when I use my screen reader. So ideally, what's going to happen is we're going to interact with an anchor over here on the left, and then it's going to dump us into the page. The thing to note here is that we've got every page contains this anchor tag. I've snuck one inside of here. And so what I want to show off there is, as we're switching over to the page, we can quickly get down to that anchor. We don't have to tab through the rest of our navigation. So let's try that with our screen reader. VoiceOver on Chrome. Managing focus, SPA window. Manage visited link, zombies visited link, hipsters. Heading level one, hipster ipsum, main one item. Link, wolf moon, voiceover off. So what we're doing there is we're interacting with the menu. The second the new content loads, we're moving the focus into the page. And then because we're inside of the page, then, we can very quickly get down to the next interactive element that we want. We don't have to go tabbing through our entire side nav or navigating through our whole side nav, which in this site is very small. But you can imagine on a really big site with a bunch of drop downs and accordions and stuff in there. It can be really annoying to have to move through all that stuff yourself using a screen reader or using the tab key on your keyboard. So how do we do this? Well, basically what I've done here is I've created a little H1. It's kind of a big H1 in this case. That's taking up our entire header. And I want to show you in the dev tools, if I inspect this element. So the thing to note here is we've got an H1. And then it's been given a tab index of negative 1. Now, we shot an episode previously on using tab index. So I'll include that down in the show notes. You have access to that. But basically, tab index is an attribute that will opt elements into the focus order. And there's kind of three states that tab index can have. You can have a tab index of 0, meaning that the element is reachable by the keyboard. So I can press the tab key on my keyboard and it'll boom, focus it. You can have a tab index of greater than 0. You can have tab index like 1 or 5 or 100 or something. That's generally kind of an anti-pattern, because what it does is it jumps that element in front of everything else in the tab order. Usually, you don't want to actually do that, but I did want to mention it for completeness sake. And in tab index negative 1, like we're doing here, what that does is it means the element is not in the keyboard focus order. So I can't reach it pressing the tab key. But I can focus it programmatically by calling its focus method. And that's exactly what I'm doing every time the page changes. So let's go look at the code for that. And you can see kind of like a little bit, I'll walk you through sort of the structure of the page. So we've got our nav here with the side nav links, right? So zombies, hipsters, bacon, things like that. Three of my favorite things. And I've got this main element here. This is where we're dumping all the page content when it loads in. And then if we look a little bit further down the page, I've just got these template elements that contain all that page content. So here's the template for zombies, the template for hipsters, and the template for bacon. You can see our header with tab index negative 1. And so if we look at the JavaScript for our router, I'm just using a very simple router called page.js.  I just picked this one because it was easy to set up. And what I'm doing is listening for any URL change that happens. So anytime you click a link, it's going to intercept that. It's going to tell me the URL. And then I just say basically, you know, let's figure out the bit of the URL after the slash. So in this case, that gives me like the page name, like just the word zombies or just the word hipsters. And I've got this little add page for path function. And all we're doing here is we're finding the template that matches that page path. So I'm saying, okay, cool. So get element by ID, passing the path and dash template. So again, you know, if someone passed in zombies or bacon, that will match this ID right here, bacon template. So then we grab our main element, we clear it out. We drop that content in there. We append child the template content. And then I'm just returning my main element, treating that like the page. And then the main thing to note here, sort of like the magic that happens is I then query selector the page and I look for that H1 with that tab index and negative one. And then I'm just calling it's focus method. And that just moves the user right into that content. And the nice thing is when you do that, the screen reader is just going to go ahead and announce that new content. Something to note, let's see, let me open my CSS. You can see it here. Here we go. All right, so right now I'm applying a focus style where I'm overriding the default outline style on that H1. So anytime you opt an element into the focus order, if it's an H1, if it's a span, whatever, once that element gets focused, you're going to see the browser's default focus style on it. And so if I comment this out, save this. Let me go back to our application. Let's see, so let's reload this. All right, and you see right away because we start off on zombies, it automatically updates the URL. So you get this blue focus ring on zombies. All right, I changed to hipster, changed to bacon, got this big focus ring. If you show this to your project manager or designer or even just like customers that might be confused by that, they're like, I'm not quite sure why you put this weird focus ring on this control. So this is one of the rare instances where I think it's okay to actually override the outline on this control because again, we're not asking the user to interact with it or anything like that. We're really just trying to direct the focus into that area. Really, we're kind of moving their focus navigation starting point, if you wanna think of it that way into that area so that the next time they hit tab and the next time they move the screen reader, it's going to go ahead and be able to interact with the rest of that content. So again, let's run through that just one more time so you can see how it works. VoiceOver on Chrome, managing, visited, blank, visited, blank, hipsters, heading level one, hipster, hipster, main one item, blank, wolf moon, voiceover off. Okay, so we've definitely made the greatest website in the world. And by the way, I will be sharing all this code on GitHub so you too can add your own ipsum to the ipsum glossary that we've built here. But yeah, this is generally how I manage focus in a single page web app. Just find a heading, slap tab next negative one on to it and put the user's focus over there. That about covers it for today. If you have any questions for me you can always leave them down below in the comments or hit me up on a social network of your choosing. As always, thank you so much for watching and I'll see you next time.


The medal I'm going to show you today is one I'm particularly proud of and it's not for climbing crazy high mountains or running ridiculous long distances. This medal is one which anyone can go for especially if you enjoy the triathlon distances and stay tuned to the end because I'm going to explain to you exactly the process you need to go through in order to get it. In episode one of Medal Monday I talked you through my London Marathon medal collection and if you'd like to see that episode that is linked just up there. Grabbing a London Marathon Finisher's medal is one of three steps that you will need to take on the road to the ultimate prize. I've been lucky enough to complete five London Marathons and one virtual London but for this episode I thought I would show you my first ever London Marathon medal. That's from 2015. It was an absolutely freezing year and I didn't quite manage to make my goal of three hours 15 minutes but three hours 18 was perfectly acceptable. The next thing you're going to have to do is cycle 100 miles specifically you need to take part in the Ride London 100 mile race. Established as a London Olympics legacy event the race is now in its 10th year and I took part in 2018. The ride takes in the classic climbs of Box Hill and Leith Hill in Surrey. Unfortunately despite it being in July it absolutely poured down for most of the race. I got soaked and I was very nervous on some of the descents with other riders speeding past me in the rain.  If you are enjoying the video or finding it useful or interesting then please do hit the thumbs up button and don't forget to subscribe if you aren't already it would really help us out. Thank you so much. The final piece of the puzzle is the swim and you'll need to complete the two-mile swim serpentine event in Hyde Park. I had to make a mad dash from Scotland on a sweltering day having DNF'd the Ben Nevis Ultra the day before. The serpentine lake in Hyde Park is not the cleanest and I dread to think how much swan feces I swam through or swallowed in that two-mile swim. But I made it to the end and when I got out of the water I was presented with the two-mile swim serpentine medal but also the London Classics medal and here it is it's big but it's not too big it's chunky it's heavy and I am really proud of it. To get yours you need to do all three of the events I've mentioned but you can do them in any order and in different years it doesn't have to be in the same year. So head to the London Classics website where you can read more about it and register. You can register after you've completed two events and you've secured your place for the third. This will ensure that you're presented with your London Classics medal when you cross the finish line of your final event. I've put a link to the London Classics website in the description below and if you'd like to watch my rather wet Ride London 100 video then you can click that link right there. In the meantime we'll see you on the start line of the next one. Take care, bye-bye.


Bemidji Boys swimming and diving, hosting Thief River Falls in their home opener. In the 200 free, Moses' son in lane 5 gets the win by 7 seconds. Later in the 200 individual medley, Luke Yarts 4 Bemidji swims away with it with a 2.24 winning by 8 seconds. And in the 50 free style came right down to the wire. Bemidji's Walker Erickson able to just out touch Alexander Zirwas. He wins by 7 hundredths of a second. Bemidji wins big. However, the last port score saw Bemidji in front by 50.


That's actually for that's actually for Chris. Okay, so let's get started. We're starting a little bit late This is Python gone bananas monkey patching in Python We are at pi Gotham 2016. It's Sunday, July 17 2016. Hi everyone. I'm James Well, that was really good that was a really good response before I get started with this talk I wanted to give you a disclaimer. I won't be upset if you all walk out This is not one of the usual types of talks that I give usually I give talks about don't use this code You can see that's what I am on Twitter, and that's my email address I tell you about really weird wild things you can do in Python This talk is something different I thought I'd go back to my roots and I'd give you a talk about something genuinely useful Maybe educational something practical something that many of you can employ in your actual work This is a novice to novice intermediate talk It's very similar to one of the very first talks ever gave in fact My very first talk conference was in 2012 at pi Gotham the conference organizer that year Gloria Had met up with me after NYC Python event and we were at Burger King and she said, you know Pi Gotham's in a week and a half you want to go give a talk and I said sure and I spent the next week and a Half furiously preparing as much material as I could I Took that talk and I presented at pi data that same year and I went to pi, Arkansas I went to pi, Texas Since then I've spoken at a number of other events and you can see I think I'm on my 40 This is my 40th conference that I presented at I think it's the 50th or 60th talk I've ever given for many of in the audience this conference you have ever attended and You've seen the kind of energy and the kind of life that you can you see what can be done when you present your materials in this forum To this kind of audience you see how powerful that is many of you are Nervous you think I could never give a talk that could never be me on stage But I want to tell you it just starts with one powerful things about pi Gotham We love to give you opportunities to speak and we really love to see up-and-coming new speakers because who knows Any one of you might come back next year give your very first conference talk and end up like a conference junkie like me Four years later given given like 70 talks now. It's okay to be nervous I'm nervous before every single one of my talks. I can't even I I tried to put together the list of all the comments I've spoken at I can't literally not remember all the talks I've given and yet. I'm still nervous every single time It's just the way it is and it's okay so This talk is about monkey patching is kind of softer term for what other people might call gorilla patching Gorilla patching and monkey patching are essentially changing the runtime state of a program Using some mechanisms now this talk may be a little bit different than some of the other talks You've seen about core python materials this talk is not a why but the how I Won't tell you when you want a monkey patch or why you want a monkey patch I would think that when you have a need to do this This mechanism will probably be the most obvious way to solve your problem There are probably a lot of other talks out there that can explain better than I can some of the when you want to use This mechanism instead. I'm going to focus on the how just the nuts and the bolts It's very similar to the very first talk I ever gave which was the nuts and bolts of generators and context managers and decorators One thing I want to do in this talk is try to put forward a couple of mental models Some simple ways to think about how the Python language work that will help you in your everyday Python programming and will make What appears to be a very complicated very dangerous thing to do just seem obvious I? Told one of my colleagues about this talk and He said oh you're just going to talk about the mock library and it is true The monkey patching is very widely used when people are doing testing you could think that in a production system You have code that does actual things and you might want to mock that code You might want to replace code that does actual things like save to a database or load from a database What simulated code that just checks to see if that behavior behaves correctly and I'm not going to talk about mock I'm not going to talk about testing. There are a lot of good talks out there on that material I'll tell you that when I Started to write this talk at around and see I got home last night at 11 o'clock and I think there was a new episodes of suits So I had to watch that and then it was like 1215 and I was like oh my goodness I have to talk tomorrow so about 12 about 130 last night because I Did all my laundry I clean all my house Procrastination is really good for getting things done that aren't the thing you wanted to get done But everything else in your life. I thought okay after write my talk I started was what is a monkey patch? I wanted to include this link for you because this is a stack overflow link that tells you what is a monkey patch and one Of our organizer is actually a very well known person on stack overflow And he has a very nice answer here just explaining a little bit of the usage of munching packing So if you see Aaron Hall, he's one of our organizers for the meetup group You can ask him and he'll point you to his stack overflow answer One note for all that I'm going to show you is I'm only going to talk about Python 3 I could talk about Python 2 and Python 3 and there's a political choice there and whether I present this information in 2 or 3 What I'll tell you the city's sake. I'll show you all of this specific to Python 3 Some of the things that I'm going to show you have actually changed quite dramatically between Python 2 and 3 They've been made easier in Python 3 and I want to show you that because hopefully most of you are using that It makes my job easier and to show you both the Python 2 case and the Python 3 case Well my time allowed So what I want to start with is a couple of puzzles and for each of these puzzles Unfortunately, we don't have enough time to get feedback from all of you So I'll just give you a couple of seconds to look at the code and to think what the answer is for each of these Puzzles, I want you to guess what the output or the error is I will tell you there are no tricks So you defining a class? I'm not going to do some weird trick where that class has a bad name or I've The semicolon the colon is actually semicolon each of these are actual problems that you might run into and I'll start very simply Here I have a class. It's called my class. I do a single assignment in that class I say ID equate an instance of that class called object. I Do my class ID and as many of you know the ID function in Python just gives you the ID of some object So it takes one argument and it gives you the ID, which is just a number I do my class ID and object ID First line this matches what you think will happen It worked and it worked now in this case the exact output you might not be able to guess But that's not important if you guess that both of these worked then that's good Let's take another example. I wrote a custom function called my ID. All it does is it calls the ID function I have a class calls. I assign my ID equals to my ID. I create an instance of that class Does my class dot my ID work? No, it doesn't oh we have to evaluate these Yes, it does does object up my ID work. No, it doesn't so immediately we see something There's a puzzle here. What's going on? Why is there a difference here in the next two examples? I'll choose two mathematical functions sine and cosine and so I'll just show you just just to be absolutely gratuitous Here's my little notebook just to remind you of what the sine and the cosine function look like the sine function is in red It starts at zero it goes to one at pi over two it goes down to zero at pi Here I import pi from the math module and I create a new class and I say from math import sine Is that legal can I do that in a class body does that work? I create an instance of this class. I call the sine method on my class with pi over two Well sine of pi over two should be one on the instance Does this work? Well, it seems to does this line work? Yes, does this line work? Yes, it does Let's do something else This is in jupiter notebook. So some of the syntax at the top of the cells May not be familiar to all of you file that file is called mod dot py. It's just a python module in that mod dot Py python module. I'll import cosine from the math module. I'll write a function called my cosine, and I'll just call cosine I'll create my own class, and I'll do the import.  Does that work? Yes, it gives me the answer. I expect does it work on the instance? No, why not? Here's another puzzle. I have a class and I assign some variable to a lambda x and I return x times two Well, this works. There's nothing strange about it. I call this method on the class. Yes, it works Can I call it on the instance? No, it fails and one thing that you might immediately see is well, isn't there a self parameter somewhere in here? That's a good hint We'll try an even simpler example here. I have a class and it has a function in it It takes the first parameter self. We call this implicit self and it takes another parameter x and it returns x squared This is very standard code. That should definitely work. Does my class dot square work? No, it doesn't it's missing a parameter This object dot square work. Yes, it does Here's another puzzle My class it doesn't have anything in it. I have a function called message. All it does is it prints out pygotham 2016 I assign message to my class dot message. I create an instance of this class Does my class dot message work? No, it does object dot message work Yes, it does Let's try another example instead of assigning message After or before I create the instance. What if I sign it after I create the instance? I create an instance of this class then I assign message to the class itself after I've created it This still works, but does this work? No, it doesn't It's missing a method or it's missing an argument. There's a second one work. Yes, it does Lastly, I assign the message function onto the instance Does this work? No, it doesn't here's one Two more two more examples, and then we'll talk about why some of these work and why some of these don't work. I create a folder Called folder in that folder. I create a module mod a member I have two modules called mod dot py one in the folder from which this notebook is running and another one in this folder called folder Maybe I should have called this my folder, but I didn't I'll create this and it just writes a file Here in a separate Python interpreter, so I don't screw around with anything else to look I Append this folder path to my sys.path, and then I try and import message from my module Remember only the module that I just wrote has that message variable in it the one that I wrote a long time ago Didn't have that at all. It only had my my cosine function Does this work because? Python is going to look for that module when I try and import it Where is it? It's gonna look it's gonna look at sys.path the first part of sys.path is the current directory It's gonna go to the current directory. It's gonna find the module that I created in my previous example It's gonna say there's no message variable in that module, and it's gonna blow up on me So obviously cannot import name message if I and To show you why that is if I were to Import that module and look at where that module is located relative to my current directory It's in my current directory when I do that import It finds the mod.py in my current directory not that's the first place it's going to look So you could think if I do insert and I put that folder path at the very beginning of the path That'll be the first place. It'll look It'll find that module in the folder directory and then this should look So here I say the first place you should look is my folder That's probably a little bit more confusing than I thought it would be at 2 30 a.m. Last night because I didn't say I started working at 1 30, but I didn't say that I actually got that far dragging my feet This should work and it works as we expect the question is Does this work? I say path where brackets folder plus path instead of using the dot insert method I do this does this work? No, it doesn't. Oh, there's a type. It still doesn't work. Don't worry Here's another puzzle. I have a for loop in a class body. Can I do that? Is that okay? Is that moral? Is that in good taste? I'd say it's probably not in good taste the morality of it. Some people say code has no morality to it I don't believe that but I wouldn't say that this is a particularly odious piece of code But the question is does it work? Do I can have a for loop in a class body? Let's see what this for loop does well It iterates from the numbers from zero up to nine and it Amends this local variable it creates a local variable x underscore that number and sets it equal to that number times ten So if I say object dot x zero x one and x that give me the number zero ten and twenty. Does that actually work like that? Yes, it does. That's kind of weird Here's another question. Can I do it if else in a class body? Does that work? Here I say x equals ten if ten is greater than five Define message is this otherwise define message is this because there's that work Probably not something you want to do, but let's see Well ten is greater than five. So it prints out. I got them as awesome If I change this to one and reevaluate these two it prints out the other one. So that seems to work Why does that work? Lastly the last puzzle I want is tell me the difference between these two And anyone tell me the difference other than what they look like the difference between these two Structures from x import y printing y or import x and printing x dot y That's the last puzzle that we will answer in this session So the answer or the all of these and the key to thinking about how and why monkey patching works the way it does in Python is to remember that the Python interpreter is a very simple imperiper It's very straightforward if you look at a Python file and you execute in your mind the lines of code from the top to the bottom of The file you're doing almost exactly what the Python interpreter does Many variants with other languages like C or C++ or Java languages have a complex compiler step And first the compiler does some magic It produces some binary and in that binary you may not always be able to predict line by line What code is being executed? Python does not work in that fashion at least see Python does not It's some code and you can execute it in your mind line by line from top to bottom And that's very close to what the Python interpreter internally is doing. I Don't think we had a Introductory bytecode talk, but I've given introductory bytecode talks before but you can also you can often see the close Correspondence to actual lines of Python is to a very close Correspondence and that's done in order to keep the language simple in order to keep the language Flexible and in order to make some of the things that I'm going to show you here very easy to do where they're otherwise actually fairly Difficult to do in languages like C++ and Java So we know that the Python interpreter operates linearly from top to bottom It doesn't have a separate definition or declare step as you have in C C++ or Java a deaf statement of Python just says Figure out what codes under this create a code object Create a function object call it this name. What happens in a class body? It sees a class body It sees some code under the code under that class body looks at all the local variables that were created says these local variables are Attributes on that class and that's it. It's all that happens One question that is relevant and you should ask yourself is Does Python have a step that we could call compilation? Who thinks Python a couple people who thinks Python doesn't have a compilation step? Who's ready to go home right about now? Nobody that's good. So let's let's think about what that means Oftentimes when people talk about Interpreted versus compiled language Singuishing between is the way in which we use that language in a language like C or C++ or Java The way we use and develop in that language is different than in Python We often write some code. We subject it to Verification by a compiler we go for a coffee break we come back and then we run some tests and we see if that code works We're used to a very interactive method of inter of working with our code We write one line of code and we immediately interact with that. There's not that strict Difference that's not that strong line that stark line between writing the code and trying out the code You work in a more iterative Way you write a little bit here and you test it out You write a little bit more and you interact with your code live use that to find some bugs Incorporate that back into your script and then start the cycle over Python however does have a compilation step If we were to say Python had a compilation step We would say that it's the step which takes all of the source text that you write and Generates bytecode from it back almost nothing interesting or useful it catches almost no errors at the most It could catch some name errors, but it catches almost no errors unlike in a language like C or C++ or Java Where the compilation step can catch a certain class of errors? That compilation step does one thing which is it how to generate bytecode from source text and one interesting thing That it does in that process is it figures out where variables came from it sees the name of a variable that you're trying to Do something with an arithmetic expression or printing it out to the screen and it says was this a local variable? Was this a global variable did this variable come from a closure this variable came from and it emits special bytecodes in those cases We'll see this become relevant in just a few minutes The other thing I will tell you is that the Python come because even though Python doesn't have a compilation step one thing that we can think of and how we interact with our code is that time is Equivalent in many cases to a compilation step that is to say people who write code in Java or C++ are used to Running their code by a compiler Having the compiler tell them some things about whether the code is correct or not and using that to determine the production worthiness of their code in Python if you can add certain checks or certain constraints to the top level of a module when a module is imported the code is run from top to bottom linearly Well module import is actually something that you could do ahead of time You could take a code base and import all your modules see if they worked and any checks that you included at that top level that module Could be used and so module import time in many ways is very similar to compile time or a little bit closer to compile time For those of us who are used to that So let's take a look at a module. This is a little Python module and it has a variable called x it sets x equal to 10 If x is greater than 5 forms this class definition Otherwise it performs this class definition Most of us who are looking at this code say this makes pretty much this makes sense If since x is 10 we'll go down this branch and my class will be defined to this thing If x were less than 5 we define this and we look at this we'd say that just works That should work fact it works and does exactly what we expect if I say x equals 1 then the branch We enter as this branch here my class is defined to This version which has a different message function pi got them as fun So if I re-evaluate this cell and reveal re-evaluate this cell the behavior we see is exactly what we'd expect Take that exact same behavior and put it inside the class body Nothing changes just as that cell which is equivalent to a Python module in the Jupiter world Runs all the code from top to bottom and performs all of those definitions live the exact same thing happens inside the class body We run all the code from top to bottom and we perform the depth so the definition of this message function It's performed live based on the state of this x variable When this code runs, so when I run this It does exactly what you think and if I do a object message here And if I change what the x variable is it changes exactly in the fashion you think the if else From outside the class the inside the class But the way that we can think about how the interpreter moves through that code Is actually identity Before I talk about the next puzzle I want to discuss briefly what this locals function is Locals is a function that tells you all of your local variables all the variables that you have here Here's a simple python script that creates three variables x y and z I print out my locals and in my locals I should see x is here z is here and what and y is here And you can see that this locals function returns a dictionary mapping the names Of my variables values are Here's one quick question. Does this work if I amend this locals dictionary set x equal to 20 Does the value of x change when I print it out? Is that value reflected on this line? In fact, it is when python sees this code it sees all of its scope It has to answer in that compilation step. Where did x come from? What does it say? Well x came from my global scope Or it came from the variables that I have It came from my global scope and it emits a bytecode called probably low global I'd have to check the bytecode to tell you for certain, but it probably emits low global What it does that it'll actually reflect all the differences in this that you make to this locals dictionary Here if I were to just create this variable The python interpreter when trying to Produce bytecode from this code says I don't know where the x variable came from It's probably some local variable. I was introduced somewhere and it gets picked up from this Amendment from this mutation that I did to this local state. So both of these work exactly as you might expect However, if I take exactly the same code and I put it inside a function body It no longer works and I want to tell you why that happens. So here I set x equal to 10 I try to change and then I print out x x is still set to 10 Why did that work that way? Well, what happens is inside that function body python said where did this x variable came from? It's probably a local variable because I see it defined here It emits a special bytecode instruction called load fast This is done for performance reasons because these very rare to do in python Most code doesn't need to do this. There are other mechanisms to use. So they said it breaks that use case But that's not a very good use case When you load fast you look up that variable from a different place Then where you're amending it by changing this local dictionary The greatest step that I can go into with the time that I have allotted But if we have time for questions, I'd love to show you a little bit more about what the bytecodes are This is relevant However in our next example Here in this next example The python interpreter sees a variable called x. It has no idea where it seems. It's a global variable Here I try to create x as a local variable I get a name error. I can't find x even though this line said, oh, no added in there as a local variable Nope, the python interpreter cannot find an x variable and at the compilation step at the parsing step It gives me a name error We can see the behavior that occurs inside a class body is somewhat different The behavior inside a class body is very similar to what happens inside a module So we'd expect mutations to the locals variable to be just like they were Inside a module so we'd expect this to work if x is equal to 10 and then I amend it I mutated local dictionary. I should see that When I look at the x attribute on my class Similarly, if I were to create a brand new x in this scope, I should see it reflected here Let's go back to our example in this example I just create a bunch of variables called x underscore something and that's why this works Just as you might naively expect for some of these puzzles I feel like there's a Little valley between if you don't know anything you might look at this and say, of course it works And then as you learn a little bit more python, you say, well, I'm not sure And then when you learn a little bit more python, you say, of course it works A little bit nudged in that direction And that's the example to our or that's the answer for why this works Before I talk about the next puzzle, I want to briefly discuss with you Ids and objects and mutability and immutability Here I have a variable called x I used this id function earlier What is the id? It gives me a unique number for every object In c python, if I look at hex of id, it gives me the hexadecimal representation of that number This hexadecimal representation should trigger some memories for you Especially those of you who are c or c++ programmers This looks like a memory address In fact, the id of an object Standard doesn't guarantee this, but the id of an object is basically the memory address of that object So x is a variable that lives at this memory address In my running program Here I have x and I add one to x Notice change the one from c to e Why is that? Numbers like strings and tuples Are immutable in python. You can't change them in place Every time you perform an operation that changes a number by doubling it or adding one to it You actually allocate a brand new number And so the x variable here referring to 10 The x variable here just had its name reassigned But that 10 that little piece of memory there that stored the number 10 Is still sitting around the memory somewhere. Just nobody's referring to it. There's no variable that refers to it There's no name that refers to it That's why this id changes If I have a list however imputable we can change them in place You can see I create a list with three values. It has some id I append to that list. I add an element to the end of that list You can see The id does not change at all. I've mutated that list. I've changed it in place And if I look at that list and say it's the number four in inside Of course it is. I append it in the last line Let me try something a little bit funnier x and y are both names that are referred to the same list in memory One two three They have the exact same memory address because they both refer to the exact same list If I appended four to x you'd see four and y The numbers to x you'd see those in y as well because they're both referring to the exact same object If I do this line, I say x equals x plus square brackets four. What happens? In many cases in the python syntax Instead of changing something in place, especially with this arithmetic syntax this augmented assignments Instead of changing x in place what this says is create a brand new list by taking the elements of x putting four at the end and call that x y still refers to my original list x now refers to a brand new list that happens to be all the original context copied Plus a four at the end. But the idea of x is totally different than before What we'll see is if we add five to the end of x That five will not be inside of y because Y is the original list with the original id So look at If we take a look at our original question path dot insert What is this doing? The sys module has a variable called path The path variable is a list of strings those strings represents paths directories on your system Where you'll look for python modules and packages to import dot insert It takes the actual path variable the actual list that's used inside the interpreter That's used inside the import library And it'll add an element to the beginning but it'll mutate it in place So this should work If I say path equal square brackets folder plus path This will say in my module. I have a new variable called path That's equal to whatever was in sys dot path was something appended to it But the actual underlying sys dot path was never changed. So when I run this And I'll remove this code and I'll show you From sys import path And I'll show you from sys import path You can see there's no folder at the end What I might want to do and what you're encouraged to do is write this code like this sys dot path equals folder dot sys dot path here I'm actually changing The path list in the sys module it added folder at the beginning That's why that example didn't work And this is something that you'll see in a couple of different circumstances Here I have three functions that ostensibly do the same thing In the first one, I take some list called x and I call dot clear on it In the second one, I use a del operator and the third one I assign it to him if I run this code And I try with clear will it change the x variable that's outside of this function? Yes, x dot clear closed a clear method on the original object What about del del deletes all the contents of the original object? What about the assignment? Note to a variable called x in the local scope of this function and empty list So this will not reflect the change that I tried to perform inside my function The last set of puzzles can be answered by thinking about python in a in terms of a set of ad hoc protocols One thing that you're deeper into python and you look at the data model methods in python All those methods that have two underscores before and after and seem to conveniently Correspond to top level methods for len. There's underscore underscore len.  I don't like that word For repper you have repper what 200 for for the addition operator you have Addition of what 200 scores before and after I add and so forth and so on these protocols The two protocols that we'll talk about in the time that we have remaining are the get attribute protocol and the descriptor protocol Because they can answer a lot of the how for why monkey patching works the way Here I have two classes and an instance one class is called a the next class is called b and b derives from a a is the base class for b b is a derived class for a I have an object that is an instance of the class b I set an attribute on the instance itself.  I just added that there I added that information to the instance variable if I want to mention that's been added to an instance of a class I can look at the underscore dict item of the class And you can see this is all the information I've added just to the instance I could do the same thing With the class itself Oops And you can see I didn't really add anything interesting to this class Let's take a look at this example again here. I assigned message equals pygothem is fun to my base class Let me run that code and when I look at object dot message what happens Behind the scenes I invoke the get the get attribute protocol is actually fairly simple Now there's a little bit of complication when you look at underscore underscore get adder and underscore underscore get attribute We'll put that aside for the purposes of this talk What happens when I say object dot message? I first go to that I this line this piece of syntax is saying python And I want it on the object use the get attribute protocol to figure out how I get that variable out What does that protocol do it goes to the instance? It says instance Do you have a variable called message defined in your dict? If the instance does it'll give you that if the instance doesn't it'll say no, I don't check my class If the class has to turn that if the class doesn't have one It'll say check my base class and we'll keep checking until we hit the end and I'll show you where the end is So here that works fine. I pulled a message variable off of the class called a If I said b dot message equals pygothem has cool talks What'll happen when I say object dot instance? Do you have a variable called message? Nope, I still don't it'll ask its type b. Do you have a variable called instance? Yes, I do It was added on the line right above And so this will give you pygothem has cool talks including this one You might wonder what's the order in which the python interpreter looks for these things There was a talk given I think right before this session by one of the people sitting in this room amit on MRO the method resolution order I encourage you all if you're interested in this to look at his talk when it's posted to youtube The MRO tells you the order in which we look for these attributes So here if I'm looking for Something called msg on some instance I'll first look in the instance then I'll look at b then I'll look at a then I'll look at the end the top level object If top level object doesn't have it it'll emit a warning saying attribute error. No such attributes However, there is one complication. There is one additional protocol that intersects with interacts with this protocol It's called the descriptor protocol When the get attribute protocol? Moves past the instance and starts asking the classes up the chain. Do you have this attribute? So most I do And then I'll ask it one more question That second question will ask is does that thing you're about to give me back? Have a have a method on it with underscores before and after it called get or set or delete In this case, we'll only look at get And if that thing does have a get method it'll say don't give me the actual thing itself Call that get method with a couple of special parameters and give me what that returns I'll show you an example of that in practice Here I have a class it has two things inside of it a variable called message and a variable called descriptor Because this is the descriptor when I say object dot message. What happens? I ask the instance. Do you have this variable? The instance says no, I don't ask my class. I ask the class the class says I think I do it looks at what it has. It's just a string. It returns a string outright When I ask it for this descriptor attribute, what does it do? It says So I'll ask my class the class says do I have it? Yes, I do It'll pull that thing out and it would return this thing here Except that one extra step it takes is it says the thing I'm about to return Does that have a get method on it? Oh, it does So instead of returning that thing return what happens when you call that? And so what you'll see on this step is we'll we'll perform this print and we'll return Pygothon 2016 is awesome You may wonder how the Property decorator works in python. This is how the property decorator works in python When you ask for something that looks like an attribute instead behind the scenes you call some code This is done using implementation of the descriptor protocol Let's take a look at the id function. We looked at the very beginning of this talk The id function is written in c. It's part of the built-ins module. It is not a descriptor. It does not have this get method on it Let's look at the my id function that I wrote myself It's written right here. Does it have the get actually doesn't have a get method? Yes, it does In python 3 all functions are descriptors all functions have a get method on it What that means is if you put a function into a class And you look it up through the instance Instead of right you'll return something slightly different. You return whatever happens When whatever whatever's going to happen whatever is defined by this get Method and i'll tell you what that get method does Here's a simple class. It has one method in it called message If I do object dot message oops I get this I get what's called a bound method one of the nice things that python 3 did is it removed what was often of Very confusing and hard to describe Situation in python 2 with bounded on bound methods. There are no unbound methods in python 3. There's only unbound methods What's a bound method a bound method is just a very simple wrapper over a function And all it does is it says when you call me I'm going to call the function that i'm wrapping i'm going to pass in a self as that first parameter And that's all i'm going to do. That's how the self gets implicitly added whenever you do a function This is a bound method. It's bound to this object So this self that will be put in is this instance. It's is this instant called obj And that'll be passed in Let's see that in use but before we see that I want to show you something kind of weird Whenever you do a Attribute look and that attribute is actually a function and that function invokes its get its get descriptor protocol component It'll actually return a brand new bound method So if I say x equals object dot message and y equals object dot message They'll both be bound methods and they'll actually be different bound methods. There's I'm not sure why this is And there's there's some there's almost certainly a good reason behind it But this actually has very real implications if any of you are working with especially gui tool kits And you're trying to set up callbacks And those callbacks are trying to use instance at times when you set up callbacks They're added to what's called a weak dictionary a dictionary that does not make sure that the object stays Stays around as long as the callback stays around Otherwise nothing would ever be garbage collected Well, those instance methods have nothing referring to them and they're created fresh every time you do a data lookup Every time you do an attribute lookup So what you'll have or try and create callbacks on instance methods And they'll disappear the moment you add them in there. This is a real implication And there's some weird work around you have to do in order to make this work But let's get back to our puzzles. This was the very first puzzle I showed you My class id equals id and my id equals my id What did I say at the beginning when you have a class body you just you evaluate the lines line by line You see what was in a local what was in a local scope? What are all the variables are and you package those up so saying id equals id just says Here's a local variable id and it's assigned to the id function that we're all familiar with Here's a local variable called my id and it's assigned to this my id that I defined a couple lines above I created instance of My class id I look up the id attribute through the class the class says I have it immediately It spits it out What it spits out is the id function on molested and that id function only takes one argument obj So this works If I say my class dot what does it do it says I have it myself Spits it out i'm molested and this works If I say object that id what happens object the instance does not have An id attribute so it asks its class and that's remember when you start asking the class is when you start It asks the class. Do you have an id? Attribute the class says yes, I do The class says but before I give it to you. Let me just check. Does this id attribute have A descriptor is it a descriptor that have a get method on it? No, it doesn't because id is a c function and none of the c functions have descriptors have the descriptor so This just works this is just The id function that you know and love Return to you on molested However in this final case when we say object dot my id We ask object. Do you have a my id attribute? No, I don't let me ask my I'd ask the class the class is Yes, I do but before I give it to you. Let me check if it's a descriptor Well, it's a pure python function. So of course it's descriptor So I'm not going to return to you on molested. In fact, I'm going to wrap it as a bound method I get a bound method back I try and call that bound method with one argument bound method automatically inserts an extra argument for me self What happens here? I got two arguments when I expected only one and that's why this puzzle works the way it does Let's take a look at the next puzzle with the math module Well the same in the same case the math module is written in c the signed in c So exactly the same behavior occurs When you ask the class for the sign method you get it out on molested When you ask the class for the my cosine method you get it out on molested But when you ask the instance for the sign method You first check does this have the descriptor protocol? Yes or no No, what does it? So you get it out on molested when you ask for the my cosine method The class says hold on a second. This is the descriptor. I'm going to run this special get function before and I'm going to give you what that returns And you end up getting a bound method That's missing an argument Before we have a set of puzzles I want to show you a fairly simple example And I want to work through it line by line and I want I want you to see Something about in binding something that should hopefully be obvious in this code at the very top line I create a class called my class It has a single attribute and it called message and it's just a string pygotham is awesome I create an instance of that class object I say some message some variable called some message is equal to obj dot message You may have heard me use the term bind name binding Name binding is often how we refer to the process of creating a variable a name And saying what it refers to so I'm saying the some message variable Where first got returned when I looked up the message variable on the instance called obj I change What's inside that class I change my class dot message on this line Will some message be effect? Of course not I looked it up on this step and this step here Is too late according to the protocol on this line and any changes I make to the class aren't going to re-invoke the protocol This line doesn't say re-invoke the attribute lookup protocol It just says give me whatever the value is that was set before and no code is run It just spits out pygotham is awesome. This is distinct from if I wrote object This says invoke that protocol and give me the latest value, which will include the change I made on this line So then these two lines should be obvious or these two These two form formulations should be obvious and why they're different Let's assume that there are many lines of code separating the import state In the very first example, what do I do? I do an early binding I say give me the y attribute out of the x module as it exists right now And for the duration of my module, I will always use whatever that variable was set to As of the time when I imported it and I won't reflect any changes people have made To the y variable in the x module On the in the second example this line says something it says x dot y x dot y is a dotted lookup It says invoke the attribute protocol every time I print out x dot y I'm saying I'm going to go to the x module Give me what the value of y is invoke the protocol and maybe that might have changed somebody might have patched something Something might have swapped something out here. You'll in the very top You'll never reflect a change that was made after the fact after this import line to the things in the x module Here you're always looking up the live value And there's a distinction here This is why both of these syntax some cases you want one in some cases you want the other in many cases because very few actual modules in the standard library or on pi pi actually use this They usually have getters or setters at the module level for setting state But you can think these are actually two very different things to ask for and they're in meaning In between these two or distinguishing these two So let's take a look at two final examples Here I have an example where I'm going to take I'm going to show you some actual monkey patching I'm going to take the length function and I'm going to add 10 to it So when you ask me for the length of the string abc 3 I'll give you a 13 That's kind of weird and probably not something that would be very useful Now in order to make this work, I need to make sure that inside this my length function I can call the actual length function If I were to say my if I were to call len here And I were to overwrite what length was set to then I might use I might have some infinite recursion here Where I keep trying to call the same method. So what I do is I use some I use a closure in order to bind the value of len It's not that important for how that works, but you can see that it just works here This len function instead of returning 3 returns 13 What I'm going to do is I'm going to take that exact same into a module But because this kind of binding using the closure is a little bit obscure And it's not something I've covered in great depth in this talk I'll just rewrite this to be a little bit simpler I'll just say at the very top line the old length the original length function Is assigned to this variable called old len and that's what I'll call here and I'll just add And on this line, I say len and built ins dot len equals my len Now notice one thing that I didn't say explicitly, but every time I have a cell which has a Percent percent python on the top that's running in a brand new python interpreter And it's not reflecting any of the I've done in this notebook So here in this script in this standalone script. I import my module called len mod and I print out one two three I've overridden What the length function does To add 10 to every value and this just works This is an example of a not very useful but a fairly straightforward monkey patching in python You can monkey patch all of the built ins in python Anytime you call a function of python. It has to see where did that function come from Most of the time that's defined in the built ins module Some of the time you can patch those Historically before the introduction of things like import books Built-in functions like the import function in order to add custom ways to import code Like importing code when you have to go and download it from a url This kind of patching is not that useful. That's not that common But it does show you how it works and why it works one thing I would like to say is Well, actually I'll I'll show you the next example a more practical example of this is somebody has Written some code for you and instead of my class is now your class and they define a method on it called msg I don't like the way you wrote your code. I want to change. I want to change that class I have an instance somewhere in my program of the class that you wrote Let's think let's take a look at some ways that I can change this Using the same code as before Let's create my own function my message that says py got them is awesome And it has great. You're not enthusiastic enough for my purposes So I want to patch your class. How can I do it? Well, I can just say your class dot message equals my message I'm just swapping out one function for the other. I don't have to worry about bound or unbound methods This will work exactly the same way yours worked and now when I call object dot message called the one that I patched However, there's a qualification because you might not want to change The existing class because if there were 10 objects that were created as instances of that class You'd be changing all 10 of those You might only want to change in a one very small very narrow case in the case of only one instance Well here if I say object dot message equals my message what happens This seems to work But there's one there's one corner case and one important qualification Let's say I did something I used a cell variable. I said this is an instance method. I'm swapping out so it should look the same It should have a cell variable as well. When I do this patching I get an error not enough arguments. Why not? I patch this on the instance Remember the descriptor protocol Only kicks in to create a bound method once you move past the instance to the class Because we never move past the instance to look this up because the object itself in its dot dict Had this definition This doesn't work and I want to show you how this works and then we're done So one way you can do this is you can perform the binding yourself in the types module They're in type and you can just do the binding yourself So here I say object dot message is a bound method of the my message function Where the self parameter will be filled in with whatever object is and this just works And I want to show you one last way actually. I'll keep that on the screen for just one second Then the very final set of slides. I'll show you one last Here's your class. I create my own class And I swap out the classes at runtime. I say this object is not of your classes of my class And this just works, but if you want to find out why you have to come back to pi gotham 2017. Thank you so much I don't think we have any time for questions. So we'll probably take questions outside the room. I hope you enjoyed this talk