Hello. Hi. Everybody here. I guess that's enough. Okay. So my name is Anu and this talk is called the mutable state monster and how to defeat it. I am a Google developer expert for Android, which means I'm very, very smart and you should all listen to me. So I'm going to tell you a story today and like all good stories, you need a prologue, right? So what is state? Anybody shout it out quick. What is twist? Not like Karnataka. I mean like in a program. Nobody. Okay. Let's ask Wikipedia. Wikipedia says a computer program stores data and variables, which represents storage locations in the computer's memory. The contents of these memory locations at any given point in the program's execution is called the program state. That's a lot of words. So this is my definition. State is the current value of data at any point of execution of your program. Okay. Chapter one, the wizard. So a long time ago, there was a grand wizard. His name was John McCarthy. So he pioneered artificial intelligence, right? So this guy spent basically his whole life trying to figure out how to get computers to think like humans. So in 1958, he came up with a language called Lisp, which you might have heard of. This is what it looks like. So Lisp was the first language to have automatic memory management using a garbage collector, right? Which we have in Java. We all know and we all love our GCs. It was also one of the first language to have atoms, this concept of an atom, right? So there's basically data that could be divided any further. So it's kind of like the atom in physics, the smallest unit of data. But why? Why? So this is 1958. This is just when computers are getting started.  Maybe they do because Valentine's Day was there before. But anyway, so this is just the very early days and, you know, the concept of atoms and data that could not be modified is in this language. Chapter two, the monster. So I'm going to show you some programs and let's see if you guys can figure out if they work correctly when they run on multiple threads, right? So let's start the first one. That's big enough. Cool. Okay. So this is a simple check and put kind of operation. You check a map, you put something in it. Let's look at what it does. So there's a map. When you pass it a value, I check if it contains a given key. And if it does not contain the key, then I put it into the map, right? That's how maps work. Okay, cool. Simple enough. So let's say the first thread is doing this, right? I run this function on two threads at the same time. The first thread is checking if the map contains the key. Now thread two comes in and removes the key from the map. Maybe I have different functions. Thread one happily goes and puts it in. Or maybe, you know, whatever the condition is now wrong, because whatever is checked is not what was the state when the other thread performed this operation and then this execution is passed back to this thread, right? And so this happens. So this is known as the check, then act problem. Okay. And this is a well-known problem in computer science, multi-threaded environments, blah, blah. But we can fix it because we're smart. So it throws synchronized block around it. And only one thread can write to it at a time now. And we're happy. Cool. So that was done. Let's look at another program. So this is a simple counter kind of a thing, right? So I have an increment method, which is going to increase the count of whatever variable this is. Simple enough. So here's, so they should not be a problem. This is a very simple program. If I run it on a multi-threaded environment, like multiple threads, it should not be a problem. Here's what happens. So thread one is, let's say here, right? And this plus plus count looks like a single operation, but in reality it's three operations. Okay. So first you have to read, then you have to modify, then you have to update the data. So let's say thread one reads, right? Thread two comes in and modifies the value of count, whatever that one. Thread one also modifies the value of count because it only knows about the previous part. And then thread one writes it back. And our counter is wrong. So this is known as the read, modify, and write problem. Another problem, first I'm going to tell you all the bad things and then we'll get to the good things in time. But we can fix it. Good old synchronized lock around the code. Happiness. Next program. So I have a class called run Frodo run and Frodo is going to run. So I have a Boolean stopped. It should be false in the beginning. Somebody calls run. While stopped is, you know, not true. You keep running, right? Then somebody calls stop. We said stop to true. And you know, it should ideally stop the program. So, okay, thread one comes in calls run. And it started running. Thread two calls stop. Okay, a different thread. Now, they should work. Right? It's pretty simple. Now thread one is checking it's stopped and we expected to stop. But here's what can happen. We expect stopped the value of stopped to be read from main memory. Right? There's also another memory called thread local memory, which is like a cache for a particular thread. So if instead of reading from main memory, it reads from thread local memory, it will not see the updated value of stopped. It can also read from another memory called L1, L2 processor caches. Right? And even in that case, so the CPU also has a cache. Even in that case, it will not see it. And that's a problem. This is known as the visibility problem. Okay? But we can fix this. We've done this before. So we make the boolean molotile. And what that basically does is tell the JVM not to cache it in the processor or the thread local cache. And basically anytime you update it, everybody should see this at all times is what we're saying. Okay? So now you finally know what the volatile keyword does. And we're happy. Okay, last example I'll bore you with. So we have the class called orc humorals. We have killed some orcs yesterday and we've killed some today. We have an init function that initializes them to one and two. Right? Simple. Then we're going to query how many are dead and we expect a proper result. So let's see what happens. So we've called init function thread one comes in and has initialized this part that to call comes in and calls get dead orcs, right? Trying to get the count. Okay, what should it be? So this is one. Right? And the initialization, they're both zero in the beginning. And thread ones here, and then thread two calls this value should be one plus zero and one, right? Right? Okay. So it should be one. But here's the thing, the JVM can reorder incorrectly synchronized operation. There's a thing called happens before relationship, which I don't want to get into today. But basically that's how you tell the JVM that two operations are related and they have to be executed in the same order. Otherwise sometimes it can make optimizations and reorder operations. So this is what we have now. That's operation one and that's operation two. JVM can go ahead and do this. It's like such a betrayal, you know, we expected our programs will run in the order that we write them, but JVM doesn't care. So the same example, sometimes thread one can do this operation before the other operation, right? Because the order can be flipped. So this can sometimes get us one, right? Or it can sometimes get us two. Our program is now non-deterministic and nobody likes non-deterministic programs. This is bad. And this is known as the ordering problem, but we can fix it. We fix everything. So we make them both volatile and some black magic happens and then we are happy. So, but we fixed it, right? Like, I mean, you know, we know the problems and we fix them. So that means we have no problem. So let's play. Let's do a little thought experiment. So we have, let's say you have a real world application and you have a user model, okay? By model, I mean whatever you want to call it, database or a class or network, whatever, some place where user is told. So then we have orders also, right? Because we're an e-commerce app and we have payment, let's say, right? Pretty standard stuff. Then we have an activity which is going to access all this stuff. Okay? Sounds simple? No problem. So then we have another activity because PM wants a new activity. Okay? That also needs this stuff. Now we have to synchronize between these two, right? If this starts, this starts some threads, that starts some threads, I don't know, right? Something can happen. You can imagine instead of the activities then being threads or anything else, presenters, whatever you want. Some place in our app we are going to eventually start accessing more and more data and we are going to start accessing common data, shared data, right? Then we have another activity then because chat bots are a new thing, we have a chat, then we have another activity. That depends on some of the stuff. Eventually your system looks like this, right? Then you have to synchronize across all of this, right? Then it's a deadlock sometime. Then you go like this. You don't want to hear the word synchronize again. So concurrency is hard and our brains are small.  So we just cannot hold all this stuff in our head. It's not possible. If I see more than 20 lines of code at a time, I forget the other 20. So when you mix shared mutable state, right? Which is what we saw. We have state and you can change it. It's mutable, right?  And then you mix that with complexity. If it's small, it's okay. We can still deal with it. But when it gets big and it will get big. Think of like a user class. You know, you have one activity and log in and it's fine. And then eventually you have 500 and user is everywhere.  It has a database inside it. So when you do that, you make shared mutable state and complexity. You get mutable state monster. It is out to get you and murder you. Chapter three, the profit. So there was once a profit called Gordon Moore. He co-founded a semiconductor company called Intel. You might have heard of it. So in 1965, he made a prophecy. He said the number of transistors in a dense integrated circuit doubles approximately every two years. So if you have a chip, you can stuff that's a X number of transistors into it. He said every two years, now you can stuff two X number of chips into it. And next year, double of that, four X, 16 X, exponential curve, right? So computers get faster. You know that it happened during our lifetime, right? And the prophecy was true. So this is a graph of CPU transistor counts from 1971 to 2008 and Moore's law. Look at all the, can you see the tiny, tiny names of things? Maybe you recognize some of them. There's a Pentium in there. Go to 8086, anyone? CS programmers back in college, fiddling with dark times. So yeah, so we had those two. And as you can see, the graph just goes up. I don't know how to read graphs, but if they go up, it proves my point, I guess. So as you can see, at the top of the graph, it's kind of slowing down. It's not as big a jump as it used to be because basically in the past decade, the prophecy hasn't held on so well. Our computers won't become significantly faster every year. They're becoming faster, they're like 10%, 15%. It will keep slowing down because we cannot stuff more transistors into processors anymore. We are hitting the physical limits of what can be done. I don't understand physics. That's what the scientists say and I believe them. So the only choice is to put more cores into our computers. If you can't make one core more powerful, you have to put more cores in them so that you can get more done. When you put more cores, that means more threads. That's the only way you can do work on multiple cores. And if we are going to make our computers use more cores, we have to make them parallelizable. We have to write programs that can effectively do this in a safe way and not destroy everything.  Locks, New Texas, right? They... For most application programming, they seem too low level, at least to me. Most of the time. It's not like we don't have any use, obviously they do. But most of the time, for the kind of applications you write, create, read, update, delete, the kind of concern we deal with, they seem really bad. They seem to add much more complexity.  We need to do better because our processors aren't getting any faster. We're just going to have to deal with it. Chapter four, the Fellowship of the Functional Programmers. This is a file photo. There's John McCarthy, the guy we discussed earlier. Alonzo Church invented a thing called Lambda Calculus, which is kind of one of the foundations of functional programming. I don't know what it is, and neither do you have to. Haskell Curry, anybody heard of Haskell? Language nobody understands. And it has to do with Curry. Rich Hickey, founder of Clojure. Nice language, I like his talks. Okay, so what these guys were doing is they were thinking of an alternative way of representing computation. Okay? So here's the question they were trying to answer. How many represent programs as a series of data transformations instead of a series of sequential data mutations? That's like a lot of words. So we're going to see an example of what that means. Okay? So this is, we're going to do a very simple imperative program. Look at that, nice and easy. So we have an array of numbers, right? You want to sum them totally equal to zero. You've done this a million times. You traverse through the array. Keep adding to the total, and you return the total. Result is 30. Okay? That's the sum of 5, 10 and 15, if you're wondering. Now let's do a functional program. This will blow your mind, okay? So, hang on. So, I have a sum function that has an x. It takes an x and a y to integer. Returns x plus y. Then I have a compute function that just calls this. So, sum of 5, 10 and 15 is also the sum of zero and five, and the result of that with 10, and the result of that with 15. Right? The result is still 30. Congratulations. Now you know functional programming. That is basically it. Functional programming is about modeling our programs in terms of expressions rather than step-by-step instructions. Right? That's what we did, right? In the first thing we said, okay, store this variable here. Run through this loop. Keep adding to that. In the second one, we said here's a sum, and the sum of all this is the sum of these subparts. You've already done this. You know recursion, right? You know SQL, right? Sort of. So when you say select star from whatever, do you write for i equal to zero, go through all the tables, put records into things, give me the... You don't do that, right? You just say, here's what I want. You figure it out. So the idea is to be as declarative as possible and let the system worry about low level. You want to make a table faster, you put an index on it. You don't go and like write an algorithm to fetch it yourself. So, we don't need to know everything about functional programming. We're just going to see some good ideas. Okay? So let's go. So first idea, referential transparency. So referential transparency means there is no difference between the value and the reference to a piece of data. Okay? So let's see this. So I have a book. Simple jar class. This makes this book. I say set title. I change the title. I say set colors. I change the colors. I get a new book. Right? But the thing is the same book object can have different values at different points of time. So it's not referential transparent. When I say a thing is a thing, it should just be that thing. It should not be a different thing later on sometime. Okay? Do not change my thing. It's the point of referential transparency. So to achieve referential transparency, we need to steal another idea. This idea is called immutability. So immutability means data once created cannot be modified. Okay? So I have the same book as before. I say set title. It's not going to happen. Can't change it. That's immutability. Once you create a thing, you can't change it. Okay? But here's the thing. We do want new things. But instead of modifying, we can make a whole new object with the same properties that we want. And if we screw up, we can go back to the old one. The sort of the idea behind it. So let's look at a more, you know, codey example. So we have, let's see, we have a bookstore class. Okay? And this one's the mutable version of it. So we have a books list. Right?  We have a bookstore. It's the constructor. We can add books. Okay? And then we just add all to the existing collections. Then when you want the books, we return the books. Simple. Something you do all the time. Here's the mutation part. Right? When I add books, I'm actually modifying the books that exist. Right? So how do we make this immutable? So this is an immutable bookstore. So this is what it looks like. The first thing we do is make the books final because we don't want anybody changing that. Okay? Then when we do a get books, we make a copy, deep copy of the existing books. So let's say, so first we make a new array. We go through the existing books. We add it all to the copy. And then we return the deep copy of the array. Okay? Why deep copy? Because if you just return the old one, you're still giving away the reference. Right? If you give away the reference, the list itself might not be modifiable, but the elements inside it can be. In our case, we have strings which are immutable by default. That's why I chose this example. But yeah, like imagine some other class in there. And if you give away the reference to list, which is final, the list might not change, but the elements inside it can be changed if they are notable. So we have ad books. When you want to add a bunch of books, we use the get books method that we just created. So it returns a deep copy. And so we add the new books to this existing copy. We made a copy of what we had. And then we return a whole new bookstore. Okay? So we have the store. Want to add some books. We get a different store. The original bookstore is always the original bookstore. That's referential transparency. And it's beautiful. So the important part, how does this stuff make concurrency safer for us? Okay, so we have a bookstore. The same one we just made. We have a app, beautiful app that shows books. Right? Material design and everything. So we are observing this thing on the UI thread. And basically whatever, that is our source of truth. Imagine it's a database or whatever you want. Just like let's say a class. And we are observing that, right? And anytime the thing gets updated, we want to be able to update the view for the user as well. So we're going to do some RX magic. If you don't know RX, it's fine. It's simple. So we'll see. So we're going to make an observable out of this book. The original bookstore. First operation we want to do is we want to add some books to it. Okay? Then we want to sort the books according to some logic. Right? Then we subscribe on schedulers. Observe on main thread basically. You're saying do it in the background. Give me the result on the main thread so I can update my view. Okay? Simple enough. Then we subscribe to the whole thing and then when we update, when the new books are coming. You've done stuff like this a lot of times. So let's say we have a background thread and we are at the map part. Okay. We made the observable. We are going to add some books. Right? So when that happens, we get a new bookstore. Okay? Because our bookstore is now immutable. You can't modify it. So we get a new bookstore. And the advantage is. You can't have in completely modified data. Your operation has to complete because you're not updating the UI until then. You're not updating the other object until then. Okay? So if this were to fail through an exception, whatever, I added some books. I was halfway through adding some books. Something happened and then crashed. Right? Or it just failed for whatever reason. What happens to my original bookstore now? It's got the original data and then some half-ass version of the new data. Right? Because in the middle of that processing, it like exploded. I've corrupted my data. Right? Here you can't corrupt your data. You can't modify your data. How will you corrupt it? So you get a new bookstore. And then you do what you need to do with it. And only when it's completely done will we change the reference. So let's look at it. So let's say another thing is concurrency, right? That's why we're here. Meanwhile, another background thread writes to our bookstore. It gets its own copy. You don't care. It can't modify our bookstore. Let's say another thread comes in. It wants to do some analytics. It wants to say, okay, what is the current bookstore? It wants to like get the count of the books and pass it to Firebase or something. I don't know. Right? So it wants to do something. Maybe it wants to modify it. If it tries to modify it, it gets a whole new copy. Our original operation is not affected in any way because we are not working on the same data. We get a new copy. No lock-based synchronization necessary. This is the whole point of lock-based synchronization, right? We want our data to be consistent. So, okay, then we sort the books. We get another bookstore. Finally, we change the reference to the new bookstore that we want. And we just update it. So how do we change the reference depends on how your architecture is. Maybe you pass it to the recycler view or put it into a database and send out an event, whatever. But the point is, while you are doing your background processing, your data cannot be messed with. And if anybody is trying to access the same piece of data, he gets a new data. So you don't need lock-based synchronization. Basically, this helps people go home on Friday. And Friday is beautiful. But my poor garbage collector is one thing I always hear and cold mechanists will kill me for saying this. But correctness is often more important than raw performance. This is what I think, right? I'd rather have a correct program than a fast incorrect program. Isn't that mostly what all of us want if that was the choice? So I'm not saying that change everything to immutable today and never use, you know, objects or variables again. What I'm saying is you can use immutability only where you expect concurrency, right? You know where your app has concurrency. You know there are some models or something you're going to be processing in the background. You're going to do some operations on them. You know that. It's your app, right? Those things you can make immutable. And as always measure. And if there is a problem, we work back to the old ways and add complexity, right? Add locks. Add what you have to add. But don't go for the hardest thing by default. Let's do the easy thing. And if the easy thing does not work, then we can go to the hard stuff. Chapter five, a new age. The functional programming is getting popular every day. This is some random Google Trends thing I have pulled up and like all data, this is also bullshit, but it shows my point. Front end people are loving the functional stuff. We have React, Closure.js, Elm, Cycle.js. JavaScript people do not want to write anything in JavaScript. They make languages. Provided. Then we have backend languages. Erlang. We have Elixir. Closure and Scala run on the JVM. They do all this functional weirdo stuff and they seem to work fine and run huge applications. So maybe this works. What about good old Android though? So we have Java 8 on Android. Not really. They have streams, lambdas and method references. Streams I think you can only use above API 24. Is that correct? Yeah. So which means maybe 10 years. We have Rx though and it has all the filter stream map and all the nice operators you can do to do this stuff. So one thing about Rx is it's kind of meant to operate in this paradigm. So if you start mutating data inside your operator, it's not going to work out well for you. There's a reason there's a side effect operator section in the wiki. So when you mutate data, when you change the state of the world, it's called a side effect. And so if you use immutable data, Rx becomes easy and you can do that. You have Kotlin. Kotlin has, I wrote first class, but it has like nice support for immutable data. Much better than Java anyway. So if you guys are using Kotlin, you can try this out. Awesome. You don't have to do it all at once. Okay. So the next time you have to do something in the background, just think about it for a minute. See if you can use this. If it applies, that's good. It's always nice to have another tool in your toolkit. And don't blame me when everything explodes. Because I told you so. And you don't have to do it alone. This is functional programming is not as weird as it sounds. There's like a lot of books, tutorials, blogs, everything online. This Google-like functional programming in Java and you get things. And you can do that in Android as well for the most part. Right? And you can learn more about it. The future is bright as long as you listen to me. That's my talk. Thank you. Hey, so regarding that bookstore class example, you didn't make it final, I believe. So this means someone can just subclass it and add some mutators. That's true. That's valid. I should probably change that in the slides. But don't copy that example word for word. Have to forget it. Thank you for the great talk. So you said that this RxJava or like this observable thing. Okay, so as you have shown that, you know, there were so many books. Okay. And then you pull some, so if you pull some books from the database when they change, okay, continuously, can we use it for something like an infinite scroll and something like in WhatsApp, you know, that you continuously scroll and the data is fetched on the back end continuously. It is observing the database. So is it a good use case or it's not the best way to do again things like that. It's hard to say exactly. You've got to try it out. If you're doing something in the background, mutability, like, you know, if you have wherever you have concurrency, mutability is a good idea to try out at least. Right? And then you have to measure the performance impact because again, it's always going to be a little heavy on the memory, depending on what kind of objects you are creating. So because Java on Android does not have like an efficient implementation for things like this. We got to be careful, but I guess so. No, so if the data is not changing by different threads. Okay. The data is not not changing by different threads. Then you have no problem to deal with. Then you have, if you have no concurrency, then shouldn't be what should be the way then this should not. This is not the best case in that case. I don't think so. Again, I'll have to see your code. But like the point is to kind of make concurrency. As you mentioned for concurrency, you return a new object every time so that it doesn't mutate the original data. Doesn't that cause a bloated object? A bloated, you know, lots of it might duplicate the data. It might, we have some mechanisms to make sure that it is not exactly the same data or every time I request a new object, it gives me a new object. Right. So I'm saying if I'm using, you know, if I'm compositing an object, an object inside another object, and that is building up like this. So will that not cause a bloated object? I mean, like if you have a, I don't know what you mean by bloated object. Bloated just means, you know, a lot of duplication that there are restrictions on memory. I'm guessing right.  Yes. So if you have super deep nesting inside your objects, probably not a good idea to deep copy the whole thing. That's what I'm asking for a very large data set. So is there a different approach for concurrency there? So that depends. Like if you have a very large, very deep nested object, right? You can think about splitting it out into smaller objects. Okay. And then individually then immutable. Yeah. Like then, then it becomes easier. I think. Okay. Good part. Yeah. So, but then again, this is a very case by case kind of a thing. Thank you. So, do you know of any like plugins or something which can help, which can help us create such classes? I don't know. Does the intelligent have something like that to make a thing immutable under studio auto value makes immutable by default? Yeah. All right. Not sure. But I guess it's not that hard. Maybe I know should you can generate that for you. So, my question is about the bite code thing you showed. I have no idea where you are. Okay. Yeah. So my question is about the bite code you showed. Bite code. Not bite code. You should write Java JVM re-orders. Right. Ordering problem. Yeah. Yeah. When it generates byte code. Any idea when it re-orders like that? So, there is a concept called a happens before relationship which needs to be established. That will take a little more time to explain. So, let's discuss that offline. Sure. This looks very good in theory. But in practical on low end devices, how does it perform? Have you ever tried it in real life experience? I tried it in real life experience. My real life experience has been decently good. But again, so if you're creating a thousand copies of the same object, it's going to cause pressure on the memory. Right. That's inevitable. But do you really have a thousand threads running in your application at any given point of time? Usually most applications will have three, four, maybe five background operations running concurrently at the most. So, maybe you create and then let's say two operations, two threads are working on one operation. So, you have ten threads. So, you might have five duplicate copies or ten duplicate copies or twenty. You've done far worse than twenty, which is normal programming. Again, try it out and you know, maybe it's useful, maybe it's not. It's very hard to like for me to stand up here and say, this is the way to do everything from now on because that doesn't work for everyone. So, somebody asked me a question. I can't hear. That's it. More questions? No, we're running a little late. So, I'm afraid we have to close questions. If you have any questions for him, please meet him outside and for all other speakers. We're going to take a couple of minutes to set up the next speaker. Meanwhile, please fill out your feedback form. Okay. Thanks guys. Bye.


In this presentation, we're going to record a transaction related to the contribution or donation of office days to our not-for-profit organization. Get ready because here we go with Aplos. Here we are in our not-for-profit organization dashboard. We're going to jump on over to Excel to see what our objective will be. We're going to be on tab one, so I'm on tab one here. And number one says it's going to be office-based donated. It's going to be a bit of a tricky transaction for the first transaction here. We've got a contribution, but that contribution isn't cash, which would be the normal type of contribution. What was contributed instead, the use of the facilities, the use of office space. Now, here then, that means there's still a contribution. It's a non-cash contribution. We've got something of value. Therefore, we're still going to want to increase the income account. That's going to be the revenue account from a journal-entry standpoint. The $35,800 is going to be increasing with a credit if you think about debits and credits to contributions. The other side then, not going to cash, but is actually an expense. So what's this going to look like in the end? This is what we want basically the accounts to look like from a financial accounting standpoint. We want the revenue to be going up, so we have zero revenue now. It's going to be going up. And then instead of cash going up with a normal contributions, we have rent. We have basically rent expense is going up, so the rent then should be going up. There's going to be no effect then on the net income. So the net income or the change in the debits and credits or the change in net assets will not be affected here. But we want to record the two line items on the income statement. Revenue went up and basically the expense went up. Revenue went up by the amount of the contribution, which we would have to determine using some kind of market method typically to see what the cost of a normal renting of the facilities would be. And then the expense went up for the equivalent amount because that's going to be us consuming it with the use of the facilities. We're using the facilities, we're using the space, and therefore we have an expense related to it as well. So that's going to be the transaction we're looking for over here. Now, note, we also from a accounting standpoint or from a not-for-profit standpoint, want to be able to be tracking who gave us the contribution so that we can track that information and be able to provide them the reporting of that contribution in the future. So that's another critical component for the not-for-profit to have that information to be tracked. So if we then go back into our not-for-profit, we're currently in the dashboard. We're going to go over to the donations. So you'll recall within the donations that we have set up our purposes over here and we only have the one purpose right now, which is the general purpose, which is going to go, that's going to be like our driving component to enter our data input form. Now we're going to enter the data input form with a contribution. So I'm going to enter the contribution. So contribution drop down and then contribution. And then I'm simply going to add a contribution here. So I'm going to say add a contribution. So we will then add this and then we're going to have a contact. Now I'm going to set up a new contact as we go. So I'm going to type in the donor name here. I'm just going to say donor one. So that's going to be our generic name. So that's going to be the name of our donor. And then it says down here we're going to add a new contact. So we're going to do that quickly. We're just going to do a quick add of the information for our new contact. Now note, of course, you might want to enter the more information into the contacts setting. So you could put more information than simply the contact name, but we're just going to be using the contact name here. That's going to be the minimal information necessary to enter the add a contribution type form. Now the purpose is going to be similar to the item for a for-profit type of organization. So we set up the purpose. That's going to be that driving factor that's going to be telling us what account it's going to be going to and the fund that it's going to be going to. And if we had any tags, also the tags. Now the acknowledgement, we could say, hey, have we acknowledged this or not, the actual contribution or not. So we could say acknowledged or not acknowledged to be able to track whether or not we have acknowledged the contribution. The contribution date I'm going to put on January 1st for our practice problem. So I'm going to be picking January. So I went back here with the back arrow January 1st. So we'll pick that. And then the amount of the contribution I'm going to say is that 35800. And that's going to be the amount of our contribution. The value of the rent that we had. Okay. And then we're going to go back on over. And then I'm not going to have any reference ID. Now the note this might we might want to put here. This was rent property donated something like that. We want to have some kind of note here that we will have. Now the expense amount. I'm actually going to put the expense amount here, which in this case I'm going to say is the full amount. And when we when we pull this over to the accounting records, what we would like to do then is apply this expense account over to the rent expense. So you'll see what's happening from an accounting standpoint. Usually the contribution form will be increasing cash. The other side going to the revenue account, which is going to be driven by this item. But what we would like to have is the cash not going up, but rather we have the expense going up and then the other side being income going up. So the income is going to be going up driven by the general form. And then of course we're going to try to put the expense with the expense amount here. So then we have the non tax deductible amount. Nothing there. We're going to say we're going to keep it there for that for our purposes. Non tax deductible notes. You can have a note and then soft credit contacts. So we're not going to put anything there. So that's going to be it. So I'm going to say save and add or save and close. I'm going to say save and close. Now there's actually no effect on the financial statements yet. Until we make the deposit. So let's just check that out so we can see this. Now a nice feature in any online process or any online software is typically that you can have multiple tabs open to do that. I'm going to go up to the tab to the top, right click on it. I'm going to duplicate the tab, duplicate the tab. So now I would usually have the reports to the right so that I can see what is happening to the reports as we go. So once that tab is open, I'm going to go to the reports on the right hand side. And then I'm going to open up our standard to reports that being the balance sheet and the income statements. So I'm going to go into the balance sheet and say open that one up. So here is the balance sheet. We could change the date. I'm really looking at the end of January 2020. So I'll pick that. I'm going to do the same thing. I'm going to and you'll see down here. Nothing's in the balance sheet. So nothing's been recorded on our books yet. And we can do the same thing for the income statement. I'm going to go back up top, right click on this tab, duplicate it. And then I want to take a look at the income statement by going to the reports tab and then open it up our other favorite report that being the income statement reports. I'm going to open up the income statement. All right. And then nothing is here thus far as well. So I'm going to say custom date range. And let's bring this on back to the January, we'll say the January 31st here as well. And let's try that one more time. We're going to say this is January 1st to January 31st. So we'll pick this back to January 31st. All right. And then apply that. And we have nothing thus far. So then I'm going to go back to the first half. Now let's go back to the first half. We're going to make the deposit. Now note there's not going to be a deposit here because we're basically we want to a transaction to an expense, but we can expense the whole thing in this process. So this is a really neat feature that we can do this here. We're going to go in and say I'm going to make the deposit. And then I want to create the deposit. Again, it's not going to be a deposit here because we expense the entire thing. But then we see our line items, our line item date. One, one, two thousand twenty. I'm going to keep that the same. I'm not going to have a reference ID. The note is here. The donor donor one. And then the purpose general purpose. And then the amount being that thirty five thousand eight. So notice we have the same kind of fields are populated in here, of course, and then the expense account, the expense amount now being that thirty five thousand eight hundred. So that's going to be important. And so we have the same kind of data input fields. Now note to be a little bit faster. Also you could enter. We could have gone directly to the deposit field and you can enter multiple line items in this way and enter it a little bit faster by going directly into these line items rather than into the contribution field and then over here. Also note that when you do the actual deposit into the bank, you want to be able to group. This isn't a deposit into the bank, but typically when you use a field like this is going to go into the bank. You want to be able to group those deposits in such a way that it'll be in the bank in the same way as in your books. So when you do the bank reconciliation, that will work out. So we'll talk more about that later. But in any case, if we scroll down, we're going to choose our account. Now, now it's going to go into this expense account. So if I hit the expense account dropdown, we have this rent. So the rent is going to be the other side that's going to be affected and then you could choose a bank account, but nothing should be going into the bank account at this point in time. So we shouldn't have anything going into the bank account. However, I'll select the checking account for this point. So what's going to happen when we record this then it's going to be increasing the rent expense by the amount of the expense to 35,800. And then the other side is going to be going to the bank account. So we're going to hit the expense account dropdown by the 35,800 driven by this general purpose item, which is kind of like the item for a for profit type of organization. And we should be able to sort that report by the fund. So let's save it and check it out. So I'm going to say save. And there we have it. Note that kind of jumps us over to the deposit screen, which if you hit the contributions dropdown, you have contributions and then deposits. So these two are kind of related in that way. So what we need to do here because they got the wrong dates. So this is the deposit date. I'd like to bring that back to January. So this is how easy it is to fix it or adjust it. You can go into it. We can go back up top and I want to change the date field up top to be January 1st as well. So note down here. This is the date of the contribution. This is the date of the deposit. Those don't necessarily be the same. You would think they'd be fairly close here because we want to, you know, we don't want to be holding on to the cash, but we're going to say save. So there we have it. There's our deposit. I'm going to jump over to the income statement now. I'm going to refresh the screen by hitting this little button up top to refresh it, or you can click on the URL, highlighting it and then hit enter. And it'll refresh the screen. So now we have our information. We've got the income went up by that 35,800. And the rent went up as well. So the net is zero. So net, no net effect on the balance sheet. If we go back to the balance sheet and we refresh the screen over here as well. Then we have nothing on, I mean, we have nothing on the balance sheet at this point in time because the income statement went up and then down. No effect on the balance sheet. Okay, let's go back to the first tab now. I'm going to make another report. I'm going to go to the first tab. I'm going to right click on it. And we're going to duplicate this tab. So I'm going to duplicate that tab. So we've got our balance sheet, our income statement. And now I'm going to look at another type of income statement. So we're going to go to the reports to the right as on the reports to the right. We want to consider another income statement. This is when we're probably start using more, maybe even more than the standard income statement. And that's going to be the income statement by funds. We want to see the income statement by fund note. It's useful down here. Here it is down in the most used reports. I'm going to hit a star next to it. And that's going to put it up top in the favorites. So that's when we're going to be using a lot. So I would put a star on it. So you got your recents, which will show up as recent items. And then I would put your favorites up top. So if we look at the income statement to buy fund then. So we have the income statement to buy fund changing the date. I'm going to make the date a custom. Let's make it this year to date. That'll show the data. So there we have it. Now we have this broken out between the restricted and unrestricted or and obviously this is in the unrestricted. So you could see now this income statement starting to populate in this format with, with the use of those funds. So now we have it broken out in, in kind of like the statement of activities here where we would have the two columns here is down here with donor restrictions and without donor restriction, unrestricted and restricted. So as we go, we'll see how that will be broken out between those two categories. Let's take a look at one more report. Let's just go back into this report. Let's go to the reports again. So I'm going to go to the reports dropdown. And we also want to track the donations that have been given to us. So then we could say, okay, what about the donor report? So I'm going to scroll down. I'm going to scroll down here and we've got the other reports and then the donation reports down here. So we have the donation by contact. That's probably our most common report. I'd probably put that on the star as well because that will be our information of the donations that have been given to that to us. If we open that up, then have our date range. I'm going to say that we want this year to date as well. So that looks good. So now we're breaking out that information by who gave us the money. So this report can help us with basically our reporting to the donors who gave us the money. Now, in this case, it wasn't money, but we still have the donation in this report. So that's what we want to see. Now also note, we set this donor up fairly quickly. If we went back to the first tab and we were going to track that information, we can also see it here where we go to the people tab. We're going to go to the people, which is going to include the donors and the vendors. We're going to go then to the contact list. So the contact list. So here's our contact list and we see down here by name. Here's our donor. So if we wanted to add more detail here, or we could just basically add more of our donors here with the plus button. And if we go into the donor that we have added, we can give more information about them so we can edit the details, edit the details of the donor. And we've got standard kind of contact information, first name, last name, the company, the title, and then we have multiple phone numbers and all the contact information, which of course we want to have. We want them on our newsletter and whatnot, the address, the events, custom fields, and so on and so forth. So the standard kind of things that you could, that you would have available to you to populate the contact type of information field. So that's going to be it for now. Let's get out of here.


A federal High Court in Bujarat on Monday declined to grant the bill application of Abba Kiari, justice Emeka and Witte in a ruling held that the NDLEA had placed sufficient evidence before the court to refuse the bill request. Justice Witte also rejected the bill plea of Kiari's co-defendant and NDLEA in its counteraffidavits held that it was inappropriate to grant bail to the applicant because of the facts and circumstances of the case. The anti-narcotic agency described Kiari as a flight risk. It argued that if granted bail, he might jump bail.


There's a new product in town for low-carb people and it's called real good food products, real good foods. They have all sorts of treats, pizzas, poppers, and geladas. Is it worth it if you're low-carb or carnivore? Hey there and jrew22.com here with another food review vlog slash low-carb carnivore. It's about real good products. I'm not sure if I talked about them already but if I make another video you could see if I contradict myself. These real good food products. I was semi-excited by them because they they brought back memories of the past you know like pizza pepperoni pizza and jalapeno poppers and all these other little things that we used to enjoy and you know they really are low low-carb. This one has three grams of carbs plus one gram of fiber so it's really only two net grams of carbs per serving which is you get about three servings, three poppers.  It was like chicken nuggets with some flavoring inside and again like I've mentioned in the past about now chicken doesn't make us feel so good. Chicken where we're meat, red meat based, beef mostly and these real good poppers here are real good food products. It just leads to a more a bigger picture thing like frozen foods and these these are like TV snacks you'll eat these while like you know living like a sloth sitting on the TV. This is not a meal in my opinion. I tried a few of their products. The pizza was just awful. It did not have the pizza experience that you remember and I really strongly believe you should not go back and try and replicate the treats that you used to like. I mean jalapeno poppers were good. I remember I'm sure I would enjoy one if I ate one now. They're dipped in batter or heavily breaded and then deep fried and they're stuffed with either cheddar cheese and some concocted cheddar cheese mix or cream cheese and they were good but they were hollow foods really because they're spicy vegetables so it would inflame you and there's breading and they weren't low carb and these things there's like almost too much protein. If I eat this whole box of poppers and there's about nine of them in there I would get 66 grams of protein which is probably too much unless you're into high intensity weight training and where your protein requirements should go up but if you're just living a normal life I mean too much protein is also bad for you because any unused protein at the end of the day will end up turning into the equivalent of sugar or carbs. You'll just store it get stored in your body fat so having too much protein and that's what what they achieve by putting high lean chicken meat in there and I mean I think I don't want to knock them because they are low carb but I think the the frozen food quick food industry is something that most people who are succeeding on low carb and eventually going into carnivore are going to realize that anything frozen sucks. I mean with the exception of your own frozen leftovers like I reheated some burgers because I buy like five pounds of ground beef a lot of times and I'll make like 16 burgers and I can't I don't want to let them all sit in the fridge for five or seven days so I typically freeze about half of them and then I'll bring them back a month later and just reheat it on the stove and that that comes out good but this other stuff is designed to be frozen and they have all sorts of things in there that they make them in a way that they stay better frozen and I don't really like them and I'm again I'm not knocking the company per se I just don't think true low carb carnivore people have any reason to include these in their lives because because A the high protein and you'll realize if you're carnivore that eventually you're gonna figure out most people will figure out that chicken is just not worth keeping in your rotation so and by the way lastly I mean it's a nice attempt but the taste wasn't knock yours knock you off your shoes whatever that phrase is it wasn't that good it wasn't like you're not gonna get that feeling unless you're eating a nice piece of steak or or juicy rare burger that that's that's it so this is a follow-up to an article we did already about these these little poppers and pizzas I just wanted to follow up with a video just to supplement it with a little cut conversation and by the way these things are expensive you're better off buying meat ground beef low go to Wegmans or any other supermarket when you can find the meat even Aldi has ground beef sometimes for two bucks a pound you can buy a magnitude more of red meat that's probably more nutritious than this stuff anyway so that's it we don't we don't recommend them we don't knock them maybe they can figure out a better way to improve on their products but I don't think you should be trying to replicate the bad treats of days past have a good day and hit the subscribe button and all that stuff


What is going on everybody, it's Toss here and in this video, we're going to be doing an overall market update, taking a look at the Dow Jones, the S&P 500 and the Nasdaq. We're also going to be doing a trading update talking about what I did today in the markets as well as some stocks and ETFs that I'm watching and looking to trade right now, five in particular in the month of October heading into the month of November in 2019. So if you guys enjoy this video at any moment in time, feel free to go down below and hit that like button and consider subscribing if you do want to see further content about the stock market, investing in trading and don't forget to join our StriveSmart Discord group chat and our StriveSmart Facebook group. Those are linked down below and are 100% free of charge. So guys, let's get into it without further ado, starting off here with the SPX, the S&P 500 index, the 500, the largest publicly traded US companies and guys, this actually took a turn for the worst here in the last hour of trading. We were thriving above 3,000 points today. I think we hit a high at about 3,015 or something like that and you guys can see we clearly sold off below 3,000 and ended up closing at around 29.95 which put us in the red for the day at 10.73 cents in the red down about .36%. So we talked about in yesterday's video how we were breaking out of this ascending triangle wedge pattern, right? We were breaking out of it which was really good and that in my eyes that was telling me that you know the S&P is going to these all time highs, 3,026. Today again we got to about 3,015 almost half way there but we saw a very, very strong resistance at 3,015 throughout the day. So that's kind of something to keep an eye on right over these next couple of days as we try and get to those all time highs you know we have to break above 3,015 now but the good thing is like we talked about in yesterday's video we ended up breaking above 3,008. That was the level that we were struggling to break out of on the 17th of October. We closed below that yesterday so the fact that we popped above it today that pushed us to a higher high. So the continuation of the uptrend was there and this pull down is honestly not too bad. We're holding this 50 SMA here on the hourly chart. We're also holding an old resistance at about 29.95 as a new support. So I kind of want to give the SPX here some wiggle room tomorrow and see you know are we going to hold this as a support if we start to pop back up and especially if we break back into 3,000 territory into that you know general area. You know that's going to be telling me the SMP confirmed a higher low and now we're pushing back up to test 3014 and maybe even get to that all time high that we've been talking about at around 3027. So keep an eye at this level here on the SPX very very important and if we go to the SPY you guys can see we broke a critical level of support today at around 299.30ish right you know we broke that level but nonetheless if we go to the 20 day one hour similar to the SPX here we actually pushed to a higher high today. We got almost to 301 dollars per share and if we go to the one day one minute we can see that and we can also see how strong of a resistance 309 300.9 was today as well but despite the fact that we fell you know towards this last hour hour and a half of the market almost two hours if we go back to that one hour chart we are holding this 180 SMA right now at a higher low. So I just want to give it some wiggle room again just like the SPX the SPY it's really just an ETF that tracks the SPX and a lot of people look at this to kind of get a broad idea of the US market. So just keeping on these major levels here if we pop you know hold this at a higher low that's going to be bullish in my eyes. If we break that break that support obviously that's going to be bearish we may be going down to 297 on the SPY here back to the SPX if we look you know if we break 2995 some levels we may be going to 2950 is one that comes in mind here and other than that maybe 2880 that's if we break 2950 obviously right so going to the Dow Jones industrial average today guys down about 40 points at the close down 0.15% and this is a bit different than the SPX because yesterday we failed to break out of the ascending triangle here we actually got rejected by it and now we're looking to pull down and potentially test 26600 and the fact that we closed above that that's a pretty good sign right but this is still looking bearish to me so I do think it's possible especially if Boeing reports bad earnings tomorrow and that stock dumps I think it's possible the Dow does end up running down here and testing this tomorrow and maybe even breaking it you know if a lot of these Dow stocks in the future in these next couple of weeks as earnings are rolling through do poorly so that's kind of what I'm watching for on the Dow right now if we go to the 20 day one hour we can see the clear resistance at 271 got rejected by there we're trending under the 50 SMA at this point if we break the 50 SMA watch for the test at 27K here on the hourly chart if we break that that's bullish right if we end up dumping below 266 like we saw on the four hour chart that's going to be bearish and we could potentially see more downside from there and going back to that hourly or really the one day one minute you can see the Dow went from almost 27K with about an hour and a half left in the market today and it dumped all the way down and to be honest guys I don't really know what the catalyst to this is I saw some headlines before recording this video about Brexit but I didn't look too deep into that so let me know down below if you guys know what dumped this market because again I'm recording this 10 minutes after the market closed so I'm still trying to get my thoughts together for the day but obviously if I plan the video have things for the video but other than that you know I'm just confused as to what made this market fall so let me know down below in the comments about that going to the NQ here you know this one ended up closing down 91 points today tech was down pretty heavy this is down 91 points and it's falling obviously because this is the future down about 1.15% and if we pull back here to the four hour chart this was looking bullish right this was looking bullish because we broke the ascending triangle now we're starting to see some strong resistance at around 79.90 to about 8000 bucks right if we zoom in a bit this is looking like a double top here we're falling down and we're honestly breaking below 78.70 right now which is another main support so this is starting to look a bit bearish in my eyes in terms of the NQ especially because of this double top downwards break that we're seeing and by the way if you guys don't know a double top typically is a bearish move especially if we're breaking support levels you know after the double top like we are right now on the NASDAQ right if we go to the hourly chart you can see we're breaking the 180 SMA here which is pretty bearish as well on the five day five minute you guys can see the big dump off and the break of that 78.70 support on a bit of a closer scale which again like I preach on the channel guys it's why it's so important to look at multiple time frames not just one but look at everything because it tells different stories these different time frames you know the five day five minute might be telling a completely different story than the four hour chart right so overall that's what I'm looking at in terms of the markets right now we were doing pretty well markets dumped again I don't know what the catalyst is it might be Brexit let me know down below if you guys um you know really have an idea is there not a catalyst maybe this is just profit taking who knows right guys but anyway let's get into what I personally did today then we'll talk about these five stocks and very simple I traded at the overnight and I actually ended up selling out of my position today to really reanalyze and look for a better entry point tomorrow and let me explain why and I'm sure you guys probably know if you watched my video yesterday so let's zoom in here to the 20 day one hour chart actually let's go to the five day five minute chart so I could show you guys where I got in so I got in yesterday morning I believe it was around 767 76.7 roughly right there I swing traded for the entire day and I held it overnight and my goal with this originally like I stated in yesterday's video was to sell some shares here and then maybe sell the rest of my position at 81 35 but since it filled the gap so quickly this morning to the resistance I decided to completely sell out of the position take the quick little gain here on the overnight swing trade and now I'm in a position where again I want to maybe enter this one re-enter this one in the next couple of days or maybe even wait until after they report earnings here on the 1st of November it's kind of a mixed bag for me right now I'll be honest I'm thinking about what I want to do and yeah that's why I'm telling you guys in this video because really I took the profits now I'm like on the fence right I don't know if I want to re-enter before earnings wait until earnings but then if I wait until after earnings I might miss an opportunity right but these are just things going through my mind another thing is the RSI is overbought so I didn't want to get caught in an overbought stock that sells off over these next couple of days so you know I ended up just taking those profits and if we zoom in a bit here I took the profits as we started to see a strong resistance under that overall level on the 4-hour chart and you guys can see it there was almost a triple top here I guess you can say it was a triple top you know we got rejected here at 78 60 then we tested it again a couple minutes later really about 45 minutes after the market opened got rejected there got rejected again about 45 minutes later then again about 45 minutes later and at this point guys I think I it might have been this pop or this pop nonetheless I sold out guys I sold out of the position I believe it was might have been this one at around 78 44 I saw a little descending pattern starting to form here you know lower highs you know I just I just decided to sell out at that point and if we look at a percentage gain you know it's justifiable because I was up almost two and a half percent overnight that's a pretty good overnight move my opinion for the way I'm trading and my risk tolerance so I decided to take the profits there another trade I entered today was in Procter and Gamble they reported earnings today they did very well they sold off there was a lot of profit taking in the morning it went from 125 to about 121 bucks and this is perfect scenario for me guys because like I always talk about on the channel I don't really like buying stocks before earnings I like getting an after after I see a positive report and a lot of just just good sentiment from the company surrounding the earnings report and that's what we got today from Procter and Gamble if we look at the live news here zoom down a bit I'll show you guys their earnings they reported sales of 17.8 billion that was what they reported and the estimated or not estimated last year was 16.69 billion which is a very it's pretty good year over year increase right but that's not the earnings let me show you guys the earnings where are they here um here we go $1 and 37 EPS beats $1 and 24 estimate that's a very very good beat that's very very good sales came in at 17.8 like we just said right you over your increase is pretty good there especially for a mature company like Procter and Gamble and that's 17.8 billion beat the 17.42 billion which that's a good beat as well so the stock guys I woke up this morning I posted a screenshot on my instagram this stock was up very very big this morning right you can see here from yesterday's close at around 118 this one was up to 125 which was about a 5% move you know you know really overnight at that point so from there we sold off all the way to 121.7 and once we hit this bottom here guys we started to pop up I bought some Procter and Gamble literally right here not at the complete bottom but I bought some here at around 121.9 $121.90 and this is one guys that I feel comfortable swing trading a lot of analysts are raising their price targets on Procter and Gamble again their overall trend on the one-year one-day chart is up we got the massive gap up above the 50 SMA on that one-year one-day chart which I think is very bullish so maybe it wiggles a little bit for these next couple of days right it hovers around 120-122 but overall in the next month I think this swing trade the swing trade I'm looking to build I think it's going to be very very good I think it's going to offer a lot of potential over the next month you know as it consolidates as it you know pushes up pushes down a bit and picks that overall direction which in this case I think is up obviously which is why I'm swing trading it so Procter and Gamble I'm in that Abbey ended up selling out looking to get back in but that's overall what I ended up doing today in these markets so let's go rapid fire and talk about these five stocks that I'm looking to trade and I'll throw some bonus ones in because honestly I have more than five stocks listed here and a lot of these stocks are reporting earnings so let's get into this quickly the first one is Visa guys ticker symbol V this is reporting earnings I believe tomorrow on the 24th that's actually in two days from now this is worth watching again whenever a company reports earnings you want to look at the guidance you want to look at EPS year over year you want to look at revenue year over year did they beat analysts just a bunch of different things because this is what moves the stock the next day right either up or down and based on these earnings that's what we're going to do as traders based on what the earnings are we're either going to do you know shorting my short the stock put options call options or we might just straight up buy shares and swing trade it over the next couple of weeks so Visa right now although the technicals I'll be honest they're not looking great this is moving horizontally if we draw out this little pattern here you guys can see we're moving horizontally right now in Visa stock we're out of support at around 170 so just keep an eye on this right this one does have some good potential if we start to push up above 170 especially if we hold 170 you know coupled with a good earnings report this one could do pretty pretty well just keep an eye on it right PayPal is another one that actually fell through the floor today if we actually look at these technicals very quickly you can see I drew out a level at about a hundred bucks and have been talking about this level as a very strong level of support if we were to break that as you can see I drew out the trend line a couple of days ago I was saying if we break that level at 90 99 a hundred bucks we may be going down to 93 dollars and unfortunately we're trending in the middle of that channel now this is looking like a falling knife so there's a pretty good chance that we do get down there especially if they disappoint on their earnings which are tomorrow the 23rd of October so this is another stock the technicals aren't looking too great but typically around earnings it's pretty volatile as are a lot of these tech stocks right a lot of these growing companies you know surrounding earnings so keep an eye on it right worse comes to worst you know we sell off to 93 we obviously will be very oversold at that point and then maybe we make a comeback up to 99 a hundred bucks to retest that as a resistance and from there we may break out which would be very good we may be going back to the 100s 105s at that point and especially especially if we break this 180s may resistance so PayPal worth watching there Amazon is arguably the biggest earnings report this week right this is tomorrow not tomorrow the 24th 10 slash 24 19 and this is another one that's been beaten down over the past couple of months right from the high at 2035 down to where we are right now that's about a 13% opening we can see here we are holding 1700 bucks pretty nicely we held that level back in June in the beginning of June before that rally up to 2k now we're holding it again at 1700 but we are getting rejected at 1800 putting us in this 100 point zone so what are we going to do here in Amazon stock are we going to breaks 1800 bucks if we do I think we could fill up to 1850 after the earnings report if the earnings report is positive that could definitely be a good thing if they beat aggressively on EPS revenue year over year numbers are looking good this could really run up to all-time highs here in my opinion if these markets in general do get to these all-time highs if we get some positive optimism around China we get some good earnings from a lot of other massive companies this could push the market in general but with the market struggling at 3000 right now mixed bag earnings so far we had McDonald's didn't do that well today you know I'm interested to see if we do get to those all-time highs again I think we will in the short term here but that's just something to think about right earnings in general mixed bag you know this can definitely bring the market down or maybe it pops it up it's really just a toss up at this point right so Amazon watching that one let me pull up my phone again because it shut off there Tesla is another one that I'm watching obviously this is one that's reporting earnings I believe tomorrow yep Tesla's reporting earnings tomorrow keep an eye it's holding the 50 SMA on this four-hour chart that's looking good I think if we break to 60 we could fill the gap up here to 275 bucks so watch that I believe if we get a good earnings report which with Tesla it's another mixed-bag company you know every quarter I feel like it's different for them so it's going to be pretty crazy whether we pop up 10% sell off 10% anything can happen but just keep an eye on those earnings again keep an eye on 260 to 275 that could be a tradable play there if we break 250 here we may be selling off to 240 to 245 ish that's what I'm thinking on Tesla so McDonald's today guys they dumped and this is one that I'm seriously thinking about a swing trade here once we start to settle consolidate and find some support at any of these three levels the first level you guys see is 200 bucks roughly 197 to 200 bucks we closed above that today which is good the next level is around 193 and the level under that is around 188 bucks and you maybe ask yourself why did McDonald's tank today well if I pull up this little picture here you can see their earnings $2.11 versus $2.21 expected revenues 5.4 billion versus 5.5 billion expected one good thing about their earnings were the global same-store sales that's a little tongue twister there guys 5.9% versus 5.6% expected so they beat on that but nonetheless the major metrics you know EPS revenue they didn't beat on that pushing us down here and honestly I'm not mad about this because McDonald's has been a stock I feel like that's been due for one of these major pullbacks if we look on the three-year one-week chart this pullback is due we were very overbought we're selling off now we're holding that 50 s may well not really holding it yet we're trending above it so I'd be watching this you know large chart on the three-year one-week time frame to see if we hold this if we do this is going to be a sign for me to enter um you know especially as this earnings disappointment fizzles off because I think it will you know McDonald's it's a premium premium company one of the best companies in the world ultimately I think this is just going to continue running up here especially if these markets are healthy well you know one one may argue that the markets aren't healthy right now but if the markets stay the way they are decent you know trade talks don't get crazy we don't get crazy pessimism surrounding certain certain things these markets run up over these next couple of months I wouldn't be surprised at all if McDonald's was running up with those markets and I think they will which is why I'm looking to swing trade it so two more guys proctor and gamble is actually one on the list we already talked about that so one more which is going to be Boeing Boeing like I mentioned in the beginning of the video this is going to have a lot of weight on the Dow you know if Boeing if Boeing you know dumps tomorrow they report earnings you know on the 23rd if they do poorly this can weigh the whole Dow down put Dow back in bearish territory you know the the Dow back in bearish territory you know if we go back to this four-hour chart on Boeing some major support levels we talked about I believe in yesterday's video or maybe not yesterday's video but one of the previous videos 330 very very strong level of support here if we break that you know we're going to have to pull up the three-year chart to see where we'd be going next you know arguably you can say 300 bucks flat we may be going to that which could be a put option play if we do get that triggered down the you know the selling pressure we do get obviously negative earnings coupled with that which would probably cause that selling pressure you know this could be a very shortable stock in my opinion especially since a lot of people have been saying you know Boeing might not be you know doing too well here in the short term due to the issues they've been having with their planes so overall guys those are some stocks that I'm watching five in particular some bonus ones actually let me give you one more bonus one right now I'll treat you guys M O this stock has been tearing it up from the low at about 39 bucks and I've actually been buying this stock in my you know what's it called guys my portfolio that's private the private portfolio and the public portfolio which is the M1 series that I have here I've been buying it heavily and I'm up a good amount on the shares on the M1 portfolio I believe I'm up like 12% on the position already the other one I forget how much I'm up on that one but either way I think this is worth watching they're also reporting earnings here although they are over but watch to see what it does here at 46 bucks guys if we break 46 consolidate there a bit this one could be starting to reverse back up to the 50s and it's long overdue because tobacco although it's been declining obviously the cigarette sales which is Altria's main business you know that's been declining there's no doubt about it but I think there's a lot of future potential with their investment in the marijuana industry with cronos and jewel I'm gonna say guys I think jewel has a lot of potential although it's been heavily scrutinized in this country being the United States and globally honestly guys it's been scrutinized but I think over the next couple of months next couple of years I think jewel is going to have a lot a lot a lot of potential here which is why I've been buying Altria and why you should be watching it as well because this is a company that it's mature it's a mature company some may argue it's declining its core business is declining that's a fact right but they're looking to plan for the future this is a company that's looking to really grow future revenue streams in in industries that are going to boom and I do believe the marijuana industry is going to boom here in the next 10 years as more states legalize it and I think the electric company not electric company the electric cigarette company jewel is going to do very very well as well here so overall guys that's it for this video if you enjoyed it feel free to go down below hit that like button consider subscribing if you do want to see further content for me about the stock market investing and trading and don't forget to join the StriveSmart discord group chat and the StriveSmart facebook group those are linked down below as well as my personal instagram my twitter everything is linked down below so I'll catch you all in the next video thanks again for watching peace out


Good morning, and thank you to Brian for the introduction and the MCing and to Jim for going through all that fantastic content about the Linux Foundation and CNCF, and so I get to take a little bit of a step up and talk a big picture about some of the trends and open source and where they've come from. I'm Dan Kahn, Executive Director of CNCF, we're the non-profit organization that hosts these projects, helps organize this event. And here's a picture of our much smaller conference two years ago in Berlin. Let's zoom in on the graffiti, orchestration, containerization, microservices, our shorthand for explaining cloud native. Last year our technical oversight committee came up with a much more expansive characterization, the CNCF cloud native definition version 1.0. It includes ideas like declarative APIs, resiliency, observability, and ecosystem of open source vendor neutral projects. One word that's not included in the definition is Kubernetes. That's because Kubernetes is a leading cloud native implementation, but certainly not the only one. So why are we at KubeCon and not a conference about a different cloud native platform? Or more succinctly, why Kubernetes? Let's travel back in time a bit and look at the question of why certain technologies went out. We'll start in the year 2004. A social networking entrepreneur met with a number of Silicon Valley investors, including Napster founder Sean Parker. The founder launched it as Ivy League University, dropped out of school, and then expanded the social network to many other campuses, building the site to hundreds of thousands of users. I'm talking, of course, about campus network, started at Columbia University by Adam Goldberg a month before Mark Zuckerberg launched the Facebook at Harvard. So why were these two incredibly similar sites both developed at essentially the same time? I found my answer playing a game. How many of you have ever played Sid Meier's Civilization? Yeah, me too. And Sid Six is my 12-year-old's favorite game. One of Sid Meier's greatest innovations was to explicitly map out a technology tree. If you want to add knights as a warrior for your civilization, you need to have first developed the stirrup to domesticate horses and metalworking to create armor. The development of new technologies depends on the availability and sometimes the ubiquity of other technologies. Both campus network and the Facebook depended on personal computers and the internet being available in dorm rooms as well as a whole set of other technologies such as algorithms for efficient graph traversal. And this process of simultaneous invention is something that we see throughout history. Let's go back further in time to 1858. This is a picture of the British naturalists who collected beetles and spent his formative years as a scientist documenting the natural history of whales. He went on a multi-year expedition in the mid-1800s to collect specimens. After reading a book on population growth by Thomas Malthus, he formulated the theory of evolution. I'm not speaking of Charles Darwin. Another British naturalist who collected beetles, studied Welsh natural history, went on a multi-year expedition and 11 years earlier after reading the same book by Malthus, Discovered Evolution. No, the man on the left is Alfred Russell Wallace, and history knows him as the other person who discovered evolution. Quote, the centrifugal governor of the steam engine checks and corrects any irregularities almost before they become evident. And in like manner, no deficiency in the animal kingdom can ever reach any magnitude. That's Wallace describing control theory, which is central to how both evolution and Kubernetes work. We can go back further to 1687 and see Gottfried Leibniz and Isaac Newton independently discovering the calculus. And finally, we have John Tyndall. He is often credited with first establishing in 1859 that carbon dioxide is a greenhouse gas that leads to climate change. Standing in for Eunice Newton-Foot, we have the cover of her scientific paper. She made and published the greenhouse gas discovery three years earlier. Despite her prior publication and also being a signatory at Seneca Falls, the first women's rights convention, no image of foot has been found, and her discovery was not credited until 2010. Simultaneous invention is the concept that certain ideas are in the air. The prerequisite inventions have been made, and now it just takes a spark of creativity and a lot of effort to build the next step in the technology tree. Simultaneous invention is a common occurrence through history. So now let's return to this decade and the cloud-native definition. A number of companies have faced the challenge of building and running applications at scale. And with the prerequisite technologies having become available, including the Internet and Linux, a Cambrian explosion of container orchestrators was created. These systems, each of which followed the cloud-native definition, enabled these companies to reach web scale with fewer servers and fewer staff than would have been possible before. They include Alibaba Sigma, Amazon Apollo, Apache Mesos, Baidu Matrix, Cloud Foundry Garden in Diego, Coro S. Fleet, Docker Swarm, Facebook Tupperware, and finally, Google Borg and Omega. No, just kidding, we're only halfway through. There's also HashiCorp Nomad, IBM Platform Symphony, Joyant Triton, Lyft V3 Infra, Microsoft Service Fabric, Netflix Titus, Rancher Cattle, Red Hat OpenShift V2 Broker, Spotify Helios, Tencent Gaia, Twitter Aurora, and Uber Peloton. So, how are all of these organizations able to develop similar approaches to their scaling challenges? You could say that the prerequisite technologies were in the air. And as Isaac Newton wrote, we stand on the shoulders of giants, which is what Newton was doing when he adapted that saying from Bernard de Chartres, which is what I am doing in that I reuse those two quotes from the fantastic video essay, Everything is a Remix. But now, let's return firmly to the present. We're all here at KubeCon, CloudNativeCon, Open Source Summit Shanghai. Many other technologies had to be developed before CloudNative could emerge. But why aren't we at HeliosCon or MatrixCon or Apollocon? These are the results of web searches on some of the open source CloudNative offerings over the last three years. What is responsible for Kubernetes' extraordinary growth? Let's finally try to answer the earlier question, why Kubernetes? In my view, there are three main reasons. Number one, it works really well. Kubernetes was not just built on a decade of learning within Google from Borg and Omega, but has now also incorporated key architectural ideas from Red Hat, Huawei, and dozens of other companies. Number two, vendor-neutral open source. Enterprises that are going to build on top of a platform want to see multiple companies backing a technology, so they're not locked into a single vendor. No one wants to have to pay a platform tax for the lifetime of their application. From the beginning, Google explicitly encouraged developers from other companies to take leadership roles. In fact, CNCF was created within the Linux Foundation to provide a neutral home for CloudNative technologies and has worked through programs like certified Kubernetes to ensure that the ecosystem does not fragment. Number three, it's the people. Kubernetes, like Soil and Green, is people. The project has been developed by an extraordinary group of contributors, has done an impressive job onboarding new users, what's been called the Time to First Serotonin, and has explicitly worked to narrow the distance between the steps of the contribution ladder, from user to contributor to reviewer to leader. So these are my three ideas on the reasons for success, but I'd love to hear yours either in person here at the conference or on WeChat or Twitter. And the thought I want to leave you with is how deliberate all three elements of Kubernetes success have been. To quote the climate writer David Roberts, stitching things together, building up institutions that work, figuring out how to keep diverse interests on the same page is difficult emotionally and intellectually. The magic of the technology tree is that we can only be here because our predecessors have developed extraordinary innovations, like Linux and TCP IP, and in a bigger sense evolution the calculus and the cause of climate change. And the work that we're doing here together this week, building on top of the shoulders of giants may be neither swift nor easy, but it is also laying the foundations of the next generation of innovations, which are even now being built on top of Kubernetes and Linux. We, all of us, are part of the cloud native community. I entreat us to collaborate together in a spirit of kindness and with an awareness of history this week and hereafter. Thank you very much.


Hello again! We are now going to start the process of learning how to solve triangles that are not right triangles. There are two primary tools to do this. One is called the law of sines, and the other is called the law of cosines. In this screencast, we're going to look at two examples that use the law of sines. So, here's a statement of the law of sines. Notice we're using our standard notation for a triangle in which the vertices of the triangle are capital letters A, B, and C. The corresponding angles then are alpha, beta, and gamma. And the side opposite angle alpha is side A. One opposite angle beta is B. And the one opposite angle gamma is C. And here's a statement of the law of sines. And again, this can seem like an awful lot to memorize, including kind of having to memorize how the diagram is set up, how the triangle is set up. And there's quite a bit of information there. But what I like to focus on in this is each individual ratio. For example, if you look at this ratio right here, you will notice that it involves the angle alpha and the side A. And if you look at that, then angle alpha is there. A is the length of the side opposite. And so, basically, what each of these ratios involve is the sign of an angle and the length of the side opposite that angle. And the other two, you would see the same thing. So again, if we look at this one, again, you can see the angle gamma and the opposite side is C. And of course, the second set of equations down here is just the reciprocal of those of the three that we have written there. So there's just equivalent, different way of writing the same thing. So I like to think about, in using the law of sines, is kind of a more general framework. And notice in this setup, there are four quantities involved. One is the angle theta, and it's opposite side of x, and the angle phi, and it's opposite side of y. So the idea here is that if you know three of these four quantities, you can use the law of sines to determine the fourth quantity. But again, regardless of how you write your ratios, notice that each one involves an angle and the length of the side opposite. Same thing with phi and y. And if we could set up a situation like that, that's when we can use the law of sines. So what I like to remember is always think of sine of an angle divided by the length of the opposite side. That ratio is the same for all three pairs, angle opposite side of the triangle. That way, I don't have to remember as much notation. I can remember the main concept. So what I would like you to do for this triangle that we're going to try to solve is pause the screencast and just see if you can at least set up one situation where you could use the law of sines. Notice again, there are three quantities given. We're given the measures of two angles and the length of one side. Okay. Now, one of the things we can do right away, too, is if we know two angles in the triangle, we can determine the third because we know the sum of the angles adds to 180 degrees. So again, we have to maybe introduce a name for that. We'll call that angle theta. And then we can say that theta plus 25 degrees plus 51.3 degrees is 180 degrees. And again, by solving that for theta, again, we get theta plus 76.3 degrees equals 180 degrees, or theta equals 103.7 degrees. So in reality, we have all three sides of, or I'm sorry, all three angles of the triangle plus one side. So we can set up ratios involving the pair of 25 degrees and 12 feet. So what we're going to use for a notation here, then, is we're going to call the length of this side x and the length of this side y. And with that, then, you can see we have ratios we can set up in particular. Since we're kind of trying to solve for x, it might be nice to put that in the numerator. x divided by the sine of 51.3 degrees. And again, you can see that's a ratio involving the sine of an angle and this length of the side opposite. The one that we know is 25 degrees and 12 feet. So we set that equal to 12 divided by the sine of 25 degrees. And now we've got an equation involving four quantities, three of which we can calculate. So we can solve for x. And basically what we do is multiply both sides of this equation by the denominator sine of 51.3 degrees. So we get a somewhat complicated computation, but the process is not too difficult. x is 12 times sine of 51.3 degrees divided by the sine of 25 degrees. And here's now where we do take out our calculator and do the computation. And again, remember, we're going to get a decimal approximation and I guess in this case, we're going to round off to the nearest hundredth of a foot. So I'll say 22.16 feet. That's what you should get for that computation. You might want to pause the screencast briefly and do that on your calculator to make sure that that is done correctly. Now we have two pairs. We have x in 51.3 degrees and 12 in 25 degrees. And what I like to do is use the original one, the one that we were given. And in fact, the way of determining y is almost the same as the other one. We can take y divided by the sine of theta and we've determined theta to be 103.7 degrees and that should be also equal to the ratio of 12 divided by the sine of 25 degrees. So you can see it's almost the same thing. We just have a sine of 103.7 degrees. We get y is equal to sine 12 times sine of 103.7 degrees divided by the sine of 25 degrees. And again, now's the time to take out the calculator and do that computation. If we do so, we should get y equals 27.59 feet. Okay, so here's the summary of kind of what we have done in this problem. And again, remember I've got the three unknowns labeled, but the whole starting point was this pair right here because we knew both the angle, the measure of the angle and the length of the side opposite that angle. That allowed us to use that ratio. We first determined the measure of the angle theta and then used the law of sines to determine length x and length y. Okay, here's another problem. Again, what you might try to do here is at least seeing what ratio we can use within this problem if we use the law of sines. So pause the screencast and try to set up the problem. You might have to introduce some notation to help with that. I will do that when you come back to it. And if you set it up, you know, likelihood, you might, you'll use slightly different notation than me. And again, it's not the notation that's important, but I will be consistent in my work here and continue to use whatever notation I introduce for you. Okay, we're back now. So what I'm going to do, again, the focus of my attention is right in these two quantities here. That's the key to the law of sines. We have an angle and a length opposite that. Notice in this case we actually have the length of two sides and only one angle. So what we're going to have to do is first solve from one of the angles. We have three unknown quantities here. So I'm going to call this side x the length of that side and then I'm just going to label these angles as alpha and beta. And you can see now, in one sense, we're going to have a hard time. There's one pair, namely the pair involving alpha and x, that we really can't use yet because we don't know either of those quantities. So our first step is going to be to determine the angle beta. But you can see that we do have one pair that we can use to set up our ratio. Since we're solving for an angle, I'm going to set up this ratio with sine of beta on the top of the numerator. And I'll get sine of beta over 2.5. And then I can use the quantities that I know. Sine of 60 degrees divided by 3.5. And again, now we have a ratio that we're an equation involving two ratios that we can solve for sine of beta. And again, to do that, I'm going to multiply both sides by 2.5 and we get sine of beta equals 2.5 sine of 60 divided by 3.5. And we can now use our calculator to at least first determine sine of beta. And one of the things we might consider here, we do know the exact value of sine of 60 degrees, but everything else that we're using is decimal approximations. So we might as well use our calculator to do all of the computations here. And if we do that, we come up with a result at sine of beta. Again, I'm going to write down seven digits. Don't round this off too much. Always use seven or eight digits, if not the full calculator display for that. And we get sine of beta equals 0.6185896. And here's where we have to be very careful using the inverse sine function. Remember that the inverse sine function is only going to return to us an angle between minus 90 and 90 degrees. In this case, since we're using a triangle, it's going to return something between 0 and 90 degrees. But it is possible for a triangle to have an angle greater than 90 degrees. There are two values that we would have to consider for beta. The easiest one is what one we get using the inverse sine function. And again, rounded to the nearest tenth of a degree, that comes out as 38.2 degrees. Now we have to use that as a reference angle equivalent to a reference arc and consider that the other possibility is 180 degrees minus 38.2 degrees. So we have another possible angle of 147.2 degrees. Sorry, that should be 141.2 degrees. So let's get that fixed up there and doing that subtraction. It should be 141.8 degrees. Okay, now, if both of these angles were possible, we would have two triangles that would solve this. We would have to give both of them. But please notice that 141.8 degrees plus 60 degrees, the other angle that we're given, is 201.8 degrees, which is greater than 180 degrees. So in this case, our second angle is not possible. We can't have two of the angles add up to more than 180 degrees. In fact, all three angles have to add up to 180 degrees. So in this case, we have only one solution for beta. And of course, the next thing we have to do is determine the angle alpha. So that's what we're going to try to do right now. There is, of course, what we're going to use is that the three angles have to add up to 180 degrees. And we'll be able to then solve for the side x. So basically what we have is alpha plus beta plus 60 degrees equals 180 degrees.  And now, again, remember, we always have our given information of 3.5 and 60 degrees. And so I'm going to use that, as you can see in this equation here. And again, use the law of signs to set up the angle and its opposite side. So we get sine of alpha in the denominator and x in the numerator. And again, if we solve that equation for x using our value for alpha, it does come out that x is approximately 4.0 meters. And I would include the point zero because that indicates that we've rounded that value off to the nearest tenth. So we've done quite a bit of work here, but we finally have solved this triangle. We have all six sides determined. Three of them were given to us, and we determined the other three law of signs. There is a way we can go to check our work just to make sure we've done this correctly. And I would encourage you to kind of pause the screencast and do the three computations that I have indicated there. We could also do them as sine of 60 degrees divided by 3.5, sine of 38.2 degrees divided by 2.5 and so forth. I chose to do it this way. And if I do these computations, or you should be doing them, but what I get here, and again, perhaps including more decimal places than I need to, that rounds off to 4.0415. This one rounds off to 4.0426. And this one rounds off to 4.0413. And again, you can see they're not exactly equal, but that's because we're using many rounded off computations. But you can see that all three of them do round off to 4.04. And so we have strong evidence that we have solved this triangle correctly. And we could also now go back and probably use the same procedure to check our work with the first triangle that we solved here. Okay, that's it for now.