Clearly our 10 finalists have succeeded in all three categories. They've demonstrated that they're winners, and we're very proud of these 10 young men and women. Given that this is such an extraordinary group, it was not easy to decide who gets to fly in the shuttle next January. Our first citizen, private citizen in space. But I'm confident that when the shuttle lifts off, our winning candidate will soar with it right into the hearts and minds of young people around the country, indeed, around the world. We've won one, I think, for American teachers everywhere, and also all Americans. Our final decision was based on who best met the criteria we laid out at the beginning. Originality and creativity, dedication to the teaching profession, a high degree of community involvement, and an ability to communicate the spaceflight experience. We aim to keep our winner and backup candidate very busy in the coming months, training for the flight. We also will ask the other eight finalists to get involved in the space program as well, mainly because we think they're all too good to let them get away. Over the coming weeks, we'll use their talents to help design lessons and demonstrations on spaceflight to be conducted by the winning candidate aboard the shuttle next January. Some will be broadcast live, others will be filmed, but all will be shown in classrooms throughout America. And over the coming year, we aim to put them to work at NASA centers and at our headquarters to assist with educational endeavors and activities. At NASA, we have always believed that we must aim high if we are to reach the stars. We are continuing in that tradition with the Teacher in Space Project. With it, we hope to communicate to the millions of young people throughout America some of the wonders and mysteries of spaceflight. We also hope to help to restore prestige to something of which it's been robbed a little bit in recent years. We also hope to strengthen our ties to the educational community to ensure that our high adventure in space will continue to inspire young people everywhere. Over the past few weeks, our ten finalists have lived and worked together. They've endured exhaustive and really extensive mental and physical tests and a battery of interviews. They've been interviewed more times than you can imagine. And just as we have gotten to know them inside out so they have gotten to know each other as well. They were competitors, of course, but I think they have now become a family. In my final word to them, I would like to offer them Shakespeare's advice. Do as adversaries, do in law, strive mightily, but then eat and drink as friends. And may you always remain friends always, and I think you shall, having had this common experience. Now I have the honor and privilege to introduce to you the Vice President of the United States, Mr. George Bush, who will announce our winners. Well, we're here today to announce the first private citizen passenger in the history of spaceflight. The President said last August that this passenger would be one of America's finest, a teacher. Well, since then, as we've heard, NASA, with the help of the heads of our state school systems, has searched the nation for a teacher with the right stuff. Really, there are thousands, thousands of teachers with the right stuff, and they're committed to quality and education, to teaching their students the basics, reading, writing, mathematics, science, literature, history, to teaching the foundations of our cultural heritage, and to teaching the values that guide us as Americans, and to teaching that important but difficult to obtain quality clarity of thought. We're honoring all those teachers of merit today, and we're doing something else. Because the finalists here with me and the more than 100 semi-finalists will all in the months ahead serve, as Jim has said, as a link between NASA and the nation's school system. These teachers have all received special NASA training to pass on to other teachers and to their students, and together they and NASA will be a part of an exciting partnership for quality and education. So let me tell you now who our teacher in space will be, and let me say I thought I was a world traveler, but this tops anything I've tried. And first the backup teacher who will make the flight if the winner can't, Barbara Morgan of the McCall-Donnelly Elementary School in McCall, Idaho. Barbara has been a teacher for 11 years. She first taught on the Flathead Indian Reservation in Montana. She currently teaches second grade. Congratulations. And we have a little thing for you. And the winner, the teacher who will be going into space, Christa McAuliffe. Or is that you? Christa teaches in Concord High School in Concord, New Hampshire. She teaches high school social studies. She's been teaching for 12 years. She plans to keep a journal of her experiences in space. She said that, and here's the quote, just as the pioneer travelers of the Conestoga Wagon days kept personal journeys, I as a space traveler would do the same. Well, I'm personally looking forward to reading that journal someday. And by the way, Christa, while you're in the program, Concord High, obviously, will need substitute teachers to fill in. And it's only right that we provide one of these substitutes. So the first class you miss, your substitute will be my dear friend and the President's, Bill Bennett, the Secretary of Education. So congratulations to all of you. Good luck, Christa. God bless all of you. Thank you very much for coming. And you too get one of these. It's not often that a teacher is at a loss for words. I know my students wouldn't think so. I've made nine wonderful friends over the last two weeks. And when that shuttle goes, they might do one body. But there's going to be 10 souls that I'm taking with me. Thank you. Thank you very much. Thank you, sir. Thank you, Mr. Vice President, and thank you all.


In some month on 1996, Toy Story was released on VHS. However, between October 1st to October 31st, 2001, Toy Story was being sold one VHS at a flea market. The day was October 7th, 2001. And I was at one area at the market. A man was selling a Toy Story cassette. I bought it, and went home. I inserted it into my VHS player. And it opened regularly. But it was wavy at the part when Andy picks up Woody. But when Woody said his four classic words, you're my favorite deputy, it immediately skipped to Woody and Andy on the couch. Everything seemed a little bright, and was in a jiggly kind of effect. Then it showed when Andy picked the box, but it was pixelated. Then it showed a clip on a plane, and then it went to the scene where Buzz introduced himself to the toys on where he lives at Sector 4. For some reason, that part was in Spanish. Then it just suddenly went static through half of the whole scene. Then it went back to the movie. As I watched, I heard someone outside my house. I looked and it was the mailman. He told me, You've got a package. I then replied. I didn't order anything. I accepted it and opened it anyway. A Toy Story fan club pin. I've never ordered this. As I looked behind, the TV was paused but I didn't stop it. I said I would be back after the situation happened. Finally, I went back to watching my tape. I went down my basement and what do you know, my dog, Chuck, was there. I asked, Chuck, are you okay? And he barked with effort when he went up to me. I hugged him. I went to drink a cup of coffee because I felt like I had a rough day. It was awful. I was not amused because the mailman gave me another Toy Story pin. I said in a very upset voice, What is with all the pins? October 9th, 2001. After Toy Story 2 was released at the same flea market, I bought that tape too. When I went home, I put in the tape four days later. Ages ago, I was a huge fan of Toy Story. My parents would always tuck me in bed and put on Toy Story. I loved that movie so much. I started having a weird feeling about something. After four days, I just put in the Toy Story 2 VHS. It began with static for two or four minutes. It was really weird. October 10th, 2001. I will never forget the day I saw Woody staring at me at Disneyland. I went three weeks after the tape situation but we don't care about Woody staring and stuff. One day I met Randy Newman, singer of Toy Story songs, and I asked him how he was doing and he felt making music for Pixar. He didn't say anything but he played me a song on the piano. It had a hint of you've got a friend in me in it. I got the hint that he would rather not go back to Pixar for the bad times that happened. I configured my problems years later, but we will talk about that at the end of the story. October 11th, 2001. I said, you know what, I am finished with dealing with this movie. So I got rid of the first movie and went to a picnic area to have a little picnic. A little kid was watching Toy Story on his portable TV. I asked him, where did you get that portable TV? And his mom said, Anthony, let's go. As I ate my pizza and gave my dog a biscuit, I went to the playground area and it was completely empty. The only thing there was a Woody doll, abandoned, buried under the grass. I dug it up and brought it home with me. October 12th, 2001. I stared at the doll and put it in my closet. As I was watching the tape of Toy Story 2, it had a random code message on it. It said, 2-FS-7-G-2-2-3-N-B-5-5-5. I wrote it down and went back to Pixar Studios. I asked John Lasseter, what is this code? And he replied, Oh, see you later, we are working on the new movie. In a very nervous voice. He gave me a Buzz Lightyear fan club pin. October 21st, 2001. Nothing really happened on the past eight days. They were like any regular day. I was watching Family Matters. The episode was Little Big Guy. It was that one episode when Steve and Carl accidentally get shrunk by Steve's witty wike invention. Toy Story was paid handsomely for its big budget in the box office. I thought to myself, I wonder what happened to the Toy Story Woody doll I found at the park. I looked in my closet and his voice box sounded like the batteries were going out. October 25th, 2001. One day, I came to my nearby Starbucks for a coffee, and when I went home, Woody was on the floor, and the more days passed by, his face was sculpting and his voice box got more decrepit. After that happened, I went in my garage and things were getting strange. I was at Burger King and I got a whopper. A kid was looking at me. I asked him what he needed and he didn't say anything, but he just went to get a kid's meal and just left. October 26th, 2001. The doll began smelling like tooth decay. Woody's voice box was gone. His hands were missing, his face was melting, and the cotton he was stuffed with was burning out. I was scared because my dog was alone in the garage. I got rid of the Woody doll and went for a walk to the park. October 28th, 2001. Yet again. A few days were skipped because nothing had happened on those past two days. I have lost half of what happened on the tape situation, and I met a physical doctor. He knew how much losing half of the memory meant to me, so he used a shot that knocked me out. I don't remember what happened much on that day, but I remember I heard a child chuckling, because he remembered something he thought was funny. October 31st, 2001. It was Halloween day for me and my dog. We went trick or treating, and got so much candy. I still think of that horrible day, but when it got knocked on my door and wanted candy, instead of giving him some of mine, I gave him the toy story tape. But I fixed all the errors on the tape, and gave him my Buzz Lightyear and toy story fan club badges. He said, Thank you. And despite the fact, this was the same kid that I encountered at Burger King. I got rid of the tape, but I still remember a little bit of the toy story doll inside of me.


pretty good audience there. So, my name is Larry Garfield. I work for Palantir.net. We're a consulting firm based in Chicago. We do mostly but not exclusively Drupal work. We've also done some Sylex work and some symphony work. We work mostly but not exclusively with institutional nonprofits. Universities, museums, public radio stations, hospitals, some media companies as well. It's kind of our standard. We're one of the sponsors. For more information, we do stop by our booth. I'm going to be there in and out. So, enough commercial. So, Sylex. What is Sylex? Sylex is a micro framework built on these symphony two components. What does that mean? It means it's an unopinionated symphony. It's the best way I've heard it described.  Not as much as you get baked in with Drupal Core but a lot of functionality there ready to go. And most importantly, an architecture implied. If you do, there is a symphony way of doing things, TM. Just like there's a Drupal way of doing things. There's not really one way of doing things in Sylex. That's by design. Sylex is a micro framework, micro in the sense of it does not imply a given architectural style. This gives you the freedom to implement the architectural style that you want. It also gives you the responsibility to implement the architectural style you want. And to do it well. As I said, there's no one right way to do Sylex. Different people have a different spin on it. What we're going to go through here is essentially how to do Sylex well Larry style. So this is the Krill endorsed way of using Sylex. It's not the only way, it's just the way that I find helps to keep a Sylex application maintainable. So we're going to go through a fairly basic Sylex application starting from scratch. If you want to follow along, there's the source code, github.com slash pal internet all in word, zero dash two dash Sylex. I'll also be tweeting a link later if you don't want to download it now. So let's just go ahead and dive in. So let's start as any good PHP app does with a composer file. And we pull in Sylex. The entire system is a third party dependency of your code. Unlike, say, with symphony, which, you know, fusing symphony standard edition comes with a lot of stock code you're supposed to use. Every single line of code we have here is something I have written. Not stock code that comes with some standard Sylex toolkit. There are standard Sylex toolkits. I don't use them. I prefer to just roll my own. This is my standard Sylex toolkit. So we include Sylex itself. And that gives us various symphony components that it's built on. So use the same HTTP foundation, HTTP kernel that symphony uses and Drupal 8 and Laravel and a bunch of others. Same routing system. So a lot of us will look vaguely familiar, at least conceptually. As far as our own code, let's go into our web doc group. And that's the entire application. We create a new instance of this Sylex application object and run it. And we're done. We now have a working application. And if we load that up in a browser, we get an error message. This is great, actually. This is a very good place to start because we're getting a proper formatted 404 message, which means routing happens. The routing system is already there and working for us. And error handling is there, so you don't have to think about 403s and 404s and so forth. That's already taken care of. Great. We now have a working application. Let's go home. Okay, now let's add features to it. So let's start some basic routing. After we create this application, we can add routes to it. To add a route, there's a lot of methods you can just call directly on the application. In this case, we're going to create a get route, HTTP get, for the slash about page, which is going to respond with that controller. This is a controller just like anything else in symphony. In this case, we're just specifying it as an inline anonymous function. It can be any callable, callable meaning thing in PHP you can print these after. Function name, object and method, class and method, anonymous function. I think that's it. So we're just going to make it inline and return a new instance of symphony's response with some text message. And that response, actually, Drupal people. Quick question. Who was at my Drupal 8 talk earlier? Most of you. Okay. This should look very familiar to that presentation, actually, because these are built on the same foundation. We're just returning a response object. And that's the entirety of what we're adding. If we want to respond to a put request, then we do app put instead. If we want to respond to a post, it's app post controllers for each HTTP method. If you want to respond to all methods, which honestly I almost never do, then you just say app match. Go to slash about. There's our response. This is a super simple messaging service. Questions at that point? I haven't seen it. So let's do something slight bit more interesting. So as in any good application, your business logic should not be in controllers. Your business logic should be in services. So let's add a service. Object is actually subclassing from Pimple. Pimple is the world's simplest dependency injection container that people actually use in practice. It's about 100 lines long, maybe 150 lines long, and works with PHP's array access methods and anonymous functions. It's actually really, really cool, and it's what everything in Sylex is built off of. So we're going to create a parameter, just like in the symphony container, you get parameters, same idea here, called rot and code. We're going to register a new service called rot and code. That service is, this is the anonymous function, or the callable, can be any callable, that will instantiate this service when called. And we wrap it in an app share call, which means cache this and only convention it once. So right there, we've got everything we need to create this service. We just close over the app itself, and then return a new instance of this rot and code class, and pass as its first parameter that rot and code count. What does this rot and code class? It's a very simple encoding system that uses rot and coding. Who's used rot and coding before? It's a very basic form of encryption, potentially two way encryption, where you just take every character and rotate it. So rot one is A replaced with B, B replaced with C, C replaced with D. Rot two is A replaced with C, B replaced with D, and so forth. Which means rot 13 is reversible. Rot 13 is something to encode it. Rot 13 is something to get back to the original. This is also known as the absolute worst security system in the universe. It serves no purpose other than to be used in slide demos. So this is just a simple class that has a, it takes one constructor parameter, and it takes a string, the php.net documentation as an example. Please never use this in production, okay? Promise me that. We've registered that service. That service is completely standalone. Nothing to do with Silux itself, which means easy to unit test. That's what you want. We're going to modify our controller to rot and code that string instead. And we're just going to return the string rather than a response. What? One of the nice things with Silux, it automatically has a view listener registered. If you return a string from your controller, it will automatically get just wrapped up into a response. If you want to return something that's not a string or a response object, you write your own view listener. We'll see that in a little bit. Rot encoded, or rot 13 encoded version of this string. Rot 26, what does that actually do? Gets back your original string, which is technically still encryption under the DMCA, so reading something is a violation of the DMCA. I always have to throw that one in there. So this is great for going to just hard code everything. Usually you don't want to do that. So let's add some services from someone else. In Silux, if you want to package up a service, you can write something called a provider.  Enjoy them. And Silux ships with a couple of providers, not the libraries for them. You have to download those separately. In this case, we're going to call app register that service provider that comes with Silux. It's just a new instance of doctrine service provider, and the parameters that we give that service provider. In this case, we're going to say we're creating a database with SQ Lite. Here's the path to it. Great. In a controller or wherever else, we can access the database connection just out of the container. Nope, this does mean your controllers here are container aware, which is a bad thing, and have whatever logic you're doing. Incidentally, we have this registered as a get method that's going to drop and recreate the database. Please do not actually do this in production.  So far, we're up to about 60 lines of code in our index PHP file. Who thinks this is going to scale well? Didn't think so. Generally speaking, putting a couple thousand lines of code into one giant index PHP file is not a good idea. So what's the alternative? There's a couple of different ways that people solve this. Just extend that application class yourself. Got an application that extends the basic Silux application instructor, which is going to move all of the code you just had into here. Nothing really exciting here, just moving code around. And I like to break it up into a couple of utility methods. You don't have to, but I find it convenient. So we've got our custom services, third party providers, any routes we're going to create. No new code here. I just moved it into a class. And then our index PHP is just create our new application. It's a subclass of Silux and run it. And we can also flag debug mode true if we're going to leverage that. That's not a magic variable. It's just the name that I decided to give this property. One issue here. A huge problem when I'm using SQLite. I'm using MySQL or Mongo or Postgres. Who thinks it's a good idea to hard code your database credentials into your application class? Good. So how do we provide configuration? Silux, by default, doesn't have a configuration system in it. It provides nothing out of the box. So let's go get one. The standard one that is generally used is from Igor Weider. I think this is how his last name is pronounced. It's a third party download. Just pull it in with Composer. And then we register that service provider. A directory name. And it can handle configuration files in JSON, YAML, PHP, and I think one or two other formats. I like to use JSON because these are going to be parsed on every page request. There's no automatic caching and container building going on here. So this parses in every page request. And JSON is a lot faster to parse at runtime on every single page request than YAML is.  And I'm actually going to load it twice. Let's see why in a moment. Different parameters. In this case, I'm going to specify a different file name. Let's have a look at these config files. So that settings is just, you know, an adjacent file that has a path to our database, or a name of our database. We can also put the odd count in here. In this case, we're setting it to 26, which means transparent, but still actually encryption, and therefore illegal to read. And we can specify an environment. This is not a required way to set things up, but this mirrors the way that the typical symphony app is set up. So your settings JSON file, you don't check in to get, because this has your database credentials. This has, or even dev mode or production mode. Sylex doesn't understand the difference. I'm building the difference in myself right here. Because that environment, everything here becomes available as a property on that dollar app variable. Now that first line there loads up that settings file. We now load up whatever our environment is. So we're in dev JSON, which turns on debug. Load of prod JSON. All of these will just be merged into that gigantic app object. Don't want to set it up this way. Don't set it up this way. This I find is very convenient to have everything checked in to get, that I need checked in to get, and still support different operating environments. And if you want to have multiple config files for different types of configuration, you absolutely can. Just call that provider multiple times again. Okay. So we've got the providers, but we're still registering this service of ours ourselves, this rotten code service. Wouldn't it be cool if we could write our own providers instead? Anybody? Yes? Okay, thank you. Fortunately, we can. It's actually quite easy to do. I'm going to implement the service provider interface. The Sylex interface, Sylex provided interface, which has two methods on it. Register and boot. Nice and simple. Register gets past the application, and you call the exact same stuff on it that we just had in our application class a moment ago. Boot does exactly the same thing, but gets called after all of the registers. This lets you vary what gets registered based on some other service provider. So it's really just a two-pass approach. But exact same code. And then in the application, we just register our rotten service provider. Now note the important thing here is the order, because all of these providers will get called in the order you specified them in the code. And if they conflict, whichever gets called last wins. That's how you can have overrides for, say, a different environment. It also means rotten service provider can, by default, have an encoding of 13. But configuration gets loaded later, so if it specifies that rotten coding count, that wins over what the module provides by default, or what the provider provides by default. Which means just by keeping the order straight of our providers, we can have default configuration for some kind of bundle and overrides, just by varying the order. It's a very, very simple approach. Okay. What else could be cleaned up here? All of these routes. Can we move those out of the app class? Well, yes, we can. You also have controller providers in a very similar fashion. It just has any arbitrary class, implements an interface, and has a connect method on it. But you get to pass the application. And then I'm not entirely sure why, but you need to get access to the controller's service, which is really just the symphony routing component, and get on that directly. Why the documentation always says to do this, and why you then need to return the controller's service itself, I have absolutely no idea, to be perfectly honest. But this is what works. So again, all I'm doing here is moving code out of base application class into this provider. And I can then put these provider classes anywhere I want. There's no rule about it. So if I want to wrap up this route encoding service as its own standalone PHP package, and then have a little bridge package for Sylex, that has the provider, then I just make those two separate composer packages, require those in my composer JSON file. In my code, then I just, you know, register that provider. And poof. I've now got a completely freestanding PHP library wired in to Sylex. And because there's nothing really going on here, there's no magic happening. It's very lightweight. It's just loading classes. That's really all that's going on. Let's try and do something actually interesting because saying hello is not the greatest application. So what should we do for a demo? I should point out that at least in the United States, federal law requires that if you're demoing a framework, your sample application is a blog. And if you're demoing a REST API, your sample application is Twitter. And I have no interest in annoying the feds. So we're going to implement Twitter because what else are you going to do? So what are we going to need for a Twitter application? Well, we're going to need users and messages. So I like to break out my application into kind of... Modules is almost a too heavy a term for the Drupal people. But essentially, I'm going to create modules here really just by putting them in separate namespaces. So I'm going to create a users directory namespace and create a user repository, which is just a wrapper around you're doing a find by username on doctrine, crud stuff. Users have a username and an age. And note here, we get the doctrineDBAL connection object as a dependency, which is the only dependency we have is on doctrineDBAL because it's a repository. To register that, service provider, where we're just returning a new instance of the user repository with its first parameter being that doctrine object. This gets you the same results as wiring things up in the symphony dependency injection container, but it's one anonymous function callback rather than compiler passes and YAML files or maybe XML files or whatever else it is you're going to do. This is about as simple as you can possibly get. You got a question? So the appshare method. This is part of Pimple. So let's actually just look at this example directly. So we've got fdb is a service registered this exact same way by the doctrine service provider. When we call appdb, that uses php's underscore underscore to be php's array access methods, and it says, do I have an instantiated appdb yet? No, I haven't. All right, I've gotten an anonymous function registered for that, I will call that, and whatever comes back from it, be that an object, be that a string, be that the resource, be that whatever you feel like returning is what I will then return. Wrapping an appshare means the second time it gets called, oh, I already did that, I'll just return the same one as last time.  So actually Pimple 2, this is a Solix 1.2 which is using Pimple 1. Pimple 2 reverses that. So the default is to have a shared service, and there's another thing you wrap it in to make it not shared. That answer your question? So it's just like in any other dependency ingestion container, this gets called the first time someone needs that service, and if that means it needs to instantiate some other service lazily at that point in time, it will do so. And then we're also going to set up some controllers. So we're going to have posts to slash users, take the request object, get its content, JSON decoded, this is a JSON based API, take that data, create a new user, and then redirect to the user we just created which is what you're supposed to do in HTTP when you create a new object. As you send a 201 created response with the URL that you should redirect to. So we use symphony's URL generator, which is the same thing you're used to from symphony and it's also in Drupal 8 to generate a link to the users.view route with this as the parameter, the username that we just created, and then we call apri direct. But what's this users.view route? We haven't created that yet. That's down here. So in this case, this is a get request bracket user, which is this bind by username on it. Just look up the user, strip off the internal ID because you shouldn't expose that in a REST API. And then return that as a JSON blob. This is just the utility wrapper around new JSON response and data. And then we're going to bind it to users.view. Every route in any symphony needs to have a name. It needs to have a machine name. In Sylex, if you do not specify one, it creates one magically for you behind the scenes, but you don't know what it is, so it's not useful to you. If you want to refer to a route, you have to give it a name by binding. But once you do that, then we can create a link to it and redirect to it. Remember I said nothing comes by default? Yeah. So we're going to add that line and you're done. And then we're also going to register our user service provider, which lets us register those controller providers. The first parameter is everything provided there should have this prefix on it. In this case, we're saying both things just come from the app route. You could also set it up so that everything is slash users and then whatever. But if it's not the route provider and everything is southbound, it's the controller provider. Okay, so I'll just go to a couple of things. I'll firstken out that very useful people we do not allow that for Drupal8. One problem here we said before, that app class looks like it's getting... or the index php looks like it's getting really big and full of anonymous functions. And anonymous functions are really hard to test. Those route providers look like they're getting really big, as services in symphony and in Sylex and in Drupal if you are so inclined, although we usually don't. So, to add another, once again, we have to register another provider that gives that ability to the routing system. For a provider, I'm going to, instead of specifying an inline callable, I'm going to give it the name of a service and a method. This is the exact same syntax you can use in symphony for service and method that will be a controller. And same thing here. Our service provider, our user controller class, which is our service, users.controller, that's the name we gave it before. In instantiated, we call that method on it, on that class. We're just taking the same code and moving it into actual methods. Which is where real code belongs? One thing to know, I am using, I am actually passing the application object into the constructor here, which means I do have container aware services. Or excuse me, container aware controllers. Is this a good thing? No one can agree on that. The first Sylex app I did, I did not do that. I actually passed in services directly and that got very clumsy. These days I go with the rule of, if this becomes a problem, it's because you have way too much logic and your controllers move it out. So, again, you know, pick your poison on that one. You can go either way. For our purposes, just to keep things simple, I'm going to pass in the container to the controller, but nowhere else. This is the exact same code we had before. Except, getUser is not getting passed a user ID. It's getting the full user object that we loaded from the database. How does that happen? Because we had this convert callback. This one, I believe, does have to be an inline callback. But this lets us upcast those parameters. So we have a user placeholder here. So the user, if provided, will get passed to this callable and replaced with whatever it returns. So in this case, we're going to look up that user by name from the repository and return that loaded user.  Which means our controller now does less work. It doesn't need to load the object. All it's doing is formatting it. This is a good thing. Cool. Also, user objects. Again, we're going to bind to it. Great. Here's our putUser method. Again, JSON decode gets put. Update the object. Save it. And then HTTP is actually unclear about what you're supposed to do after a put request. What I'm going to do is respond the exact same way I would had it been a get request. So we've saved the object. We're now going to return the same thing you would get if you just hit it again with a get request. Is that what you have to do? No. That's what I find convenient to do. We've got users. Great. We've got a system where we can create and update users through the system. We could also delete them. That'd be easy to add. So now, let's check out messages. Messages we'll put in our own separate module. Again, scare quotes module here. Application. We register its services which looks pretty much the same as the user repository. You could simplify this if you want to. The message itself, an author, and a parent because you can respond to messages. It's just some internal implementation details, whatever. Here's our service provider. Looks pretty much the same. The provider looks very similar. With one distinction, we also have a post. So messages live at slash messages, which is a list of all messages slash message ID, or messages you can reply to them. So if you send a post request to messages slash message ID reply, do the same upcasting here as we're doing for a get, okay? Create message. Works pretty much exactly the same as it did on users. Send a post request to slash messages. Create a new message. We send back a redirect. Get a message. Fine. Sure. Nothing different here except, oh, the message author. We're going to overwrite with the author's name rather than internal ID. Again, good rest of the API practice. You don't expose your internal IDs. It's going to also create a new message, but it will populate the parent field right here based on the message that's passed in. So notice here we've got the message being replied to, the parent message, and the request for the message. We send a redirect to the newly created message just as we would. Questions at this point? We don't have a working Twitter app, and it didn't take very long either. Can we go further than this? Absolutely. Errors happen. Because, well, we're humans, and humans make mistakes, at least some of us do. I don't know about you, but I'm not perfect. I make mistakes, and certainly my users make mistakes. In symphony, most HTTP errors are handled via exceptions. The routing system or the access control system or whatever will throw an exception that gets caught by an exception listener and convert it into a response. That's how symphony works. That's how Sylex works. That's how Drupal 8 works. Let's register some error listeners. App error is a shortcut for accessing the exception event in the symphony kernel. I say those words. Does everyone understand what I mean when I say the exception event of the symphony kernel? Does anyone not know what that means? Okay, good, on the same page. So each of these is just a callable that will be the body of the listener for that event. But what's really cool is you can type hints on the type of exception that gets thrown, which means we can just specify, hey, if we get a not found exception, a not found HTTP exception, this is what gets called. I have an object not found, which is what gets thrown by our repositories. This will get called. This listener has a lower priority than those, so it gets called at the end, and it will catch any exception. What do we do with it? Well, again, Sylex doesn't tell you. It just says, hey, as long as you get a response back, I'm cool. So what I'd like to use here is a library called API problem. API problem is one of two REST error specifications out right now. The other is VND error. Personally, I like API problem better, and so I wrote a library for it. It's just a standard library on packages if you want to download it. Very simple, one class, plus tests, of course, for formatting a error message in a standard JSON form. Because you don't want to return an HTML error if someone sends you a JSON request that's invalid, right? You want to send back something that is vaguely what it expects. So in each of these cases, we just use this API problem library to specify, all right, here's the error information, the body of the exception is going to be our detail field, and then get back that information as an array, create a new JSON response with that, send a 404 not found in this case, calls it based on priority in Sylex, or in Symfony, higher number wins. It's a priority, not a wait. So what it'll do here is, exception gets thrown, first thing it checks is, is it an object not found? Is the exception an object not found in exception? Nope, all right, check the next one, which is this one, all right, is the type of it not found HTTP exception? Yes, okay, call that, we're done. This does register three different listeners. So it is three different listeners in the event spatter. It actually, what it does is take each of these callbacks and wrap it in another object, and that's what it actually ends up calling each time, that's the actual listener, and forwards on to your, if you don't type in, it always runs, yes. And if you don't return anything, then I believe that also says, I didn't handle it, so I'm done. If you do return something, then the first one to return wins and the rest don't get called. So you don't need to do, you know, events, arrow, set response, like you would in a symphony listener. This is just a shorthand for that, but that's exactly what's happening under, yeah, the exception listener and the view listener in symphony work almost exactly the same. Short cuts like this for the request event in symphony, called before, for the response event in symphony called after, and view doesn't have one, but there's an open issue right now where it hopefully should get in the next release, because it's silly for it to not have one, so I hope it gets in, and hopefully it will work the exact same way as exception, if I win. There's an open discussion in a GitHub thread right now, but I'm pretty sure we'll be able to get that in with the type hinting for view as well, because that's really, really powerful, as we'll see in a moment. In fact, that's an excellent segue. We're sending out a REST API, which means we should be having hypermedia links. You didn't know this was also a talk on REST, not just on SILX, right? Someone told you? Okay. We should be sending out hypermedia links, which there's about eight different formats for in JSON, because JSON is a terrible format. It's really easy to parse, but it actually doesn't work well as a REST format, because it doesn't understand the concept of links, so there's a dozen competing formats for it. Go team! XML does actually have a standard for that, more or less. So, what we'll do instead here, so we're going to use a library called NoCarrierHAL. It's just a, again, random PHP library off of packages that is the most commonly used in PHP for HAL. HAL stands for Hypertext Application Language. It's probably the leading format right now for hypermedia with JSON. It's an IETF draft spec. It's also what is used by default by Drupal 8 and by default by ZendApagility. So, it's a good format to know. It's very simple. You take any arbitrary JSON object and you just take a magic property on it called links, and another one called embed, and those have a defined structure to them. I'm not going to go into that in too much detail other than to say, we're going to return not a string, not a response, but a HAL object from our controller by a HAL object, because I'm just returning the data. I'm not responsible for formatting it. Who here knows Paul Jones? He's a PHP developer. Google for something called Action Domain Responder. It's something he's been pushing recently as an architectural pattern similar to what people incorrectly call MVC. That actually fits the web a lot better, where incoming requests goes to an action, which processes that request, but then something else is responsible for formatting a response. Because those are two separate actions. It's not really a MVC type structure, necessarily. And this actually fits really, really well with Symphony's HTTP kernel. This is how Drupal 8 is working. This is how you should be doing things in Symphony and Sylex. Fabian actually says don't use the view listener because it's slower. It is sometimes, but I find the architectural separation that it gives you really, really nice. So our controller here is now going to return this thing that is not a response and not a string. So do we know what to do with that? We registered some listeners to the view event. Syntax here is a bit clunkier. As I said, there is no wrapper for view yet. There will be soon, I hope, the more generic on the various events, kernel events view. And we have to do it the clunky way. So we actually have a response object, event object. We get the control result off of it. And this is now exactly the same as in any other Symphony app. If the result that came back from the controller is an instance of that HAL object, then we'll handle it. If it's not, we won't, and whoever comes next will take care of it. So if the request is JSON or HAL JSON, that's the format. Then we'll wrap that in our own response object that formats it as HAL. We can set it to format the JSON nicely if we're in debug mode so that it's much easier for me to read the JSON rather than it being one long string. If it's not, if the request was not one of those formats, one of those HAL JSON formats, then we'll say, all right, if we're in debug mode, you're probably just typing stuff into your browser. So I'll go ahead and return it anyway and I'll assume you want JSON back.  If you send back a JSON variant, they won't know what to do with it and they'll ask you to save the file. So this just makes debugging easier. But if we're in production and the request format is not JSON or HAL JSON, then we'll throw an appropriate exception, not acceptable, wrong mind type and that could convert into a response by Sylex and you get the nice error message back. Actually, we're handling that ourselves, so no acceptable format found. How do we know about that HAL JSON? Well, we also are registering some before listeners. We're doing content negotiation. Please don't do content negotiation this blindly. This is not a great implementation, but it does work. Just get the acceptable content types out of the request. That's what content types did that request say were acceptable in the accept header. Check against the available formats if it's one of the machine name formats that Sylex supports and Symphony supports. Specify that and we're going to default to JSON if we don't know what else to do. Is this the right way to handle it? It's not very robust, but it fits on one screen, so I'm good with it. So, request comes in, we do content negotiation, routing happens, maps off to our controller. Controller returns a HAL object, view listener turns that HAL object into a JSON response and we're good. We've written all of this ourselves and it's only taken us 45 minutes. One last thing, caching. It's kind of important. Sylex does absolutely no caching on the PHP side because you probably don't need it. It's lightweight enough that it's not a big deal and if you get to the point that you need it, well you can implement it yourself. Or move your app over to Symphony where it does a lot more pre-building of stuff. But Symphony doesn't do render caching either. Caching of the output is HTTP's job. HTTP already takes care of caching for you. You should let it. You just have to give it the right headers. What are those right headers? Let's register some after listeners. This is the response event. If we're in debug mode, disable all caching. Great. We've got a cache lifetime configuration property we allow. We'll default to zero. We'll just set on the response, hey, our cache lifetime is 3,600 seconds. Five minutes. So, they time to live on the cache for both proxies and for the browser's cache is five minutes. You can vary those separately if you feel like it. I'm going to set them the same, whatever. Set an expires header as well for older clients. And set an e-tag. An e-tag is simply some unique hash that indicates if this has changed, that means the output has changed and so you need to get it again. This is part of the HTTP one spec. This is not, again, this is not necessarily the most robust way of generating an e-tag, but it works. And the challenge is I can't just invalidate the cache when someone updates an object because you've got these links between them. And so those links could vary when the object doesn't. So I'm going to take the cheap way out and run through the entire process and at the end say, alright, now that I know what the response is going to be, does the SHA-1 match the e-tag that the browser sent? Saying, hey, last time I requested this, here's the e-tag I got back. I've still got that version. If it hasn't changed, just let me know. And then we can just ask symphony. Hey, symphony, or Sylex, symphony library, if given that request and the response I'm about to send, nothing's actually changed, then send a not modified, a 304 not modified instead. And symphony will chop off the body, change the response type to 304 not modified, and send it back, and you are sending back just HTTP headers, no actual body, saving the network. You've got varnish sitting between you and the client. Great, it'll cache stuff for however long you tell it to. It may even handle some e-tag stuff. This is all off-loading cache logic to some HTTP server that knows what it's doing with that. Nginx, varnish, a CDN, take your pick. They do it better than you do, and they are faster than PHP, let them. You've implemented a cached Twitter clone with proper rest semantics in Sylex in 56 minutes. Thank you. So we've got about four minutes for questions. Yes, the question was, doing e-tags this way doesn't actually save us time in PHP. That's correct. If you want, you can put this same logic in the, in a before listener, aka request listener. If your logic for knowing what the e-tag is supposed to be can be done before you get to the controller. If you know that, great. Move this logic to a before listener, and you can just, you know, check there and say, oh, response, create a response, not modified, return that, bypass everything else. Same thing works in symphony, same thing works in Drupal 8, all exactly the same. In this case, again, because of the cross-linking, it's possible that the response that comes back at one URL, the actual bytes may change, even if the underlying object doesn't, because of the links. Like if I, I'm linking to another object, and I include its name, that object changes, I change too. So that kind of cache invalidation is hard. I decided I didn't want to bother with that here. If your application can do that, by all means, you know, save yourself the, the CPU. But this at least does save network traffic and browser speed, or client speed. Can you use annotation for routing? I haven't. There may be a provider that will do that kind of scan. It would then have to cache it as well, somewhere, otherwise it'd be way too slow. I don't know. There's probably a mechanism for it, but I haven't used it. I prefer to just go old school here. Which does bring up an interesting point. Because Sylex doesn't do the compilation by default, that symphony does. That means it does have, you know, it's much more like wait on an individual request, but it does have a scaling issue. If you have an app that has 400 services and 80 routes, those have to get re-registered on every single request. I understand there are some dumping tools for Sylex. I have not used any of them. Or at that point you convert your app over to symphony or Drupal 8 or whatever. Should be easy if you've done your job right, i.e. if your logic is all over in services, you copy those over into a Drupal 8 site, into a Sylex framework, whatever.  It could take you an afternoon support to your app from Sylex Symphony to Drupal 8 if you've done it well. You don't think that microphone's on. The question is for someone new to symphony, is this a good place to start for a small app? Yes, I did. Because it has so little stuff built into it, it makes it much easier to look at just the bare bones core pipeline. Febein recommends that as well. If you want to learn how symphony works under the hood, use Sylex. Because it's the same kernel that Sylex, that symphony uses, that Drupal 8 uses, that various other things use. But all of the stuff on top of it is stripped away. So it is actually a very good symphony learning tool. Again, it works for an awful lot of systems. You can download, uh, Twig Provider, there's a Twig Provider for it. You download Twig, you can build pages with Twig instead. For pure API stuff, I really like Sylex. I, I actually kind of like not having all of the conceptual layers of overhead that symphony has. That said, I also work on Drupal 8, so go figure. Point is, yeah, it's a perfectly viable option if it'll do what you want. And one of the advantages of all, all of these systems using the same common component is your same team can jump from Sylex to symphony to Drupal 8 and back with relatively little retraining. Because all you need to learn is the stuff on top of that common pipeline. The common pipeline is going to be the same on all three. So if you think to yourself, oh, I would do this in a request listener in symphony, that, that answer is going to be the same in Drupal 8 or in Sylex. Say, oh, I'm going to do this weird logic with, you know, grabbing the response, doing some regex on the string for whatever reason. You can take that code and move it almost for a beta from Drupal 8 over to symphony.  So that makes it a lot easier for teams to cross train in all three of them. Okay, time for one more question before they throw me out. All right, great timing. Thank you. Enjoy the rest of the conference.


European XFEL is a state-of-the-art facility that provides access to ultra-bright X-ray light pulses for scientists studying a wide range of topics. It consists of a superconducting linear accelerator, a beamline system, and six scientific instruments designed to take advantage of the unique characteristics of the X-ray light produced by the accelerator. This article was authored by Thomas Skentcher, Christian Bresler, Jan Grunert, and others.


Hello and welcome to the session. Let us understand the following question today. In an AP given A is equal to 3, N is equal to 8, S is equal to 192, find D. Now let us hide the solution. We know S is equal to N by 2 multiplied by 2A plus N minus 1B. Now substituting the value of A, N and S we get, S is given to us as 192 which is equal to 8 by 2 2 multiplied by 3 plus 8 minus 1D. This implies this 2 goes here so we get 384 is equal to 8 multiplied by 6 plus 7D. This implies 384 is equal to 48 plus 56D. This implies 56D is equal to 384 minus 48. This implies 56D is equal to 336. This implies D is equal to 336 divided by 56. Now it gets cancelled by 2 so we get here 168 and here we get 28.  Again it gets cancelled by 2 so we get here 42 and we get here 7. Now 76A is 42 therefore which implies D is equal to 6. Hence D is equal to 6 is our answer. I hope you understood the question. Bye and have a nice day.


Hello everybody, thank you so much for joining me today. I'm watching videos on crafts to inspire its Facebook group made by Tina Steinhaus, and I love ladies from there. They are sharing different types of techniques and projects, and I'm watching Tina when she's making her a Frankenpaper, and I was totally inspired, so I made my Frankenpaper and since that I totally understand what that means, Frankenpaper or collage paper, Frankenpaper it's paper where you can see from both sides what kind of pieces have you used and glued together to make one big piece from those small pieces, collage paper so that you will take big piece of paper and you will glue those small pieces on that big piece. So I did my own Frankenpaper and then I took my camera and I switched it on and I started to put it on pieces and talk to that camera and then I noticed I switched it but to pause, so I'm gonna just tell you what I did. I created my Frankenpaper, then I used craft medium, this is Creabox from Marabu, this is the name of company, Marabu company. I found this collection in a little or local little shop and there are different mediums and I used this number five crystal clear medium from this side of my paper. I put that clear medium and let it dry and when I was talking that I'm thinking that I'm taking that video I used another thing I've got in my stuff for a very long time, it's when I bought it I thought I'm buying white fine embossing powder but what came, it's like granite, I think this is like enamel, that enamel embossing enamel enamel. So what I did, this is that colored side and on that side where I have used that clear clear acrylic gal, I put some colors to distress my background, I used walnut stain and black soot and then I put on the top like nice amount of this of this powder and I melted down and then I used my stumps and once it was still hot hot hot and melted I used my stumps and press it into that into that I don't know what is it embossing powder probably or that enamel and then I took my stumps off and I've got this beautiful embossed image and I once it was dry I cracked that the trust so I was thinking yeah I missed that taking video about this process but maybe I can somehow create something different, this I wanna where is my brush, I would like to use some colors on that and I've got here something what I totally messed up with, ideapatina from Mamery Spa, I will put the names down below everything I'm using, ideapatina, this is Rusty Patina, I made mistake when I started to work with this bottle, I didn't clean my brush when I put it to color with that metallic base and I painted I don't know what I did but I put that dirty brush with that color into my patina so it already got rusted that absolute liquid which is making that rusty effect so I'm using it here just for coloring, you can see that now how how dark it is, I'm gonna color this my embossed effect but this needs to dry over the night to have some some effect using this Rostock, oops sorry that's check word, this liquid, so I'm gonna just wipe this or put this liquid into my embossed tack and I will hope that at morning I will have some result, I'm not sure if it even works because I think all that rust effect it's already gone because I use that dirty brush but at least I will have here some kind of colors from that left and I was thinking maybe I can use another tack from my Frankenpaper and maybe I can create something, something else so if you don't know the Facebook group Craft to Inspire I will put link down below, go to go to have a look, go to ask ladies, join this group because ladies are totally amazing really, they inspire me so much especially Tina, I love her style, I love her to listen to her videos, she's got wonderful demos, wonderful demo videos, she's a great teacher so I'm gonna let it dry over the night, I already like it like it's now so I hope it will dry like with beautiful effect hopefully hopefully it will stay there something till the morning so I'm gonna take some different tack and I will try to do some different technique something just with stamping probably so I was digging into my drawers and I found these these are wooden pieces these two these three are wooden pieces where I actually used that rusty patina and this is framed from a craft clay I created a long time ago so maybe I will use them and from the Tim Holtz those two board pieces I think I'm gonna use this relic and I've got here those photos and I found that frame it's actually sitting on those photos really beautifully so I'm gonna use that lady probably I'm not sure probably I might use and I will create something or at least I will try to create something using my stuff so first this is that size side where I use that medium so now I'm going to try one technique it's very old technique using oil pastels and I think I saw that on Tim Holtz channel if I'm not mistaken when he did background and then he sprayed it with sprays to create you know those images stayed there and I think he used oil pastels or maybe he used his those crayons now I'm not sure I think he used those pastels oil oil pastels but we will see I will do something I'm gonna use those oil pastels I'm gonna show you and I will write down all information so these are oil pastels I've got them for a long time but I'm not using too much my stuff so I decided to be much better with using all those supplies I bought through to those years I'm in this craft family and I'm gonna just rub it into my paper to create like a coat with those pastels and maybe something on the bottom where he maybe maybe some different maybe I can use oh these are undiskinned stencils and they are beautiful as well I like all my stencils so I think this uh what is it oh come on how many times I'm gonna flip it over this number I guess I'm gonna use that number 337 but for that I would like more to have black and red color so for number I'm gonna give it a try if I will be successful with oh that's different color this one this is more to more to um not burgundy more to purple I want to have it red red like press it into my paper like one I'm gonna use for an o it's hopefully that will work it should it should work because oil pastels have beautiful you know coating so what I'm gonna do next I've got here and I'm using it all the time for my stamping and times for stenciling when I am lazy to find out another different um different ink pad I'm using ink pad with my printer ink this is bottle uh with bulk ink for inject printer black color just normal uh bottle for you know for those who like to refill is it that right word uh ink cartridges so I bought that bottle I'm not using it for my printer but I'm using it for stamping and what I think this will be enough yes so what I did before what I tried before I've got here a bottle with water and with walnut stain uh reincre distressed ink reincre that liquid so I sprayed my table like a lot lot lot lot and I use this printer ink black one and spray it again to make a spa and I'm gonna try to dip my tack into this color and because I have used that medium it shouldn't soak through if I use that medium right way and it should make some protection um for my paper but I can see that I probably didn't use a lot so I'm gonna dip my paper into this bath yeah here on the top I didn't use much and I've got here another paper which I'm using you know for those leftovers this is just normal card stock so I'm always like taking see it's proper proper this not distressed color it with inject printer not inject yeah inject inject printer ink so right now I'm gonna use my heating tool and I'm gonna dry that tack with my heating tool and we will see how it will looks like so I'm gonna dry it and where I use those oil pastels it should it should stay clear at least here here it should stay with those colors so I'm gonna dry it I think it's dry everywhere I think I've got here a little bit of that uh of that uh enamel it was probably on my table and now I'm gonna try to wipe a little bit this top yeah there is something a little bit so what next next some stamping oh I don't like to show you my stamping because I'm really right no good in it so I'm gonna just try to do some very quick stamping hopefully I will don't mess up somewhere here this is glitch that a bigger collection not glitch mini but that normal glitch it's not too bad okay and some more stamping so I did a little bit more stamping here and here on the top I don't want to show too much my stamping because my hand looks like this after stamping and I'm like very messy and I'm gonna create the top of this paper like a tack before I will attach any embellishments I'm gonna very carefully fold these two corners together very carefully like this so I do have shape as a tack and here it's getting unglued and now I will start to build up a little bit so what I'm gonna do next before I will do anything else I'm gonna take this ink again I'm gonna open the bottle and I will try to take a little bit of that color on my brush quite a lot and to do some small splatters just a little bit to wipe it off close the bottle I don't know when I have any color on my table so now I can start to build up I do have here this is a piece of metal from can from energy drinks I used 3d I didn't see that it's dark so this is 3d embossing folder from Tim Holtz the name is mechanics here I will put all the information down below so I glued can on a piece of serralli box then I used that can for my ATC card look at that I'm so happy that that's inspired by Tina as well by the way she sent me amazing card so that leftover I put on pieces I've got a few of them over there and I'm gonna use them here and there and this one I embossed with this embossing folder and I've got here glitch glitch stamp that circle which I fussy cut out and I cut out also that inside piece I used dye I'm gonna say I used circle dye from I think it's physics those stitched ties those what is it nesting dyes is it I'm not sure the name so I used circle to cut it out that inside because I will be terrible with my hand and I'm thinking to use piece of that under because this way so I'm gonna make a mark for myself or probably I'm just gonna glue it together and then cut that extra I'm just gonna cut it a little bit down and I'm gonna use a double sided tape that foam double sided tape and I'm gonna glue it together okay now I know where to put my double sided tape it's too long and I'm gonna glue it to that metallic piece I'm not sure if I will use just some coloring on this one maybe not maybe I will leave it silver or maybe I will decide later it's always way how to color your metallic piece even if you will have it already on your project it's always you know small brushes and take the time with coloring which way I want it I think this way yes yes yes I think I'm gonna place it here like this yes so I'm gonna put there a glue and because it's that metal a color metal it's glued on a piece of serrally box it's good now to use normal glue I'm gonna place it this way and from this side I'm just gonna put it off along the tag yes here I'm gonna use on the top this second circle here in the middle I've got this is when you're using you know circle punches so I've got this one here I don't need no glue I'm gonna place it to the top like this yeah my good my good and now those other pieces so I've got here this the lady can go to the photo exactly how it is and show yourself we have opened this bottle it looks like it's hopefully it will work gonna put tacky glue on this frame and glue it together with that photographic and as I said this frame it's from craft craft clay I made it a while ago and I used that rusty patina on the top and then let it dry through tonight and it makes a beautiful rusty effect I'll place it here maybe I'm gonna use the walnut stain and I'm gonna distress just these edges here and I think I'm gonna use the walnut stain also on edges on my tack not too much I don't want to make it too dark because it's already dark like this now how I how I will put that those pieces I can place this one here I can still move it a little bit no but I like this one a lot so first what I'm gonna do I'm gonna try to make a hole in the corner of this and fix there using brat to fix there that gear so I put gear on my picture and I put also one brat here in this big wheel or gear I'm gonna put that tacky glue and glue it on my paper if you will be here like this now I'm gonna put glue on the back side of that photography glue it down this way place it the dot cross underneath and here that relic I can yes I think I will like it this way and I should before I started to put any kind of decoration I should use also my sewing machine and sew it all around so it will be without sewing effect oh I do have stamps oh I forgot I have stamps will I use any okay I can try this one I'm gonna give it try with my lovely stomping oh sorry pardon me pardon me no maybe I can give it try right but I would like to have it in not in black black color I think just need to wipe it very lightly and now it's not too bad actually look at that it's not too bad so this is my but next time I have to remember to use my sewing machine so this is my sharing for today what I'm doing with my franken paper I'm gonna let it dry properly and then on this side I would like to just stick you know writing paper for some notes but first I need to let it dry properly and I wanted to use a propodile to punch the hole punch the hole and place there some so I'm gonna use this Utah thread and maybe later when all will dry I will use also some embellishment to hang it here so you will see that probably on my Instagram thank you so much for visiting me today if you stay till the end thank you so much for that I hope you've got wonderful time take care about about yourself and see you next time thank you bye


Here is Alejandra Ortiz from Colby College, and Alejandra will be talking about atolls and ecogeomorphology. Over to you. Great. Thank you so much. I'm really happy to be here, and I apologize for the really long title. I think it might be the longest title. I'm going to say it's due to COVID, and really it can be summed up with this title, understanding atoll survival, or what's going to happen to atolls in the coming century. And so this work is something that I've been doing for the past couple of years and is really dependent on a large body of students I've been able to work with, including Sean Dailey, Jonathan Woodruff, Carter Rucker, and Faith Johnson, who are all students that I worked with at North Carolina State University, and Melody Thomas, John Connors, and Manny Salas, and Bentley Meyer are more recent students I've been able to work with at Colby College. And I have been really liking some of the memes that have come up on the academic Twitter, so I couldn't resist doing my own version of it for this talk. And one of the things when we look at atolls in the geomorphic community is that in the last 10 to 20 years, there's been a real kind of explosion of interest looking at these landscapes from the point of view of how the processes and feedbacks are driving landscape change. And you kind of tend to get to big camps, which is either that these islands are doomed because of climate change, or they seem to be surviving, and they're going to be okay. And so that's kind of motivating work for a lot of the work that we've been doing. And to answer this question of atoll resiliency or survival, first we have to understand where are the people living. And on those islands, which I call Motu and I'll explain a bit more about what's driving the evolution of those islands. And to understand the evolution, primary control, we need to think about what drives kind of the size and shapes that we're seeing on these Motus. And is it potentially external controls like the offshore wave climate or big hurricanes that they're passing through? Or is it more driven by internal processes like coral reefs or production of sediment in the lagoon? And to answer this, we've started with creating a global atoll database and then looking at quantifying some of these relationships between offshore wave climate and atoll and Motu morphology. So of course that begs the question, how am I defining an atoll? And you'll hear me say sometimes atoll or atoll in a given audience about half the people like one pronunciation, half like the other. So choose your favorite. But I take a very broad definition. I'm saying that there has to be some coral reef platform, so some kind of old carbonate platform that's encircling an inner lagoon. And on this coral reef platform, we may have land.  Motus is one term. It's the Polynesian term. They are also called sandy caves or islets. And they tend to be really low elevation, usually less than five meters with maybe an average elevation of one to two meters above sea level. And the key part, of course, is that the Motus are where people live. So here is an example of a small vegetated Motu that you can see in the background in Majuro, which is in the Marshall Islands in the Pacific Ocean. And when we kind of think about the shape, we have kind of this offshore ocean that then shallows up on this old carbonate reef platform, which we'll call the Reef Flat. And then on that Reef Flat, you can have these Motus. And there one way of thinking about these Motus is that there's kind of a pile of sand and coral rubble and maybe some vegetation holding it all together. But it's pretty small relative to the size of the entire atel. So when we talk about where our atels found, Sean Daly helped me create a global atel database using this very broad definition. And not unexpectedly, you find these in all of the world's oceans between the tropics of cancer and Capricorn. The Pacific Ocean has the largest number of atels followed by the Indian Ocean with only a few in the Atlantic Ocean in comparison. But because we have this like huge number of boards of five, almost 600 atels globally, it becomes difficult to visit them and do fieldwork for a number of different reasons. A lot of them tend to be in the middle of nowhere. So getting to them is difficult. And that's really kind of started to motivate some of the approach that we've been doing in my lab, which is this kind of three-pronged stool where we're using a combination of remote sensing and computer modeling with some targeted fieldwork to help us think about this question of whether these landscapes are going to be surviving in the coming century. Oh, skip one. So just a brief background in general, when we think about these atels, I've said, you know, there's kind of this reef platform, which you can see here in the upper left in orange and circling this inner lagoon. And then on that reef platform, we might have some of these motos, these islands, which are shown in grain. If we take a cross section through that, we can see that that reef platform, that carbonate base is actually quite large. And that's the product of tens of thousands of years of growth of old corals and happening on very slow timescales compared to the timescales that are driving the motu formation. So these motus are forming much more quickly on timescales of decades to centuries, typically. And that's kind of the piece I'm interested in, because the motus, these reef islets are where people are actually living. And so when we think about kind of the survival of these landscapes, we need to understand what's going to happen to those islands. So here I'm showing you two satellite images of atels in French Polynesia in the Southern Pacific. And we have Rangaroe, which is one of the largest atels on the upper left. And then another one on the far right, Higuero. And what we see is that on a given atel, A, they very rarely are actually circular, but B, and more importantly, we have huge variation in the size and shapes of the motus on just even a given atel. So there's kind of this consistent pattern in French Polynesia, where on the northeastern sides, we see these long connected motus. And you can see kind of the vegetated part here with a pretty narrow reef flat in front of the motu. But when we look on the southern side, we might have significantly fewer motus, and they tend to be much smaller. So if we look here, we can see that these motus are maybe 500 meters in width. There's large variation in how wide the reef flat is. And on some atels, you might not have any motus on that southwestern side. And so the question of course is, well, why is that happening? And there's some work that I did with Andrew Ashton from my PhD, using X-Beach in a simple 1D model that predicts that the offshore wave climate should drive a critical width of the reef flat in front of the motu. So what I mean by that is if we zoom in here to that northeastern side of Rangarola, we've got this long connected motu in green. You can see the lagoon in kind of the lighter blue to the south of it. And then what's been highlighted in these orange boxes is this reef flat. So the carbonate reef flat is usually quite shallow, maybe a meter or two in depth, and doesn't necessarily have a lot of active coral growth. Most of the active coral growth is happening on the ocean side of that reef flat. But what we found was at least with the model, it kind of seems to suggest that there's a reason that the motu doesn't keep growing all the way up to the edge of the reef flat. And so the question of course becomes, do we see that? So to understand this question, I've been working on atomorphometrics and trying to figure out, do I have this behavior kind of seeing globally of consistent offshore or consistent reef flat width in front of the motu versus when we don't have motus? And is that driven by an offshore wave climate? And so to answer this, I'm kind of using two big pieces, the remote sensing and some more modeling work. And this has really been driven by my graduate student, Faith Johnson, and then my two undergrads, Manny Salas and Bentley Meyer. And the methods that we've been using for this are first, we're going to use Landsat imagery and create satellite images composites that we can then automatically classify land cover on them. Then we're going to calculate the metrics of that land cover. So if I've separated an image into motu versus reef flat, let me measure how wide is that reef flat? What's the area of my motu? And then compare that to wave data. And we're going to be using WaveWatch 3 hindcasted wave data as a way to kind of get our global coverage. So when I talk about Landsats and temporal composites, what you can see here on the left is a single Landsat image taken of Bikini Atoll, which is in the Marshall Islands, and is most well known for the fact that the U.S. dropped some atomic bombs and you can see some of the remnants of that in the upper left hand corner of the reef flat. And one of the big issues we have is the presence and prevalence of clouds. And so one way that we can get rid of clouds is by using a temporal composite. So we take every Landsat image over a set time period, in our case, three years, and then we remove the clouds and average the remaining pixels to create this composite of Bikini Atoll shown here in Part B. And it's a very nice method to help us remove some of the outline issues that might affect our images. And so here I'm walking you through Katui Atoll, which is in French Polynesia. And we start with our composite Landsat image in the upper left. We then are using different methods to do automatic land cover classification. Currently, it's using unsupervised canines classification to separate it into water in blue, reef flat in red, and then motu's islands in yellow. From that, we can then start to do some of these morphometrics. And one of the cool things is, even though Landsat has pretty coarse resolution, it's only about 30 meters, when we zoom in on some of those finer features that are visible in a Google Earth high-resolution image like this deep channel that's cutting through our reef flat. Our Landsat imagery and our automated analysis is actually capturing that behavior, and we are seeing those features preserved. So that's actually been really good. You can see here kind of the outline in light blue is the reef flat, and the outline in green is the motu. And obviously we can see when we're looking at a high-resolution image, we might have more variation within those motu's, but ours at Landsat scale kind of resolves it as a single motu. And so what Bentley has been doing, and I'm not going to steal too much of his thunder because he's presenting tomorrow's poster, is taking some of these morphometric measurements that Faith has done and comparing it to the offshore wave climates that we have pulled from WaveWatch3. And we've done it on a relatively compressed piece. So what we did was looking at a couple of key metrics, like the reef flat width in front of motu's, and we've binned them based on the orientation. So we picked the center point of the atoll and then bin it directionally into northeast, south, and west. And we also bin our wave data into those same categories as a way to kind of simplify our comparison. So what we find when we're looking at 43 atolls in French Polynesia, and this isn't all of them, and we look specifically at how long our motu's are. So the motu length versus the reef flat motu width, what we see plotted are all these points. So these are from 43 different atolls, and they're colored based on the direction. So all points in the blues are on the north and eastern sides of our atolls, and the greens and yellows are on the south and western side. And we see a really interesting behavior for small motu's. Motu's that are relatively small in area and length, less than about five kilometers. We have huge variation in how wide the reef flat is in front of those motu's. It ranges from 100 meters to almost a kilometer. But once we get these bigger kind of connected motu's, like on this north side of Rangaroa, we now have almost a near constant reef flat width in front of the motu's. And so what I've now plotted here in the second graph is that reef flat width of the motu's for only these larger motu's. So just kind of looking at this piece of the data and plotting it against our wave heights that we've extracted from WaveWatch3. And in this case, I'm plotting it versus three years worth of wave data that's been in, we've calculated the H3 Sigma, which is the kind of storm, the big infrequent storm that might be hitting these islands. And what we see is there seems to possibly be a trend that we have increasing reef flat widths in front of our motu's with increasing wave heights. Now, these data were generated yesterday. It's very preliminary. We have a huge data set. We're still going through it. So just wanted to kind of highlight it. One of the other pieces we've been getting into is trying to use different methods to help us classify our landscapes at higher details. So right now with K-Means, we've been doing just three classes, land, water, and reef flat. And Manny's been working at using deep neural networks to classify our landscapes into more classes, including vegetation versus sand versus infrastructure. And that's been some work that we're hoping we can then use to look at more places. One of the other things we've actually done is look at some of the impacts at kind of much smaller scales. So what can happen on certain atolls is that to generate building materials, people will actually excavate out holes of the reef flat. And so these excavation pits we can see here off of Majura, which is atoll in the Marshall Islands in the Pacific. And the question became, well, if we create this big hole in our reef flat, how does that change the wave energy across that reef flat? And do we see kind of enhanced erosion of vulnerability of those motus behind those reef pits? And what we were finding was when we have no excavation pit, we've got this black line and wave height decreases as you get closer to the motu, which is what we expect. But then as you create a different pit of different depths, we actually increase the wave height at the motus. And so what we can then look at is kind of, once you've got excavation pits of about two meters or deeper, you do have a bit of enhanced wave energy at the motu location. So this might be an area of future worry for people with rising sea levels of kind of higher vulnerability of these landscapes. So I generally touched upon some of the different pieces we've been working on. And the big piece that has now been postponed to summers is to try and get that third leg of the stool, the fieldwork. And so I'm going to be going hopefully next summer to Glover's Reef and Belize, which is one of the few atolls in the Atlantic Ocean. So it's much easier for me to get to. And we're going to be deploying a lot of instrumentation to help us kind of get a better handle on some of the hydrodynamics and sediment transport processes that are operating at these landscapes. Other aspects is right now we've got 88 atolls that we've done morphometrics on and wave data analysis. We have about 560 in our database. So we need to apply that more broadly. And we want to start tracking how those morphometrics have changed through time. Because we're using Landsat, we could in theory go back to the 1980s. The one downside is it doesn't tend to have great coverage back to the 1980s for a lot of these landscapes. We can usually go back to about 2000. And so even so we could still track 20 years worth of landscape change on these locations globally. And so I think that's going to be really exciting to help us again piece out what might be driving the changes in these islands. So acknowledgements, my students, Andrew Ashton who helped start this, and then a number of different funding pieces. In particular, most recently from Colby with the AI Davis Institute and the Low Latitudes Fund. Here are my references and I'll take any questions. Thank you Alejandra. That was super interesting. So we have some time for questions for Alejandra. Brad has a question. Go ahead Brad. So thank you. That was a very interesting talk. And I was wondering if you can just remind us from the earlier work, what is it that determines that critical reflat width before you get a Mo2? Or that stops the Mo2 from growing out to the edge? And remind us, can you explain the difference between those North and East sides versus the Southwest sides in terms of wave climate? So those are great questions. So first in terms of the potential driver of this critical reflat width, what we found was when I used X-Beach in this kind of simple 1D thing, which I'm showing up here in the upper right and in the schematic, we had offshore ocean, a placement of a Mo2, and then behind the Mo2 a Lagoon. There was a change in the direction of bed shear stress. And so what would happen is that as the Mo2 got closer to the ocean side, it went from having onshore directed bed shear stress, which would theoretically be driving sediment onto the Mo2 and helping it prograde to the edge, the ocean side, to a negative directed bed shear stress where bed shear stress would be directed off towards the ocean, which would then be a way that it would stop accumulation of sediment at the ocean side of that Mo2. Now, the key part with this is because we were doing it as a 1D model, this really was only a good proxy for some of these larger, long connected Mo2s where the dominant direction is probably on and off the reflap. If we look at some of these smaller Mo2s, we would expect that flow would be going around them as much or more than maybe just going on and off the reflap. So we don't actually necessarily expect that to be the primary driver of a critical reflap in front of these smaller Mo2s, but we were thinking that it might be driving a consistent trend in these larger Mo2s. And then when we look at the data, sorry for going through this kind of fast, the interesting thing that popped out is of these 43 atolls, I have a consistent trend. Now this is French Polynesia, and I've added in about another 40 atolls that are more globally spaced, and we still see similar patterns of a near constant reflap with in front of these big Mo2s. It gets to about 120 meters to 150 meters as the mean reflap with. And in terms of really what's driving that, I've got this graph, but there is a lot more data, and honestly, we were just starting to look at this yesterday. So I think the cool part is trying to investigate that more and tease out some of the different pieces.


Hey, welcome back. This is part two to our watch along with me and my lovely beautiful wife to Chennai Express with Shao Rukh Khan and to Pika Padakone. If you're watching this on YouTube, you'll see a very cut up version. We can use about five ten minutes of very, very, very, very, very, very, very, very cut up for those who probably know songs on YouTube because you know copyrights. But if you'd like to see the full uncut version, including all the songs, you can head over to Patreon to check that out. I'll put the link in the description below and the pinned comment for you to go check that out. And here we go. What is happening? See. My name is Rahul and I'm not a terrorist. Oh. Hi, buddy. Oh, thank you. It was so nice to see you. Your brother is leaving me to Mumbai. Come back soon. Huh? Oh, you're... Ah! Hey! Hey! Hey! You're there. They're not a family. Rumbo tension. We're going to put you in the same team. Officer, you can't leave me here. I'm Sri Lanka. What is physics? We don't know. What is physics? What is physics? Shit.   Bacoast dictionary. Underestimate the power of a common man.  I'm not Angelina Jolie. What is it? What? Oh, my God. Oh, my God. Oh, my God. Oh, my God. Hey! What happened? I want a movie. It's a funny movie. Because whenever people laugh at me, I get scared. That I'm very rich. Of course, of course. And you're Halwae.  What? Actually, I never missed my parents. Because my grandfather and grandmother took their place. Especially my grandfather. Life without mother and father takes 50 years. How many times has he been named Rahul? It's not an easy thing. 50 years? I think you're 50 years old. Look, why? Why? You're older than me. I get it. I get it. Sometimes, man. I swear, sounds necessary. I need to pick it up into a horror film. Yeah. I don't understand the audio sound effect. Hey, I need to pick it up into a possession movie. No. That was pretty awesome. What are these sorries? They mean that husband and wife are born strong. Okay. You're strong. What's the need to be strong to see the lesson? Don't look. Do it. Don't underestimate the power of a Halwae. Where is the temple? Where is the temple? Don't underestimate the common of a power bank. Now you can do it. You think so? Easily. I'll do it twice and backwards. Miss, subtracting? Yeah. Nonsense. Nonsense. Topeka can have such sad eyes. She's shmitten. She saw that she's acting against Shahrukh Khan. That's gorgeous. Very. Now she's shmitten. I'm sorry.  Rahul? You got your item, sir. Oh! I'm sorry, sir. Leave me. No, no. I'm ready to study. I'm ready to study. No. I'm sorry. No. I'm sorry. I'm sorry. I'm sorry. I'm sorry. I'm sorry. Forgive me. Forgive me. Forgive me. Forgive me. Forgive me. I'm sorry. I'm sorry. I'm sorry. Oh, go ahead and give me the disc. I'm gonna give you the disc. And now to the end of our part two reaction to Chennai Express. If you'd like to watch the full uncut version or like the third part that's not out yet, it's already on YouTube, obviously. You can go check that out. I'll put the link in the description below and the pinned comment. And on to the part three.