I'm Daniel Jackaway and this summer, thanks to Ruby's number of code, I worked on Rubato, which is working on bringing Android apps, or Ruby to writing Android apps, so you can bring Ruby to Android so you can write apps in Ruby. And so today I'm gonna talk about that and some related projects. So first of all, why are we, like some notes about mobile, first of all, it's surprisingly new, even though basically everyone including your mom has an iPhone, the app store's only two and a half years old, so really there's still a lot going on, there's a lot of new stuff, like we really have only scratched the surface in augmented reality, for example, there's a lot of new stuff to do with mobile and now tablets are coming around to add even more possibilities. Also, for some people it's very lucrative, it's hit or miss, but there are some big wins, any venture is gonna be hit or miss, but at least people are finally willing to pay for your software again, unlike online, where consumers usually aren't willing to pay. But you do have to use either Objective-C or Java right now in general, and that's not the best option, in the opinion of most people at Ruby Conferences. So if you say like, hey Apple, you know, you guys just want a Mac or Ruby, right, like we maybe, we ask nicely, no. Never Ruby on an iPhone, at least from time being, that's just not gonna happen. But Android can run anything that the JVM can run, so that includes Clojure, Scala, Jython, and even JRuby. Now JRuby does give you portability to run anywhere that JVM can, which includes App Engine and Android. But it's also just a really cool thing in general. It's pretty fast, roughly in line with 1.9. It has native threading, so you can saturate all the cores with one process. You can call Java, you can talk to Java libraries. There's all kinds of cool things about JRuby. LinkedIn is using it. You should definitely think about it. So now I'm just gonna give you kind of a whirlwind overview of the Android API, so we can kind of assume you guys don't really know much about the API as much as you know about Ruby. So first of all, the two main visual elements are activities and views. And activity is generally gonna be one screen full of things. So it's kind of analogous to a web page on when you're doing web development. So you'll have one activity that has a bunch of view elements within it, which are the views. And then when you shift to a new view, that's like a new screen, that's a new activity. I'm gonna illustrate that with a demo. So this is pretty much the first Rubalto script that I wrote. It's a very simple craps, the gambling game script. So this whole thing is one activity, and then each of these text boxes and buttons is a view. And then if I click this, this takes me to a new activity, and this is a view, or what's called a list view. And if I click this, this is yet another activity. These are both views, and I'll close it back. One cool thing about Android's UI is that basically you can always use the back button to get to the last activity you were on. So whereas in the iPhone, when you have a Twitter client or something and it wants to open links, it has a special API called open and embedded browser so that you can then just quit it and get back to the app. With Android, you can just hit the back button. It sends you to a normal browser and then they hit the back button. It takes you right back to the last activity, which is a different app, which is the Twitter app or whatever. So that's just one note. So then I go back here, I'll click this. This is a view, and I lost my back, but that's just it. So that's a quick idea. Each screen pulls that activity and each thing within it is a view. Then things that are a little hard to get illustrated visually. There are broadcast receivers, which basically pretty much any event, you can say I want a broadcast receiver to get it executed when this occurs. So that's everything from there's a time tick event, which basically just fires every single minute and that way you can do some kind of cron-like thing if you want it or stuff like that. And then it goes all the way to more interesting stuff like there's an SMS received event and you have to ask for the permission for that, but that means that any time they receive an SMS, you can be notified of that and then take advantage of that. And then there's also services, which run in the background. So the way Android's multitasking works is basically when you're on the activity, it's running and you can see to you and all that. But then when someone moves on to another activity, either within the app or to another activity in a different app, then that'll get paused. And it won't get killed, but it might get killed later if it needs the RAM back. So anything that you need to kind of keep going, even when the app isn't running, you do a service. So for example, I have a tethering app that lets me share my phone's internet with my computer. And there you open up an activity to tell it to start tethering. But then it does the actual tethering in a service and that way if the activity gets killed, I still have internet on my computer. And then finally, there's a lot of XML configs where you do things like define the name of your app. You can do layout in there. That's where you ask for permissions for more sensitive stuff, like asking and getting their location or reading their SMSes and all that stuff. So that's a quick overview. There's also, it's kind of all built on callbacks. So for example, you'll subclass activity and your activity will implement the onCreate method which gets called when it gets started. And then onPause is when they move on to another activity. So that's where you would save state and stop running CPU intensive stuff. And then there's an interface onClick. So for a button, you would pass in something that implements the onClick which might be your activity depending on how you set it up. So basically the whole thing is when stuff happens, some method gets called. And then Ubuntu would translate those to blocks. So basically instead of an onCreate and instead of defining an onCreate method, you call this handleCreate and whatever is in your block gets executed when that happens. And the way we do that is basically under the normal Java API, like if you're implementing an activity, your activity would directly subclass activity and then you would define the onCreate theme onPause, et cetera. But the way, what we do is we have this rubato activity in between. And what the rubato activity does is define all the methods that might be called back and all the code that's there basically says, push this on to Ruby and educate Ruby and give it the parameters and all that. And we do that with a very ugly .java.erb file to generate those with the rubato activity file. But you don't have to know that, you don't have to worry about that. So now getting into the heart of this, which is talking about rubato. So it started out just as a little IRB app. If you want to, you can download it right now if you get it in the marketplace scanner app, if you have an Android phone, if you don't have a barcode scanner app, I can't give you a barcode to download that. But you can always get it later, so I'll give you a link at the end. And basically Charles Nutter's on the .java.erb core team wrote it because he wanted to start playing with getting .java.erb on Android. It was just, it was an IRB, so just like an IRB on your phone where you could touch stuff in and it would show you the result. And then also you could save little scripts, like multi-line scripts and run them later. So that was useful and pretty cool and it allowed for some nice things, like if I'm out and I'm talking to people about movie and wondering about weird language quirks, I sometimes pull it out and try it on my phone, which is nice and I don't have to SSH into my server like I used to do on my iPhone. But it did have some limitations. You could only script activities, you couldn't do the broadcast receivers and services and other stuff. You couldn't ship an APK, which is the compiled Android package of your script. You would have to tell them, download the .java.erb, download the script, run the script, it wasn't, it's clean. And then also you didn't mess with the XML config, which meant, first of all, some of the layout stuff is easier to do with that. And also it meant that the .java.erb app just requests all the permissions that are possible. So then every script would have the ability to do all kinds of crazy stuff to your phone. And so this is, like it was a good starting point, but obviously they needed more. That's where I came in and this summer I worked on making the .java.core, which is for a full app solution. The goals of it are basically, I want it to be able to expose the entire .java API to your Ruby scripts, but at the same time, not actually require you to write a job. And then I mentioned there's gonna be plugins. So the idea is, I see it kind of like Sinatra, where it has a very tight core that basically just exposes functionality and stays out of your way. But then people can write plugins on top to make a nicer interface and make it easier to do certain things. And also I haven't done this yet, but I wanna make it so you have to write little to no XML, because no one likes XML. So the first demo that I'll do is just gonna be, I'm gonna show how you would create a starter app and then show what that, it gives you an app that does a little bit of functionality. So first of all, before you make a starter app, you're gonna need the JDK, obviously. You need JRuby, and one good way to install that is RBM, because an RBM also makes it easy to switch between JRuby and Ruby, and you can also switch between your versions of Ruby. It's pretty cool. You need the Android SDK, and then you probably wanna generate an emulator. You can develop straight on your phone and there are some advantages to that, but having an emulator is nice. You can just like, blow it away if you need to. You have root access to it, or you might not have root access to your phone, which is useful. There's some other stuff that's useful. And then once you've done all that, you just gem install robots on core. So then generate an app, and I'm not gonna go through all this, but the main important thing to know here is that the package, the Java package, is how Android differentiates between apps. So you need every app that you write to have its own unique package. You won't even be able to submit it to the market if there's already one with that package there, but it would overwrite if you were to just be working on an emulator on your phone directly, if you were installing the same package as one that was already there. And this is basically a dropping replacement for Android Create Project, which is the, if you were writing just a normal Android app, how you would generate that. So that's just nice. So this is, what that does is it basically creates, it gives you all the files that develop, that producing a normal Android app would give you, because it actually calls Android Create Project behind the scenes. But then it throws in a few other things, like it throws in those Roboto activity.java files, and a few other things like that.  It gives you asset scripts, Roboto.rb, which is the first thing you require, because it's what makes everything after that work. And then it also, back here I specified that I want the first activity that from when you launch to be called high activity, because this is just like a whole world-ish thing. And so that's why it's high in the score activity.rb. So just going through this, this is all pretty much blow and play. You require Roboto.rb, and then you ask for the view elements that you're gonna need.  You wouldn't have to, the blocks that follow, you could say activity.them and put it outside the handleCreate, but you don't have to say activity. If you put it in that. Then set title, just sets this world title bar on the top and it sets the text there.  And that's the parameter that gets passed on Create. So Roboto just passes that on to you to do whatever you need to with it. So then getting into the more interesting stuff. Okay, so set up content is where you put all the content that's gonna be there when you start. So this is saying that the outermost view is gonna be what's called a linear layout, which basically just has other views within it and puts them linearly. In this case, we're saying we want it to be vertical, so it's gonna be one on top of the other. The other option would be horizontal, obviously. So it's like the first one that you put would be to the left and then move over. So here, what makes the text view is this column of text view element and then we're just stashing it in an instance variable so that we can use it down here. And then we say text, that's pretty obvious. Then here, we also want a button, which says, let me just show you guys this thing first. But I'll get through this, actually, honestly. And then there's a button with text, MX-birefied, it's a reference to an XKCD comic. And with wrap content, it just means that you want the width of the button to be the same as the text. Now I'll show you guys what this does so you can understand the last part. Now this is gonna be slow. When I was going to UI, this is gonna be slow. It's not that JRuby is that slow, but it's that we use a lot of reflection, what's called reflection, which is the Java equivalent of calling dot methods in Ruby. It gives you all the methods that something can use and it tells you their types, like what types they return, but how many parameters they take and what types those parameters are, whether it's public or private, all that good stuff. And the libraries on Dolvid, which is the actual VM, it's not quite a Java virtual machine, it's just a replacement for the Java virtual machine. The Dolvid reflection libraries, they've told us are really slow and eventually they're gonna make them faster, but it didn't make it into Gingerbread, the next version that's coming out now. So it's gonna be a while, we're gonna work on lessening our need for the reflection as well. So this is what you get. As you saw, there's a text reader button, so that's there. And then when you click it, two things are gonna happen. It's gonna change that question mark to an activation point, it's gonna put a notification down here. So see. And the way it does that is it says handle click and then it passes in the thing that gets clicked. And then this is just a check so that if something else got clicked and it, because if you were using that same on-quick method for multiple buttons or something, then you'd wanna see which one it actually was. And then you just say it's text reader set text and the toast is a notification thing that's built into Android. And then it just closes and this end closes the block. And then there's various ways to install, this isn't very interesting and you can find it on the review, but the main thing is to make sure that you're using JRuby's rake because it needs that to talk to Ant, which is the Java build tool that Android uses. And so the easiest way is to RVM use JRuby and then everything after that would be JRuby's rake, but you can also just do your VSS rake for every rake call. And then one cool thing is that there's rake update scripts so if you're using a Java app, you'll have to recompile the whole app every time you make a change. If you just make changes to your Ruby code, you can just run, and you have root access to the device you're using, it's a part of why you wanna use an emulator, then it can just copy the scripts on and then you don't have to recompile it and reinstall it and copy the scripts so that you can restart and see that it changed. So that can help you develop a little bit faster than you might be able to with Java. And now here's a little bit more of an involved demo that actually does things. So, I guess I'll share it all first. Basically, I wanted to do something with the hardware because that's what is interesting about mobile really. And so I made this demo, I'm gonna actually look in the photo booth so that I can show it to everyone. But basically what it does is it uses the accelerator to see when you move the phone and then it changes the background color when you move it, but not on a scale. So it's still right now, it's kind of a sense that it should change the professional, but it's still right now, but then if I move it, it's gonna have to see, you can see it up here too. So yeah, so let's see how we do that. All right, so this is a bunch of, so this is the same basically as what you saw before. And then we just have a text view in this case. It says shake or this one, you can actually see that. But then, and then there's a bunch of imports, we need more because we need like the sensors stuff and the color stuff. That when loss is the same as handle create, it's alias in that way. Whereas with a broadcast receiver, you have to know that it's on receive and with a service and I think it's also on create. When loss will work for all of those ideas just to kind of make people not have to think about what the actual underlying API is quite as much. So then we set title again, just like before. Then we, this gets us a, what's called a sensor manager. This one here. And then we ask for all of the accelerometers from that sensor members. So we ask for a list of the sensors that are type accelerometer. And then we check if it's empty. You can say on the emulator, you're not gonna get any accelerometers because there aren't any. And that way it won't totally crash it's empty. But otherwise, then we set an instance variable to be it so we can use it later. And then actually the most important thing, next, on resume also gets called on create. So you wanna put anything that needs to happen anytime you resume in there and we call both of them. So on resume, we're gonna register the listener which means that we wanna get notified when things happen and then on pause, we unregister that because we don't wanna know that they're shaking if they're not actually on our activity because we don't wanna be updating stuff. And then go ahead and see what happens when it does shake. It passes in the sensor event object. And then we make sure that it is an accelerometer because again, we might be using the same method to deal with some of the other sensor types like the proximity sensor. And then if so, then this is just a convenience one so we don't have to keep coming down values every time. And then this is to add a threshold to make sure that they're shaking it enough that we wanna change it because otherwise even as it was my unsteady hands sometimes we're shaking it. So then this is to make sure that's like taking the magnitude of the acceleration vector. And then this is the one that changes the color. So it changes to a random, this is a random color here, the color random 55 to 55, 55, 55. And then set, and then that makes a color, what's called a color drawable. And then it sets that to be the background drawable. You don't need to know all the specifics that are necessary. If you would look in the Android documentation, you were actually trying to write this. And so that's like, it really isn't that much code. And it's a little bit, probably a little bit simpler than it would be in Java and it's very easy. So, moving on. One thing that you probably noticed is that it was slow. I already had, this one, the one I did on my phone wasn't slower than it started out before. The one before was slow. A little bit slower than it would be on a phone. I think I figured that a whole world takes around seven seconds on a phone but it's still not really acceptable to actually use it this time. But it is possible to get you some of the benefits here but actually usable today and fast is what's called Mira. Which, this is a language also by Charles Nutter. It's a JVM language, at least from now, although he actually has it set up so it's gonna be pretty easy to say, write a C++ backend or a .NET backend as well which is one of the benefits to it. The goal is to have as much of a Ruby-like syntax as possible. And you'll see that in a second. It even has closures and all that stuff, meaning blocks. But it's statically typed and the big thing here is it has no runtime dependencies. So whereas a Hello World app for Rubato is around 10 megabytes and it still has to ship with the JRuby jars, a Mira Hello World app is, and that also slows it down because it has to start all of JRuby just to do these little things that you pretty much can write yourself in Java. The Mira, it compiles straight to either to Java code or to Java Lake code and compile Java. So that means that it's basically as fast as Java you would write. You'll see it basically generates the Java you would write but not quite. So it's got the speed, it means that you don't have this big this big startup value. You have a big jar that's slow to load for something when you're just doing Hello World or something small like that. It just grows as Java. Anyone. So this is the Hello World in Mira. It is exactly the same as it would be in Ruby. You get instance variables, you get the string inserting, you get all that. And then slightly more complicated would be Fibonacci here. The only diff from Ruby is that you have to tell it that it takes a fixed num which then translates to the right kind of integer on the back end, depending on which back end you're using. Note that you don't have to tell it your return type because it can infer that. So that's pretty cool. And the Java code that it generates is really not that scary. It's a little bit weird and this whole thing will be on one line but it didn't fit on my slide. But except for the fact that it's using the ternary operator and it's all on one line that's pretty much how you would write this in Java. So that's, and that means that it's gonna be just about as fast because that's how you'd write it in Java. So demos of that. Techno-Rancy wrote this thing Garrett which I will not show you the code to. It's fairly long, which just has a bouncing ball. But what I did is I just took, it's really pretty much just a straight Android application but he added one task to amp the build tool to compile the Mira to Java code before doing the rest of the build. But I just, I basically stole that and wrote, more or less rewrote the hello world that I just showed you in Roboto in Mira. I'll show it, I won't show it to the screen but you guys can read it. So this is what a hello world app which I'll show you would look like in Mira. So first of all, look at how fast this loads. It loads basically instantly, just like a Java on wood. And then I didn't do toast, I didn't do changes by the size of this, that's a little bit of a pain, but you can see it, it does the same thing, and this looks, so you do all these imports, some of these imports are things that we did in the Roboto that RB did and some of them are things that RobotoActivity.java did. And then you see it's pretty much, it's a little bit different, you can't, you don't get like passing in hashes and stuff. You could also change some of this layout to be in XML and that, they claim it's easier but I'm not a huge fan of XML. But it really is pretty self-explanatory and it doesn't look like Ruby. You have this block here, and it's not that complicated and yet it still feels like Ruby, you don't have to work out your right pinky so that you can get all the semicolons in, et cetera. But one thing which is kind of, if you look back at what this looked like, this does feel more like it's all blocks and stuff and that also means it's a little bit easier to build abstractions up from this than you could write blocks that call out their blocks. And so that's one of the things I'm hoping for with Roboto is that plugins will be, and we pretty easily write a plugin that's powerful and makes things easier. So moving on, one thing that you might have heard of is what's called scripting layer for Android which is another way to write Ruby code for Android apps. These are quotes from their website. Scripts have access to many of the APIs available to full-fledged Android applications, but note that that doesn't say all. And they aim for a greatly simplified interface. They do have an impressive list of languages, big support including TCL and Lua and Beanshell and they are planning to add even more, which is cool. And you might have seen, there was a blog post a few months ago that had a spy camera app which was pretty cool. They vended in Sinatra and then they had the app. You would go to your phone's IP like usually over wifi you can do that. And then what it would do is it would take a picture with the camera and then render you a view that served you that picture. And that was pretty cool and it was really cool code. It took about 30 lines to do that. But, and so it is a great project but I think that it's not the best approach at least for what I'm aiming for. I want Roboto to expose the full Android API so that once we get speed under control people can use that for any app they want to. And even things where really you care about being able to have full freedom you can do with Roboto. So it seems like Scripting Layer for Android is more for hobbyists and playing around with it. Whereas I'm aiming for exposing everything in that for allowing me to do more even everything basically. And then ways for Roboto to be better than the other options. First of all Rui, second of all break up the script as cool as I can. And third of all the abstract is the ability with this block basically you could write plugins pretty easily they just call their blocks and like make a whole bunch of text using. It's a little bit more powerful because it's Rui and because it's closures and all that. And then ways that you can help. First of all just use it and then complain when things are broken or confusing because there's probably some things that don't work that well that we just don't know about because there aren't that many people using it. One more block would be when something's confusing you contribute documents. So like if you find something confusing but then work your way through it and ask us an IRC then you could go to the Wiki and update that and update them to make it more clear for future people. And then one step up would obviously be forking it and contributing to the actual code. And then soon also have a plugin architecture so that you can write plugins and upload that. I'm going to go fast but that's basically it. Thank you a lot to Charles Nutter because first of all he is much of the reason why JRuby is as mature as it is. So without him we wouldn't even necessarily be able to do this and also he was my mentor for Ruby Summer of Code. Thanks for all the Ruby Summer of Code sponsors because that's how I managed to do this. And also early contributors and you probably haven't heard of them Scott Neuer, Jim Burkele, Jim McAvron who all been pre-active in pushing this and working on code. And if you have questions you can ask me now or find me after this, I'll be around for the next two days. And then all the everything I referenced here this is my slides, the demos, like links to Roboto and stuff are all going to be on my blog. Actually I already are and that was really fast but I'll take questions. Building path to back in on it like roads or say a kindness catch port for Android or you're simply using typically the SQLite 3. What do you ask me? What type of backend is typically used for the apps on this for storage? Right now, not much. You can write to the files, which would be the main thing but we're going to add as we, we always support a few of the classes right now but as we, it shouldn't be too hard to move on to support all the classes and that includes the SQLite helper class whatever it's called, the latest SQLite. So there's no use of anybody using roads? Roads is kind of separate. Yeah, so it's a Ruby, I wondered if there was any written between those two Ruby systems. Not to my knowledge because roads like, you write a Ruby in that, that compiles it down to the job or the other. Here you're actually interpreting the job on the device or on the Ruby on the device. Roads is totally separate is the journey to that. How do you push it? So what about the rest of the Android SDK? What do you mean? Stuff in Eclipse, the emulator, the logic. Well, the emulator, I mean. Building a resource in the SQLite. All right. Well, there's some, I'm, I mean, I have rake tasks and stuff that the Robots of command one tool can do for some of the stuff that Eclipse would do. I guess that'll expand in the future. For the emulator, it's not that hard just to generate yourself really. So that's the short answer, I guess. Were there any kind of like a testing framework? And kind of that's like the worst part of Android development right now. It's hard to test this. I haven't really thought about it. Like, obviously eventually that would be good, but I don't really, I think first thing is you get it fast enough to actually use and exposing the entire API. But then yes, testing would be good. If you want to write that. No. For someone like just starting to develop Android, why would you recommend using Roboto over like just going in with Java and that's the game? Because you're like Ruby? And also because, as I said, eventually, I think that we'll be able to make a simpler interface between the block-based interface that we have and possible plugins on top that make it even easier. But I mean, if you want to write it out right now, don't use Roboto, use either Mira or Java. And Mira basically is Java. In the end, we'll give you all the things that Java would give you pretty much. Just like your examples, you have a pretty heavy DSL in your Roboto. Yeah. Just the subclassing. Yeah. What was, when designing your Roboto, why did you decide to go for DSL instead of just using some classes? Well, the DSL is already there, but there's also, I think it's, Charlie, quickly for a moment. I think it's not actually possible on the phone to subclass, to have a Ruby class, subclass, Java classes, right? Because it needs to generate bytecode to do that and we can't generate Dalvik bytecode at the time. The way the Android API works is that you write Java code. It gets compiled to Java bytecode. And then the Android tooling compiles it to Dalvik bytecode, but you can't do that on the phone. I guess we could, but we don't have support for it yet and there would be a pain to add. So with that not working, the only real option is to have these generated Java files and pushing it along to a calling a Ruby script. Other than the fact that you can't extend an activity, you don't necessarily have to use this DSL. You can't just have a script that gets the dollar sign activity thing and just starts calling. But you can go through and do the, basically the same thing in Mira. You just need the extra little help for getting an activity. So you had mentioned before about Java reflection being slow. And that you're working to improve the performance and the contributions. So what is the plan in terms of this? Well, I think, we haven't talked about it too much, but I think basically trying to do it ahead of, like doing the reflection ahead of time and have it cached essentially would be the goal, but it's a little pain. We're not totally sure. All right, I remember you went on music with the package of JRuby and the application. There was quite a large size package. Not really. We thought about, we've talked about, like trying to take out classes that you like certainly wouldn't need, but it's not yet. The Android world is that Google, like basically just drops their next big thing. They've worked on it in secret for a while and dropped it on the floor. And that did you guys during the talking? Not really, just the way we have it. We generate, we use reflection to generate the files, so which means that it just goes through and asks for the methods and then pulls them all in. So it's pretty much, we can generate that in like five minutes or less. So not really. But I mean, if you want to plan how to, what you're going to do with your app, then obviously that's a little bit pain.


Dear students, I will be discussing with you the properties of the joint cumulative distribution function and I will start by defining the joint CDF. So let me take a simple case when we have only two random variables X and Y and in this case the joint CDF is given by capital F of the random vector X, Y at the point small x small y is equal to the probability that the random variable capital X is less than or equal to small x and the random variable capital Y is less than or equal to small y. Now let me give you the properties of this joint CDF. As you can see on the screen there are quite a number of properties of the joint CDF but at this point in time I would like to focus on the first three. So the very first property reads as follows capital F of the random variable X at the point small x is equal to capital F of the random vector X, Y at the point small x comma infinity. You see that we have the second property capital F of the random variable Y at the point small y is equal to capital F of the random vector X, Y at the point infinity comma Y. So let's talk about the third property. Definitely I would like to try to explain these two first two properties which as you can see are quite similar to each other. That is to say that in the first property we are talking about capital F of the random variable X and in the second property we are talking about capital F of the random variable Y. So the point is that if you pay attention to these two equations, the left hand sides here students they are the marginal CDFs. Are they not? Obviously, when you are just capital F of X or you are just capital F of Y, obviously you are not considering the joint thing and you are actually talking about the marginal CDF of X and the marginal CDF of Y. And now if we look at the right side of the equation, look at the right side of both equations, then you will see that there is also a pattern there. When our left side is written as F of X, then in the right side where the comma Y is written, the place of infinity is written and when our left hand side is written as F of Y, then at that time our right hand side where X is written, there is infinity. So if you pay attention to this a little bit, then the only thing is that since you are taking out the marginal of X, then the second variable Y, if you have a continuous variable on it, then you will integrate on the entire support of Y. Because you are interested in X and you are not interested in the other and you will have to integrate over that whole thing in order to get the marginal of X. Exactly the same kind of logic for the second one, that if you want to take out the marginal of Y, then you will integrate over the entire support of X. If it is a continuous variable, then it will be integrated. If it is a discrete variable, then it will be summation. So this is rational for the first two properties. Equally importantly, let me discuss with you the third property which reads as follows. Capital F of the random vector X, Y at the point infinity comma infinity is equal to 1. The thing is that if you integrate both the variables from minus infinity to infinity, only then you will get this expression capital F of X, Y, infinity, infinity. So when you integrate the whole thing, then you will get this expression. And obviously in that case, the answer has to be 1. Because if it is a two-dimensional case as is the one in front of you now, then integrating over both over the entire support of X and the entire support of Y means that you are computing the volume under that surface entirely. And you know that in this particular case, volume represents probability. If there is a univariate situation, then area under the curve represents probability. Here, volume under the surface is representing probability. And if it is done entirely, then obviously if the total probability has to be 1, then obviously this thing will be equal to 1.


The Bitcoin network is currently consuming over 130 terawatts in electricity per year. That's more than Ukraine or Argentina. The majority of Bitcoin mining operations are located in China, where 65% of Bitcoin's hash power is produced. A study says that this could prevent the world's largest polluter from reaching its emission reduction goals in the next decade. According to critics, Bitcoin risks becoming an environmental disaster. I fear that this will quickly get completely out of control if adoption increases a lot more. But crypto advocates disagree with these forecasts of catastrophe. They are confident that Bitcoin can become sustainable and even contribute to the green economy. There is an aspect of miners seeking cleaner for cost. We can drive real impact onto the ground in communities that can install renewable energy. Join our latest coin telegraph crypto duel with Alex De Vries, data scientist and founder of Digiconomist, and Josef Palant, CEO and founder of Blockchain for Climate. First of all, let's put things into perspective. Bitcoin's global share of annual emissions is around 48 million tons of carbon dioxide per year. That's only 0.15% of the global annual total of around 31 billion tons. So, looking at these numbers, doesn't Bitcoin's environmental problem look a little bit overblown? Why should we be so concerned about it? Maybe Alex wants to start. Sure. That number you mentioned is the current estimate, but that doesn't yet include the expected increase in the network's energy consumption and there's also the carbon footprint. So, you have to consider the Bitcoin price went up by a lot very recently. But that doesn't immediately increase the energy consumption of the network. You have a very long lead time in the production of new devices. The good thing is we can calculate or estimate where the energy consumption of the network and the carbon footprint is going to end up at. So, you could say that we can expect this number to at least double or triple for Bitcoin alone. And then, of course, you have to consider the other cryptocurrencies that run on proof of work as well, which tend to add 50% on top of what Bitcoin is doing. So, altogether, factoring in the latest price increase and assuming these machines are delivered. Somewhere in the next year, you could be talking maybe half a percent of our global emissions related to Bitcoin mining. Now, you could still say, OK, that's not the biggest thing in the world. There are probably things that have a bigger carbon footprint. But at the same time, the Bitcoin system is also still very small. We haven't achieved mass adoption yet. There's only been one S&P 500 company that has so far invested in Bitcoin, being Tesla. And I think most Bitcoiners will agree that there is a lot of upside to the Bitcoin price as a result, which also means that the carbon emissions related to mining could go up by a substantial factor as well. Because those things are inherently related. So, yeah, apparently, Bitcoin's energy consumption is increasing and it looks like it will continue doing so. What do you think, Joseph, about Alex's estimations of Bitcoin's future energy consumption? Does it look an estimation that you agree with? Well, I think that the baseline numbers and the current numbers, I believe, come from a lot of Alex's really well researched work. So I think that I'd say that that's technically accurate to be projecting that growth. Looking at 48 million tons of CO2 per year, or let's say 75 if we're adding the other coins, but let's maybe stick with 48, I would say it is a lot and it is a little at the same time. And I really want to couch this all in that addressing climate change is really one of the major challenges of our time. And so the opportunity to dig into this is actually one we need to take. If we are cryptocurrency fans, if we are Bitcoin fans, we do better by leaning into this issue and solving it rather than leaning out and saying it's not our problem. 48 million tons, it's sort of difficult to put in perspective of, well, how much carbon is that? Well, Canada's emissions right now are 750 megatons per year. And the States is around 5,200, I believe. And so, for example, that 48 megatons Canada has committed to cut about five times that between now and 2030 for its emissions targets. So it's, you know, it's a lot and it's a little. A lot of critics about Bitcoin's carbon emission also compare it not to countries but to alternative payment systems. So Bitcoin is a arguably payment system and it should be compared to other payment system in terms of energy consumption. So according to research conducted by the economists, the carbon footprint of a single Bitcoin transaction equals the carbon footprint of roughly a million visa transactions. However, those numbers have been widely criticized as they don't take into account the energy costs of the wider financial infrastructure that visa needs in order to perform a transaction. So on the contrary, Bitcoin is a self-sufficient system which doesn't require any more energy in order to work. So Alex, you are the founder of Digiconomist, so you produced those criticism. So how would you respond to that counter argument? Well, you know, it's very hard to, you know, make a proper comparison with the regular financial system, especially considering that, you know, Bitcoin has other issues than its energy consumption, one of them being scalability. So you could say that you could not compare Bitcoin to a payment system simply because a payment system like visa can handle 65,000 transactions if they need to and Bitcoin doesn't get any further than five transactions per second. So is it really fair to compare the two? Difficult, very difficult question. Now, let's stick with the payment systems. We know that all had the whole financial world together processes around 700 billion electronic transactions per year. If you look at Bitcoin, Bitcoin is doing not even a fraction of that. It's doing 120 million. Now, if you were to scale them up to the same level, you need a very large factor. If you were to increase Bitcoin's energy consumption by that much, it would exceed our total global energy need at the moment. So we can be pretty certain that the financial system is to some level more efficient than Bitcoin, even if you can't perfectly compare it to visa or anything else. OK, so now I would like to know what Joseph thinks about this. What about this specific comparison with the visa system? Do you think it's a comparison that fits? Once again, I'd say yes and no. I think that it's unlikely, maybe in a deep maximalist sense. People might think that we would do all of the transactions on the Bitcoin mainnet, or maybe it goes to Lightning or maybe it goes to another cryptocurrency to do that work. So I don't think it's a really... It's not apples to apples. Coinbase brushed off criticism about Bitcoin being bad for the environment, defining them as myth. So in a recent blog post, they said that Bitcoin miners will be increasingly incentivized to use renewable energy, which are becoming the cheapest form of energy available. Thus, according to the article, Bitcoin mining will help driving sustainable energy innovation. So what do you think about this argument, Alex? The thing is, when people say Bitcoin will use renewables, I don't see what type of renewables, because I see people saying, OK, Bitcoin can be used to, for example, use the excesses of solar power. We turn our Bitcoin miners on when we have an excess of solar power production, which sounds like a great idea until you realize that, you know, that means that those miners will be shut down for the rest of the day when there isn't an excess. So there is no incentive for miners to just, you know, enroll themselves into a scheme where they can only get power for an hour of day because it's a massive opportunity cost. They would rather run their machines 24-7 and get power, cheap power all the time, because that maximizes their potential returns. So in that sense, I don't see the compatibility there. I do see that in this energy transition, the thing that's slowly starting to become obsolete is actually fossil fuels. And if there is one thing that Bitcoin miners love, it is very cheap, obsolete energy sources. And we have seen, for example, reports about the state of New York, where Bitcoin miners are now getting involved with obsolete natural gas plants, trying to save those so they can repurpose them for mining. And we also saw very recently in Kentucky that a clean energy subsidy was converted into a tax break for Bitcoin miners because the state believes that these miners can play a role in saving their obsolete coal industry. Now, that is something I see as a very realistic scenario for Bitcoin miners to increasingly take advantage of these fossil fuel sources that are becoming obsolete. But that is obviously not going to be the trend that, you know, hey, you are mentioning just now. It's actually the opposite. I see the future of Bitcoin mining in obsolete fossil fuels rather than in renewables because we need those renewables to clean up our grid and meet our climate agreement goals. That's an interesting point of view. Joseph, what do you think? Are you as skeptical as Alex regarding the possible importance of renewables to solve this problem of Bitcoin? I think that saying that the environmental impact, brushing it off as a myth, I don't think that that's accurate. I think that's a little bit too pat of an answer. But overall, I believe that the climate scrutiny of Ethereum and Bitcoin can actually have a really positive effect. We can get to net zero emissions of these blockchains through reducing emissions where we can and offsetting the rest. And I think that if the communities want to, if Bitcoin wants to, if Ethereum wants to, they can absolutely take the network's carbon neutral. I've been working for the last 16 years developing projects that get or keep carbon out of the atmosphere and economic and policy tools to make sure that this can be done at Blockchain for Climate Foundation. We're working on building the Bitmo platform to connect national carbon accounts of the world and enable cross-border collaboration on emissions reductions under the Paris Agreement. We can do wild stuff with crypto. We can build amazing things on the blockchain. And we do this, of course, so that we can drive real impact onto the ground in communities that can install renewable energy. If we're looking at an offset point of view, that communities can manage their forests according to their priorities that people can cap landfills, take that methane, use it for something useful. So I believe that leaning in rather than brushing it off as a myth is ultimately going to be the way we get through this discussion. I would like to get into your main field of expertise, which is Ethereum. So the Ethereum community has pledged to switch from a proof of work to a more sustainable proof of stake system. Alex, you are very skeptical that such transition will ever take place. Why are you so skeptical? Well, I don't know if it will never take place. I just know that it's challenging. But that's inherently to making changes on a public blockchain network with a lot of different stakeholders. And if you want to make a change like this, where you replace the mining with an alternative like proof of stake, you need to onboard at least all the stakeholders that are in miners. Because otherwise you risk that there will be another split in the network. And we know for sure that the miners are not going to make the change. And they will argue that you will have to keep running on proof of work Ethereum to be certain that you have enough security because they will say proof of stake is not secure. And they might be able to convince a part of the community to go along with that. And then you might end up with a split like this. So it's a very challenging thing to make it happen. Like it's not even the software because we know proof of stake solutions have been used for years and they're used in various other cryptocurrencies. But getting it implemented in what is currently running as a proof of work blockchain it's possible, but it's just very hard. And that's why you see Ethereum promising for the past few years. They'll be doing this, but still probably not succeeding this year. Okay. And Joseph, what do you think? How can we solve these obstacles that stand in between the transition towards a proof of stake system for Ethereum? I've seen the Ethereum community do amazing things. And so I have a lot of faith in what they say and their ability to pull tricky stuff off. I know that proof of stake has always been part of the plan since the beginning of Ethereum. And one could say, well, then that kind of invalidates the argument that it's going to happen because they've been saying it's going to happen for years. On the flip side, I think it's beneficial that the concept has been baked in and they're working towards it. With the launch of the beacon chain last December in 2020, that's really the start of Ethereum 2.0. That's sort of a chain that's going to organize the transactions and the merge of proof of work and proof of stake. And I see amazing people who are on the core ETH 2.0 teams that I have all the faith in the world for. So I believe that the process is ongoing. I believe that the Ethereum community has the nerve and the steel to make that happen. And so I'm absolutely comfortable that we'll be moving to proof of stake in the next year or so. So while the Ethereum network is going to switch to a proof of stake system, there are not such plans inside for Bitcoin. So what are the other ways to reduce the carbon footprint of Bitcoin according to you? I do see two key pathways. And I think of supply side opportunities and demand side opportunities around greening Bitcoin, if you will. So supply side opportunities include the world grid just gets cleaner. So hopefully there is a shift going on that has other drivers sort of outside of the Bitcoin realm that we move to a lower carbon state and that some of that affects Bitcoin mining and that we're able to accurately reflect and quantify that. There is an aspect of miners seeking cleaner for cost. So in the case where we can be putting in renewable energy in places where it's a great fit, we do know that in a lot of places, solar and wind power is the lowest cost. And if there's a way to have miners be seeking that and being able to communicate that they're on renewable energy, this becomes part of the equation. Alex, what you what you think about this perspective that Joseph just explained, does it sound too optimistic to you? Well, my most optimistic view would be that Ethereum, first of all, succeeds in implementing proof of stake and that Bitcoin were to then follow the same example, because if that were to be the case, then you have solved all issues. And by the way, how we have seen again, I mentioned earlier the power outage over the weekend in Xinjiang, which showed that we have a pretty big concentration of computational power in a single county in the northern province of China, which is also from a security perspective, not so great. The risk of having a lot of equipment at the same location is that equipment gets confiscated and used against Bitcoin. And if the majority of the network is up for grabs in a single country, in this case around a quarter or more in a single county of that province, then that's a major security risk too. So you have more reason than just the environment to actually consider moving away from proof of work. Now, if you don't do that, then the solutions become more challenging, because you want to get this network on green energy then, or specifically excesses of green energy that you don't need elsewhere, because otherwise you get displacement. And how are you going to get that done? Then you have to come up with clean energy tax breaks for maybe Bitcoin minus, so they use that green energy. But like I said before, I don't see that as a likely path forward, given that it's actually fossil fuels that are becoming obsolete and very cheap. In that sense, perfect for Bitcoin mining or proof of work mining in general. Joseph, do you have any other possible solutions to mention? How can Bitcoin become greener without switching to a proof of sex system? So I mentioned a little bit about supply side opportunities where the grid gets cleaner, miners mine cleaner, different ways to reduce emissions there. The other aspect is demand side. So if mining pools, maybe you set up a mining pool where they source green power minted Bitcoin, maybe this is an attestation simply that the miners are saying, yeah, in this pool, we're going to do it. Maybe you have some verification pathway that I'm not exactly clear how you would do. And then they sell this to institutional buyers, for example. So I know that there's people in Canada that say, oh, we only want green Bitcoin. I also think that you can simply offset the emissions from a specific number of Bitcoin. So if you have supply coming on the market through a pool, you could be estimating the carbon emissions and then offsetting that rest. Now, what, of course, is necessary for any of these to really hold water is a durable tracking of that green Bitcoin, a way to tie these better environmental outcomes anywhere along the spectrum to that Bitcoin. Have done, so many people have done a bit of thinking about this. I think one straightforward way is to wrap that Bitcoin as in the RC20 token and put it on the Ethereum network. I think some people will vibe with this, others won't. But you could also attach an offset or really the carbon inventory and offset into that token. Don't know if you could do that as the RC20. You could definitely do it if you made it an NFT. So you could have a Bitcoin wrapped NFT and have information about the emission reductions, the baseline footprint and all of that. And so I think that there are some really neat pathways there. Those were Alex DeVries, founder at Digiconomist and Joseph Palant, director of the Blockchain for Climate Foundation. I'm Giovanni, your host. If you enjoyed the conversation, don't forget to smash the like button and subscribe to our channel.


Many parts of East Africa are facing complex economic, environmental and conflict-driven crises. Pastoralists in the greater Karamoja cluster have not been spared. The region covers an area almost the size of the United Kingdom. Spanning across the borders of Ethiopia, Kenya, South Sudan and Uganda, cross-border resource sharing and livestock coordination programs have been essential in building resilient livelihoods and contributing to lasting peace. This is a story about strengthening the pastoralist way of life and disentangling it from a legacy of conflict, vulnerability and poverty for all the people of the Karamoja cluster, from Pocot and Karamajong shepherds and a young girl's passion for farming, to a Kenyan veterinarian's life's work. This is the result of more than a decade of FAO's work in building resilient livelihoods, contributing to peace and stability and overcoming a challenging history of cross-border proportions. Pastoralists voices in 360 degrees, a story on inter-community coexistence in the greater Karamoja cluster.


Mr Gorbachev, tear down this wall. A new chapter in Hong Kong's history was written in Beijing. We will not tire, we will not falter, and we will not fail. We are travelling along a bumpy road as the economy rebalanced. When Lehman Brothers collapsed, it caused panic in the banking industry. Greece should be pushed out of the eurozone. We are willing to build bridges. We will do whatever it takes to maintain price stability in the euro area and to preserve the euro. The British people have voted to leave the European Union. Brexit means Brexit.


What's going on guys? It's your boy DPJ here today with another Destiny video and today I bring you the first of a new talk about series called The Road to a Two Man Feed with a No Land Beyond. Now this is basically just an excuse for a video or a series of videos where I play PvP live with a No Land Beyond. I mean I needed a title and what better than The Road to a Two Man Feed? I mean like Two Man Feed. So easy but it ain't easy for me. It isn't easy for me. You guys have witnessed me sniping. I am bad. You don't have to. You can abuse me. That's what this video is for. You can hate me in that comment section of how bad I am in PvP. That's fine. I'm no one bad. I'm no one bad. Which is why it's The Road to a Two Man Feed. I'm not a ten man feed. I'm a five man feed. But once I do get a two man feed, which is two kills, two shots in that feed. It'll be The Road to a Three Man Feed, which ain't gonna happen. And then if I do with some milk, I'll get three man feed. The Road to a Four Man Feed.  But it's just my excuse to play The No Land Beyond, which is a weapon I love. I really enjoy using. Which I ain't, when I ain't trying to do something, I mean like this past week Iron Banner's been here. So I haven't, I used it a bit, but not a lot. Because you're trying to win. You wanna win. You wanna get that rep. You wanna rank up. Normal PvP.  I just play it for fun. So I can use The No Land Beyond all day, every motherfucking day. So yeah. So yes, yes, yes. No Land Beyond with my backup weapon, my Pirate Crusher, plus one. Which I love by the way. Which I love by the way. I could use Go Out all the way, two snipers, but like I need something.   This is not gonna go well at all. Yes, you guys can point me in the direction of where I'm going wrong in that comment section. I mean my accuracy isn't bad. It ain't the worst. It's not the best, but it isn't the worst. I can hit body shots quite often. It's the head shots I struggle on. I mean it's don't, I just don't, I just, I don't know really what, I know you're aimed for the head. Yeah, obviously, but when I aim for the head, it don't work. Shit don't work.  Let me just message, message, message, message. Easy now Barry, telling me about Goldberg's return to WWE. He saw it as a 2K17 trailer. I love, I'm a massive wrestling fan. I loved wrestling games back in the day. Remember on the N64, Revenge, WrestleMania, No Mercy. Then it went to PlayStation with SmackDown, which was really arcadey and over the top. Wicked games, but these latest few. They've been terrible, too simulated, trying to be too much like UFC and it just does not work.  That's what I like to see. I want fun in the game.   It's a show. That's what I want to see. Thieves dead, thieves dead, thieves. Oh, this is not a good map to use and all I'm beyond. This is not going to go well, but yes, wrestling, I love it. Love the games back in the day. Hate the new ones. I haven't seen a trailer. It's the actual gameplay footage of the 2K17. I think it's called a lot of Goldbergs in the trailer, but I haven't seen gameplay footage. Hopefully if scrapped or that simulated, I don't even know. I'm going to try and make it too realistic.  I can't remember whatever. It needs to be arcadey. Let's see if we go. It's not going to go well. So you shoot, double tap. It's just good. This is going to go.  Oh, I'm bad. I'm bad. I'm bad. I'm bad.  So what? My grenades went up. Didn't get a hit marker. Dude, just vanish that midair. I'm dead. I'm so dead. I'm just going to stay up here. Stay up here. Probably get a kill over here. My problem is I rush. I panic. There he is. He's seen me. This is good. It's so bad. To be honest, though, I'd probably prefer these close-quests maps with a weapon like this. I can't snipe. It's so hard. You should have died. I don't care. I'm on the team with 500 points. Two kills. Like a boss. Like a boss. Then hate comments.  Don't take this too seriously. Because, I mean, like, I would like to get two map feeds. I can. I'm capable of getting a two map feed. I mean, I'm bad. I can't stay in play. I can't stay in play. I can't stay in play.    Next use for a video for me to play live people. I know you guys love to see me play live PvP, especially using snipers when failing. All right, mate. He's camping around corners.   That went in his face. If that wasn't your one person, you'd have been so dead. If it's gone up everywhere, try to snipe. Better play to you. Now, this video could have been for that. Could have been a minute long. A full one minute long. Could have got straight into a game.  You know what I mean? Nope. It's going to take weeks. I'm lying on one heavy. And my shots just not hitting no one. I'm not going to use it.  What happened?  He disappears. Oh, I'm so scared. He was not there. He was not there. This map just doesn't help. This map just doesn't help. I'm so dead. I'm so dead. I'm just, I'm just going to give up my life. Where's that knife? Very bad. I've still got the gun. I could get a couple of kills if I wanted to. No. The rest of years as well, when we get to bigger maps where I can actually snipe, other people are going to be sniping and I'm just going to get wrecked. I'm just going to get wrecked. Five minutes.    I hate it. I'm seaside. I'll catch the fight then, because that's mine, isn't it? I'll catch a bead, lads.  Uh-oh. Come on, bitches.  I deserve this.


When looking at the exhibition, the setup is truly interactive, inciting the imagination to make us feel as if we are in the shoes of the person that it talks about. We're presented here with much more than a photo exhibit. We're invited to an audio and visual experience of a migrant's journey, the paths they decide to take, the risks they face, the labor opportunities at their destinations and the relations with the families staying behind. There is not one migrant experience, they're countless. That experience is shaped by gender, economic situation, perhaps religious identity, disability, age or sexual identity. There's Christina, a young girl who's been left behind by her parents who went abroad to work so that they could send money back to make sure their children would have better opportunities. Then there's Kamal, who lost his wife and now needs to take care of his two children and struggles with the new role that he has been given. So I invite you all to experience all of these lives and others and feel how gender influences the different paths. The fact that women are living their own countries as heads of families using different roles that they are used to and they are allowed within their societies is an extremely important element of empowerment. That also will bring different logic when they go back to their countries because migration today is a process of going and coming back at some point. We are truly honoured to support this exhibition and we do hope that it will be eye-opening for everyone visiting it, that it will convince us even more that gender equality should remain top priority in our joint policy agendas.


Paul tells us in Ephesians 1, 13 and 14 that we have the Holy Spirit given to us as a seal, a deposit, a guarantee of our salvation until we acquire the possession of our salvation. That should be awfully encouraging and rewarding. And how is Paul able to make that statement? What he's literally saying is that the Holy Spirit is like our earnest money deposit. It's our guarantee the same way you would put a deposit down on an automobile or a hotel, and you are guaranteed to get that. God does the same thing with the Holy Spirit in us, and he is our guarantee to be with us until we receive our salvation, meaning he's not going to forfeit the Holy Spirit and we're not going to forfeit our salvation.


Woman Sue's neighbor, he leaks photos nobody was supposed to see. He was the bigger person, he admitted what he had done wrong and tried to fix it. But his neighbor couldn't help but take advantage of him. He didn't really think anything would come of it when he opened his laptop and typed her name into Google. His mouth fell open when he stumbled upon photos he shouldn't have seen. He now knew all about her. Now that he had the upper hand, he was ready to make her regret what she had done. Christopher Hess felt like his routine was getting stagnant. The 18-year-old would start his 16-hour shift as a security guard every day and get home at 8, a.m. to fall into his bed, only for the day to start all over again. One day, his phone rang and it was his best friend on the other end. He said he would come to visit for a few days. Christopher felt happy to have something to break up his routine. He just didn't know how bad things would turn out. Over the Independence Day weekend, Christopher's friend, Mark would come to visit. He was so happy he applied for leave at his job and looked forward to a great weekend with his pal. Christopher even spent some of his small savings to make sure Mark's visit would be a good one. He bought some beer and snacks and got ready for his arrival. But when Mark was at his door, he had something else in mind. There had been a drought so it was very hot. Once they both sat back with a few beers in Christopher's backyard, Mark had a suggestion for their Independence Day weekend. With a wide smile and steely-eyed look, Mark suggested that they get some fireworks to celebrate the holiday. Christopher didn't really think it was a good idea and would regret giving into his friend's wishes. Christopher took the rest of his abysmal savings and handed them to Mark. He later said, to be fair, I have had nothing but bad experiences with fireworks so I had no idea how this would be any different. Once they bought the fireworks, they put them on the floor and admired the sparklers, cakes, bottle rockets and Roman candles. They both had mischievous looks on their faces as they looked at their loot. Christopher thought of what to do next. Why don't we mess around with some sparklers since it's still not dark yet? Mark appreciated his friend's way of thinking and agreed. But there was a problem they'd only realize later. And it would become a great story about getting even. Christopher lit the sparklers for them. They were lost in the white glow that sprayed off the rods. They felt nostalgic waving the sparklers and making shapes in the air as they had done as children. Christopher didn't know that the sparklers had other plans, and would soon make him regret ever lighting them. He sadly recalls, one of the little sparkies from mine and my friend's sparkler made contact with the ground and made two small fires. Christopher watched the ground fires in dismay as they quickly spread throughout his yard, creeping up onto the neighbor's fence. He didn't know the grass was so dry. I ran as fast as I could to grab the garden hose and quickly started spraying down the fire. It was no use, it was spreading faster than I could spray it. The neighbor took this opportunity to be selfish. The friends called 911 while they tried to kill the flames. But they couldn't do anything. Once the flames licked the fence, it ignited and spread along its length. The neighbor, named Patricia, burst out of her house to see if she could help. Christopher was guilt-ridden. His poor neighbor's fence. She always seemed like a nice lady. But when he watched her walk back through her front door. She was smiling in a sinister way. After getting back to work after his awful weekend, Christopher was feeling terrible about everything. And his leave was wasted. Another exhausting day of the same job. Christopher wanted to just fall into his bed and sleep. But after opening his door, he was met with a nasty surprise. Christopher found two quotes from his neighbor, one for $4,000 to cover the cost of a new fence, and another for $6,000 to replace the burnt lawn. He didn't have that kind of money. In fact, he'd spent the last of his cash on the useless fireworks. He showed his dad the quote, which had been typed out on a Microsoft Word document. Seeing that there was no logo or company name, he hit the roof. Son, don't you give that con artist a single dime, he yelled. As the cherry on top, there was a rude note underneath the quote, I will also be having you pay my water bill for three months because the new yard will need lots of water. Christopher couldn't believe it. He took to Reddit to vent his anger, now the fence this woman had before was raggedy and falling apart. Her yard. Dead grass, weeds everywhere, never mowed it. Now, looking at this paper, she wants a mahogany fence and a brand new backyard with flowers and trimmed hedges? I said I need to get an estimate myself, this doesn't feel right. Christopher contacted a contractor friend. He was certain that his neighbor's lawn had been in a terrible condition for years before this had happened, but the fire damage made it difficult to prove. As for the mahogany fence, fresh lawn, flowers, and trimmed hedges, Christopher knew a guy who could do it all, and cheaply. He arranged for the contractor to come out to give him an estimate, but then things turned ugly. Christopher met the contractor outside. But before he could begin to assess the damage Patricia ran out, flailing her arms and screaming, I did not give you permission to get an estimate on my fence. Well, technically, the fence separates the property line, so the fence belongs to both of us, Christopher retorted. Obviously panicking that her plans were falling apart, the entitled neighbor called the cops. She calls the cops on me for having a contractor, and they ultimately can't do a single thing, because I'm on my property, Christopher wrote. He quickly finishes the estimate off at $1,200. Luckily, Christopher also knew a guy who did lawn care from his time working at a grocery store. He estimated the lawn reseeding while she was away from the house to be about $800. After I get these estimates, I give copies to the woman and she is having none of it, he wrote on Reddit's ProRevenge thread. Upon seeing the estimates that Christopher had gathered, Patricia yelled, I don't know these people, I don't want them near my house, they're probably really bad contractors. Christopher, trying to reason with her, replied, No, I know them personally. They are really nice people and do great work. But his neighbor didn't want to hear it. She slammed the door in his face. But this is where the story gets interesting. I ended up working a 16 hours shift that night and got home at 8am, and this woman comes knocking on my door at 9am, and demanded I speak to her, Christopher wrote. I explained, I would really love to do this, but I just got home, and I have to be back at work in less than five hours. I need to sleep.  Christopher had been bullied for too long by this audacious woman. He'd had enough. At this point, I had about lost it, and told her, you can either accept my $2,000 for my quotes or get nothing. She stood there for a while with her mouth open, but she accepted my offer and planned to meet down at the notary the next morning, Christopher explained. Thinking he had finally made her see things his way, he spent that night after work writing a contract and gathering the $2,000 in cash. But the battle was far from over. The next morning, Christopher woke up and grabbed the contract. Thrilled to finally be done with this woman and never speak to her again, he went down to the notary to meet her. Christopher waited for her for over three hours, but she didn't show up. I get a message from her saying I'm sorry the $2,000 isn't enough, I'm having my guys start work on this project, and you will be paying me the full price. Oh really, Christopher thought to himself. He needed a plan. After that, I did not say a single word to her, and I watched for a few months as these guys turned her backyard into an oasis, complete with a small pond, brand new sod, flowers, the whole nine yards, Christopher wrote. I come to find out she had plans to remodel these things for a long time, and was just waiting for the opportunity to go through with it. Now, Christopher knew he had made a big mistake. He felt awful about burning down his neighbor's yard, but he'd been willing to pay a fair price to cover the damages. How dare she ask for more money. In a last-ditch effort to get justice, he fired up his computer. There, on a community Facebook page that she didn't know he was a member of, he saw the incriminating photos, and he was incredulous. So this is what she had wanted the money for? She used her remodel funds to go on a trip to Hawaii. You know how I found out about this. She was bragging about it on the neighborhood Facebook group and didn't know I was in it, Christopher wrote. There, for everyone to see, were pictures of his neighbor sipping expensive cocktails in a five-star resort in Hawaii with her girlfriends while he scraped by getting the money to pay her. Are you ready for the revenge? He wrote, to the delight of Reddit users everywhere. Now, four months after the fire and all the remodels, I get served papers to go to court for $10,300. At 18 years old, I'm having to hire a lawyer to work my case, Christopher continued. When we finally do get into court, I lay everything out. The quotes, being harassed multiple times, not showing up after agreeing to a deal, not wanting me to get my own quotes, required by law, by the way, the Hawaii photos, and her bragging about conning me out of money, and I have proof of all of this. The judge looked at her and said, ma'am, with all due respect, you're out of your dad gum mind. Not only did this young man tell the truth about what happened, but he also offered to pay you more than he was supposed to, Christopher recounts. Your lawn was already dead before the fire occurred, therefore he is only responsible for the fence at $1,200. I will also deduct from this his lawyer fees. Christopher concluded his story on Reddit, she took a huge financial loss from this, not sure how much the Hawaii trip cost her, but she was in serious debt. She ended up having to sell the house because of it and moved into a smaller house. Haven't heard anything from her since. He added to this day, I still do not use fireworks because we could have really hurt someone. What I have learned through this though, is it's best to take responsibility for your actions right out the gate.