Hi, guys. Thank you so much for having us here today. So thanks for the invite and the intro. So as Roy was saying, I'm the Chief Creative Director at Warrior 9. We are a content creation house based in Singapore. And we are currently working on a series called the Phoenix, which is the first animated sci-fi series in VR. So it's quite unique in terms, at least as far as we know, nobody in Asia is working on VR fiction content or content that is fiction and animated as well. So what I'm going to do today is just talk to you a little bit about what we've been experiencing when we've been creating this content and some of the learnings that we've been getting out of this. So before we started on anything, earlier this year we completed a proof-of-concept teaser just to see if you could, in fact, tell a cohesive narrative story in virtual reality. And what I'm going to do is just to make sure we're all on the same page, I'm going to show you a 2D version of this teaser. And afterwards you can just grab any one of us wearing this t-shirt and we can show it to you in VR. We have the headsets with us. All right, so just give me a sec. Let me just pop this on for you. Okay, sure. We've completed the teaser, obviously, and we are currently in full production of Episode 1. The cool thing about the teaser was that we were able to try out many different techniques and styles in a very small time space and we were able to experiment a lot. And I'm sure you were able to see some of that in what we did. When you see it in VR, and I highly recommend it, if you have not seen it then you should, you will be able to see how immersive the story is. So let's talk a little bit about the production and what went into that. We actually did it on the Unreal Engine. A lot of people are using Unity, but we decided to go with Unreal. And we're going to actually do the entire series in Unreal as well. Because animation, we did the 3D models, created the 3D environments. And for the movement that you saw, the characters there was all motion capture, facial capture. And of course, we used a local artist, Mesh Manukar, to do the voiceover, which fit quite well.  And obviously, individually these aspects are great, but it's only when we put them all together into VR that we knew that we had lightning in a bottle. Okay, so what have we been doing since we finished this? So we went on the road for several months and we went to a number of events. We were at, around the region, we were at Innofest Unbound in Singapore, in Etchelon. We were at Rise in Hong Kong. And we even went to the Indonesia Comic Con in Jakarta just to show it to people from inside and outside of the industry. We showed it to more than 850 people. And for a majority of these guys, it was their first time viewing it. Overwhelmingly, we got positive response, which was great considering like it was different segments, different ages. It was a huge learning point for us. And we got a lot out of it. Okay, so what did we learn? Well, specifically, what did I learn from creating this content and working on it? Some of these may seem obvious, but when you delve down, you'll see that there's more to it. So the first thing is, let's talk a bit about the differences between virtual reality, storytelling in virtual reality and 2D. All right? What we have today are, a lot of people obviously know that VR is a relatively new technology, but what they don't really realize is that it is a new medium. And a new medium requires a new cinematic language. So the things that we do in 2D, you just can't replicate it into VR because it just wouldn't work. So for example, if you just take this opening sequence, if you look at the images there, when we slowly moved into the planet, if you were to do that in 2D, you would have cuts, you would have close-ups, you know, people, they would want to show it, guide you and show you how to view the narrative. We don't have that option in VR, and we shouldn't be trying to force people to do it. That's a conscious decision that we made. The content that we create is so that you should be able to watch it multiple times. One of the points that was raised to me was that, you know, when you do a dogfight in virtual reality and somebody fires a missile, the missile doesn't just disappear when it goes out of your point of view. It's still there, so you need to plan it out, saying, does this missile, what happens to it? It hits a rock, what have you, there will be people sitting there following this missile and just seeing what happens. That's what virtual reality is about. A lot of the content out there today is quite gimmicky. I think a lot of you will agree with me. You know, the usual roller coasters, et cetera, et cetera, which you've seen multiple times, which is great to experience VR, but in order to tell a story behind it, it has to be just more than these little cinematic gimmicks that have been put together. Ultimately, if you are a VR content creator and you're trying to tell a story in VR, you have to be able to straddle the technology and the ability to tell a good story, and that's what we are doing in Warrior IX. So, as I said, we showed it to 850 people, more than that actually, and the resounding thing that we got was that people are ready for VR. We were in countries where we met with established studios and they were like, oh, you guys are doing VR. We're not. This country is not ready for it. Flat out. That's what they told us. But when we went out to the events, it was a totally different story. Once you get people past the technology, once you get them into watching VR, they totally got it. They were like, wow, that's great. I want to know. I love this. I want to see more of it. What they didn't know was that, okay, basic things. You need a headset to watch VR. A lot of people we met didn't realize that, which is fair enough. The education is still lacking. That's part of the things that we're working towards as well. A lot of misconceptions. We would tell people this is not a game. They would watch the teaser and be like, that's a great game. Where can I play it? It's not a game. The misconception, of course, is that VR is only for gaming. And it's not their fault because initially, when the VR push occurred, it was all about gaming. That's something that we're facing as well. We met a lot of people who were like, oh yeah, I know everything there is to know about VR. And then we asked them to put on the headset and they were fumbling around. So to me, there are no experts in VR. If anybody tells you that I'm an expert and I know it and I can get this done, be very cautious because most likely they don't know what they're talking about. Right now VR is all about experimentation and it's all about patience. So for those of you who are meeting with clients like we did as well, who are looking for VR content, there's a few things you just need to clarify to them. Like what are the limitations of VR? What is it that they want to do? Why do they want to do stuff in VR? If it's just to have a gimmick, then it's probably not worth your time, to be honest. The whole point of it is to do something creative, immersive. Virtual reality is an immersive technology. You need to utilize that beyond just what everybody else is doing. The other thing about client interaction is cost. So a lot of the client base that we met from corporates to what have you are interested in VR because everybody's talking about it, but they don't want to spend too much money on it because they don't believe that they're going to get back what they're going to put in. Again, that's your call when you're having that conversation, but you need to be very clear on what your cost point is. Again, it's all about experimentation. You're not going to get it right the first time around when you're creating the content for them. You're going to have to play around quite a lot and the clients need to be aware of that. The final thing I want to talk about, which I'll just spend a few slides on actually, is as content creators in virtual reality, you need to be able to think about it from end to end. It's not just about inception, creation, production, post-production. Here you go. No, because the industry is too nascent. How is the client going to be showing this to their users? How do you want people to view this? Those are the things that you need to be thinking about. It has to be an end-to-end thought process. Okay, so let's talk about distribution and what we're doing with the Phoenix. When we created the teaser, at that point, it was still, I mean, it still is early days, but it was even earlier back then. So we decided we're going to create it in virtual reality and 2D. So if you go to our website, the 2D version is there. We're going to do the same thing for the series throughout as well, just so that people who do not have access to virtual reality will still be able to enjoy this content. In terms of the devices that you want to look at, Warrior 9's philosophy is that we want as many people as possible to see our content. So we're not going to be restricting it as much as we can to any kind of device. Mobile VR is one of the fastest growing, and that is the most easily accessible at the moment. So that's what we decided to focus on. This doesn't mean that we're going to be cutting out the high-end headsets, but they come with a different bunch of issues which I'll talk about in a bit as well. Once you figure out the devices that you are focusing on, let's talk about the platforms. So there's a number of growing distribution platforms of VR as well. The space I'm quite confident is going to change by this time next year, but so we are also being very cautious. One of the great things about these platforms is you don't have to, you just give them your content, and they will figure out how to get it working on their devices as app-based, right? So some of these, which we're looking at for our distribution model right now, YouTube 360, Jaunt, Veridio, Little Star. YouTube, Veridio, and Little Star are quite similar in terms of you have a channel, you upload your content, there is minimal supervision, and only if somebody complains about your content will they look at it. Jaunt will actually ask you to submit the content, and say, yes, this meets our quality standards, and only then will they upload it. So I mean, we quite like that in terms of it's not just anybody putting up stuff. So for example, when I looked at Veridio, their top video was Two Spanish Girls in a Bikini, and that was there for like six months or something.  And of course, the other option is you create your own app. A lot of people are doing that as well.  Of course, if you're creating your own app, you also need to make sure it works with every single device that you want it to work with. So there is quite a lot more overhead on that. One of the final points I wanted to make, and this is one of the reasons that we are not focusing solely on like the high-end headsets, if you'll notice I never spoke about the Oculus Store or any of these major stores, which is quite common. A lot of people just go and submit it to them to upload. One of the things that we found in our research was that you need to be very careful, you need to check the terms and conditions that each of these guys are posting. So for example, with Oculus, there's a little section under section six, which is user content, which I'm not going to read it out to you. I mean, you can go and have a look at it. You can see it's available for everybody on the website. But ultimately, they own your creative content. If they accept what you've submitted, they have the right to do whatever they want with it. They can use it for their own marketing. They can give it to other people to use as well. I mean, it's very clearly listed out here. For example, it's royalty-free, fully sub-licensible. They can do whatever they want with that. To me, as an indie VR content creator, it's quite disappointing. Oculus is somebody, is a company that I looked up to initially because they were the ones at the forefront of virtual reality. Their tactics, some agree with them, some don't. I don't agree with them. But it is what it is and we decided, okay, we're going to focus on mobile VR and that's what we're going to do. Question. Sir, can you clarify, is that for promotion purposes or they can do so? They can do whatever they want. So you grant Oculus a worldwide, irrevocable, perpetual, non-exclusive, transferable, royalty-free, the whole, the legal jargon is that they can do whatever they want with it. You wouldn't expect them to monetize it and cut you out, but they have the ability to do that. So I'm not saying that that's what they're going to do, obviously, but they have the ability to do that, which is quite, can be quite scary for indie VR creators. So essentially that is what I wanted to cover with you guys. Please do feel free to come and have a look at the VR version afterwards. We have our website, which is thephoenixvr.com and I'm going to open it up to questions. Yes. How are you going to monetize? That's a good question. So our, again, this is going to be a very, it has to be a flexible distribution methodology. So the first, so right now we're planning to create nine episodes. Each one of these episodes will be five to 10 minutes in length and we're planning to complete all of these by end of next year, 2017. The first episode we'll be coming out in Jan is our plan. So our intention is to have the first three episodes for free. We're going to put it on YouTube, those channels which I just mentioned, YouTube, John, et cetera. It'll be there available for free. And I believe that will take us close to halfway point of the year, at which point we'll know what the distribution, well, we'll have a better idea of the distribution model. After that, we're going to ask for a very nominal fee for access for the entire season. That's our plan right now. Whether it's going to make guarantees of significant revenues, we can't tell because it has to be on the merit of the story itself. The content is what's going to create your fan base. So it's going to be an experiment. We're not sure, to be honest, at the end of the day. We have a monetization model in place, whether it's going to be significantly profitable or not, only time will tell. Yeah.  YouTube 360, I have not seen any ads on that at the moment. Sorry, question. Oh, sorry. It does because of the sound and the music. Ah, okay. So based on the music royalties. Yes. So there is an ad component to it. Any, oh, yep, back there. Sorry, Zagan. What's the camera rate that you use to capture content? And what's your, what has been your experience with selection of these?  He can talk a little bit about Hassan. What was your question again? Basically, what camera rate do you use to capture content? For the motion capture. Yeah. We used a combination of techniques. Obviously we're not a huge studio and I'm responsible for almost all of the production of the assets from the animation, the artwork, to rendering and everything. We were fortunate enough with my previous company that we actually had a 26 camera opt-a-track system. And so for the guy in space that was actually me wearing the Spandex suit with the tracking markers, the girl was a friend also using opt-a-track. And then for the end character, the eye patch, that I put 32 markers on my face and we had a camera setup for doing that. And then actually we used the Kinect 2, the Breckle app for that for a second face. I forget which one that was in it, but a combination of both. Moving forward, we're going to try to keep it with the Kinect as much as possible. We think the cost point is pretty effective for what you're able to do with it nowadays. Obviously it's not a one-stop solution and as with doing anything with animation, it takes a bit of time and tweaking and cleaning up. But for what we're doing, it then comes back to maybe try to limit what you're doing in the script to something that works better on the Kinect. No crazy three-person fight scenes obviously. So it's about tuning your content to work with the tools that you have. So episode one is actually, the motion capture on that is going to be done fully on the Xbox Kinect. We're experimenting with that. Question? As a new medium, what do you think is the best kind of content to produce? I just want to know. You saw it right on. I think for me it has to be episodic. It has to be an episodic I think all of us are here because at some point we had that VR experience where you were just in awe. You saw something which just blew your mind. And that happened to me and that happened to pretty much all of us in Warrior IX. And that's what we wanted to portray with the series. The reason we're doing the series is to show everybody, not just gamers and people who have access to high-end VR headsets, how amazing virtual reality can be and how immersive it can be. That's what we're focusing on mobile as well. So we thought about it and we were like, okay, I've seen stuff which is like 5-10 minutes long and it's great, good quality, but what else is there? So that's the reason we're doing it as a series. It has to be episodic to bring in people to keep them coming back. So as a viewer, I want you to be watching each episode multiple times. See first of all, what did you miss? And then I want you to look forward to the next episode so you can do the same thing and just keep watching it and let the story go. So episodic would be a big part for me, yeah. Yeah? Audio, while creating in Unreal, do you use any specific plugins or just use the default solutions for audio in Unreal? So this one, we just did it in stereo, but there are solutions which I can let Grace talk about. Yeah, there's a few different plugins that offer spatialization for it the problem with doing that then I think is kind of the problem with adding any type of plugins to stuff that you're doing is then are you limiting who you can help experience that. I know YouTube offers a pretty standard spatialization plugin now. I'm sure that's coming to everyone and as the programs progress, that I think will just be a built-in feature in the future. But just to give you an idea of the dynamic between the two of us, I'm the guy who writes all the stuff and drives him insane when I'm like, I want this to happen. And he will just look at me and then it's a process from there onwards to see what can we really do. Yes? I'll create a plan, et cetera. Here I guess you have to reinvent everything. Yes. Do you have, or do you do that? Do you have a community where everybody try a bit or is that considered as your IP where you develop it yourself and you don't share it or do you want to share it and create knowledge based on that? For the Phoenix, it's our IP. We are not, I mean, we haven't actually thought about sharing it out at the moment just because we want to build traction and get people behind it. As far as I know, there aren't really any major communities built around experimentation with this. So for example, if you look at what's, the major stuff that's coming out, fiction based in VR is really driven by the big studios out in California and Silicon Valley and stuff like that, Oculus Labs and all those guys. If you see any of the live action series that are out there which are episodic of their live action, I find them very confusing personally because they seem like, because first of all you have a big Hollywood director or some big Hollywood personality involved in it and it seems to me that you would get the same effect in 2D because they actually cut in there which is very jarring for me when I'm watching it. And they are trying very hard to say you have to look here. You have to look here. I'm going to cut so that you look here. The first thing that came out was Invisible. And in that one, if I remember correctly in the opening sequence, it would lock to where you're looking. So the title sequence would follow you around. Even if I wanted to just look around and see, it would just be stuck to me. So again, it's an experimentation and I did read a lot of the articles behind it and the work they did, but it seems that it was more technology based experimentation rather than storytelling based. And of course people have their deadlines, but the reason we pick animation as well is because live action, to me, is too much detail. You really want to look at the street and look at a lamp post or something like that, whereas the story is going on. Whereas with this, we can control it. We can control the level of detail so that you can more naturally follow what we're talking about. Yeah. Have you had one last question? Why did you use a new MG? Why? I will let you know. That was a choice from the beginning. I think mainly because technologies to the point where video cards are powerful enough to give you what I would consider 90% photo reel. If you really push it, you can get there. But it's running in real time. So when we compose a scene, it's like a sandbox. You can put your camera rigs in. You can build your setting and environment. You can change the lighting in real time. And then you can put the headset on and immediately see what it looks like. And now when Unreal, they have editing in VR.  And I think the final output, because it's going on YouTube, we have to render frames. And we're doing 4K lat-longs. And those still take about two minutes per frame to spit out on the machine that we have. That trailer would have taken months to render had we done it in a traditional pipeline where you got to do the whole scene every time. So I think real time is pretty hard to at least not consider for your projects just given the rapid prototyping ability. Yeah. Yeah, I mean, as I said earlier, because we're a small studio, we don't have the resources and availability. Unreal is also free, yes. So because we're a small studio, we don't have the leeway to spend months rendering out stuff. So really, we did a lot of investigation in saying, like, what is the best and low-cost resource effective, et cetera, et cetera. What are the best ways of doing it? And that's why I mean, I remember he was talking to the Unreal dev guys who were asking him, what are you creating exactly because this is not what the engine is made for. And we were like, yeah, we know, but we are creating this. So, yeah, I mean, it's... And the experimentation is going to go on. I'm going to give him a few things from left field and Ray still have to figure out with me, yes? Yeah, exactly. So... Okay, that's all the time, right? Thank you so much, guys, for listening. And check out the website, sign up for the newsletter. Come and watch the VR version later. Okay? Thanks, Avian.


All right, so our next talk is Secure Non-Interactive Simulation, Feasibility and Rate. This is by Hamid Reza Khorasgani, Hamanta Maji, and Hai Ingayan, and Hai will give the talk. So, yeah, go ahead. Hi, is your microphone on? Can you hear me? Yeah. Yeah. So I'm going to talk about Secure Non-Interactive Simulation, Feasibility and Rate, and this is a joint work with Hamid and Maji. So let me start with some motivation for studying Secure Non-Interactive Simulations. So a prominent paradigm in Secure Computations is a pre-processing model. And this model has produced some successful stories. In this model, there are two phases, the up-life phase and the online phase. The up-life phase attributes correlated private elements to parties. And this step is independent of the functions and also the input of the Secure Computation performing the online phase. On the other hand, the online phase is fast and can achieve information theoretic security. And this phase consumes correlations generated from the up-life phase to perform the derived Secure Computation tasks. However, there is a concern for this. So online protocol needs very well-structured correlations. And similarly, well-structured correlations is very aggressive. And if the online protocol is using some cheap correlations, like the noisy correlations, then the online protocol is usually not has enough, it is slow. So one idea, the solution is to transform cheap correlations into well-structured ones and non-interactively and efficiently. So motivated by this, we introduce a new model, we call it Secure Non-Interactive Simulation. So the objective is to simulate a sample of target distribution UV from an independent sample of some sort distribution xy. So in this one, Alice gets xn and Bob gets yn. Additionally, Alice also has access to private-runner-ness IA. Bob also has access to a private-runner-ness IB. And then Alice applies a reduction function on her samples and the private-runner-ness to obtain the input U-pram. Similarly, Bob applies a reduction function gn on his samples and the private-runner-ness IB to obtain an output V-pram. So the coordinates of these simulations, it will ensure that the joint distribution of the outputs, it goes to the target distribution. So in addition to the coordinates, we also require the security conditions. So we formulate these security conditions based on the universal composable security by Kennedy. So in this model, it is secured in Corrupt Alice. It's a distribution of Alice's sample condition on fixing the outputs. It's rapidly independent of the Bob outputs. In other words, the view of Alice can be simulated only from Alice's output. And similarly, it is secured in Corrupt Bob. It's a distribution of Bob's samples. Condition on fixing the outputs is rapidly independent of Alice's output. So these three conditions together define secure non-interactive simulations of UV from I-square. So to study the rate, we consider M independent samples of the target distribution UV. So the rate of these simulations is a maximum achievable rate, is a maximum achievable ratio M by N. So this similar looks very similar to some existing ones in information theory and cryptography. So let me mention some of them, yes. Secure non-interactive simulations in information theory take a lot of zero random correlation generators, which we introduced very recently. And second, secure simulations in cryptographic extensions of non-interactive simulations, which are a classical problem in information theory. So in non-interactive simulations, security is not a concern at all. And first of all, secure non-interactive simulations in generalizations of non-interactive correlation simulations to arbitrary targets. And finally, one can use a secure non-interactive simulations at a restriction of one-way secure computations to no interactions. So in one-way secure computations, only one participates and the other participates. So I will focus on two fundamental correlations. So the first one is the noise from the binary symmetric source. So for this source, Alice receives an uniform random bits, plus one and minus one. And here we use the multiplications, plus one means zero and minus one means one. And we probably one minus epsilon, Bob receives the same bits. And we probably epsilon Bob receives the Philippines. So I'm representing this correlation as BSS rho, where rho equal to one minus two epsilon. And the second correlations is a noise from binary eraser source. And again, Alice receives a uniform random bits, plus one and minus one. We probably one minus epsilon Bob receives the same bits. And we probably epsilon Bob receives the erase bit. So we use notation zero here for the eraser. And I represent these correlations as BSS rho, where rho equal to square root of one minus epsilon. And the reasons we choose the parameter rho, because rho corresponding to the maximum correlations of this source. And maximum correlations is a very prominent quantity in information theory. And we see later that this is also very convenient for our representation. So let me give you an example of insecure reduction. So the example in deductions from reduction of binary symmetric source from one sample of binary eraser. So Alice had an uniform random bit x, plus one or minus one. And Bob has y equal to the Alice bit with both the one minus epsilon. And otherwise it is zero. And so Alice's reduction function work as below is just output per random bit x. Bob output y is y e plus one or minus one. And otherwise it's output in uniform random bits. And you can see that this implements the output u prime and v prime implements an BSS with parameter rho prime, where rho prime equal to this quantity. So it is correct. And one can verify that it is secure again, correct Alice. But this reduction is secure again, correct Bob. So the reason is that as a conditional distribution that you can see here is not independent from u prime. This is Alice's output. So next, let's take a look at secure reduction, where we can simulate one sample of BSS from two independent sample of binary symmetric source with mass symbol correction rho. So the reduction is very simple here. Both of these just output the products of their samples. This u prime equal to the product of the first sample times the second sample, and similarly for Bob. And for this, we can verify that it is a correct and secure course such as. So our questions from this model is that given a source and a target distribution, is that possible to simulate the target distributions from the source? So in other words, we are interested in whether it is feasible or not. And when it is feasible, we want to make it very efficient and we try to simulate as many samples as possible. So we're interested in what is the more efficient secure simulations. So we initiate the study of feasibility and great of secure non-interactive simulations. And in an independent work, Aguawa et al. introduce the same primitive. And they focus on studying the feasibility from arbitrary source and target distribution. And you will see this in the next talk. So let me summarize our results. Our first loss is a de-randomization. So basically, this is telling us that private randomness is a risk for secure simulation. And in fact, we have two different ways of de-randomize some reduction functions. The first one is for the PCBP results and the second form is studying the risk of secure reduction. So our first de-randomization results tell us that if there exists random microstructions, then there also exists deterministic constructions that use more number of samples but asymptotically the same. And with almost identical simulation error. However, this simulation is not enough to study the rate because it doesn't preserve the number of samples. It is more number of samples. So we also put that it is possible to de-randomize the constructions using the same number of samples but with slightly higher simulation error. So the constant here usually either half. So we can achieve square root of nu if the original random microstructions achieve simulation error nu. So our work focuses on secure simulations between binary symmetric sources and binary eraser sources. So first we show that it is impossible to simulate binary eraser source from a binary symmetric source of five percent. And next we consider the cell reductions between binary symmetric sources. And we show that it is feasible if the maximal correlation of the target distributions yield power of the maximal correlations of the source distribution. And in this context, when this happens, we show that the rate is less than or equal to one by two. And interestingly, we can prove very strong results. It tells us that a statistical constructions can be error corrected to a perfect constructions. So in fact, we show an academy of secure simulations. That is, either there exists a perfect constructions or any constructions have constant insecure. And finally, we also consider the cell simulations between binary eraser sources. This looks very similar to the simulation of binary symmetric sources. And basically, so this is similar, but here for the perfect constructions, we are able to show that only linear production functions work. And for the rest of the talk, I will be focusing on the technical ideas from our work. So to go about, let us take a look at the impossibility of binary eraser source from binary symmetric source. So first I want to note that the impossibility result from insecure simulations and one way secure computation naturally carry over to the secure simulations. And reverse hypercontactivity and Haris claim inequality as a two main technical tool to prove the impossibility results. So let me give you some intuition how to prove the impossibility results. So here, if we look at the target distributions, suppose that Alice outputs equal to plus one with some constant probability. And also that the box output equal to minus one with some constant probability. Then this technical tool tells us that these two events must happen simultaneously also with some constant probability. However, for the binary eraser source, this quantity is zero. So that's why it is impossible to simulate binary eraser source from binary symmetric source. So next, we take a look at the impossibility of binary symmetric source from binary eraser source. So here I want to note that this problem in the other models, the insecure simulations, and one way secure computations is still open for some reason of parameters. And these problems seem quite challenging in this setting. However, in our setting, with the security conditions, we are able to show that it is impossible. So let me give you some high level idea of how we prove that. So we prove it by contradictions. First, we fix some sources and the target distributions and suppose there exists a statistical distance as opposed to the statistical constructions. So our first step, we did undermine some reduction functions. So with that, we can say that the reduction function is deterministic. And then we out-surprise the security definitions. And to out-surprise this, we use the macro and the joint macro parameters of the source distributions. So from the series input, we can out-surprise to the following out-surprise constants. So I'm not going over the details of these constants. And from those constants, it implies an approximate eigenvector problem. So basically it's saying that some combined up to two macro operator applied on the function F should be close to a scaling of the function F. So intuitively, F should be an approximate eigenvector of the macro operator T-tivor. And then interestingly, we observe that when we apply the two macro operator together, it is equal to the Konami vector noise operator with parameter both square. So we use a Fourier analysis to show that the rho prime square e of power of rho square. So in other words, the maximal combination of the packet distributions e of power of the mass, e of power of the mass immigration of the source. And furthermore, we can show that the spatial width of the reduction function F is mostly concentrated on dv-gay terms. So with the concentrations on low-dv terms, we can apply a powerful tune from a harmonic analysis, that is, with the Hunter theorem. And we can conclude that the reduction function F will be close to some constant Hunter Boolean function H. So H here depends only on constant number of input variables. And it is independent of the number of samples F. And finally, we use the random prediction techniques to prove that the simulation errors elicit a constant. And here is a high-level template to prove the results. So first, we de-randomize, and then we out-surprise the security. And from the out-surprise-ations, we get an approximate eigenvector problem. And from that, we show a Fourier concentrations. And for applying the Hunter theorem, we can do the dimension reductions. And next, we take a look at the feasibility of binary symmetric source from another binary symmetric source. So intuitively, we follow that template with the show here. So we are able to show that the massing of the target distributions must be a power of the massing of the source. And it also is the case that the spectrum of reduction function F concentrated on some dv k. And we also show that both reduction function F and g should close to a constant Hunter Boolean functions. So it depends on only constant number of input variables. So let me give you an example. I just see. So I just see it before. So linear reductions F and g here, we can simulate one sample of BSS row from two sample of BSS row. And this is a linear constructions. And all the Fourier weights of this function concentrated on dv2. Because here, your linear term is a product of two variable x1 and x2. But interestingly, for this, there also exists nonlinear reduction functions. And this is a nonlinear reduction functions. I'm not going over the detail of these constructions. But you can observe that these constructions also have the Fourier spectrum concentrated on dv2. Because all the terms here have dv2. It's a product of the two variable. And observe that this construction will force samples of BSS row to simulate one sample here. So we need four samples here. For linear reductions, we use only two samples. So a natural question to ask is that a nonlinear reduction function always works than the linear reductions. And interestingly, if we look at some simulation of two independent sample of BSS row graph, then in fact, using two different nonlinear reduction functions, this one and this one, then we can also achieve, we can simulate two independent sample of binary symmetric source. So at a summary here, the block linear reductions achieve the red half. But nonlinear reduction also achieve the red half. So here, it is natural to ask another question. Can nonlinear reduction surpass the red half? So in fact, we prove that for perfect constructions, the red can be at most half. So it means that nonlinear reduction functions can be at most at most at the linear reduction function for the simulation of binary symmetric source. So I went over the detail of our life here. But for the statistical simulations, this problem remains open. And we have the following conjecture. It related to harmonic analysis. And here, I want to emphasize that if we can prove this conjecture, then it shall prove the red from a statistical simulation of BSS from BSS. So let me briefly go over the conjecture here. So we want to say that if we have three functions that are all homosilias, and any pair of wires, it is also a homosilias Boolean function. Then it must be the guy that that product is also homosilias. So if we can prove this, we can prove a local to global structure. And this will help us to prove the red result for statistical gains. And finally, we also found an interesting connection between CQ simulations and distant invariant codes. So of course, C, a distant invariant is a number of code rules as written i from a fixed code for C. It is independent of the code for C. So intuitively, if you look at the red commemorator of C plus with any code word in C, it is the same. So we show this connection to the CQ simulations of binary symmetric source. So we saw that if there is a CQ simulations of BSS from another BSS, even if the two reduction functions are identical. And so distant enumerators of any code word but in the P image of the reduction function F are identical. So at a summary, we introduced a new model, a CQ non-interactive simulations, and we initiated the study of feasibility and rate of this model. And we gave a complete characterization of feasibility and rate among binary symmetric sources and binary erasers sources, except for the statistical rate of binary symmetric sources. And we proved very strong forms of statistical to perfect reductions. And finally, we saw a connection of CQ simulations among binary symmetric samples with homogenous Boolean functions and distant infinite codes. And thank you for your attention. All right. Thanks, hi. So we're running a little bit over time. So I think maybe if anyone has questions, I'd encourage you to sign on to Zoom and ask hi in chat. And we'll set up for the next speaker. Thank you. Thanks. Thanks.


Can you be fulfilled where you are at this current moment with what you have and still want more? The answer is yes. Today we're going to be talking about how to finally feel at peace. We're going to dive into that and we're going to go deep and it's hard to find peace with where you are for everybody most of the time because we live in a society of more. We live in a society where too much is never enough. You always need the next thing, the next car, the next best thing. And if you don't have the new iPhone, you're completely behind. If you don't have the new MacBook, you're completely behind. If you have a two-year-old car, you're completely behind. And when you live in a society of more, it's hard to be at peace simply because peace only comes when you're satisfied with where you are. We live in a society where we see hundreds and hundreds of advertisements and billboards and logos all day, every day. We see them on YouTube, we see them on Facebook, we see them on billboards, we see them when we're driving down the road, we hear them on the radio, you hear them everywhere. There's nothing wrong with advertising. I want you to understand that. There's nothing wrong with it at all.  Now you need a new apartment because you feel like yours is trashy. We live in a society of more. Too much is never enough. You have to have more, more, more, more consume, consume, consume, consume. Think about that for a second. How could you possibly feel 100% at peace if you always feel like you need something more? You need something else. You need those new shoes, you need that new bag, the new Jordans came out. You know, when you live in a society where you have to have the newest car, the newest phone, the biggest house, the nicest clothes, more toys for your children, all of that stuff, it's hard. Oh, your neighbor got a new boat.  It's constantly feeling like we have to keep up with the Joneses. But if you ever stopped to just ask yourself, why, why do I have to keep up with the Joneses? Why do I have to buy these new things? What's wrong with this iPhone when there's a new iPhone that comes out? Why do I have to have the new thing? You know, why do we always want more? Why is it built into us to always feel like we have to have more? We live in a society that is built around constant consumerism. Our society works when the government is making money and the government makes money when businesses make money so that they can tax them and people make money and things are bought. That's the way the governments work. Governments do not work if they're not making any money. Government is a giant business no matter what literally no matter what country you live in.  Why can't we just be okay with what we currently have? It's really hard. It's hard to get to that point. And I had a book that I read probably about eight years ago now and it was talking about, you know, retiring early.  Because if you look in your house, like I have many things in my house that I, I have less things in my house now than I had over my entire lifetime. If you were to add it all up, I have tons of different stuff that I've bought over my lifetime that I don't have anymore. I don't know where it is. And they said, just imagine if you were to get everything that you've ever had and put it into a pile and you could see that pile of all of the stuff that you have gotten rid of over some point in time in your entire life, you've gotten rid of it. It's gone. What would that pile look like?  Would it be a, you know, 500 feet tall, a mile wide? Would it be a size of a football field? What would it look like? Just imagine in your head, and now what I want you to do is take that and multiply that by three or four billion, because obviously there's, you know, over seven billion people in the world, but not everybody in this world buys as much stuff as we do in the countries that you're probably hearing this from.  How big would it be if it was multiplied by three or four billion? That's all of the waste that we've created. Not even talking about all of the plastic that I've had from to go and all of the, every single plastic fork and knife and spoon that I've ever used. It's just a pile of stuff. And you start thinking about that and you're like, man, I do consume a lot. Even if you're not, even if you consider yourself some form of a minimalist, you're still consuming a lot at all points in time. And, you know, I don't want you to think that having nice things is a bad thing, because that's not what I'm trying to get to. What I'm saying is the feeling of always having to have something else is the bad thing. I had my, I struggled with this for a long time as well, where I had a, I was on this mindset of, I'm a minimalist. I don't need to have things. I'm going to take this car that I have and I'm going to run it into the ground. And I had a 2000, a light blue 2007 Hyundai Santa Fe. You know, I got it all the way back in 2010. I got it. And I was like, you know what? I'm going to run this thing into the ground. And I took pride in being like the person who's like, I don't need a new car. I don't need a new car. I don't need a new car. And I use it for years and years. And there were some issues that it had. One of my friends came over and we were talking and he happens to be an extremely successful guy. And he's in his fifties. And in all honesty, he's worth about $150 million. He's not extravagant, doesn't have a massive house, doesn't drive a really nice car, doesn't wear clothes you would make you think that way. But one thing that he said to me that really stuck, and I'll always remember this for the rest of my life, he said, the reason why I like to have a nice car, and it's not even like a crazy nice car. It's like a Lexus, right? The reason why I like to have a nice car versus just a rundown beater car is because I think I just arrived better. I like driving in a nice car. I feel better about myself. I feel better about the ride. I feel better about getting into that car and driving than I did with my old car. So I arrived better. And I was like, oh, God, now I'm going to have to go buy a different car because it hit with me. I was like, that makes sense because I hate driving in this car. I literally hate it. I think about it being in the garage and I hate it. And I was like, okay, I've got to get rid of it. So I went and I bought, you know, and so if you think about the 2007 Hyundai Santa Fe that I used to have, and I have a new Ford Raptor now, which I love, I love driving that. And I feel like I show up better. I didn't buy that truck for anybody except for myself. I didn't want to show off. It wasn't anything like that. I just thought, you know what? This is what I want. And this is how I want to drive. I want to have some space. I want to have some nice or I want to have some leather. I want to have some cool little features and stuff. And I want to be able to off-road found out that was the one that I wanted and I bought it. And I noticed the difference in the way I arrived when I have a nicer car versus a car that I hated. Now I'm not saying go and just spend all of your money to get a nicer car. But what I'm saying is in that case, it's not bad to want nice things. I've struggled with that for a long time. It's not bad and not want nice things. It's bad to feel like you have to have the next thing and you're not good enough as you currently are or your life isn't good enough as you currently are until you get that thing. That's where it starts to become toxic. But you know, it's like I always say, like most people, 99% of people who own a Ferrari, they don't own a Ferrari for themselves. They own a Ferrari because they're trying to prove something to other people. They're trying to impress other people. If you want a Ferrari, simply because you want a Ferrari deep down inside, there's nothing wrong with it. It's just a vehicle to get you from point A to point B.  He must have a lot of money. She must have a lot of money. She must be famous. All of that. Then that's when it starts to become toxic. The only thing that's bad about it is the feeling of always wanting more because you're not going to be at peace if you always want more. If you feel like you're not good enough until you have this thing, the things won't bring you happiness. You've heard this before and you're like, yeah, I understand, but I would probably still, you know, I would still like to drive around in Ferrari more than like driving my beater car. Cool. Great.  And I think part of the problem is that number one, we think that happiness is what we're searching for. And we think that things are going to bring us that happiness. So therefore, we think, oh, when I do get this car, when I do get this house, when I do get this relationship, when I do buy that, those pair of shoes, then I'll finally be happy. And we get those things and they bring us a momentary feeling of happiness, a little bit of dopamine release inside of our brain. And then the next day we feel exactly the same as the way we did before. Things will not make you happy. And in fact, you're not searching for happiness. You're not, you're not searching for happiness. What you're searching for, what every person truly is searching for is fulfillment. That's what you're actually searching for. And just so you know, happiness is a byproduct of fulfillment. Happiness is a momentary feeling. You could be happy one moment, somebody can give you a call, give you bad news. You're taken right out of that happiness immediately. Happiness is a fleeting emotion. You're not searching for happiness.  That's what you're actually searching for.  And if you're fulfilled, you'll be happy. That's what you're trying to get to. So what is it that would make you fulfilled? That's what we really want to get to. The feeling of fulfilled is the feeling of I'm good where I am. I don't need more. I can have more. I will attract more. I can have more and I will have more. But I'm also good where I'm at right now. That's the feeling of fulfilled. That feeling is the feeling that brings you peace of I'm good. I'm happy. I'm great. I'm going to get more, but I'm not going to, I don't need more at this moment. But then a lot of people think this, well, Rob, I've heard so many times, if I'm happy with where I am, if I'm fulfilled with where I am, what's going to happen? I won't have any motivation. I'll just be this lame duck that's like looking up at my ceiling like, Oh my God, I feel so amazing at all moments. No, that's not the way that it works. Just because you're fulfilled doesn't mean that your motivation disappears.  What you're doing is you're going, you know what, I'm super fulfilled where I am. I feel amazing.  That's what's the craziest part about it. I felt this way years ago. I can't be happy with where I am. There's no possible way I could be happy with where I am because if I'm happy with where I am, I'm not going to go anywhere. No, it's not about that. It's being fulfilled.  You're achieving from a place of this is just a big game and I'm just having as much fun as I possibly can. Wouldn't it be fun to want to achieve from a place of this is fun as hell? This is a game that I'm playing. Money is just a game. Success is just a game. Happiness is just a game. Joy is just a game versus I need, I need, I need, I need. I don't feel good if I don't get it. I don't feel good if I don't get it. I don't feel good if I don't get it. I got to get a new car. I got to get a new house. I got to keep up with my friends. I got to get those new, you know, Louis Vuitton shoes. I've got to get that new purse. I've got to get this thing. Once again, there's nothing wrong with things. I'm not trying to say that. What I'm saying is the toxic part of it is you're not good enough until you get this thing. What's toxic is that you're not good enough right now as you currently are until you get whatever that is. And that's what creates consumerism. That's what creates always having to have more. Can you be fulfilled where you are at this current moment with what you have and still want more? The answer is yes. It's a delicate balance. But once you get to a place of fulfillment, you're like, this is just fun. And it becomes easier to work harder because you've realized that you've been working hard from a place of scarcity. You've been working hard from place of, I hope that I can finally get out of this place versus I'm good where I'm at. Nothing's going to rock me. I feel amazing. I love what I'm doing in my life and I'm going to go do more cool. That's where you get truly motivated because when you're not motivated, it's because you're not truly in alignment with what you're supposed to be doing. And at the same time, you're not, you're not fulfilled where you currently are. You're not searching for happiness. You're searching from fulfillment and fulfillment comes from being, you know what, where I'm at is great.  I want you to think about this question for a second. What do you have to be grateful for? Look around you and think of all of the things that you'd be grateful for that are in your immediate environment. Look at it. Look at all the things. Think of all the challenge you've had in your life. Think of all the people that you've had in your life. Think of all the things that you've owned, the people that have been there supports you. Think about all of the things that you have. Think about the sunshine that's out there. The sun wasn't here. We wouldn't be alive. That's for damn sure. Think about the fact that the trees taken all of our carbon dioxide and give us oxygen. Think about taking your dog for a walk and how grateful you are just to have an amazing companion. How many things are in your immediate environment that you can be grateful for? Because if you're searching for peace, peace comes from not wanting more. Peace comes from loving what you have. That's what you need to realize. What is it that you have around you that you can be grateful for? If you wake up every single morning and start with gratitude, what can I be grateful for?  Look at all the great things. I still want more. I'm still going to achieve more.  I'm not going to stop, but I'm so blessed with what I currently am. I'm so grateful with what I have around me. That is where you become really motivated and you become a force to be reckoned with and that's when you start doing amazing things in this world. So if you're not peaceful right now, it's because you're actually not looking at all the things to be grateful for that are around you. Else, for me to do, accept.


Okay, NASCAR fans be prepared to hate me as we dive into this one that yellow car He's gonna run into the wall NASCAR is riding them pretty tight doesn't give him a lot of room on turn four expert over here Thank you very much.  I've been told he spins out FedEx Dude's name is Danny. That's what I've been told. He's not really too happy with him After the race this one got requested from a lot of people That's why I'm using my expert analysis to dive into it He goes hey bud bud bud that wasn't fun for me. Was that fun for you? Did you mean to do that? He's like, well, I don't I don't care man I saw you but what am I gonna do and then on his way out? He gives him one little barb there verbal barb and FedEx dude goes whoa Wait a second bud and then he gives him the physical jab.    Let's go and FedEx dude is saying yes. Yes. I want to go I've wanted to go the whole time You did two runaway jabs. I'd like to go, but I got this walrus security guard all over me that guy's trying to commentate in blue That's pretty funny. I was grabbing his cheek. It's not worth it. It's not worth it backpack guy looks very much like a guy That says it's not worth it. It's not worth it. Look at that beautiful sunset. Holy moly.


So, good evening everyone. How are you doing today? Yeah, doing good? Great. Awesome. Yeah, all right. That's the spirit. So, this is what I'm going to talk about today. Samaritan forms custom renderers. Well, a little introduction to myself. I'm Uddara Alvis. And fun fact, Singaporeans find it very hard to pronounce my name. So if you happen to be one of them, it's all cool. I get that a lot. So I've got some... Well, I'm here in Singapore working as a Samaritan developer. And I must admit, I'm a crazy enthusiast in Samaritan and got some mad love for mobile development. And of course, Microsoft for the win. And I'm not much of a grown-up, just a 23-year-old kid causing trouble here and there. And in fun times, during my leisure times, I go on nature walks, adventures, running and stuff like that. And yeah, so today we are going to go through a little journey during this presentation. So this is the journey that I'm going to take you guys through. First of all, we are going to talk about what Samaritan and Samaritan forms is all about. Actually, Sohail gave a really good introduction to it. But so I wouldn't go much into details on that. Then I'm going to tell you guys a little story about a Samaritan forms developer. That's going to be fun. All right. Then of course, we're going to talk about custom renderers. And I'm going to show you guys how to create a sample custom renderer. And of course, at the end, I'm going to walk you guys through some very important facts that you need to keep in mind when you create custom renderers. All right. So let's get started, right? Well, Samaritan is, of course, it's great. All right. Let's you create mobile applications using our good .NET framework. And also, most importantly, it gives you native performance, native look and feel just by developing from Samaritan. And it's got true cross-platform capabilities. And next, let's talk about Samaritan forms. Samaritan forms is more like the true cross-platform extension of Samaritan. If you take a look at it, Samaritan forms is like the approach of Samaritan where they want to create this concept right once, run everywhere, and not suck. And they have delivered it exactly as it is. And Samaritan forms, what this differs from, what Samaritan forms differs from normal native Samaritan is that Samaritan forms has a shared UI layer. So that allows you to share almost up to 100% of your code base among the three platforms. So no more separation of the UI layer between the native levels.  Let me put it this way. With ordinary Samaritan, you get this shared C sharp background, sorry, back end. But you still have to implement the native UI separately for each platform, as you can see in the left-hand side diagram. And now if you take a look at the right side, you can see there's a shared UI code across the three mobile platforms. And the native level has narrowed down. So in that way, you get to share almost up to 100% code, to share the code between the three platforms. Now, if you are still confused, okay, I don't remember why I put two ones. Okay, anyways, if you take a look at this side, that's the normal native approach where you get to share up to 70% to 80% code base with separate UI implementations. And Samaritan forms, you get the UI layer as well, which fills up the next 20 to 30%. So yeah, hope that clears any confusion. Now we go to this story time. All right, so there's this developer who started working on a mobile application, all being all enthusiastic about Samaritan forms. And so he starts off developing, right? And he's given all the UI sketches by the UX lead and so on. So he starts implementing with the ordinary UI controls that's given with the Samaritan forms layer. And he manages to implement the basic UI design. But then slowly, he gets into the complex UI implementation of the designs, right? Then having a little confusion, he actually starts going through the available properties of these UI controls in order to fine tune the design as complex as the UX lead has given him. But unfortunately, he looks up and down here and there. He cannot find enough properties to customize the UI according to his complex UI design requirement. So, oh boy, he's in trouble. He realizes that using Samaritan forms default controls is unable to optimize the UI exactly as he needs. So, well, any solutions for this? Well, sadly, he's in a lot of trouble, right? Now, he could actually go back to the native development and, of course, he'll have to go through the trouble of implementing the same UI in all three platforms separately. That's not an option at all. So what do we do? So, ladies and gentlemen, let me tell you this is where Samaritan forms custom renderers comes for your rescue. All right, let me explain.  Now, every single control that Samaritan forms provides you has a renderer that associates with the Samaritan forms level to the native level of the mobile platform, where it maps every single property of the Samaritan forms controls to the native level properties. So that's why we get the actual native performance and native looks and feel through Samaritan development, right? So, in my opinion, this Samaritan forms, this rendering process is more like the magic behind Samaritan forms. Now, if you take a look at this diagram here, you can see the entry control here, right, which is something like the text view in Samaritan forms. So you can see how it goes down through these renderers that Samaritan provides, and they get converted down to the native level controls. As in, like, in iOS, you get the UI text field at the end of the rendering, and edit text user control and in Android and Windows phone respectively, right? So next, this, now Samaritan being such a good guy, they have allowed us developers to override this rendering process, tap into this rendering process and customize it according to our needs and requirements, right? Look what a good guy Samaritan is. Now, thanks to that, we developers get to customize the default properties and the behaviors of these Samaritan forms control by tapping into the rendering process for each and every platform according to our requirements. Now, what is a custom renderer, right? Now, in order to tap into the Samaritan forms rendering process, we need to create custom renderers by subclassing the base renderers that Samaritan has provided us. And by doing that, we get to create custom renderers and, you know, tap into the rendering process to edit the properties and behaviors of those controls. Now, well, why do we need them? You already have the answer to, you know, customize the controls from the native level itself. Now, if you take a look at this diagram here, here we have control, created a custom entry, which is my entry base, that derives from the entry control of Samaritan forms, and it goes through our custom renderer, my entry renderer, and goes down to the base renderer level. So at this level, we get to customize it as we want before passing into the base class renderer level. So that's how the whole rendering process and custom renderers work. So now, how to create a custom renderer? It's very simple. A lot of people are very, you know, they're scared of this whole custom renderers thing because they think it's very complex. In my opinion, no, it's super simple because what you need to do is, first of all, the first step, you create a custom control in Samaritan forms level by subclassing a, you know, default Samaritan forms control. You create a custom control, and then you consume that control, that custom control in Samaritan forms project, your normal UI. Then after that, as a third step or the final step, you implement the custom renderer in the native project level. So it's that simple. It's not very hard. So now, time for the demo. And as Sohail said, I'm going to show you guys in all three platforms. Hopefully. All right. So what we are going to do here, all right. Now, you can see I have a sample, you know, a Samaritan forms project opened up, which has a normal label and a button, right?  And, yeah, just give it a little time. Do I talk too fast? Sorry, guys. Yeah, it's just a habit, a bad old habit. All right. Oh, so there we go. This is the normal output we get by the default Samaritan forms control, right? Now, if we take a look at the iOS, we set the, towards the iOS project, and we run it. OK. Come on. Oh, yeah. There we go. So that's how it's rendered in iOS. Now, let's take a look at Windows Phone. There goes Windows Phone. Now, what I'm going to do is, all right. Now, imagine my UX lead asks me to make these buttons corners even more curved than how it's normally rendered in these three platforms. If you can see in the normal, wait, I forgot to tell that in Android. All right. Let's set it to Android, and I'll show you. Oh, yeah. See, it has this but normal, the default button has squared corners, right? So what I'm going to do is make these corners even more curved, more towards like an ellipse corners. So in order to do this, I'm going to implement a custom renderer. So what I'm going to do is, first of all, the first step. Here we go. Create a new class. Let's call this corner, corner button. Oh, no, wait. That's a nice name around corners button. Let's call this round corners button. All right. We're going to create a button that has round corners. I'm going to make this public. And now, so as a first step, we need to inherit our custom control from default Samarin button, Samarin Forms button. So that is button, as you can see, Samarin Forms button. There we go. We subclass it from there. And that is done. So now we can straight away go ahead and consume this custom control in our UI implementation. So there we go. Boom. Sorry. Phone size. Oh, yeah. Let me. Sorry, guys. 120. Let's put it like 130. Is it good now? Let's put an increase a little bit more. 50. 150. Yeah. That's good, right? Yeah. OK. And alignment. Come on. Oh, nice. All right. So I'm going to use the same properties here. Why not? And click this normal button. No. Let's call it curved. No, rounded corners button. Rounded corners button. OK. There we go. So now the first step is done. The second step is done. We consumed it in our UI. And next what I'm going to do is the last step that is implementing in the native level, creating the custom renderer in the native level. So in order to do this, you need to dive down to the native project, native Samarin project level. That is, you know, Samarin.Android. Here we go. We create a new class called. Now the usual naming standard of custom renderers is that you take the name of our custom control button and you add the renderer keyword at the end. So here we go. We'll call it round corners button. And as a suffix, you add renderer keyword. That's more like the standard, you know? All right. That is done. Public. I'm going to make this sheet need to be visible. And yeah. So now if you remember, I told you guys earlier, when we create a custom renderer, we need to subclass it from the Samarin default renderers. So in this case, since this is a button, we need to subclass this custom renderer from button renderer that is the default renderer class for Samarin forms button, button renderer. There we go. Hope you can see. Yeah. That is done. And I'm going to do the same for on iOS and Windows phone also. Public. Now iOS is done. Let's go to Windows phone. And I'm not going to, you know, demonstrate about normal Windows and universal Windows platforms because it's almost the same. But and we are a little out of time right now. So yeah. And we create the custom renderer on Windows phone as well. Public renderer extend from the button renderer. Oh, yeah. Make it. All right. Now we have created the custom renderers basic skeleton. Now before I go ahead, I'm going to walk you guys through some very important facts that you need to keep in mind when you implement custom renderers. So the first one is now actually I'm going to go. I'm going to get back to the code while I go through this fact so you get a better understanding about each point and how to do it at the same time. So whenever you create a custom renderer, you need to export it and register it with the Samarin forms rendering process. If you don't do it, then Samarin would not recognize your custom renderer and it will go ahead with the default base class renderer. Now let's do that in our project. So how do you export your render is that you call the assembly and you use the export renderer and you pass in the type name of, you pass in the type name of your custom control, that is this one, the rounded corners button. Import it and then you need to pass in the renderer name. All right, that's good. Okay, there we go. And we need to do this in all three platforms as we need to implement this renderer in all three platforms. Okay, import off. Okay, all right. Okay, that's good. All right, now to the next point. So whenever a custom renderer starts its execution, the first method that gets fired is the one element changed method. This method is where we need to access all the properties and create, do all our customizations however we want to. And also something to be noted is that this method consumes some very important parameter that is called element changed event arcs which has two important properties, new element and old element. So what these properties are about is that the new element property contains a reference to the submarine forms level control and, sorry, the new element gives you a reference to the submarine forms control that is that this renderer is currently attached to. Like now if you take a look at the old element, it gives you a reference to the renderer that the submarine forms control was attached to. There's a distinct difference there. So this matters because whenever you create a renderer and you implement events and stuff like that, you need to keep an eye on these two properties and do the proper subscribing and unsubscribing of those events. So in order to, of course, to avoid memory leaks, we don't need to keep references to the objects that are not being used anymore. So let's do that in, implement that in our project, in our custom renderer. There you go. I'm just going to take this right here and let's start overriding. There you go. It's good. Now, usually this is the place where you need to do all your customizations and everything that according to your requirement. And let's do the same here. All right. I want it to be changed. OK. Good. That is good. All right. Now we have overridden the method that we need to write our custom customizations on. So next, all right. Now, a custom renderer is more like a middle guy in between the submarine forms level and the native level. So this middle guy has hooks for the both sides for the same submarine forms and the native level. So this normal base class renderer always has these two important properties that is called element and the control. The element property provides you a reference to the submarine forms level control. And the control property provides you a hook to the native level control, that this renderer is going to convert that submarine forms control to the native level. So whenever you do the customizations, you need to use this property and inject whatever the customizations you need straight away access the properties that according to your requirement. So let's go ahead and try that out in our project. So what you do here is you need to... Oh, before that, I need to do something. Yeah. I hope you remember about the new element and the old element. So I'm going to implement that here. First thing and let's say you take the... There we go. You need to check whether the element is present or not. If it is present, well, according to... I mean, during this demo, we are not going to use any events implementation here. We're just going to implement a customization of the UI. Therefore, I'm not going to do anything, any of those events here. So let's just say, subscribe to the events stuff. And if not, then you need to check for the old elements presents. Old element. See whether that's available or not. If it gives you the old elements, then you need to unsubscribe. Okay. All right. That's how it is done. All right. Now let's take a look at the control. Before you go into the controls properties, you need to check whether the control is available or not. Do a little check there. And inside this condition, only you need to do all the required customization. So I'm not going to go through the whole code, so I'll just get from my sample project here. That is... All right. Okay. Let's get this one. Get the gradient drawable. Okay. So if you are familiar with Android development, the way to set a button's background is by creating a gradient drawable, right? So here we have... I have created a gradient drawable where it sets the corner radius to the value we have given and so on, the background color and stuff like that. Now if you take a look at this code here, you can see at the set color method, I have gained the access to the element property, which is the Samurian forms level. Now what happens here is that this code, this piece of code, gains access to the background color property of the Samurian forms level here. Remember we set it here, background color property. And it gains access to that and it set it to the native level properties that we are creating here. Now that's how you use the control and the element. Now in order to set this gradient drawable to the native control that we are customizing here, what you need to do is gain access to the control property. You set background. As you can see, the control property has all the required native level methods and properties whatever available for this Android native button. So we go and set background and just as a normal Android application, you set up the gradient drawable. There we go. Now it should work like a charm. There we go. While it's compiling since we are out of time, I'm going to get the same code. It's already done. All right, there we go. As you can see, the new custom renderer button that we created, it has curved corners. So yeah, it looks better. All right, now that is Android. Let me show you the same on iOS next. Here we go. All right. So always keep in mind, you need to keep an eye out for the new element and the old element properties if you're using any events, stuff like that. So the next Windows Phone code is a little bit longer. So it's going to take a long time to code the whole thing from scratch. I would rather. Yeah, here we go. Okay, so here I need to show you guys something. Now if you take a look at this, you can see inside the, wait, let me copy the method, actual customization method. Okay, so in the Windows Phone renderer, what we do is we check for the old elements presence and the new elements presence, and we are using the method, the summit forms level event here. So, and we are unsubscribing to that event based on the presence of these two properties. And inside this method only we are doing the required changes. So these customizations depends on each platform's control's behaviors. It differs. So you need to have some native level look around knowledge in order to do extended customizations. However, so I hope you get the point of the new element and the old element properties. Well, that is done. And let's see how this gets executed. All right, on Windows Phone, here we go. Come on. There we go. Custom renderer successful on Windows Phone. And let's take a look at iOS. There we go. Come on. We don't have the whole day. Come on. There we go. Oh, yeah, there we go. Look how pretty it is. So that's the custom renderer implementation. Hope you get the idea. And don't worry, even though this seems pretty confusing for now, give it a try. Play around with it. And you can do awesome stuff. Now, yeah, the next point that you need to keep in mind is that like, now let's say the scenario like this. What if you wanted to get rid of the default native control that's given through the base class renderer, through the custom renderer, right? Well, and create your own native control and use it in our custom renderer. All right. That seems pretty complex. And let me give you a little example. So let's say you need to have a text box with a background shadow with it. So in something like IOS, what you do is you get the UI text field and you create another UI view that's going to hold the background shadow. And you put those views together and you form one native control in order to get that effect. So in scenarios like that, you need to override the natively provided element, right? So to do that, you can use the setNativeControl method that's available in custom renderers and directly put your own custom native control and override the defaultly given native control. So, yeah. And also keep in mind, since you're overriding the default given native control, you need to handle all the events and the behaviors manually all by yourself. So, yeah. So as long as you stick to those control and element properties that's defaultly given by Samaritan forms, you're good to go. But if you're going to even more deeper level customizations, you need to keep in mind to handle all the events and the behaviors. And last, but this is also very important to some fact to keep in mind, let's say you need to create something, some very, very complex customization control, right? And in this process, you might probably want to create your own base class renderer. So what you do is, now, is that even possible? I mean, we've been using button renderers and label renderers the whole time. That's defaultly provided by Samaritan. And now we want to create our own renderer and override the entire rendering process. That is possible. Yes, it is possible, even though it's not very recommended by Samaritan. What you need to do is you need to use the default view renderer that's provided by Samaritan and use the generic pre-renderer and pass in the custom control and the native control that's going to associate with your own renderer. So, yeah, there you go. Just something to keep in mind if you ever come across such a requirement. It is possible to create your own base renderer. Well, now that's been said. This is something I really need to mention, guys. For Samaritan forms mobile development, you don't need so much of in-depth mobile knowledge and experience, but it's quite, in scenarios like Samaritan custom renderers, it's pretty useful. So, if you're someone who's looking to move towards Samaritan forms mobile development, I would suggest that you take, at the same time, just take a little look around of the native platforms that are available, just a little look around while you are moving towards Samaritan. It's going to be very useful. So, that's a little sharing of the experience and wisdom. Next. All right. So, we've arrived at the last part of our presentation. That is things to keep in mind before you decide to go towards custom renderer implementation. Now, this is something very important. You need to think twice before you move towards custom renderer implementation. That is because some untold truth about custom renderers is that it's a little bit process-intensive. And I know it's very tempting to go for custom renderers whenever you get comfortable with it. I experience that myself all the time. But try your best to solve your requirement from the Samaritan forms level itself. So, you save a lot of resources and processing time. And also, you can try out the alternatives by sub-classing the default controls in the Samaritan forms level. Try to put all the stuff together in Samaritan forms level itself. Or else, you can try out Samaritan forms effects. That's been released last few months. Something introduced new. And it's something similar to custom renderers. But it's more simplified and less process-intensive. So, always look for the alternatives before moving towards renderers. Now, whenever you create a custom renderer, you need to focus on the re-usability as much as possible. Because, I mean, as I mentioned earlier, it's very clear that custom renderers process-intensive. So, try your best to keep it low as much as possible, the number of renderers that you use in your application. And try to merge the possible renderers together and use less number of renderers in your application. So, as such an example, let's say you have an image renderer that renders an image control as a circle. And you have another renderer that renders the images' corners, images' squared corners as curved corners. Now, why don't you just merge those together and keep only, maintain only one renderer? You can do that. It's the same type of properties that you're using for the both renderers. So, try to keep it, try to unify as much as possible behaviors and properties to one renderer. So, yeah, that's something to keep in mind. And the last thing, last point to keep in mind when you're implementing custom renderers is that before you move towards rendering renderers implementation, try to take a look at the renderer hierarchy starting from the sampling forms level towards the actual native control level. Go through the properties that are available in the native level in all three platforms before you decide to go for custom renderers and see whether it is possible to achieve your requirement through the renderer. By doing that, you'll have a better understanding of how we are going to implement more efficiently. So, now after that, that's been said, we've reached the conclusion of our little journey. So, well, something to mention here is that Samarin Forms custom renderers is extremely important in Samarin Forms mobile development. In my opinion, Samarin Forms custom renderers is more like the magic behind the actual awesomeness of Samarin because it gives you an ultimate flexibility on customizations for your mobile applications. And, guys, it's nothing to be scared about custom renderers. Once you get used to it and you start playing around with it, you're going to love them and they're going to be very, very useful. And, yeah, keep in mind, custom renderers are there to rescue you. And also keep in mind the important facts that I explained today. And, yeah, that will give you a better understanding about how to implement more efficiently and effectively. So, well, that brings to the end of our presentation, the journey today during the presentation. And thank you so much for listening. And don't forget to check out my blog. I post these custom renderer implementations almost every week and a lot of interesting stuff there. So, yeah, thank you so much for listening and thank you for the organizers for the opportunity. Thanks, guys. All right.


We are here today for the 2011 Department of the Navy Acquisition Excellence Award. The Acquisition Workforce, you place the finest ships, aircraft, armored vehicles, weapons systems, possible in the hands of those sailors and Marines. The people here are the folks that are being recognized for their awards. My team specifically is being recognized for the expeditionary and contracting awards. I love the business. I like dealing with, negotiating with contractors and getting them under toes, so to speak, to make sure that they provide us the best possible supplies and services. Because people like you are the true secret weapon of the Department of the Navy, thank you so much for what you do. We are so thankful to have you in this department and making this the greatest Navy Marine Corps team that the world has ever seen.