Okay, good morning So today we'll be learning all the rules you need to know for making your code a very measurable testable and perfect I'll teach you everything you need to know you need to like memorize it obviously Right because if you don't memorize it, how can you know if it's good or bad when you see some code? Some people think that goes over aesthetics, but I I disagree strongly it should just be correct according to certain measurements I'm actually kidding and I was planning to start this This workshop asking you guys to please present with each other to the people at your at yourself And I will actually do it just in case but I see that you're already socializing I was going to ask you to please present Present yourself to the person at your right or left or whatever Tell their name and ask them if they are new to programming and how long have they been working with roby? So please go ahead. You have two minutes Okay starting Good morning everyone. Thanks. Thanks for coming. It's amazing that you're all here I'm so happy to see you We learned here how to transform this type of code you can see that it has some weird coding standards It has like dollar signs everywhere arrows for for object orientation Well, I'm actually kidding. It's just php But you can put here You can put here any any code you have in your applications that you feel is just painful to work with that you feel It's more complex and it should be Any code that it should just be clear or easier to maintain like you have an application for to-do lists And you can't implement a new feature. There's something wrong So my goal is that after this workshop you learn the specific Steps required to actually improve that code base while you are working on it without losing productivity And without obviously rewriting the entire application So check it out because we'll learn how to transform this code into this one. Oh, sorry into this one So while you can see that i'm cheating here, but the before and after like i'm cheating here It's just a one liner hiding all the complexity somewhere But the before and after code after you implement some of the patterns we'll see today can be as impressive as this I can assure you so that's amazing and that way i'm very passionate about refactoring I think every one of us should be constantly at least be aware of that these things exist And then use them or not freely like really there's no silver bullet. I agree with david in that But at least we should be aware of what things are we not doing right and we could just to to not Not get get stopped. It gets stalled in our in our development When we get code like this and we can't change it without breaking the application So before we start I need to know a little bit about you How many Couldn't get the repository yet my repository with the exercises one two three four Okay, who has a usb stick? Okay, please pass it around and i'll be asking that question every two minutes or three Anyway, as jeff said if you are having trouble and if you don't have ruby or the repository just please pair with the Thankfully, it's not a hard drive just Obviously like just pair with the person at your side and continue working um Okay, uh, we'll see today refactoring patterns. I didn't want to put those enterprisey words in the name of my talk But that's what we'll see today anybody's Familiar with these concepts refactoring and patterns Anybody want to describe like the idea of what what does it mean? That's okay. If it's a very general. I want uh, yeah, please I see refactoring is editing your draft I know that sounds corny after what we just saw but it is like you write something down and you say How can I make this simpler? How am I making my point clearer? Perfect. Yeah Indeed and by pattern by applying a pattern to refactoring What we make sure is that there are specific steps to to apply that will lead us to better code And there are scopes also so we want to end up rewriting entire chunks of code in a single in a single hour So what we'll learn today is a algorithms for improving our draft. Thank you Now a little bit about myself I'll tell you what I've been doing in the previous years and why am I so passionate about refactoring in general And why do I think that people should think about this constantly? But first thing first my name is not to actually my first name is eugenio But I had a problem with that name because there's a very famous Italian with that very same name and so when people in the open source community wanted to google me They would see this ship, but I'm not a ship.  It's crazy But this was not useful for open source because I want to relate with the community I want to be able to learn and teach from the community. So I just chose my nickname to te Which is hard to pronounce. I think I am coming from Buenos Aires, Argentina. This is In between Uruguay at the east chile at the west in the north. We have bolivia paraguay brazil Anyone here from latin america or spanish-speaking countries? Wow so many Okay, bienvenido Beautiful, let's talk after And even though i'm from argentina, I don't play soccer, but I do have an asado every four or five days a week Um Coming from argentina sometimes I say very clearly what I want to say in english, but people somehow don't understand So I was once at work and I said, hey, there's a bug in the software And they were like what and i'm like, dude, there's a bug in the software. You mean a bar? Oh, well, if you're gonna get technically I mean a bar So please if you find something weird and you want to interrupt me, please do and I'll just repeat it in different different terms So in 2011 I worked in a small startup called chef surfing. I didn't follow any best practice I was a dream of david actually. I was learning by my own experience I was doing whatever felt right, but I wasn't I didn't know so much about architecture patterns and stuff So I committed many mistakes there and this team was small. I was my own lead So we wrote a lot of code and every two months the complexity Would bite us and so somebody would say there's a bug in production So please fix it and I'm like, well if I fix that I have to I don't know break something else or just stop for days And refactor and it was annoying. It was like weird. We have to stop for a week after two months Test and refactor. It was not predictable. Not sustainable. It was just stressful It felt very much like this. You are very carefully working with something and some Suddenly it just breaks down and it's like I don't want to there has to be a better world So next year I went to general assembly. They had a real application in quite about jpe But it was tested. So refactoring wasn't so risky and thankfully they told me please refactor all the things and so I did And the amazing thing in this story that I actually could do it while I was While my team was still feature shipping. They were still deploying to production probably many times a day While I was refactoring not only the code but the database as well and stuff So I I felt that was a happy story that I want to repeat everywhere. I can and actually improve it as well And that way I'm very passionate about it like in general assembly. It improved so much the code It made it simpler. It made it smaller. It made it easier to work with it. It made it like nearer Um, I'm sorry. I left for the usb stick. Who has it? Who has my usb stick? Okay, who needs it You are using it. Okay after you uh over there, they will be needing it So, um And the team was so happy to receive the refactoring this refactoring into the code They said because suddenly we could stop the talk the same language as as developers as the project managers as the business owners Because when they said like something like a classroom full of students the code spoke about the same concepts So it gained productivity week after week and it's still I believe ripping benefits so Oh before who who here is like in a similar situation as I was with chef surfing Here where you can where you sometimes have to stop the word and refactor anybody like feeling they should improve their code big time Okay, not so many happily. Wow. What an audience.  I actually broke it. I would have stayed at home doing nothing and it was more productive So these are the four patterns we'll see today These are the magical spells that you need to memorize so the code will be correct Anyone familiar with these ones?  For example for intention revealing method Anyone would like to describe it? Nobody familiar with it. Okay, please You didn't look at the code and it essentially tells you what it's going to reveal that's in that code Yeah, I did Um Indeed it turns comments are necessary because suddenly the code itself is is saying what it's doing at the same time Uh, the second one we'll see today special case object who would like to introduce the idea Nobody special case object. It's a variant of null object. Uh, null object pattern that I also it's a case I'll present Okay, so special case object A voice type checks a voice conditionals in your code So if in your view you have code similar to if there's a current user here Then display this welcome message and if there's not displayed this other one All of those conditionals will will like suddenly not be needed in your views in your models in your controllers everywhere So that's the idea of this one refactoring pattern replace method with method object, uh, which seems very Very weird to speak about anyone familiar with it that would like to describe it Okay, so I guess I'll do it myself, but I'll wait another minute though use the stick replace method with method object is useful for Extracting big methods from big classes without Needing to rewrite the whole thing So the rigs there is that there's many instance variables and there's too much context And if you start to refactor to refactor that right away You will see that you break too many tests to be like contained in a single hour of work And suddenly you run the risk of of rewriting So the interesting thing of this pattern is that it scopes scopes your work of refactoring that big chunk of code And service object is useful for extracting Responsibilities from big good objects. So typically the user in a real application Knows how to speak out descriptions about the product advice and so on and it's like a 500 line of code if you're lucky So with service object refactoring pattern And You are able to extract these different concerns in an organized way So I'll start now showing code at last so intention reading method is It's a variant of extract a variable or extract method in which you give a proper name To a to a chunk of code So that it describes itself and you won't need any longer this comment So this line of code was totally cryptic That that's my own code actually and when I came to it a year after I had to add a comment to myself because I didn't understand What was going on there? Uh applying intention reading method, which is a simi is really really easy There's a really easy way in four steps that I'll show you right right away I could change it to this this uh, there's the before and after code Which the code itself says says what's going on putting commenting code is a bad practice Because at first like if you can call without comments It means that you're already writing code in a clear way in a readable way Such that you don't need to comment in in natural language And more than that a comment is a lie waiting to happen Because you may in the future change the behavior or something and the tests run and everything goes well and you commit it But you may forget to change the comments and so they are actually misleading So, um, I find very interesting this idea of trying to call without comments That's that's another rule that you can bend whenever it's better to bend But it's a nice rule for myself like that's this code need to comment and so how can I improve it? So I don't need any longer The algorithm I have to apply in this pattern is you have a chunk of code. It doesn't describe itself I'll comment if it needs it if it has a comment great Then transform that comment syntactically remove the pound sign at the beginning Change the space by underscore and suddenly you get a method run the tests If you run the test at that level the method will don't exist And so you go ahead and write that method Remove the comments and the code write reads itself I'll show it to you this idea here calling in the browser That you are am I here? So what I just said is Remove this comment. Look what I do. This is just syntactical syntactical transformations. Remove the pound sign Transform this into a method Change it by the line of code we want to extract And suddenly no need of comment here. I can Define that new method Well, whatever it's hard not to look at your keyword And suddenly the code is better So that's all we need to just remove the comment and transform them into code So we start now with the exercise we get a 15 minutes a per each exercise. Let's start Do you have the Do you have the? The repo all of you So there is a read me there explaining how it works. I'll tell you right now before we start Uh, there's four folders for the four exercises We'll see they have the number at the left like the number one intentional link method Is the one that will work to win right now There's an app. There are v file, which is the one with which will work And there's tests then to run the tests you just run the app the app The app file So while you are coding you can constantly be running the test and see if you are breaking something or not And the goal is that the code that's there instead of being a long method, which is quite wide as well reads itself So the implementation details go down in the class You don't care about the implementation details and the main method reads like English So I'll be going around a few for 15 minutes and Work work together Please start and ask me any question if you have one and please help each other as well The first step guys is pleased to run the app. There are v file so that you actually see the tests run and they are green You will need mini test if it doesn't work for you Please pair with the person next to you and I encourage you to work in pairs It will be better because it is a very subjective matter And it's more just collaborative and more fun anyway So instead of having each one in some computer. I encourage you to actually work on a single one run the app there are v and I'll be going around to to explain what's the next step after that happens Just make the code read itself better removing the comment. I'll open them up here Removing the comment and making them code A comment. I forgot to make this requires many tests and I apologize I didn't include a gem file I thought it was with ruby. That's my mistake. So if you have many versions of ruby Choose the one that has many tests installed so you can actually run the tests Pair with a guy at your side or the woman at your side so you can actually work if it doesn't work And well, that's it. Like if you get a constantly missing mini test, that's that's yeah, that's my mistake Don't worry. I'm sorry and use my version of ruby or pair up with someone else Time is up for this exercise Thank you guys Sorry that we don't have enough time so I'll interrupt you right now This will happen in every exercise and I'm very passionate about this So if you want to like talk with me in the hallways or later or through twitter or github Please do because I love doing this work. But now I have to present more content. And so here we go Some people discovered while thinking about this particular case or while refactoring That there's some funkiness with the conditional and is the user is there or not and which lines of Of code get executed according to the conditions That that's right. There's something funky in that code and it's amazing that you found it That's that's another like nice benefit of refactoring You think twice about the same code and you ask is this a bug or a feature and in this case it was actually a bug So not only did you improve the architecture of the code and you maybe simplified it with one less conditional But also yeah, you discovered something that was going on your application and you weren't aware before of it So that's another benefit and thank you for pointing it out. That's that's totally Totally correct. So I'll move on to oh, sorry. I won't move on yet There's one rule speaking about rules very tough. It seems from this woman who is amazing at Speaking about design and the software development. She's called sandy meds and she said your methods shouldn't be Actually, she's here. Right. She's here right now sandy meds. I would love to see her and I see her And I want to thank her for her great book She said your methods shouldn't be longer than five lines And that's crazy because if you have a switch statement or an if with an lcf You're already in seven lines. So it's like are you are you trolling here? What's going on? But if you apply this pattern a certain amount of times it's actually easy to get to that size Because you start like a moving implementation details like the switch statement like the if router at last Into into private helpers in the same class and suddenly your code at the top is just speaking english It's just saying if user is a old in a like I don't know older than a week ago And you can write that in ruby in english Suddenly it's easy to follow this rule, which is amazing. It lives to better code in general And sometimes you should bend it for sure, but if we should have someone that authorizes you so she says um This is arguably the easiest pattern because it's just uh, sorry Oh, thank you. Wow I did This arguably the easiest pattern because it's just syntax transformations. Wow. Sorry. Sometimes I do I need the microphone at all Can you hear me like this? Oh a little okay, so I stick with the microphone But it's also the hardest one because it implies naming and naming is hard It's true that it's hard and not only naming it also implies that you know Which are the levels of obstructions of your code which is which counts as a business rule And which counts as just an implementation detail And well, you will see what feels better if you make a change on your code and the before and after looks worse Did what you did at least you gain the perspective over your code and your problem And if it's better go on with it So while it does seem simple Don't do it and just commit it because it may actually lead to something less readable or more confusing Hiding what's actually a business At something that's core rule to your application and that should be there on the top In the slides I put resources always at last of each pattern So I'll share them in twitter and speaker deck. So you will have them all Moving on to special case objects This avoids conditional in your code base. So suddenly you don't need to put an if The thing that it avoids especially the one that I'm going to show is the nil problem So you have seen as Ruby programmers probably this Hard to trace the error and define method email over nil class You never know where did it come from because it could be coming from a hash with a key that doesn't exist Or with a hash that has that key but actually have nil as a value inside Can come from a Conditional that didn't run like didn't have one of the bodies and it returns that one as an empty method So nil can come from many places. It's hard to trace So returning a symbol rather than nil is already an improvement Because at least you can you can get instead of an defined method Email over nil you will get a defined method email over a symbol over guest user Abdi Grimm suggested this pattern and it already helps to debug because then you you find in project that symbol And you know, where is it coming from? and even better than that sorry before that Here we have this conditional it has to be there all the time Whether you have a symbol whether you have nil you will need conditionals everywhere There's not an object that you were expecting in this case a current user. So you can say welcome user dot email And if you forget about it you will get exceptions in production everywhere And you will forget because the applications get big you have to put these conditionals in views in background jobs in models everywhere so better than Symbol the idea is to introduce a new object that responds to the same methods than the object we are Replacing so in this case in the top we have a new model called nil user Which is not active record. It's not baked in the database or anything. It just have a absent methods Then we have somewhere in the controller the current user helper Which either finds the one which is logged in and if it can't find it it will return a new instance of the new user Suddenly the view has no conditional Because whether there's a user backed in active record who is real who has a real email or there is this new nil user It will display the correct welcome message And suddenly not only that conditional was fixed But all the other ones in the your whole code base And suddenly you don't need to remember to put these conditionals everywhere you use a user And so it avoids a future problems And suddenly a code reads better also because you have like less imperative instructions in your code base So that's the idea of a special case object And let's move on to the second exercise. I'll put there again my beam Window I've seen many having trouble with mini test gem Please if you don't have somebody working like beside of you because two of you have that problem Move a move around and find somebody who can't do it Please pair because of all of this is so eager of is so subjective and so interesting to discuss about It's much more reach to be discussing one problem together rather than being in parallel trying to solve it by by yourself This is not hard technically, but it's hard like Like Which decisions to take which code to write how to name that method why to extract it. So please pair please be noisy Let's see So folder two I'll show it to you here I'll explain to you this problem. This extracted from an application. I worked with actually And there's a user who has a subscription the last one is the active one And you can cancel the description you can show it in the in the report job which is a background cron job that sends emails to their business owners and It may be nil because sometimes the description may not be there because the user signed up, but actually didn't subscribe So the goal is to introduce a new object that we return here So that when subscriptions that last is nil we we return something else And start simplifying all the code after that's running after you get a new class with a new object and you return it there You can get rid of the conditional line four and all the conditionals that are below line 25 So that's the goal today I'll hear some syntax and you please move on and I'll be going around and ask me questions and stop me Go on So sometimes the mini test problem is because of ruby versions Two one and two and one nine three run different My tests are inheriting from mini tests. I don't know what and he knows how to fix it There's There's a syntax change that if you make starts working. So please ask me if you think that's your case or change ruby versions Timeout is over How did this one go guys? Was it better than the previous exercise? Two was better than one Yeah, so I think I'm happy to hear that but if you have any trouble, please poke me and we're yeah He will be helping as well. Thank you and uh, yeah, you please stand up We three are helping you guys So whenever you're stuck with any step any syntax problem or any interesting discussion to have call us three What are your names guys? Jeff Roland and today obviously well obviously sorry Um Okay, I'm happy at this one better now. We'll move on to replace method with method object Which is for when you have code like this, which is so ugly this is uh, the first intention ruling method that was like Removing duplicate from the code.  There's some initial. It's like a class in itself. It's like a class in itself this method Um and more problematically this method was instead of a class which was itself big So whenever I tried to change the behavior I would have to change the instance variables and so the other methods that were using those instance variables and everything And it was a big rewrite that I couldn't afford because I didn't have tests But thankfully previous year I saw the talk through the internet from katrina owens In cascadia roby where she implements this this pattern in a code, which was as bad as this one Uh, and it's a great talk that I encourage you to see she speaks for one hour on how did she solve it And how did she develop tests for for chunks of code that were completely untested very interesting Um, so I'll show you again an algorithm that you just apply and suddenly boom. It works. It's better Uh, the first step is to look carefully at it and get scared I'm just kidding the first step is to create a new class every every time we have a problem in object oriented software Typically an answer is to extract a new class a new object encoding this behavior or data Uh, in this case, I know that this code because I studied and a year after writing it Was trying to format a csv with one shape a file with data Into another shape shape. Let's call it format a to b And the first step is to create a class with the same arguments in the initializer as the method itself There's gonna be four steps You don't need to memorize or take note of them because they are written as a comment in the exercise in the file in the code But I'll now go through them The second step is to copy and paste the methods body into this new class With no arguments because now we'll be using The instance variable that we set in the initializer The third step is to replace the original method in the big class We call to this new class. So suddenly The the method which was problematic in a class that was big and complex Is a one-liner suddenly that class got smaller and a big chunk of behavior got its own object with its own name The fourth step applying tension ring pattern Intentional revealing method to the new class and this is safer now because you are now Constraint into this new object and whatever you do there in this new object is isolated from the big class And hopefully the application itself. So now you can do this in a more Constraint environment in a more safe one and whenever you want you can commit and if the tests are green then it's gonna be fine Um If you do it before you run the risk of having to change too much code at once and that's always dangerous So the whole idea of this is to apply intentional link method in a way that that you Don't touch too much of the application. So I'll open up that code now It's the three number three Uh Here is a big method. So the very first here the fourth step that we need to do I'll do the first one You define sorry, let me remove the comments You define a new class there Let's call it format a to b but you can call it whatever it makes sense to you And you define the initializer and so you go that's my suggestion as first steps Uh, and then apply one or two iterations of intentional revealing method and continue running tests all the time and call me whenever you need help Well time is up I'll go on to the fourth pattern service objects But this one I want to exercise it because it will move a After the hour we have which is until 12 30 So I'll just explain it to you and you always have the exercises in your machines And you can poke me and we look at it together later if you want to and if you don't want to whatever Here are the resources one of the links I put here. It's actually the video from cascadia ruby from a from I forgot the name Katrina oh and thank you Which is a great great explanation of how this should be factored something like this um So the fourth one is service objects The problem that it solves is when you have a god object And uh, you want to add new behavior in the case of my application? I was working with we have a user which was big. It wasn't so big It was a greenfield But anyway, we need to add the subscriptions and subscriptions wouldn't belong to the user. Although it was so easy to implement it there Uh, the problem was that if we put it in the user We would be coupling a new dependency losing cohesion for the user Testing it harder and slower suddenly a user can have so many relations and so on and following the single responsibility principle which we all love especially Especially david You can't describe any longer your class with and without and so now the user is this thing that knows how to persist itself knows about How to send a welcome email knows about authentication and also knows about descriptions uh That's not a problem if you have a rather small object But if it's a if it's a class that's already about 300 lines it can start it can get painful and The name service comes from domain driven design Which is a great book about how to architect your software in a manner that makes sense also for non-technical people Um, it's a service as opposed of a value or an entity This is a little bit technical But the idea is that the service has a only behavior and no state It's not persisted in the database. So in the case for a subscription It was a service because it was just uh connecting to a payment gateway checking if there was any error Either validating the credit card or a connection error and all that logic had no no state Uh, I'll show you some code quickly. We want to exercise this one Let's see And I'll I'll move on Oh, and before I will also Tell you that I have a branch in this repository called to the dash solutions to the dash solutions So if you check out that branch you will have four new files in each one of the I mean one new file in each folder Which is app dash solutions to the solutions or something there are b And you can see my take on this refactoring patterns. They are arguable We can discuss about it, but they are for sure better than the code before refactoring Uh, I'll do it now to explain this before and after for a service object So I'll open the before Here so we have this user a typical rails class with validations callbacks authentication Notifications and suddenly we added subscribe Which was which had this funky method try api to handle errors Uh and subscribe which is the the opposite and this crazy logic Which was only concerned about subscriptions, but was living instead of the user objects So when we extracted extracted it out I came into this code Where the user let me go down Where the user only calls that service it initializes it here as a private helper It sends the the user it sends self to it and it calls on it subscribe and subscribe And the user doesn't care what does that mean if it's through an api If it's through a phone call or through fax or whatever the user just doesn't care All the logic lives on this new object subscription service which receives a user And performs all these these these things which in this case is connecting to the api That's the idea of a service object as I said we want to exercise this now But I'm very happy to discuss it with you guys if you're interested later through twitter whatever Uh going back now to the top Again the branch for my solutions in the repository to the dash solutions plural solutions If you want to check them out compare and so on Let's see Uh next steps if you want to continue learning about um About a refactoring patterns a code design like in general just send pull requests to it have it's a gold mine I I learned a ton there the community is amazing There's these two projects that are uh are actually needing quite a bit of refactoring if you are interested in specific ones But you can choose whichever you want and just contribute The smaller ones are easier to get it to get to get in because the community is smaller And they need just more time and you will get more feedback people in my experience. Anyway in smaller projects I I received more constant feedback and that was very useful for learning go to it have if you'd like to Continue working if you don't want to break your own applications Send pull requests and see and see the code improve That's another next step. Uh, I encourage you to follow Follow the rules all the time follow the rules. I'm kidding But the four rules from sandy mets are amazing. They lead to they lead to green pastures and they are easy to grasp Uh classes should now be longer than 100 lines of code Methods should not be longer than five lines of code if you can Think about these problems and try to shape your code in that manner You will be following a lot of patterns a lot of The design like ideas you only following best practices without needing to study them all and become an erudite of Like all these things without becoming a pure scientist I love these rules because they are so easy to to grasp And they improve so much code basis And if you then want to actually study why they they lead to good code or not and so one is your choice uh But I strongly encourage you to to know about these ones and try try to to apply them to your own code Then the the other two ones are a method should not accept more than four parameters And a controller shouldn't just instantiate only one object, which I never wrapped my head around it yet So if you want to teach me actually, please do Uh while refactoring in my opinion, it's not only about aesthetics or although it's a consequence But it's about the shared understanding of how your project works in your team and with your business owners in my opinion refactoring is uh Bring so much productivity because suddenly discussing the things we need to implement with the business owners with the project managers And fixing the problems that arise become easier if you have a smaller code base They will sell something amazing the best the best key to improve codes a code is delete key I strongly believe that if you don't need to solve the problem Don't solve it if you can delete code delete it and you will have a more understanding and less errors in production And it may also be about performance today. Adrian suggested to me that if you're in If you're using null objects You should also make them singleton because they are always returning values And so you don't have 1000 objects saying all the time the same It's also about performance and of course about also finding and discovered yet bugs um Another idea that I like to think about while refactoring is that we work with the tools with which we work We are kind of meta professionals because we like so much the meta as developers We are the users and the creators of our own tools. This would be like we are carpenters and we can shape the Precise hammer that we want the precise tool that we want rather easily Like you take the hammer of another person and Suddenly shape it to your own hand to your own strength and that's crazy power for us. Suddenly we can shape the computer However, it's better to us That's an idea that I that I always find interesting And the last one if I'm going to chase a bias between over and under engineering I will always choose over because under engineering is risky expensive and overcrowded So that's all. Thank you very much. I hope you enjoyed and see you around


It's going on everyone Sam here with late in sports cards We are ripping one box of 2022 Leaf Metal Draft football hobby for Daniel L Good luck Daniel. See you got in here for you man.  So empty We've got Tyler Goodson eight out of 25 first one there. He is a Green Bay Packer Nice one there for you Daniel Tyler Goodson We've got this is sick. He is a Raven five out of 30 is Charlie Kohler Congrats on that. He's injured right now, but pretty solid tight end dudes like a genius apparently. Oh Wow We've got nice one here. How about a Bailey zappy one out of seven Heck yeah, there you go Nice one there for you Daniel another nice one after that. We've got a 10 out of 25 Traylon Berks who is currently now on the Texans are not texas Titans the other T's AFC South team.  That is a great card right there. That's so sick. I Would like genuinely like I would see this and I'd buy a card like this because it's just how cool that looks with a God of War Eye black So sick That'll do it for your break there Daniel man awesome break. I have to say I will get them right out to you Thanks as always


As you can see, the pricing is the best and we are trying to give people homes, not just houses. Places that when they are they will be comfortable to do whatever they want to do. A good environment, safety. We are trying to bring everything together to make the place a home so that when you are here you can just feel it. This is not just about Agazi, it's about everyone. Good morning from Star Properties. How are you all doing? It's your favourite village boy, Mr Ghana Baby, right here. And I'm back again with another video. This video is more going to be like a vlog but at the end of the day I'm also going to work. When you ask so many African parents what job does your son or daughter do, most of them will be like he's a doctor, he's an engineer, he's a lawyer, he's a professor. But when it comes to me, believe it or not, my mum doesn't know the kind of job that I do. She knows that I make YouTube videos but what is my profession? If you don't know who I am, my name is Wadamaya, you're one and only. I'm not a village boy who is on a journey to change the negative narrative of Africa. But personally my profession, I was an engineer, an aeronautical engineer that I quit just to follow my passion. And my passion is creating YouTube videos. We appreciate what you're doing man. Thank you man. I'm on my work today and what work am I going to do today? I'm actually going to feature a real estate property. I mean if I say feature, we are here to promote a real estate property in Tema. But my mum came to visit me. My mum came to visit me, you all know that my mum had a problem with her eyes and I took her to a doctor to fix it. Hi. So can you see the sign? How many? So she's here for what we call a review. And I feel like you know what, why not do something different?  So I just want to take my mum around and see how she's going to react. I mean for her to see the behind the scenes of my work and then also have a few conversations with my mum in terms of what job does your son do? Anyway any time my sister dresses me, I look like a rich man. That's why I love my sister so much. So my sister got a fashion design shop called Dukes Fashion. You all should check the link in the description, purchase one and go support my sister. Damn it, I look so good, yeah? I love you sis and you all should buy from my sister. Aunty Ragi. Good morning. How are you? You slept well? Yes. Hey, Aunty Ragi is giving me simple answers. You slept well? Yes. Are you okay? Yes. You're going to work with me today. What job do I do? I'm a man.  Okay, so I know that today you're going to see behind the scenes of Wadabaya, what I do every morning. Yeah, you ready? Say hello to them. Hello. Aunty, you should come along with us. And I appreciate you all. Do you have an oil and gas company? Why start the real estate business? I was living here alone in the bush. So I sit down and say, why can't I create a community on my own for people to move in so that the whole place becomes full of... So if you can even say the structures are affordable. Yeah. Everything is affordable. So any mere man can buy the movie. I didn't tend to make a huge amount of profit or money from it. So that's my main reason. Let me know. You build this with a loan or your own money? My own money. No loan. Aunty Ragi, come here. Yeah, come. Come. Hey, J. Hey, babe. I don't know how mom feels. Eh? Nah, it's okay. Here it's okay. Nice. How are you? Fine. Good? I was just... I just want to talk to you. Yeah, I'm just nice to you. I'm also nice to you. I heard about you last time. I wasn't so nice that I came here because... I just wanted you to say you're nice to me because you are nice to me.  How much is it? $180,000 $180,000? $180,000? Do you are the marketing manager? Yes Can I check in? Thank you Wow The living area You have your dining space You have your sit-in space All here I don't believe you How much are you selling this? $160,000 So The kitchen I told you This comes with it at no extra cost And it's Good brands quality brands I think it's very good We don't give you any inferior product here So your extruder Your washing machine here Your banner and it's actually a 5 banner So you can see 1, 2, 3, 4, 5 All inclusive Your fridge Over here No This is all part of my $160,000 All parts You have your in-built oven And microwave I want to see the bedrooms This is so good to be true It's actually true So this is one bedroom down And all the rooms are in suites So every room comes with its own Toilet and then bath For a felt bedroom This is so big You could use this as your guest room Or you could style this as a home office If you want So we'll show you a couple of other houses Where we've styled it differently Hmm The rest of the bedroom are upstairs? Yes Then you have the visitors' washroom over here So rooms up here Let's check out the master bedroom First thing to see Ooh You feel like sleeping right? I feel like sleeping But I love salt bed Oh Are we still filming? That was with the walk-in closet Then This is the closet area This is spacious Huge For all your food things So it can be hats and hats No, hats and hats So we will take the The biggest space We actually see them at home And then You have The balcony In that evening This is unbelievable 4 bedrooms for $160,000 That's unbelievable Marketing manager For our guys at home So this is the one that I'm filming Yeah, tell us something about yourself Oh, so I'm Margaret Really? Can we tell you something? I will tell you now Just remind me that I want to tell you something Okay And I am the marketing manager For our guys at home So the community comes With a lapoo A mini mat A kid's playground Wow As far as I know There are trees that have been planted As you can see All around The interior also has beautiful landscapes Which you could actually Influence on The design that you want You can make changes to the interior If you want What about the exterior? The exterior we want uniformity So you can't change anything outside Wow, they planted flowers It's been three hours of filming We're done with the first phase of the video It's time for us to shoot the second phase of the video The first phase is more like talking to the CEO Getting to know his story Story that might probably inspire most of you So if you haven't seen the video Check out the link in the description Watch and be inspired It's time to go check out my mom Man, I'm so sorry I feel so sad bringing my mom in here Because sometimes she thinks I don't do anything She thinks I just go around Cameras on my face, I'm done And I do a YouTube video So I just wanted to come along with her I hope she's not asleep Because it's been three hours since I left My mom is tired already She's sleeping So you guys don't need to disturb her Let her enjoy her sleep It's time for lunch Go and organize some food for my mom One thing about my mom is She doesn't like eating rice If you give her rice She thinks she's going to eat in the whole day If she eats rice So I'm going to look for something like Kenke, that's what she used to sell before So it's definitely a big front of Kenke, so I mean Let me just go organize some Kenke for my mom The floors are tall With the grass in between And for the flooring You could decide anyhow you want it If you want it just way In a different way Is it not slippery? No, it's not If you don't want it tall Whichever way you want it can be done for you Because this one is so inside You're buying a 150,000 house And they still want to customize it For you You will never get that anywhere I don't want to talk too much I'm just trying to let you know That this is so good to be true So you need to just Put it on your screen And just make that purchase It's worth it And if it doesn't grow well Call my name My name is Wanda Maya This is the interior of the three bedroom And this is an open kitchen concept Wow So you have two options You could choose the closed or the open kitchen It still comes with all appliances I love the open kitchen Thank you Your knives, God's hope And that's the sofa hiding there Oh Nice And the washing machine right here And this is inclusive The AC's are inclusive 2.5 horsepower The TVs are not inclusive Bring your own TVs please That one I will not even allow them I love the interior design Thank you That's what's room here This is a three bedroom One room down and two up All rooms and suites This is big Wow All the three rooms are in suites Take a look at this So cute Wow This is how it looks like the master bedroom Okay So We have got a nice window here The master bedroom Wow We should walk and close it Bacony as well Bacony as well Good morning My nervous You guys didn't respond Sorry I don't have nervous yet Because I'm getting this one This is how much again? 150,000 Okay I want this one You want this one Oh what am I Heads and heads I always choose the big side And your washroom here You have heads and heads Oh nice So this one if you're fighting with your wife You can't sleep You just use this and she'll use this Yeah exactly And then close WEC See It all comes Your water heater Right up there This was done by one person No loans No He's investing for you people To come and support his business Don't know how to make kinky Even though they originated kinky I want my mom to taste and see Because my mom used to sell kinky And tastes way better Than the kinkies that I eat in a crowd by the way So I would let my mom Confirm what I'm saying I'm going to take it from there Come on Come Come I don't want my mom to do this No it's okay No Come Cool I don't know I don't know what to do I don't know what to do I don't know what to do I don't know what to do I don't know what to do I don't know what to do I don't know what to do I don't know what to do I don't know How much is it? $180,000 Dollars? $180,000 What's that about? $160,000 How much is it? Where are you 28 for the No, cities Cities Current Ghana city 1 million Ghana city 20 billion What's the payment plan to?  You're going to take back your house? No, no, no We won't take back our house So now you see, we have other arrangements With financial institutions For external mortgages So if at the end of the 3 years you're not done We would always recommend you to speak to a Femme for a mortgage So they can give you maybe up to 20 years Based on your age and all of that Wow So we wouldn't take back the house No, this is such an incredible deal Man, I am buying one How many units remaining? Oh, we have about 80 units Available now, so a lot for everybody A lot I'm buying one, so 79 remaining Yes Please, let's do this I mean, the fact that we are Africans Let's support Africans man Own a house in Ghana for just $50,000 Yes Two years payment plan Interest free Interest free That's what I love Interest free I hate interest No interest No I want to know, do you need more money Or do you need more capital Before you start up your business In Ghana? No Are you sure about that? No If you have a huge capital Lying in your account Or at hand To start your business You end up making a lot of mistakes But if it is coming Bit by bit, bit by bit That one When you are doing You take your time To do the best And not the quantity What are the kind of mistakes that you made? To me I see every mistake to be A lesson to me So I don't see my mistake to be Too much mistake It is an education to me Do you have mentors? Me Yeah No You told me that your Reverend told you To get married When you get married Everything will be alright Did everything get alright When you got married? Yeah 100% modern right Wife supported the journey Exactly She has a position in the company Yes She's a director in the company Wow She's waiting for me If you have a message for young couple What would that message be? Okay As I said earlier You just have to pray There is nothing God cannot do That is what I believe in I don't have any malam Any traditionalist That would do anything for me And we have none But then when you put God first Everything is possible Young ladies coming up now with this They all want rich guys to get married to And it doesn't work like that You can start bit by bit And then if God is in control of everything It will work well But then young girls who want cash Big house, big cars It doesn't work Even with that there will be no respect in it Because the guy has already built Everything for himself So then nothing works Yes So young ladies up there Young couples up there What I would tell them is They should just keep God first I don't do anything without God Everything is in So they should just pray They should stop nagging Nagging doesn't help at all Just wish your partner the best And everything will move on well Vanessa Yes You are the interior designer Yes I am For Agazi homes For Agazi homes And you are also a diaspring Yes I am Oh okay So you are trying to design Just to meet the diaspring market I guess you could say that Something contemporary, simple You know, something that we all can kind of Vibe with Because we all have a different style You see Wow And most of us kind of want something We like to keep storage away So you know the TV mounts hidden We've got some understair storage For you as well That you can utilize It is a four bedroom But we've made it into a three bedroom With an office Okay And we've utilized the underfloor storage So that's something that we thought we could do For the client Wow How long have you been doing this? I've been in the industry more than seven years Oh that's seven years Yeah Seven years in the industry You actually look like Denta Do I? Yep Oh that's a compliment Really?  Oh where do you live? I live there Do you live with your parents? I live with my parents I don't know Do you live with your parents? I don't live with my parents I don't live with my parents I don't live with my parents Because you live with your parents I brought you here to say We don't live with our parents I mean that's how my parents raised us We always used to invest back at home So we have homes in Dantuman You know like most Africans do So I always encourage coming home If you have a message for Africans What would that message be? I think we should be proud of what we have I think that's one of the things I think with my career I've tried to I always put my Ghanaian projects In the forefront Because Ghana is still developing It was one of the first African countries To gain its independence But I still think we have quite a bit to go There's a lot of young kids now coming to Ghana And obviously making a difference The entertainment scene The construction scene The medical scene So I would definitely encourage More and more of us to come home Don't be streamlined to thinking That we're living in huts And it struggles central If we don't come home And make that change That change actually won't occur So that would be my little... That comes to my next question If you had a chance to change one thing In Africa or Ghana in general Regulating things Getting things in order I think a lot of people are Misled We don't know where to find The right information For things Yeah, I think generally just Mis, like just guidelines Getting to know where you can go And get your land certificate done Who to speak to if you're having Trouble with the law There's a lot of issues when it comes To construction and land ownership And purchasing and even mortgages And interest rates Those things I mean there's several banks That are given great options There are several contractors That are amazing There are developers such as The Gazi Homes That are also readily available To work with the diasporans But I think a lot of us come home And sometimes we are misguided Or misinformed And then it becomes a stressful ordeal To kind of handle business here in Ghana So I would always encourage That we should let the information Be more readily out there That's very important Thank you so much for talking to me In it Everyone does the in it with me In it, that's the only English word That I know So what's your name again? Margaret Hey, Lin Hey Hi Hi See Okay


Greetings and welcome to the Introduction to Astronomy! One of the things that I like to do in each of my introductory astronomy classes is to begin the class with the astronomy picture of the day. From the NASA website that is apod.nasa.gov.apod. And today's picture for November 20th of 2023, well, it is titled the Horsehead Nebula. So what do we see here? Well here we see the nebula known as Barnard 33, which is a dark nebula, a dark dust cloud blocking out the light from behind it. And this is more commonly known as the Horsehead Nebula for its distinctive shape that looks like perhaps the night piece in a game of chess. And that is again a dark nebula that is dark dense areas that are blocking out the rest of the light from behind it, and just happens to have something resembling that kind of shape. Now the darker, denser material will be in the process of forming stars, and the Horsehead Nebula is within the Orion Star-forming region. So we are seeing stars that would be forming in this region again. Now we also see, in addition to the dark nebula, we see another nebula down toward the lower left, and that is an example of a reflection nebula. A reflection nebula occurs when a bright star has formed and still has dust around it, not as dense as within the dark nebula, which completely hides material from view, but still some dust around there, and the dust is very good at scattering the shorter wavelengths or blue light, giving it a distinct blue color. As we see in our image today. So those are two of the prominent types of nebulae that we see within a star-forming region. The third we see all around, and that is the red glow of hydrogen gas, and we call that an emission nebula. So we see all three of these different nebulae, and they would look very different as we study them, but they're all related with star formation. The dark dense areas are where stars are currently forming. Then we have the reflection nebula, which has young stars where the light is being scattered off of dust grains remaining, and then the red glow is the scattered hydrogen gas around the whole region that is energized by ultraviolet radiation from those hot stars that have recently formed and caused to glow. And when hydrogen gas glows, it gives off a distinct red color as we see in our image today. So again, all of this is part of the Orion star-forming region, which is a nearby star-forming region, in fact, one of the closest to us here on Earth. So that was our picture of the day for November 20th of 2023. It was titled The Horsehead Nebula. We'll be back again tomorrow for the next picture, previewed to be Supernova Wisp. So we'll see what that is about tomorrow. So until then, have a great day, everyone, and I will see you in class.


Hello and welcome to the session. My name is Asha and I am going to help you with the following question that says Find the derivative of the following functions It is to be understood that A, B, C, D, P, Q, R and S affects non-zero constants and M and N are integers The fifth one is AX plus B upon CX plus D First let us learn the quotient rule Suppose we have two functions fx and gx which are real valued functions such that gx is not equal to 0 Then the derivative of the quotient of these two functions that is d dx of fx upon gx is equal to d dx of fx into gx minus fx into d dx of gx upon gx whole square So with the help of this rule we shall be finding the derivative of the given function that this is our P idea Let us now start with the solution Let us denote the given function by y So y is equal to AX plus B upon CX plus D We have to find its derivative that is dy upon dx So this by the quotient rule here let AX plus B be fx and CX plus D be gx Now let us apply the quotient rule to find the derivative of the given function First we have to find the derivative of fx which is AX plus B into gx that is CX plus D minus fx that is AX plus B into derivative of gx that is CX plus D Upon the denominator we have gx whole square and gx is here CX plus D so we have CX plus D whole square This is further equal to derivative of AX plus B is A since derivative of constant here B is the constant with respect to x is 0 and derivative of AX is A since derivative of x with respect to x is 1 and A into 1 is A into CX plus D minus AX plus B into derivative of CX plus D derivative of D is again 0 since it is a constant and derivative of CX is C Upon the denominator we have CX plus D whole square This is further equal to ACX plus AD minus ACX minus BC upon CX plus D whole square Now plus ACX cancels out with minus ACX and we have in the numerator AD minus BC upon CX plus D whole square Hence the derivative of the given function is AD minus BC upon CX plus D whole square This completes the session hope you have understood it well take care and have a good day


7-0 City Pass vs. Carlos Alcárez is the final of the Barcelona Open for 2023. And both guys have been very impressive to get to the final. City Pass entered the tournament as the number 2 seed and we're going to buy in the first round. In the second round he take on Cashin. This is no problem for Steph getting through in straight sets. 6-4, 6-2. In the third round he take on the number 14 seed, Shapa Vaalov, who he had played some tough matches against before. If this was not one of them getting through in straight sets. 6-3, 6-2. In the quarter finals he take on the number 8 seed, who had just gotten a walk-over win over Dimitrov in the previous round. But again, no problem for City Pass getting through in straight sets. 6-4, 6-2 to advance to the semi-finals. In the semi-finals he take on the number 9 seed, Moussetti, who he had had some tough battles on clay with the last few times they'd met. And this was no different. But City Pass having to win a third set, eventually winning 6-4, 5-7, 6-3 to get to his third Barcelona final. Alcárez started the tournament off as the number 1 seed and we're going to buy in the first round. In the second round he take on Borges. This was no problem for Alcárez getting through in straight sets. 6-3, 6-1. In the third round he take on Felo Espanyol in the number 13 seed, Batista-Rigou. And after a close second set, Alcárez would get through in straights. 6-3, 7-5. In the quarter finals he take on the number 10 seed, David Overshukena, who had taken out Roussevore in the previous round. And again after a very close set in the first, Alcárez would get through in straights. 7-6, 6-4 to get to the semi-finals. In the semi-finals he take on the number 12 seed, Evans. But this was one of the easiest matches of the week for Alcárez. Getting through in straights sets. 6-2, 6-2 to advance to the final. These two have played three times before with Alcárez winning all three matches. But they have played a couple of close matches, including the quarter finals here last year. They went three sets. If Sissibas is going to win this one, he needs to bring the variety. We saw that against Moosetti. He could have probably got out of that in straights sets. Unfortunately he had to play a third. Maybe fortunately he got that extra play under his belt. And he is battling some sort of an injury with his arm. He's got tape on it for the whole week. So if he can keep that under control and also keep the variety and be aggressive as well against Alcárez, take the base on away, you might get the win. If Alcárez is going to win this one, he needs to use the crowd to his advantage and just play the same way he's been playing against Sissibas. He's obviously got a working game plan against Steph. It's worked three times before. And it worked this time last year at this same event. So he knows he can beat him. So it's going to be a matter of trying to get that game plan in and hope that Sissibas doesn't change things up. This is a very fun final. 1 versus 2 in the seedings and a rematch of last year. These guys have put on some bangers as well. I think it is going to go three sets. But I reckon Sissibas is going to get the win here. I reckon he's going to upset Alcárez and finally get a win over Alcárez. Last time they played, Sissibas was a totally different guy. He's starting to bring in those volleys, bit bigger serve as well Sissibas. So I reckon he might get the win here. But let me know down in the comments below. Who do you think is going to win Barcelona?


Okay, I am very, very proud to introduce the Rocket Badge team that hacked the Lightning Talk format, so give them a round of applause for that. I never said you could not schedule three back-to-back demos that were thematically different enough to constitute their own Lightning Talks all at the same time, plus it's the Rocket Badge, so it's really awesome. So they have three, they have a five-minute talk and then two demos, was that it? Okay, so they have a five-minute talk and two demos and they're taking up the next 15 minutes. Give the Rocket Badge team a huge round of applause, they're going to take it from here. Hi. Okay, this is about the multiplayer, massive multiplayer prong. We wanted to have a nice game with, playable with the Rockets by a bigger audience and basically if you have a Rocket you can log in into the game and you have the option to control the right or the left side and it's basically averaged from all your inputs and you have to, you can play a little bit in the background. The setup is basically done currently with two of the tracker readers you see around which to track all your movement if you enabled it on your Rocket. But you can actually use, you can actually use a Rocket as a receiver also. The code for this is all in our Git. The numbers in the bottom right should be the number of players but actually it looks like it's broken. That's what happens if you do some last minute changes. I'm very sorry about that. You can check out all the code, the prong is implemented in JavaScript using web sockets to connect to the game script which is written in Python. There's the complete Python lib for controlling games. Down in the hack centers there's four, five player Tetris, six player Tetris implemented with the Python game lib and rockets. Second is trying to fix the thing with the number of lock and people because I think it's pretty interesting to see how many people are controlling the pedals. I'll use the meantime and tell something about the setup for people who want to redo it themselves. What we're basically using here is the open beacon readers for inputting your movement but that is not necessary. You can also use a rocket with a bridge code framework. Does it work right off the box deck or do you have to change something? It should basically easily work with rockets as a receiver part but not in the version which is currently committed. Sec will commit the changes today or something like that. So if you want to do it on your own notebook, you need a rocket as a receiver and there also needs to announce rockets, right? No? Yes. You don't? We don't know what we need. We need? Well, the open beacon readers are configured to only receive packets and we have distributed at least three rockets in the room here which announce the game. But if you're using a rocket to play the game, it switches the channel, announces the game to another channel, reads packets and once a second switches back and announces the game. So we only need one single rocket to play the whole game as a server. But we are using a little bit more than a right setup here. So oh, okay, 20 people on the left side, 45 people on the right side. Okay. Do you want to say something about how the averaging works or what our ideas for the algorithm were? During the talk, we already tried this. It turned out where people had problems reaching the complete top and the complete bottom because everyone needs to control the record. So in this version, I implemented some kind of idle timeout. If you take part of the game, but don't use the rocket control for like 40 seconds, you'll get thrown out of the game. So you have better chance of reaching the extreme positions to hit the ball. That was only one of the ideas. The other idea was to allow oversteering. So basically scale it up a little bit to make it easier to reach the top. But I think this idea is the better one. Any questions about the setup? Or do you just want to play? I'd like to know about the averaging. Why do you average the position and not the movement? You could also say if a majority of people steer up, the thing goes up. Yeah, I thought that was more interesting that way. One thing is you could reach more easily the position because it could move quicker if everyone decides to switch. The second thing is it was to show that some kind of swarm intelligence. There's no correct answer to move the paddle. But the people automatically decide what to choose to hit the correct spot. Thank you. So welcome to our new talk. Moving the pedals. It's a live demo. So we will shortly say, oh, it's already running. Nick is really fast. Set up the game here. Why are the numbers back to zero, Zach? He don't know. Because it's the second talk. Of course, we had to reset it. That's the rules of lightning talks. It's very, very hard. Nick is really strict there. So we had to restart the software. Now nothing is working anymore. So what's that? What is? It moves all our players to the ignore list. Oh, happy restarting. I try to continue what you were trying to explain about the movement of the paddle. The idea is if you press up and down, there is no way to give an exact position from zero to some arbitrary value. So the swarm intelligence has to randomly decide, do I press up or down? If everybody would press up because the paddle has to go up, the paddle would instantly be at the top of the screen. So it's a bit of a delay of people, oh, should I go up? Should I know? And the more they go up, the higher the paddle goes. But not everybody is allowed to do the right decision. So this really is a funny experiment and we were quite surprised that it actually worked in a way. What we would like to try if Zach has the game running back. I fell over the power cable. He fell over the power cable. So if the thing is back working again, we would try to possibly increase the speed of the ball and see how fast the swarm intelligence, or it should increase automatically, shouldn't it, Zach? I think we even said it after every lost ball to increase the speed. So we can see how fast this swarm intelligent paddle movement can really get a paddle to a specified position because in theory the audience could instantly move the paddle to any position if they just do the right decision in how many people press up or down. So what your basic algorithm in your brain should be, choose a random number between zero and the value you want to go, and decide open that if you have to press. But of course that will not... It's getting faster. Oh, I think he's repowering the recipients. That looks almost like... We're not attacking jeopardy here. You can use... You can use working technology. And I think it would be better if it would move. We have left players. That's unfair, Zach. Only one... I think it is a little unfair because of the left side. Oh, okay. Possibly a few more people should... Where are your rockets? Please join the forces of the left side. It's very unfair. Are we getting higher? Okay, so now the speed of the ball should increase with time, right? Yeah. Oh, okay. It's increasing even more now. Are there any questions in the meantime while you are playing here? There's one far in the back. Can the microphone go far in the back, please? Hi. We'd like to get the logs of people's votes. Is that possible? Do you log the votes from the badges? We're running a full TCP dump on the packet, so we have complete log. Good stuff. Thanks very much. And I think we can publish it later if you want to analyze how such things work. So we put such dumps anywhere where you can get it. I think it's getting faster now. I think you should restart it. You have to rejoin the game, I guess. One minute? Okay, we have to get close to the end. Are there any last minute questions for this talk before we start the next one? Where are my slides? These are our slides. They are in the background of the pong, and I think we used all of them. No, this was yesterday. I think. Okay, now remember, the speed is increasing again, so get the – why are there 47 and 21? So thanks for all your help. Okay, so welcome to our third talk, and we need more players here, and it's still getting very fast. Yes, you should remove the increase a little bit, I think. They actually got one. That's not that difficult. Why did – oh, it starts always in this direction. It's really unfair. You should alternate that, Saks. It's very unfair. It wasn't random. It was all going through that one side. Yeah, that's not random, Saks. Going through the side to one is not random. Why are 43 players not able to move a paddle to a specified position? What am I playing? I'm playing left. Okay. Everybody has to press up to get to the real – to the real limits. Yes. Everybody has. Saks didn't change it. I really have to agree on the top level. Does anybody still have questions about the setup you need? The code is basically in the Git repository. So if you go to the Rocket website and check out the Git repository, where do you find it? It's in our standard Rocket Git. It's in GitHub, and the repository is called Rocket with a zero and no C. If it's a consensus, can we ban somebody? Sorry. If it's a consensus, can we ban somebody? No, currently not. The code is in the tools, game, bong. It's like pong but with a B. Oh, okay. That's actually not scope of this talk, but how does the mesh network work and how does tracking work? That's not really part of this demo. But every Rocket just for tracking just broadcasts its current ID, and several readers around the convention center, and they listen, and we're trying to – there's a more or less clever script trying to deduce your position if you're seen by more than one readers, because it's sending in different transmission strengths. So if you only see the packets which are sent with very high power, you're far away. And it also sends your nickname, which you configured on your Rocket. And there's actually, since yesterday, a working JSON which contains all the data. And there will also be a packet capture file of all the transmitted data. And as to the mesh network, that's just simply flood fill. Each batch retransmits the packet it sees if it's within its current parameters. Okay. To make that clear, the mesh – you have to restart again, I think. To make that clear, the mesh network has nothing to do with either the tracking or with this. This is direct transmissions from your batch to our receivers here. And that's basically the same what the tracking does. This is the same receivers, and your batch is sending on a different channel your nickname and your ID. And the mesh network is completely different in this broadcasting the time from batch to batch. And you find the URL for the tracking on the Twitter account. Thank you.


Yeah, everyone shaber 1000 here. I got another little paranormal thing I caught on My security camera up here in the kitchen. So let's check us out together. Okay guys, so I Got another little clip for you. It's very quick, but it's very interesting I think we may have debunked the last one It may be a bug because if you slow it down real slow You can kind of see some wings on top of it. So it could have been a bug This one, I'm not sure Again, I'd like your guys's input on it in the comments down below See if we can figure out what this is, but I'm gonna roll this clip for you and loop it a couple times and I'll be back with him. We'll see what you think of it. Hey guys. So what do you think? It's pretty interesting I was waiting on as you can see what time it was I was waiting on monkey to get home from work and I had just come out of the bathroom and I was staying there in the garage right over there and I was watching for her to come in to because Bruno likes to to meet her when she pulls in so What I was doing was I was staying there watching on the monitors for her to pull in and I seen that was my eyes and She had come home right after that right after that happened because I was going to go ahead and Roll it back and check it then But so I waited and then I went ahead and roll we rolled it back a couple times So then I went ahead and imported it on to the PC so I could see it on the big screen monitor and It's pretty neat. It goes Kind of like right into the bathroom door But if you notice right before that there's one, you know Runs up on I guess it would be your left side of the screen It goes really fast But when you slow when I slowed this down if you can tell you can see through it So I don't know what it was. It was picked up on this camera up here You guys are clear over there, so I can't show you but the camera we have up there is when it was picked up on so I Don't know. What do you think Monk? Monkeys over there behind the camera. So I Don't know either, but it's pretty interesting So whenever I catch something like it like someone had a Commented and said I should have cameras rolling in here, which I do I got two cameras in here once Pointing right here like right where you guys are at and then another one is Pointing over back this way towards behind me So what I'm going to do is going to just move one over in the corner now It's not 4k, but it is 1080p. So It was kind of a gloomy day today That's why there wasn't a whole lot of light coming in and had the shutters on the back door closed So there wasn't a whole light coming in so that camera was thinking it was dark in it So it was on like night vision Because it kicks on automatically. So anyway guys, I Don't think it was either I didn't think the other one was but somebody commented and said that they thought they could see wings And when I rolled it back and really slowed it down, I can kind of see some wings on it. I Don't know why it disappeared, but so I think that one may be debunked as a bug But this one here, I don't know guys check it out and see what you think or roll it again for you I'll loop again for you a few more times and then we'll see you guys soon monkey All right guys, thanks for watching Shea Bear the myth man the legend We'll see you guys soon. Bye. Bye and take care


Hello. Welcome to the start of the video series on random forests. Now random forests, as you've learned in this lesson, are a great tool for making predictions. And so essentially they build a lot of individual decision trees and then merge them all together to get a more stable and often more accurate prediction. Now within this lesson, we're going to start with classification using random forests. And then we're going to get into regression with random forests, which is one of the nice things about this technique is that you can use it for both classification of groups and regression of numbers. So with that, let's go ahead and dive in. So we're here in Google Colab, and we've got some libraries that we need to save. And so one of the things that you might notice, depending on when you start to do random forest is that this TensorFlow decision forests is a new library for us. And sometimes, depending on what your runtime is like, you need to first install it. And so right now you can see that there's got this squiggly line underneath the library, which is telling me that there's something wrong. And if I run this command, lock of commands that are loading all my libraries, we can see that I get this error, no module named tensor decision forests. And so if you get that error, all you need to do is run this pip install line to install the package onto Google Colab. And the reason this happens is because TensorFlow decision forests is not a standard package, so we need to install it. And essentially it's going to run through all of these different lines, but at the end it tells us that it successfully installed the library. And so now I can go through and run all of import all of the libraries. So once our libraries are installed, and our Google Drive is mounted, we can get into the actual problems. And so what we are going to do is try to predict the type of house based off of energy consumption. And sort of the situation that you can imagine yourself in, you're working at a utility who wants to better understand their customer base. They want to try to figure out which housing unit types exist without needing to go to those specific houses. So we are going to try to predict this housing unit type based off of features variables that you can easily see from bills. So to give some further background, our how our data set, we would be predicting type each you queue. And there are five different categories mobile home single family detached single family attached small apartment large apartment. And I want to point out that it's really convenient that our data is already coded numerically because that's something that is a requirement for the random forest package. So if you were to be running this with a separate data set that maybe was labeled a B C B, you would need to convert those into numbers in order to get this model to run correctly. But before we get started, I've already set up some data set so we are only looking at the energy use data. We've got our response variable and I've selected several predictors or explanatory variables that can be used in to maybe predict what housing type is based off of data that is available in a billing data set for example. So there's energy or electricity natural gas energy assistance liquid protein or propane fuel oil, wood cords, and then wood pellets. So with that let's go ahead and get into actually modeling. So the first step that we need to do is split our data into training and test. So I'm actually going to simultaneously create both of these variables using the train comma test. So this will create one variable called train and another called test. And the actual command we are using is train test split. We give it our data set. And then we give it our test size. And so because we want to split it into 80% training, 20% test, I specify 0.2 as my test size. This is something that you could change in your own work if you thought maybe you would get a better fit with a smaller or larger amount of test data. So let's go ahead and look at what this training data set looks like. So you can see that we've got these random numbers because it's shuffled the data and then randomly pulled out 80%. And we've got our response variable and all of our explanatory variables. But before we can use this in our TensorFlow model, we need to convert the data into a TensorFlow object. So I'm going to create a new data set called train DS. And the command we're using is TFDF. So this is from that TensorFlow decision forests, which I've nicknamed TFDF. So we say TFDF dot Keras dot PD underscore data frame underscore to underscore TF underscore data set. And then we give it what our data frame was called so train and a very important step we tell it, which data set to program as the label or response variable. So type HQ. I'm going to copy that and change some words because we need to do it again with our test data set, but we don't need to change the label. And so then if we look at what this looks like, it's essentially just an object. So it's not actually a data frame or even a dictionary like we are used to it is an object that is stored in memory space, but the computer will know what to do with it. When we get into the model definition. So that's step two. So now we have our data set. So now we need to define the model. And we've got a few parameters that we're going to define here to tell the model, how to actually formulate this random forest. So this is all my model model. And we're using that TFDF library again dot Keras dot random forest model. And this is where we actually tell it what we're actually what we want the model to look like. The first thing we want to do is say compute OOB, which stands for out of bag variable importances. And we want to set that to true. And so this is will tell the computer to calculate the importance for each of our predictors or explanatory variables, which will use later when we do interpretation. Now we want to set the number of trees. I'm going to set it to 15. It defaults the 300, the smaller number of trees you use the longer the model will take to run so I'm going to use a lower number for the sake of the video. And then I'm going to set a max depth of 12. So this is sort of how complex, you want your model to be larger depths means more complexity. So a greater chance of overfitting the data. So we can see that it's told us where it's actually storing this model. If we print it. We can see that it's once again just one of these weird objects we can actually see anything yet, but the computer knows where it is and knows how to use it. And the last part of the model definition is an optional chance to specify the metrics. So we are going to put specifically specify accuracy, which is defined here. So the way we're going to measure how good our model is, is by how accurate it is the total number of correct predictions, divided by the total number of predictions. And so, at this point we've defined to the model, there's, but we haven't added any data in here so if you look at this, there's nothing to suggest that this model is connected to our training data set yet. And so that is what we do when we fit the model in step three. So we say model dot fit. Train underscore DS using that TensorFlow object. And as we run this we can see it's going to print out a few data sets for us so it sort of tells us what it's doing as it goes through. And then it tells us that it took 5.6 seconds to read in the training data set, but then trained it in point seven eight seconds so less than a second of training. It's given us some warnings, but we don't really need to worry about that, because we're not interested in this autograph command. And then we can continue on because it's told us that it has done this correctly. And the final step here so we've now defined our model and fit it to the training data, but we want to see how accurate it is so we're going to compute the accuracy with the test set. So in this case this is the 20% of data that we held out in step one. And we say model, which is what I named my model evaluates. And in this case we give it a test object. And we're going to say return dict equals true to return it as a dictionary. So I accidentally double clicked and interrupted, but here we can see that it's now printed out our accuracy for our model so our model, it has an accuracy of point seven one, which means that 71% of our data points were accurately classified within the test set. And so we'll stop here for this video, and then in the next one we'll get into how we can interpret the results of this classification model.


The fundamental theorem of algebra is one of the quarterstones of mathematics. Unfortunately, it's not easy to prove using elementary methods. It can be done, it's just a lot more work. And so we usually prove it using complex analysis. So we have the following result. Every polynomial with real coefficients has a root of the form a plus b i. We can't actually prove this until we develop some complex function theory, but let's assume this is true for now and see where it takes us. So let f be a polynomial with real coefficients. Our theorem guarantees there is at least one complex root z equal to a plus b i. Consequently, f of z is equal to zero. But since f is a polynomial with real coefficients, the conjugate of f of z is f of z conjugate for all z. We can prove that directly. The conjugate of f of z is... Now, remember that f has real coefficients only, and so the conjugate of each of these coefficients is just the original coefficient. And so we get... which proves our result. But now let's consider. Since f of z is equal to zero, we can conjugate both sides, and the conjugate of zero is just zero, and the conjugate of f of z is f of z conjugate. And so f of z conjugate is zero as well, which proves an important theorem that complex roots of a real polynomial occur in conjugate pairs.  Let its real roots, if any, be r1 through rk. By the factor theorem, every real root corresponds to a linear factor x minus ri, and we can write f of x as a product of these linear factors and some other real polynomial. Now, if this other polynomial isn't a constant, then our theorem says that it will have at least one complex root. But since it's a real polynomial, the conjugate will also be a root. And since the number in its conjugate are roots, then their product is going to be a factor. Remember that the sum and product of a number in its conjugate are real, and so this product is also a real quadratic polynomial. And so that remaining polynomial has a quadratic factor. And remember it has complex roots, so it can't be factored into real factors. We call this an irreducible quadratic. And now Lather rins repeat to prove the fundamental theorem of algebra, at least one version. Every real polynomial can be written as a product of real, linear, and irreducible quadratic factors. Real factors correspond to real roots. The irreducible quadratic factors correspond by our assumption to complex roots of the form a plus b i. And this means that the roots of a real n-th degree polynomial are real or complex numbers. And this is important because... Well, let's take a look at that next.


That's a good question. I was doing a bit of cryptographic research and I was always interested in finance and so I read the white paper. I thought it was kind of an intriguing concept but initially I didn't really take Bitcoin very seriously. Then I started thinking about other applications like identity management, decentralized DNS and on a whiteboard I was able to design an entire revocation scheme for a credential and just a single whiteboard and then I realized wow this is a really cool concept. So my problem was that I was a little late to the game. This was about 2012-2013 and I didn't know anybody so I remembered what an old professor told me which was those who cannot do teach. So I created the first MOOC on Bitcoin. It was Bitcoin or how I learned to stop worrying and love crypto. It took me only a week to do. I released it and I assumed oh I'll have like 500 students or something. Now I have about 60,000 students and I personally got about 5,000 emails and I answered every single one of them which was a great opportunity to get to meet people and also learn about the space. What output? So I've done three companies in the space. The first was Invictus Innovations and we found it in Blacksburg, Virginia and that came off of what we were doing with the MOOC. So I asked my students what are the big problems in cryptocurrency and I kind of got a bimodal distribution. Some students said hey value stable currencies are a great idea. We need Bitcoin to look like the US dollar or the euro in terms of value. Then another group said decentralized exchange and so we tried to do a project with both and we released BitShares and that was a great product and we had a lot of fun. After that I did another project and that's the one I'm usually known for which is Ethereum and Ethereum was all about adding a programming language to a blockchain. We like saying it's like when JavaScript came to the web browser it opened up all of these new amazing applications but both of those were really companies built around particular projects. So after doing that for a while I wanted to create a company where we created cryptocurrencies for a living. So true to my academic roots I also wanted to create a research company. So we formed Input Output Hong Kong Jeremy Wood and I back in 2015 and we have both a service division and a research division. The service division constructs cryptocurrencies for clients and the research division does foundational research into the science of cryptocurrencies.


It's easy to put an image into a post on the MRH website, so just follow along as we show you how. We want to place an image here in our post, so we click right there with the cursor. Along the top of the edit window you'll find a series of toolbar buttons. You can configure what toolbar buttons you see in your My Account profile, so your toolbar may look different than the one here, but a lot of the buttons are the same. You want to find the image button and click it. Up comes the dialog box for placing an image. Click the upload tab. Then you want to click the choose file button to pick the image you want off your computer. I picked this nice photo I took of the Winchester Bridge with my new Canon 40D and I click open. Next, I click the send to server button. Be patient, it can take 10 to 20 seconds or more to upload the image. I'm waiting, I'm waiting, ah there it is. Once the image is uploaded you'll see the original image dialog box come back, this time with an image loaded into it. Notice my image is 1600 pixels wide, which is too large. Our website will clip any images larger than 800 pixels, so I change the width to something under 800. 780 pixels sounds good. Notice the height is automatically changed for you to keep the image proportions correct. I also add some alt text so search engines like Google know what this is a picture of. And then I click OK. And there's my image in the editor window. Since I'm done with my post, I scroll down to the save button and click it. And there's my post with an image, it's that simple.


Hi everyone, Joe for Jaspie's casebreaks.com coming at you with the second half of that NT football break that we knocked out earlier today This is break number 24 2020 national treasures football Big thanks to everyone who bought their teams straight up It's William with last spot mojo right there Appreciate that and congrats again to the winners of spots right here as well And all 32 teams are in let's roll it. Let's randomize it four and a one five times for names and teams one two three four And a one fifth and final time After five we got PJ down to PJ four and a one five times for the teams one two three Four good luck and a one fifth and final time after five. We've got the Tampa Bay Buccaneers Down to the Carolina Panthers All right PJ with the Buccaneers Steve with the Packers William with the Rams hung with the Eagles PJ with the Washington football team Sean with the Cardinals PJ with the Titans and Ravens Sean Matic with the Falcons Nick Stober with the Chargers Matthew with the Cowboys PJ with the Niners Aiden with the Steelers PJ with the Broncos Colts for Brian Shane with the Patriots Matthew with the Bengals PJ with the Seahawks PJ with the Dolphins Matthew with the Chiefs Scott with the Jets PJ with the Vikings Matthew with the Bills and the Browns Anthony with the Jaguars Scott with the Lions Mark with the Bears William with the Texans Mark You also have my Raiders Brian with the Giants Greg with the Saints and PJ with the Carolina Panthers Let's sort by column B alphabetically by team And here remember I marked though those RT4 so we all know that it's from the same case Now we're gonna pause the video when we come back. We're gonna see if there's any trades And maybe some more people watching live and then we'll have the break stick around. We'll be right back All right. Welcome back folks No deals were done So onwards with random team number 24 Thanks everybody for helping out and making this happen. All right. Good luck Hopefully the the few of that are that are active in the chat right now can brag tomorrow About all the awesome stuff that we saw in this NT break. Good luck everybody. I hope so I want that to happen Good luck. All right, let's use a blank card here so we can Hide the hits a little bit nine out of 50 Phillip Rivers I like to be a little surprised about what's about to pop all right Got 11 out of 99 Dalvin cook Rex. There's Arthur by the way Rex was just asking about you the other night Arthur. He's like, hey, I don't see rex arthur as often I was like, yeah, he checks in a couple times a week There's sam darnold 39 out of 99 for scott and the jets All right mark, maybe a little little rater joe mojo We've got juju smith juicer century materials 58 out of 99 for the stealers That's going to be for aiden Jim kelly 76 out of 99 Matthew with the bills There's dishawn watson 20 out of 49 century materials for william and the texans Well, michael piran rookie jersey and autograph That's 22 out of 99 That'll be for scott and the jets Denzel mims another jet 26 out of 99 He may his stock might be on the rise with With with the new quarterback out there. Zach wilson We got greg olson six out of 15 For seattle PJ with the seahawks the hawks of the sea and we've got oh nice Four color patch and autograph 70 out of 99 For the fly eagles fly jaylin hertz Hung young cho with that one Nice Strong play right here. There you go. Nice one for the eagles Could be a big season for him and the final box just a quick little half case break random team 24 Now I feel like each time i've done the second half of the case i've said I don't see any more in the back, but I guess they they keep spawning In the inventory room back there Because there was another one that appeared today Maybe we'll get another shipment in tomorrow. I don't know but check back jaspy's case breaks.com. We always have things going on the Site kind of a thicker box here. Oh, there's a book right there, too All right. Good luck everybody We're going to lead off with one out of six Just one off the train whistle Baker mayfield for mathew and the browns All right, we've got immortality roger stovak Dallas that'll be for mathew shira terry cohen 27 out of 99 tremendous treasures chicago bears tried to trade couldn't trade mojo 27 out of 99 for mark castanzo a dual relic one out of 10 daryl henderson and cooper cup rams that'll be for william last spot mojo signature materials 10 out of 49 clinton portis for my rivals denver pj the broncos 49 out of 50. That's patcher queen dual relic for baltimore. It's going to be for pj 15 out of 83. That's isaia right rookie auto for pj and the washington football team We've got darienton evans. That's a nice patch 65 out of 99 nice patch nice auto tightens pj And we got a book and an auto at the bottom. I think let's do the book first nice tyler johnson 78 out of 99 rookie jumbo prime signatures. Let's take a look. That's a prime patch. That's pretty sharp There's his autograph right there And a super bowl champ buccaneers buccaneers book Bucks book pj with the tampa bay buccaneers And the last one here. Is this an auto or is this just a base card? Oh dual relic and auto j heart 3 out of 99 jordan love steve birch Won that spot In one of those filler breaks got randomized the green bay packers and ends up with possible future Of the green bay quarterback position jordan Just wanted to hang on to thanks everybody. That was a great two box break 2020 panini national treasures another two boxers are in the books. Keep an eye on the website For more we're always trying to pick up stuff like this when the price is right So keep your eye on jasmies case breaks.com for more of this nt flawless immaculate all that sort of stuff And i'll see you next time for the next break. Bye. Bye