Thank you So I'm Emma or I'm a new L if you really wants to have a mouthful I am the co-founder of a small company in Belgium You might have heard of me regarding one of those two libraries the R schema adapter in embers. He liked read it He's I am not going to talk about that today. So if you want to talk about those libraries to me just find me in the holes and Today we're going to talk about factoring and as I said we're part of a small business and We do mostly remote work and sometimes we Find projects that have already been started for a while by different teams and sometimes it's a mess And so that's how I got the idea for this talk once I Got into a project I came I came there and say oh, yeah, we have to improve the maintenance and availability and performance of This feature and I looked at the feature and it was this method that was several screens long with nested ifs and fordubs and stuff and it was not readable and I had no idea where to start to get it faster because I could not read the code So before we get started what is actually refactoring? Well refactoring can be many things If somebody tells you hey, this is the one recipe for refactoring Well, don't listen to them because refactoring is a lot of different things and so there cannot be only one recipe Refactory can be something refactoring can be something as simple as renaming One single variable all over your code because you decided that finally that name that you gave it was not that smart of a name after all It can be updating your cook style and making your code base that they've compliant for example if it was not for starters That's that's one sort of refactoring too Refactoring can also be writing a single method function of class to make it more maintainable Just one you don't have to do the whole code but refactoring can also be rewriting that same thing to make it just more readable and To make it easier for other people to add other features and that's mainly what we're going to be looking at today And finally refactoring can be rewriting almost everything just keeping the name of the project And so this is the kind of method that I want Yeah, it's sideways. Did you notice because I didn't have enough room to put it vertically so I had to put it sideways this this is the kind of method I was talking about and Other than the fact that it's sideways. You probably are having troubles reading all of this You have no idea what it does. It's just comments. It doesn't do anything And This is something that is really common actually to thank this and it is so common that people on the internet has Made challenge some kind of challenges It's not really a challenge because there is no winner or loser But it's an exercise to make you refactor some codes. This is this one is a gilded Roscetta There is going to be other ones. I Forgot on the first slide there was the The URL for the slides I will go back to the first slide at the end of the talk All these are working links so you can click on the slides and you will have all the links, but you can also take pictures So this is the first link is where I got the code It's really nice repo with the original code in many different languages including Python 2 that tree sorry But we will work with Python 2 and the second URL is Where I pushed all these steps of the refactoring that we are going to do together But this is the first section of the afternoon of the last day So I guess I need to keep you awake. So I'm going to be asking you some questions I'm going to ask you to participate. Are you ready to help me refactor this? That's for people Okay, thank you So this is a new formula that I'm trying today I hope it works well First of all, so we're going to read the requirements of this Refactoring because we're new we were new we're new in the company. It's it's looked fine We we got a nice contract, but it's our first day on the team So here's the assignment and I'm going to read it with you Hi and welcome to the team gilded throws As you know, we're a small in with a prime location in a prominent city run by a friendly in keeper named Allison or you can Don't call me Allison. I'm a by it's not We also buy and sell only the finest goods and thrown it unfortunately our goods are constantly degrading quality as they approach their sell by date We have a system in place that updates our inventory for us. That's good It was developed by a non-onsence type named leave right Who was moved to was moved on to new adventures? Your task is to add a new feature to our system so that we can begin selling a new category of item first an introduction to our system and so this document is very important because that's Basically the requirements for what we are going to have to do for the next hour And we're going to go back to this document every so often The first thing is that all items ever selling the value which denotes the number of days we have to sell the items by Then the quality degrades They have a great evaluation which denotes how valuable the item is and all items degrades as the sell by dates Comes closer. I'm going to stop reading now We will come back to this later, and we're going to start looking at the code for this What do you think Do you want to touch this? No Yes, that's okay. That's that's a good that's a good start We're going to do test we're definitely going to do test and what is nice with this is that? Somebody actually did us a favor and also provided some fixtures so we can run The current code on the fixtures and have the output store the output because right now there is absolutely no test on this code So our baseline is that we've got some fixtures, and we know that the code works So if we change something we have to be able to replicate to the same results But before we did that This is some kind of simple example, but something that I like to do is that I like to look at the complexity of the current codes and There's a tool for that in Python. That's called Fredon. It's Linked in the in the slide and Fredon allows you to calculate the complexity of your code in various different ways and this is Computing the cyclic the complexity And you see that our update quality methods got a C. So it's not very good. I try to often run my entire code by that and in Prediction code is C is okay, but when you're starting to get D E and F. It's really bad But as One see every once in a while can happen. There are other metrics. This is the one we're going to be using today and we're also running the fixtures so You can run the fixtures for as many days as you want So here the first thing I'm doing is that I'm running all the fixtures and storing the results in a text file So that we can just update our codes We run the fixtures and do a VIM diff between the two text files This is not tests, but when there is no test Being able to output the result of something and compare it later and doing a VIM diff between two things It's a hack, but it works and it can save your life No next thing I want to do we said we wanted to to write some tests and To be able to write some tests I'm looking here at the test fixture program that was Sent to us I'm not able to resize that window So we've got all the items directly in the test program So the first thing that we're going to do is that we're gonna take the data and put it somewhere else so I'm taking all this and This is live Which is probably a bad idea. I didn't sacrifice any kitten But this is only going to be the only live part almost of this talk So from killed it rose Import item since this is the class that we're using for all our data is a class item and Back in this Here we have to import items from Data and as you might see my my VIM is not I have two spaces. It's okay My VIM doesn't really like the code It's not pepe compliant that's okay. We don't care for now So I'm going to quit all this to save it and quit and see if it still works. I Guess I have to quit both files So let's run the test again and It doesn't work because I broke my code. It was a really bad idea to do that part live So Let's go back to Syntax error import items from data from Yes, that's thank you. Thanks a lot. That's that's that's why it's fun to do things like that It's not the right file And the fun thing is that I don't know why but I don't see the last line of text on my screen right now And who could guess what language I've been programming in for the night for the past few days Drivers, thank you. And so if I run this Syntax error were expected Okay, let's let's just Trust me if we got the same results because now I'm going to check out the next I have two bitons Yes, let's Let's not worry because if we do we're going to run overtime. I'm going to Just check out the next revision because I did plan this I did plan that my coding was going to be awful when I was live So everything is in a repo what I'm going to do now is basically I'm going to go and check out the next revision each time So Here we have our data and so we would like to write some tests The first thing that we want to do since If we go back to our description we are going to be able to see that Once the cell dates as past the item decrease twice as fast for certain items The rate is different and so on and so on so the first thing I want to do is that I want to write a few test Helpers that will allow me to get the different items that I need to be able to test their behaviors So Back to my test here, you can see that I have already written some code this one is gonna work and Here I'm going to stop and say If you want it a generally factoring talk You're in the wrong place because we're going to do a lot of things that are only just working for Python Because Python is going to be really helpful. I said this is An exercise that's available in different programming languages and Python is really really helpful to give us things that will allow us to work faster for example We have the first thing here We are declaring a property which is not possible in all languages and we're declaring a property on the test And this is going to be our regular items that age in the normal way and It's a simple list inclusion I'm going to Switch this so what I'm doing is that I'm Just returning all the items that are not special items This is a simple list inclusion It's everybody here familiar with this inclusion or do you want to know how they work? Okay, and so the test helpers We're going to do that for every type of items that we want to check And what we want to check is that the quality increases or decreases as we are told it should do so we're also writing a few other helper functions That are going to to compare the original quality or the original setting date and Give us the list back This is some helpers and Then once we have that we can start writing our actual tests and Maybe something that was not sure that all we have all the items on the side and as you can see the only Way that we can identify which item is what is by their name So it's rather simple. We just have to pass the first word of the name of the item So it's everybody Freddy to go on Yes, three people I lost one Okay So the next thing is that we're going to start actually writing tests and we're going to going to test that the quality of regular items Actually decreases so As you might have noticed And as some people have said in the audience Testing is going to be the main thing that we're going to do before able to refactor So that's about half of the code that we have to write and I'm not going to explain all the testing details If you want me to explain I'm going to show them all but if you want me to stop and explain one in more details Please raise your hand or shout or do something because I cannot spend all my time explaining the test Or this is going to be very very very very boring for everyone So we've got our first test and it passes. Do we still have the video on the side? Okay, great So we've got our first test and it passes this this is the road to progress Next thing to do is to test that Quality degrades, but also the sell by the degrades. It's almost exactly the same test So while we're doing refactoring, let's refactor our tests and write a method that takes an attribute which will be what we want to measure and make sure that it decreases and then call that so let's run that and It fails oh That's that's not fun. Why why does it fail? What what does our cheat sheet say why why would that fail? Oh? Here we this is the reason why See I remember I looked at it before I knew where to search So the HV item actually increases in quality the older it gets so That's one. There's also This one the sulfur is I didn't know what the sulfur is never ages It doesn't change it doesn't decrease in quality. It never has to be sold So this is this is our culprit. The other one is about quality, but this this one this one Is the one that is posing problem so Let's fix that And so we need to to declare another helper. That's non-silver's item. So that's the item that do age correctly and Instead of testing on all items are just going to test on Test on this one on the non-silver's items So let's go back to our test. We now have to test passing This is progress. I still got two people. I'm going I have I have to to increase the speed of Talking about the test So we're going to be testing other stuff like the regular items decreasing quality twice as fast when they are explored and We've got three tests passing next one When does it stop there? We're going to test that the quality is never negative because Quality is something that doesn't go below zero. It either doesn't it's not worth anything or it's worth something But it's not worth minus something French cheese who likes French cheese Okay quite quite a lot of people about half of the people so French cheese you might know It increases in quality. It's like wine when it gets older So let's let's have a test for that too And then we have all the other specific things Like the one we mentioned the sulfur is that never changes The back six stage passes that are quite complicated This is the most complicated test we have the back says the backstage passes The increasing price in quality the closer you that you get to the date of the concert But after the concert, they are not worth anything It all makes sense So we've written all the tests for everything and we now have a test passing This means that we can finally get started Well what time is it has been 20 minutes So we spent one third of our time just testing what we had no we can we can start actually doing some work And the first thing we're going to do is to write a failing test And so to write a failing test we know what we have to know what what we need to do And so we have to to add a new feature this one We have to be able to sell conjured items which degrading quality twice as fast as the non normal items So that sounds easy, but none of you wants to touch the current codes. I don't either So let's first Go back to here and write our test for conjured items So I guess there are two different cases that we need to to account for We first have the non expired items that needs to decrease by two since they age twice as fast and The expired one have to decrease by four I'm also adding some test data so that we have some more complete test data and We can test that and we can now see that we have our failing test. Yay Thank you. I've never seen so many people upload for a failing test. Thank you Next thing and this is the second thing you can see the the threaded message there on the bottom right live So this this may fail I'm going to actually write the code for that If you if you notice something we are dealing with items and We already have an item class at the bottom of this file What do you think we should do how could we Endle different things that are almost similar but act slightly differently subclasses yes, and so since we have subclasses means that We're going to have to shift the responsibility of aging from the main Collection to each item. So that's what we're going to do right now And I could very much delete all this code I Should at some point, but what I'm going to do for now is that I'm going to comment it out just in case There's something that goes awfully wrong, and I have to take a look at it I really don't want to do that, but just in case I'm going to to keep it and comment it out and So since we know that we're going to do subclasses What I want to do is I want you to just start with item and define What does a regular item do so? Let's see your if you're still awake. What happens to the quality of a regular item every day Decreases by one so dev update quality self self dot quality Minus equal one what happens to the selling date. Yeah, it decreases by one Selling yes selling sell by its So self dot sell in Minus equals one Okay, so that's for regular items and we're going to start by with that and it should pull is still a few of our tests should probably still pass but Most likely not all of them So I see what happens we have six failures Six failures out of nine. That's one third of our test passing. It's still still good I'm sorry. I cannot hear you Okay So the next thing that is that I remember for the definition is that Is this one and we're going to take them one by one once the sell by date has passed 20 degrees twice as fast We could do a new statement in the update quality, but that's in the end that would bring us back to where we started So this is this is not really what we want Does anybody has an idea how we could implement that? Yes, exactly. So I'm going to say out loud. So what was proposed is a degrade method or property that would calculate by all much each item should be great and We can do that and Except that we're going to call that freight to know at which rates it degrades So this this here we have a property rate now And if the ceiling date is less than zero then the rate is two otherwise the rate is one and Every time that we update the quality we update the quality by one times the rate That's good. It's easy so far to do refactoring so Five failures we fixed something great Next one The quality of an item is never negative Well, we can do something complex with a main or something, but we're just in this case We're going to add an F so a Simple test at the end of the update quality method if the quality is under zero. We just put it back to zero and for failures Really easy so far does it get more complicated afterwards Oops At the right screen. The next thing we have to take care of is That French that French cheese again, which actually increases in quality Can anybody have an idea on how to handle that? Subclass. Yes. Thank you. What people is still awake. Can you make some noise to tell me you're still awake? Okay, so subclass aged item Here underneath it and the decrement for that we're going to add a decrement property to regular items and We're going to run the update quality with that property and for aged item is going to be minus one instead of one So if we decrement by minus one we increment by one we make the quality go up So this should work shouldn't it? That doesn't work Why No, no, we had four falling tests with six failing tests It's probably because I I I didn't show you all the code We we know we have items. We need to get the proper class for those items so We are With I've added a method and I'm going to show it to you It's really hard to type something when you don't see so there's this get specialist item for which is a helper method Which will help us get the the the regular item the item for the class So now this means that we're making a copy of the original item and we are updating the copy of the original item And all our tests are done on the original item. So what we have to do To fix our tests Is just make sure that you are testing On on on the copied items so here The code previously was for item in items And items was fed to the original class And now we are going to test for item in gr.items So which means that we are going to actually do the test on the item that's updated This is something that is easily That's very easy to get from when you use a refactoring You say, oh, yeah, I'm going to do something different I'm going to do subclass and then you copy something and You wonder why nothing is working anymore. It's because you're updating the copy. You're not updating the original So you have to make sure that you test the right thing So we're back to four failures Okay, we're back to four failures That's the problem because we had four failures and we were trying to fix something What else is wrong? Well, I could ask you But I'm going to show you It's easier. Here we have The test for quality of Of aged items That was failing and now we still have four failures But the third test that fails is That the quality is never over 50. So we actually solved the problem, but we created another one So We're going to fix this quite easily We're going to do with like with quality It's never less than zero quality can never be over 50 if it is we put it back to 50 Why did I use self the max quality in some places and 50 in other places? Because I didn't do that on purpose But so does that solve anything? Yes, it solves it. We are now down to three failures We're making huge progress So the next thing is to write Why am I showing you the answer already? You have to participate. I'm I'm hiding the answer Okay, so the next thing that we're going to do is we're going to read the next line Sulfurers does anybody know what the sulfur is What is it? It's a helmet Okay, thank you. I didn't so there are there are legendary items and They have never have to be solved. How can we solve that? you've probably seen it it's The update quality basically during the update quality method. We have to do absolutely nothing What do we do? Yes, subtype and overwrite So that's what we're going to do. We that's probably the easiest thing to do We subtype and we create an update quality method that does nothing Okay, so that should bring us to Two failing tests Yes two failing tests So what was the last one is probably the more complicated one is the backstage passes Backstage passes are complicated stuff So this is probably going to be the The most complicated part I'm going to go relatively fast and tell you the answer. We are going to subclass and overwrite the method But we're not going to overwrite everything We have two different things to do one we have to increase the rate as time passes and then We have something else to do if the cell by date is over the quality then drops to zero So The way I chose to do that Is to have if statements in the rates And just check the selling dates in the update quality method and call the parents if The cell by is not passed You probably this is A lot of you wanted to do the same thing as me. This is not the only way you can refactor that This is the way I chose to This is the way the gentleman over there chose to do it apparently too because he's been Saying a lot of things, right? But you can do that in other ways. You could have Completely rewritten the update quality method and everything but This is this is how I did it So, uh, no, do you remember at the beginning we said that we had Okay, I don't know. We only have one failure where we're back at the beginning We we now can start working Um, and do you remember that we said that we had text fixtures? So now it's a good time to check the fixture output And see if we have the same thing We don't have the same thing But if you look at the right part of the screen, I told you that I did add some fixtures So the only difference is between the two files or the fixtures The the three additional fixtures that I added So this means that this works Great. No, I'm going to ask you again Now that we've done a lot of the work How can we implement the last feature? Am I right? By changing the rate. Thank you So we're going to try to do that Okay, and this is where I messed up my script I didn't want to solve the This problem yet because one thing I didn't show you and I didn't mention Is that I got a little note here at the bottom Feel free to make any change to the update quality methods Right as long as everything still works correctly or if I do not alter the item class Or there is a gobbling that's not going to be happy. We did change the item class Oops So did did we write all these codes for nothing? Or can we try to fix this in an easy way? Yes, we try to fix it. But how? Okay, so here in python, there's something that's uh, there's a design pattern that's quite easy to implement It's called the proxy pattern So everything that we wrote for the item class, we can just move it down to an item proxy class And the item proxy what it does is that it takes the an item As an input In the init method it takes the item And right when you try to get the quality or the selling date on that item proxy Is going to give you back the quality of its item And when you try to set the quality or the selling uh date on that Proxy is going to set it on the item So what we're doing is that we're wrapping each item in a in a proxy. It's like If you wanted to put it in a big plastic bag And when you look through the plastic bag, you see what's inside of it But it's just inside the plastic bag. So we don't change the item Class we just wrap it in a proxy And everything that we wrote All the specialist class they can be specialized proxy and we can wrap any item in its own proxy That way we don't change anything to the item class And the only thing we have to the only other thing that we have to change to make this work Is that we have to change this get specialized item method and Let it return an item proxy instead of returning a Returning an item um, I guess I didn't explain this so, um There's a regular expression who needs uh, who is familiar with regular expression Okay, most of you for those of you who are not This basically means that we're taking the first word of the name of the item That's that's what this regular expression means then We try to Find a class that's we're going to be using and we can not use class with a serious variable name because Yeah, it's already used for something else um And the class is going to be item proxy if There is no first Word in the name. There are some special cases that start with plus five and stuff like that So there is no first word in the name or otherwise we're going to look At all the variables everything that is declared in the current module And try to get an item proxy by that name like h item proxy or something like that And if we cannot find it the default value will be item proxy So everything special you give me the special proxy everything non-special you give me the regular proxy and so we can Re-update our tests So that's um the test friend on The test friend on regular items as well as the the fixtures we can Run them on items and we don't have to run them on gr.items So that that that fixed our issue with the goblins because who wants to have troubles with goblins Okay, so now let's actually fix this and let's go back to the solution which is So the fixture back there Which is to add Different rates for our conjured items And so all we have to do is to create a new class with a different rate So the new feature actually implementing the new feature is two lines of code Only two lines of code All the everything that we've been doing for 45 minutes has been Just getting getting us ready to do that So why did we spend 45 minutes doing all that? But because we're going to keep working for that in and we did nobody here wanting to touch that code No, we did spend 45 minutes which we Would probably have spent to read what the method was doing and try to understand it But now we have some clean code and know that we have to make a change. It's only two lines And just to make sure everything passes the nine test pass And finally, I I'm a bit curious You remember at the beginning I ran the complexity test So we get something that are a bit complex. We are getting a specialized class. We have a method for that Um, what is the complex the complexity of the new code? Hey, hey everywhere. So Oh, thank you um So of course in real in real life code a everywhere is something that you cannot achieve You will probably not achieve that It should not be A metric in itself to try to well to have all a's but try to have as Few d's e and f's as you can And stay everything mostly in a and b and sometimes c There are other things. There are other uh indexes that you can measure with radon.  It's pretty simple every time you have a need for a narrative It's you add one point and so that's how the complexity is measured and then it Makes some computation with the number of lines and everything this library also Gives you a maintainability index. I'm not going to explain that formula. Um, that's um Something that's not useful for this kind of refactoring But it's basically based on the number of lines in the file and the number of lines in methods So it's going to be really helpful to have that the tool is called radon or adon You will have the link in the In the slides and just to make sure We can take a look at The side by side we have a lot a lot more items On the on the new code, but everything every new item is very simple. So now you see side by side and uh That's about it. So I was a bit fast So we have time for questions If you have questions, please lean up Thank you. That was an example where you have like a really clear specification Yes, but what strategies do you use in order to get the specification out of the initial mess Okay. That's that's a very good question. Um, it the answer is it depends If you have something that you trust in the organization that you can go ask questions You can go try to try to find this information If all you have is a bunch of documents Uh, you're better off, uh, trying to read the the actual code the current code trying to understand it and the part that you don't understand Don't spend too much time trying to understand it. We in this case, we had some fixtures You probably have in whatever context this is you probably have some data and you can just run The existing code on the existing data see how it behaves and get Try to guess the specification from that Depending on your organization There's some somebody who should know these things and you can ask maybe it's not somebody you trust but somebody from the business side Uh, if you're in a in a large company, you're in the it department You're told to do that you don't have all the specifications because someone left Well, this is uh for the sales department Get up go to the sales department find the person who's using this thing and ask them How is this supposed to work? um There is no miracle recipe it really depends on Where you work in which context But there is always at least somebody that has a big idea of how it works either. It's the final user Either it's your client that you might not be supposed to talk directly. You are supposed to talk to your manager Don't call them send them an email or something But try to get in touch with the person who actually needs to use that code Hello, um, I have a question related to the business side of the justifications So obviously as an engineer, we wanted to always have the clean code And then if you go to the the client and look at the code Oh Your whole code need to be rewritten and reflected So how do we handle that pressure like business pressure say you pay me the money? Suppose I just add one picture however you in the end you said Like this every code need to be Changed then and uh, they they say Hi, you just for I didn't want to line but use in the end you change everything and take that long time and then It's it once again It depends in the the example that I gave at the beginning of the talk the client Are it me to make things more maintainable and faster? So Rewriting is part of my job Um, when it is not explicitly part of your job It's hard to justify that you spend Three three fourths of your time refactoring something Instead of actually working on the new feature. You don't have to rewrite the whole code of the client Here this was the whole code of the client we reward almost everything But most of the time your feature the feature that you're going to have to implement Is probably going to be one small portion Is going to to involve one small portion of the code of the client So, uh, the best way to go about it and it it also it once again, it also depends on the client And oh, uh, they understand the need to have clean code and stuff if they don't understand Uh, just refactor as you need to so you are writing a new feature You really don't understand that method refactor the little part that you don't understand Create the feature and day by day the code will get cleaner Um, that's usually how I I do it when the client really doesn't want to hear anything most In my experience and not this is my experience and it is different everywhere, but Most clients most and And clients seem to be more and more Aware that they need to have maintainable code So it's easier now to tell the client that a I'm going to do a little bit of maintenance on your code Then it was maybe five years ago You're welcome Um Yes Hello regarding the radon tool is a static code and license tool I'm using Sonar cube for my project How does radon act with Django functions and models and so on? um Usually, uh You get a b Uh You get a b for most models It's hard to you to have models with a it depends if you have fat models or skinny models For everyone fat models is where you have all the functionalities of the model inside the models Skinny models is where you have a surface that takes a model and changes the model when you want to For example mark an invoice as paid So it depends but if you have fat model you can you can get away with b's and c's uh, don't expect an a And sometimes if this is something really complicated you might get one One d or something Thank you. You're welcome Anyone else? If not, let's thank our speaker one more time


What is up, my cranky crew?  Very itchy. We're back in Boar of Sray. We got, we got the, whatever it's called, the def, it's like a defibrillator, the deflector. What is this called? I can't remember. Yeah, excited about it. I am excited about it. We're with Doc now. We're gonna get back to, to Shamus. Oh yeah, it's probably not working. Electricity's been cut. I can probably fix that. Well, I bet I can fix weight that way. And then you, can I get up in that vent? Is this a thing I can do? Nah, hold on one second. No, no, no, no, no, no, no. No way. Wait, but there's, wait, hold on, wait, hold on. Let's figure this out. Okay, cause I can't go. Yeah, I'd have to be here, right? Oh, whoops. Just a little bit further and then we'll be there. Okay, ha ha, little guy, hee hee little guy, hee hee. This feels dangerous. Yeah, just try and mess with, oh, wait. Ha ha ha ha ha ha ha ha, I forgot that it overheats.  Bang, bang, bang, bang, bang, bang, a ring. There we go. Friend, get off of my friend. Okay, we gotta, we gotta go. We gotta go, mister. We gotta go, we gotta go, mister. Okay, so now I need to, I need to be, whoops, whoopsies. Whoopsies, stoopiesh. Need to make sure he doesn't get killed. I'm doing great, I'm doing just swell. Just damn swell. Hold on, I really am loving this game a ton so far though. Um, it's got so much charm, so much charm. And it's just a fun time overall. Okay, let's let, so we'll let this cool down. Go over to Doc, hey Doc, don't worry, Doc, I've got you. Oh yeah, make a run for it. See, a couple of them will get in, Doc, and that's okay. That is A-okay. Because I've got them right where I want them, ha ha. Good job, Doc. Woo, that was close, let's go back home. Yes, let's, well, frames. Got a little frame-rady over there. Okay, we're to now, St. Doculus. You really take a long time with this. Is this the door? Wait, but we like slid down a whole thing and stuff. We've got quite a journey back, don't we? Or do we not? Does this just go into the city? Why Georgia does? That's so nice. Thanks for saving Doc, little friend. It's great to see that Seamus is no longer alone. It is, now that we can, now we know that we can fight back against the Xerx. Momo has been waiting for you by the sewers. Oh, a very old binary code, only a real geek. Okay, hold on. Let's, Doc and Seamus look happy. I think we did a good thing together. I think so too. Hey, Doc, meet? Hi Teddy, what's up Rosie? Oh, Billy. Do you know my son Seamus? Just thanks to him I came back from that damn place. Talk with Doc. And my fellow outsiders, did they find a way out yet? No, I want to show you something, Doc. Okay, that's fine. Where did he say that Seamus was waiting for me? By the bar? By the by? By the by? Where did he say that Seamus, or Momo was waiting for me? The sewers. Oh wait, have you done everything you wanted here? Because I'll close the door behind you. I don't want Xerx coming through. Okay, cool. So I do actually want to do a couple more things actually. That's so fun. Can I do it again? Oh man, I want to do it again. Okay, I need, I think I need three soda cans. I think it's what I need. I'm going to do a little bit of exploring now before we continue, because I want to, I just want to get a couple of things. The music sheet. Music sheet, what do you want? One energy drink can. Oh, there you go. There you go, there you go. My light just went out, sorry about that. Gain new item. Hell yeah. Now, then we've got, it's like a blanket. Okay, so there's a few things that I want to do. I want to talk with Doc and just have him decode the thing. I have things for you. So I have four, five, seven, eight, six, four, five, six, seven, four, five, six, and seven. Look at this. That's so nice.     Is this way? Okay, I need to go to Elliot because I bet, I bet he would know. I bet he could do it, decode the thing, I mean. So let's go ask him. Hey, Elliot, Elliot. You want me to read this binary code? Just a second, I need to calibrate my lenses. It means doofur bar. Strange, who gives rendezvous binary code? Damn. Okay, doofur bar. Okay, well where is that? Is that the bar, the bar? I don't know if it is or not, but I suppose we will find out. We need to go this way then, up and over. Hey pals, hey there pals. Is this bar? Yeah. Oh, okay. I'm gonna take a picture of this with my phone real quick, just to see. I don't know if it's those numbers. Hey, Jacob.  Like that, okay. Well, okay. Can I, we can change the music?  Hell yeah. Ooh, remember, was there some foods? Did it really consume this? Their original design didn't have a digestive system. Maybe they somehow evolved by mimicking humans? You think I should try some of it? I don't want to be disrespectful of their ways. Huh, interesting, interesting. Who are you? Hi Carl. This is the newspaper from the people living above on level two. It's a few years old. It's something to read, okay. All right, so let's go back. Let's go back to that spot. And let's see if any of these numbers work, or what I read. Use the digit code. Okay, let's see. We have 0476, nope. 2477889, nope, four. four that's the only ones that I can do was that not it two four six six oh nine nine five which we can't do because there's no zero seven eight eight nine four four five seven am I sure that that's a four yes damn it did I miss something was that not what the numbers were let's see hold on let's go back again cuz I really want to get that I want to get that I want to get that there's something around here six nine eight seven one two eight three ha ha ha ha we've got it we're mystery solvers guys we're puzzle keepers music sheet ha ha we've got it cool down think I can play this look ha ha he's completely jamming look at him look at b12 in the back my backpack damn like that a lot mister thank you for that music I will practice do you think you can find more yeah the way you compute tonight that's a nice one hear me out we got a bag on our head it's time to go here we come this is dangerous oh wait he's oh okay all right no choice I thought I was gonna have to like talk to somebody to get them to shut the thing but I guess not hey mama dude we're going down a river it's like Charlie in the chocolate factory going down the tunnel love can't believe you found doc and got the defluxer but this now we can go find the balancer let's go okay I'll sit at the front and I'll be my like so we can see are we gonna go down like a river of rapids that would be kind of cool that be kind of dope tbh kind of dope and lit and sick and making the little outsider I want him I want him straight on huh hey what you making noise about what you saying this is so pleasant so so pleasant and it may become unpleasant very soon a bunch of zerks everywhere who knows who knows my time to shine huh God yes I've got it got it real nice don't forget to pick me up whoa it's a little glitchy wow wow wow wow wow we are what's the range on this bad boy like you might be able to get them well I don't know what you're saying your subtitles aren't showing what they're gonna drop from the ceiling don't even try it don't even try it watching you up there little zerklers I think this water is cool to swim in it looks really nice really really nice little hacker aren't you just a little hacky my time to shine all this whole machinery is broken now I think we can only open it manually how strong do you think I am I'm a cat I'm a kitten you think I can open these things you think I can do these things I cannot I can't go on with you but I won't stop looking for a way you find some bald sir in Clementine tell them I was brave but you're not gonna die here I'll be back don't be so dramatic such a dramatic guy that Momo such a dramatic guy you'll be fine Momo I will find you oh that does not look a good eek eek eek hello friends how are you I'd love to just give you a little zap if I can just a smidge no the range really is poor very not well whoa can PTSD from those those pipes of all reason I'm down in this sewer in the first place oh that was not good whoopsies I started doing it too early way too early he lights out is it automatically gonna bring them out just do it one at a time that's easy hey I like the little pop nicely done me yeah I would I would actually like to avoid them as much as I can just as I can nice I wonder if we can get upgrades on this thing that would be cool that would be very nice get some range updates that so sweet that would be sweet get a cool down upgrade oh baby no I love upgrades you know Papa loves his upgrades oh he's almost getting overheated don't get too cocky even don't get too cocky don't get greedy come on little little jerks that's big a hefty supply but not unmanageable you just gotta you just got a timer right you know it's all about timing perfect perfect perfect give me a jokes easy alright we'll just get the rest of these guys good excellent perfect yeah what can I what can I even do in here oh this yeah come on little ticks thank you let's ride let's fucking that doesn't sound good oh oh oh oh oh not great not great not great get off of me you get the hell off of me but I feel can they not come down here feel good okay click the last of us just a bunch of clickers where's the big goosher open the door lock probably have to do the other side there don't we yep look at those peepers dude shy and ass peepers don't don't put the defibrillator away yuck yucky yucky what are these big-ass eyes about what is this it's a hive mind it's a hive mind and we are at the core hey are you gonna do something oh no no no no no no okay run for your life run for your goddamn life because we've got the entire we've got the whole industry on our ass Bob and we just preemptively pressing B I hate the way they jump off of me do not get me the doors closing yes like mission impossible you cannot get me is it gonna be like just a couple that's so sad what if I had not click to that just left it was dark I was alone I felt like I was back in the network but you saved me thank you friend trying that much power was rough on my core the defluxer is completely destroyed now we'll have to be careful whoa attack this ventilation system through the sewer again through the sewer again we go through the sewer again we got to be careful little friend got to be careful oh this tiny little hole for me are you spaltz are valid in a traveler from the sewers we've even seen one of you in ages are you the one who contacted us earlier the little outsider spaltz are the outsider has been expecting you he's meditating at the top of our village and village this is cool this machine the scientists I assisted use one of these sick this was his last hope he walked into the machine but I wasn't with him he was alone what's he doing he uploaded himself into the computer and then everything was different but the upload something went wrong he was stuck for hundreds of years until a little cat appeared was it it was me I was a scientist I was human I I need a moment be 12 I'm a cat what can I say it's what I do I just screw some things up sometimes you know it's what I love what else have I forgotten I must have had parents friends what happened to everyone I wanted to open the city but is there even anyone left to save it might not be what is this is this a bald star hey don't you know not to interrupt a fellow during his transcendental meditation oh it's you you were with Momo when we received that call earlier I'm glad to meet you little outsider you know Momo and Doc you're you know Momo and Doc so you're already familiar with us outsiders I miss them their memory brings me peace almost stayed in the slums I heard you helped find Doc and Clementine she's in Midtown now we still want to see the outside she's the only one who can get you she's the one who can get you there apparently she apparently she had some kind of plan to leave the city here take this I wrote her address in the back of this picture helpful to reach Midtown climb up our little village should be easy for a dexterous one like you if you manage to read the outside you'll be the very first I wish you luck but you don't need it I believe in you sir photo mode because it looks so damn good just so damn good let's head out then let's go I am a dexterous one bye bye everybody I'm off to save the world so fun goodbye Aunt Phil I didn't go all the way to the top though that's like the mid and Phil's and village is mid so how do we decipher that uh that address because I have no idea what that says this is a subway station I completely forgotten this kind of transportation existed goodbye you could ride anywhere in the city people used to take it to go to work I used to take it to every morning after saying goodbye to my family at home do you remember your family I remember I was doing this for them but they're gone now it was so long ago they wanted to see the outside but does that even matter anymore what happened to everyone anyway we're near Midtown now let's find Clementine we have a picture of her we can show it to her to some companions around here a bit of the point is in the right direction and subway we're reaching more of humanity whoa there's little robots whoa it's like a whole other thing midtown how come these robots aren't freaking out that I'm here because the OG robots freaked out they were always freaking out yeah how do we show b12 it's a picture of clementine is a balsa told us to find her she's an outsider to the series of symbols written on the back no yeah I know but can you yeah yeah yeah yeah yeah yeah but but what does it say it's not what her door is going to look like a way to find clementine residency so this way for residency here we go three and then five two okay I've got this figured out now just need to go up one more yes three three three three four oh that's not good little eyes peeking clementine I thought you were a scent never mind who are you do you want wait so it's a balsa finally decided to send someone guess you're my new recruit you're not very big how did you even manage the sewers guess you must be pretty resourceful I've been looking for a way to the outside ever since I left and village but the sentinels are always watching they're here you can help follow me been working on the plan to use this old subway for a while I even had keys to start it all we need is an atomic battery to power it I know Neko corporation has one secured inside their facility I have a contact who can help us infiltrate them I don't know his name but he's the robot with a bomber jacket and a gold chain okay someone small and swift like you should have no trouble sneaking inside the factory one last thing don't hesitate to ask around for help this city's full of information just stay clear the sentinels okay well all right then what's uh you do not have a bomber jacket you have a vest okay how do we get to Neko corporation the person arrested was not clementine continue the search okay oh wait hold on huh Neko corp is this way what's in here hey there's cool stuff you're one of those young punks listening math loud music all day don't touch anything don't make any noise don't ask for credit steel jacket should I do that should I steal the jacket okay so we gotta we gotta distract him somehow make something happen back here okay so I need I need music I need loud music anybody got any music back here and then I can steal the jacket I don't know why I need to steal the jacket but but I feel like it's a good thing to do in a sense nobody can enter the shop while it's being restocked seeing how incompetent those two are it might be a while whoa really in his face you guys have any music y'all got any tins isn't it so cool right now so chill I think that nothing bad could happen to us I need some sort of toonage even though this guy bombs me out he's my only customer try not to scare him away please I used to own a bar it's the closest place around here until I took a screwdriver to the knee now it's closed so the skyroom joke I get anything from this guy I need to tunes I need tunes one of the signs talking about clubs closed get lost this trendy is shopping midtown but the shopkeeper is pretty grumpy yeah seems like that you're not gonna steal that okay feel like I don't need it but I want it and I feel like it's important for me to get it what are these signs saying in shop street is there any is there any music stores round here it's all right all right let's keep going I'm busy what do you want nothing I don't want anything I'm sorry geez geez sorry okay let's just continue continue down the path to hell with the sentinels long lives the outsiders how do we can we get up here how do we I thought this was the way to get to the place look like it oh it's probably just this way down there I see now now I see this is that was just a big circle how do I navigate this city eh wait you make a corporate work all day long to gather waste and send it downstairs but they recycle and repurpose it speaking of downstairs it's been a while since I've had news from them so our little one can't play over here make a corporate there is no place for a little fuss ball like you access is restricted but only for a little while you can wait a few years we'll open right back up I see what we have to do so we do have to find some music got to find some music play some songs is there any to an inch around here you've nothing to insert how will we find it wonder it's kind of seemed like she had music like Clementine had music so maybe we can do it that way so crazy it just might work let's find out did seem like a spot for tunes yes yes yes aha no time no time for cuddles time for cuddles and snuggles can I steal this because that would be convenient is there anything I can steal it on I need some tunes need some music I need you to give me some music track down the atomic okay all right so we just have to find I guess we don't necessarily need that we need to find the guy with the bomber jacket orange bomber jacket gold chain you hey life is boring since sentinels put cameras in our resident what do you have tunes grab a cassette tape yes hey those tapes are ours don't you know how to steal I can give you one but you'll have to do something for jenma me going to sentinels have been sold three security cameras we don't like that but you can get them off our backs well I just did one by accident there's one easy peasy I've got this it's easy it's easy peasy easy that's one that's two where's the third third over here where's that third one it where is the third one I don't see it they have another big one it's a third one to where's the damn third might be up high but I'll talk to him anyway you guys have accidentally see those three security cameras okay where's oh right in the center easy easy easy all right security camera you're going down baby oh is he up higher yes yes but I'll go it we do a little bit of parkour right here we like to do a little bit of parkour when we can bye bye bye bye now we have what it takes now we have what it takes hell yeah can I have one of those didn't think you'd do it take a prize you earned it we've got it now so now we can go and wreak some havoc do a little bit of thievery let's do a little bit of thievery huh boom boom boom said a boom boom boom let me hear you okay so now we need to find the dude with the bomber jacket do not see anywhere orange bomber jacket orange bomber jacket waiting for ages for stoop lash to get back and help me basses boss is not happy that guy's slacking off at the bar again he has another thing coming okay at the bar huh witch bar you resin put tried downloading an aimbot to be the best that's the game food and it managed to be malware don't worry I'm really good at this game who are you Memphis who are you in you oh buddy oh buddy not doing so hot huh what do I need to knock over let's get up here oh no an entire case of beer you got it yeah you got to get back to work my guy you got to get back to work if only he had his hard hat on you know yeah we're saving people all over the city all over the city oh here go do that thing please get it done he's drunk he's drunk as hell there you go do the box do it quicker well we got that we just need to find our man's where is he quite sure I need to find him I feel like he's in the club what about this how do I find this man do I find you know work is work is work slippy don't lose your head about loving the tunes loving the tunes okay I don't know where to find this man's feel like it's not in here he's got to just be somewhere around in the city in the city this this isn't a bomber jacket tomorrow if I replace my arm with another robotic arm in the next day my other two that my body and so on so on tell for place all my parts and upgraded my software will I be the same robot that's true that's the thought experiment something ship I can't remember what the name of the ship is but it's the same concept if you have an old ship and you replace every part of the ship is it still the same ship hey I'm off to work see you later oh honey be cautious of the sentinels they're quick and they're quick to make arrests for no good reason don't worry about me babe I'm good are you off to work are you leaving quick to make arrests bomber jacket cold chain cold chain bomber jacket oh I can't find anyone out here wait you have a gold is this a that's not a bomber jacket silly where did you get that oh you're with the white contact me brief you about the atomic battery factory right there but this whole area is restricted and heavily guarded they check every person who enters and turns away anyone who is not a worker well boy oh boy do I have something for you here's an idea go get me a worker jacket and worker helmet while I stay here and check for a good time to enter I've got it yeah perfect still need the worker helmet oh I've got that excellent I'll get dressed now my turning around yeah I don't want to see your I don't want to see your nuts and bolts if you know what I mean these are great little snug around the waistline but it'll do okay hop in this box sneak you across checkpoint I get in the box I'm a cat I am in the box my cat who's in the box let it work do you cross your fingers this way or this way yeah it's the goods we need thank you appreciate you wonderful got it are they're not gonna notice the other cat though I need to stay at all on the side of that back at the box you didn't see anything you saw nothing where do I need to go what are you doing you didn't see anything that's kind of fun nice nicely done nicely done me I'm a genius thank you a little genius they would never know how would they know they're not gonna know nurse gamers yas but how do we get across there the question me I know is this gonna work yep just a little barrel find in its way don't worry that's just the force of whatever oh wait you need to follow me just a little I see now how do I do this I think we'll come here this is not good quick let's go yeah we gotta get this battery to Clementine okay oh yeah my bucket is my friend the bucket is my friend I'll never know how could they know how could they know I'll never know they didn't even know a cat was there so you know couldn't know it was me they could not know that it was me they're looking for Clementine dead God whoopsies I thought maybe I could get away with it you'll never get away with this we've got this got it nice no no no no no no Clementine are you here oh no son of Clementine it's like some sort of coded message we're gonna have to play detective and figure out what happened to be 12 in the cat the answer lies in my stuff and then there's four symbols signed Clementine okay plant something bong white got this this guy my sensors can only detect harmless chemicals in a gaseous state they can't recreate common they can't recreate the common sensation I remember like me companions can't smell so I wonder why they do there's also a message hidden under the container says I'm with okay so that was a plant right what an odd thing to have in an apartment this is the companions here see humans it's kind of funny look something's been left there it says come to so the thing smoky thing you found something I don't see anything are you sure I have no idea what it is but it's close mesmerizing sorry I was elsewhere didn't even notice a message here it reads nightclub okay so I'm with who are they with though are they with aha the crystals to Jim of medium value and low purity this glow seems to have been artificially added maybe to ask for says blazer I'm with blazer that's it let's go find her we don't have much time let's go how do we get out just have to wait don't worry about me I'm just a cat there was blazer at the nightclub but how do we get in I'm gonna let me in it's not for you go away hate this club it's full poses but at least there's no sentinels here danger groove level at two bouncer is going to let us in I think we're gonna have to climb at the back again climb at the back you say I'm very good at doing that hey how'd you get up here gonna party with us here jump in and go drink it's nice all right where's blazer it's like dafunk funny funny is there a lower floor and if I'm honest I don't even really remember what Clementine looks like bartender probably knows if he balcony is close it's been reserved by some blazer guy we just need to find a vantage point it's turning back flip that nice have to go over to the other one can I take that what the hell where am I gonna find a leveler base oh my goodness it's a gab rage this is a gap style friend somebody stream I was like wait what take strange drink I'm gonna tell them to play it DJ matchy here let's get the party started use the drink somebody somebody get me a leveler base gotta be something around here oh no I thought I was gonna die in the dishwasher and memory of lines and spirits human my friends and I would gather and party into the night even if we had to suffer the next annoying consequence suffer the annoying consequences the next morning felt good to find joy despite the unlivable surface in the underground living conditions become more and more I didn't read that last word the police they created by the Sentinels now remember why they were doing that it's there a leveler base others fly stuff down here that's fun can I do anything at that door is anything down to ooh there's electric stuff is there anything down here that I can use at all or is this just for memory just for memory's sake I think going back up but I need something dude where am I gonna find I have that this club sucks when I try to go to stupid VIP room they kick me out me can you believe it still this lever just for cakes give me a drink oh baby do I have a drink thanks here you go as promised thank you thank you we jump we jump and then we wait laser where is he going maybe I should have met him but two birds with one stone you're not as clever as you look at anyway nothing personal business is business this is so good business money and I value money more than friendship or camaraderie they're all yours she she's bad oh Sentinels little senties did he just kill me he just killed me I got the achievement Alcatraz it's like Alcatraz and that's not funny and that funny all right friends well I'm going to end this one here where will we go next I don't know I have no idea I need to eat food because I haven't eaten yet today and it's already 1 o'clock have you eaten food today you should go eat some food have you taken your meds today you should take your meds if you need to take your meds anyway thank you guys so much for watching hope you enjoyed and I'll see you in the next one so bye


Hi I'm Lucy and in this video we're going to look at bar graphs. Data can be completely overwhelming. I want to investigate how population has changed in these cities. But these numbers are just numbers that don't mean anything to me. In a table like this, the data can be a little tricky to compare and to really get a feel for. In this video we're going to discover how great bar graphs are for providing us with a clear visual, which is easy to read and interpret. So looking at this bar graph, we can now easily compare the populations of these cities in 2016. It clearly shows us that London is about one quarter the size of Tokyo. Or we could even have all three years on one bar graph and compare the changes. We can easily see that some cities have only had a small population change, whereas other cities like Shanghai have a much larger change. Bar graphs are used to compare the amounts or frequencies of different things. So for comparing different populations or frequencies, the taller the bar the higher the frequency. Heart disease and cancer clearly cause many more deaths than anything else does. The bar graph can be this way or it can also be horizontal. Both are correct and are equally clear and easy to read. A bar graph should always have a title that makes it clear what's being shown and labels on the axes. Most important are the bars. See how they are all the same width and there is a gap between each bar. Most bar graphs have this gap because the data is discrete. You're either in one group or in another group. There are some special bar graphs where the bars do touch called histograms, which we'll look at in another video. Our frequency axes then needs to go up by equal amounts. On this one we've gone up by 10 every time. So let's turn this data into a bar graph and it looks like this. The frequency needs to go up to at least 3,500 and I've put lines in every 500. We could have gone for lines every 100 instead for example. Work out what best fits into the space available and the data you're working with. So back to the data. 3,500 football fans means the bar is this high. From the bar graph can you work out how many field hockey, tennis and baseball fans are all worldwide? Pause the video and give it a go. Did you get them right? Here are some questions for you to do. Pause the video, work them out, click play when you're ready. How did you get on? There we have bar graphs. They're really useful for comparing different sets of data between different groups. The higher the bar the greater its value and they can either be vertical or horizontal. Watch our video on pie charts to see an alternative method for displaying and comparing data. If you liked the video give it a thumbs up and don't forget to subscribe. Comment below if you have any questions. Why not check out our Fusco app as well. Until next time.


And moving on to the business news, the federal government says outcomes from the last edition of the Nigerian International Energy Summit's NIES have been has been embraced and utilized by the government policy makers and oil and gas sectors to effect development. Minister of State Petroleum Resources Timi Per Silva made this known while briefing newsmen on the forthcoming edition of NIES 2022 Targs revitalizing the industry future fails and energy transition which is scheduled to hold in Abu Ta from February 27th to March 3rd. It said the push should diversify Nigeria's economy and drive industrialization through a focus on domestic utilization of natural gas which culminated in the declaration of 2020 as a year of natural gas for Nigeria emanated from the summit. Hello hope you enjoyed the news please do subscribe to our youtube channel and don't forget to hit the notification button so you get notified about fresh news updates