Here you one, and welcome to day two of the advent of code In Haskell So yesterday we had a lot of fun, right? We We were doing some depth measurements from for Santa so it wasn't code. It was some sliding window stuff And we got two stars which is not bad and And what I liked most is that, you know, we have a lot of active chatters. That was nice, right? And we had and We could like we really dug down into the core, right? We really looked underneath the hood of Of Ghtc in Haskell, right? And we really saw what was happening so Yeah, let's see what happens today Hey, you can see that I've got The calendar open where we left it yesterday. I haven't looked at today's exercise, but I've seen on I've seen on Twitter that there's some parsing involved, so That's gonna be fun All right, let's get to it. So we'll go back to advent of code and And Yeah, we got a new subscriber like One minute ago. Yeah jumbo Jumbo holiday. Good evening. Cool. I called it Yeah, I'm Icelandic It is the best country Right Alright, we got two chairs Hello, okay So, okay. Yeah, so I think the first one was like we were on a submarine and Then We found some depth stuff, okay now We are Let me zoom in a bit more Here we go. Now. Yeah, and now we are Doing the next step, right? So how to pile this thing seems like a submarine can take a serious commands like four to one down Two or up three So forward down or up. Okay, we're going down and upward report. So yeah, we're driving a submarine. Okay Down and up the vector depth and now so they have the opposite result of what you might accept Yeah, okay. Yeah, we would dive deeper. So we go. Yeah, that makes sense Okay, note that since you're on a submarine down. Yeah, okay Somebody's all day of land of course your personal input. You should probably figure out where it's good. For example Forward five down five forward eight up three down eight Forward two Your horizontal position and depth both start at zero the steps above would then modify them as follows Forward five adds five to your horizontal position a total of five down five Okay, after following these instructions you should have a horizontal position of 15 and a depth of 10 Multiplying, yeah Okay, that seems Seems pretty good So let's Get over now. I can see everything I have open. All right, this is from yesterday Let us make a new folder make dear day two and we Open that folder How we did we do control K and no Day two We're gonna open No, this is with that core we were doing yesterday. Okay. Hey Yeah, I have to connect again to the instance. That's fine. All right new file text file Module main where? You may need to make this bigger, right? It should be seen putster Okay, well see it detected it was Haskell But it suggests a Very bad name actually did two dot eight checks. Okay.  Let's just ignore those for now right, so let's Let's see what we did yesterday, right? for the parser and stuff They wanted a jazz What we did was we had this map reading every file, right So I think the first thing to notice today is that We don't actually so we just sum up the forwards, right? And then we go up and down up and down We don't actually need to We don't need the order right we just need to find out yeah, the sum of the forwards and then the sum of the downs and a Minus the sums of the ups, right? So let's say here Let's see GCI Yeah, okay now we're in the wrong territory actually go back They too Okay. Hey, let's make a new file and it's just called example pasted and We do a Example is going to be a list of strings And it's going to be a example is going to be lines over read file Example, okay, let's load this And see what happens they do that. Yes All right example All right, so we got the example Okay, now we're gonna parse it So we could write a proper parser here But that is too much work So we're just gonna say data instruction Okay, it's gonna be up And now yeah up in Well, let's have it in a different order forward int Down int up int Deriving eq or whatever Okay, and now we are going to write a parser that takes a string Instruction a parse Okay parse in the stir So parse in stir so, you know, we could write a proper parser here with like blah blah. Yeah, but a That is just a lot of stuff, right? So what I'm gonna do is I'm gonna just cheat. I am going to say in And say a Take so if it starts with forward Hmm Now actually it's let's do the let's write a proper parser And read we're gonna write a read parser. We're not gonna install parsec 3p Haskell Because they are pretty nice actually the read P It's in base, right? So we don't We don't need to install any packs. I mean, it's a bit slower than these parsecs micro parsec all those but this is Nice, right? So we actually say here import text that parser Combinators that parse know read be right. Yeah, I have some packages installed because I was doing some experiments Hey, Janet in welcome back to the stream He's been with us since day one Right now so read instance Yes mega parsec is better but It means you have to You actually have to It's more I so I like this because you can just say read P2S Which turns it into a reads parser? And that's exactly the instance of read, right? So I can say here reads preck or read preck, right? So we can we can actually do this right Let's see. So this is going to be parser read P of instruction parser equals Okay, and then instance read Instruction where reads preck Don't care about the We don't actually care about the The yeah, we're not gonna care about the presidents. I mean it matters later when you know, we're doing actual health draw stuff But as we know, there's only one instruction per line. We're not gonna care about it. So we are gonna say const and Then read P2S Which is nice read P to Instur parser, okay now we just have to write our Instur parser and then We our you know Instur Goes to file path to list instruction is just Instur's equals map read at Instruction Dot lines over we are clicking to like this fmap this Start read file and now it's complaining that yes, we don't have type applications All right, I Think it was a strong choice for the first Yeah, you're the one that they are using the there's an AOC 2012 Hey little Annie She was here last year as well Even longer than janitin. Oh, so there's a like a a racket thing that allows you to submit AOC 2021 solutions So there's a tweet about it right and if you say no it calls you a coward And I kind of assume will boom and wrote to that but yeah All right, we're drinking chai today, but wait, you know why? Because it has a Cardamom right so it It's a super Christmassy drink And it's a new moving up. It's got moving papa. I like it. It's a different one from yesterday Try to figure out how many moon cups I have from this room. All right back to parser Cardamom is good. No Okay, so Right, how do we write this? So yeah, so we have so we have a choice. Okay. Yeah Yeah, so I always forget how we do this so we have No, we have like a pf It's gonna be this is going to be okay, so two parts. Okay, so we're gonna take the parts one dream Okay, so what we're gonna do is that we're gonna have a Okay Parts one string. Okay, so this is gonna be a choice of a map R's one over Like forward Up and then this one is undefined Okay, a a Masala Jai is good. Okay. Now type of R's one is done one It's gonna be a string to read the instruction Okay, so I forget how we How do we change it again? So I think it's like because it's a monad, right? So I think it's So we let's just do like this we do and we do Let's actually make it a bit clearer import qualified text dot parser company Combinators P Okay, so we do a parse dot string stir and we ignore the output Okay, and Yeah, it's complaining that We're not finished right and then we skip spaces and then we We parse an int right and to parse an int We can we can you can use a reads track so we can do Reads track at int And we just give it some whatever Now this is gonna be read s right so we do read s to read Read s to P Right, it was at read s to break. Okay, so then we Now we do the string again, right? So we do case stir of if we got a forward We're returning forward of num, right if we got up we return up up of num and if we got a Down We return so this one should do something That's actually just Move it like this And these are wrong now. We reload. Okay, parse one All right. Hey, so we also need show here actually show And then we need to reload and then so we want to parse one up five Now actually we want to say read add instruction Up five set x type applications. Nice. See It just works Because we stole the parser from hints. We can just Do whatever what is there a read s to P? Read s to Prak what's called read s To okay, it just does It just does the same Okay, doesn't matter So now we can parse one. So let's say a Instance Example right, sorry Okay, so this is our input Forward down forward Yeah, it makes sense all right, and of course we could have just We could have just manually put it in right but Yeah, this is more fun. Okay. So now we have instructions and what were we going to do right?  They're not equal, of course hmm Now we need to kind of group them by the So we sorted them right so now we want to grab all the forwards. Let's just do that, right? So Let's define his word because now it's kind of like a Trinary thing right something like that. So is forward is going to take an Instruction and it's going to take As kind of a pool right and is Let's actually do it a different way, right? We just say from forward and we go to maybe in So this one I'm gonna be forward Is equal to just From forward He goes nothing if there's something else Then we copy paste these and we see you know Forward up These and we say up down Yes, up down Okay, and so I mean so what we could do is like we can make sure yeah We only walk the list once blah blah blah, but that doesn't really matter So we're just gonna We're gonna have so we're gonna have the the sum of the forwards is gonna be some dollar map may be from Forward right Yeah, okay import data dot maybe so the sum of the forwards is 15 So, okay, let's just do the problem right so task one is going to take file path And it's gonna return IO hint The task one Equals, okay, so we first Get the instructions so ice is going to be instors Of the FB Okay, then we're going to say a for some Let for some equals Some map maybe from forward Yes, and then we have Up some which is gonna be from Up and then we have down some We'd like to get down some With from down And of course here we are Walking the list three times which is not the best but And we also could make it like a set or whatever but Let's actually do that right. Let's just say it's fours. It's ups and Downs and then we just do the sum later. Okay, so For some it's going to be some of fours and So we add the ups and we subtract it down so it's gonna be With what it what is it called can horizontal Okay, so it's called a horrors Gonna be some of the fours And depth is gonna be the sum of downs minus sum of ups and then we Return a horrors time depth and yeah, we have to import data dot Maybe nice Okay, and this is dip What's wrong with this? There was nothing wrong. Yeah, we don't need this bracket. Okay now Let's load it and let's just call Main is do Task one Example Into print okay, so we do are and then we just run main and we get 150 which is what we expect Okay Exactly, so we get our puzzle input copy paste it Save it Okay, and we are going to say input And let's run it 1670340, let's check if that's correct All right first one done That was too hard And it was very fast, right? We didn't even I mean we didn't even have to wait for it to compute It just kind of happened when I pressed enter Let's see if the so sometimes like you do these things right and that and you make the second one super easy because of how you did the first one But sometimes it's the opposite right you are oh Yeah, okay Based on yeah, so let's hope our our way to doing it Wasn't too bad basic calculations the plan course doesn't seem to make any sense You find the summary manual and discover that the process is actually slightly more complicated In addition to horizontal pressures unit a man and you also need to track turn value aim, which also starts At zero the commands also means something entirely different than your first thought Down increases your aim and up decreases your aim It decreases your depth by your aim multiplied by X Okay, so five Okay, yeah, so down five. Okay, so forward eight Pass eight to your horizontal position a total of 13. Yeah, because your aim is five, right? So you're so we have now we have to now we can't just sort them and do it, right? All right, let's say let's get to it so task two takes in a File path and IO int ask to Fp do is This is the same insters Fp now we're gonna say a Return process Is so the process is going to be it's gonna kind of take in the depth aim and And is okay, so where process and the depth okay, so it's actually depth aim Is okay, so it's actually zero and zero So if we're on the empty list we just return depth times All right, so we need to actually have our depth and aim and for us It all starts at zero and depth and we could multiply that for hours This is just a depth times horrors Okay, we don't do anything there now. Okay process depth aim Okay, if the current instruction is Let's just do the up and down because that only changes the aim So we have up and rest that's equal to process Depth depth minus and aim Okay, so it doesn't actually change the depth right It just changes the aim and let's say minus end here and For down it's gonna be Plus right Let's aim plus now What happened for forward then our depth? That's two changes. Okay, so the horizontal position It's gonna change by and horrors plus and and our Aim stays the same But the depth is gonna be depth Plus aim Times and right so what is it complaining about? process, this is supposed to be an int to int to int to Instructions instruction to it Right. Oh, yeah. Oh, yeah, and I have to Pass the reds here. Exactly. It's not too bad, right? It's just a I mean, we're essentially just writing a very basic right after we brought a parser and Doesn't seem too bad Let's see Now, let's do task two on example That was 900, which is the same as here Let's do task two on the input Very fast again, and we get something. Let's see if it's correct All right That was quick and easy Yeah So I got them both quite fast I don't know what to say. I mean, there were no tricks really Well, this is these were just straightforward And Yeah, I mean so like you need to know about these parsing things But the not really nice thing about Haskell is that you look you have all the monads and applicatives and all that stuff, right? So parsing just it's it's just a monad, right? So you have all these parsing functions, but because the repeat is actually a monad you could just use do right? So we just here we just kind of parse the string Right, and then so as we just so we're we're looking at one string, right? We say parse string We say a skip spaces and then we read the number, right? And okay these reads practice It's actually gonna be Yes, so So actually we can we we don't even need to ignore this, right? We can just say Now okay, we actually need the Presidents there But let me see we can do it here, right? You can't ignore it at this point So we just say like this Okay, and then we ignore the int, but we could probably Kind of parse it here, but we we have only one per line, right? So let's see how fast it is Yeah, okay. No, yes, we do task two on input. Okay now. Let's close it a GCO 3 They do that HS D dump simple. Let's just dump the code right away, right? Yo, what I wanted a D dump file. What did we say against today again? bash history grab D dump D dump to file to file and we need to change the flag so that it actually compiles it right now let's run it again and Let's just see how fast it takes day two Yeah, okay, so 10 milliseconds that's not bad That's not bad at all Look at the file and we generated what happens But so here's all our parsing stuff, right? So we have the forward. It's all like strings Read instruction. Okay. Let's see far as one string So it's it's just checking the EQ strings, right? What's one is this? So this one is read instruction 17. Yeah, exactly. So you can see that a Like the parser turns out to be You know, it's literally just checking like is the is it equal to the right string and then we Okay, so we if we have an empty list we do this otherwise if we have What does this mean like a string concatenated to? It may be like the first character So we end up with like main forward. Okay, and it So it checks right it checks if it's equal to the string And then it gets goes up or forward or down And then it keeps going So I'm guessing that this Kind of is the front of the entire list, but how does it know like the length? I'm not sure about that, right? Okay, so this is the Go go function So this is like the Okay, so this is like after we've kind of broken it up Yeah, so this is the thing right like once you start using these libraries. I Mean it's a bit hard to read all this, right? Will you skip spaces? Yeah, I It's I can't really explain what's going on here. Let's check right What happens If we don't have o3 that just oh right so it doesn't do all the super optimization stuff We have to close this and we open it again Okay, it actually doesn't It actually doesn't change that much It still has this base ecu string And it's just checking that This vs3x is equal to the string. Okay. Yeah, okay. So this is a function that actually grabs the string And then it checks that the string is equal to The thing right so what I don't understand is like parse one Like this is a string like what where where does the parse one get this string from right? So here we have another parse one And here it's still being passed this string. So this one is Okay, wait. So here it might be right. No, this is just making it at the right type. This is just a type Where is this invoked? parse one, um Okay, I guess this is just the top level function. Maybe there's something more here parse one is main equals parse one. Yeah, okay Now let's see But if we kind of at this point we kind of already have the String right it's already kind of split up So this is read instruction 11 That is the original string. Oh, right. Sorry. This is not the string that we split on This is actually the yeah that like that as a forward or off. Yeah, like the original one so This is just the string That's doing this right But this parse string here, that's something else Let's see. Sorry. Yeah, that was Not as mysterious So that's why we just check the string Okay, but how do how does we do the actual thing? Read instruction 13 Um, I think it tries to parse Yeah, okay, I think it just calls some of the read stuff. Yeah, all right Not so much happening today actually not as much as yesterday Um, it's just harder to diagnose There is less going on in chat this People more excited the last yesterday, I guess right it was more of a oh, that would have code is starting Now it's just more of a okay. What is this? Anyway, I think we solved it quite nicely. I mean we kind of avoid doing the iteration here But here we actually need to do the iteration because it matters like in which order we do it Um, and we can probably I could probably do it faster, but like, you know, this took No time at all Uh, so I think we're just gonna be pretty happy with right. Let me actually Add a git here It add day one star dot It just gets status It commit um, and let's throw up the code, right? We might as well Have it up there. Uh Now you'll be able to see all my private repos But that's okay near repository 100 off code Go 2020 is already exist Yes, okay create repository Get remote add Get add github Dot com Days one and two Get push Get push set upstream origin master All right, then the additive code code Oh, wow, it's slow That's not Oh, okay It's not git pub Git remove Here we go Now it's up there And you can check it out I'll add a Let me add a license actually Add file license Choose a license template my t Good stuff Commit new file. No, I didn't want to commit a branch That was a lot of buttons for one file And I want to create doc git ignore And we were going to use Haskell All right, now we committed directly. Yes Good stuff All right, now it's licensed and all Not bad um Yeah, all right So thank you for today. Uh Wasn't sure long this time, but uh will be longer Uh In the coming days, I mean it gets harder and harder This was just I think it was particularly easy because it's so easy to parse in Haskell, right? So Haskell was a good choice for this one. Um, I won't be streaming tomorrow. Uh, I'm getting with it from mom All the way from Norway And uh, yeah, we're gonna go to a amusement park I mean you have to receive, uh Mom, right, you cannot You can't tell they're like, no mom. I got my string So we're gonna do a double feature on saturday instead um Or we do day Three and day four at the same time Hopefully they're not super hard And uh, yeah, and then Thanks little Annie It'll be super nice. All right, and then I'll upload day one To the youtube channel like I did last year, right? So we'll have all of them there Uh, so if people want to you know, check out some Haskell coding It's gonna be good stuff all right Thanks again for today and Catch you saturday I'll I'll put it up on my twitter like tritlow on twitter This is a links like below the channel where you can see uh Yeah, my my twitter and that's where I put all my links and stuff and Tomorrow Uh, let's see time is So I'm gonna I'll I'll probably know on saturday. Yeah next stream. I'll know if my paper got in But it's anywhere on earth on december 3rd Which means that it's not gonna be uh for another 18 hours at least But yeah, thanks for showing up today, uh, and uh See you. Hopefully. Yeah, so just Before we leave, right. Are there any questions? Do you think This went well or Also like feedback on the stream, right? So now I have the christmas music and I think this is a fine setup, right? You know, you can you can see me you can hear me well um I think there was an issue with a vod yesterday actually because I had it set up so that it wouldn't um, it wouldn't Like the christmas music wasn't allowed to be there Right, so I would upload it but without the music channel Which is good if you're streaming, you know copyrighted music um But what I'm listening to is called stream beats And they are like copyright free Lo-fi christmas music that's super nice to have for these streams, right? And they have like a huge election, so Uh, I like them. Uh, they're not sponsoring me I just like them use them for your stream. It's nicer with music, right? All right, thanks again for today and catch you Saturday. All right. Bye


Hello everybody here welcome back to Thursday there's today. We are talking about the second Bachman book The long walk and no I did not already do this one cowboy I did a spoiler-free review for this one In fact if you guys want to go over there and check it out There is a dude down in the comments who has some Some awesome Research down there He proved me wrong on several accounts as far as who died if more than one person died if one person died twice The dude is awesome Go check out the comments on my spoiler-free long walk video The dude done his research and I have a hell of a lot of respect for him for going as deep as he did into that So in fact, I'll leave a link down there in the dooby-doo so you guys can you know easily go on Let's finish this video first. Um the long walk not one of my favorite Stephen King books It's kind of meh on my end, and I know a lot of people disagree with that. I'm cool with that I'm fine with you guys loving it I'm fine with the people who who hate it who don't see any point in it whatsoever me I'm just kind of on the fence, you know like 2.5 stars is what I'm feeling both times I've read it. It just kind of it doesn't do anything for me and I find myself Disliking it so much that I I look for problems with it, and I usually don't do that with the Stephen King book I just kind of let it be what it is. I will say this is one of the harder Stephen King slash Richard Bachman books to Connect to the dark tower, but I have several threads several cords I want to pluck and see if they resonate with you So the first one is there's a mention of a Mrs. Petrie in here And of course, there's a character and his family and Mark Petrie in Salem's lot Now, yes, this book does occur in the future, but how far in the future? I believe Salem's lot came out in 75 this book came out in 79 If I'm wrong leave your comments down there in the doobly-doo, but King wrote this book Before he wrote Salem's lot. He wrote this. He started writing it in 66 67 Who knows if Mrs. Petrie was in there at that point in time? I don't know for I certainly don't know What I am wondering is maybe if it's not too far in the future maybe that Mrs. Petrie is the same Mrs. Petrie or a relative of the Petrie in Salem's lot maybe Mark's daughter or Farther along maybe that's why the world is the way it is because of the vampire apocalypse You know that kind of thing who knows but there's a Petrie in there now as far as a hard connect Of course, there's no hard connect to a to a Bachman book But the main character's name Raymond Davis garrity does have 19 letters in it. There is another way I can possibly kind of Connect it for getting both. Well, let's keep the number 19 there. That's that's a really good connect But let's go even farther. Let's get into whacked out territory. How about the long walk is kind of the proto Running man the prototype for the running man and this is this happens Let's say yeah, it doesn't matter. Let's say it happens in the 90s or whenever it occurs I don't believe to the dude that watched the other one and left all the comments down there I think your name's Josh Justin something. I don't know. I can't remember. I apologize But let me know if you know the exact time frame that the long walk happens. Let me know down there in the comments, but Let's say that the running man is the evolution of the long walk and so televised murder televised live The competitions where death is a real possibility Let's say that has evolved over the years from the long walk into shows like the running man Now if that's the case, I can tie the running man into the dark tower There is a hard connect to that one But we'll get to that when we actually read the running man If you guys know I want to see your comments down there in the doobly-doo Please tell people it's spoilers if you want to But there is a definite hard connect to the Stephen King universe in the running man Roadwork is going to be a lot of fun, but that won't be until farther along in the series right toward the end right before we jump into the um The talisman the dark the black house and the overall dark tower series itself So have you read the long walk? What did you think did I miss anything? You might have caught that's a big one. I enjoyed doing this Did I leave something out for you guys to mention? Who knows? Let me know down there in the comments below if you found anything that ties it to either the Stephen King universe or the dark tower Universe, but until next time I have been a you have been you this been another Thursday theorist review I'll talk to you guys later. Bye. Bye


Hello all. Today's topic is on improvisation and demonstration of Linux thermal framework for multiple temperature sensors. I am Aditya K.V. and my co-author is Tausif Nomani. We work at Samsung Semiconductor India R&D. So this is the agenda for today's presentation. First we will try to understand what is the need of thermal management unit. Then we will have an overview and internal look of thermal management unit. Then we will have overview on Linux thermal framework. Then let us try to understand how thermal management is done in Linux kernel. Then let us see what are some of the important structures and functions in Linux thermal framework. Let us walk through on pseudocode of conventional TMU driver. Let us have a demo of interface from user space for thermal framework. Let us try to see how TMU in complex SOC looks. Then let us try to understand what is the limitation in conventional TMU driver for TMU in complex SOCs. Let us have a walkthrough on pseudocode of complex SOC TMU driver. Then let us see what is the scope for improvement in thermal framework and how it can be implemented. Let us see what is the need of thermal management unit. In an SOC it can have different blocks. When there is high computation or high frequency operation going on in certain block, the temperature of that block increases. For example, in this picture we can see the memory blocks are cooler comparatively to GPU blocks and GPU blocks are cooler comparing to the CPU blocks. The temperature is high on computational blocks. What happens if temperature of SOC increases? SOC can perform poorly if the temperature is high. SOC can malfunction or if the limit is crossed, the SOC can get permanently damaged. So what is the solution for high temperature in SOC? In Linux thermal framework we have terminologies like thermal throttling, thermal cooling and thermal tripping. Let us look on each solutions. Thermal throttling means reducing the clock speed of that block. So the block will be operating in the limited performance. So the heat doesn't build up in that block. What is thermal cooling? Any device which cools the block is called cooling device. For example, a fan can be a cooling device. Thermal tripping. Thermal tripping means when the temperature of SOC crosses its limit, then it can cause permanently damage. To avoid this, we can switch off the power supply to SOC by informing PMU or by controlling voltage regulator. So thermal throttling, thermal cooling and thermal tripping, these three solutions can be provided by thermal management unit. Let's have a look on internal of TMU. TMU have a controller and a temperature sensor integrated within it. TMU can be placed in any block of SOC where temperature need to be monitored. TMU controller configures the temperature sensor and initiate temperature sensor to sense the temperature. There are different threshold levels in the controller. When the sense temperature processes the threshold level, controller generates interrupt. There are separate threshold levels as well as separate interrupts for thermal throttling and thermal tripping. Most of the vendors nowadays also provide support for emulation mode. When the user inputs is emulated temperature, controller instead of taking temperature from the temperature sensor takes the emulated temperature. This emulation temperature is mainly used for debugging as well as to verify the future of TMU. In a real environment, if we cannot simulate certain temperature, we can emulate this temperature using emulation mode. Let's look on Linux thermal framework. Any TMU or temperature sensor are called as thermal zone devices. And any devices related to cooling such as fan are called cooling devices. Linux thermal framework exposes these cooling devices and thermal zone devices to the user space. In order to expose these to user space, these devices has to be registered with thermal framework. Once these devices registered to thermal framework, it becomes part of thermal management. Once these devices exposed to the user space and user space application can take decisions based on the current temperature rate from devices as well as based on threshold temperatures. Now let's see how thermal management is done in Linux kernel. Temperatures will be read from temperature sensors and it will be compared with threshold. If temperature is less than threshold, after some delay, again temperature will be read. If the temperature is greater than threshold, it means associate temperature has been increased. So now cooling devices will be switched on. Once the cooling devices are switched on, again current temperatures are read. And this current temperature is compared with the desired temperature. This is to see if associate has cooled on or not. Once the current temperature has reached desired temperature, then cooling devices will be switched off. And this cycle repeats. The switching on and off of cooling devices is done basically to save power. This is how thermal management works. Now let's look on some of the important structures and functions used in thermal framework. Structure thermal zone device ops. This structure need to be initialized before thermal zone register functions are called. Let's have a look on important function pointers inside this structure. Bind. This binds thermal zone devices and thermal cooling devices. Unbind. This unbinds thermal zone devices and thermal cooling devices. Get temperature. This function reads temperature from temperature sensor and displays it to the user space. Set trips. This set the trip window for current temperature. Change mode. Thermal management can be done from kernel or some user space application. To switch thermal management between kernel and user space, change mode is used. Get trip type. This gives what kind of trip temperature it is. Trip temperature. Get and set. This sets the trip temperature and it reads the trip temperature. Trip hysteresis. Get and set. This trip hysteresis is used to calculate the minimum change required to trigger the trip trip interrupt. And set emulation temperature. This enables and set emulated temperature. Structure thermal zone of device ops. This off device ops is used when we fetch thermal zone from device tree based on device nodes. This is very similar to the structure we used in the previous slide. Let's have a look on function pointers inside this device ops. Get temperature reads temperature from the sensor. Get trend. This function calculates the rate of change of temperature. Set trip. This sets the trip temperature window for current temperature. This set email temp sets the emulation temperature and enables the emulation mode. Set trip temp. This changes the trip temperature threshold. Let's have a look on struct thermal cooling device ops. This cooling device of structure need to be initialized before cooling devices are registered. Let's see some of important function pointers inside this structure. Suppose if a cooling device is spanned and has three states low mid and high, then get maximum state gives the maximum state possible. Get current state use the current state of the cooling device. Set current state sets the current state of the device. Get requested power. This calculates the power requested by cooling device. State to power. This function calculates the power consumption based on the cooling device state. Power to state. This calculates the state of the cooling device based on the power consumption. Now let us see some of the important functions used in thermal management. Thermal zone device register. This function adds new thermal zones in the folder sys class thermal. When this function is called it also binds cooling devices which were already registered or which is registered at the same time. Thermal zone device and register need to be called if the particular thermal zone is not needed anymore. Let's see some of the parameters which need to pass when we call thermal zone device registered function. Type. This is actually the name of thermal zone. This gives what type of thermal zone it is. Trips. This indicates how many trip points are there for thermal zone. Mask. This represents whether the trip points are writable or not. This is the device data pointer. This thermal zone device ops. This structure we have already discussed in the previous slide. Thermal zone parameter. This pointer will be used for device callbacks. Passive delay and polling delay. Passive delay is the delay to wait between poles when performing the cooling action. And polling delay is the delay to wait between the poles when checking whether the current temperature has crossed threshold temperature or not. Similar to the last function thermal zone of sensor registered function registers the thermal zone based on device trees. Upon calling thermal zone of sensor registered function, it will search thermal zone in the device tree and adds the new sensor to the thermal zone. Let's see what are the parameters inside these functions. Dev. This is the device node of the sensor. Sensor ID. This is sensor identifier. When an IP has more than one number of sensors, we need to pass this sensor ID. Data. This is a private pointer that will be passed back when temperature is red. Thermal zone of device ops. We have already discussed about this structure in the previous slides. Thermal cooling device register. This function registers the cooling device and exposes the cooling device to the user space in the folder sys plus thermal as cooling device. This function also checks and binds the thermal zone. The function parameters are typed. This is the name of cooling device. This Dev data is device private data. Thermal cooling device ops. We have discussed about this structure in the previous slides. Now let us have a look on how thermal zones are exposed to the user space. Upon system boot, TMU driver will be proved. These device ops structures need to be initialized to the respective functions of respective drivers. Once these device ops are initialized, then these ops need to be passed to register thermal zone. Upon calling register thermal zone, thermal zones will be created in the file system. User can give command to read temperature from thermal zone. Once the user give the command, temperature will be displayed to the user. Now let us have look on sudo code of conventional TMU driver. In conventional TMU driver, we need to define thermal zone device ops and initialize get temperature function pointer to the driver specific function which read temperature from the sensor. And during the driver proof function, call thermal zone device register function. To this function, pass the device opt structure which is already initialized. Upon doing this, thermal zone will be registered and will be exposed to the user space. Driver might have a function to initialize the thermal zones also. In this kind of approach, we can see probing of TMU driver happen multiple times. For each instances of TMU probe will happen separately and multiple instances of TMU driver will happen. With this kind of approach, little bit of additional memory and time to probe will be consumed. Now let's see how get temperature and set emulation actually work. Inside folder sys class thermal, we can see all thermal zones which are already registered. If you see inside thermal zone, we will see number of files. Here temp is actual representation of get temperature function. If we try to read them, then temperature will be displayed to user in relations sys. Instead of giving the numerical value of thermal zone, if we give a question mark, temperature of all thermal zones will be displayed to the user. Now we know how to read all temperature from all thermal zones. Let's see how set emulation function actually work. Inside sys class thermal zone, emulation temp, this is one of the file. Now here, I am trying to write 1000 millicentures to the file emulation temp. This inter internally called the function set emulation and enables the emulation mode. So here I am writing value 1000 millicentures to the thermal zone 0, 1 and 2. After that, I'm trying to read all thermal zones. We have five thermal zones in this demo. So upon reading all thermal zones, I see for thermal zone 0, 1 and 2 as 1000 millicentures. This is because I have set emulation temperature as 1000 millicentures. For remaining thermal zones, thermal zone 3 and thermal zone 4, the temperature is actually from sensors. Let's see what are policies. If we see inside folder sys class thermal thermal zone, we can see policy and available policies. What are these policies? These policies are actually thermal governor to manage overall thermal functionality. If we try to see what are available policies, we can see power allocator and stepwise. Power allocator policy is actually closed loop control. This is based on power budget, temperature and current power consumption. Power allocator kind of thermal governor implements PID controller with temperature as controlled input and power as controlled output. We can also see K underscore D, K underscore I, K underscore P O, K underscore P U. These are actually constants for PID controller. We can also see integral cutoff. When cooling device can't bring temperature to the exact value governor has requested, the maximum allowed offset is represented by integral cutoff. Now let's see what is stepwise thermal governor. This is actually open loop control. This is based on temperature threshold and rate of change of temperature. This kind of thermal governor actually walks through each cooling state of each cooling device. We can also see what kind of thermal governor is currently being used. If we try to read what is policy, we can see stepwise. So in this example, thermal governor is used is stepwise. Now let us see what are trip points. Trip points are actually threshold levels, which we have already discussed in earlier slides. If we see inside folder sys class thermal thermal zone, we can see trip point hysteresis trip point temperature and trip point type. There are zero to seven threshold levels in this example. Based on these threshold levels or trip points, governor will switch on the cooling device and operate the cooling device in different states. If we try to see what type of trip point it is, we can see passive and critical. Zero to six are passive threshold levels or trip points. And seventh is critical trip point, which means upon reaching the current temperature to this critical temperature, power to associate should be shut off. We can also try to see what is the current threshold level set for each trip point. It will be displayed to the user in mini Celsius range. We can also try to see what is the hysteresis value for each threshold level or trip point. Hysteresis is minimum change needed for thermal governor to take the next action. We can see for zero to six points, thousand militias is the hysteresis value. Where for critical trip point zero is the hysteresis value, which means when the temperature reaches the critical temperature, then thermal governor should not wait for any change in the temperature.  Now, let us see what is mode and type for each thermal zone. Mode is current mode of thermal zone. If we try to read mode of any thermal zone, we can see either it is enabled or disabled. Enabled means thermal management is done by kernel. Disabled means thermal management is not done by kernel, but from an user space application. We can also try to see what type of thermal zone it is. Type is actually the name of thermal zone. In this demo, we can see thermal zone zero, one, two, three are actually CPU block temperature. And thermal zone four is GPU block temperature. With this mode and type parameter, we can also try to understand that thermal management for CPU blocks is enabled, which means thermal management for CPU block is handled by kernel. Whereas for GPU block, it is disabled, which means thermal management for GPU block is handled by user space application. Now, let's have a look on how TMU looks in complex associates. TMU in complex associate will have remote sensor interface in additional to the conventional TMU. entire associate can have single TMU controller. And if any other blocks, temperature need to be monitored, then only remote sensor need to be placed in that block. This remote sensors will be connected to main TMU via remote sensor interface. By this kind of approach, size and cost can be reduced. Now, let us see what is the limitation in conventional TMU driver? Why can't we use same conventional TMU driver for complex TMUs? In complex TMUs, TMU main sensor and all remote sensors are represented as a single unit. Remote sensors are connected to controller via remote sensor interface only. If we if we try to register using conventional TMU driver, then only main sensor will be exposed to the user space. The remote sensors cannot be registered with the conventional approach and it cannot be exposed to the user space and user cannot treat temperature from the remote sensors. So what is the solution to register TMUs in complex associates? So what the approach we can take is define thermal zone device of structures separately for all sensors and initialize get temperature function pointer to respective functions, which reads temperature sensor that to separately. In the probe function call thermal zone device registers multiple times and pass this device of structures respectively. By doing this, all the remote sensors will be part of thermal framework and will be exposed to the user space. By this approach, TMU driver probe happen only once. Now we know that thermal zone device register function registers a thermal zone. Let's see how it is done. When this function is called it internally, it sets passive and cooling delays. Then it sets trip parameters like type, temperature and hysteresis. Then it binds the cooling devices with the respective thermal zones. Then it initializes the thermal governor. And finally, thermal zone will be created. The current existing thermal zone device register function. It can register only one thermal zone. There can be a scope for improvisation in this function, but this function can register main sensor and all remote sensor in a single call. If we have this kind of improvisation, then this function need to be called only once. There is also a scope to have a map which shows the relation between main sensor and all connected remote sensor. If we have that kind of map, then we can it will be easy to understand which remote sensor is controlled by which main sensor. By this we have reached end of slides. I hope this presentation was useful for all those who use Linux thermal framework. If you have any questions, please feel free to put your questions in text chat. Thank you.


My national security staff and defense staff has been in constant contact with their counterparts in the Middle East, not just with the Israelis, but also with everyone from the Egyptians or the Saudis to the Emiratis, et cetera. And I had a conversation with Bibi Netanyahu not too long ago. I'll be putting out a statement very shortly on that. My expectation and hope is that this will be closing down sooner than later. But Israel has a right to defend itself when you have thousands of rockets flying into your territory. But I had a conversation for a while with the Prime Minister of Israel. And I think that my hope is that we'll see this coming to conclusions sooner than later. That was President Joe Biden's predictably terrible response to Israel's war crimes against the Palestinian people. Simply put, Israel has the right to defend itself. End of story. Yeah, I'm wondering what he thinks about whether or not Palestinians have the right to defend themselves. Because they're the ones currently being forcibly removed from their homes in the East Jerusalem city of Sheikh Jarrah. Do they ever have the right to defend themselves? I mean, they can't even speak out against what Israel is doing, let alone defend themselves. But I mean, when they protest, they get brutalized by Israeli forces. They fire tear gas and rubber bullets into mosques.  I mean, I'm sure that if Joe Biden had an intruder come into his home, he'd be perfectly cool with that. Right?  That intruder is just defending himself. It's outrageous. But if you thought what Joe Biden said was bad, Nancy Pelosi somehow managed to be even more ruthless and racist against Palestinians in a press statement that she released saying, quote, I condemn the escalating and indiscriminate rocket attacks by Hamas against Israel. Israel has the right to defend herself against this assault, which is designed to sow terror and undermine prospects for peace. Every civilian death is a tragedy that we mourn. Hamas's accelerating violence only risks killing more civilians, including innocent Palestinians. The recent inflammatory provocations, including by extremist forces in Jerusalem, have exacerbated the situation and restraint must be shown by all to deescalate the crisis. Let us pray that the situation will be resolved immediately and peacefully. So let's be very clear about what this statement is. This isn't merely a defense of ethnic cleansing. This is a full-throated endorsement of ethnic cleansing. Nancy Pelosi should just be honest and say she believes that Palestinian lives are meaningless. They have no value whatsoever. Therefore, Israel should be allowed to indiscriminately kill Palestinians till their hearts contend. Just say it, Nancy. Stop being a coward because that's what you're advocating for. You are supporting war crimes against the Palestinian people. And she's really quick to unequivocally condemn the rocket attacks that Hamas is firing. Any word on the airstrikes? Nancy, have you heard about the fact that they're killing children? Are you concerned that they're firing tear gas and rubber bullets into mosques while people are praying? Any word on that? Any concern whatsoever, Nancy Pelosi, for them? Well, of course not because they don't matter to Nancy Pelosi. She's a racist, completely minimizes and erases the suffering of the Palestinian people and just permits Israel to carry out an ethnic cleansing. Shameful. Shameful. This is the Speaker of the House. This is a leader of the Democratic Party who's supposed to be against war crimes and crimes against humanity. But here she is endorsing not only an illegal occupation, but all out ethnic cleansing. Brilliant. And when she says that Israel has the right to defend itself and Joe Biden says that Israel has the right to defend itself, let's be clear. This is what Israel looks like when it defends itself. So I know that you think you heard women and children screaming and babies crying, but that's not actually what you heard. What you heard was Israel defending itself, ruthlessly bombing densely populated areas. This is what they support. This is what they support and not only support, but enthusiastically endorse whenever they have the opportunity to do so. Now, a young Palestinian man who is living in Sheikh Jarrah, who's facing expulsion, went on CNN and he shared the situation, shared his experience. And he really concisely put things into perspective for a CNN reporter who was asked about violence from Palestinians because there's this assumption that Palestinians, they're just inherently violent. These people are barbarians. So everything that Israel does, Israel is just defending itself. But watch what he says to a CNN reporter. Do you support the protests, the violent protests that have erupted in solidarity with you and other families in your position right now? Do you support the violent dispossession of me and my family? I'll take her silence as a cue that it's time to cut to a commercial break. So that was Mohammed Al-Kurd. And he has been on numerous mainstream news shows, surprisingly, to even bring him on is pleasantly surprising, to share his story. Because usually we exclusively hear just one side, but he talked about how him and his family were facing expulsion. And unfortunately, he was very quickly proven right. And just like that, he was expelled from his home. If he fights back, he dies. If he tries to protest, he gets brutalized. Absolutely no choice whatsoever. Because the occupier has determined that his home belongs to them. So they just take it like that, nothing he can do. So I want to go back to Nancy Pelosi and Joe Biden, two individuals who endorsed the ethnic cleansing that Israel is currently doing. So does Mohammed have the right to defend himself? Because he talked about how Israel has the right to defend itself. Does Mohammed have the right to defend himself? Because currently he doesn't have the right to defend himself. He had zero choice in the matter. I'm sure that if Canada decided to take over portions of the United States and they decided that they want the area where all of the houses are that Nancy Pelosi lives and they just barged into her mansion and they kicked her out of her home with $2,000 refrigerators, I'm sure Nancy Pelosi would just be totally cool with that. Well, look, it's unfortunate. I really wanted to stay in this place. But the occupiers that I have to go, so I feel compelled to oblige. And I don't want to have to put them in a predicament where they're forced to defend themselves against me. I mean, we know that these folks would never, ever accept this if it were being done to them. Joe Biden would never allow someone to expel him from his home without a fight. So I ask the question again, at what point do U.S. lawmakers who unconditionally support Israel even acknowledge whether or not Palestinians have the right to defend themselves? They don't acknowledge it because they don't believe that Palestinians have the right to defend themselves. Palestinians to these racists are not actually human beings. They've been dehumanized. And so all they are is an obstacle, obstacle in the way of Israel's total domination. So they don't believe that Palestinians have the right to defend themselves. Them not saying it as a tacit admission that that is in fact the case. But understand right now it might be the most politically expedient position somehow to support ethnic cleansing. Having said that though, time will pass and eventually things will change. And history is going to judge racists like Nancy Pelosi and Joe Biden accordingly for not only their complicity with the actions of the Israeli government, but their assistance, their aiding and abetting of a genocide of an apartheid regime. And again, it's not surprising. I don't want you to think that I'm surprised by the statements we're seeing from lawmakers after taking days to mull over the situation. But nonetheless, that doesn't make it any less egregious and certainly it still needs to be condemned because if you support ethnic cleansing, I think that you should receive a little bit of pushback to say the least.


Guess I'm fun today. It's cool, right? Belly's full. Yeah, y'all real lethargic So I'm gonna need you to pep it up. All right. This is about me not you I'm just joking. Um, so a show of hands here freelancers Hardcore devs Agencies that are actually freelancers because they have two or more employees. There we go All right, where were the hardcore devs? Love you guys. Thank you. You're my people How many people just getting into WordPress and want to know some more things about WordPress cool? That's a lot of you well This is going to apply to all of you in some way or another but this talk is mainly about Developers and how we train people How many of you have hired a developer before? How many of you are your own developer? Cool, how many of you have had to train somebody on how to use WordPress? How many of you that just had your hands up have left and then somebody called you really pissed off because something bad happened Don't lie I've been doing WordPress for about eight years my title slide here is Dwayne who is so cool from pantheon and I told him that this was gonna be my title slide because he was cheesing like he Stole something last night and that beer was good. It was magical. So thank you guys for hosting us and Having a little fun doing that But the real name of my talk is why it doesn't do that and all the things that WordPress actually does because I've been training people how to use WordPress retail and corporate websites for about five years now with the agency I'm with I'll tell you about them in a minute And one thing I learned my first year on the job was that I was actually a crappy trainer Every good developer has a skill set that they're very very good at something that they can do well Especially in the WordPress community you have to specialize in something right because if you try to do it all You're not gonna be great at it But one of the things I feel like as as developers that we have a hard time with is training so throughout this Talk you're gonna get training tips and tactics to keep your users from asking why doesn't it now if you are a WordPress user and you were just setting up your own website eight of these things are gonna be things that you should learn about WordPress so definitely hang around we're gonna talk about Gutenberg at the end too but Again, my name is John McCully. I'm senior web developer for Moxley Carmichael in Knoxville, Tennessee We are a full-service communications firm. We do graphic design. We do PR We do government relations if your business gets in trouble with the IRS. We will come help you out I won't but somebody smarter than me will But we've been heavy into WordPress web web design since 2010 before I came there and I've been doing it for about five years Throughout this presentation, you'll see my Twitter handle there Johnny Mac codes If you have any questions that I don't answer to this presentation or during the Q&A period I will answer them via Twitter or you can just get in touch with me in general if you just want to chat And that'll be fun for me So I'm gonna make an assumption about the developers in the room and this is an assumption that I had to make about myself I used to think that being a better geek would make me more successful Right Any of you out there? It's okay. You're in a you're in a place of comfort right now. I was that guy If you haven't noticed yet, I have a gigantic ego That's why there's a picture of myself in my presentation because you know if you can see me twice How much better is that? But had a huge ego when I started developing WordPress websites, right? I thought I'm a good corporate developer I'm doing intranets. I'm doing big stuff for big companies I can do this and I can be great at it But what it what I ended up doing a whole lot of times was throwing unneeded terminology nonsense tactics and A whole bunch of things people didn't need to know into my training. So I'd set with somebody for two hours I'd stand up bold chested and be like I have taught you to run the world And they'd look at me like I don't know what you've been talking about for the last two hours, man It and then they'd call later on and be upset This happened to me in the worst way in my first year at Moxley Carmichael We had just done a pretty big website for a law firm in town And I was excited it was a hundred plus attorneys It had all these neat features and I went in their office had on a suit and tie I was like I look snazzy and I'm gonna train these 50 attorneys on how to use this thing got through the training Get a phone call when I get back to the office and it's our CEO and she wants to talk to me And I'm like, oh, no, she never speaks to me So I go into her office and she's like what the hell have you done?  Like how many have you ever been in that you're in there training you're like after it's over you're like I don't know if I covered anything useful, but I said a lot of words with my mouth That happens all the time, right? We leave a training and we're like So that's what I had to figure out because I was so focused on this I was focused on being a better coder And not a better user of the system Because at the end of the day most people that buy wordpress websites Do not care how you built it as long as it works well and it's fast All right, these are two things that will always win clients over Works well, and it's fast as long as you code it right. It's secure. They're happy with it They don't care about how you coded your custom post types.  It's not nobody knows what that is And all they know is that internet explorer six used to tell them they had to turn it back on All right, so you got to use human words patience Any adhd developers in here? I think that's what makes us who we are right? Yeah, me too I don't have any patience. You start doing something stupid on the screen and I'm like, no I'm out Can't be that can't be that you've got to be good and you've got to have patience with people And then a little bit of esp goes a long way right read somebody's body language I took a class on public speaking a long time ago and they talked about body language on stage And then I watched myself do a presentation. It was like this The whole time and I was like everybody assumes I don't want to be there any more than they do But esp is about reading their body language when you're in the meeting when you're training them They will show you confusion They will show you fear And they will show you discomfort So make sure you have just a little bit of that going on Otherwise what's going to happen is you're going to leave training and they're going to look at that where wordpress website And they're going to do one of these numbers And that's going to be the end of it so I'm going to start out with 10 tips For developers that are training people and like I said if you just have a wordpress website These are things that are going to apply to you or that you can ask for help on To get done. Oh, let me start by following the rules too. If you have questions throughout You may ask those questions You don't have to wait until the end because it may not be relevant by the time we get there So definitely make sure you ask those questions tip number one Simplify the interface How many of you have ever seen one of these?  I'm going to show you twice With just a few things taken out. I did this in about 10 minutes earlier It's easy to do Decluttering and simplifying the interface Is the first thing you should do before you start to train somebody Because they don't need three quarters of what wordpress has in that dashboard They're never going to use it If you've worked with the user, you know that when it comes to plugin updates and appearance editing and all that crap There's a lot of stuff in there that they're just not going to use now We want to tell them what they are But we want to keep them from pressing buttons and worrying about how to use their website We want to keep them focused on what we need them to focus on So there's a couple ways you can do that There's plugins out there that allow you to customize the admin menu. There's a ton of really good ones You can do this through simple code in the functions php file though Throughout this if I say there's simple code for it, you can also hit me up on github There is a thing that says useful wordpress code snippets and it's for beginner developers And it's just this one repo that has a bunch of code that I reuse over and over again So that people don't ask me how I did it because I can't spit it out Standing in front of you. All right A few other things about decluttering the interface Move custom fields up a cf users in the room Big fan of a cf big problem with a cf Developers a lot of times those custom fields are buried at the bottom of the interface under the Gigantic visual editor, right? What's the problem with that? People are going to hit that update button or that publish button and they're going to see this is required This is required. This is required and they don't know where it is So bump those custom fields up if I have to fill it out or I need to fill it out Make it be the first thing I see before I get to that huge content block Choose your admin notices wisely Any of you guys ever been in the back end of somebody's wordpress website that you inherited And all the things that they haven't paid for are telling you that they haven't paid for them Happens to me all the time. I'm like, did you buy this plugin or this theme? Admin notices can clutter up the interface and make it really hard for people to understand What information it is they need to actually use, right? So there's a few easy ways to do this. Like I said, there's code snippets on my That you can go get that will help you hide these things But there's also ways to choose them. There are things they need to know So recently with wordpress's minimum php requirement They need to know that their wordpress website's not going to work anymore So you don't want to hide the notice that tells them to update php So wordpress has several levels of admin notices Learn which ones that they need to see and keep the important ones in there So they get the warnings and they know to either work on it themselves or call someone to help And get rid all the other crap. Like, you know, if they're using free plugins, we want them to donate But let's not keep that persistent there forever, right? Actually use the dashboard widgets Um, this is my favorite thing to say to developers Any of you have all the dashboard widgets turned off in every single wordpress installation you have me too because I hate them But for clients, they're very valuable, right? What's the first thing a client's going to ask you for one month into their new launch? Google analytics, right? They're gonna be like, do you have any analytics or how many people are hitting my brand new website? It must be thousands If I don't give them that I got to go tell them how to log in somewhere They're probably it's probably also another system. They're uncomfortable with this is something That's easy to put in the dashboard and put it in their face when they log in So go ahead and do that There's other things if they have custom post types and they're managing data sets You can actually put access to those data sets right there in front of their face And make sure that they see those things constantly use the dashboard wisely We all love dashboards and the software we use. Let's make it work for them tip to avoid jargon CSS html j s cpt ui Custom post time Do not make any of these things the first thing you say to a client Because they don't understand it You lost them the minute you said log in to the word press back end All right So we got to get them there avoid jargon or you're gonna see a whole lot of this And it's going to look like that face and once you get there You're never going to get them back If you start a two-hour training with a group and you get one that looks like that You're going to spend the rest of the time you're there winning the audience back.  This is the hardest one Do it in their space Everybody in here tests on all browsers i'm assuming Liars Yeah, who has a copy of opera? Yeah Jerks, I told you this guy No, do it You know what happens is you develop a word press website and they work so beautifully in chrome that you're like Why would I ever need another browser? I mean everybody's using chrome, right? No, no my boss has a version of safari that I call the devil's safari Because every time I go in there after making a change. He's like, I don't see anything and I'm like What are you using for caching? What does it it will cache for days and days and I'm like we work across from each other There's nothing going on. I have to clear the cache manually every single time But this is why you want to do it in their space, right? Because we're developers when the site's done. It's not done, right? Right, we showed it to them. They approved it.  And what happens we get into training?  I'm like, oh you're confused, honey And that's the end of my day because then nothing works after that, right? They looked at that website. I changed one thing And it's like no because I don't know what sort of pit of hell that internet explorer caches in but I can't find it And it's in some registry key on somebody else's machine using windows 7 from 1997 or some crap like that No, do it in their space a few things about that not only is it going to eliminate disasters From happening in their browser It's going to be a place where they're comfortable So basically you just hacked the comfort level by putting them in their own chair Now a couple things about doing it in their space and these are just personal tips not really dev tips don't stand behind them We as developers forget that when somebody walks in our office or walks up behind us We jump like cats that see you know brown things on the ground We're developers we should get that They don't like people behind them either don't touch Touch is a bad thing when you're teaching people tech stuff because that just completely changes everything And don't ask to drive Never ask to drive make sure their hand is on the mouse at all times because If you don't you're going to see them do not see them do some quirky thing that they do That you're not going to be able to account for in your training and you need to be able to Maneuver those things on the fly tip for Highlight the screen options menu Every time I go into somebody's office after taking over a WordPress site and they say how do I see more posts? I want their developer's name and number You're like we're gonna have conversation, buddy Ah, so the screen option menu if you're not familiar with what it is for those that are running WordPress websites Tucked into the top right corner of the screen. There's a little thing that says screen options Why is that important to you? That controls all the fields that you see on the screen when you go to edit something inside a WordPress It shows your menu editing. How many of you knew you could add CSS classes and targets to your menus in WordPress? Yeah, the WordPress people did Lots of other people didn't that's because it's hidden under screen options. You have to check some boxes to see those things So what happens when we as developers customize their menu system? And they've got to add some sort of class to get an icon on it Then they're like I don't understand why this doesn't work. I copied the menu item It should do the same thing right? That's not the way it works. There's a field missing because I can't see it So make sure that they know those things This is also when you've got somebody's got a big blog our CEO has a blog that's been running since 2009 That has a little over 500 posts sometimes She needs to scroll back to a post that she doesn't know the title of or the date that she wrote it So I gave her the screen options menu so I could stop doing it for her This will keep you from doing that as well Giving them that menu and it'll help This uh screen grab is from an older presentation because I can't let go of WordPress 4 9 Because you know 5.0 is so friendly now tip 5 Provide short screen casts. This is an easy win with training We do this with all our clients. We build in about 12 hours of training time just to do this part because basically If we try to do give them one of the systems that sells screen casts Or we give them some other proprietary training system. What's the difference right? It's not their site So they get into the back end and although as a WordPress dev I understand what most WordPress backends look like and I feel comfortable in that Most WordPress users don't so Short screen casts are a great way to not have to go back for training later Because they retain about 2 of what you say in your trainings So if I can give them these screen casts on the back end of their websites I give them a place where they can go back and look in the future This is actually as I die This is one of our places one of our websites for a local boutique called estate They have this neat little thing on their website that called trends That puts these pictures to the right hand side of their events posts What's the problem when you tell somebody to put a picture in a pre-designed space? They always want to put something that doesn't fit, right? I don't know what it is when we look at some design that has a tall image. We always want to put a wide one in it Let's try it out. Let's trick this thing out. Let's do it but So what we did was we actually built a plugin for them that warns them on these posts that they have to crop the image And then it offers them to crop the image Part of that that's really hard is they have to select coordinates to do that, right? So after about three times of teaching them how to do this, this is how our training libraries were born Because I just created these videos under the education tab on the back of their website That they can go in and they can look at this anytime And they can understand how to do these croppings inside of their website My computer says it's going to go to sleep, but I promise it's plugged in So if the presentation dies, it wasn't my fault I'm going to move outlets real quick stand by This isn't awkward Hey, there we go All right back in business. Sorry for that brief delay Tip number six Prepare prepare Preparing is so important for training, but lots of people fly by to see their pants when they do this Um, I don't know why as developers we think that we can leave our terminal and just be experts Just because we built it. It's not how it works You should know that anytime that you've ever tried to log into your own email account when you were on somebody else's computer Because it's always some weird. Oh, I forgot my password. I don't know.  My password thing's not working. I don't know I don't know what's going on here It happens and you'll get in there and you'll feel like you're doing really good.  That was working yesterday. Oh, let me debug this for a few minutes and help you out here So What's the problem with that right? We're setting in their office now during their training time debugging something that's broken on their website that we just told them was awesome How many of you is that ever happened to you? Yeah, oh, yeah Yeah, first year at moxley corner michael as well We built the retail and uh forward facing websites for all of their medical practices 62 websites Seven hospital systems. It was a big deal So I'm very excited about this me and one of their it guys launched them in my living room with six pizzas and a Bunch of red bull. It was fantastic. I'm feeling like king of the castle. It's the first website. They've had in 10 years feeling really good about it We're two weeks in We go to their office for training and I'm standing up in front of people again suit and tie And I'm like, all right guys. We're gonna do a live training demonstration on how to address this hospital's website Turn around I go to log in and it won't log in every time I put in my password and Hit the button to log in it just keeps reloading the login page over and over again Ever happen to you guys? Yeah, me too Problem which I couldn't determine right there on the spot in front of 38 regional marketing managers The problem was We were using domain mapping WordPress multi-site. Anybody ever do this domain? Domain. I know I know it hurts me to think about too. It kind of makes my back hurt Oh Domain mapping was this fantastic piece of technology that allowed you to map domain straight to any wp mu installation What inherently is the problem with that?  Redirect loop on the login screen. You know how I figured that out Sweating my hind end off in the floor of a training center in front of 38 people going. I'm so sorry guys. This was just working But I didn't prepare I didn't prepare. I did all that work on the site. I came in and I thought I just built these sites They ought to work That was not the case. I was totally naive sitting there in front of these people another bad phone call and a letter You get those things and you don't feel comfortable at work anymore for a while. Trust me. I didn't eat lunch for days People are like you going out? No, I'm gonna be in the office so I can hear I need to know right now But it was my own fault, right? If I had just logged in I could have called them up days earlier and said no We screwed something up. We got to fix it, but I didn't prepare What's another problem with debugging on site? What's another problem?  And they assume that I've broken something right That's really hard to deal with so I'm going to give you a couple of code snippets that I use I'm going to put them up on the screen For this very thing because debugging on site is going to happen It's going to happen. It shouldn't but it's going to happen at some point You're going to have to fix something and what you want to be able to do is do it incognito Behind their back. So you're like, oh, yeah, just keep on working on that right now And I'm just I'm just having a few things making a few notes so One of the first things is this easy thing that you've seen a thousand times is changing the debug profile inside of wp-config to where it only Shows those admin notices with your ip address Why is that important? I can leave it on all the time and it won't matter I could debug on the fly all the time just to my ip address and nobody's going to be hurt by that A second one is this one I like to use especially when I'm doing api stuff One of the things that I have such a hard time with is I'm a javascript developer So I want things to debug in the console. It's when I'm debugging php I don't want an extra step and I really don't want an extra step when I'm already hot sweaty and tired So this piece of code is one that I put into all of our installations It's basically just a php snippet that will debug data to the console In any form fashion in an array anything like that This is great. Like I said, if you're doing api calls if they've got a big set of custom data custom post types Stuff like that and some field isn't showing up some array isn't working the right way You've assumed that you can just cast this data out and it's going to work the way you assume it's going to work You know, even though php will let us make a lot of mistakes. This will keep us from making mistakes Yes, yes All this stuff we've talked about snippets wise are on my github and it's in A thing called useful wordpress code How clever right Tip seven create an agenda. I also learned this one the hard way I had a training group come in I scheduled them for an hour that are only three people This is plenty of time. Their site doesn't do much Five and a half hours later I was hungry and mad And they were still asking questions Create an agenda It's as easy as this and you can even pick out my typo in this email because this is a real email Because I'm not going to bs you Um in prep for our training We're going to learn about wordpress basic information adding removing post and page pages page design and structure Cornerstone basics. This is a page editor that they were using on their website for a while, which was garbage Section reordering publishing version control design basics going to take two hours. We're going to have generous faq portion The only thing that's blaked out and there's the pricing information But if you have any specific training needs, let me know and I'll get those added in I did a few things in this email That saved me when I do a training First thing I told them exactly what I was prepared to talk about Up front. This is what I am prepared 100 to talk about Number two, I gave him a time frame You got to get in and you got to get out in two hours This makes sure that I don't get scope creep because I have a set price on training So when I brought him in there, I can't go to my ceo and tell her Hey, I had a $300 budget for training I may or may not have wasted $1,800 worth of hours after but that's fine, right? Work in agencies.  We build by the quarter hour All right, people would be real mad if I gave away $1,800 more on a website Then at the end I did the magic thing that is going to help me out with training I asked them if they have any questions or specific training needs Not that they're going to tell me. Don't assume that they're going to email you back and tell you That is fallacy and it's not going to happen But what it does is it makes them think about it so that they're not thinking about it while you're training them Because we need them to retain more information. The way we get them to retain more information Is explain to them what they're going to get And then make them think about what they need before they even get there Tip number eight Do I use a page post or custom post type? Anybody ever had this question? Some really smart trainee Two weeks later came back to you and said So when i'm in the back end of the website, uh, and i'm on my about page Is that a page post or custom post type? I'm like, what blog did you read today? Who's twitter are you following? It was probably mysners But These are terms that at the end of the training right before you need to explain what they are very clearly Pages or static information posts Are information that we're going to update all the time custom posts or data sets This is basically the way I explain these things to people So that they understand what the difference is Because what I don't want them to do is get in the back end and start creating posts for their attorney profiles Or start creating pages for their attorney profiles I want them to use the custom post type I set up and if I educate them on what that is They'll understand that they have to do it to make it display Otherwise you'll get a lot of people saying Do you understand the words that are coming out of my mouth right now? And you won't get any further and then they'll say I made eight pages for attorneys You ever see an attorney's bio It's like nine miles long and it's all credentials and like at the end of it. You're like, but what do you do? Like we do a attorney in law firm websites all the time and I see these bios They come in word documents that are 5 000 words. They're like, yeah, trim that up.  They've ever spoken They want to put in every single case. They've won They're long You know when this becomes a problem is when they're editing their own website They make a page and they spend all the time crafting and editing and customizing this information And they do this 10 times because they don't test They don't your users don't know where that preview button is They don't know what to do with that They don't test that they get 10 deep three hours in they call you and say It's not displaying Then you're like cool. Let me look at it.  So if we just explain those things up front Tell them what those terms mean Then we're gonna get a lot better result in the end tip nine recap at the end of the training Developers are just like when we write good code and it works the first time We're like boom done. I'm out. We got the bag on before that person has logged out of the website We're sitting with the satchel at the door like But what haven't we done? We don't know if they got trained We're developers. We have attention spans so short That whole meeting we were looking at the website going, please don't break Lord when they click that button if it could just work The whole time At the end of it the best thing you can do is run back over everything that was in your training agenda Look at it. All right. So we talked about custom pages and post types We talked about how to publish how we talked about version control. We talked about design basics Look for confusion Look for confusion because they'll be like this I don't know if I got that or not Go back over it. That's going to give you an opportunity to do one of two things One re-educate two Charge them more money I work for an agency. Everything we do is about billing you more So at the end of the day, I want to look at you and if you're confused about something I want to make an opportunity where you don't have to do it yourself Hey, I understand. That's really hard. Let me help you out here. Let me show you again If you don't get it, I'm happy to support you at $225 an hour. It'll be fine Tell your accountant. She'll love me Tip 10 Another adhd trait that's really hard. Sit still and be quiet This is not just for training This is when you do design reviews code reviews When you're pitching selling when you're in the meeting to learn about features Sit still and be quiet Because if you talk a whole lot at the end Which is what we're prone to do because we feel really good about it We're high as a guy on all the things that have happened We want to talk their ear off Sit still and be quiet This is going to give you two very good opportunities Number one, they're going to ask a question that they didn't think about before Or they're going to tell you something you need to know Number two, they're going to buy something else from you End of the website training is the best time for them to realize Their website doesn't do something that they didn't think it should do And this is the moment where we say, hey, that's simple to do Let's talk more about that But we can't do that if we've already dismissed the training through our preamble out You know, we're trying to, hey, I've got the set text that I've got to say to you before I leave And here's my contact info and I'm off to the office. It's lunchtime We can't do that. We got to sit still and be quiet, you know, just throw the shh on yourself It's really hard at the end of the training. I know you're amped up after it's over Your adrenaline's running. You're just happy that the WordPress website worked the whole time And that no weird plugin updates came up right in the middle of it And they're like, I thought this was new. You guys ever get that? Some plugin needs to be updated eight minutes before training And they're like, I thought this website was new. What do we need updates already? I'm like, because it's WordPress Because developers don't have anything to do with their time So we're just adding stuff All right, that's all my tips. Any questions before I move on to Gutenberg? Gutenberg? Yes, sir? Posts, I always tell people this is anything you're going to update So basically if you got news, feed, a blog, you know, these are things you're going to update A lot of people have kitschy names for their blogs now Because we can't call them blogs anymore Too much Pinterest for that But posts are things that are updating Custom post types are data sets This is anything that I've got a spreadsheet on our intranet Stored in that I need to display on the website You know, this happens in the way of Attorney profiles, physician profiles, you know, the locations This is a great thing to use a custom post type for Because we don't want them to choose how locations display Especially if they have maps involved You know, because if you've used Google Maps in the last year You know, they keep trying to trick you into doing different API stuff We don't want them to control that We want to control that, we want to be standardized So those are data sets Other questions before I move on And we'll have plenty of time for other questions, I think Gutenberg, Gutenberg fans? Bueller, Gutenberg, nobody? Yes, I'm like, yeah, when you first put this slide in as a developer You're like, who am I about to piss off In the development community But thank you So Anna, the reason it says am I never ending struggle with page builders and editors I love to hate things like this I love to love Gutenberg for what it could be I love to hate Gutenberg for what we don't know it is yet You know, it's hard to use, right Because the default for people that have a WordPress website Existing right now is to say, here's a new thing Let me go do it What's the problem with that? How many of you have been like me and in the last year You've dealt with clients, that self-host That came to you and said, well, I installed the new WordPress And it seems that none of my pages are working anymore Well, yeah Yeah, did you go rip the engine out of your car this morning Just jam a new one in it and think it was going to start up No, that'd be stupid But we do this with websites, right Why? Because they're fickle And we think that they're going to be fine But I think Gutenberg is going to get better And I think that developers who support the community And users that want to start testing for the community And doing the right thing With helping us out with what to know Are going to make Gutenberg a great thing So a couple of things I want to say about Gutenberg There's basically three things you need to think about And I'm so glad there's somebody from Pantheon in here right now Because I totally ripped these off of you And I did because they're so true And it's what a lot of developers are saying But first thing you need to do if you're going to use Gutenberg Or want to use Gutenberg and you already have a website Now this is not for people that are booting up a fresh website WordPress install, this is not for you This is for people that have had a website For a couple, three, five years And you want to decide to use Gutenberg Number one, prepare All right, don't hit the button yet Because you got to think about what Gutenberg's going to do There are a lot of hosting companies now That have staging websites built into your hosting Learn how to use that Or find a developer that can help you with it Staging website will save your life when it comes to Gutenberg And possibly rebuilding your entire website Or having to find some sort of backup to restore what you've done Design, I'm not a designer So when I first saw Gutenberg I'm like this could be really good and it could be really pretty And it could do functional great things But not without design Right, because if you use it by default How many of you have tried to jam it into your template And then you had a bunch of funky margins everywhere Right, Gutenberg is actually out of the box designed very beautifully You know what your template and your theme is not Designed around Gutenberg's beauty It's not, it's designed for the old visual editor So there's a lot of gutter There's a lot of margin There's a lot of things you don't need inside there So make sure you're designing And this is the most important one Extend Anybody who tells you that what I'm saying is not true is crazy Gutenberg is painfully easy to extend Painfully easy to extend It's basic JavaScript, right? It's not very hard You can learn it If you want to do something really crazy with it You're going to need to do some serious tinkering But if you want to do something simple It's pretty easy Case in point This is the default way to do it Way you would put your plugin in if you want to add your own blocks to some theme Now this is very rudimentary This is not the way I do it for our themes But this is the way you could add it to your own And then this is JavaScript that just creates a little simple box That you can change the color background on All right, this is very simple code This is stuff you can learn in an afternoon Gutenberg is painfully simple to learn You just have to spend time with it And you have to understand That by way of extending it You can break things So unit tests, staging websites And making sure that you've designed this well Are going to be pertinent to making it work Like I said, I don't think Gutenberg is a bad thing I think that if you want to use Gutenberg You should definitely try it out Boot it up on some test site Some staging site Somewhere and play with it If you haven't played with Gutenberg And you are a WordPress developer Time's a waste It's coming around Visual composer people in here Beaver builder Hey, we got a couple of beavers Page builders are great WordPress's evolutionary scheme And the future of WordPress Is not going to support a lot of out-of-the-box things Like that You're going to have to get things that update Gutenberg is a good way to go It's a good way to go Because the community is working on it And people that care about WordPress are working on it We're not selling it to you So at the end of the day We want to develop for you We want to extend it But we also just want to make it good Just to make it good So if you haven't thought about it And developers, if you're not contributing to it Now's a good time I am uncomfortably stepping into the waters To learn about it And deal with it right now We had a long talk about this Over a few beers last night Because I love to hate Gutenberg Because I started using it in its beta format And I was like, what the hell What are you guys trying to do to me right now? This isn't okay But it can be a great thing If we make it a great thing Questions For a good reason Yes, yes, you are correct I would also argue that ThemeCo's X theme cornerstone page builder is pretty close And however Page builders that force you to do things That are semantically incorrect Hurt my feelings So there's a couple of things with those page builders When you drag and drop an element into it At pre-borders, pre-origins, and pre-box shadows things I don't think those are things you need to do However, for if you are building your own website These are great tools to use There are syntactically and semantic things that they do wrong That can cause you load speed issues As WordPress updates And as your theme updates Can cause you major page layout issues So, no, I didn't mention it Not that I don't know Yes, sir This question's gonna suck We're about to fight in the street Yeah, definitely So the question was around decluttering the admin interface And making it simpler Are there any simple recommendations for that? Now I also do that a very custom way But there's actually a plugin called WP Admin Menu Customizer That basically writes all the code that I would write anyway Just a little less functional There's some things in it that semantically I don't love But it doesn't matter, it's the admin screen I'm not worried about load time here But WP Admin Menu Customizer Allows you to drag and drop and hide things in the back end It also allows you to give functional names to things So if you've got a user that really doesn't get it You can change the name of pretty much any item in the back end So if they don't know what a post is You could actually write it out to say This is the place where you put the things that update the website It's like oh But yeah that's what I would use if I wasn't doing it by code Good question Other questions? I'm going to answer that in a very broad way Yeah backups I would recommend daily backups But I do not hesitate to give clients admin access Because anytime you try to control somebody's access They will try to do more Anytime you give them full access they will do less You notice people don't steal stuff from open gates They hop fences Right So you give people a bunch of access and it terrifies them It's You know it's kind of the way of the world It's the way we socially act So yeah give them access Give them wide open access And force them into a hosting plan Or recommend a great hosting plan that has daily backups Because it's not likely that they're editing the website every two hours anyway And what we want to do is give them a way to go back all the time We do daily backups to the cloud It's it's cheap It's cheap There's storage space is not what it was in the late 90s Other questions Perfect Well someone else has been applauded So it must be my time to leave A couple of things There are some great talks going on this afternoon and tomorrow Definitely go check them out If you are interested in Gutenberg Definitely go check out Myzener's talk About Gutenberg I'm going to go check it out because I'm super interested And also heckling him while he's doing his talk But we're going to have a lot of fun And I thank you guys so much for hanging out with me