I have left instructions that we do not want to hear that any of this killings or mails or violence continues and I'm sure that the heads of security who are here have taken that very seriously and intend to ensure that there is peace and that there is security. Of course this is in the short term in the middle to the long term we're looking at more permanent solutions to the problems of insecurity and we've discussed several of those issues. Fortunately we've had very very robust discussions from all of the community leaders and they have made their suggestions. We will look at how to implement several of those suggestions as we go along. Some include the permanent positioning of security agencies in certain communities that are prone to these types of violence and we intend certainly to look at that request and to see how we can put in place permanent security especially police and in some cases military deployments in some of those places where violence tends to, where flashpoints tend to be on a frequent basis and where we've agreed to some locations where these security deployments ought to be made. I think also we have looked at issues surrounding the not just the recent killings but also the killings that are taking place and some of the conflicts that are taking place in the past. One of the critical issues that was raised is the fact that there are people who have been dislocated from their villages and from their homesteads and who have not returned to those villages and homesteads and those villages and homesteads haven't taken over. I think that that is a very serious issue and it's an issue that the federal government in collaboration with the state government must take up and which we will ensure that we take up. I think a very important point that has also emerged from our discussions is that a lot of the crises are not a year old or two years old. Many of these crises are dated, they are, many of them are almost historical in terms of the number of years that they have continued to manifest themselves. Some, you know, have been 10 years ago, some even much earlier than 10 years ago and I think one of the most important issues that we need to resolve is that we cannot continue having this continuous cycle of killings and this continuous cycle of violence. And I think a point that was made very well made by the government of KPQ is that we must all condemn killings of any kind. And it doesn't matter whether these killings are by herdsmen, killing villagers or whether it is villagers who in one way or the other have killed others, including herdsmen. I think it's important that we condemn these killings. In particular, the killings that have taken place where so many people have lost their lives in past few days which have been attributed to herdsmen. They are condemnable killings.  We will make sure, we will make sure that and the major general or the head of the operation save him as well as the, as well as DIG Habila have confirmed to me that some arrests have been made and those persons will face the law but that other arrests will be made. I think it's important and that we ensure that justice, those who have been killed cannot just be killed and will allow that to just go by. It is not acceptable at all. It is our duty to make sure that these individuals are prosecuted and I want to be sure and I want you to be sure that we will do so. We will make sure that those who have been arrested duly are prosecuted and that others who are engaged in this kind of who are engaged in this heinous conduct are also arrested and prosecuted. Otherwise I think those are the main issues that we discussed except to say that it is our duty as leaders, as community leaders to ensure that we do not allow the situation where these cycles of violence continue. As I've said to the community leaders, issues like these are dealt with and resolved by men and not spirits. It is those of us who are alive and well today, those of us who are leaders, community leaders, leaders in the state government, local government, or federal government who must resolve these issues and we cannot shy away from resolving the issues. I would must be bold enough to be able to tell our communities that resolving these disputes, they give and take issue. They give and take issue. There is no zero sum here. So many losses, so many killings, so many deaths over time. But we must find the solution and the solution is in the types of sacrifices that leaders are prepared to make. Sometimes you may be unpopular with your community because you make some concessions. That is what leadership is about. The final point is with respect to relief materials. I think that we already, NEMA is here with me and they will be ensuring that relief materials are provided. The DG of NEMA will ensure that that is done. The materials are provided in the various areas where they are required. We've also talked about the 10 billion fund which the president approved for mainly for the rehabilitation of farms and farming communities. The farmers in particular, fortunately we have the chairman of the Food and Security Council, who is here with us, the vice chairman of the Food and Security Council, the governor of gaming. That fund is to enable farmers who have lost their, who have not been able to farm, or who have lost farmlands, who have been irritated and will provide for them inputs, will provide whatever assistance is required so that they can go back to their farms and go back to their farmlands. And this we're going to make available also here in Gladio State. Although those are the issues that have been talked about and we hope and pray that we'll see an end to these cycles of violence again just to express our sincere condolence to all of those who have lost farmlands and trends in this last spate of killings. And we pray that the Almighty God will console the families and the relations of those who have lost their lives. And we pray that we'll never see a repeat of these kinds of killings or these deaths. Thank you very much.


What's up everybody, Jason here for JaspiersCaseBrace.com. We're giving away one Eminence basketball spot away with this 2019-20 Panini Mosaic basketball hobby, one pack break, 373. So again you guys, 30 total spots, first we're gonna do the break, right on my customer names, teams distribute the hits out of the hobby pack here. Then at the end we're gonna take all 30 customer names and randomize them. And the top name in the spot, well we'll win the spot, sorry, in Eminence basketball random hit break. So it's just between two customers guys, Alan got three last night and then George got the last 27. So between both of those customers, good luck guys. Obviously odds will be in favor for one, but hey, all it takes is one, you never know. But I'm gonna have to break someone's heart, or at least round the door, it's not me. So we have a nice roll here for names, teams, then at the end we'll randomize the names again and we'll give away the Eminence spot. So here we go, let's roll, six into three nine times, good luck. One, two, three, four, five, six, seven, eight, nine. Nine times, six, three, nine, George, down to George at the bottom there. So again this is for the pack break first, nine times, one, two, three, four, five, six, seven, eight, nine. Bucks, down to the Grizzlies. Now again guys, stick to what you got of course, no trades. I know I'm nervous for you George, honestly I have a little knot in my stomach right now literally, but yeah. There's your teams there. All right, let's do the pack. Ooh, looks like we got an autograph and it's Jared Colver autograph there for the Minnesota Timberwolves, which is going to George. So you got an autograph there. Get a Yolkish swagger. All right guys, let's do this. Good luck guys. Here we go. Six times, six times, five in a one, one, two, three, four, five, and six the final time. Boom. All right, I'm officially really nervous. Five in a one, six. I do see one Alan here, so there's still technically two in the top 10 potentially. Oh man, okay, I think you got it George. That got me a little nervous there, but hey, you had the odds though, 27 to three. So there you go. So unfortunately Alan, you did make a little bit of a sweat. You did get into the top 10, but needed to be at number one. So there you go man. So I don't know if you wanted to do that, but I guess you saved a couple hundred dollars getting into their filler. Got a hit from the Pac-2 as well. Thank you though, man. Good luck. And I know you got a spot straight up already, so I mean if it would have went south, I would have said we'll make it up in the break, but ended up working on your favor, man. Congrats. All right guys, so yeah, there we go guys. Let's do eminence now coming up next in a separate video guys. Thanks.


I'll get the rest of you. Two. I'll get the rest of you. One. Two. I'll do it. Ninety-nine. Ninety-nine. I'll do it. Ninety-nine. Get set. And go. It's on you. And go. Well, fifteen. Fifteen. Fifteen. Fourteen. Two. Three. Four. What do you want? Two. Four. Four. Get set. Go. You got to pick it up. The whole way past the cone. Fifteen. One-seven.  One-two. One-three. Oh, you got to get that last thing.


Hi everyone, thanks for coming by. I'm gonna tell you the tale of two unlikely friends that are up there, and they are very much in love. I'm gonna talk about myself for a second here. My name is Katerina Fay, I'm an active open source contributor, I like tea a lot, and sometimes I play around with embedded hardware. I do some rust things who would have thought, so I was a contributor to, or I guess still am, a contributor to the CLI working group. I write too many crates, most of them are probably useless, but I've met a few people here who told me that one of them isn't, so that's pretty cool. And I'm a member of Berlin RS, which is an implementation group that's starting out to be, so we work on stuff together, we organize workshops, and little conferences, for example, a few weeks ago, we had a mini-con for about bind gen, which was pretty fun. So, before I really start talking about this, I wanna answer this simple question, why? As in, why would you do that? So, there are lots of, I have people who tell me that if you have to reach for FFI, your day has already basically gone wrong. And I think that's very wrong, I think there's very good reasons to use FFI between languages, to make languages talk to each other, and especially with Rust and Native Code, to embed Rust into said Native Code. I could probably, this could be its own talk, so I'm just gonna list a few up there, and if you find yourself in the situation where you wanna grab, where you wanna reach for an FFI interaction between C or C++ and Rust, just know that it's a valid thing to do, even though there's people on the internet who will tell you otherwise. But I realize that that's not really the only meaning of the word why, it's also why give this talk. So, about six months ago, I was working on a project and I wanted to do exactly this. And I encountered a lot of roadblocks and a lot of stumbled a lot. And Rust promises to be efficient in its C bindings. And I mean, I know what the people who wrote the website wrote ment with efficient, but when I have to do a lot of research and there's not a lot of documentation about it and basically all the knowledge that I get for this is from blog post, I wouldn't exactly call that workflow efficient. So, my hope was to engage people a bit more in documenting things, in experimenting with things, and building tools that are more publicized than what already exists, where everyone basically has to reinvent the wheel. So, the second thing I wanna get out the way before we really get started is I wanna talk about ABI's because a lot of people don't know this. ABI stands for application binary interface. And it's basically like an API, but for your linker or your compiler, it's not something that humans would ever interact with. It specifies how a function looks in memory. It specifies the way that data is laid out in memory, and depending on the ABI, you can make certain pieces of code talk to each other, whereas if the ABI is wrong, it won't link and it won't compile. In Rust, we use the extern keyword to, so this is a Rust talk after all, you will sometimes forget. In Rust, we'll use the extern keyword followed by a string to specify the ABI that we're using, for example, extern C. For structures and enums, we need to use the reprasee macro to tell the compiler that we want it to look like their C variants. Now, you might have noticed that's a string up there. There's other stuff that you can put in there. By default, it says extern Rust. You can put that in your code. It'll not change anything. You'll have made your code worse to read, but it's not gonna make a difference. There is a lot of different ABI's that you can target. Most of them are platform specific and usually you will just use extern C unless you're doing something super funky, at which point my hat's off and good luck. Rust doesn't have a stable ABI. So when Rust was made stable in 2015, that was a promise that code that you wrote one day would still work the other. And that promise extends pretty much to the language itself, so the syntactic features and the standard library. It does not, however, extend to the ABI. There is this issue by Steve Open, number 600, this that Rust might want to define an ABI at some point. Because this is also a talk about C++, there isn't one standardized C++ ABI. It always very much depends on the compiler that you're using and a lot of different things. This could be another 30 minute talk, so I'm just gonna gloss over this. There are certain things that are standardized, but most of them aren't. So when we deal, when we talk about the C ABI, there is no such thing as a C ABI because C never standardized or specified an ABI. What we mean instead is whatever platform that we're building on, and that is, and hopefully stable. So yeah, a little background on that. So let's get into some FFI. And I wanna do it the other way around when this talk is advertising first, because I think it demonstrates a lot of the same principles and it's a lot better documented. That's why I usually call it boring FFI. There is an entire chapter, or like a section in the Rust book about it. There's a lot of blog posts, and just generally if you wanna do this route, there's great tooling, and generally people know how to do it. So the way you go about using C code with Rust is by using externe functions that are declared as the ABI that you want to use. You need to wrap those function calls in unsafe because the compiler can't verify that they'll actually be there when you run. And you may have to make data compatible in a way that C can understand because Rust is smarter than C in this aspect. The work falls onto you with a bunch of stuff. So this would be an example. We have a function called reverse, and it takes a string and returns a string, or sorry, a constant character array. We call this function in an unsafe block, and you can see here we use the CSTR type to transform our string slice into something that C can then understand. In the reverse, like I've left the reverse, you would have to do the same thing. I didn't want to make the code example unnecessarily complicated. So there's two type, there's two modules in the standard library. One is OS raw and FFI, and both of them deal with transforming data into a form that C will understand. OS raw are primitives, whereas FFI are things like string that becomes a C string. It's an owned allocated string. There is STR, becomes CSTR, which is just a string slice. And then there's lots of primitives. So void and C becomes C void and et cetera. I'm not gonna go through all of them. When the documentation of this is really great, there's good examples in the standard library, so this is usually not an issue, how to transform data. Okay, so let's turn this around, and let's look at what you actually have to do to call some rust code from C. We use the same mechanism with the extern C as previously, except with a little difference, which you'll see in a second. You have to take data in a C form, so whatever data C provides, you then have to make rust compatible, not the other way around. But there's also a thing, you have to declare your functions as no-mangle, because the rust compiler mangles function names differently than a, say, GCC would expect. And as such, you need to declare them as no-mangle so that the C compiler that then links you in your application can actually find your functions. Usually, if you have function errors, it's probably because you forgot no-mangle. It's because I forgot no-mangle, at least. So this would be an example. So it's a function called reverse, it takes a string, returns a string. It's no-mangle, it's extern C. The implementation isn't really important right now. I wanted to do an example where, safely, reverse unicode, and there's a great crate for that, but the example ended up being half my slide and I just took it out because it's really not relevant. At this point, you will need a few more fields in your cargo tumble. So there is the lip section, which I don't usually use unless I'm doing this sort of stuff. You can give it a different name if you want it to be different from your normal crate name. And you also have to provide a crate type. Cdylib will generate a shared object file, whereas staticlib will create a statically compiled library, as the name might suggest. But something to keep in mind at this point is that cargo does not own your project. So cargo will build your Rust code, but it's not in charge of your actual application. That falls to whatever build system you're using with C or C++. I had a wonderful conversation over lunch about how wonderful the situation with C++ build systems are. So whatever you'll use in that regard, we'll have to understand how to link in a library that is generated by cargo. One thing, so in this example here, I'm using CMake. All of this code will be online after the conference so that you can go through it. One thing of note is the reverseo.h header in which we declare a function which you might recognize. So basically, every function that your Rust API exposes needs to then again be declared in a C header so that your C code can actually use it. Okay, so far so good. Calling this from C is then actually pretty simple. We include the reverseo header, we generate, like we use a very unicode greeting, and then we call our Rust code that will reverse this for us. And when we call it, we get that out. Funnily enough, the creator was using couldn't deal properly with all of the composite emoji so it's, yeah, it reversed them individually which means computer woman is not the same as computer woman. So that's pretty much it then. Everything works, like share and subscribe. Okay, not quite. So I see some problems here. The first one is that I'm notoriously lazy and I don't want to write headers. And not just because I'm lazy, but because if you have a header in your repo and it's out of date from your library and then you get weird linking errors and you don't know what's going on and then you find out that there's like a merge conflict from three weeks ago because someone like pushed a button too quickly on GitHub and that's why your application doesn't build. That's not really cool. The other thing is this was a very optimistic function. It returns a string. What could possibly go wrong? So maybe we might want to fix that. And the thing is Rust makes it very easy to forget about memory management. So how does that happen? And the last point is less of a problem. It's more of a philosophy, I guess. I want to talk about what even makes a pretty API because this isn't just about making Rust talk to see. You can make anything talk to anything. This is about efficiently talking to see which means making it pretty. So let's start with the easiest thing first, tooling. This could be another 30 minute talk. I think you're seeing a pattern here. It's a lot of stuff. So there's this project called C bind gen which is pretty awesome. It's basically like bind gen but in reverse. So you point it at a crate and then it'll generate header files for you. You can either do this in your build RS in Rust code or it provides a CLI that you can then invoke in your favorite build system, which you probably have. Yeah, so when it comes to actual build system support, you have to do a lot of work. So usually I find that writing a few bash scripts that hook into some make file or something is usually the easiest to deal with generating, like invoking cargo, building it, then taking the library from the target directory, putting it somewhere that your build system will understand and then letting the build system do the rest like it would normally do. But this isn't a thing where you can just go somewhere and look it up. It's figure it out yourself, which isn't very nice. So let's talk a little bit about memory management. The thing that Rust doesn't really need you to handle. By default, when you create an object in Rust, it creates it on the stack, which is really convenient, I guess, if you don't need it to be on the heap. And in most situations, this is fine. There are situations where you might want it to be on the heap and then you make that explicit. And especially when we talk to some other piece of code where we have no idea what it's doing, what it's doing to the stack, it's not a great idea to use the stack as permanent data storage. So put your troubles in a box. The box is a heap-allocated pointer in the standard library and whatever thing you put inside of it will then be on the heap and you, this code up there, the extern C, the box thing, what that does is return a pointer to whatever you put into memory. And the thing is we declared our structures repRC, which means that C will be able to follow that pointer and then do something with it. The other thing is that boxes retain type information where they store the data, which means that you can also get the data back. So you can, if you have some piece of code, say PTR, and I just realized that code example is wrong, it should be PTR that you do reference, not CTX. So, whoops. You get a C void, which can be literally anything, and then in an unsafe block, you essentially cast that to be a mutable reference to my thing because you can follow the pointer to wherever the thing is in memory and then you can use that and then you can, in your Rust code that follows, safely access all of your stuff without having to worry about something going wrong. This is what this looks like from the C side. So basically, yes, the make thing function just returns a pointer, the my thing pointer is then on the stack and we can deal with this. Something to remember though is that you can't make your application memory safe. So the Rust's guarantee ends at when you return back into C code, which means that you should not make any assumptions about persistence of data. It might be gone, something might write over it, or it might just die before you can do anything with it.  Even if it's like unintentional or a bug, it's something that you have to deal with. Speaking of things exploding in your face, let's talk about errors. So errors and generally reporting if and when things go wrong and see are a little weird. So in Rust, we have these amazing types result an option that let you return something from a function and it contains some type information or some state information about what state it is in. The result realistically communicates the state if it's okay or an error and the option just communicates if it's existent. And that is super convenient because you can just return something from a function and I don't have to explain this to you, you probably know this. Well, this is something that you can do in C but before I go there, I wanna talk about something because this talk is called C and C++ and I've really only talked about C so far. We have to split this up in errors and C and errors and C++ because errors and C are something that we can deal with. We have a binding to C code and we can deal with interacting with C code. Errors and C++ are either exceptions or some class that uses a template to essentially be the same thing as a result just in C++ and that's not something that we can really easily interact with and even if you could, it would be very dependent on your compiler version and it's not something that you ever want to touch. So whenever we talk about errors and whenever we talk about building pretty APIs, you have to keep in mind that you build a layer to C from Rust to C and then your C++ code if you have it will have to use that C code just the same way like externally as your Rust code would. So you basically have two parts that sort of communicate via a common ground that they both don't really like but they just put up with it. So this is something that we can do. We can emulate a result in C. So this is a Rust struct obviously and what we can do is we have some struct over a generic T, we have a box in there so that C doesn't have to understand how big this is because in the end for us it's just a void pointer and we can mark that field as economy or like hide it or something as long as the structure knows that there's a pointer in there that points to something, it doesn't have to care. So this way you can deal with returning Rust objects that you might want to give to other Rust functions that C doesn't have to deal with while also returning an error code that when it's convenient. And this is what this would be used then. So we call some function, this is C code, we call some function called my function and the return value is this wonderful result type and after the function was called, we can just call code and if that doesn't trigger and we don't have to deal with an error, it's a valid thing. There's another pattern in a lot of C libraries and I've been trying to look at how it evolved over time. It seems to have like a lot of older libraries use this but a lot of newer ones as well so it's not really sure, like I'm not super sure about a trend that use double pointers and so as a little bit of a refresher I guess because Rust developers usually don't deal with pointers directly because we don't have to, the idea behind this is that you provide the pointer to a pointer to something and then by dereferencing one of them you gain access to the other. In this case we have a variable which is a pointer on the stack and we give a pointer to this pointer on the stack at which point in the function we can de-reference the first pointer and write onto the stack outside of our function. This is a pattern that you can use in C to do error reporting by always returning an integer from your function you have the ability to communicate if something goes wrong, if it returns a zero it's fine and happy or it can return some error code or an enum or whatever while handling data return types with double pointers where you make some field on the stack so we have this function called getClient and we have a client pointer on the stack and then we give a pointer to this pointer to the getClient function at which point it'll fill it in and if there's no error the client variable will then contain the pointer to a valid client. You can do the same thing for initializations you can also provide parameters obviously that have nothing to do with any sort of return value and just yeah, this is the same pattern essentially. So from Rust this is super unergonomic to use basically what you're getting so let's take the initialize function where we have a pointer to a pointer and a port. We get in a star, star, starMute, starMute, C void and a port, you can check if the port is valid and then return like an error if you wanna allocate like port minus one or something and then what we do is we generate like we create a new server in Rust we put it on the heap with a box and then we use the box into raw function. What that does is it destroys the box and turns it into a raw pointer so Rust does have pointers, they're just unsafe and so whenever you want to deal with an actual raw pointer to something where you can seriously shoot yourself in the foot you have to put in an unsafe block and you then also have to deal with the lifetime and the cleanup of this piece of data yourself so you can actually this way you can leak memory quite beautifully because you can put something on the heap, give yourself the raw pointer and then never do anything with the raw pointer again and it's just, it remains on the heap. But so it's pretty ugly from Rust but if your priority is to be in line with the rest of a C API that you're trying to match this is really great because it feels exactly the same. You can even like the server struct can be exported to C so that it can directly access the port if you want that to happen and if all of your other code uses this pattern or if some of your other code uses this pattern it's a good way to sort of match that and this is like literally figuring out the box into raw was why I then wrote this talk because there's like no documentation about this. Well, there's now but. So let's talk about C++. Well, I already mentioned that we'll have to wrap some stuff and what we can do is so I'm not, I don't write that much C++ code. I know that people shouted each other about whether or not to throw exceptions so I have one example that throws an exception and one that doesn't. Basically what you will have to do is include the header that is generated for you the same way that you would include any C header from C++ and then you would probably want to write a module around it that calls into it and then abstracts away any sort of errors into the system that you're using in your code. This is very specific to your project so if you use exceptions then throw exceptions or if you use like a result struct that you're emulating because there are things like that you can use templates or something you can return that instead. So at this point it's very much down to you and your project what you need. The important thing is that with the patterns that I showed you in C at least you have a good basis for communicating errors in the first place because the worst thing you want to do is in your C++ code just throw an oopsie exception that tells you that something went wrong and you have no idea how to debug it. Okay, so I have five minutes left and I hope that until this point I've shown you some useful information and maybe shown you where maybe the ecosystem needs more work. For the last five minutes I want to answer this question which has been haunting me for the last six months or so. So I think if this isn't your reaction by the way then I'm deeply worried about you. And well the answer is yes you can. So let's look at what exceptions actually are maybe you've never worked in a language that has exceptions like see or rust or you've never looked under the hood deeply enough. This is based on the C++ LLVM documentation which is really great. So if you're curious about that definitely read that. It's really well written. So there's usually three keywords involved sometimes four but like we only care about three right now. Try, throw and catch. What a try does is create a sort of landing pad that you can jump into later and I'll go into the details in a bit. Then when you call throw at some point in your code what you do is you start walking up the stack the same way or similar to how you would unwind your stack. You go up until you find the landing pad and you jump into it. Catch blocks are then basically function pointers that you jump onto and like call them. The thing there is that there is a bit more logic to handle which again I'll deal with it in a second. So the try, the landing pad actually contains more information than just how to deal with an exception because the try block can be ended in two different ways either you can have thrown an error or you can have not. So it needs to understand the difference between or it understands the difference between an allocated exception that sits somewhere in a buffer and not at which point it'll either choose to evaluate the catch clauses or it'll just continue in your code as normal. So the catch is actually a filter because in C++ at least you can catch for multiple exceptions at the same time kind of multiple catch statements or catch blocks I guess that filter for different exceptions and you can even like use the pipe logical or operator on them. And maybe you don't have a catch block which catches the exception and then it gets rethrown in the hopes that someone upstairs will care. The last part is actually the easiest and that is nice because that's what we care about. So the throw keyword gets replaced by the compiler with calls into libc++ that allocate an exception define types with certain mangling rules and then throw the exception. So this is a talk about Rust and I'm sorry if I went a little far there introducing exception RS. So I wrote a crate that can throw exceptions C++ exceptions in Rust. This is what it would look like so you have the exception thing and then you can like throw some structure with whatever payload you want. How's this implemented? Well, there's no libc++ bindings in Rust which is probably a good thing. So instead I wrote a little shim layer in C that just invokes those functions that are exported. So those are the two functions. There's like a third but it's not important for this example. These are the two big functions that you need to allocate an exception and to throw it. Those declarations are in the C code exactly that way because I can't provide those and I am compiling my code in the hopes that before it's run, a C++ compiler will look at my code and go, oh yeah, I know where to find those. So you're very much dependent on your project being compiled with a C++ compiler or else it won't work. And this is what that looks like now. So the cargo build release is so that I build the actual Rust code that throws the exception and then you invoke a G++ or a C++ compiler that links in the exception throwing library and then it's, well, I didn't handle it because I thought it looked nicer to die with a custom Rust exception. All right, so there's one more thing that I've been working on and I kind of got it to work. It's answering that question. And the answer is yes but I'm out of time and I will write a blog post about that because it's a whole different kind of worms on that adventure. So thank you for real. So follow me on Twitter, I do a lot of shitposting if you can put up with that. Or if you have questions or wanna get in touch with me, if you see this online at some point or you're shy or you don't meet me, write me an email so I do like getting emails. I want to thank my employer for our systems. That's the name you might be familiar with. It's the company that I'm working on in with James and they sent me here. So I wanna thank Mozilla for allowing me to be here and providing accommodation and stuff. And I wanna thank all of you, the Rust community. I really like the keynote this morning because I talked about how the Rust community can be inclusive and welcoming and it's really one of the reasons why I like contributing to Rust. So thank you and yeah, have a nice day. Thank you.


Next up, we have Panagiotis Tachis Metachis. I don't know how I did there with my Greek. Metaxas. Metaxas, all right. He is a professor of computer science at Wellesley and a visiting scholar at the Center for Research on Computation and Society. And his area of research, well, I guess this setup, is about misinformation, propagation, and electoral predictions. So I actually was reading about him. And I saw that he said that he loves social media in the Wellesley newsletter. He says he loves using social media, but Facebook is an interesting chitter-chatter. So only Twitter. Only Twitter for me, yeah. All right. Yeah, right. And as a matter of fact, I give a lot of, I don't want to sound like an advertisement for Twitter, but Twitter is playing the role of my collection of editors. Instead of going around like crazy, trying to be informed about the important things, I have selected carefully the people that I want to be informed from. And I follow their tweets. So if you think you have something important, tell me. You send me an email and you'll tell me. So I did something crazy. So let's see how it works. Given the interest of the morning discussion, I tried to change my talk so that it fits into the form of where the discussion is going. I was going to tell you a lot about how web spammers and propagandists have a lot of things in common. And I will tell you, I would have told you a little bit about how the theory of propaganda can help you detect propaganda as well. But I'll skip and I will tell you a few things about the first Twitter bomb that with my colleague we found a couple years ago. And there it was a case in which somebody was attacking the candidate Martha Cochle in the last Massachusetts elections. And I'm acknowledging any Mustafa Rai who's sitting back there. We found out that actually it was easy to detect this kind of attack. This is where they were trying to send their people. And the message was signed by American Future Fund. We had no idea who was behind this attack. Turns out we're the same Mayovan Republicans who were also behind the attack on Kerry. So pretty interesting story when we found. And as Phil said, it would be nice if we had found it a little earlier, not like maybe weeks later after the elections were done.  Elections are awfully important and you cannot let them down. That led us into the current project that I'll tell you about. The other thing that we found also was another prefabricated tweet factory. So if you wanted to support your cause by attacking particular reporters, you would go to this side. You would find the collection of tweets and then all you would have to do would be to copy and paste, copy and paste, fire. And instead of trying to tell the general public about that, you were going to tell about particular news reporters and news organizations about your message and you would write in the Massachusetts editorial race as a way of getting the message out. So I will close this parenthesis because I want to tell you a little more about what we're doing now. The discussion of this session has to do a lot with trying to create tools for individuals. And here is something that I know that people from, I'm blanking out, you Sahidi is doing. So I had a little discussion with Patrick before about that. What do I care about? Have you ever heard of social theorems? I hope not. Because I just thought of this term as a way of making a point. What's the point? We treat our knowledge, what we try to believe as facts. We treat them as theorems the same way that we are looking to mathematical theorems to make sense of the world around us. But the problem is they are not the same. There is a big difference between the real theorems and the mathematical and the social theorems. Social theorems are things like, there is no such thing as a free lunch, which you might consider to be true, except if you are a graduate student in a university and you will find lots of free lunch after every talk. But in general, it is roughly the case, just not always. And compare it with F equals M times A, which is something that no matter what, it will work as long as you are in this universe. We confuse natural laws with social behavior. So we would love society to behave the same way as nature, but it doesn't. For example, nature will not care if you did another experiment before and it will not change its behavior the second time you do an experiment, society will do that. And that's a problem when you try to find exactly the same behavior or time. And again, here I have the Joe Paterno and Whitney Houston deaths. The first one was a fumble, the second one, the news organizations were very careful not to repeat it so they were kind of slower as they were going. Another bad thing that my mother used to tell me all the time, it's the good guy does not always win, I'm sorry, but this doesn't mean that you do not have to try every time to get the good things out. Finally, just because you found a counter example in a social theorem, it does not mean that the social theorem is wrong. Just because some of the things that society behaves like do not always work, does not mean that we know nothing about society. We still know something about society. And we saw some of these earlier, for example, Brent and Ian talked a little bit about best practices, credible sources, how to make more sense about all of these things. So what are social theorems that I want to tell you about are things that we have discovered in the last five years, some of them. And what we hope is to put them into a personal tool that will help you make more sense as you receive information.  So I'll give you three of them today and I'll give you some evidence about that. So the first one is that unedited retweets about political issues indicated the agreement and reveal communities in likely minded people. It does not mean that every retweet means that kind of thing, but when you have political discussion, retweets, verbatim retweets actually mean that I totally agree with this guy. Always, not always, and I'll show you an example, but most of the time, that's the first social theorem. The second one is that it's a very optimistic one. Given enough time and enough people's attention, lies have short and questioned lives. That's pretty optimistic. It doesn't mean that every time lies will die. No, it doesn't. If you look in world religions, you will see some lies that they have propagated forever, but there are other cases in which in this world we live in actually they can be detected. And the last, which is not really a theorem, but what the heck, is that people with open minds and critical thinking abilities are better at figuring out truth than those without. Sounds like a da, but with the discussion we had in the morning, it seems like we tend to believe that maybe there is nothing we can do, but it is not like that. So some evidence. The first comes from the data we got when we gathered the Massachusetts Senatorial Elections. This is the retweeting pattern of a group of people that retweeted the most. This is about a thousand people that they retweeted about 14,000 times in the seven days. You can see a way that they were divided and actually they were divided automatically by an algorithm. If you retweet a lot, you get to be clustered together, otherwise you're far away. The big group, by the way, is not unified if you look closer at their individual retweets. There are three different groups there. Some of them engage more with the other group. The others are not engaging at all. The people from Indiana, Phil and Mike and Bruno there have found a very similar picture for the elections in the late 2010. The second about giving enough people's attention. Here is some results of a paper that check to see how much misinformation about rumors, about potential tsunamis and earthquakes, problems in Chile in 2006 I think was propagated and how far they propagated. Some things, the bottom part are the false rumors. They were proven false eventually. The top are the confirmed truths. These ones were questioned much more often as you can see and did not have, here is the column I want to show and here is the number of different questions. It's not like the truths were not questioned, just not as much by and large. Another very interesting example are the London riots rumors that they propagated. The guys at the Guardian have an amazing tool you should visit and play with it. The pics there show some attempts at propagating false information eventually died. They tried to revive but did not live for long. Wisdom from the ages. Here is time saving truth and falsehood and envy. So we're going along the same ways. I need to stop, I know. So a little thing about open minds. The third part, the critical thinking. It's not that everybody will actually be beaten by every piece of information. How does it go? You cannot fool all the people all the time, right? That's something that happens. You cannot expect you will have a tool that you will just click and will give you the answer. What you really want is to be able to have technology that will give you the information but you will need to figure out the answer using your own brain. So education is that important there. Here is Rios Fereos I mentioned in the morning and men notice that he said whoever thinks freely. You want to be free in your thinking but you want to be able to think as well. Thank you.


Here's a controversial topic. Can drugs lead you to truth? Can drugs lead you to God? Now let me give you my position as a few years ago.  Of course drugs can't lead you to any kind of true insight. In the past six years or so my position has moderated a bit. I quite honestly was subject to a measure of propaganda where I thought drugs were synonymous with bad and badness and I had very limited exposure to drugs, really just alcohol, and I still do have limited exposure to drugs. The only thing that I've done other than alcohol is marijuana, which many would say is not a particularly strong drug. However, my belief system around drugs has totally changed, and here's why. Many years ago when I was engaging in lots of philosophic conversations with people, they go, Steve, are you on drugs? I'd say, no, what do you mean?  But now after having a little bit more experience, having more experience just with pop myself and with other people that have been on drugs or talked about their drug experiences, I now have a little more insight into what's going on. What's going on is this. Apparently, drugs will kick your mind and your consciousness out of a kind of framework that you may be unaware that you have. The way that a lot of drugies put this is, it opens your mind, man, expands your mind, gives you new perspectives. That actually might be somewhat true. So, I'll give you an example from my own experience. When I first tried marijuana, I was giving, I was putting myself to a, through a skeptical test because I'm a philosopher, I wanted to know what is this drug state like that everybody keeps talking about. And so, the test that I, I came up for myself, I said, okay, if I can get myself to believe in a logical contradiction while I'm on drugs, it must be the case that while you're on drugs, your mind is not a reliable method for sorting out truth. And therefore, all these drug states that people are talking about are completely bonkers. So, this was probably six years ago now. I was a, I was staying with a friend's house in D.C. and smoked pot. And I was writing notes to myself, you know, tracking my internal experiences because I'm curious. I want to know what's going on here. And I came to a question, and the question was this. Is there a difference between squares and circles? Can you have a square circle? And I paused. I remember this because I would never pause about that question. In my normal state of mind, I would say, no, of course, there's the standard definition of a logical contradiction as a square circle. But I paused, gave it some thought and concluded, no, you can't have a square circle, but squares and circles are awfully similar things. In fact, they're similar in 99% of ways, and they're different in one tiny little way.  So they have a ton of properties in common, but that one property about shape, maybe one property, indeed, you could not have something that was square and circular. And I remember once, the next day or the day after that, I thought, huh, that's really interesting because my regular frame of mind would say, no, squares and circles are completely night and day, nothing similar and end of story. But when I was kind of jostled a little bit outside of my normal conscious state of mind, I realized, oh, no, actually, these two things are incredibly similar. Why do I say this? I now have an understanding and an explanation for the stereotype of the stone druggie asking existential questions, like, why are we here, man? Like, well, isn't it weird that I have thumbs? I realized when people are jostled out of the regular frame of mind, it actually makes them more philosophic. So they ask questions, which are really interesting, really insightful, that they would never ask and it's entirely because not because they're crazy or out of their mind, but just because they've had their frame a little bit jostled. So I realized this is why people think I was on drugs because I would sincerely ask questions like, what is my mind? What am I? What are we doing here? Is it skin weird? Why do we have two nostrils? Are these questions that might seem silly to me? They're genuine and interesting and I want to know what I want to know the answers to them. But most people only ask when they're in that other state of mind. So to get back to the original question, can drugs help you discover the truth? I can't believe I'm saying this given my the conviction of my prior beliefs, but I would say yes drugs can help you discover the truth in a number of ways. One, they help jostle you out of your regular state of mind. So you're going to see things from a different perspective and ask insightful questions that you probably wouldn't otherwise be able to ask without those drugs. In other words, you're going to see your perceptions from a different point of view and then that enables your philosophical mind to seek out the answers for these questions. Also, it might lead you towards an insight of the nature of experience. So you might have experiences in those states of mind that you wouldn't otherwise have. Those experiences require a philosophical explanation. So perhaps you have to expand your worldview to incorporate your state of mind, your insights, the things that you realized that were contemplating while in this altered state of mind. This is no challenge to rational philosophy whatsoever. You can't experience a logical contradiction, you don't have to worry about that. So whatever the nature of your experience, whatever the nature of your state of mind, that requires a philosophical explanation. And in fact, I've also found the more I dive into philosophy of mind and metaphysics, the more a lot of the states of mind that people who are in psychedelic experiences they report, it makes a lot more sense to me. But that being said, I do think it's the case that drugs can lead you way far away from the truth as well because it depends on your starting point going into it. I've met tons of people who make ridiculous arguments for things that I know to be certainly false and they give justification for their argument because of some psychedelic state they're in. Take magic mushrooms and then you'll see the insight. There may be some truth to this, but it gets abused. And I think it's a cheap, lazy way to get around critical thinking is to say, oh, man, you just take drugs and then you'll see it my way. I don't buy that at all. I think drugs can be a philosophic tool, but they're not, they're not, they're not, they shouldn't be a legend. And I also think just from my experiences, there seems to be one type of person that can have their wires crossed in their brain after too many drug experiences where they lose it. They lose the edge. They lose the critical reasoning. They seem, maybe they go a little schizophrenic. I've seen that. And so I don't think it's a panacea. If you've got some, I don't exactly know the cause of that, but maybe if you have some markers for having, you know, brain issues, I think it can cause brain damage, which is a huge deal if you care about discovering the truth. Now, for the next question, can drugs help you discover truth and can it help you discover God? How many people have reported, I met Jesus while I, my position prior to my own experiences and insights and opening of my own mind and understand these things was if you think you've discovered God in an altered state of mind, you are the definition of crazy, literally. Now I realize this isn't so for similar reasons that I've just laid out. It might be the case that in your altered state of mind, you come to realizations, let's say about your own value system. In my own case, you can experience love, you can feel your own feelings. As people with a more rational disposition, I think oftentimes are completely unaware of their feelings or completely disconnected from their feelings because they think they're a poor method for discovering truth. I was prime example of that. I was disconnected from my feelings. I've been disconnected from my feelings, not in like a depressive way, just in a purely rational way. I was like, yeah, I have these feelings that come up, but screw them. They don't help me discover truth. I don't need anything, I don't have anything to do with them. Then, thanks to marijuana, my very limited experiences, but it helped me realize the feelings that are there, that are suppressed, back pain for example, bad health that I've had, that if I were just a little more aware of, I would recognize love, the feeling of love, which I would say is the most important experience that one can have is an experience of love. I do think it's the case that drugs can help people with certain psychological dispositions to learn important truths about ethics and maybe their own value system or maybe even the meaning of life in that state of mind where they're naturally more philosophic and they're naturally more open to different experiences. I do think it's the case, and I'll talk about this soon. I do think it's the case that there is some truth to religion. There's some kind of boundary blurring here. The boundary is between religious orthodoxy, human psychology, the philosophy of mind, religious experiences, psychedelic experiences, drugs, and maybe meditative states. In that bundle, there is truth to be found. In fact, I think perhaps the most important truth to be found. Oh, I should say, perhaps where all of these intersect and they have, at least in my experience, is love. A common theme in all of these different things I just talked about is the importance of love, which I actually have a positive belief is something like the meaning of life, or the highest state that a human can achieve is the state of love. This would correspond with many different religious philosophies. It might correspond with human psychology, the philosophy of mind. The point is to say, I see no reason why a drug state cannot lead you to truth in metaphysics, truth about the relationship perhaps between the mind and the world, truth about the existence or non-existence of God, the importance of love, the importance of feelings, or non-importance of those things. And I see no reason to believe why drugs can't do the exact opposite and trick people, delude people, take away their critical reasoning capacity, in some cases give them brain damage, give them maybe false insights that they don't pursue rationally because they lose their impetus to think critically for themselves. So it's a two-edged sword. I'm not going to dismiss anymore this idea that altered states of mind can give you some important insights on the nature of the world. I will say the strength of my conviction that that was not the case, the strength of my conviction that drugs equals insanity and incorrectness came from me being dogmatic and wrong in my youth. I was subjected to propaganda that I absolutely believed I had limited experience with drug users that were negative. And I thought, this is just the opposite of rationality. Now I realize that's not the case. And what I've also found is most is probably fair to say, if not the vast majority of people that insist all drugs are dangerous and can't give you any true insight into the nature of things that are important are people that have not had drug experiences. It's the people that don't have the experience that just repeat things that they've heard that are utterly convinced that there's no potential here for using drugs as a philosophic tool. Now my position might change in the future, maybe if I have more intense psychedelic experiences, I think this is bad. But from my own limited experience, like I said, just probably less than a dozen times trying marijuana, I don't think it's the case that it's a boogeyman. I think it can spark creativity. I think it can spark insight. And all those bajillions of people who claim that they have discovered some interesting truth about the nature of the world while in an altered state, well, maybe there's actually something to that.


So I'm going to make a confession. This is the most nervous I've been before I got on stage, which is why I'm at the beach right now and it's quite lovely. You all should join me. But in reality, I'm right here. And I actually could see when I was walking on stage, which is how I didn't fall in my face. But I'd like to go ahead and start by taking a picture of all of you and me on stage with my 360 camera as a kind of a prayer to the demo gods that my presentation works today. So I'm going to go ahead and hold this up. Everyone smile. Awesome. So as Bruce said, my name is Liv Erickson and I am a virtual and augmented reality developer evangelist. And if that sounds like one of the coolest job titles ever, it is. My job is basically getting to play with virtual reality technologies and then teach everybody else how to build with them. So I'm going to go ahead and set this down here. And I'm going to get right into this. A couple of days ago, I found this tweet that a friend of mine tweeted saying, a 2D website must fit on a computer screen. A 3D website can contain life-sized mountains you can actually climb. And I thought that this was one of the best 140 character representations of the VR web and its potential here. Because we have been building websites for specific sized devices for quite some time now. And with virtual reality, you get this ability to build entirely new worlds. So with that, I decided I'm not going to put you guys into slides for this talk. Virtual reality is here in your browser. And this is a virtual reality application running in the browser. As I said, my name is Liv Erickson. And I built this site about a week and a half ago now to talk about the VR web, how it is here, and how you can get started building for it today. The previous talk did a really awesome job of explaining some things that I had not even seen in terms of bringing 2D interfaces into the browser. And I'm excited to try out a little bit of that and play with it myself. What I'm going to talk to you about today are some of the frameworks that exist to bring 3D content into the browser specifically for VR so that if you do want to start building these virtual worlds in JavaScript, you can do so. So we're going to start on a little journey. I like telling stories. VR is a very storytell-y medium. And I'll start before I even get into the VR portion of this with my story. So I get asked a lot, how do you get into VR? How did you get into VR? And I got into virtual reality by doing something that I would never give advice for, which is saying, basically drop everything that you're doing and take the advice of someone on a YouTube video that you watch and completely change your career path to do something that sounds amazing, which is exactly what I did. I moved to the Bay Area in 2013, searching for something that I was really, really passionate about and all of this kind of life-changing technology that I had heard about in school but had never really had a chance to build. And so I was watching YouTube and I was watching a video right around the time that the Oculus Rift developer kit 2 came out. And I had this light bulb moment where I thought, wow, this whole, like my whole world seems brighter now that I know about this technology, I need to start working on this now. And in retrospect, that life-changing decision was probably my roommate turning on the light switch somewhere else in the apartment, but it left a really profound impact on me as I started to learn more about virtual reality and how it was going to be changing the way that we interacted with computers. So to get started, I'm gonna talk just a little bit briefly about virtual reality devices as they stand in 2016. How many of you are already building virtual reality applications today? Okay, four or five. How many would kind of like to, depending on what I'm about to show you, even the tool set, try playing with VR and building it yourself? Yes, all right, awesome. So like I said, I'm gonna go really quickly through this first part. I'm gonna talk a little bit about VR devices. So the first type of VR device that I'm gonna mention really quickly is the one that you see here that I'm wearing on my head, and that is a mobile virtual reality device. This virtual reality device is powered by a smartphone. I'm particularly using the Gear VR right now because I have a Samsung phone, but you also see this in forms of VR headsets like the Google Cardboard, now upcoming Daydream devices, where all of the interactions that the application use are powered by your phone and the sensors that are a part of that. On the other end of the spectrum with VR devices today as they're generally available to consumers is desktop devices, and these are things like the Oculus Rift or the HTC Vive, devices where the display is contained in the headset itself, but all of the processing power is being done on the computer instead of the headset. You'll have some of the different positional sensors included on the headset to figure out where is the user looking, but you also get a lot more power that you can throw behind your experiences to get more realistic looking applications and you would get a whole bunch of added bonuses like room scale VR and being able to track someone as they're walking around in a space and controllers and different peripherals that you can use there. So looking at this, big question is like, okay, well, why? Virtual reality, it's kind of new technology that's been around in several different iterations over the past several decades, and I often hear kind of like, okay, well, I'm not a gamer, I don't know if VR is for me. And I like to talk about the different applications of VR in a few different ways, one being that at its core, virtual reality is a very, very fun technology. I genuinely love what I do and I have a really hard time separating out my hobbies other than my Elvis impersonation hobby from my job because I love what I'm doing when I'm building things for VR because it's just this fun new way of interacting and engaging with the world around us and technology. It's changing the way that we think of computers and we think of operating systems and human computer interaction when we start to realize that for the first time we're able to put ourselves inside of these applications that we're building instead of just using applications that we're building. And to me, that's really interesting when you start to think about different opportunities that that presents for how we're able to do things like visualize data and understand different systems around us. And it also is changing the way that we interact with each other. I came on stage today and it was a little bit weird because you didn't know what I was looking at if I could see you. But when you start to look at things past one person in isolation standing on stage, virtual reality starts to show a lot of promise for how we're able to relate to each other. So this is an example that I like to show when I talk about this. This is me from about three or four months ago on vacation visiting my parents. This is my mom and my dad. And my sister wasn't able to come with me on this trip to visit my parents. We live on opposite sides of the country. And for the first time, having the ability to take a 360 picture, let me kind of transport my sister from California to North Carolina with my parents. And I can look back on this and I get really happy because I can revisit these moments in time where I'm able to share memories from not just a picture and experiencing something but what it actually felt like to sit in a given location. So I've taken a lot of pictures from the conference today that I'll post up online shortly. Some being from the audience and some being from backstage. So you could even put on the headset or even in your browser, as I'm about to show you, walk around and see what it was kind of like to experience this very event in someone else's shoes. So we'll move on from that. So when we start to think about virtual reality, we wonder, okay, what type of technologies are available to me and why does the browser make a really good place for a virtual reality application anyway? So there are a lot of benefits to the web, which I think everyone in here is probably familiar with. You have the ability to build sites and applications that don't really care what they're running on. They just work. They're able to interact with different kind of connected first atmospheres where you're building things that rely on data components and the web is built around networking and interconnections between devices, data and people, which translates really well into virtual reality once you start looking at that. You have in the VR world a lot of new concepts around what an application or an experience even is. If something is a six minute piece, is that an app? Is it a movie? Is it a video? How do you distribute that? And as we're trying to figure out kind of as a whole, what virtual reality experiences are, we're also faced with kind of some interesting distribution problems. Like is this something that goes in the app store even if it's only six minutes of content? And the web removes those barriers. It removes the need to build applications to work on specific devices. I can build a VR application that doesn't care if I'm on a mobile phone or a desktop VR headset. It will just work. You saw a little bit about building for VR on the web previously. And I'm gonna dive a little bit deeper into two things. One, how the heck does the browser allow you to build virtual reality experiences in the first place? And two, what are the tools and the libraries that are enabling people to build virtual reality experiences today? And what did they look like? I mentioned this as an example of that. So my wonderful graphics programming that was standing, I'll dive into the specifics of how I use one of these to build this site in just a couple of minutes. But first, it's important to look at the web VR API because that's underlying all of this. And it's some really, really cool technology. So at the root of everything, the web VR API is a, and it's just hit 1.0 a couple of, I'm gonna say, weeks ago. And it's this experimental exploratory API that's slated to start landing in major browsers shortly. By the end of this year, I think in some of the beta builds of the different of Chrome and Firefox and I got web VR 1.0, I wanna say like two weeks ago. And what it does is it offloads all of the information about how to represent a device that an application is running on. And it gives that to the browser and says, I don't wanna think about this, you do it for me. And then the browser will then look at the device that it's running on and it will abstract whether it's a desktop VR device or a mobile VR device away from the developer and the user and say, can I get positional data from this device? Yes I can, it's a phone, it has a gyroscope in it and I can tell what direction it's moving. We'll use that as my positional data. It will look at a desktop VR headset and it can pull out the information about the pose and the positioning of that headset at a given time. It has parameters to look at the system and say, hey, I actually found some other sensors that are tracking the entire room. Do you want the data of the person as they're walking around? And as a developer, I can apply this to my application by calling regular camera transforms within my 3D scene. So for this particular application, my browser doesn't care that it's running on a computer without a headset, it's just gonna work. And if I tried to query this by switching into VR mode, it'll say, you don't have a browser attached or I'm sorry, you don't have a VR device attached, I'm not gonna let you render the stereoscopically. And because of this API and kind of the ecosystem that's being built around it, there are a lot of tools that are coming into play that make it even easier to start building these 3D environments. If you've never done VR development or graphics programming before, one of the hardest parts about getting kind of familiar with virtual reality development isn't anything specific to the devices themselves, but it's a lot more of a challenge to start thinking about your applications and your interfaces in three dimensions instead of two. So a lot of tools are evolving around this that are helping make that easier. So this here is A-Frame. A-Frame is a project from the Mozilla VR team and that's what I use to build this website. And A-Frame is a markup-styled language that uses an entity component system to write reusable and highly flexible components to your application and to your environment that sits on top of one of those JavaScript layers that you heard about in the previous talk to do 3D graphics rendering. So you have already here this markup-style language that you can use if that's more comfortable for you when you're learning to do VR development. You also have different JavaScript frameworks like Babylon 3JS and all of this kind of wraps together to create these little scenes. So this scene in particular is something that I put together very quickly. So it's very low resolution. I don't have any high poly graphics in here but the technology all exists there and I'll show you some better examples of that in just a couple of minutes. So let's continue on looking at kind of what some of this looks like and I won't spend too much time here because you've already seen a little bit of this in action in the previous talk but this is a sample application that uses 3JS to draw objects onto a scene. Now I work for Microsoft so I sometimes use a little program called Excel and I'm not a spreadsheet. So I have trouble sometimes looking at data and saying, oh yes, this column intuitively makes sense. I can remember all of these numbers and pull that information out right away. And viewing 3D data and 3D charts in 2D just isn't really the way that it was kind of meant to be. It's not really intuitive. I could go into a lot more depth about mixing kind of 2D and 3D devices and UIs and interfaces but I think that that's another 30 minute talk in and of itself but the basics of what this application does as it's shown here is it's doing a couple of things with 3JS and WebGL. So the first several lines and I think that that's a little bit hard to read so I'll put the code all up, the code's all up on GitHub and I'll show you some links for where you can go find that later. So you just have to trust me for now that this is what it does. You have a renderer that's drawing everything to the page. You have your WebGL canvas and you have your scene and none of this is really special to VR. You're creating a perspective camera that you can use to kind of look at your 3D environment and we have a couple of different settings that we apply to that camera. The only three lines of code that's specific to VR in this 3JS scene are a controls object which will apply to the camera and say if the user turns their head this needs to be represented in your application too. The second one being a VR effect which is what's gonna render this side by side and stereoscopically saying if my phone screen is maybe this big it's going to be a lot different than if I'm rendering something on a headset that's larger than that. So the VR effect handles calculating the screen size of the VR device that you're using and figuring out how to make that comfortable and look right for the user. And then you have a VR manager that switches in and out of VR mode depending on when the user triggers that. One of the really interesting things about web VR is that we have a very, very rich ecosystem of web applications today and it's unlikely that one day everyone in the world is just gonna switch to VR and that's that. It's really important then that we have applications that can switch in and out of VR mode like if you're browsing something in a store and you wanna see it up close or move it around before you purchase it, that's something that will be really beneficial to have this flexibility with that isn't really there in other types of applications for virtual reality. The rest of the code up on this screen is just general plain JavaScript that's creating a couple of cubes and it's reading information from an Excel graph to then generate the size of those cubes and render them into the screen. And so that looks like this. It does not look like that. I'm gonna go ahead and switch over to the actual application itself. You get a demo early this time. So what this video was supposed to show was a video of the application running on a mobile device so that you would be able to see what that looked like running split side by side on a phone. So what I'm gonna do instead is show how it looks like in a regular browser but since I don't have a desktop VR headset attached to this computer I'm not going to be able to run that. So, all right, that doesn't wanna work either so we're just gonna play the video instead. It's why you have backups for your backups. So you can see here that this is just a regular website. I use Bootstrap to render everything kind of nicely and I have a file chooser where you can pass in an Excel spreadsheet and this particular spreadsheet that I chose was one that represents the cost of living in different cities in the US. San Francisco has a really big problem right now with housing and affordable housing in particular and I wanted to create something that visually showed the differences between this and other cities in the US. So this is actually a relatively simple project like I said, it's only using three lines of specific code to VR itself and it will run on a mobile phone just as smoothly as it will run on a desktop site. Of course, everything loads after I do the demo so I'll go ahead and see if I can make this a little bit bigger and I'll show you a little bit more of the code behind this. So, most of this is just using the ASP.NET files to do all of the front-end rendering but the interesting part comes into our scripts when we look at our page scripts file. So this is gonna be where everything is happening, aha, there we go. Now you can see the code that I was showing earlier and it's got this function paint canvas where everything is being rendered to the screen. I already talked a little bit about how it's just using 3JS. We have a camera here that we create and then we apply VR controls to it. We have our VR renderer here which you saw in the video applying to the mobile phone and the VR manager and then the rest of it is just calculating the objects that we have. It's creating these different cubes out of that information by giving it a geometry, it's a cube material in this case a normal material but you could kind of change this depending on the aesthetics of your own application. We set the position and the sizing of all of those cubes and then we create some text here to put that in front of the cube so you know which cities you're looking at when you render all of that. Once we do that, we're adding our cube. We create a plane for the ground. We position that plane and then we switch and handle the rendering based on whether or not we're in VR mode. WebVR uses a special version of this request animation frame that lets you hit the frame rates required for virtual reality. It's gotta be better than 60 frames per second which is one of the big kind of areas that people are looking into right now with WebVR is making it performant enough to run with that kind of performance. So looking in here, I added a couple of little move behaviors with the camera and if the position of the camera goes less than zero, AKA if you walk off the edge of the platform, it'll reset you. So coming back to what that looks like in this application, I'm gonna go ahead and show you the code behind the presentation that I wrote. So this in contrast to the demo and the application that I just showed you is using A-Frame to render everything instead of just writing it in pure 3JS. So what this is doing is we're loading in the A-Frame JavaScript file. We're loading in an extra text component so that we can add the text into the scene without using the geometry itself. And then I have another page component scripts here that handles the interactions of things in the browser and then I have a font file in here as a JavaScript file because that's what the text component uses. So the first thing that I do here for my A-phrase scene is I create this A-scene element. Everything that uses the A-frame markup style pre-pens their elements with the A tag. So you have A-scene and that's saying everything within here is A-frame related and should be rendered as such. The next thing that we do is we're gonna set up our assets and our assets are gonna be the things that we're interacting with inside of our scene. So I started off the presentation with a tweet and I just have several images in here that I've been using to kind of fake having UI elements or 2D elements in my scene until I can find or make some pretty nice 3D models of the headsets themselves. I was just putting them in with pictures but you also have the flexibility of loading in obj files or other 3D models to make more complicated scenes. I also have the video that came in and did not play that I brought in and then I have my font mix in and that's really standard kind of asset loading in here. You also see that you kind of are starting to recognize a pattern here with how these elements are created. So it's a mix in, I'm able to define that I have a font and I can just assign this mix in to any of the text objects that I have. I could also assign it to any other objects that I had that wasn't text but since a cube doesn't really have a font it wouldn't make a lot of sense. But you can create these mixing components to change up how you want your application to look and to not have to be rewriting the same components for everything. Once I've loaded in my assets I'm gonna start building my scene elements. So instead of having to come in and bring in a 3D camera and apply all of these different things to the scene like I did in the previous experience I just say that I want a camera and I want it at this position. I can also do things like start adding in lights and adding in entities.  So in this case I create a stage that holds everything that's kind of default with the scene. So the pathways that you saw, the couple of little trees that I built all of those are held in this scene so that when I wanna go back in and when I showed you that image that the 360 picture you could actually see that right away. And I could show and hide that without having to look at all the different individual components to that. So I created a couple more of these and they all have these different elements to them. So instead of having to set all of the specific components to the geometry to a geometry object and then assign a material to the material object and colors and normal values to that I can just do all of that to one object here. So my path is made up of a couple of different boxes. I set the width and the length of those positions. I change the rotation for some of them. I assign them colors and then I have my box taken care of. And what this is doing in the A-frame JavaScript code is converting all of that to JavaScript items so you can interact with the underlying code behind those objects but you don't have to unless you really want to. So I built a couple of trees here. I put in some clouds and then I come in and I start defining different areas of my talk with kind of the different sections they go to. So I have this pre-title slide which is the placeholder that I use to just create something that sits in front of the camera and uses the tweet as a placeholder to kind of start my talk with. And I then go into my title and as I'm creating the title I'm putting in things like a picture. I'm adding in different entities with text so that I can define kind of what you're looking at in this scene otherwise without context it may not make a lot of sense. And then I'm creating these boxes that have custom components and or custom elements that I'm building this one is called click hide start and it does what you would expect it to do. It clicks, you click it and it hides the start menu. And what this lets me do is this lets me come over here into my page components and write some really simple JavaScript to register the click hide start component as a function and an event that I can trigger when I'm interacting with the object on that particular object. So in this case what it's doing is it's listening for clicks and when I click a particular box it will hide its parent element. I go in and this is how I define pretty much all of the behaviors in my scene for this particular application. I can register different components to show and hide the different parts of the application that I'm using but it looks pretty standard. It's pretty straightforward. It's not really fancy JavaScript. I've only been doing web development for a couple of years and it's almost entirely been for web VR. And this has been a really straightforward way for me to start defining custom behaviors for things in my environment. What I should probably go do is figure out why clicking the video didn't work. Oh, and I can see it. Okay, so I made a typo in terms of what I named this. Anyway, so moving kind of back into the index.html file I go through these different components but the really interesting and fun part about using these to build VR applications is that it's all less than 200 lines of Markup and I have all of this to generate essentially an entire conference talk for me which is kind of fun. And that's kind of one way that you can build these VR experiences but as I showed you, you can also be writing it directly in JavaScript using those libraries yourself. On top of all of that there are a lot more tools that are being developed to start kind of using things like WebAssembly, ASM to generate web VR code from things like the Unity or Unreal game engines. So I have another video that I'll pull up really quickly that's showing an exported Unity application that runs in web VR. So I have this running on my desktop and I'm wearing my Oculus Rift in this picture and I'm just kind of looking around the scene that I built and I've clicked and you can't really see it here because you don't see me but this little button down here is what allows me to toggle in and out a VR mode for this. And this is really interesting because it provides another route to getting applications in the browser that work with web VR even if you're building that somewhere entirely separately like Unity. So there are a few other things that I've started playing around with here. One being what about JavaScript that doesn't run in a browser itself but may run on the desktop? So a couple, about a week and a half ago I taught myself a little bit about NPM and got an Electron application running. So what you can see here is this is actually my talk almost exactly as it was running in the browser, running an Electron now. It's been wrapped and it's running on the desktop. And there's a lot of really interesting use cases for this. You get to write desktop applications now in JavaScript using Electron that work in theory for VR. This version of Chromium that Electron uses doesn't actually support web VR yet but since Chromium and Chrome are slated to get web VR support within the coming months it's probably only a matter of time before you can put that into VR mode because everything else works without any changes. I just wrapped it up in the Electron package. Of course there's so many other things right now that are happening in kind of the web world that continue to be really exciting for virtual reality. Things like web assembly. Being able to create experiences that maybe you surface when you're at a particular location using smart devices and being able to kind of pull in all of this information and start working with it in a virtual sense is really, really exciting. So kind of moving back to the end of the presentation there are two last things that I wanna show you. One, I mentioned that I was hanging out backstage so here's a quick little picture of me backstage before I came on. There's me. I took this with my 360 camera and I put this up online using a tool called Visor which meant that the time that I took the picture to getting a VR-ready 360 photo up in Distributable was about two minutes. If you want to, you can actually go to this URL here 360.visor.io slash v slash moz and you could look at this on your phone right now and see how that works in a mobile browser which will again have that VR support and you can take a look at what it would be like to be sitting backstage with me. So with that kind of in mind you hopefully have had a chance to start to see that we're really just at the beginning for a lot of this. You know it's a really experimental time for the virtual reality industry in general specifically for the VR web but it's one of the most exciting places that I've had the joy of kind of working in because it's changing really fast and it's growing really fast and it just enables so many different scenarios. So I'll go ahead and tweet this link out later and kind of switching back into the last thing here. If you want to learn more about virtual reality in general, the building for the VR web. I have a repository up on GitHub here called Learn VR where I've basically just been putting everything I find that I think is a little bit helpful for virtual reality development up here. You can follow me at Ms. Livy Rose if you want more VR tweets than a single person could ever generate, that's me. More than happy to continue answering any questions offline and I haven't had a chance to add this into my experience yet but I did actually just release a book on getting into virtual reality development so if you want to learn more about that too you can come find me later and I'd be happy to chat with you because it's free for a couple of days so you should. So with that I'm gonna say thank you, see if we have any questions and come find me later if your questions are not answered. Thank you so much. Will web VR revolutionize gaming? I think that there's a lot of benefit to gaming once the kind of browser is able to support it at the performance that virtual reality kind of meets. I think that the bigger question is kind of looking at how virtual reality and the VR web is impacting gaming already and a big thing that I see is one, we're already starting to see examples of games being built with A-Frame and I think that that's really powerful because what it kind of shows you is that there's this potential to release a game that works on the browser, whether or not you're in VR mode you can add that support with relatively little and that's a dangerous thing to say because there is a lot of optimization that generally goes into photo-realistic games especially for VR at this stage but I think that that potential is all there and it's just we're waiting for more people to get excited about developing for it and creating those experiences. I'm talking to all of you there. What other industries is it likely to get into? I think that and I might be optimistic because that's my job a little bit but this is generally believe that everything has the potential to be revolutionized by virtual reality. I kind of look at where we were not even 10 years ago with mobile applications or even web applications at the time and you're starting to see industries picking up virtual reality very quickly. Things like the medical industry and being able to do things like pain management or doing kind of therapy techniques in VR. Getting over phobias is a really big one in the medical industry. I like to show the Excel graph visualizer that I built as an example because I think that as big data gets more and more prominent we're gonna see a lot of opportunities to start visualizing data in new ways. One of the things that I really wanted to do but haven't gotten a chance to is kind of replicate that project but doing things like finance. How much more interesting would my bank account be if I could go in and see it in stacks of dollar bills everywhere and be able to relate to that in a very physical sense rather than okay I think that number may have been lower or higher than yesterday but I don't actually see where it's going whereas if I had a VR experience for my transactions I could see my money get into a little car and drive away if I bought a car or something like that. We're not there yet but I really do think that there are examples of virtual reality that are just gonna come in and change everything and a lot of the really cool stuff hasn't even been thought of yet. Somebody maybe more skeptical asked will web VR suffer the same 3D fatigue that the movie industry went through after its initial hype? I don't think so but I can't speak for an entire planet of people and creators. That's a lot of power in which case then no, everyone's gonna love VR, there's no questions there. I think that it's important to be realistic about what the technology is capable of today but I think that given what I've seen I don't see hype going away and I haven't over the last two and a half, three years as releases for different products were delayed and we're only really just at this very, very tiny, tiny beginning of this ecosystem that's building up. People like to look at low percentages of adoption but realize that we're still so early on that it's kind of like looking at a super Nintendo and saying like, oh that's not actually going to change like gaming, no one's gonna have consoles in their house in 10 years. So I am very excited about VR. I don't think that it's gonna go anywhere because I think we're already starting to see cases where enough value has started to been being provided by virtual reality experiences that there's not really a reason to say, okay well maybe just because it doesn't have as much hype as we thought it didn't already do some significant things. One example that I think really illustrates both that question and the one before it is that about a year ago a doctor was able to save a little infant's life by walking through a 3D scan of her heart and that's not something that ever could have been done before this technology started to come into play. So if you ask that child, do you think that the hype for VR is gonna go away? Probably not because it's already shown that it has some really very real implications and I think that as we kind of look at the consumer space and what people will expect from it that's going to evolve a lot over the coming years but I think that the value that it's already adding to so many places is just not something that you can take away easily. Cool, last question is less philosophical and more dev focused. How can you possibly automate UI tests for web VR? That's a really, really good question and it's something that a lot of new startups right now are kind of looking at. They're looking at how do you capture analytics in VR anyway?  Like how are you generating those depth maps about where they're looking, how they're engaging? So I think that it's really interesting because right now you're at a stage in the industry where more of it is like is the user even understanding where they're supposed to look and how do you build techniques around that? But I think that when you start to kind of look at this the tools will evolve around 3D development, 3D environments, I could write a script pretty easily that would walk through that and if I had done that I wouldn't have had a video that didn't play when I got on stage and that technology all exists right now. It's just a matter of having developers who are really passionate about it, building these tools and like I said there's so much opportunity right now for kind of taking all of the information that you have available on the web today and synthesizing that into things that are going to help make VR better. So it's not probably an actionable question to answer right now but I think that potential is there and I'm really hoping that maybe next time I'm at a conference like maybe next year at this conference someone will have built that library to do that. Cool, thank you. Give it up for Lev Akson. Thank you.