Hello everyone welcome to another video So I thought I'd make this video to explain why I would do something so stupid as to run nearly 100 kilometers in a space of around 10 days So I thought I'd make this video to show you What my mindset was like going into this? Why I actually did it how I'm feeling right now and here. Yes, I do have the commemorative What says the ultra London medal right here? Actually quite proud of this to be honest ultra London 55 case now Max max you were involved with this with me max was my support crew and He was there by my side handing me gels handing me water looking after me. You got some questions for me max Let's ask the questions that people In the comment section, I'm going to say there was about 50% people Criticizing what I did and 50% people supporting the challenge. I understand I completely understand people Being critical because I would say the same thing that the critics would be saying is why the hell would you do something so stupid? You could cause a long-term injury But what he got for me max Quite simply why did I do it why now this started basically this type of it was more about a mental challenge And it started with the guy called David Goggins, which I was Consuming his content basically and this guy He hadn't done any type of running for about a year and he was really overweight and he ran a hundred miles around running track without no running training prior to that and he caused these stress fractures on his shins and He kind of went to a different place in his mind to overcome this feat And he wanted to qualify for some crazy ultra rays called bad waters But to do that he had to run a hundred miles So he did and I thought that was crazy what he did what he put himself through what he put his body through He taped up stress stress fractures on his legs He was you know, he put his body through he had to go to hospital afterwards basically, but I never thought It was humanly possible To do what I did. I went 70 miles in that 70 miles.  So I thought that's crazy a hundred miles. What's that 160 kilometers, you know So he kind of put it in my mind that your body is actually capable of much more than we actually give it credit for Now we did the marathon didn't we did the marathon I did it the next day I was like, you know, why can't I run a marathon basically on no training? Let's give it a go gave it a crack my knee started to cause problems and I'm basically I think Instead of it being actually an injury. I think it's more my IT band you know Cramping up and causing the knee pain So I think we should move into the next question. How is your knee? How is my knee? Everyone's worried about money because basically the 55 kilometer run video is just basically me Running with a sore knee the whole time nearly and that was exactly how it happened after about the second kilometer in My knee started to hurt and we already preemptively planned that I knew money was going to start to hurt because I did a little treadmill run The day before and I could only last four kilometers without money with money Causing me issues. So we got these knee straps. I've got this support thing for money And we have to strap it up straight away. So basically I ran that the whole time with Sony We interviewed Fiona Oaks literally the day before All right, Fiona Oaks is missing a kneecap, right? She's never gone to the start line of a marathon without a Sony and she says that I will show you a clip right here So you always have that's what some people say to me about my knee I know somebody once said you never go to the start line of a marathon No, are you carrying an injury? And I've never been knowing I'm not carrying one. I've always got a bad knee So but I've got so many other Worries going on that I don't kind of notice money because them it's like this hurts and that hurts and the packs heavy So she always has a sore knee so she was in the back of my mind too now She did one of the toughest foot races on earth called Marathon disables in the Sahara desert running through the Sahara desert It's how many how many cases it 250 K's through the desert up sand dunes. They only give her like small amounts of water You know, it's crazy. You camp out there in the sandstorms. It's crazy She didn't have I think it was her first one She did with a broken toe fractured foot her horse stood on her foot So she had the bone sticking out of her foot through this marathon marathon that You know men in the military quit from and cry.  So my knee Basically, we get to the question of the house money money's okay. Like let's let's pan out. I'll show you. Okay, so there's my knees Let's just do a squat We good Boom squat boom jumping squat Jumping squat came on these are right. This is about a week later to be honest, it took me a long Fair few days to recover from this one because I did it back to back from the marathon basically so anyways I'm watching the Fiona Oaks movie and I'm like, I'm gonna look up if there's an ultra marathon So I think the start of the movie a movie. I looked it up the end of the movie. I've already signed up So it was more a very spontaneous thing now I don't know like What you're saying like all the experienced runners out there You can't just go out and run a ultra marathon after a marathon look at your suffering the whole time The whole point was that to me to put myself through that suffering to challenge myself mentally to see what my body's actually capable of Obviously, I know I'm on the right diet so my diet can sustain this obviously. I had no base level running training I haven't ran for about three years. I think something like that But my body pushed through it and it was only to the very end like the last couple of kilometers That my knee really couldn't take it anymore. I think that the muscles were tightening up my RT band and it was just causing money Pain so it wasn't an injury. It was more my muscles or something like that because money is actually okay so it's interesting how your tightening of your muscles can cause pain excruciating pain and It might not be an actual knee injury Max you got any more Questions what inspired you to yeah so my inspiration was this David Goggins guy and finishing with Fiona Oaks and also like I wanted to Sort of show people that hey, you know, I'm not even an athlete and if you think vegan diets are deficient I'm not even an athlete. I don't even do any type of running I do weights mostly upper body right and I can run nearly a hundred kilometers in a space of You know just under two weeks without any running training. So the diets fired obviously like I've got some Pain, but I haven't got no running base. I'm doing some crazy ultra marathon after I've done a marathon with no running train Of course, I'm gonna have pain, but it just showed that I could go the distance on Vegan diet. Yeah, what I felt like before the race I guess I felt really inspired and motivated and I really wanted to push myself You know, oh, I wanted to push myself. Do I recommend other people do this to themself?  So the whole video right was a warning at the start and Was like wow, I'm in pain. This wasn't a smart idea You know so not not I'm not coming out here going. Hey guys do this. This is smart This is yeah, obviously you can cause yourself serious injury. I didn't luckily I Was in pain. Yeah, but I pushed through the pain But as soon as I literally thought that I had done something wrong, I couldn't land on the knee anymore I stopped I was started walking and but uh, yeah, you could seriously hurt yourself doing something like this But I actually feel really accomplished I really feel like I done something that I didn't actually thought I was capable of and It's crazy how you can push yourself past your limits But going into it, I don't know.  She runs up sand dunes. It's crazy The hardest part of running 55 kilometers, I don't know if I had a bit more of a running base I'm sure it would have been a lot easier.  It was nothing to do with my cardio it's it's my Nutrition okay, and can I mentally overcome the pain barriers? So like look I just want to tell everyone that is worried and concerned that I would have shared the same worries as you You know, I used to tell people don't do running. It's really high impact You can cause knee problems, especially people who are a bit overweight and I knew to exercise I would say like to cycle maybe walk up hills or but you know, I Really think that a lot of the fear is in your mind So be obviously be smart, but I for me personally I did not think I was capable of Running the ultra straight after a matter if you asked me before the marathon. Could you do an ultra?  I'm on is working for me. I'm recovering of building muscle work and run around the track Probably longer than you can So yeah, if you want to be critical of the vegan diet, you know, I've Basically Approved that you know after being six years vegan I can still do these things without even being an athlete without even being in it, you know a runner I'll be a little bit smarter next time Maybe I might even get a little bit of running training behind me before I do the next big thing But yeah, thanks again for everyone This is just basically an explanation as to what was going through my mind Obviously, it's not the smartest thing to do straight after a marathon when you're not completely recovered But yeah, I loved it. I feel really accomplished by it. I've got my little got my little metal here. There you go Not even a runner ran an ultra. How do you like that? I love it and Yeah, you know max as well max was there supporting me I would have done it with or without if max was telling me to stop I would have kept going anyway, you know, I think we discussed this very thoroughly And I really wanted to push past the limits and Yeah, I think your body is just your body is really really Capable of much more than we give it credit for so yeah, thank you all I'll leave the video link below if you haven't yet seen it. I hope it inspires you I hope you when when you're going through something that's a little bit tough You have the perspective of what the animals are forced to endure check out my podcast with Fiona Oaks Check out David Goggins to for the you know sort of overcoming these mental struggles. He's not a vegan I hope he does go vegan one day But yeah, thanks again, and I'll see you in the next challenge video. Peace


Live from San Juan, Puerto Rico, it's theCUBE. Covering Blockchain Unbound. Brought to you by Blockchain Industries. Hello, welcome back everyone. I'm John Furrier, the co-host of theCUBE. Exclusive coverage here in Puerto Rico for Blockchain Unbound, it's a global conference where a lot of the leaders are coming together as our second day of wall-to-wall coverage. Talking to all the top people, government officials, entrepreneurs, investors, and tons of great, great action here. Our next guest is Marcus Leven, who's the co-founder of XYO Network, XYO.network is the URL, interesting opportunity. Really built from the ground up, no outside funding, although that's some interesting things with their community. Great IoT example, great user of the cloud, great example of how real entrepreneurs are working with crypto and blockchain to actually grow. Welcome to theCUBE. Thank you, John. So tell me a little bit about what you guys do. Take a minute to explain to the audience what XYO Network is, how did you get here? What's it all about? Yeah, sure. So XYO Network is the world's first decentralized location oracle. Oracle means data input into smart contracts. Right now you have the problem that a lot of data sources are centralized and hackable or spoofable. So if you make a bet, for example, you need to look at the results of the bet at the website, the website could be hacked, you could collude with someone to provide wrong data. The same problem exists with GPS. GPS is easily spoofable and hackable. Like during the Pokemon Go craze, for example, all the kids just downloaded GPS spoofing up, they got all the rare Pokemons. Or allegedly the Iranians took down an American drone a few years back, sending up a wrong GPS signal, the drone just landed. So because of that, you can't do transactions based on location data. Today most applications for GPS location are navigational, but not transactional. We solve this by providing a decentralized location data or network. We do this through IoT devices and mobile phone apps and other types of partnerships. We are around since 2012, started as an IoT company, which provided location beacons, we call it XYFindIt. We have about a million of them out there and they can recognize each other's location. It's like us two taking a selfie together, we print out two copies, put our signatures on there when we leave each other, we can prove that we were here together. And it's the same thing with those devices, with our own devices, but also with partnerships, we build this mobile app distributors and IoT companies. So what can you do with this? So you could, for example, do payment up on delivery for e-commerce. So you could put a chip, small chip like an RFID chip into Amazon packaging tape. Once the package arrives at your doorstep or even in your house, the payment gets triggered. It works by your doorbell, your Tesla in the driveway, your neighbor's cell phone, any type of connected device, recognizing that the package is there, the payment automatically gets triggered. One third of Americans experienced port theft in 2016. You don't know if it was a UPS driver, for example, scanning the package or taking it or your neighbor took the package or someone random came by. This way you can prevent port theft or you can discover it. Or you can make sure your kids arrived safely at school, they arrived with their friends and they took the parts you wanted them to take. Or the hotel reviewers, for example, have the problem that they lose their users because they don't believe that the reviews are real anymore. But if you could prove someone flew from San Diego, that's where we're based, to Puerto Rico, said it's a hotel for two nights and then flew back and brought a review about it. Suddenly you have a location right if I reviewed. That's all today. But in the world, in like five to 10 years, full of AIs, robots, safe driving cars, drones, smart cities, you need transactional location data and nobody is providing that today and we want to be the center of the future. Awesome. So it's super exciting. I got to ask you about the IOT piece because do you need physical devices out there? So are you deploying sensors or are you leveraging pre-existing infrastructure? I love that selfie example. I can imagine that we do a selfie, we share it. It's a location-based opportunity. The phone's got location-based. How do you guys interface with this? How does it work? Yeah, so right now the network builds on top of our own devices. We're on since 2012, as I said, so we have a large network already. We're an existing company. It's a little rare in the blockchain space. And we build partnerships now with IOT companies like certain light bulb division company or fridges, all connected devices, mobile up-to-celebures. So you're providing your customers the IOT device folks who are proliferating out there? Yeah, we put our code basically out there. We can- Open source? It's open source. And you can plug it as an SDK into, let's say your mobile app. You can use it as a monetization tool as well because you earn tokens as you verify location and this data is part of an answer. And so you could earn XYO tokens as you become, because of Sentinel's location verification device in our network. So how do you guys tie this together on the token side?  Yeah, so there are four components in our network. There's Sentinel that spoke about, which are the IOT devices or mobile phones which verify the location. Then you have bridges which are relay the data. They relay it into something called the Archivist which is a distributed computing system. If you're familiar with storage in the space here, for example, or the old system like safety at home from Berkeley, it works like that. So the data is on people's personal computers. And then we have something we call the Divina algorithm which provides the answers. It works like mining. So from, you might want to ask, where's my package right now?  A bunch of diviners will take the data from the Archivist, the distributed computing system and try to find the best answer and try to find as close as possible to consensus as they can. What about spoofing? I mean, people might want to spoof the location. Yes. How do you prevent spoofing? Yeah, that's a good question. So we too, we could collude pretty easily, right? And, but if we are this entire room of people who you usually don't know, it's very difficult to collude. So one of them is scale. Then we build reputation over time. So as your answers are probable, you build reputation. For example, all we, all of us say, we're here at this hotel right now, but you say Novia and Shanghai, your answer is improbable and your reputation goes down. In addition to that, the disincentivist lying. She's very data driven. This is big time analytics. Extremely data driven. So what are you guys doing for analytics and what chain are you using? Cause performance becomes an issue. How's the plumbing work? What's the analytics look like? Take a minute to explain that. Yeah, it's very beautiful. We have our own chain, the XYO main chain. So our, we have an Oracle which plugs into any type of smart contract. You know, you have Ethereum and about 19 other coins there which have smart contracts. So from our, we build on our chain to lower the transaction costs, transaction times and build a more reliable network for ourselves. And then it plugs into all other smart contracts. So you have your own chain to manage this? Yes. So that's one of the reasons why you, from an operations standpoint, you would have locked that down. So you could control performance, latency, timestamps, security, what not. The openness is for the smart contracts. So you, is that what you're saying? I can do any smart contract I want. Is this basically for old-style developers? It's like an API, right? You can plug into it. It's like, we connect the real world with blockchain. So right now you have very limited applications for blockchain in a lot of cases because you can't take offline things and connect them to the chain. What we allow to do is, we call it the API to the real world where you take location data, put it into the chain and make it transactional. So I got to ask you a question. This is interesting. I love this. I'm getting to the more of the token sale and what you guys are doing raising money. In the IoT world, certainly with cloud computing, the big debate is, do you move compute to the edge where the data is? Or do you move the data back to the centralized cloud? Here, since you're decentralized with the IoT device, is the data coming back to your central network? Or where's the processing at? At the edge, what's the edge equation? Explain that. Yeah, yeah. So everything is decentralized. We believe that our company doesn't need to necessarily exist in a few years and the network will live on and grow as we grow the community. So the community is very important to us. So devices are decentralized. You own your cell phone. The data storage is decentralized. You can define like 3% of my personal computing power goes to this, for example, you earn extra tokens. And the mining is decentralized like any mining is decentralized today. So us as a company, once people start to build on that platform, we don't need to exist. Which makes it beautiful, right? This is what blockchain is all about, this centralizing and building this platform layer where people can build on top of. So there's a ton of Bluetooth and GPS out there. Talk about where you guys have got your traction. I want you to take a minute to explain. We kind of went off on a tangent on some IoT rant there that I was interested in, but I want to take it back to mainstream. There's GPS out there, you got Bluetooth. Everyone's got Bluetooth devices. So it's not like there's this massive new requirement. You guys did some interesting things how you funded your first token sale. You have customers, you've been around for how long? 2012. 2012, you've been successful, no outside capital.  How'd you do it? Take us through that progression. Yeah, so we co-founders worked in various ventures together previously. One of our co-founders, the main founder, I would say, R.E.TRO, he started this company in 2012. And we bootstrapped it with $7 million of our own cash. And one and a half million venture debt. We really believe in what we do. You guys put up a lot of capital. Yes, we believe in what we do. We believe in our capabilities. I try to attract the right teams. We have an amazing team. And yeah, it's... That's skin in the game. Yeah, it's skin in the game. And it's actually a lower risk investment for me because I know about the capability of what we are capable of. You're underwriting your own confidence. Exactly, exactly. So you got $7 million of your own cash. Did you pass the hat around? You all kind of contributed money in? It was mostly from R.E.T.RO. Actually, yeah. But we all have skin in the game there. But so we... So you have a community. So then you launch your idea. What happened next? Exactly. So then the VCs started to come. We did some outreach. VCs started to come. They're interested in our idea. They love what we do. It's all... Platform is quite sexy right now in blockchain via a platform and you can build a lot on top of it. We pushed off the VCs and we said we want to take community money first. The reason is we believe in building this strong community of evangelists, people who believe in us, who want to code with us. We went to other developer conferences, not to investor conferences or something like that. And so we marketed to about 2,300 people our token sale. And a little under 500 people put some Ethereum into our token sale. And 95% of them were under 5F. That was a very global community. Was that a utility token sale? Yes. Outside the US, because there were credit investors involved? What was this? So it's clearly a utility token because you can build on top of it last weekend in the city of San Diego. And 120 hackers in the IoT company were in our office to build on top of our chain traffic flow and parking solutions for the city of San Diego. But so it's clearly a utility token but because of the uncertain regulatory environment we are actually running it like it's a security. So we have a Reg A, Reg D, Reg S, whatever. We have 115 different jurisdictions we look at. I spoke during the whole process, I'm not lying. It's 20. That's a lot of work. Yeah, 23 lawyers I spoke with. It's a lot of hours with lawyers on the phone. The most aggressive one of them, she suggested to me is a structure with no taxes but 20% prison potential I think and on the other side. It's a good cause, you're doing it right. So you spent a lot of money to make sure that your community was involved? Yes. And then they weren't throwing a lot of money and it was like they're millionaires, they're like, what's the, $1,000? That kind of numbers? Yes, exactly. So it's not like you're breaking the bank but they feel ownership? Absolutely. So if you look at our telegram channel. You raised what, a million, two million, three million? 1.7. So from the community? From the only community, those 400 people and we had it open for about five to six days. We closed it down. It didn't take any money anymore and since yesterday I started talking with institutionals again and now we have sexy stories. So now they come again. Platforms are sexy. Exactly. We know we have one too. That's awesome. We love your project. The thing about platforms is as you know we talked about last night is that the platform wars and the platform entrepreneurial thinking has radically changed. In the old days it was I got a platform and I'm going to monetize my platform for my application. Look at Facebook. They monetize their platform. Data for advertisers, not users. I am a Google search engine. I need to make the best search result so I can get better advertising and search results for that part. But the new order is the platform value goes to the users or customers. Right, right. That's right. So not. We are not rent seeking. This is an open model with platforming. 100% open. There's a lot of the platforms are rent seeking where a certain percent of each transaction goes to the company or to some founders or something. We don't have that at all. So what we do is for every token we sell we allocate one to the company and after the token sale there's not going to be ever more expo tokens ever again. And we use our portion to build this network but we don't take any fees or anything there. How do you make money? Building partnerships with companies helping them to build on top of the chain building the community. At some point you need to take a small cut of something, right? Yeah, if you own half the tokens hopefully there's some value there. Okay, so you've got the token opportunity. So on the security token do the investors, the community and now token holders, is that an equity security token? So they own the company through the tokens, right? Non-dilutive, non-voting. Equity, is that what you're thinking? Yeah, it's not an equity token. It's still in our mind a utility token but we do something very interesting. During the token sale event we are going to launch an equity sale at the same time. So you can decide if you're comfortable in the blockchain space or you want to be an equity investor, you buy equity, the disadvantage is you have less liquidity there but you have all the protections in equity gives you, right? We are a California based company with audited financials since 2012. SCC qualified and regulated. So equity in our case is a kind of sexy concept. Yeah, and they had the long game in betting on acquisition or something else. Well, they got to get some revenue going. Well, what's next? What are you guys doing? You have token sale done, is it working? Was it going on now? Let me just check it out. You've completed it? No, it's going to start on March 20th. It's going to run for two months until May 20th and so now it's a lot of trouble speaking with people, engaging and yeah, that's the next step. Well, congratulations. I'm so glad that Kerry on Facebook got notified of me of you guys, super impressed with what you're doing and we had a great conversation last night at the monetize roof party. Great to know you guys. I think IOT really needs this kind of model because there's a lot of real critical challenges around the role of data, the role of immutability. There's all kinds of sensor devices out there. Cameras, you can't go anywhere. Digital cities are coming. Smart cities, self-driving cars. It's going to be wired up big time so I think you guys got a good opportunity. Thanks for coming on to you. It's John Furrier here in Puerto Rico for exclusive coverage of Blockchain Unbound more after this short break.


My name is Jimmy, his name is Jake, and this is the Weekly Dumb. Jake, you look great, two necklaces. We're back, back in studio. Look at you, look at me, look at us as we can be. Jake, let's go to the sports. James, huge sports match. The Savannah Bananas, friends of ours, we went down there. They're always up to something kooky down there. They are, and they aren't. Because clearly rule number eight of banana ball states that if a fan catches a foul ball, it isn't out. And we got it for the last out of the game, and it's a pretty incredible scene. The batter, Dustin Baber. Dustin Baber. Three, two, one, six, eleven. Is it Baber? I'm also assuming it's Barber, but we missed it. Dustin Barber would make more sense. Anyway, he's upset. He sees the fan catch. It's like a hot shot down the line. The fan makes a nice grab and he's like throws his batter. But he got bad because he knows the real rule, which when we went to the Savannah Bananas, one of the fans caught a Savannah banana foul ball and we interviewed him with one of our more pressing questions we've ever interviewed a guy with. Sir, what the hell? His wife left him. I like the Savannah Bananas. You could be on the fence. You'd be like, this is too much. I don't like fun. But when you see them bring him on the field and celebrate because he's now part of the team, everyone gets one over. Well done, bananas. Don't put that in. Blur the whole thing. Put it on loop. Like that. Jim, what was this almost a breakdown that you said you were a part of so you wanted to bring to the office? I wasn't a part of this, but I wish I was. I wish I was there. A Atlanta man attempt to rob a nail salon, nail first salon. Ad? Yeah. He did the field of dreams. Kevin Costner hand inside of a bag. I got a gun in here. No, you don't. And the women just don't respond at all. He barges in. He says, give me all the money. And no one moves at all. There's a look at him. I'm like, what? And the guy is so confused. He's just looking around like, he said, give me your money. Put the money in the bag. One woman stands up, tries to leave, and he's like, you can't leave. I'm robbing this place. And she's like, ah. I might leave. She doesn't run away. She just goes outside the glass door and just stands there, which I love. Usually a guy comes in with a gun. You run. She's like, you know what? She was just getting fresh air. Really tough for the robber. I didn't think I'd feel as bad for him, but I do. Oh, because his boys are going to see this. He just gets stunted on. And I don't like using that word either. Make sure you blur that whole thing out. Can you put that in like a gang? Like, oh, they got stunted on. He just gets stunted on. Like a documentary. A gang member doesn't want to reveal his identity. Good stuff. You can go to Seake to get tickets to the next robbery of Home Runs. We had a member of John Boy Media win a baseball game the other day. Our friend, Trevor Ploof, three, two, one, four and a half. Yeah. He won a baseball game. The first sideline reporter to win a baseball game. That's tough. Ploof has a good last name. We had a fan win a game for a team, and now we had a sideline reporter win a game for a team because Trevor Ploof used his 11-11 wish on Alex Kirolov to hit a home run. And he did, and then he points him out in the booth and the twins win this game by one run. Trev is crushing it. I know that you hate Trev, and you would never want to compliment him ever. No, no, no. He's doing this.  He's the hottest thing on Minnesota TV ever. It's awesome. And this was like a very genuinely cool. Sometimes I have to step back and like, would I find this wholesome and cool if I didn't know Trev personally? And I think the answer is I would say, yeah, that's a really fun moment. And I love that Trev, when he stands up, this is my favorite part of the whole thing, has the glove in his hand. Right.  People don't know. Oh, he brings a glove to his game. He's owned it so much, he's wearing a glove in the booth. You know who told him to do that? Yeah. Yeah. This pro baseball player is pointing to a former pro baseball player who used his 11-11 wish to say, I want you to hit a homer today. Trev is basically a dying kid in this story. Dying kids have similar tales. Oh, no. This is not sport. Your favorite animal in your favorite California town and Otter and Santa Cruz is hassling surfers and stealing their boards. This is an awesome story. This is a story that I would have made up and people would have said, Jimmy's making up stories again. But I did not make this up. So there's an aggressive sea otter in California. It's ripping surfboards out of the surfers' hands. It hasn't been anyone yet, but it's being very aggressive towards the humans and their boards. Make sure we circle up on the biting. I'd like to talk about that. One, their terrain. You're in water. You have to get out of the water. They live there. Where this story gets amazing, and I think Zach doesn't know this yet and he's going to perk up, is that this sea otter has a name. It's officially known as Otter 841. This sea otter was born in captivity because its mother also was unfriendly and attacked humans. So they put the mom in jail. She's pregnant. Otter jail. In jail, has a criminal child. And then after a while, they're like, you know what? I think this, you know, the sin of the mother should not be on the child. They release Otter 841 into the waters. And now he is avenging his mom. You put my mom in jail.  I think you're putting a lamestream media tone on it because like you said, the otters have the water. Like mom wasn't a criminal. Mom was protecting her land. That's exactly what I'm saying.  She's not. Well, that was me speaking on behalf of the humans. That's what I'm saying. When I speak on behalf of 841. That's why it was lamestream media. I'm saying we got to tell the real story here. Like these otters in their family, his mom was protecting their land. Now he's protecting their water. Not land. The humans, the humans are spinning it as, hey, you know, we actually need to look out for this Otter and get him out of here.   You're not looking out for the Otter. Oh no.   Put 841 in jail. Let him have a kid. See what happens. They're going to make a whole army. I wouldn't want to do that. Which leads us to our employee of the week. It's the employee of the week. Bom, bom, bom, bom, bom, bom. OTW. EOTW. EOTW. EOTW. EOTW. We'll blur that whole thing out. Ha, ha, ha. There goes 15 minutes. Chef. Chef. Chef DiPoma. Huh? Jeffrey D.P. Hi. Come on. You didn't even say why. You tell him. It was all so weak, so a lot of people were eligible candidates, but Jeff stepped up and edited our all-star game vlog. So go watch that. And Zach loves Jeff. Choose a card. Any card. That was a weekly dump. Today's episode was brought to you by SeatGeek. Get in a better voice. Today's episode was brought to you by SeatGeek. There are more than 70,000 events every single day on SeatGeek, including sports, concerts, festivals, and more. And we've got the hookup. Use code DUM for $20 off your first purchase at SeatGeek. That's $20 off your first purchase with promo code DUM. Click the link in the description to download the app. Babe Ruth did it for a whole orphanage. Was Babe an orphan? Yes. Is he like the number one orphan if we did an orphan draft? Oh, James, James Peach. Is an orphan, right? Might be the last. James or the Peach. Babe Ruth was an orphan. The guy who took him in's name was Babe, and they called him, that's Babe's kid. And then that's how he got his nickname.  He went from playing against his local Catholic school boys at 18 years old to playing in Major League Baseball. Babe Ruth, cool story if you haven't heard about him. Check out the link here. Put a link to Ask Jeeves.


Let's find the derivative of y with respect to x. If the relationship between x and y is given by the equation, three x times y plus four y squared is equal to 10. You'll notice in this equation that we don't have a y equals some f of x right here. That is, y is not solved for explicitly here. There is a quadratic relationship here on the y's known as we have a y and a y squared. We could attempt to solve for y in order to find the derivative, but it's gonna be much easier just to compute the derivative implicitly than that's the strategy we're gonna take in this situation. So essentially, we just wanna compute the derivative of both sides of the equation. So we're gonna take the derivative with respect to x of the left-hand side, which is three x, y plus four y squared. And then we're gonna take the derivative with respect to x on the right-hand side as well of just the number 10. Now, let's actually think about the right-hand side for a moment. We're taking the derivative of 10 with respect to zero. Well, since 10 is just a constant function, 10 doesn't change as x changes. This is just gonna go over to be zero and I'm actually gonna move that to the left-hand side so, because I really don't have to do much with it anymore. As for the three x, y plus four y squared, by the usual rules of derivatives, I can take the sum of these derivatives separately. That is, we'll take the derivative of three x, y and add to that four y squared. But then also these constant coefficients can come on out of the derivative process. And so we have to take the derivative of three times x, y and then we have four times the derivative of y squared. And this is where it's very important to remember that when you use this little tick notation, this prime, this prime here is just short, just a shorthand for the derivative with respect to x. So whenever we take the derivative here, we understand we're taking the derivative with respect to x. So how do we take the derivative of the product x times y? Well, we'll use the product rule. The product rule tells us that when we take the derivative, we're gonna take the derivative of x times that by y and then we're gonna take x and times that by the derivative of y for which we have right there. So x prime y plus xy prime. When we take the derivative of the y squared, notice we're taking the derivative with respect to x, not with respect to y. y is a function of x, even if we don't have that explicit formula right now. So when we take the derivative of y squared, remember we're taking the derivative with respect to x. So therefore the chain rule comes into play. We have the outer function y squared for which when we take its derivative by the power rule, we're gonna end up with that two y. But then we also have the inner function, that is y itself, because we can think of this function, you know, being broken apart as we have this, we have this, excuse me, this x squared composed with the y right here. We put y instead of the x. So that's what we're trying to keep in mind here when we take these derivatives. So the outer derivative would be a two y and then we times that by the inner derivative, which is a y prime. And then of course the left-hand side is still equal to zero right here. So we should have a couple of y primes that showed up in this calculation. We have one right here, we have one right here. It's then gonna be our goal to try to solve for the y prime, because after all that's what we're looking for. We're looking for dy over dx. In shorthand, that's what we mean by this y prime right here. So what we're gonna do, is we're gonna move anyone who's not a multiple of y prime onto the left-hand side of the equation. Before we do that, let's distribute the three here and multiply the four by the two right here. So we end up with a three x prime y plus x, excuse me, three x y prime. And then we're gonna have an eight y y prime. Another simplification we can make right here is when you see this expression x prime right here, what is this short for? This is short for the derivative of x with respect to x, as we know that should be equal to one. So we can actually drop the x prime notation going forward here. So we're gonna subtract the negative three y from both sides of the equation. We end up with, well, negative three y on the left. On the right-hand side, we have a three x y prime plus eight y y prime. And then recognizing the derivative here as a common multiple, we can factor it out, thus making the right-hand side look like three x plus eight y multiply that by y prime. And so then to solve for y prime, we need to divide by its coefficient. That is, we need to divide both sides by three x plus eight y. Do that to the other side as well, three x plus eight y. So in the end, we get that y prime, which of course is just an abbreviation for dy over dx. This is equal to negative three y over three x plus eight y. And there's no simplification we're gonna be able to make to that fraction right there. The three on the top can't cancel with the three in the denominator because the denominator is not divisible by three. Nor can the y in the numerator cancel with the y in the denominator because the denominator does not have a common factor of y. And so we see how very nice implicit differentiation can be used to compute the derivative here, dy over dx for this function. Now, because we didn't solve for y explicitly, you will notice that the derivative involves both x and y. That's perfectly fine with implicit differentiation. We're okay having the derivative be a function of both x and y.


Somebody said they called him on the phone and he answered like, hello, this is Abraham Lincoln. They're like, yo, it's me. You're not in the movie right now. And he did not get out of character, but that cloning, he's one of the greatest actors ever. So as an entrepreneur, Kobe Bryant did this with Michael Jordan. He's just like, best in the games, Michael Jordan. Let me just have every move, how I post up, how I shoot fadeaways. So I think adapt situations that make you feel weird, but give you enough trauma to motivate you, adopt, just mimic somebody.  It's a compliment. If somebody says, Oh, Ty, you're quote warren Buffett too much. Well, shit, if I can have 10th of that guy's success, I'll be laughing all the way to the bank.


The game we are playing today is called Geoburst. In this game, players list types of geometric objects, understand geometry concepts and begin to think about interrelationships among shapes. The materials you need to play this game include Geoburst cards, page protectors, a dry erase marker and eraser, a notepad to keep score and a timer. To set up this game, place each Geoburst card in its own page protector. Shuffle the cards, then place the cards facedown in the center of the playing surface. To begin the game, the reader from Team 1 takes a Geoburst card from the top of the stack and reads aloud the category listed at the top of the card. Team 2 tries to guess all 8 target answers that fit the category on the Geoburst card. Team 2 players guess as many answers as they can in the given time. If the card has only short answers, Team 2 has 1 minute to guess. If the card includes the word properties in the title, Team 2 has 3 minutes to guess. As Team 2 states a target answer, the reader from Team 1 marks off the answer on the card, writing on the page protector with a dry erase marker. When time is called, Team 2 gets 1 point for each correct target answer stated. In this case, the players guess 6 target answers to fit the category so they earn 6 points. Teams then switch roles and repeat play until both teams have earned at least 20 points. After play is complete, the team with the most points wins the game. After completing the game, try to think about what strategies you want to remember for the next time you play. Think about what geometry concepts you found difficult and what made them difficult. Read the properties cards again and explain how you know the properties are correct. As a variation, try to play Geoburst with more or less time. How many target answers can you guess in 30 seconds? How about 90 seconds or 5 minutes? As another variation, try to have only one team member guess the target answers. You could even have Team 1 state the target answers and Team 2 guess the category. Click on the instructions link on the Regional Mass Science Center website to read the game rules or just re-watch this video, pausing as needed. Thanks for playing.


Whilst we know God from the perfect 14 13 of them had known him from this Queen The proofs of God on mankind God's proof in her they would find 13 of them had known him from this Queen All 14 of God's greatest Perfect impeccable household have all seen the oneness of God and of and of this God we were told But 13 of these 14 whose knowledge in God is untold No a Queen for whom created was every heaven and world For man their proof of their Creator From them his proof is Fatima to Zahra of her there is no kind God's proof in her they would find 13 of them had known him from this Queen The fires that lit her house when Zahra would deny tyrants inspires future tragedies of which Fatima laments Empires see threats in her children and they're godly intense She tires Seeing poisoned men crushed bodies and burning tents. How much she saw in the push of a door? No wonder for her wonders were made for How much she saw in the push of a door? No wonder for her wonders were made for the door had 14 behind God's proof in her They would find 13 of them had known him from this Queen Fatima Zahra alaihi salam in the Quran First of all, you know, what is the Quran so the for the viewers that don't understand what the Quran is or Impact or the significance of the Quran puts very very simply the divine word of guidance and spirituality Explaining man's purpose and objective here on earth The relationship we must have with the Quran Okay, so essentially as we mentioned it's the divine word of God Sent to us in a book in order for us to live our lives in a meaningful peaceful way Okay, in this book there are many many different aspects That can tell us about how to live our life be it from a law aspect Regulations be it from a spiritual aspect. There are supplications be it from a story aspect to gain Inspiration there are stories in there. Yeah, and also to explain the significance and the importance of our relationship with the Quran of course the relationship that That we should have with the Quran all boils down to the hadith of the Prophet when he says I leave behind you two weighty things The ahlul-bayt alaihi salam and the Quran They will not separate until we meet in the land of in the pool of coater So the the same way we have a very tight relationship with the ahlul-bayt alaihi salam be it Fatima Zahra Be it the Prophet Muhammad be it Imam Ali alaihi salam. We should also have a simultaneous love and passion for the Quran and let's delve into Fatima Zahra as life through the Quran cause the first and most Relevance chapter in the Quran that speaks about Fatima Zahra is the Surah or the chapter of coater on the date of her birth in Mecca the Almighty revealed Surat al-coater. Bismillah ar-Rahman ar-Raheem. Inna a'atainakal coater Fasalli l-Rabbika wal har. Inna shani aqa hua al-abtar. Of course as we know during the time and the historical facts the Prophet Some people of Mecca would mock the Prophet say that he was abtar a man who could not have children Because he had no son, right? So Allah swt blessed him with a daughter and a queen whose legacy is remembered throughout the whole of the Islamic history A queen who would give the Prophet 12 princes who would inherit his knowledge and power and surely the enemy of the Prophet is the one who will be without offspring and this is the last verse Inna shani aqa hua al-abtar and that's where the enemies that spoke about the Prophet or mocked the Prophet for not having a son Allah swt switched it round for the enemies and that person who mocked the Prophet That person became a person who could not have a son and that's the first verse or the first chapter in the Quran which speaks about Fatimh Zahraal There is another one The second is the ayah the the verse that refers to say the Fatimh Zahra alaihi salam is the famous ayah of tatheer Okay, and this is found in Chapter 33 verse 33 Allah intends Only to remove remove you from the impurity of sin Oh people of the Prophet's household and to purify you with extensive purification Why is this so significance a number of different things? Okay First and foremost, Haileet al-Kisa which is also narrated by Fatimh Zahraal further supports this ayah Which is used to explain the infallibility of the five Ma'as or Meen the Prophet Muhammad Imam alaihi salam, Sayyida Fatimh Zahraal, Imam Hassan and Imam Hussain peace be upon them Now the reason why this is very important is because it also delves into the issue or the topic of infallibility Now a fallibility not to delve too deep into it But the reason why infallibility is important is because Allah swt has a message Allah swt in his divine mercy in his Absolute beauty Right. He is impeccable and therefore he sends down the message any message coming down from Allah swt is impeccable Okay, there are no wrong aspects to this message Therefore the person or the vehicle that explains this message to the people has to also be impeccable or infallible Why because if there were any sense of doubt with the person or the vehicle that is spreading this message of Allah swt Then this can link back to doubt to Allah swt Yeah, it's very very simple In essence, of course delving into it. It's much more of a complicated issue the infallibility of Muhammad Imam Ali, Imam Hassan, Imam Hussain and Fatimh Zahraal is important because they spread the knowledge of Allah swt And for them to spread the knowledge of Allah swt, they must be infallible Because people must trust them with this message if they were seen to be people of ill repute or People that may make mistakes Then the message of Allah swt is then subject ill repute or mistake or doubt The message of Allah swt through the Prophet is la ilaha illallah Muhammad Rasulullah There is no God but Allah and the Prophet Muhammad is the messenger and the 14 and the 12 Imams after other vice-adherents of Allah swt and therefore this is the reason why the The infallibility aspect is important Another verse in the Quran, which is mentioned that speaks about Fatimh Zahra alaihi salam is the impact of Mubahela or Aideh Mubahela as we say because in chapter of al-amran Verse number 61 it says then whoever argues with you about it after this knowledge has come to you say Come let us call our sons and your sons our women and your women ourselves and yourselves Then supplicate earnestly together and invoke the curse of Allah upon the liars among us Who was present in Aideh Mubahela or the impact see the whole the whole Story of Mubahela or the impact of Mubahela is that two people or two clans or two groups of people came together This one believed in a message and this one believed in a message and So they came together and said we will invoke or supplicate earnestly and invoke the curse of Allah swt be upon the liars and So the Christians of Najran came forward with their people and the Prophet came forward with his people Who did he come with as we know he came with himself and when it says let us call our sons His sons were Hassan and Hussein Let us call our women women was Fatimh Zahra although he had a choice of Which women to take but he took Fatimh Zahra Ourselves and yourselves when he mentions ourselves. He says he brought mama alaihi salam and Those are the five people that he brought alongside with him when they came to the place where they were to invoke Allah swt's wrath upon the liars The Christians of Najran noticed the luminous light coming from the faces of these infallibles and So they retracted and said if there are this if they They said that There is so much noor so much light coming from the face Or the faces of these people that if they told this mountain to move or if they told this mountain to be crushed It will do so Yep, and that's the significant importance of Fatimh Zahra Who was accompanying the Prophet Muhammad salallahu alaihi wasalam in this event of Mubahala also mentioned in the Quran so three Surat al-Kawthar Where Allah swt speaks about the birth of Fatimh Zahra the verse of purity Where Allah swt looks to purify Fatimh Zahra from any sins and thus making her infallible and then the impact of Her stature within the family of the Prophet is mentioned in al-amran but of course Her father yearns to resurrect once for every tear she's shed and Other Muhammad's yearn earlier birth for blood she's bled they gather 13 but the first and the last are all Muhammad She'd with her and they'd be there for her wailing on her death bed how much How much she had mourned Muhammad's last breath How many Muhammad's have mourned her death from crying? They're almost blind God's proof in her they would find 13 of them had known him from this Queen In lights dim in Fatimh's house of sorrow. I see hidden Al-Kawthar Making a house of sorrow out of his prison beside him He sees his mother wailing from a rib broken. I fathom that she also sees him That's why she's heartbroken Maybe she had built the house of sorrow to mourn the prison that burned his shadow Her shadow to his she'd bind God's proof in her they would find 13 of them had known him from this Queen How many of the 13 wish they were with her on that day as Ali Watching his house burn would also watch his world sway Tragedy from that day of days cannot be taken away, but he'd see her head slapped and Recall he'd be struck when he'd pray He'd yearn that fatal strike up on his head 1,000 times, but not her head instead Two tragedies were aligned God's proof in her they would find 13 of them had known him


In my mind, nobody represents or epitomizes a Ruby hacker more than Ryan Davis, and also I think no library represents, to me, kind of the spirit of Ruby more than Minitest. I'm a huge fan of both Ryan and Minitest, and so I'm excited. Up next is Ryan Davis talking about building your own testing library. Yeah, so I'm going to be talking about making test frameworks from scratch. As said before, my name is Ryan Davis. I'm known elsewhere as ZenSpider, or on Twitter, the ZenSpider, because someone's camping it. I'm a founding member of SeattleRB, the first and oldest Ruby Brigade in the world, and I'm now an independent consultant in Seattle, and I'm available. I'm also the author of Minitest, which happens to be the most popular test framework in Ruby, and I only mentioned that because I didn't know that. I learned that last week, and I'm a bit astounded that we're beating RSpec, and it hasn't been since July. So setting expectations. This is something that I always do. I really want to set these things up front. This is a very code heavy talk that will go into detail about the what's, the how's, and the why's of writing a test framework. It is 320, yeah, 26 slides. It's a little bit more than nine slides a minute. That's 50% more than I've ever done before. So I'm going to be talking at this pace and going as fast as I can. The slides are published. You can find them there. One thing I find about doing more slides, and again, 326 is ridiculous, but the more slides there are, the more I'm able to help connect the dots and the more explanation it provides and the more comprehension you guys walk away with. So first, a famous quote that was not said by a famous person. Tell me and I forget. Teach me and I may remember. Involve me and I learn, and that was not Vendor Brown Franklin. Who actually said this is a bit of a mystery, but it's usually attributed to him? Who knows? The internet says it's him, so it must be. But I think that the quote points out an important problem in Code Walkthrough Talks. So just to back up a little bit, don't get me wrong, not all Code Walkthroughs are bad. I think some of them are absolutely great and they're absolutely necessary for work. And I'm really only talking about presentations. But quite simply, I could write this talk in my sleep by simply working through the current implementation of many tests and explaining each and every line. And you'd learn nothing from it. And you'd forget it almost as quickly as you read it. And some of the many problems of Code Walkthroughs are that they're boring. They're top down. And as a result of that, they focus on the what's and not the why's. There are good reasons to tune out and not learn a thing. So those are also good reasons for me not to do a Code Walkthrough of many tests. That quote that isn't by Benjamin Franklin, the real quote or what is believed to be its predecessor is much better. And this screen is dark. Not having heard something is not as good as having heard it. Having heard it is not as good as having seen it. Having seen it is not as good as knowing it. Knowing it is not as good as putting it into practice. And I'm not gonna mangle the source on that. For those of you who think that's too many words, here's a more concise version. Is Erin in the audience? So for my most ferrity of friends, since that's too many words, I didn't know what to do for, there's no brain emoji, so I did the nerd one instead. So starting from scratch, that is the point of this talk. Working up from nothing is the closest that I can get to allowing you to join me in building up a test framework from scratch. I will try to describe this in a way that you can literally code it up at the same time and understand the steps that you went through to get there. Now would be a good time to open up your laptops if you wanna join in. Further, this is not gonna be many tests by the end of the talk. It's gonna be some subset. I'm gonna apply the 80-20 rule to show you most of what many tests can do in a minimal amount of code. To emphasize that, I'm gonna be referring to this as microtest from here on out. Does anyone get that joke? Couple? Finally, I encourage you to deviate from the path that I'm gonna lay down and experiment. Do things differently and you might understand my choice is better. Finally, this talk is an adaptation of a chapter of a book that I'm writing on many tests. There will be more info on that at the end of the talk. So, where to begin? At the bottom, the atomic units of any test framework are the assertions. Let's start with plain old assert. In its simplest firm, assert is incredibly straightforward. It only takes one thing, the result of an expression, and it fails if that isn't truthy. That's it. This framework is complete. You have everything you need. Thank you. Please buy my book when it comes out. Are there any questions? Okay, no. Although, doing a 326 slide talk in five minutes would be great. I'd like to have a few more bells and whistles, but before I add those, let's figure out what I wrote and why. In this case, I chose quite arbitrarily to raise an exception. If the value of the test isn't truthy. I could have chosen to do something other than raise an exception, like throwing or pushing an instance of something onto a collection of failures and returning. And while there are trade-offs to all of those choices, it doesn't really matter what you choose to do as long as you report the failed assertion at some point. I mostly chose to raise an exception because exceptions work exceptionally well, no pun intended, for my brain. Trust me, that wasn't on the notes. There's an added benefit in that exceptions raised, interrupt the execution of the test, and they jump out of the current level. And we'll see more on that later. So, if you ran this exception, 1 double equals 1 would evaluate the true. That would get sent as the test arg to assert. And it would do nothing in response. That would be a pass. However, if you ran this expression, 1 double equals 2 would evaluate the false. That would get sent as the test arg to assert. And that would wind up raising an exception. At some point, there will be mechanisms to deal with those exceptions and gracefully move on. But for now, the whole test suite grinds to a halt on the first failed test. One problem we have is that the raised exception reports at the place that the raise was called, in assert, and not where the assertion was called. I want it to only talk about the place where the assertion failed, on line five of test RB. So I'll clean up the exception a bit by changing the way that raise was called. Raise allows you to specify what exception class to use and the backtrace you'd like to show. I'll use caller for the backtrace, which returns the current runtime stack where you wind up calling caller. Now we see where the test actually failed, much more useful to the developer dealing with a failure. Next, I'm gonna add a second assertion. Now that we have plain assert, we can use that to build up any assertion anyone could possibly need. At least 90% of my own tests are handled by simply checking a quality. So let's do that next. Luckily, it's incredibly simple to implement. I'll just pass the result of a double equals b to assert and assert does the rest. And here's how you use it. Where two plus two equals four, it passes true to assert, and where two plus two doesn't equal five, it passes false to assert. Assert does its thing and we know how that goes. This is really all I need to do most of my work quite happily. But the way it stands right now, it has a pretty unhelpful error message when a failed assertion raises. First, the backtrace is pointing at assert equal, not at our actual call to the assertion. Didn't I just fix this? Sort of. I'm using caller for the backtrace that includes the entire call stack, including other assertions, so I need to filter the assertions from it. Let's fix that by deleting everything at the start of the backtrace that is in the implementation file. And here, I simply assign to a local variable, I still use caller, but then I use drop while to filter out anything that starts or contains the current implementation path at the start of the array. But it's still ugly. The failure still says failed tests. Let's make it possible for assert equal to supply more information. Let's pull up the error message into an optional argument and use that argument and raise. That allows us to change assert equal to use that with a helpful message that details why we failed. Now we get our message that looked like this. And that's much more useful, though probably not 100% resilient, but it'll do for now. One more assertion. One mistake people make time and again is misunderstanding how computers do with floats. Stop. The rule is really simple. Never, ever, ever test floats for equality. There are exceptions to this rule, but if you stick to this, you're going to do fine every time. So while we have assert equal, we should not be using that for floats. So what should we use then? We'll make a new assertion just for comparing floats. And I should see if the difference between two numbers is close enough, where close enough is simply going to be within one one thousandth. We could make it fancier later, but for now done is more important than good. And so this is what it looks like. It's almost exactly the same as assert equal, except we're using the formula that was stated previously. And this is how it's used. And it simply works right out of the gate. So what does that mean? It means that our assert method is finally general purpose enough that we can write all the other assertions. While writing other assertions you want as fine and good, necessary even, that would take hours and I'm only 25% through my slides. So consider that an exercise for you after the conference. What's your favorite type of thing to test? Hopefully you're not actually doing floats that much. And how would you write an assertion for it? Go do that and then have a cookie. Once you can write one test, you'll want to write many tests and that starts to introduce problems on its own. It'd be nice to keep them separate. There are many reasons why you'd want to break up your test and keep them separate. Organization, refactoring, reuse, safety, prioritization, parallelization, and so on. While it'd be nice to separate our tests from each other and organize them, how do you do that? We could do something really quickly and easily like this. Call the test method, provide it some sort of description and a block with your assertions. And it's equally easy to implement.  This gives us the benefit that you can name the tests and put them in blocks so that you can see that they're separate. But they're leaky. And leaky tests infect results. Now that you can write multiple tests and keep them organized we need to be able to trust them. The problems of these tests aren't actually all that separate from each other. Here at the top you can see that we have a local variable A, we assign to it, we test it in the first test and it passes. The second test modifies it and it passes and that causes the third test to fail. We really want those tests to be completely independent from each other. But the fact that one test can mutate a local variable that is used by another is simply a mistake. This goes against good testing practices that would state that tests should always pass regardless of what was run, what order they were run in, or anything else. Otherwise you don't trust the tests and trusting the tests is crucial. We'll fix this by using methods. I might need to stop using the clicker. There are a number of ways that we could try to patch this up. The simplest perhaps is just not to do it. Instead, just use Ruby. Ruby already provides a mechanism for separating blocks of code and making them immune to outer scopes. It's called the method. Here we can see that we have local variables A in all three cases, but they're all separate local variables. The nicest thing about this approach is this is absolutely free. There's no cost to using this if you are already paying by using Ruby. It is important to also remember that by using plain Ruby is that anyone can understand it. It does have some drawbacks. First, you have to run the methods yourself. That's fine for now, we'll address it later. Another perhaps more pressing issue is that there's code duplication in the previous examples, but there are simple ways to get around that too, and I'm not going to bother going into them at this time. Stick to plain Ruby, and it should be pretty easy. Now that we have multiple tests separated by methods, how do we get them to run?  We could come up with a more complicated way, and we will, but this we'll do for now. Methods are a good means to separate tests, but more problems arise. Unique method names are necessary. It's harder to organize, reuse, and compose, so on. Luckily Ruby comes up with another mechanism, classes. Didn't I just say to keep them separate though? Yeah, but it would be nice to be able to organize them, clump them up in units. So how do we do that? Take the previous code, wrap it in a class, and that's all there is to it. But how do you run those? Wrapping the methods in a class breaks the current run. In order to fix it, we need an instance of that class before we can call the method. So we add that to each line, and we're passing again. This change doesn't really do anything. It groups the tests in classes, but it does put us in an ideal position to make the tests run themselves. Right now we manually instantiate and call a method for each test. Let's push that responsibility towards the instance and have it run its own test. By adding a run instance method that takes a name and invokes it with send, it doesn't look like much either. In fact, by adding the call to run, we've made it a bit more cumbersome. But this will make the next step super easy. It also provides us with a location where we can extend what running a test even means. For example, the run method would be a good place to add setup or teardown features. What would you add? Running tests manually is still pretty cumbersome. Let's address that next. Now that an instance knows how to run itself, let's make the class know how to run all of its tests. And we can use public instance methods and then filter on all the methods that end an underscore test. Public instance methods returns an array of all of the public instance methods on that classroom module. And we can use enumerable's grep method to filter on those. We wrap that up in a class method that instantiates and runs each test, allowing us to collapse this into this. This would be a good point to pause and apply some refactoring. What we've got is well and good, but we've only put it in one test class. In order to really benefit from this, we should push it up into a common ancestor and make a parent class, so let's make a parent class and refactor. We simply reorganize the methods into a new class called tests, and while we're in there, we scoop up all the assertions and throw them in as well. This is subclass of the new test, and that's all there is to it. Do that to all the test classes, and they all benefit from code reuse. This makes it super trivial to have a bunch of classes of tests that can run themselves, so let's push that further. The one thing we have left to address is where we manually tell each class to run its tests. So let's automate that too. Since we're using subclasses to organize our tests, the class inherited hook. Every time a new test subclass is created, it'll be automatically recorded, and tests will notify all of them off when told. First, we need some place to record the things that we need to run. Then we use the inherited hook to record all the classes that subclass test, and from there, it's trivial to enumerate that collection until each one to run its tests. This allows us to rewrite this into this. It would be an ideal place for us to put that into its own file, so you can just require that and kick everything off. That's all there is to it. At this point, we're able to run all the tests we want, but microtest is kind of hamstrung at this point. Now the generalized testing is supported to be able to know what happened. On the one hand, silence is golden. You don't see an exception raise that anything ran, so you're not quite sure that they did. I think this is one of those situations where the Russian proverb, trust but verify is a good policy to have. Let's give the framework a way of reporting its results and see if we can't enhance things while we're in there. How do we know what the results of the run are? I personally would be pretty happy just seeing that something ran. Let's start with that as a minimal goal. Here comes my favorite slide I've ever written, ever. Let's print a dot for every test run. I think Tufti would love that slide. So let's add a print and a puts, and we're done.   Quite simply, we print a dot for every test and we add a new line at the end of the run to keep it pretty. Doing so, we see this. Now that we see that we ran three tests and they pass, and we have usable information about our test run, but what about failures? What happens when a test fails? Currently, if a test fails, it immediately quits since it was raising an unhandled exception. It's not too terrible, but it does imply that you only see the first problem that raises. That might not provide as much insight as seeing all the failures at once. So let's clean this up. We'll rescue the exceptions and print out what happened for each one. And now we see all the tests regardless of failures. We also don't see loads of backtrace. We just see the failed assertion. And perhaps it's not the prettiest output in the world, it is much better than before. But there's still several things that I don't like about this code. I don't like that the logic for running a test and doing IO is mixed in the same method. It's just messy. So I want to address that in the process, refactor the code to be more maintainable and capable. The problem I have is that the run class method is doing way more than just running. There are about four categories of things that it's doing throughout. The first thing I want to do is separate the exception handling from the test run. I really don't like the test run as handling both printing and exception handling, but I especially don't like the exception handling. So let's address that first. Since test class run calls test instance run, which calls your actual tests, it's too hops up from where any actual exceptions are getting raised. We should refactor this and break up the responsibilities. I want run all tests to only deal with running test classes from the top. I want the run class method to run all of the tests inside that class. And I want the run instance method to run a single test and handle any failures. And then I want something else entirely to deal with showing the test results. So let's move forward with that goal in mind. First, let's push the rescue down so that the instance method returns the raised exception or false if there was no failure. Now we change the class method to print appropriately based on the return value. Now we have exception handling pushed down to the thing that's actually running the test. Having exceptions only raise a single level usually means that you're in a better place to deal with them. And by doing this, we've converted some exception handling into a simple conditional. Next, let's look at the IO. Let's extract the conditional responsible for IO into its own method and call it report. By doing this, we put ourselves into a better position to move that out entirely. So let's do exactly that. We'll extract the report method into its own class called reporter and we'll grab that puts that we had in there too while we're at it. This lets us rewrite run all test into something much cleaner. We pass down the reporter instance to run and we use that to call report instead. The same was a block variable before we need to pass that to report as well. By doing this, we removed all the IO from the test class and delegated it elsewhere. Throughout these changes you should be re-running the tests to ensure that it works the same. But in this case, it doesn't. The class name is wrong. Now that we've pushed the reporting into a separate class. For now I'm going to go with a quick fix route passing in the class. I'm intentionally focusing on fixing the bug not using the right abstraction. Sometimes this is the right thing to do because you need to get stuff done but you pay a price in doing so and we'll see that. So let's add a new argument to report and we'll call it K for class and pass in the current class which is self in any class method to report. This fixes our output back to what we expect. Let's add a third argument to do that and that should be a hint that we're doing things wrong. So let's try to address that now. We don't need to pass the actual exception to report. We can pass anything that has all the information that we need to report on the test result. And what better thing than the test itself? All we need to do is make the test record any failure that it might have and then make that accessible to the reporter. Let's add a failure attribute to test and default that to false. Then we modify run to record the exception and failure and return the test instance instead of the exception. Now we can use the accessor and reporter to get to the message and the back trace. Let's clean up the mess we made with the third argument. Now that E is the test instance we're able to get rid of the K argument and that gets us back to two arguments which is still one too many. Let's try to remove name. With a little tweaking, test instances can know the name of the test that it ran first by adding an accessor and then storing it and initialize. Then pass in the name to the initializer instead of run and finally by removing the argument from run and using the accessor. This means that a test instance is storing everything that reporter needs to do his job and we can get rid of the name argument. There's one more thing that I don't like and that's mixed types when you don't need them. Right now E is either false or the instance of a failed test. But tests already know whether they've passed or not. So false isn't helping. It can be the source of pesky bugs. So let's get rid of it. By adding an insure block we can get rid of that false and make sure that the run method always returns itself. One thing I want to point out is that you really need that return in this case otherwise it might return one of the values from previous blocks. Next let's add an alias for the failure A predicate and switch reporter to use this new predicate method to test. This looks pretty good now. I just don't like the name E anymore. This is no longer an exception but a test instance. So let's rename it. Let's call it result. This makes the code much more descriptive albeit longer. At this point I could call it a night. I really could. But the output is still a bit crafty. I want to enhance the output. It would be nicer if we separated the run overview the dots and Fs from the failure details. Something like this. Let's change report to store off the failure and print them in done. That's pretty easy to do. First we need a new failures array to store them and then we need to make an accessor and initialize it. Then we need to print an F when we do get an exception and store off the result in the case of a failure. Finally, we need to move the printing code down to done and into an enumeration on that array. And our output looks much, much better now. But we're still not quite done. There's still a couple things left that are getting on my nerves. Let's report and done quite a bit. They're no longer doing what they say they do, so let's rename them. Report becomes shovel or chevron. Done becomes summary. And we use those names in test. At this point, I'm pretty happy with the code. But that does not mean that we're done yet. I'd like to add some more enhancements. One common problem is people often write a test that depends on side effects of a previous test for it to pass. If that test is run by itself or if it's run in a different order, it will fail. That goes against our rule of testing. The test should pass regardless of their order. An easy way to enforce this is simply run the test in random order. That's easy to do in our current setup. But I'd rather not mix too many things into this method. So let's start by extracting that code that generates all the tests to run. Now test.run only deals with enumerating test names and firing them off. So we're in a better place to randomize the test. And that's where all there is to it. We could get fancier, push it up so that run all tests will randomize over both the classes and the methods. But this is a good compromise and I'll leave that as an exercise for you. So we're done for now. What did we wind up with? We wound up with only about 70 lines of code. There's a good portion of what Minitest actually does. It's all factored. It has zero duplications of any kind. The complexity score is incredibly low. It flugs in at only 70 or about one per line, I guess. Or about five per method, which is half of the industry average. And it's, even without comments, the code is incredibly readable. The reporter, the test class methods and the test instance methods all fit. Rather readably on one slide. You guys can actually read that, can't you? It's a little fuzzy. It's not bad. It actually runs twice as fast as Minitest because it's doing less. Don't switch to this, though. The worst thing about this talk is that I spent about nine slides for every two lines of code, but that's a price that I'm willing to pay to explain this well. So how did we get there? We started with the atom, then we worked up to molecules. We gathered tests into methods and methods into classes. We taught the class how to run one method. We taught the class how to run all of its methods. And we taught it how to run all classes. At that point, we decided to add reporting, error handling, and randomization as a cherry on top.  I'm hoping to soon publish a small book under Michael Hartle's Learn Enough series. If that goes well, then I'm hoping to write a much more complete book on Minitest. I will have a sample chapter coming out soon for review that I'll provide for free, but it's not ready yet. So please follow me on Twitter for announcements. Thank you. I would prefer to write tests with methods. The question was, do I prefer to write tests with methods rather than what Rails provides for the test block form? And yes, I absolutely do prefer methods. And the problem is that the block form, they're closures, right? So they're closing on all the outer scopes and always hold on to everything that was able to see at that point. Erin? Yeah, it's the closure that I actually have a problem with. It's not the string or the descriptive name. I understand that by doing it my way, you have underscores or whatever in your name instead of spaces. I'm okay with that. Why did I create Minitest?  It was incredibly complex for what it wanted to do, and I didn't understand how all the mechanisms worked, and so I already had, I don't know, 50 projects or so at the time, and I wanted to see how little code I could write to make all of my tests run and pass again, and it turned out to be, if I remember right, 98 lines of code to do all the assertions and the mechanisms that I needed, and thus Minitest was born. And it's now, I think Minitest is now 1,500 lines of code, but that's compared to the, I think it was 6,000 lines for a test unit, and God knows how many for our spec. But even at 1,500 lines of code, it is incredible, 1,500 lines of stuff, that includes comments and blank lines and everything. It's still incredibly readable, it's very well maintained, and it's faster than almost anything out there, which that is actually the most important part for me. Nope. Thank you very much.


What's up everybody JZ here for jazby's case breaks.com. We just sold out 2019-20 panini Prison retail basketball three box break pick a team's number 17 where we're giving away the pelicans to chase some Zion So again, all you had to do is buy a spot on this break You buy one team to get one entry by two teams to get two entries etc etc the more teams you buy the more Better chance percentage you have to win the pelicans Excuse me, and I remember No veteran base court ship in this besides the loopy Yannis Lebron and then Kobe is why I forgot we put it in there So I'll penny sleeve those so that way they will ship for sure So here the customer names in the break itself I'm gonna copy them post them in a randomizer and again customer at number one after the dice roll Which is a five into two seven times number one gets the pelicans. Good luck five six seven one two three four five six and seven the phone time boom seven times Robert at the top after seven times congratulations. You just won the pelicans nice Which I'm not sure who you have in this break. You must be in here, right? There you go. You had the Toronto Raptors nice Very nice. So there you go. Put a little plus sign next to your name for the pelicans And here you go. Good luck. All right, sweet. Here you go three boxes of prism Is everybody in the break itself?  There's the three boxes. Good luck for the bulls PJ Washington, Jr. Young waders over those emerging green and Gordon Silver Tyler hero Retail green rookie Heat point of Ken haunt you more on inserts Psycho magic Johnson Silver Cameron Johnson autograph rookie penmanship Phoenix Gonna Arthur now see your little green retail Pascal siacum Silver a brown James inserts Kobe whites Jason kid Dwayne deadman dumb boy a little bit on chips Russell Westbrook LeBron James height Silver for the Lakers gonna Rob EP3 Ben Simmons over Paul Pierce green Pull the O I'll try to man. Maybe Kevin Porter, Jr. All right last box everybody. Good luck Well, you got a cab's auto though.  Oh, not much sign so far in this break as well Jim O'keekie Allen. I was some AI silver. That's cool Brian Harold And there you go guys. All right you guys what we did post up two more three box breaks on the website numbers 18 and 19 So if you guys want to get the next one going 18 and 19 are on the website Appreciate it guys coming up next everyone's favorite more ballman baseball picker teams number five. I believe Sold out yesterday, so we'll be doing that next. Appreciate it guys