Hey guys, it's Nate, aka the Foot Accountant. Welcome back to the channel. It is Rewards Day. You may be thinking, why am I not uploading your rewards video right now? There is a reason I'm going to tell you about it, because I'm recording this video on Wednesday night to put it up for Thursday for you guys. You're going to see a lot of rewards videos today, but there's one thing that I'm going to talk to you guys about. As you are completing your Thursday flips, which you'll all find dandy and good, market's going to rise after rewards, which was previous to this video going live. Sell your flips, get them out, but we need to look for the next market moves for this next team of the season coming out this weekend, which is La Liga. We're going to be getting the La Liga team of the season, and we need to look at investing in some cards and look at some trends from last week. It's happened now twice with the Bundesliga and with the Premier League. We've had some major, market movements, and it's going to be no different this week. A new fresh batch of coins is going to come onto the market with weak and weak rewards. People are very rich right now in this game, and they're paying a premium for cards. That is causing a lot of cards on the market to shoot up in price. Don't worry, I will have a rewards video that will be coming out on Friday. I'll be recording those later in the day on Thursday, but we need to look at the market and what you guys need to be looking out for Thursday night, tonight, and into Friday. That's what I want to be talking about with you guys today. I'm going to start off with a few examples of cards that have boomed this week with the new team of the season coming out. John and Son shows FFS card, a usual riser on Thursdays. Look at this. You go back every week. Tuesday, 4.45, he goes to 4.80 on Saturday. Thursday, 4.11, he hits 4.44. This card is hype card that goes up every week, but look what happens when Bundesliga Tats comes out. He goes down to 419,000 coins. On Friday, it says 4.47. I can tell you for a fact in the morning before the team of the season came out, and especially right after they released the actual team of the season that was going to be coming out. People saw that he was getting a Tats card. They went and they panic sold their 90 rated Sanchos. He went from 409,000 coins. He was panic sold down to that point. Look where he has boomed to. 500,000 coins on Saturday. He's back up to 500K and he had a nice dip in the midweek as well. We're going to talk about buying on Thursday and Friday, selling on Friday night into Saturday and then buying again Sunday night into Monday and looking to sell these cards again for Thursday flips later in the week. This is guaranteed money. It's going to happen again this week with La Liga. More people are starting to catch on to it though. We need to be careful with our buy times and with the cards that we choose. We need to make sure that the cards that we choose are very hyped, are very popular, and also very meta in game. Sancho fits all three of those categories with his stats, and especially the hyper on this card being English and Dortmund. He's easy to link in multiple different leagues. Now, it's not all those cards like the 500K range, 200K plus. If you're in a smaller budget, maybe you only have 500,000 coins to mess around with. This card would have been a great investment for you. Last week, before Todd started, 60,000 coins. We'll ignore this low point because that was after Frankfurt lost, I believe, after Frankfurt had lost and his card was no longer a live item. But this card has insane stats. For Bundesliga coming up, he gets a perfect link to Jovic, I do believe, team this season Jovic. This is a pretty sick card. Look what happens to him. Bundesliga Tats comes out on Friday. He shoots up in price, 64K to 72, not too much, but now look at it. He's 80,000 coins after another midweek dip into the 60s. This is another type of card that you want to be looking for. We're going to be looking at cards from La Liga here in just a second so I can start to give you guys some examples and just talk to you about what cards you're going to want to look at during this weekend. So again, I want to talk through the buy times just a little bit. We're going to look at another card to give you guys an example of this, the Headliner Royce. Now, this isn't just for all the top cards on the market. All the cards moved. Oh my gosh. Look at this. He goes from 377,000 coins on Thursday all the way up now to 519K, which is a massive undercut. Look, he's 554. He's gone up 200,000 coins in a week. That's how much this card has gone up. We have to get on this, boys. This is incredible, incredible trading and we can honestly double dip as well. You can buy on Thursday, Friday morning, sell on Saturday, and then buy again on Sunday night at an even increased price, but it still continues to go up, especially for a card like Royce who everybody wants to have in their Bundesliga team. So that's kind of the buy time and the sell time for the movements of the market for this team of the season stuff. And I also want to look at some other special cards as well because it's not just that top tier card that moved, all of these moved. Look at this Royce, 150K on Thursday. Look where he's at now, 225. He's almost up 100K.  All right. I've shown you enough of the proof that it's going to happen and then it works. Let's look at some possible players from La Liga. So this is what I have been doing. Go into the FIFA 19 players database right here using this, click this link right here, go over to leagues, go down to top five and click over to La Liga Santander and boom, you're looking at all the La Liga cards. Now we're going to focus on special cards, probably not gold because they're not going to have as good of a return, but we're going to be looking at special cards and it doesn't matter whether they get a tots, whether they don't get a tots. If it's a popular player with good stats and a player that people are going to abuse when they're building teams around these new tots players on the weekend and on Thursday after rewards, they're going to fly. They're seriously going to fly. Now, one favorite player that I have looked at already is Antoine Griezmann. Will he get a team of the season? I think he will. But if Royce's team of the season, just this last week, was three and a half million coins on the first day, four million coins, this Griezmann tots card is going to be at that price level for sure. He's going to be three million coin card and you're going to look at this card being panic sold, maybe down to 750. Maybe this card on PS4 goes to like the mid to low 800s at its lowest. I'm not sure with the PS4 prices. I'm talking Xbox, but look at the PS4 graphs and you'll be able to decipher what a good buy price is for these cards. You might see this card get panic sold a little bit, maybe down 40, 50,000 coins, but when that next high level card is four million coins or three million coins, people are going to buy back this card in a hurry. It's going to draw hype to this player and he's very linkable. Yes, he kind of is an imbappe's position. So that's only a bad thing about this card. But maybe this one is one that you would like to look at as well. I think Griezmann is going to be a huge rebounder because people love Griezmann in this game. I remember early on in the beginning of the year, everybody had the gold Griezmann in their team just because his finesse shots were great. Finesse shots are still a great thing in this game. He's got the four star skills and he's just a player that a lot of people like to use, very linkable as well, being French. So watch these cards. Honestly, watch them, watch their fluctuations and price. Griezmann right now is 540 on Xbox. He's a little bit up. I bought two of them actually last night for 470K. People know that these cards don't sell a lot. So to get them to sell, they have to undercut and that's how you get some of these deals. And that's what you're going to be watching for on Thursday and on Friday. Now, obviously you're thinking, well wait, Thursday is when the market goes up after rewards. Yes, that's true. But some of these cards, if we look at Royce again, his lowest point was on Thursday. Wednesday and Thursday for this card was his lowest point. This also drags into Friday morning as people are panic selling. But that's when a lot of people are going to be looking at the market. So I want you guys to look at this stuff today. Thursday night, this is your time to get on some of this stuff before other people are getting on to this method that a lot of people are going to be doing this week. And that's why we need to be careful with the cards that we pick as well. So let's go back here. Another card that I want to point out is Lionel Messi. And I think my favorite Messi card out of all of these is probably this one. Or maybe his team, the group stage, because this one has such a huge price difference from the, wow, 799 is a fantastic deal on that Messi card, to be honest. But this one is a lot cheaper than a lot of the other ones. And if you need a Messi in your team, let's say you pack a Suarez team this season. You know, there's a lot of people in this game this year that have a million coins where they could splash some of it on a Messi. That's why I like this card. Not as many people are going to be able to buy the 1.8 million coin card. And he just has a lot of cards up here at the top. So we're going to focus on the lower level Messi cards. Sorry for that background buzzing if you do hear that. That's my apologies. But focus on the lower level Messi cards because he is going to rebound as people love Messi. He's going to get a team the season card. And you know, that's just a very popular and hype card in this game right there. But again, focus on the 500,000 coins in less budget, maybe 700K for a couple cards. But that's really the budget where a lot of people are at. A lot of people can afford that. And everybody gets a guaranteed tots. Some people pack a really good one and they go and build a team around it. And that's where we do make some of these coins. Man of the Match Suarez is another one that I really like as well. Maybe not so much as this one looks good to me as well. 700K. It's a bit pricey in the end forms. Yeah, maybe they're good for me as well. But I do like this Man of the Match one because it's orange. It doesn't have a dynamic image, but it's orange and it's very rare. Gareth Bale's foot birthday. As we get into some of the cheaper items, I really like this Sergio Ramos Fanta card. He was like 250 yesterday, so he's up a bit right now. But if you see this card at 250,000, 260,000 coins on Xbox, maybe under 300 on PS, that is a massive buy. Because his next most expensive card or his next card is 1.7 million, the team of the year. Obviously, I have a tots card. Might be a little bit cheaper, but there's still going to be a huge price gap in there. And that's where you really make the biggest coins. That's why we saw such a huge rise in this Royce card. This is the highest rated Royce card available on the market other than his tots card. And it's literally 3 million coins less, maybe 2.5 million coins less than his tots card. That's why you saw this one rise so much throughout the week. So again, be looking through the squad right here. There's a lot of guys that obviously people are going to be looking at some of the most popular players like the Griezmann, like the Isco, like a foot birthday, Coutinho, maybe some versions of Marcelo. But you know, don't be afraid to kind of get back here into some of the lower rated cards that are very popular and used in this game. Even a guy, you know, I'm trying to find a lower rated card here, even like an 87 Nacho Fernandez, you know, that or an 88 Gerard Moreno four star, four star, he's 88 rated. He's got pretty good stats and not a tots level card, but still a pretty good card. And he's 88 rated, you know, four star, four star, that's a card people might try to incorporate in their teams. You could see him rise from like 35k at a low point. You might see him hit 50k. That's a very cheap level investment. If you're on a coin pinch and you don't, you have less coins to invest in some of these cards. But again, I got like Anaki Williams. Can you imagine if he gets a tots card, what it's going to be priced? He's going to have so much hype being an OP player that people love.  He's going to be club 90 except for defense. If he does get a tots card, then you're going to look for this card being a huge, huge boomer next week. This card is very good in game. I did try it a long time ago. So that's going to keep your eye on as well. That's honestly probably one of my favorites right there. Spilled the beans on that one, I guess you could say. And then of course, check on a guy like Voron. You know, this again, there's a huge difference between this UCL card right here, 99k for this and 96, and it's 96 rated card, which is like 1.1 million coins. The only one slight precaution I will give you is be careful with these UCL rares. Just in case they do release some type of SBC that gives out UCL rare cards because Champions League is this weekend. I don't see it happening, but it is possible. We did get a Europa League SBC today. So that's one thing to watch out for. Ben Yedder is another good one. Even a Carvajal at right back. This is his highest right back card because that 88 was an SBC. Keep your eyes on this card because if people are going to make a team, they're probably going to be some better right backs from the LaLiga team of the year. But you know, here's a cheap option you can use in your team, especially if you are hybridding a squad with a team of the season Ramos or you know, another Real Madrid team of the season players. So watch out for those cards this week. Seriously, go into this FIFA 19 players tab. You can even sort it by whatever type of card that you want. Just scroll through here. Look for popular meta players from LaLiga and look at their price graphs. You can figure out what a good investment is going to be.  This comes into play. Obviously, people are thinking about Scream Bousquets. Why not think about Scream Diego Costa as well? Maybe 190,000 coins. He's got 99 pace and 99 shooting. It's going to be a card that some people are going to want to try out. Four-star weak foot, great finishing stats. So keep your eyes on that and there's going to be a lot of market movements this week with the LaLiga card. So if you enjoyed the video, smash the thumbs up on it, comment down below if you do have any questions and subscribe to the channel. If you're new, it's been Nate, The Foot Accountant. Catch you guys later. Peace out.


Hi everyone, in this video we will learn how we can use the mf function to allocate memory in a C program. So I have written this mf.c program here, let's open this with visual code. So this is the mf.c program. I will go over the code and then we will compile and run this. So here is the main function. I have defined a signal handler, I will come to this later. So first we get the page size of the system using the getPageSize function. So the page size is generally 4kb which is 4096 bytes. Then we define the PID using the getPID function and this will return the PID of the process which is running this code. Then we use printf to print out the page size and the PID of this program. And this is where we are using the mf function to allocate memory. So here we have defined this caster region which is a pointer to the memory. And this mf function takes first argument as the address at which we want to allocate memory and the system will try to assign us memory at that particular address. But we have given null here. So it will just give us the memory at any available address. Then the second argument defines the size of the memory that we want to allocate. So here we have given 100 times the page size which means it will be around 400 kilobytes of memory. So we are allocating about 400 kilobytes of memory. Then this defines what are the permissions on that memory. So we have read and write permissions on that memory region. This indicates whether this memory is backed by some file or not. So we have used map anonymous which means that it is not backed by any file. It is just a chunk of memory. And it is private which means that it is not shared with other processes. And because this memory is not backed by any file. So we use minus 1 for file descriptor because there is no file with which we want to back this memory. And we use 0 as offset. So these two arguments are used when the memory region is actually backed by some file. Now we check if the return value is map failed then we print out an error could not map and return. Otherwise we print out that we have mapped 100 pages at this particular address. And then we have this while loop. But this while loop does is it iterates over 0 to 100 and accesses the first byte of every allocated page and adds it to some. So this is just to make sure that we are accessing every page. And then it sleeps for one second and it repeats it again and again. So the program will be stuck here so that we can analyze certain aspects of the program. But what if we want to exit the program then we can use ctrl plus c. And because we have mapped some memory and we need to unmap that before exiting the program. So we have defined this signal handler which handles the segment which is ctrl plus c. And what this handler does is it unmaps the memory region using m unmap call. And it takes the address of the region and the size of the memory. And if the unmap result is not equal to 0 then we print out the error that could not unmap. So we print out that successfully unmap and then we exit the program. So that's the complete mmap.c code. So let's compile it and execute it. So I'll open the terminal and compile it using gcc mmap.c and then I'll run the error out. So it shows that system page size is 4096 bytes, PID of this process is 9871 and then we have mapped some 100 pages at this particular virtual address. And we can use ctrl c to exit the program and it prints successfully unmapped. So that's the mmap.c program. Now let's try to analyze this program further. So what I'll do is I will comment out this mmap part so that it doesn't allocate any memory and I'll comment out this part as well. And this part as well. So now the program just prints out the page size and PID and just keeps running this while loop. And I will also comment out the signal handler. So now let's compile this program and run this. So it shows 9925 is the PID. Now I'll open another terminal and I have written this command here. So this is just the ps command and this hyphen is used to define the output. So I want PID, the virtual memory size, which is the VSS and RSS, which is the resident set size and the percentage of memory used in the output of this ps command. And I want all of this information for this particular PID. So I'll change this PID with 19925. So this shows me VSZ, which is the virtual memory size. This is the amount of memory which a program can access, which is 4512 kilobytes. And then when a program actually uses some memory, that is when it adds up in RSS, which is the resident set size. So RSS is 768 kilobytes, which means that program can access 4512 kilobytes of memory, but it is actually using just 768 kilobytes of the memory. Now let's stop this program and let's uncomment the MAP system call. So here I will uncomment these two and I will also uncomment the signal handler. So here it will map some 400 kilobytes of memory, but I'll keep this commented so that we are not actually using that allocated memory and it should just show up in the VSZ and not in RSS. So let's compile and let's run this command again with 20226s PID. So here we see that VSZ did increase by 400 kilobytes, which is the 400 kilobytes extra memory that we allocated using the MAP call. And RSS just increased by approximately 100, which is due to uncommenting the parts of the code and it does not include the 400 kilobytes of memory which was allocated using MAP. Now let's stop this as well and let's uncomment the remaining part. Now we are allocating memory and we are also accessing the memory in a while loop. So now let's compile and use this 20279 as the PID here. So now you can see that there is a significant increase in RSS because now it includes the 400 kilobytes of memory that is being accessed by the program. So we see a significant increase in both VSZ and RSS. So that's it for this video. Thanks and have a nice day!


As Queensland's Police Commissioner, I want to assure the Muslim community that you are integral to what makes Queensland a great state, a multicultural society living together in harmony. The Muslim community continues to be as important to the Queensland Police as every other community that we serve. I recognise that recent events locally and internationally have had a significant impact on the community. Sadly from time to time there will be incidents that will test our usually harmonious relationship. The Queensland Police Service is committed to stopping crime, making the community safer and working with our community. Recent operations have resulted in arrests on terrorism-related charges. Targeting this type of criminal activity is a high priority for your police. Equally, we will not tolerate persecution of individuals or groups based on religious beliefs or ethnicity. Queensland Police have also recently arrested a number of people for appalling incidents in which members of the local Muslim community have been targeted. I recognise these incidents create fear within the community, something which we are determined to address. We are all Queenslanders and Australians and we do not tolerate this behaviour. It is important any such incidents are reported to police so we can take immediate action. In a life-threatening situation, please call 000 and ask for police. If it is not urgent, call our police link You can also report crime anonymously to Crime Stoppers on National Security Matters should be reported to the hotline on Over recent weeks, I, along with many of my colleagues, have visited a number of mosques and met with Muslim community leaders. Through our Police Liaison Officers and Cultural Support Unit, we remain committed to building strong relationships with all communities in Queensland. It is important we continue to work together to make this community safer.


All right, a little bit about me. So February 14, 1983, over a Valentine's Day, yes. Over the weekend, I did a lot of work with computers. I'm working on a simple machine language game for the Apple II. Machine language is the only language a computer understands, and it's consisted of binary number codes. Probably needed a technical editor or copy editor there. All other languages are converted to this language. And I'm going to make a game that's going to be, oh, and I'm going to make a game that's going to be trying to move a man through a field of moving dots. Very exciting, very exciting. There's a picture of me and my cat about from that area. And let's write some code. I have always been kind of fascinated with the workings of machines, like computers and kind of low level details and so forth. And if you start working with machines, you start coming across different kinds of structures and so forth. And one of the things that you might come across is just like a stack. Stack is actually really easy to implement in Python. You can do it with a list. So maybe we make a list and then a stack has like two operations on it. You have like a push item where you can just append something onto your stack there. And you have a pop where you just return something coming back. Now stacks are actually kind of an amazing thing. I'm not going to do a demo of that. But you have a stack. It turns out that stacks can be just used for all sorts of amazing stuff, like actually making like little machines.  And so an example of what something like that might look like is you can basically come up with like your own like little machine language. This is an example of kind of a stack-based machine language that computes 2 plus 3 times 0.01. And here's how you might do something like that. You can take like your stack, give it an execute function or a method like that. Maybe I'm going to change this into the name machine at this point. And what you will do is just write a little like a little loop where you just execute op codes in this like instruction sequence. Like you can say, give me an operation and then maybe some arguments to the instruction.  Like you can say, if op is const, then maybe you push something onto the stack. If op is add, for instance, maybe you pull things off the stack. Like you get the right thing off the stack. You get the left thing off the stack. And then maybe you put the result back onto the stack. So self-push of left plus right. You can do the same thing for like a multiply instruction, for instance. OK, so you can take that code, do multiply. And all of a sudden, you're kind of on the way to making like a little machine here. I'm going to put a print statement in here just so you can see what's happening. So maybe print the op, the args, what the stack is. I'm also going to put a little safeguard in here. Just in case I screw up, I'll get an exception message sort of saying like a bad operation. OK, so you might start with something like that. And I used to think this was amazing when I learned about this as a, I don't know where I learned about stack machines. It probably was not middle school. But somewhere along the way, I learned about stacks and the fact you could make machines. I just thought this was like totally cool. So the way that this works is you'd make like a little machine and then you'd execute code. And then if it worked, like the result would just be there on the top of the stack. So let's give that a try and actually see if it works here. So you would just say Python, you know, Python 3 machine dot pi. And nothing happens. Let me, let me see what happens here. I got execute code. Oh, I need a main function. OK, so your job in the front row, by the way, is to do kind of a code review. Like I don't actually use syntax like tooltips or anything like that. So I need more like an audible version, like kind of the louder and like more yelling that takes place. I'll know that, I'll know that something is wrong. OK, so, self.stack, self.push, oh, items, items. OK, no, OK. Nothing like live debugging to, OK, OK, so, OK. So get this, get this, get this stack we're going here. What you see is it's sort of churning through operations and it comes up and prints result 2.3. OK, awesome. You know, it's like I've got the start of like a little, like a little machine here.  I could give it more features. So maybe one of the features that you might want to give it is some memory. I don't know, maybe we're going to make like a byte array of some, of simulated memory of some kind. The most memory that I'll probably ever need is 64k. So I'll give it like kind of a default size like that. And then maybe I'll start building like some functions to kind of load and store from memory. Again, I'm thinking like, can I make like a little CPU or something like that? Now the problem with loading and storing is that I'm going to have to make some decisions about how this memory actually works, right? I mean, OK, I'm going to have to pull something out of the memory and I have to make some like decisions of what's here. So for lack of a better, I guess a better alternative, I'm just going to assume that everything is a floating point number. Maybe I've been doing too much JavaScript or something like that, OK? So we're going to, we're basically going to do like some memory unpacking here of value. If you haven't used the struct module in Python than before, that's a way of kind of packing values. OK, so we're going to have this machine. It has like a load and a store and a pack and unpack kind of thing. In order to use that, I've got an import struct. And then I'm going to give that sort of more, I'm going to give myself sort of more instructions here. OK, so if there's like a load instruction, what I would do is get the address by kind of popping that off the stack and then pushing on like the value of loading it.  OK, so store it address value. So if you add these kinds of instructions, suddenly your programs become a little bit more powerful. You can start having the concept of variables maybe, like X is 2 and V is 3. And maybe I do computations like X is equal to X plus V times 0.01 or something, where I'm now like reading and writing data on my machine. In order to make that work, what you have to do is basically give like these things a memory address. I'm actually introducing like the concept of a pointer here. So I have to pick some number, like some address for this X is going to live. I don't know, does anybody have a favorite number? 22, OK, that can work, OK. X is going to be at 22, V will be at, I don't know, 42. OK, fair enough. So what will happen now if you wanted to load from variables is you kind of have to, you have to put like the address of a variable on the stack and then you would load it and then you would put the address of the other variable on the stack and you would load that. And then at the end, what you would have to do is store the value. Now the store is a little weird. It turns out the way I have this structured is I have to put the address first and then you put it through the value afterwards. So you kind of put these like addresses on there, loads and stores. And then the way that the machine would work is you'd have to set up some variables. So like I'd basically say, well, at X address, I'm going to store two. And at the V address, I would store three and then I would execute my code. And then at the end, instead of popping something out, I would just load it out of it. Okay, so kind of building up the machine, giving it kind of memory here. You have memory addresses, load in store and I'll keep my fingers that this thing still runs here. Self-store value. Okay. My cat is cute, but I don't want to keep looking at that. I just have a typo in the variable name. Front row, you're letting me down on a typo there. Okay, so if we do that and it comes back with kind of the same result, we're doing load and store kind of stuff. Now, somebody's going to look at this code and they're going to say, you know, that's great.  And then use that, you know, because so I kind of build function calls into my machine. And it turns out that that's not too bad to do as well. What you can do for functions is maybe introduce the concept of a function. There are a few things that are kind of related to functions, like how many parameters do they take? You know, does it return a value? What code is associated with it? So I'm going to add these in here. Typo, okay, I'll come back to that. Yeah, just have to make sure that there. Okay, so you're going to have a few features like that. And then what I'm going to need to do is add a little bit of stuff to my machine to kind of make function calls work. One of the ways that I could do that is I could add maybe a call method where you give me a function and some arguments. And then I set up kind of like a function call. Now, one of the things that you're going to need with functions are a notion of local variables. And like when you call a function, you get like new local variables and parameters and stuff.  That isn't kind of a neat little trick there. What I'm doing is making a mapping between the numbers and the arguments. There'll be a quiz on this later on. Okay, a little trick with the enumerate function. And then what I'm going to do is kind of pump this whole thing off to the execute function where I'll have some, I'll pass it the locals. And then if the function returns something, I'll pop something off the stack.  I'm going to modify my execute code here to take in the locals. And I'm going to build some more features around it. One of the things I'll build are some operations for dealing with the local variables. Like maybe I have an instruction called local get. And the way that that works is it will put something onto the stack by kind of looking it up in the locals dictionary. And then maybe I have another operation local set that does the opposite of that. Okay, so this is kind of like load in store, but it's kind of manipulating that, that like locals thing a little bit. And then the other thing that you're going to need to do function is I need to have some way to call a function. Now this is a little, this is a little tricky with the call. And one of the things with the call is I need to have some way to like reference the function. Like somehow like I need to get like, what am I referring to? Like what is the function object? In order to do that, I'm going to extend my machine with like a little function table. So I'm actually going to pass in functions as like a little, it's an argument here. Okay, so we're going to have like the, think this is like the function table here. Okay, that's coming in. And I'm going to have a, the call operation is essentially just going to look up what the function is. So we'll look up the function, okay, look it up.  So what we'll do is we'll pop the arguments off the stack here. That underscore by the way is just, I'm disregarding the variable. I'm just like, eh, I don't care about that.  So I'm going to flip the, like I'm going to reverse it. And then I'm going to basically call myself. I would say self call, funct with the, with the arguments. And if it returns something, I'll take the result and put it back on the stack. Okay, so you got like, you have function call. What that's going to look like in the little machine code that I'm working on is that you would have to define functions in the machine code. Like I would have to say update function as function, number parameters equals three, returns equals true. The returns by the way, I'm just treating that as a Boolean, like does it return something or not? Okay, so returns true. And then you would give it code that does the function. And so what the code might look like for this is I would say local get zero, that's basically getting the X. And then I would do local get one, that's the V, local get two, that's the DT. And then I would do my math calculations, like multiply it together and then add the results. And then maybe that's just the end of my function there. And here's my function table. Okay, update position. Okay, so I'm gonna have my little function table like that. And what I will do is kind of modify my machine. I'll say, okay, well here's your set of functions, I'll pass in the function table. And then if I wanted to call a function, instead of doing this stuff at the end here, I would replace that with a function call. I would just say call zero. That's the, what was that? Update position or something, whatever I called that. Okay, so you've kind of added, you've added things to your code there. If this is working, I'm not sure it will be, but we'll see. It should produce the same answer as it did before. Oh, man, once the execute takes locals, you gotta pass that third argument in there. Okay, let's try it. Okay, so we get the same answer as before. One little digression, by the way, in one of the breaks, so I've talked to a lot of people at the conference, and I don't remember who it was, but somebody asked me, how does Python work? Like how does Python take like Python code and turn it into like machine instructions or something like that? It actually does this. This might be more than you ever wanted to know, but like if you write up like a Python function, like update position. Okay, this is just pure Python code. xvdt, and you said return x plus v times vdt, like that. What happens underneath the hood of that is Python turns it into like a little Python machine code.  You can see like the numbers there. Load zero, load one, load two. This is like exactly the same thing that I did and then there's like binary multiply, binary add, and so forth, this is how Python works. It's actually a little like stack machine, kind of what I'm doing. Now, I'm not actually trying to re-implement Python, but if you're kind of wondering what Python is doing, it's doing that. It's interpreted, okay? So it runs on a little machine there. All right, now continuing in this machine model for a bit, okay, it's like, okay, again, it's like I'm geeked out about like low level details and it's like I wanna know like how do CPUs work and how do machines work. One thing that my machine is missing, well, it's missing kind of a critical feature. You know, not to put anybody on the spot, any thoughts on what it's probably missing here. Okay, well, the one thing that it's missing is I don't have any way to do control flow. Like I don't have any way to do if statements, like if test, you know, consequence, you know, else alternative, things like that. I also don't have any way to do like loops, like while loops or anything. Like this thing is just going through instructions and it just like that's it. And in order to do that, you have to introduce some kind of like branching instruction or something. Like maybe you have a branch instruction of some sort and then maybe you have a conditional branch.  But in order to do this branch, you have to do some kind of go-to statement. I mean, you have to introduce like some kind of jump or go-to and like go-tos have a way of sort of offending people. Not to mention that they don't even have them in Python, but so one question that comes up is just what, well, what do you, what's the next best thing to a go-to? Like if you don't have go-to, what would be the next best thing that you could do? And I would claim the next best thing is to simply raise an exception. This is really gonna offend people. They're like, raise an exception. Like what, so what is happening? So if you want the program to stop or branch, one way to do that is just to stop. You're gonna look at that saying like, what is that about? Okay, the conditional branch here is, it's going to be, look something like that. Like if the top thing on the stack is true, then we break. We'll have to introduce an exception for this. And this is gonna look really weird.  So you could break zero or you could break like 10 or something and maybe one is more than the other. But you're gonna have this kind of break statement. And then the other thing that I'm gonna introduce is the notion of a code block.  Think of this as like curly braces or something or indentation. It's basically going to be a block of code that's like nested, okay? So you're gonna have this code block. And what I'm gonna do with the code block is essentially just try to execute it. So like do a recursive execution. And then I'm gonna catch that break exception. And then if the level is still high, I'm just gonna decrement the level and re-raise the exception. You're like, and so like, you're looking at that. What is that? That is like crazy town kind of control flow. Here's the thing that you get with that. It turns out that using nothing but the block and the breaks, you can implement like an if statement. This is what it looks like to implement an if statement. I'll move it down a little bit so they're kind of together. What you do is you just kind of nest two blocks inside like a block inside of another block. You put the test in there and then you put these like weird branch statements with a zero and one and here's how this works. Basically the end of a block gets a label attached to it. Like the end of the inner block is label one and the end of the outer block is label, or that's label zero and the outer block is label one.  So you do the test and then if the test is true, you basically just bail on the rest of this block and you go to label zero and then you run the consequence and this thing does the alternative and you kind of branch out. Again, there'll be a quiz on that later, so kind of a while. And then you can do the same thing to do loops, it turns out. If you wanna do like a while loop, you introduce a loop instruction. Now this thing is going to be even stranger. I'm gonna go into an incident loop where I just try to execute a bunch of code and then right after I execute it, I break. And then I catch this exception and then if the level is greater than zero, we do the same little trick like that. Now what is that basically? Okay, so that is really crazy. What is going on there is a, let me undo that, insert. I have a few things to kind of speed up typing. This is how you would basically introduce a while loop. So if you had a while loop, like while test body like that, you end up doing it with like another, like this nested block idea and it turns out that these blocks basically have magic labels. It turns out label zero is basically the start of a loop and label one is like the end of the outer black.  That's kind of like a continue statement. And this is go to one. And that's kind of like a break statement. Okay, so you have this kind of very strange kind of control flow going on where it's like, oh, okay, these are like raising exceptions and like doing this weird blocking and another stuff. The other thing that I'm gonna introduce in here is a function return statement that just basically tries to get out of all that nonsense too. So that is also going to be an exception. And I'm gonna catch that up in my call thing here. Basically that the return is just treated as like get out of this horrible mess that has been created. And okay, so you're gonna have this and it turns out that doing that allows me to write much more complicated programs involving looping and other things. I'm not gonna modify the original code per se, but this is what it might look like to execute a while loop. Let me kind of move this into position here. You would have like a much more complicated piece of code. Sorry, I kind of put that in the wrong spot there. But you're gonna have like these nested blocks and loops and other stuff. And what this code is doing is it's basically doing like a while loop where it updates the position. And then it's checking to see if the position kind of got too far to, you know, too high up. And then it's like flipping the direction and it's like making it come back down. In order to make that work, I need to add a few more instructions to the machine. Let me do that real quick. It turns out you can't do like if statements if you don't have things like conditionals, like relations. So you have to have like less than and greater than and other things here. So I'm gonna add a few little instructions here, like less than or equal to, greater than or equal to, like that. And if this is working, famous, famous last words, I should be able to run the machine and let me, okay, undefined variable. Okay, that's interesting. Oh, I think I didn't get my, I didn't get my machine set up here. Okay. Okay, let's try this here. Okay. You have to pass the local variables. Okay, a little bit of live debugging here. Okay. Oh, I know what that is. Okay. At least I think I know where it's, oh yeah, okay, sorry about that. Okay, so I need to pass the locals there. Okay, so let's try this thing. Okay, so now you see the thing like generates like a whole bunch of stuff kind of happened there.  It happened fairly fast. I mean, I'm not really sure if it's giving the right answer, but you see the thing kind of cycling through instructions. Now the problem with this is that it's not, okay, so we've got like most of the makings of a machine, but it's a little bit hard to see it do anything. Like one of the things that I'm kind of missing is any kind of output from this machine, like any kind of display or anything like that. And in order to do that, maybe it would be useful to have like a Python function like that basically displays like a player or something. I mean, we're like drawing something on the screen. Maybe we want something like that. Maybe I'll put a little time delay on it just to like slow it down a little bit. Okay, do that. And maybe I want to have that something that I could, like can I execute that in my little simulated machine? This is some way to do that. And maybe there's a way I could have like an import function. This is an idea of having like an external function. It's not written in the machine. It's like embedding something externally. Can I have like display player to be like this import function of some kind? And can I have that in my function table or something? Now, can I extend my machine to do that? And maybe I even put like some, like a little extra instruction in there to do that. Maybe load X and then call this function to display. Okay, so you're gonna, maybe you want like a little import function like that. Turns out that that is not too hard to do. I can take the existing function thing that I just wrote, maybe give it like, give it something that you're calling, like have it like an import function. And then I'll just make the machine kind of look for it. Maybe here I'll check, if the function is like a normal function, then I'll do this thing that I had before. Okay, so there's the kind of the normal thing. And then if it's not the normal thing, what I will do is just get the result. Oh, hold on a second here. Okay, let me, yeah, if it returns, I'll do that. And then if it's not the normal thing, what I'll do is I'll just return the value of calling that external thing, import function. Okay, so I've got this like the little switch and hopefully if this is working, I will see like the output. Now it's real messy. I don't know whether you're gonna be able to see that, like with everything going on, but there's like a little thing kind of moving across like the bottom, like bottom of that. So it kind of went left and right and so forth. Now, you can look at this. Now as a kid, I was like, ah, this is awesome. You know, I was like, I don't even have the field of dots. And I'm already like super excited about my machine language game. But what happens is somebody will look at that now and they're just like, nah, you know, like my kids, like dad, this game is terrible. Like what are you doing?  You know, it's okay. So we want rocket game and so let me talk about rocket game for a second. First of all, this is not my creation. The link is up on the web there. And this is kind of a brave new thing. Rocket game is using web assembly. How many people have used like web, and have like either played with web assembly or know what it is and like two hands, okay? It's a web assembly. Now the fact that it has web in the name already like scares me off. I was like, oh, wow, no, okay. And then the other interesting thing is that rocket game is written in Rust. So the game is written in Rust. It's running on web assembly and it's in the browser and I kind of, you know, you look at that and I sort of realized that the web programming class where I learned CGI programming is just not, that is really not what's happening here, right? I mean, I don't even, it's hard for me to even like comprehend like what is going on with like Rust and web assembly, what is going on with that? And there's, and you might be inclined to just like, look at that, it's like, it's, you know, I'm sorry, it's just game over, Python.    And so what I'm gonna try to do, I'm looking at the timer and I get some time. I guess the question is, is my time up on this thing? And so what I'm going to do or attempt to do is run that Rust program inside the interpreter that I just wrote because the thing that I just wrote actually is a web assembly interpreter. You didn't know where I was going with that, but this code is capable of running web assembly. So let me talk a little bit about like this setup here. So here's the problem, we're gonna, the clock is racing, the clock is, so web assembly looks like that. There's a program called program.wasm. I did not write this. This is compiled from Rust. It is a binary file. That game that you were looking at, Rocket Game is an HTML document with some JavaScript and it's a mix of JavaScript and web assembly. So this is kind of the thing that we're gonna try to do. And it turns out that this machine that I wrote can execute web assembly. Now, in order to do that, I have to make some changes to it. They're not huge changes, but let's talk about the changes. One of the changes that happens with web assembly is that web assembly is a very tiny, like abstract CPU, and it only understands four data types. Instant floats, 32 and 64 bits. I have imported these types from NumPy, mainly because doing so allows me to claim that this is a machine learning project. No, no, no. Yeah, it's, thank you. Some people were asking me, like, I don't know, we were having conversations with students and stuff, and they were like, I was like, oh, you should do stuff that makes people angry, and like doing something, like claiming that this is a machine learning project by importing NumPy is one way to do that. Okay, so, and I'm gonna put like an assertion on the stack push operation to assert that those are literally the only things that are allowed in the system.  So, web assembly is, it's a little emulated CPU, and it only has four data types. The other thing that you're gonna have is it has a richer set of instructions. So, it has some instructions for creating constants. This is like the const thing that I had before. It has instructions for binary operations. These are things like add and subtract and multiply and divide and so forth. I have defined these as just a big table, essentially, of lambda function. There's nothing really magical going on here, just I'm trying to do it in a compact way. Okay, so there's a lot of binary operations. There are some unary operations. These are things like square root calculations, comparisons, and so forth. That is not a complete list, but it's some of them. So, you have some unary operations. You have some operations for loading from memory. So, it turns out that web assembly has these four data types, like ints, floats, and of different sizes. It has some different options for reading memory and different configuration. Okay, so I have some loads and stores, and it has store operation. Okay, so, mostly what I'm doing here is just inserting tables of like short little function. And the code that I wrote can be modified to work with that. The way that it's going to modify is that instead of me with my little minimal set of instructions here, I'm gonna check for some table lookups. And I'm just gonna dispatch off operations. Like, you know, if the op is a const thing, then I look up the conversion and I convert a value. If the operation is a binary operation like that, I'm gonna keep the code the same, but instead of doing like hard wiring it like that, I'll look up the operation and then pass it some argument. If the op is in unary, I didn't have any unary operations in the other thing, but like what you'll do there is push in like, you know, unary op, self-pop. Okay, so I'm kind of going through like by machine and just, you know, filling out some stuff. Do I have a typo there? I do have a typo there, okay. I heard the rumble that time, I was a little... Okay, good, good, very good, okay. And then, you know, you'd have an operation in like, you know, in the load table. If it's in the load, this is gonna be, I'm gonna do this in kind of a strange way. I'm gonna basically do load op and I'm just gonna pass it like a chunk of memory. Now, this is a total hack. Because there's nothing bigger than a 64-bit value, so I'm just gonna pass in like eight bytes and like see what happens. Oh, also the other thing with a load is they do introduce an offset. WebAssembly has like an address plus an offset, so I'm gonna introduce that. Store is gonna be kind of the same thing. Okay, so if you're in store, I'll pop a value. There's an offset that goes with that. Okay, that's an added offset. Am I missing something here? Yeah. Oh, oh, yeah, yeah, yeah, yeah, okay, yeah. That would be bad. I would be sitting here debugging. I've had like nightmares about this talk. Like if it goes wrong, it goes wrong really badly and it's kind of, okay, so you have like store operation. Turns out that there's a couple of other memory operations that are in the system. There's a size operation that just tells it like how much memory you have. And it's reported in 64K pages. So you have an instruction like that. There's also a memory grow operation. WebAssembly is actually kind of interesting, by the way. It treats memory literally as a big byte array. And what you do is you just kind of grow it and shrink it. I mean, you might be looking at this saying, there's no way, like that's like, like how can it be like so minimal like that? But like there's like a memory grow thing. We're gonna keep the locals the same. There is one extra little operation with locals called a T operation where you pull off like an item off the stack without consuming it. Okay, so you have that. And there's a few other additional little stack operations. There's a drop where you just pop something off and forget about it. And then there's also a select operation which is kind of the like the ternary operation, like a conditional kind of thing like that. I'm gonna keep function calls the same. I'm gonna keep my breaks the same. All that's gonna say the same. The block stuff is gonna stay the same. Actually, one thing with the blocks is they introduce a block type. I'm gonna ignore that, but it changes the offset that I'm using there. Okay, block type. And I think I'm basically more or less done with that. Actually, there's one other instruction that enters the picture. There is basically a tabled break instruction where you give it like a table of indexes along with a default. That is something that is used to implement break, like a switch statements. So there is a like a feature for that. You should be greatly disturbed by the lack of testing on this. This is awful lot of a lot of a lot of code. Okay, so we've kind of kind of gone through and modified it a little bit, but not a lot of changes. Now the claim is that that could run the rocket game. It could run the Rust program. Okay, now in order to in order to do that, we do still have this kind of problem of what like, okay, that's what WebAssembly looks like. How do I turn that into this game? Like how can I make Python work with that? Okay, so it turns out that that format is very easy to decode. It's like WebAssembly is actually really cool because they've actually rethought the whole concept of a DLL that might sound scary. Like if you know about DLLs, it's like, oh, good God, like no, like what are you doing? Like they've kind of rethought the whole concept of a DLL and decided like, what would we really like to have in there? So I've written a library to this is WebAssembly decoder. This is just in the full interest of disclosure. I wrote this, I'm incorporating it by reference because I don't have time to talk about it. But the way that you can work with this is you can basically just say, okay, I want to parse like a WebAssembly module and just grab this program, programmed out wasm. Okay, just kind of open it up and read it.  Let me kind of show you what's in there. Okay, so I'm just gonna run that. Some of the stuff that's in the module is there's a whole bunch of information about type signatures. This might be a little hard to read, but it's like a big table telling me all of the type signatures of all functions in the module. This is already awesome. Like one of my early things in Python was writing the SWIG utility to do C extensions for Python. And one of the big complexities with that is that C libraries do not encode type signatures. They're not in there. Like if you make like a DLL or something that there's no type signatures in the DLL. And you're like, well, where are they? They're in the C header file. That's where they are. And like so I have to go write this whole parser to do C header files. And it's horrible and like it's horrible. WebAssembly right away, all the type signatures are there. Some other stuff that's really interesting about WebAssembly, it will tell you what needs to be imported. These are basically functions that are defined outside of WebAssembly and they have to be provided by like Python or JavaScript. It's kind of like that display player thing that I had. That's what's going on there. It has information about what is exported. And you have to type it right. Okay, then that's, it will tell you like what functions are defined in there that it's exporting to you. This is the kind of thing that I was again was like doing like the SWIG project.  Well, here are the functions. It tells me the functions right there that it's like that it's exporting to the environment. It has code.  Like, that's not a very interesting one here. Okay, like, let me just kind of pull off some code. Okay, so there's like a fragment of code. You're like, well, that's not very readable, but it turns out to be very easy to parse that. You can say, you know, let's parse code. And then all of a sudden it turns into this like machine code that I just wrote. So these WASM modules, they basically, they have all sorts of cool stuff in there. It's like, you know, all the imports, all the exports, all the functions, all the code. And I'm going to use that. That's basically going to be the basis of my little web assembly encoder here. So one thing that I can do is build like the imported functions. I'm not going to totally type that in because I knew it would take a little bit of time, but essentially like the imported functions are things that have to be implemented in Python. Or JavaScript actually. It's just like what functions does it not know about? And so you're seeing some math functions here. You're seeing some things with like gameplay, like clear the screen, draw a bullet, draw enemy and so forth. Those are basically going to go into like a big imported functions table. This is exactly the thing that I did with the player thing. You know, I had like the imported function. I will have to import machine to do that. What I can do after that is I can declare all of the defined function. These are basically functions that are in web assembly. Like what I'm going to do here is I'm going to turn those into the functions that I did in my little hack this morning. You know, like before that it was just like, it's like, oh, okay, let's make a list of defined functions. What I'm going to do for this is you get a type index and a block of code. This is just giving you kind of an idea of what it looks like. Okay, so I'm going to take kind of two pieces of information here from the module. I'm going to look up the type signature based on that first value there. Okay, so this is looking up the signature. And again, this is the thing that's missing from like DLLs, like not having the signatures. This is awesome, I got the signature. And then I'm going to make a function. Okay, here's my machine function object. The number of parameters is going to be the length of the parameters of this thing. And then I'm going to, if it returns something, I'm going to just do a bull check on that. And then for the code, I'm going to parse the code, wadsy parse code, code instruction. Okay, so I'm going to make a function. I'll pen that. I'm going to make like a complete function table here. So I'm going to have all my imported functions plus all of my defined functions. Okay, so you're going to do that. So now, so what I'm doing is I'm kind of making like, okay, this is all the functions that are in this module. I have the Python ones that are kind of the, you know, they draw enemy and draw particle and stuff. And then this thing is basically all the, this is all the Rust code that I just did there. Okay, so whatever that Rust thing was, it's turned into my function objects. Now what I'm going to do is I'm going to get all the exported functions. Okay, declare exported functions. Do I have a typo in something here? Yes. Where? A typo. Yeah, yeah, yeah.  Okay, so I'm going to make like an export table. This is maybe a little, little strange, but what I'm doing here is kind of going through the module exports. And then if they're function exports, I'm going to make a little table here. So what that is doing is it's kind of just setting up like everything that is coming out to me. And at this point, you're kind of ready to start making the machine, basically. I'm going to say, okay, make the machine with my functions. I'll give it some memory. Admittedly, that's a bit of a hack on the memory. I'm just saying, well, I'll give it like, you know, 20 times 64K for memory there. The file actually does indicate how much memory is needed, but I just don't want to deal with it. Okay, so make a machine, make some memory. It turns out that there's a step of initializing memory that you have to deal with. And that is also something that's in that web assembly module. There's like a little data section in there that sort of has like initialization kinds of things. So the way that I'm going to do that is I'm basically going to execute instructions to compute an offset. I'm actually going to use my machine for that. And then I'm going to go into the machine and set up some memory. Okay, initialize memory. Now, once we've done that, call something and live dangerously. Okay, now I'm absolutely terrified of this step here. So this game involves like a kind of a game board. Maybe there's a width and a height for instance. So they have to have some data types. Those types are coming from the type signatures. I'm not showing you that, but it's part of the exports. Let me just import the types here. What I should be able to do is basically just call like the export table and pass it in the width and the height and basically have some kind of prayer that this is like going to work basically. Okay, so what is happening is that that is going to try to call this, there's a resize function in Rust. That's written in Rust by the way. And we're just going to see if it works. I mean, if this works, this will be a miracle, but we'll see if it works. Positional follows keyword argument. Oh, well, okay, that's not, okay, we can fix that. I think I, come on Python, you're supposed to let me break the rules there. Okay, so let's try it. Is instance, okay, a few little bugs here in the code. It's not, at least it's not in the machine yet. Okay, let's try that. Oh no, oh no, worst fears. You're realized here, const ops args. Oh, in, in, in, okay, no, okay, I see it, yeah, okay. I think like the, it was the is operator, like not is, that there's a very different, definite distinction between is and in there, okay. Okay, so the thing is, okay, so I don't know what that did, but it didn't crash, okay, so I'm like, I'm only going to have like a two minute, two minute, I'm looking at like one minute, one minute 50 seconds on a timer here, okay, so it didn't crash. The lack of tests should be very disturbing on that, and essentially what you can do from here is like, well maybe we should just, maybe we should just have like a game loop at this point. I mean, why not, let's just go for the game loop. So it turns out that this rocket game, the way that it works is that you record kind of a time, and then the game loop records like the current time and calculates a delta, like what is now minus last, and then what it does is you call like exports on a, like an update function.  And keep in mind, those functions are written in Rust. I mean, they were written in Rust, they've compiled a WebAssembly, I'm calling them just kind of blind from Python, let's see what happens. Okay, so the thing is it's looping, I'm not sure what it's doing exactly, but it's not crash, I think the key thing is it's not crashing, that's probably the key part of that. Now, to see what it's doing a little bit better, I might go to my machine and turn off the print statement. I mean, a lot of the output there is coming from the print statement, so let me just comment that out, and then try this again here. Okay, so now what you're seeing is it's like, it's actually calling those Python functions, the import, these are the import functions, right? It's like, huh, okay, draw particle, draw NME, so forth. Maybe what I would really like to do is something a bit more interesting with those. Okay, let me come up here. It's like, those are not so interesting, maybe a more interesting thing to do would be to pump them over to Pygame. This is what kids like to play with in school and stuff. So I'm gonna load up Pygame. I've just re-implemented some of the functions in Pygame, so instead of printing, I'm drawing circles and circles and stuff. So doing the same, just replacing those functions. Okay, let's replace it with Pygame. If you're gonna do it with Pygame, there's a few things you need to do in the event loop here. You have to do a little bit of event handling. Let's just ignore that for now. And you also have to do a display flip. The way that Pygame works is you draw and then you flip the display. So let's put that in there. I don't know, let's see if that does anything. Okay, so now I don't have any way to play the game. So I didn't put any keybindings into the game. So that is something that you can do with, that's not easy, or that's not hard to do, but basically what I'll do is just check for some different keys. And I'm calling more Rust functions. There's some functions in there to toggle shooting and turn left and so forth. I'm just gonna add that in there. And then let's try play in the game again. Okay, so now what's happening is this thing is running in Python and I can basically fly around and shoot then. Just to be clear on what has happened here, I mean this is a Rust program running in a horrible interpreter in Python. Like don't, don't, don't, don't use it. I mean the whole thing is just running as this interpreted stack machine in Python, using Pygame, but the software for it is this Rust thing on the back end. There's part of me that just wants to say, borrow that Rust, you know, but, you know, sorry Rust, you're fine, you're fine. I don't want to start language war in the Python Tucker. But you look at that and it's like, that is sort of awesome in a way. And it kind of brings me, it kind of brings me to this, you know, this like future of Python. I hear people talk about, oh, what is Python's future? And like, it doesn't have a web assembly story and like what's going on with the types and all this, all this stuff. And I think like the only thing that I would throw out there is that this web assembly stuff is not well known, but it is super cool. Like if you were looking for something like weird, crazy project to work on that's like really kind of interesting. Look at the, I mean, here's the thing that's so amazing about web assembly. It almost has nothing to do with web programming in any kind of conventional sense, right? I mean, it's like web assembly is that, is that emulated machine. It's like a target for, you know, for like Rust and for C++ and C. And like you can compile stuff to it and you can make extension modules with it. And yeah, you can run it in the browser if you want, but you don't have to run it in the browser. I mean, there's actually a lot of kind of projects sort of going on right now that are, you know, that are sort of very interesting. I would have you look at it. One thing that I think was kind of a big inspiration on this talk is actually Omar Klein's talk from EuroPython. He actually did something with the same game. So he did something with Rocket, but also running like WASM in Python, but he was doing like some AI, like he wrote an AI to play the game where you have like a C program compiled a web assembly playing against the Rust program in web assembly, like compiled in separate modules and he had like some other stuff. So that was really cool. There's this PyOdide project, which is somewhat recent, which is like the complete Python scientific stack running in web assembly in the browser. There's this PPCI, I think it's pure Python compiler project, has some WASM support. This WASM or project, this is like a web assembly runtime that is not part of the web. It's actually like a standalone library.  So I think the thing that I would just kind of leave you with in the talk is like, this is like an area that it just seems really wild and really kind of awesome and like an opportunity for just doing really neat fun stuff. And I've met a lot of like students at the conference and stuff who are like, oh Dave, what should I work on? Or what should I be doing? This is definitely something cool that I think could be worked out. There's a lot of interesting possibilities. And just by doing it, it was kind of maybe just kind of jump that hurdle of like wait, maybe it's not that complicated. That's kind of a very interesting thing. So that's the end of the talk. Maybe we went a little bit over, but thank you for, I've actually had a great time at this conference.


Hey guys, Ryan here for movie nerds. I'm going to talk all things about the Predator.  And I'm going to talk about what didn't work, what did work, and probably everything in the middle. The first two acts of this film were almost, almost flawless. Had great comedy, great actors, great ensemble cast. The Predator looked awesome. It was modern and it was futuristic. And the gore and the action at the start of the film, especially when they were at the lab sequence, was unbelievable. Predator ripping off heads, gushing out like jaws and stuff. Everything you could possibly want from a Predator film. And then they started heading over to Suburbia. And I thought that's where the movie would start going downward. But it was fine. It was good. I was enjoying it. I was like, why are all these reviewers giving this film bad reviews? How could they possibly not enjoy this? Ah, but then we start heading into the third act. And that's where things started going downhill. Things didn't connect. They were doing things that weren't even a part of the first or second act. Like, nothing connected. Everything fell apart. Why were we here in this sequence? Why were these characters doing this? What happened to the storyline of this movie? And I think it all comes down to a preview screening earlier before the film. There was a preview screening where people had watched the earlier cut of the film and it was believed to be poorly received. And so that got the studio worried. That got 20th Century Fox worried.  Let's grab the entire cast back and let's reshoot the ending and give it a whole new ending. And the ending, I don't know what to say about it. It's clearly different than what we were going to get. Rumors had it that the ending was gonna be set at Area 51 in Roswell and we're gonna get a team up of predators and humans fighting this super predator. Now pictures were leaked about this and it showed off what could have potentially been a really different outcome for this movie. I don't know if it was gonna be better but judging by the first two acts of the film that were actually quite good.  And of course it would have been completely different than what anybody would have expected being that it would have been predators and humans teaming up against a super predator but anything I think would have been better than the ending we've got of this film. But you know, at all and all, the movie I don't think was terrible. I think the first act and the second act were awesome. I had a really good time with them. The action was unreal. The gore and stuff like that, as I said, it was awesome. But it was the third act, yeah, it just fell apart for me and I just feel like studios need to stick by their guns and believe in their directors and believe in the movie that they're trying to create because you've hired them for a reason and Shane Black now is gonna be tarnished because of this and you've tarnished this director because you've decided that the studio, what I'm talking about is they has decided that they don't believe in his craft, they don't believe in his work and now they're gonna force him to make this abysmal third act of a film which is getting horribly reviewed and for the next movie he's gonna make, he's either not gonna get as big a budget, he's not gonna get as big of a blockbuster or he might not even get another movie because the nice guys didn't really work out for him. Iron Man 3 didn't really work out for him and now the Predators hasn't worked out for him. So where does that leave Shane Black? Probably not in a good place. So what I'm trying to say is 20th Century Fox, you're getting bought out by Disney, you could have done anything with this movie, it wouldn't have mattered because it was gonna be your final film anyway. So why did this have to happen? I don't bloody know, I've got no answers for it.  So yeah, what do you guys think about it? I'd love to know what you guys thought of Predator, if you liked the ending, if you would have preferred this new ending that I talked about or if you just would have liked something completely different. I mean, there was also another rumor saying that Arnold Schwarzenegger could have appeared at the end, which would have been awesome. I mean, I love Arnold Schwarzenegger obviously but at the end of the day, that probably wasn't gonna happen because Arnie's Arnie, why would you wanna put Arnie in a film and just have a minute for five minutes? But, could have happened. But yeah, let me know in the comments, I wanna know what you guys think because this is gonna be talked about and until next time, I'll catch you in the next episode of The Movies.


OK, zato povedaj, Hakeem Berengar, z njegovosti o internetnih vse. Thank you very much. Good afternoon. I hope you like the presentation. We are going to talk, as he said, from internet of things that gives you a better idea of what's going on there.  You could see here, by 2020, more than 25 million apps is going to be there. Well, it's difficult to have in four years so many applications, but OK, that's what they said. But in case that's not true, what is going to be true is that the revenue opportunity there is huge. And the decimage of data that are going to be managed is going to be huge as well. As you could see here, the reports that all these sensors are going to send to be stored will be huge because the number of sensors around are going to be also huge. So, new analytic engines are going to be needed because to reflect the good feedback to the control against sensors send right information to the data source. In order to go ahead with this, I have implemented something regarding a server that manages those kind of devices. We'll see the environment, the architecture, the server functionality, some security that is needed. What type of IoT devices could be used here, what kind of access from mobile and desktop devices could be sent and what even alarm sensors and actuators and what I think about the future about this. Environment is Python 351 for the devices that are accessing the server, it's not there, it's 3.4, but the server actually is based on threading and queues. They share nothing, they communicate each other using queues. The database being used is MySQL and MySQL connector comes from Oracle and some personal lives that are going to be used as well for MySQL and for managing USB or general functions. Everything is running in Ubuntu 16. This architecture that is actually up and running, when any of these devices in this part are powered on, what they need to do is to register themselves into the server. So they send a message to the server, well, here I am, my name is that, whatever. If this is okay, if this is a right device, register it in MySQL database, and then the day I get the server adapts a new thread for this device. If not, the thread is terminated and is rejected in the communication. So is what any of these devices, it doesn't matter where they are using Wi-Fi, is what they need to do. We will see later what kind of devices are those. On the other hand, Kivi as is in the text that you have already in the schedule in the task application, which is better, are using socket IO, that means we are going to, because we need a persistent connection, we are going to use socket IO web sockets and any web browser that supports web sockets is going to be valid. So any of these devices are going to connect also to the MySQL database using a password. When that's done, they are ready to send messages to any of these devices below. In order to have an idea of what's going on, we have here a small application that supports that. We have a small that. And then we have here online, we have extracted what kind of devices are connected to the server. We could use this one and we could know all these kind of functions that really are now a possibility to have in those devices. We could say, OK, we want to know temperature pressure or humidity on that device, we send to the server and give us what kind of measurement these devices is having it. So this is the way that's happening. So we have connected using user and password. We have a persistent connection that will be valid for the rest of the presentation and all these devices are ready to answer any message that we are going to send. As I have said, the front end is a flash application as socket.io. The messages and to and from modules are executed using this socket.io 1.4. And to send messages from the devices to the application, to the flash application we are using socket.io client in Python. As we can see here. And how is this going? In part of the web browser we define a number of messages for connection, for example. And this JavaScript is sent and at the end of the day what we are going to execute is a function in Python that receives the message, which is the message containing origin, and what type of function we want to execute. And once it's in the environment of Python we execute everything that we want. Just defining the naming of the message and the naming space. Inside the server what we have is that every time a server is waiting for connections from the IoT device once to be connected what we start is a thread socket, a thread queue and those are blocked waiting for the message. They are doing nothing. In the future I think I think I could be better by the moment is running on threads taking into account that those threads are corresponding to one customer and every customer will have their own server. So this could be now but I think I will try to make it happen as well. So the parameters to define a device at the end of the day is we need to know what kind of device, the idea of the device, the serial number, the server name and the server port. With these five that are stored in each of the IoT devices the first thing they are going to do is using server name and port connect to the port of that server and the server using type of device, ID and serial number will know if there is a good IoT device to be connected. Three types of devices are happening here. We are going to have MKR1000, we see later that will use flash memory or EMCC with black bone or SD card with raspberry. The serial number by definition is never sent through the network in order to have more security. We will see later how this is going to happen. In different servers the only thing that have is connect, change the port and we will have another server useful for other devices that are going to be connected. Actually the server name is probably using no IP. The message format always have three fields that mandatory, which is origin, destination and message type as we have seen here in the application. The origin is this web browser, destination is disconnected module and the type of message that we want to send is this one. The rest of the fields that depends on the message, we will have parameters on there in variable length and we will finish with EOT. Security is used using SHA256. We are using Haslip SHA256 in Python and in C implementation for MKR1000, because need to be in C we are using Atmel documentation and there is SHA256. Devices are grouped by customer. So only IOT devices from one customer could talk with those around. So inside the server what we have is an origin thread that is sending to the key of the destination. From the key of the destination goes to the device, the device execute the function and come back with the results, who goes to the origin queue and from there to the destination. We could again send the we are sending this from this origin to the destination we want to have well, we could read we could read the gyroscope of the device and then it's accumulating here what's going on. But the system is always the same using queues and thread and sending the message. So we are going to define devices, low consumption and we have here example of device. This is the size of this device is nearly nothing and this is the battery that we could attach to this and with this we could have we could have it on your dress and with that you will have the possibility to do anything that you want because you could connect this device to your phone as an access point and from there goes the information to anywhere. So here we have here wifi and we have oh, okay. Right, so with this we have low consumption, 2-3 weeks we could have with this, we have a lipo a lipo so. The wifi range that these devices have is more or less the same as a laptop. In one laptop arrives to 100 meters this could be the same or more. You have here the calculations if you like to have more information. The wifi most normal thing is this is a client, a station but also could be used to have a range extension used as well as an access point and that mean that we could connect one with the other and extend the range because we could resend the message to the following one. These are the advanced modules that have been used so all of them are Linux embedded most of them are Debian and these we using here also a Python. Raspberry B is about 45 we could use OpenCV in this case is more because the information or documentation is not good enough and the contract you could have with Raspberry is not all limited permissions you have there, media and education is where we could apply it. PCDuin is good for also has Ubuntu inside, Ubuntu embedded board we use 3.4 Python and is good for the ones who have already things done with Arduino and for me the favor is this one, big or long green wireless is about 44 there is a lot of documentation Texas instrument CPU with Debian or Ubuntu is the one you want and is good for inducing environments and also commercial products because you have any kind of protocols communication is this one here. The mobile and desktop devices the only thing that is needed is that a web browser that supports WebSocket because we need, as I have said a persistent connection we have that using Flask and ShockDio and that's alarms and events so we need alarms from the devices in order to send us directly messages if a temperature is above or below a number but also we could schedule events that in our case will appear in the text area below we use this event and we send this message what usually should happen is that the device is sending us events that will appear here downstairs in this area so any several seconds in this demo are going to be in this text area downstairs but also are registered in the database so we are producing information from every one of the devices that we have in front of us and they are producing information that we are going to analyze or treat in any manner if we send the same event again we stop sending us more events and that's the way how we generate alarms and events sensors we can have seen here any kind of sensors it depends on you which ones because it's above any kind of application and sensors could be used in the case of actuators what we name an actuator is everything that we have is applied from the device to the environment as a matter of example we could again go to the application and use also this camera that this is a raspberry you see is about 5 or 6 cm by 6 cm and we have here 64 let's say leds or lamps because the only thing we want to do is provide there we could write pixel we say ok we want to write pixel number 26 and we send and here we have we have the color we could say ok blue or whatever and when we have send this pixel pixel number whatever we have said is on letters or we could send messages as well so any kind of possibilities are on top of what in green or so this is what we could do with writing and any kind of send a message that writes goes in that direction in the future again software is the most important or python extension of python using c is and many applications going to develop around this products products like civilly or from log in log main think speak or Azure from Microsoft are good examples of what's going on in this area hardware will continue to integrate more parts of the application decreasing price and size wearables are there and we have seen them and the industry will take advantage as well of substituting the actual solutions that are in the market ok that's all thank you does anyone have any question ok so if nobody has a question then let's thank you again here in kidscap.bb you have the condition from here thank you and goodbye


many of you would say that you're generally healthy? Good. Most of you. I'm happy to see that.  Okay, also most of you. How many of you have ever forgotten someone's name that you actually knew pretty well? Okay. So how do you know if that's normal or if you have early onset Alzheimer's? You don't, because we haven't spent enough time to quantify brain health to know if you need health care. In fact, we're ignoring the brain.  And tracking your brain health or cognitive health over time is critical if we want to detect a change if something happens, like a concussion, the depression, the onset of Alzheimer's. Why don't we quantify the brain? Well, what I want to argue today is that we need a shift from diagnosis and treatment to wellness and prevention and that we have the data to do it. So let's talk about data. You've all heard of the Internet of Things and generally we think about machines and devices connecting to each other, but it's actually an Internet of Things and people. And we're continually generating data both through actively interacting with our environment as well as through passive monitoring. Between my cell phone and my wearables, I generate more data in a day than my doctor sees in a year. And the future of the Internet of Things is going to add more and more data that we can use to quantify healthy. For example, we already have devices that we can use to control and monitor our home environment. And the advances in AI and robotics are going to allow a smart home of the future with scenarios such as the following. So your refrigerator of the future might sense that you're low on milk, send a message to the store, a robot delivers your milk, and directly to your refrigerator. You think a human's out of the loop, but we actually have really interesting data on your behavior.  A lot of data that can be used to quantify healthy. So I want to move away from data for a moment and talk about the cost of ignoring your brain. Non-communicable diseases are responsible for 60% of deaths worldwide. This includes cancer, diabetes, cardiovascular disease, and mental illness. And these diseases will cost us $47 trillion by 2030. This is about as much as the US, European, and China economies combined. And all of these non-communicable diseases affect your brain and cognitive health, whether directly like depression or dementia, or indirectly through medication or the long-term effects of chronic disease. But I want to focus on dementia for a moment. 44 million people worldwide have dementia, and one in three people over 60 die with dementia. And by 2030, 75 million people will have dementia if we do nothing. There's also a second cost to ignoring our brain, the second victim of long-term chronic disease, the caregivers. There are 66 million unpaid caregivers in the US alone. The value of their care is $522 billion per year. This is more than the amount of paid care. It's also almost as much as the United States government spends on Medicare, the care for our elderly. So we invited caregivers to a website that we created called the Healthy Brain Study, because caregivers are also at high risk for mental illness and depression and other brain and behavioral issues. And so we suspected, even though they say that they're healthy just like we did, that probably, compared to the general population, they might not be as healthy as they think they are. So we had a thousand people come to the website and take a cognitive, computerized cognitive test, and the results were sobering. Sure enough, these healthy caregivers, when compared with matched controls, had cognitive impairment. So what do we do? Do we wait till they report themselves as sick so that they can be diagnosed and treated? Or do we make that shift and focus on health, not health care? So how do we do that? Well, I want to end by telling you about a digital health tool that we developed for the military to measure brain and cognitive health. The military normally only assesses the cognitive health of the soldier if they suspect that a concussion may have occurred. The problem is that all of our deployed men and women are exposed to conditions that can affect your brain health, such as combat fatigue and stress, or even depression and PTSD. So we designed a mobile, a medical app that allows medics to track soldiers' brain health over time, and not just when an injury occurs. So what does the future of brain health look like?  What if we used all of the data generated by the Internet of Things to quantify healthy aging? What if we provided tools to those who are at risk for dementia, tools for them to manage their own brain health so that one in three of us don't die with dementia? We can all define healthy together. Thank you.