Kind of a broad topic, integrating web applications. Wanted to kind of talk about Ruby and web and how things go in architecture and stuff. And so that's what we'll get started with today. So I want to start with kind of how we got here. Big picture for me anyway. For me, Ruby in 2005 was Rails. And Rails in 2005 for me was how to write a blog in 10 minutes. How to build another to-do app. A lot of just kind of simple models. We were kind of celebrating the, he's distracting me. So you know, kind of celebrating the ORM and building web apps that have just a sprinkle of Ajax in them. They were pretty simple back then at least for me. And Rails was a lot of just about trying to get our code organized back then. 2010, last night I did just a Google search, looking for tutorials on Rails 3. Some of the things that were coming up were bundler, active relation, active model. You know, bundler is because there's so much going on in the Ruby community. Dependencies and issues and things. It's complex. We've got to kind of simplify it with bundler. Active model to kind of modularize things, active relation. Some really neat things that are more about integration, more about big, more about there's more going on. Our applications are more complex than they used to be. At our company, Fleet Ventures, we're building a video rendering application in the browser with Rails. We're building a system that works through the patent application process. This major document parsing and machine learning on that. We do lots of medical records, coding in the browser for medical records. Just kind of complex stuff that we do now. So we come a long ways from just simple apps. And the problem I'm having with that sometimes is I make, or I start with big monolithic apps.  And in 2008, Justin Getland spoke at RailsConf. It was about something almost similar. And his talk was called Small Things Loosely Joined, Written Fast. And the concept was if we architect things smarter, we get more done with less resources, we can maintain it better. It's better code. And that's, I think, kind of the trick with integrating web apps. And going smaller, going simpler, using other services, don't try to be everything. Solve one problem in one context and go on and do a different problem in a different context. And there's a lot of ways to do that. And so, you know, unfortunately, you know, like I was saying, I've learned the hard way sometimes with these big apps. And so coming back and refactoring things and learning to use web services. And so there's kind of three basic areas, I think, that make sense. Internal systems, you know, we're building internal web systems, external systems and open systems. So I'll kind of break it out that way. So internal systems are basically, you control what you're doing. Maybe you have a big monolithic app. Maybe you just think that you're gonna reuse some code or maybe it's just easier to do something smaller. At the RailsConf this year, there was a company that had built a learning management solution and their talk was entirely, just saw the slides, but they'd used 30 Rails apps to build this. They just kept it really modular internally and they were able to keep things kind of the way they liked to. So internally, if you control everything, you can build your applications in a simple way and you can just have a simple decoupled system. Maybe your search, maybe five or six models all bundled up that make sense together, that you build smaller apps. It's cool in the Ruby world to use RESTful. RESTful connections that's been around for a few years. Basically, a typical Rails controller like you guys all know that allow the URL to kind of tell you what you're after. So you can create, read, update and delete your basic models through REST commands. I'll go in that just a little bit. And I think that if you're gonna go from scratch and it's not already a Rails app or a Merv app or something, stick with Sinatra. It's really easy, I'll show you how easy. And there's a lot of ways to consume it. REST client's kind of the easiest way as well. So here's a Sinatra app. Require a bunch of libraries more than you typically do, but I did because I did. And basically you have to require Ruby Jam to require Sinatra, that's what you need. The rest of this, I was using Data Mapper in this and I used Bundler to keep it clean. But basically you need to require Sinatra and then I required some local libraries. I set up the database, but the bottom line there, the post documents is just one method. It's a RESTful interface for creating a document and it just creates the document in the database. And so that's one page, it's a web service. It's local, it's easy, it's simple, it's a haiku. And with that you can go and store and save a document. And if you put another 20 or 30 lines you could view them and download them and update them and all kinds of things or do related things. And you can imagine if you had 20 or 30 little methods in there for anything you wanted to do to a document, pretty soon you've got a web service that does just documents, uploads and handles documents. And now you've got probably a good start to an internal web service that's gonna do a good job. And we actually kinda started this last night, we're gonna get to this in about two weeks here at work where this will actually grow into a real web service that we're using where we're gonna do a lot of behind the scenes work on these documents in a message queue system and just having a simple Sinatra web app to get it in and out and get things started is all we needed. So that's what that is and then to consume it it's even easier. The way I did it is just was from the command line. But REST Client, if you just suit or gem install or gem install REST Client you'll get a lot of tools and it does a lot of smart things for you and that's kinda why I like REST Client. Here I just said REST Client, I gave it kinda a base URL and I was running the Sinatra app locally and so I called that method, that post documents and I named it and actually sent a file, I opened a file and REST Client smart enough to know that that's a multi-part submission. Yes. Is this a gem or is it? It's a gem, yes, it is. Yes, so it's a binary that comes with a gem. There's usually you'd use it like in one of your other apps or in a class or something and you can just do capital R, REST, capital C Client. And it's really easy documentation. The reason I like it is because it's easy. But right there it handled multi-part uploading, it loaded it and created a document in my database and it's just that easy. And so if you control the consuming and the producing if you use REST Client plus Sinatra that's probably the easiest way. With Rails there's a little bit of you know things you're thinking about protect from forgery, some configurations you're thinking about, authentication.  Sometimes if you already have the Rails app though it's worth it. You already usually have it in the right format ready to consume and produce. So internal systems breaking up your systems may be a thing to do. Definitely if a product's getting too complicated. There we go. External systems are everything else. All the web 2.0 stuff that we all consume. And we've probably all consumed them with our Ruby apps or they're not hard to do. The basic way you usually start is an adapter and API. If you have to you might custom build something and here's the cool stuff. I'm starting to realize that Datamapper can be really, really powerful for web services. So wrappers and APIs, there's kind of for everything something already usually. I just checked this morning on GitHub. I was looking actually at the results and they all looked like they were wrappers or a lot of these were 1831 wrappers or so in Ruby on GitHub today. And pretty much anything and everything you want to do. All the web docs, all the web applications that you might want to consume and use and bring them in. And they're usually really basic. You look at the documentation, there's usually a class, there's usually a key, it's usually an hour or two to get a web service integrated to what you're doing. And so that's not too bad. Every once in a while you'll find something you just don't like, the wrappers, you just don't like the APIs, you don't have one. So you have to custom build it. Ruby's got some good ground work that we can start with with that. XMLRPC and SOAP are both part of the standard library and so you can do different styles of consuming services that way. If you're doing really old school stuff, EDI stuff, they have these standards, these documents that are these piped limited documents that they come up with 20 years ago or so. And they run a lot of industry, a lot of the medical world that we work with uses X12 to talk between different entities. And so there's an X12 parser that looks pretty good, Ruby, Ruby Jam. For several years now, Active Resource has allowed us to consume RESTful resources if they're out there and there's not a good wrapper or anything there, you can bring it into your Rails app or you're using Active Record. An Active Model is a way that it's not really about web services, but it's kind of about making your plain Jane Ruby classes kind of look almost like an Active Record, validations and callbacks and some of those state management things you can kind of add. So that's a Rails 3 thing with Active Model. So there's not a lot I can say about how to do that except if you just do it. But something that I was realizing as I was doing it is a way to simplify it, at least for me for things is the Data Mapper adapters are incredibly powerful. Data Mapper is really, really modular and they did a great job of extracting out the adapter. And if you've got an adapter, you've got all your finding, all of your associating, all your validating, all of your everything is there. And to create an adapter, you have to write four methods, create, read, update, and delete. And they give you, if the couple lines of code, you would have 41 specs already running against your adapter. So basically you set up the specs, you've got 41 things to get right in four methods. Once you have that, you have an adapter. So what we're looking at right now is an adapter or a DM Salesforce that was written for Salesforce. So Salesforce is a web service, kind of an ERP type solution for customer relationship management. And they developed what looks like to a lot of you guys. That's just a class, like a Data Mapper regular class. It's, they set up the repository to use the Salesforce. So you can have a backend database in your app and you can have a Salesforce backend here and here's an account that's, they define just the properties they were interested in. And then over here, they have a contact and they connect the contact to the account and then they consume it and use it just like it was, just like it was in the database. So this is a web service that's running like it was just part of your app. So it's like you wrote Salesforce. So really powerful. So look kind of an art to that. But I think really powerful way to approach web services. So that's kind of the external things. Now, real quick before I jump into open resources, kind of the art of it as I've used web services, there's sometimes latency issues. The way I usually get around that is I ask for something asynchronously either in the backend or I get the webpage up if I'm needing to view it. And then I ask in the background to get it and I just have a JavaScript listener to tell the user when we're ready to go. So that we can kind of fudge a little bit on how long it may or may not take to get data from a web service. Cause maybe it's slow that day or maybe it's down or whatever. So I kind of decouple that and that's important, I think. Also other things that you deal with when you're doing external web services is some of the authentication security issues. I haven't found any general rules of thumb for that just every time I work on it. I'm thinking a little bit more about that than maybe if I'm just building my own little app. But open resources is another web service that works today. This is kind of a web 1.0 and a web 3.0 examples here for open resources. Sometimes there just isn't an API. Sometimes there just isn't a way to wrap anything. There's just data on an HTML page. And so you gotta scrape it. I haven't done any scraping for about a year but I had quite a big project. I had a client who needed their data from their own supplier and they couldn't provide it in a useful way. So we ended up scraping the supplier's site. And it was important, we got it right. And so I ended up using a mechanized and HPCOT to get things done. The structure I ended up doing was I tried to treat all the pieces of the external website like classes and methods and try to group it up. So I used OpenStruct a lot and so here's an example I just try to basically bring it down to the level almost like it's a local method call. And that way I can run tests. And I thought, it turned out it was important that I wrote tests because things change out there when you're scraping websites. And so having tests around tell me whether or not my scraper still work is important. So this is one where I just set up a few variables and then I just call something in the class to start asserting data that should be sitting in the document that I just created. So I tried to just treat it like regular, like it was a class in my library, like it was local. And that was I guess the biggest thing I learned from that experience. But the issue we have even web 10120 API or not is there's a lot out there, it's exponential and it's growing, it's growing exponentially. And you can't keep up. If you're thinking about it, you've got a web service out there and every time there's a web service they've got to develop an API and then somebody's got to write a wrapper and then you've got to adapt to that wrapper. There's a lot of work every time you want to use something. And you don't usually tie into a whole lot of things but there is another way. Turns out, and this isn't for me, I was listening to a guy in London talk about linked data and turns out that Tim Berners-Lee a few months before he even coined the phrase World Wide Web, he was talking about linked data and talking about Web 3.0 stuff. And kind of the idea that a resource or a link on online should actually relate to something concrete and be semantically discernible is kind of what I'm saying in a funny way. But maybe a simpler way to say it is a linked data, some suggestions to make linked data work for you is name things with URIs. And go ahead and make those URIs point to real HTTP pages, something you could actually go consume and look at. So if it's new, you created it, go ahead and publish that, put it on a web service somewhere. So, and when you do that, put something useful there, something about what you're talking about. So if we're talking about this web conference, we might just make up our own link, a URI that might refer to it that has some RDF behind it or whatever and just make something useful or just point to convert maybe the main conference website a little bit to have linked data on there. And then finally, link to other related information so people can traverse it. And it's really interesting because if you stay simple with linked data, it gets really, really powerful because now your database is the web, whole web, everything that's using RDF and linked data and these ontologies and the kind of infrastructure that we've been building up for quite a few years. And so now web services don't have to mean an API, don't have to mean something that you spent time building a wrapper for or learning the API for or anything like that. It can just be something you can go out there and discover. One of the most powerful things I ever saw with this stuff was six lines of code application. It asked, what is the relationship between a fox and a cow? And the answer got back was they both have commercially viable pelts or coats. First, skins, that's whatever it is. And it figured it out. And it was what they did was they asked the USDA, USDA had published this huge RDF database with all this information and it just looked for what's the most relevant way these things link. And so it's really, really powerful if you start to explore and look around at things. Wikipedia, a lot of Wikipedia has been converted to another system called DBpedia, which is all the RDF information for the same thing. If they can extract links out and meaning out of the things you're looking at at Wikipedia, it's there. The BBC has got major commitments to that. Other huge, huge resources that have amazing amounts of data you can consume and information you can consume, you can relate to your own web services. In the Ruby world, turns out we have some pretty good ways of doing that as well. Geminsol, RDF, RDF Raptor, RDF JSON, RDF Tricks and Spira. RDF Raptor is sometimes a bit involved. There's a good link for getting through all this. There's a really good blog that's keeping this RDF RB stuff all intact. They're not very active writing, but when they write, they write really well about this stuff. And then so if you install all that stuff and then you just maybe start an IRB console up and require your RDF, RDF and triples maybe in Spira, just a little simple application here. I added a graph from this external resource.  It's information about Jay Hacker, his name and a lot of things about him. And that's okay, that's useful. Spira's a little bit more exciting. It feels more like a model and it's a little newer. Create your repo, same repo, that's what we had in the last example. You add the repository to Spira and then you go ahead and create a simple model. And on this model, I just said, hey, there's two properties I've interested in. There's about 10 on it. What it's doing is conforming to an ontology called FOF, friend of a friend. And so it already tells you, we already know that it's gonna have name and nick in there and it's gonna have other things in there too, account and things like that. But we just said, well, all I wanna know since I'm gonna be using these people is their name and their nickname, but you could set more things up. And you see over here, the predicate FOF name, it's basically saying I can go look through this data and figure out what we're looking at. And I go ahead and I instantiate Jay Hacker to some URI that's out there and I say it's as a person or as this model that we have there.  We can save it, we can change it. We can treat it like a model. So there's no API that we had to learn extra. There was no extra service we had to run through. There was no new connection we had to deal with. And so it's a lot better if it's available to consume web services and kind of what they're calling the Web 3.0 way. So that's the basic ideas I had for web services and integrating web apps, kind of a broad topic. Kind of fun and embarrassing. Last night as I checked my blog, it's down. So fleeventures.com, we'll figure that out and debug that today. But I've had about 50 or 60 links on the blog there that tied everything I talked to. Probably take you two, 300 hours to find all that information of the same stuff. So if you wanted to kind of think about that, there's some good stuff to work with. So thank you very much.


Yo, what is up you guys realistic gaming here, and today we're here with the squad. Oh my god was up guys We got alpha's pirate the awesome sunny star Tristan and ootoo ootoo bae I don't know how to pronounce that bro, but today we're on I forgot the name of the game today We're on don't get crushed by Thomas the crusher. It sounds insane. I know let's see what's going on here All right Spartans make me proud. Oh, that's Sonic with the master chief helmet. That looks pretty sick, man Oh, let's have one at me. All right. Let's add this boy real quick. I got you my boy I got your man. Okay, so they reject. Oh, there's a cat Pet the kitty.   Okay says to survive and you cannot shoot Thomas in the courage with your rocket. Okay, whatever Let's begin. Let's go see what's up. Oh, oh my god. What is that? What is that? Is that like a giant mech robot Thomas over there?  There's the freaking giant Thomas here I think that's a Thomas that we're talking about. Okay, so I think the goal is to not get crushed By this possessed Thomas, dude, he'll be looking evil though. Look at his eyes Yeah, I'm about that one chief. All right. Oh my god. You better run sunny. Sunny is dead meat.  Oh someone just died. Okay, so what's up with these giant? Rockets that are dug into the earth and to the earth. Look at look at Roblox earth, bro Wonder if I'll die. No, you know what? I'm not gonna do this not the brightest idea. Okay. What is Thomas doing, bro? He's straight up dissing me.   Do my boy trip and look at him. Oh, man, all right This Thomas doesn't die, bro, he's like indestructible.   Oh, he needs back great All right, cool. So now we found the way we can actually defeat the Thomas pretty quick Let's try to go check out this giant Thomas big. Oh, that looks so cool right there. That looks pretty epic I'm not gonna lie. Okay, so what's going on? I'm not sure if that Thomas is evil. Oh, he's coming right at me Run! You gotta run. Oh Crap, I'm dead. I'm dead. I'm dead.  All right, so I'm gonna attempt to land up here on the top side So we can go see the giant mech Thomas over there since it looks pretty cool Okay, please don't okay nice cuz I tried it earlier and I landed and my character flung into the darkness over there You know to that black hole. Yeah, literally flung me over there, right? So it's gonna take a while to walk all the way across so I'll see you guys in a minute Oh, just look how awesome this thing looks from the side. We're almost there It only took me like half a half a year, but we'll make it. Okay. We're almost there man. Come on Okay, so these are actually like halo ships from what I recall It's like literally halo themed which is pretty awesome. Oh my god. I didn't even notice this guy chasing me What if I throw a bomb at him? Please don't come up here. Oh my god. I have a feeling he's gonna climb up here You know what? Let's just throw bombs at him. Let's see something out. Oh, no That's not good. Go go go.  I Want to see that that's gonna be hilarious. All right, you know what?  Oh my god. He's following me. I am being stalked right now Okay, cool. We made it to the giant robot Thomas. Oh my god I didn't even realize he had a Thomas in the middle of his body And that's the one that's actually shooting the beams Okay, what is going on bro? They're like did they open a portal? I don't freaking know dude, but this thing looks insane, man All right, let's go see. Let's get a closer look. Let's see we can climb all the way up here All right, please don't fall because if I fall I'm gonna have to redo all this and that's gonna be the real nightmare Okay, we're almost there. Oh climb climb it Oh that was close Dude the Thomas is right there. Can we shoot him? Booyah and Bro that took forever.   Okay, nice. Oh, no, we're like in his neck. Okay. Now. We're actually above we're on the Thomas mech now Dude, this is awesome. Look at this Look at that good.  That's a good feeling everyone like that, man All right.  He won't leave me alone. Oh, I must get myself. Okay, um So can I? No, oh my I thought I was gonna fall down Okay, cool. Oh Let's get closer to the to the middle face. Oh No, I knew it.  What a view That is not a view I expected to see and great. We felt the spawn bro What is going on with Thomas? Look at him all of my character. Please help me. Oh Wait, I actually landed down here Okay, what is this bro? I See some feet Okay, finally managed to made to land here without getting flung by by landing. Okay, cool So now it is time to fight Thomas again. Oh, I think he's cornering someone over there Whoever's over there screaming for their life right now because just imagine a What is that like a 10 ton Thomas? Oh, he's above. Okay, see him up there. What if I try to shoot him? I'm gonna try to shoot him from down here. Let's see my rocket makes it over there I'm gonna have to shoot way ahead. Oh, it doesn't even make it over there, right Thomas It is time to fight and I'm here with pirate the awesome. Oh, he's dead. Oh You saw that that looks creepy man. I'm about you guys, but that looks kind of creepy Here playing your turd Bruh, he's stepping all over the turd. That is not fair because if I touch it Oh, if I touch this then we die Okay, this dude's just like Flying at us now Somebody help alpha. Help me. Oh helicopter man. What's up a boy? Oh No, what I have. Oh We just died great. Now I'm bald. Oh My god, what is going on?  He's like infinite spawning I wish you knew you could only control like or at least go inside that giant mech Thomas I would be so cool man like imagine you control him.  I'll be pretty sick. All right Well, I guess that's pretty much it to this game. All right you guys well That was don't get crushed by the giant Thomas crusher. I think that's the name of the game Dude every time he's killing me does like this crazy flip. I can't get over it's pretty hilarious All right, well leave the game down in the description down below if you guys want to check it out It's pretty cool You know just just to play it for a little bit then because it's pretty repetitive, but even than that It's a pretty cool concept. All right. Well, thank y'all for watching and enjoy the rest of your weekend


Good afternoon everyone, joining from India and from across the world. Today we have May. May is a software engineer, info developer and a public speaker. She likes talking in tech conferences and taking part in hackathons. May stages yours, all the best. Yay! I'm so happy to be here. Yeah, so hi everyone. First of all, I want to thank you all for joining, taking the time to be here with me today. I'm truly honored and excited to do this talk. And yeah, let's begin. I'll share my screen. Oh, there you go. Can you see my Star Wars screen? Okay. All right. I think we can start. So yeah, like I said, hello everyone. My name is May Baceron. I'm a software engineer. I'm an info developer at Porter. I write in Groovy, Python, Clojure, Node.js, and several other languages on a daily basis. I am a mentor and a public speaker. And yes, I was born Star Wars fan. You can see that in the presentation. You can see that in my background. You know, I don't think you can miss that. So I already did quite a few Clojure talks in my life. And most of the talks that I did were about some game development or maybe just functional programming in general. Or, you know, there were many different talks that I did. And about Clojure. And I think that the main thing was that I showed is just a single-player game. And then somebody that I talked with just approached me. And he said, well, Clojure is nice. But if you ever decide to write a multiplayer online game, well, you can't do that in Clojure. And you know what happens when you tell a developer that they can't do something. I'm in. So, yeah, I decided I am going to write multiplayer online game in Clojure. And I'm going to do that in under 100 lines of code, or at least the backend will be under 100 lines of code. And that's the game that we're going to check out today. So the backend of the game is written in Clojure, as I mentioned. And the front end is written in React.js. And it was written by my friend, thank you for that. So now let's check out the game itself. So what you can see over here is the way the game starts. You can see that we have two windows opened.  I see that a few more people joined. So just for the sake of those who just recently joined, I'm going to tell you that the game that you see right now, the backend is written in Clojure and the front end is written in React.js. It's just monkeys scattered around the screen. And what these monkeys are trying to do is now we have just one screen and not a split screen. So it will be easier for everyone to see, but you can see the other players over here.  So for instance, the one that you see right now has a divide by your zero exception. And you can only collect exceptions that match the one that you have on your head. The idea was, you know, enclosure exceptions are kind of annoying. And it's hard to understand what's going on with them.  I don't know. I thought it was funny at the time. I hope you guys are laughing and girls are laughing somewhere. And if not, you know, I'm laughing for you. Okay. So that's the game. I want you to notice that we have a player that goes around the screen, each person over here, like I said, wants to collect exceptions, but please remember that you can totally do that with any other things. It doesn't have to be exceptions. You can define your own player that will be maybe, I don't know, collect bananas or apples. That's the idea of this game that it's quite simple, but still has enough complications in order for us to be able to talk about the challenges and choices that I had to make when I worked on this game. So let me talk about all of these challenges and choices in, you know, two steps. The first thing that I'm going to talk about is only the challenges. I want to describe what were the challenges for me when I decided to develop a multiplayer online game. And then I will tell you about the choices that I made in order to handle these challenges. Now, when I will go through these challenges, I want you to try to think with yourself, how would you do that? And then later at the Q and A session, I would be so happy if some of you will, you know, step up and participate and tell me, how would you do things if you do it the same like I did? If you've already developed a multiplayer online game, share those thoughts with me and let's do it together. So the first challenge is to define the game flow. What does it mean? You know, in general, you want to define the game that you're going to develop. So you want to define the amount of players. You want to define the movement. Can you move in 2D in two directions, just left and right, or maybe, you know, up and down only, or can you move in four directions? Like just like you saw that our monkeys can go. Also, you want to decide about the boundaries. Can you leave the window just like in Snake, where if the snakes leave the window, then he can come back from the other side, you know, or you can't live the window. This is how I did it with the monkeys game. Monkey, when he reached the end of the window, he can't leave it. And then another thing that you want to remember is you want to handle collisions. How do you do that? If you want to be able to collide with other players, if you want that, if you had a collision with an item, do you want to collect it? Do you want to ignore it? And of course you want to decide if there are winner, winner situation or losing situation. That's it. So the next thing that we want to do is to choose the game architecture. There are several popular ways to define the game architecture. And you've got to think about both the internal architecture and also about the communication between server and, you know, between clients and server. And there is no one right way to do that. Remember that even the biggest gaming companies are still facing this matter today, the communication part and try to make it, you know, the fastest, the best, the easiest. So, you know, then what we need to do is to define not just the communication between the client server, but we also want to define the protocol. Now, what does it mean to define the protocol? We want to define what will be sent in the messages between the client and the server. Do you plan to send only, you know, just specific limited information from the server to the client? What about, you know, all of the images and graphical things where do you hold these? So this is also some of the things that you'll have to consider when I say protocol, you know. How do you, how do a client recognize self? You know, if we have so many players, how does the client recognize if a player is self rather than just other players, stuff like that will be a part of the decisions that you'll have to make. I think one of the last things is managing the game state and what is a game state anyway? Let me talk about that for a minute. So a game state is the mode of the game entities at a given time. For example, the location of the players, the number of players, the number of items to collect, etc. So that's what it means to have to handle the game state. You want to decide who determines the game state. Probably the smartest would be to have the server do that in order to maintain consistency because if, you know, if you have one player deciding on the game state, then, you know, it might cause a few consistency problems if you do that in a different way. But there are architectures that have been doing that over the years. So I can't say that it's completely wrong, right? Okay. Part of, you know, part of the things that you'll have to handle will be adding a new player, handling player movement. What happens when the player has left the game and then handling the player entities, which means what happens to all the things that are scattered around the screen, which is not the player. So we talked about the challenges, and now I'm going to talk about the choices that I made. The first thing that I mentioned was the game flow. So, you know, if I make it into a simpler mode, then you can see that this is actually the game flow that we have. So we have several different players, and each player can move in four directions, and they can all collect items that match their something. So over here, I showed it with simply every player can collect an item that match the color of, you know, their little head. Notice that I defined that there will be no obstacles. It means that the player can move freely, not like in Pac-Man. In Pac-Man, there are not obstacles, but there is like a maze. So that was also something that I decided to do, not to have a maze, not to have obstacles, but it doesn't mean that I won't add it in the next, you know, version of this game. By the way, I don't think I mentioned it, but this is why this talk is called Attack of the Clones 2. That's because this talk is a part of a series of a talk that I do. Every time that I do this talk, it's where when I develop the game a bit further and I show it, so, you know, try to check it out or, you know, find the next talk that I do. If you're interested in seeing the next version of this monkey game. Okay, that was a side note. I'm going back to talk about the main thing. I was talking about the game flow. Let's move forward. So now that we were done with the game flow, I'll tell you about the architecture that I chose. So I chose the client server architecture, which means that there is one server who determines what, you know, the game state, and he sends it to all of the connected clients. This also means that if one player, yeah, notice how it's ugly, ugly arrows. I know, I chose to leave those arrows because I thought, oh, well, they'll know that I am incapable of drawing. So it's okay, right? So what we see over here with my ugly arrows in the screen is how it goes with the architecture that I chose, like what's happening there. We need that if player one made a move, you know, it will be sent to the server. It does not determine the new coordinates of the player. What will be sent to the server is only the fact that the player moved somewhere. And how, you know, maybe if you moved a little bit, if you moved further, but that's what's going to be sent to the server. And so the client will inform the server about that move. Then the server will calculate the new coordination of the player and he will send these coordinates to all of the connected player. Now, you can see that right in the drawing that he sends to player two and to player three. Hey, player one made a moved left. Hey, player three, player one moved left. Actually, an arrow that I now see that I forgot to add is how the server also sends these coordinates to player one itself. So that's missing in the drawing, but I just told you about that. Okay. Now we will talk about defining the communication and protocols between the client and server. So messages protocol. This, what you see over here is actually the first message on the left that is sent from the client to the server on, you know, on the moment of the connection. So what will be sent is just this tiny JSON. And you can see that it's already actually written in a map style and closure, but it's just a JSON that's coming from the client side. And this JSON will only have height and width of the window. And we want to send that to the server. So then the server will be able to determine where he will locate, you know, the first, you know, the player position and all of the things that he has to send back to the client that are based on the side, the size of the window. So now we have on the second message. This is the message that the server will send to the client back once he knows that a client has connected. So let's go over this map. I want you to get familiar with it because we're going to use it throughout the session. We have the first key says self question mark true. Now I want you to notice that it also says player question mark true. And then we have the ID key. So all of these three keys, they say this. First of all, this map describes a player.  And we also sent an ID. Now you can see that it's just a randomly generated you ID. And because we wanted it to be unique. And this is how I determine which player is which, and I make sure that everyone is not someone else. And then the rest of the keys that we have over here X, Y, that's location score, you know, that's how much, how many exceptions you've collected. We also have show true, which determines if this player is connected or not. And then we have exception type. This is what will determine what's written above the player's head. We have collision false. And this is where I decided to determine what happens when somebody collide with the window. If it says collision true, this is how, you know, I handle the collisions part. You'll see that in a little bit and window height and window width. This is these values always change in case the client change them because we always want them to batch what we have in the client side. Okay. Now we, we just saw, okay, I'll go back just for a minute. We just saw these messages. This is how this is how it starts. Okay. The communication between the client and the server. Now throughout the game, what's going on here is that the client only sends use what you see over there client to service sense X plus 10 plus then it means, you know, the movement that was there. And then the server will send. I'm sorry. Okay. So, and then the server will send a message with the updated game state. And you can see over here the player map that we already discussed. And also another map is exception question mark true. These are the exceptions that are scattered around the screen. Okay. Now the way that I did the communication was using Web sockets. I'm not going to talk too much about Web sockets, but this is how it's usually done. The first thing will be an HTTP request from the client to the server. And then it will be an upgrade by the server to a bi-directional open communication, open and persistent until one of the sides closes the channel. That's pretty much it. There is a lot more to say about Web sockets, which I'm not going to do today, but I'm going to talk about the other things that I used the HTTP kit library and closure. Now let's see how to use that library. What you can see over here and now listen, even if you've never written in closure, I just want you to focus on the names of the functions that you see over here. Defend means defining a function. And you can see that we have Defend Web socket handler. And this means that this is where we're handling the web sockets. And this is where we're handling the web sockets. After the connection is open between the client and the server. We have Def Web socket routes. Remember how I told you that Web sockets start with an HTTP request. It happens right there. You see get and then the backslash. That's it. And then we have in the main, it says run server and Web socket routes. It's called the Web socket routes that I defined up here. Now I want to go back to the Web socket handler function that you see over here. What we get is a request. And you can see that it says on close channel, which is saying what happens when the connection is closed? Well, if the connection is closed, what you want to do is call the remove player function. And on receive, this is what will actually happen as long as the connection is open, we want to call the process message function. Now here's the process message function. This function has two modes, either adding a new player. Or updating the player state. These are the two modes, right? Because if a player has just was just added, then I want to do some things. And then it's a whole different thing if I want to update. And you can see that what they are both getting over here is the height and width of the window. And also the specific connection. And this is how I can tell which connection I am currently working on in terms of processing the data that I got. Now I'll briefly talk about how I handled the active connections. You can see that I have an atom, which is with a list in it. And it's our, you know, in closure, it's not really a list. I can call it just collection. So I have a player's collection. And what it means is all what I will have there is all of the active players are going to be added to this collection. Each player is represented as a map. And we already saw the map of a player. You can see that again over here. This is actually where I created new player. You can see that. Do you remember that I said that we have player a question mark? True. This is how we know that this map represents a player and not something else. So we will have many maps like that, that each map describes a different player. How do we know that this map describes a different player? That's because we have the ID key just like we have over here. Okay, let's move forward. Now what we want to do is when the server got a message, I talked about how the thing that the server wants to do is to either add a new player or update an existing player. Another thing is the player, then the server wants to update the other connections about what just happened, right? So we have two functions for that. Just check it out. We have the send message function. Send message function gets two things as an input. We get con, which is a short for connection, and we have message. So it means that this function gets the connection that we want to send the message to and the message to be sent. You can see that I use the send function over here. This is actually a function that is from the HTTP kit library. So send this message to this connection. That's it. Look how short and cute this is.  I don't know. I love it. Then we call this function, the send message function. We call it from broadcast message. We call it the send message function. We call it the send message function. What broadcast message function is doing, it receives a message, and then you can see that I call DUSEC. What DUSEC is doing, it actually goes through all of the players list or collection, and it sends the same message to all of the connections. And then that's it. All right. Let's move forward. Now we need to manage the game state. Okay. When I talked about managing the game state, I told you that we want to handle adding a new player, player movement. What happens when the player has left the game? And let's see that. So how do we add a new player? Adding a new player means that first of all, we want to send a message to the player himself, the one that actually created this message happening. You see that I did the self true over here. So that's what we have on the first line in this function. Then we have two calls to DUSEC. Why do I do that? So the first one is because I want to send all of the existing players to DUSEC. I want to send all of the existing players to the new player. Let's say I just joined the game and there are already five or maybe three players over there that I need to iterate over all of these players and send all of them to me, the new one. And then I want to go ahead and send to all of them the new player. I want to update all other players that a new player joined. And then that's it. I want to update the players list. That's the last thing that I do with adding the new connection in. All right. Now we will talk about the player movement. All right. What do we have over here? Now, every time that I call the update player state function, I have been sending the connection and also the new X and new Y into this function. Now the updating of the new values is being done in a different function. It's just a very small function that calculates the previous X plus 10 equals the new X. So I didn't put that in here. And so we get those new values. And then we have the move player. We have the move player function. And then we do the collect because what happens in the collect function is I check whether I need to collect some of those exceptions that were scattered around the screen. And last, I am going to send, I'm going to broadcast the message to all of the connected players. That's it. Okay. Let's move forward now. Player movement. You saw how I called the collect function before. Now I don't think that I want to go into this function. I just wanted to show you that what we're doing over here is we got to make sure that if an item was collected, then I want to remove it from the items map. I want to update the player new score in the player's map. And I need to return the updated player to the player himself. Okay. Now what happens if a player left the game? We just need to remove him from the list of all players. And that's pretty much it, you know, we've been going through all of those things and we are done. So what you see over here is we have the original drawing that I used for the game. You can see it's not as nice as what I had at the end, right? So I want to do a quick summary of what we talked about today before I finish and then we can do the Q&A session. All right. So we talked about the different choices and challenges that you have to make when you develop a multiplayer online game. I told you that there is more than one way to do things. And for me, I went with the simplest way that I found at that moment, because it was important for me to be able to finish that game because sometimes it's super hard to finish side projects. So I start simple and then I upgrade it. And I hope that next time you'll join me when I'll do the next talk and that's it. Let me know if you have any questions. Thank you. I see that there are some questions in the chat and stuff like that. I hope you enjoyed, you know, I can't see any of the participants, but I do hope you enjoyed this talk. So thank you so much. There are quite a few questions. Do you want to attempt these questions now? Or I can basically selectively turn on the participants so that I can turn on the mics of the participants so that they can ask you the questions. Everything works. Whatever works for you. Okay. I could see there is a question from Aditya. Aditya, I'm just like turning the mic on. You can ask the question. Okay. Yeah, it wasn't. Hi, me. Thanks for the talk. It was just a small question. I was curious about the hello. Oh, sorry. I was on mute. I didn't, I didn't hear you. Can you? Am I audible now? Yeah. Yeah, you are. I was just curious about the identification scheme because the ID didn't appear to be a UUID. So I was wondering if like the, the, like when a player registers the server sort of create some ID and gives to the player, like how does that sort of work? Because one other scheme could be like the player might, you know, come up with the UUID of its own and say, okay, this is I and please register me in the game or something like that. I mean, I can't. Okay. So first of all, I, I can't say that the way I handle the identification of each player is, you know, the best in terms of not cheating proof. Okay. I didn't. If somebody wants to cheat on that to monkey's game. Well, it's not there. I would love to hear other people's thoughts on that to be honest, because the way I did it was, you know, it's just the most naive way I defined an ID. And then I, I, you know, based on hoping that the players are honest, obviously, we don't actually want that. But it's, it's a whole different thing to make sure that you have good, you know, ways to prevent cheating. That's, that's a whole different subject. I would love to do a talk about that one day if I'll find good ways to do that. If you have ideas, I'd love to hear yours. I just, I can't hear you. I'm sorry. Well, that one, the thought that I just had was maybe copycats are a feature of the game that it's part of the gameplay. Like you could get a clone or you could get a monkey's copycating you and you can't stop it. Now what do you do? It's actually very funny thing to do. Very small life. Thank you for that. Okay. Yeah. Thank you. Yeah. But seriously, that, I mean that could have sort of like a national equilibrium kind of dynamic to it because you don't know the incentives of all the players and there could be like, like copying can have a cost and copying can have penalties. I don't know. I mean, it could be very interesting gameplay. Exactly. Exactly. You can say there are a few ways to handle that. Not only, I don't think honestly that, you know, just stopping the cheating is the best way. I always think that if you find like, you know, good ways, artistic kind of ways to annoy, but not too much the cheaters, then this could be more fun and helpful. But what do I know? Thank you. Thank you. Thanks. Thanks. Yeah. Any more questions, people? I do want to ask the audience a questions, my question myself, if I may. Has anybody here ever developed their own game or a multiplayer game? I'd love to hear about that too. If you don't have a question, then I'd love to hear about that. Yeah. You folks can raise their hands and then you are more than welcome to share your experience. You can see the raise hand button on the zoom. I do. Oh, no, I'm just asking the audience. They can see. Okay. Okay. By the way, while we're at it, I want to reshare the screen again just to show everyone. I'm not sure if they were able to see it. I want everyone to see my, my Twitter or my email or my LinkedIn. This is where I post a lot about the talks that I do. So if you're interested in hearing in when I come out with the next talk about, you know, the next step of the game or the next part of development or how I evolve it, then this is where you can do that. And I'll also love to hear, you know, your thoughts. If you don't have the time to do that over here, then you can also send to me either here in the chat or to any of those places. Just wanted to say that because I wasn't sure that I did. I always love to chat about. Games and closer and literally anything that is related to functional programming. Yeah. So I'm just saying. What are the more questions. So Sunday's question was, what are the prerequisites to start game game development? Okay. So I think. I hope I got the, the question correctly and that you mean what are the prerequisites in terms of your knowledge? And if that's what you're aiming for, then I think what you should do is just start by reading a little bit about game development from other people. I would go and check out literally other people's code before I would write a single line of code by myself. I think that's always a good place to start to see other people's work. I think that's we, that's what we do as developers anyway in our everyday life. We see other people's work. We use that in order to create new things and to learn from them. And that's how I would start. That's actually how I started honestly. Before I went to writing my own things. I went and I checked out tutorials. I went and I checked out just a code in GitHub. If you want, you can go ahead and check out my GitHub and find this game and start from there. I think that's the best way. Yeah. That's it. Yeah. Thank you. Thank you. So I do not see any more questions.


So, we will continue the discussion with protein folding and to introduce this protein folding phenomenon. So, I have here a particular example, we will deal with this particular protein called sumo. This is a small ubiquitin modifier protein is called sumo and what is shown here is the so called folding funnel or it is energy landscape of the protein of the protein in a sense. What are the things which are, it is very important to understand this picture. What are the things which are present here? This bottom portion represents here, this is the native protein which is very well folded and on this axis we have the energy of the system and what is on the surface here, this is the model which is called as the funnel model. What is here is the unfolded state of the protein and the unfolded state, you see the funnel is very broad on the top. What does it mean? What does it indicate? It indicates a different degree of freedom. This is the conformational heterogeneity is quite a lot. So that is all represented by the width of this funnel. So this is so wide here, there are trillions of conformations for any particular protein. See how many conformations are possible for a particular amino acid. Let us say I have a 100 amino acid residue protein, 100 amino acids and each amino acid 2 degrees of freedom the phi and psi, phi psi 2 torsion angles and each amino acid can take this any of these combinations of this. Therefore how many degrees of freedom will be there 2 to the power 100, each amino acid has 2 degrees, 2 degrees of freedom. So the 2 to the power 100 conformations are possible for this particular protein 100 amino acid residue protein and the proteins in general fold relatively faster if the system has to scan through all these conformational degrees of freedom, how long it will take, it will take the age of the universe. 2 to the power 100 conformations if it has to scan through the system has to scan through and then finally reach a particular folded state that is an enormous amount of time. But nonetheless we do see that the proteins fold in much smaller time scales, sometimes minutes, sometimes seconds, sometimes hours, so on and so forth. So this was actually called as the Leventhal's paradox, how does the protein fold, how does it scan through the conformational space and reach to the particular ground state or the lowest energy state, does it pass through the entire energy landscape, this is the landscape energy landscape of the protein. So here on the funnel on the top of the funnel you have this trillions of conformations which are possible, they are all interconverting very rapidly and if it has to fold the system has to fold it has to go down the funnel, losing the degrees of freedom slowly as it starts to fold, some degrees of freedom are satisfied and some degrees of freedom remain and eventually it has to reach here but the path it can take from this point to this point or this point to this point can be very different. So there can be multiple paths for the folding, multiple paths for folding because it has to eventually reach the same native state because the native state is supposed to be very, very narrow, it does not have too many do many conformations, it is one conformation. So we know that that is what is called as the folded protein and this is the one which is responsible for the varieties of functions of the protein and we try to understand that. Now as it is going down here, as the protein is going down it can have different paths. So if I want to plot here the energies of this, suppose I have an unfolded state with a certain energy here which is high energy and if it has to go to the folded state it has to come down to the folded state here, this is the folded state let us say, this is the folded state energy, this is unfolded, does it come directly here like this or does it come like this, like this and like this and these are the various barriers and at every step there can be, there can be kinetic process is operating which is the one which is going faster. If the barrier is very high then actually the protein may get stuck in any of these minimum here, there can be a local minimum here, a local minimum here then if it gets stuck here is not able to come out of this minimum then of course it will reach what is called as the misfolded state. So the system will have to come out because of such kind of situation that is what is schematically indicated here, there are various barriers indicated here and therefore there are local minima, there are many local minima present in this folding funnel. So depending upon that so the particular amino acid can fold go over this, this applies to every amino acid residue because of the folding has to happen for all the amino acid residues, the system has to, is there a cooperativity in this? If there is a amino acid residue which is folding does it induce the next amino acid to fold in a particular manner, so is there a cooperativity in that? What is the energy landscape? For every amino acid residue to go down the funnel, go down the funnel and come down here. So these are the various intermediate states that can happen, there can be an intermediate state, an intermediate state here eventually it will have to pass through different intermediate states and finally reach a particular folded state. If it is able to reach one particular folded state then we say it has the unique pathway and all the molecules are coming down to this but if a particular segment is such that it is not able to come down to this state, gets trapped somewhere here then you generate a so called misfolded state and this misfolded states can deal to all kinds of problems, they can aggregate and they can lead to different diseases and things like that. So to understand the folding process is quite an important thing to do. Now so how do we do this, we have to create certain situations like this, how do we understand what is the state of the protein at somewhere at the intermediate level here, ideally one can do it in a kinetic manner but the kinetic manner to do that is you do not have the tools for doing so appropriately at the residue level but we can actually do the equilibrium states. Equilibrium states because these also represent the confirmation, equilibrium confirmations are also sampled by this process and it is going down. What are the equilibrium states that are present at this, if it passes through here I create a situation that the protein gets trapped somewhere here in this some of these ones. The various equilibrium states I can create at different stages of the folding as it comes down from here to here I can trap the thing at different stages and these ones by doing artificially certain kind of denaturants. So this is what can be done by using the denaturants. By controlling the denaturant concentration you can create intermediate equilibrium states they may not necessarily be the kinetic intermediate states but they can be the equilibrium intermediate states the protein will possibly flow go through some of those states as well when it has to reach finally these states different segments because you notice here the different parts of the unfolded states can fold 2 different pathways here to reach the final folded state. How do we do this? This is what is indicated here this is a strategy you actually denature the protein first of all we have to create this unfolded state. So you denature the protein artificially by adding 8 molar urea. Notice here when you denature the protein the chemical shift dispersion on the amide proton these are HSQC spectra amide proton here and this is the N15 chemical shift here and you are plotting here the HSQC spectra at a different urea concentrations this is 8 molar urea, 7 molar urea, 6 molar urea, 5, 4, 3, 2, 1 and 0 this is the final folded state that corresponds to this state here and this corresponds to this state here and notice here the chemical shift dispersion is very, very small and that is indicated so 8.0 to 8.6 only 0.5 to 0.6 ppm is a dispersion here that is why these peaks are looking quite broad in this area you compare that with the situation here this is 7 ppm to 10 ppm this is 3 ppm whereas this is only 0.6 ppm 0.5 to 0.6 ppm. And therefore the peaks are looking quite bigger here and that is just the because of the scales. So 8 molar urea you have this very narrow chemical shift dispersion here the N15 dispersion is of course good but now you see we had these tools which we discussed last time with regard to handling unfolded proteins the IDPs intrinsically disorder proteins or unfolded proteins so there you can use this HNN, HNC and spectra to assign the individual peaks. Now you have to assign the individual peaks in every spectra because there can be differences here in the chemical shifts depending upon what the 8 molar urea is doing because the urea goes and interacts with the backbone of the protein therefore there can be differences in the chemical shifts you will have to identify individual residues in each condition. What is changing from here to here? What is changing from here to here the chemical shifts will change intensities will change the relaxation properties will change as you go from down the funnel like this as you go down as I said the number of degrees of freedom will start decreasing as you go down here you have the maximum degrees of freedom as you start folding some degrees some structures that are getting formed which will restrict the degrees of freedom therefore the number of degrees of freedom will start going down as you go down the funnel here. So, therefore if as you move down the funnel here so you have the peaks some structures are getting formed some areas are getting mobile and that can be seen by the relaxation properties of the individual nuclei I mean I said residues. So, let us see what is it we get in this how do we measure the structural changes that are happening as we are going down the funnel of the protein. Here is one particular parameter which is extremely useful that is known as the secondary chemical shifts. You know that in the particular protein the chemical shift indicates the environment around the particular nucleus if the protein is folded it has a particular kind of an environment if it is unfolded completely random coil it has a different environment and the random coil is more like an individual amino acid residue individual amino acid residue does not have any structure therefore the random coil confirmation can be taken as the individual amino acid residue. So, if there is a chemical shift which is different from the random coil chemical shift it indicates a certain degree of structure around this particular amino acid residue for any particular nucleus if you are monitoring it shows a certain amount of restriction or the confirmation preference around the particular residue. So, you define a what is called as the secondary chemical shift delta S which is delta observed minus the delta random coil. This random coil is basically an individual amino acid residue here of course the neighboring residues also will have an influence. So, typically one generates a table for it every particular amino acid residue keeping different neighbors and you get a certain kind of a near neighbor effect etc all of that put together you generate a random coil chemical shift for a particular amino acid residue you add corrections for all those neighboring effects. Now and what are the nuclei one can monitor you can monitor whatever are the nuclei possible for you can monitor the N15s and you can monitor the amide protons you can monitor the C alphas H alpha CO and I have shown here a few of those here typically these are the ones which are more sensitive to the secondary structures of the amino acid residues. So, here you have the C alpha and the H alpha and CO these are now because you have these chemical shifts one has to obtain I showed you earlier the N15 proton HSQC spectra but that alone is not enough that will only give you the N15 proton chemical shifts having obtained those N15 proton amide proton chemical shifts you will have to also carry out other experiments which we discussed earlier like the HNCA CB, HNCO, HNCA all of these experiments one has to carry out to obtain the C alpha H alpha and CO chemical shifts all of those. Now is there a trend in this for particular secondary structures yes there is a trend here now if you plot here if you look at the secondary shifts for an alpha helical structure if there is a propensity so in a denatured state there is no regular structure but there can be a propensity what does the propensity meaning it has a higher probability of obtaining a particular kind of a structure it will not be permanently there it forms and goes forms and goes forms and goes so that is what is called as the propensity is certain propensity for a helical structure. So, if we have that sort of a situation there what will be the secondary shifts the observed chemical shift minus the random coil shifts for the C alpha this secondary shift will be positive the carbonyl also it will be positive but the H alpha will be negative. So, if a particular amino acid residues has a propensity to be in a alpha helical conformation then you have this combination of chemical of secondary shifts whereas if the same amino acid residues has the propensity to be in the beta sheet structure or the extended beta structure is completely the opposite. You have the C alpha will be negative H alpha will be positive and carbonyl will be negative. So, this kind of chemical shift changes you will observe in your experimental spectrum for all of these. We will illustrate this for the sumo protein and what are the secondary shifts which are plotted here is in illustration we have done that for various with along with the other nuclei as well C alpha and CO what is shown here is for the H alpha H alpha these are the secondary shifts. So, now notice here the at 8 molar urea this is the structure of the folded protein shown on the top here this has a long tail and terminal which is unstructured you have a beta sheet a beta sheet the helix small beta sheets beta sheet helix and a beta sheet again this is the sort of a structure which is present in this. Now in 8 molar urea what sort of a preferences do you have these are all positive. So, most of these are positive here most of this H alpha H alpha secondary shift these are all positive and what does that indicate what does that indicate that indicates that you have a beta sheet propensity. So, most residues prefer to be in an extended conformation like in a beta sheet like in a beta sheet at 8 molar urea. So, this is indicated by this here these ones indicate this small rectangles here these are the areas you can see continuously a range of 4-5 residues if you find then you draw a kind of a bar here. So, that can be with all beta sheet structure. Now this is the beta sheet structure this is not present in the native protein here this is extended and here you have a beta sheet structure once more then you have the beta sheet structure this is present in the native protein beta sheet structure this is present in the native protein partly here and all over the place where there is a helix here you do not find any helical propensity there you have a beta a sheet propensity again very small region and other regions you have the beta sheet everywhere beta sheet where there is a helix you are not seeing the helical propensity there. Now you decrease the urea concentration go down to 8 molar sorry from 8 molar you go down to 7 molar. Now you see the changes that are happening here see these all these with the big positive slowly there is a decrease there is a decrease in the positive values and this remains everywhere there is a small decrease in the positive values of these secondary shifts. So now you go to 6 molar 6 molar here while the decrease in the positive value continues to happen you start seeing some little bit of a stretch of helix here a stretch of a helix here therefore indicate that as a helix here little bit of the helix is getting formed here but rest of it is still beta although the propensity has decreased is decreased there is a change happening there is a change happening in the structure but the propensity is still there because we said this is the probability this is the probability at every amino acid residue what is plotted is against the probability.  Now you come from this to 4 molar urea this is the same this has decreased this is the same and this has vanished this was about 4 5 residue is long here and that is that is vanished this is gone is not so much there and you come down to 3 molar urea most of these helices are gone is all negative all small small small things there no structural preference it appears there is no structural preference at all here the propensities are not there what does it indicate the initially when we went from 8 molar down to 3 molar go slowly the initial extended structure propensity was there this started decreasing and some helices were getting formed so one helix here and then 3 helical propensity is not that this these helices are not permanently stable they are there they are propensity we are talking about the propensity that is it is being formed and getting broken formed and broken formed and broken that is the way it is happening and therefore we reach a stage when we come to 3 molar urea so all these structural propensities which are there these ones have gone okay what does it indicate this is shown in the next slide here so here you can see this is the very dynamic 8 molar urea state dynamic 8 molar urea state and we come down to 7 molar urea what is the color change here this color change is the change in the dynamicity in the protein there is a change in the relaxation properties why does it happen because some constraints some structures are getting formed because of that the dynamics in the protein is getting reduced okay it is not as flexible as it was in this case here so as you go down to the 6 molar you saw a formation of a helix here and the dynamics is reduced further and it is see it is going all the way until here also the dynamics is getting reduced because because some as you as you form some structures it reduces certain constraints for the protein to follow therefore that will reduce the dynamics in the protein this will get reflected in the relaxation properties especially the r2 values which we have not shown here here but this information comes from the relaxation measurements so you have this reduction in the dynamics as you go down in this here so from high frequency dynamics you come down to low frequency dynamics because it is constrained and the motions are getting constrained low so that is millisecond you come down to the microsecond to millisecond time scale r2 values go up okay now you go to 5 molar here as I shown you you got 3 helices formed 3 helices formed and the constraints are still there the motions are reduced as more and more structures are getting formed protein is getting more and more restricted with regard to the motions and that will be reflected in this other portions of the protein as well because it is continuously changing the protein is continuously changing you go to 4 molar see this helix has disappeared as I indicated there in the previous one this helix has disappeared and you have these 2 helices are still there and this one is still there but overall the motions are constrained that this there is a dynamic is getting changed and now you come to the 3 molar everything has vanished everything is vanished why is it so and this is very important why is it so because now if I look at these residues where there is a on the basis of the relaxation measurements it turns out that these are protein is undergoing a certain kind of a dynamics which will eventually lead it to the proper folded state what is the folded state that is here this is the folded state okay this are the original 0 molar and the 1 molar structure is here because it has to form so many beta sheets here it has to form so many beta sheets and then it has to form this helices at these 2 points but in none of these states these helices are there and none of these states you have these beta sheets permanently formed therefore the protein has to change from these states into this state so therefore what we call these as the non-native contacts these are the non-native contacts initially the protein when we went it went through a kinetic process of preferential structure adaptation and then it forms certain structures which are kinetically favorable therefore it formed some non-covalent non-native contacts non-native contacts and these non-native contacts will have to be removed so for that purpose the protein got prepared into a this state where this all these non-native contacts have been removed okay now it is all set it is all set to fold into a state where it is more like a native protein so when you go from 3 molar to 1 molar so you see start seeing some data sheet formed here some helices formed here and these are the native contacts and that you can see here as well in the in this spectra so in this spectra you see from from 3 molar already you saw when you come to the 2 molar the spectral dispersion is increased the spectral dispersion has already compared to this spectral dispersion is was only 0.4 ppm the spectral dispersion is increased quite a lot here you see these ones are small tiny dots and this is and even more increase better the peaks are becoming even more sharper and you are starting a greater dispersion along the amide proton chemical shifts okay and then you come to 0 molar therefore it is all clean beautiful spectrum every peak is separated and the spectral range has gone from 7 ppm to 10 ppm and that is what you can see as the structure is getting formed so here you see that sort of a thing happening at this point so the structure is getting formed at 1 molar beta sheets are formed and the beta sheets typically have a wider spectral dispersion compared to the alpha helices alpha helices are typically within the small range of 8.0 to 8.5 ppm whereas the beta sheet goes all the way to 9.5 to 10 ppm and that we saw in the in the HHSQC spectra as well and this is reflected in this changes in the dynamics in the protein and the secondary shifts and the helical propensities formed in the protein as we are going down the funnel from here to here and remember these are all average effects these are not one particular molecule but these are average effects we are talking about the propensities when you say propensities is the average effect so therefore on the average you have no structural propensities at this point and then you go to the 1 molar you have the propensity increase now they are stable structures getting formed when the stable structures are there you have clean chemical shift dispersion and you have a wide range of chemical shifts reflecting the beta structure formation and then of course when you go to 0 molar you have the proper helices formed the beta sheets formed and this is how the protein is getting formed therefore what is the message from here the message is the proteins when they fold they follow a kinetic pathway and they do not necessarily go through the native contacts it is not that these structures are getting formed straight away as the protein starts to fold protein these helices are not getting formed straight away as the protein starts to fold you provide these conditions for folding it does not necessarily go to these states these states it goes through whatever is feasible in the kinetic pathway so these ones are feasible in the kinetic pathway and therefore they form helices here but these are not the helices that have to be there but as you provide further and further folding conditions these conditions these are not the most stable states so therefore these are temporarily formed and as you are getting providing better folding conditions these eventually these non-native contacts will have to be removed and these ones are getting removed system is prepared and you see there is exchange rates appear there in this situation there are residues which come close and go close and go close and go like this when it is happening the ones regions which are coming close by they are making contacts you will see larger changes in the relaxation rates there the intermediate exchange will increase it is reflected in the R2 values and that indicating that those contacts are similar to what are present in this state therefore the the relaxation data there was indicating that these structures are getting formed because we saw changes in the properties relaxation properties of the molecule indicating that the such a structure is getting formed so once one this is formed then of course you go to the completely go to zero molar you have this sort of a structure which is formed so this is how you can study the protein folding phenomenon by following the equilibrium transitions there so these represent the changes that are happening down the funnel and it can it is an average effect every residue can follow different pathways but of course in every molecule every molecule you have this changes happening in different ways but what you see is the ensemble average on the ensemble average what you are seeing is what is reflected in this way so this is this is the great application of NMR for studying the folding protein folding phenomena in this in any particular protein this is a small example but of course one can do this for larger proteins as well now okay so I think this is we will go into the next class with NMR of large proteins and assemblies and this possibility of studying unfolded states allows us to study aggregation phenomena in proteins I think we will stop here we will take up this in the next class


Their commandant releases new guidance this week on the Corps Report. The F-35B Lightning II from 1st Marine Aircraft Wing began their first flight operations in Okinawa. The F-35 will operate out of Marine Corps Air Station Futema and Kadina Air Base. February 6, Marines with 13th Mu had their opening ceremony for exercise Iron Fist 2017. Marines will train in the Pacific Rim with their Japanese counterparts to improve combined capabilities. Military police with Marine Corps Air Station Miramar are the first in the Corps to use body cameras for their protection and evidence collection. This week, the commandant released a message to the Force 2017. Seize the initiative. A guidance on where the Corps is headed. The guidance has six resolutions for all Marines to follow in 2017. Improve readiness. Modernize the Force. Sharpen the mind. Take care of yourselves. Protect what you've earned and have more fun. These goals support his new task list for the Corps, which was also released. The task list has the same focus as last year. Control, readiness, training, naval routes, and modernization. All Marines need to read the guidance to understand where the Corps is headed. That's all for this week on the Corps Report.


The 11th edition of the World Policy Conference is going to take place at the end of October in Rabat, Morocco. This has been 11 years since we have launched the WPC, as we call it, and at the time we had the conviction that the flat world, the happy globalization, was in fact a myth, and on the contrary we thought that the world would become more and more complex and in some ways troublesome. Unfortunately, events have proven us to be right with the financial crisis in 2008 and the following years, with the so-called Arab Springs, with all its disasters spreading over the whole of the Middle East, and today with the tragedy in Syria, with tensions in Korea and the Korean Peninsula and East Asia more generally, and behind that a kind of new artificial Cold War, mini Cold War if you like, and against this background the rise of China, the competition between China and the United States, which is very likely to dominate the whole of the 21st century. And therefore our mission, which is to contribute to answering the question, how to maintain a reasonably open world, our mission we think is more and more relevant. And in order to contribute positively to that end, we have to accept differences. We have to talk in a positive spirit. We have to be tolerant with one another. And these are the conditions to be successful over the long run. And again we believe that the WPC, the World Policy Conference, is more relevant than ever, and we hope and we trust that it will continue to be useful in the coming years.


Outside Africa, former Roman Catholic Cardinal Theodore McCarrick has pleaded not guilty on Friday to charges a molested 16-year-old boy in 1974. The case makes him the highest-ranking U.S. Catholic official to be prosecuted for sexually abusing a minor. McCarrick is 91 and former Archbishop of Washington, D.C. He entered a spleen through a court officer at a state court in Dedham, Massachusetts, after being charged in July with three counts of indecent assault and battery. Each charge carries up to five years in prison and are required to register as a sex offender. McCarrick has said he had no recollection of committing child abuse. Hello, hope you enjoyed the news. Please do subscribe to our YouTube channel and don't forget to hit the notification button so you get notified about fresh news updates.


What's up, everyone take down here welcome back to another video today. I'm gonna be reacting to the official Firecry 6 trailer. Let's get right into this Okay, I Don't like the classic car burning though. I just hmm. I hope there is gonna be classic cars in it at least that'd be pretty cool It's beautiful. They go I've seen things online where But useless I have something people are saying that This kid is From is the son of one of the villains from either three or four I've yet to play those games. I recently bought them on sale. So I'm going to be playing them before I even get six But the handle, I don't know and of course be weird if he is how the story ties together What are you doing? Yeah, what are you doing? The pin In the kid a live grenade and pulling the pin It is only when you let go That this grenade goes Yeah, so grenade works Follow me buzz kid. I'd be throwing it behind me. I'd be saying must do this I'm just throwing it and trying to run which means that some just saying you won't be following the guy with grenade and our people They don't know how he gave me the grenade. I'd be taking any throwing it at him and more in the office of us noise indecision Strangle, oh, so he's like a leader wherever this is going to be even if you have love in your heart like the leader Even if you want what's for them seems to be rebelling against him save them from themselves Probably want him out of power.   I've been working this Call you evil.   So that is the official trailer for Far Cry 6 now for me I only started playing Far Cry with Far Cry 5 and then I went and played Far Cry New Dawn I absolutely loved both games and like I said I recently went and purchased Far Cry 3 it was on sale for $4 on the PlayStation Store and Also far cry 4 which was on sale for $8. So before far cry 6 even comes out I'm definitely gonna be playing number 3 and number 4 just because I absolutely loved number 5 and new dawn So I really think the 3 and 4 are gonna be great as well I hear great things for them on the story, but for 6 it definitely looks like it's something of interest to me now From this you don't really quite get Who you're gonna be playing as if it's just showing the trailer? The kid looks like he clearly doesn't want to be there the guy that was shown in it He seems to be the leader and everybody they whole I don't know country or area or whatever is Rebelling against him. It seems like they want him out of power, which seems like it's gonna be interesting the kid again I don't think he wants to be there. So I could see you playing as a vigilante or I Don't know maybe somebody that's just trying to save the kid I could see that be interesting, but to actually play as the kid. I don't know how that's going to work out It's gonna be really different, but it definitely looks like it's gonna be great I think the trailer looks awesome. The graphics are way more advanced So it also makes me wonder and it didn't show it in this clip for the official trailer But it makes me wonder if it's only gonna be on the PlayStation 5 and the new Xbox or if it's gonna be on the Xbox one And PlayStation 4 I'm hoping it is because I don't quite know yet If I'm gonna be getting the PlayStation 5 this year or not as a launch year because I never get a console launch here But they're really hyping up the console So I'm really curious to see if it's only gonna be on the new consoles at the end of the year Or if it is gonna be on the ps4 and Xbox one But like I said one thing that I really want Far Cry 6 to have is more car options either adding more vehicles itself Or just more customization options to make them unique the main thing that's five had was Customizing paint jobs Which again, I thought was pretty cool, but I really want a little bit more out of it Especially if it's gonna be like Far Cry 5 and you're getting shot at The ability to add armor to some of these vehicles would have been a huge advantage to have but I absolutely loved Far Cry 5 and Far Cry new dawn I got the Platinum's for both so I can't wait for Far Cry 6 to come out It definitely looks like it's gonna be interesting of course for me. I'm definitely gonna want more than just this trailer I'm definitely once it's released I'm gonna be looking at other things and maybe some gameplay and seeing if it's something I really want to get so far from the official trailer. I think it's gonna be a blast So comment down below what you think of the Far Cry 6 trailer. Are you gonna be getting it? Whenever it is released, let me know down in the comments below. I'm gonna leave this video here. Please take care. Peace