Hello my DevNation friends from everywhere in the world, thank you for coming to another DevNation Tech Talk. Today we have a frequent guest because we welcome Mr. Reactive, Mr. All Things Reactive. So directly from friends, from his cozy house in France, let me introduce you to Clemence Coffier and Clemence. Thank you for coming and the stage is yours. Hello, thank you Edson. I'm very happy to be here. Thank you for having me. Let me share my screen. Can you confirm you see my screen? Yes, I can see it. Alright, so again, thank you. My name is Clemence Coffier. I'm working at Red Hat. I'm doing plenty of Reactive stuff including Quarkus, Vertex, Mutiny, Small-Eye Reactive Messaging and so on. We're not going to cover all of them today, but we're going to see quite a few of them. Yes, initially this talk was named Take the Highway with Reactive Roads, but we got some kind of mutiny around there and we had to change a little bit the content of the talk. But don't worry. What I'm going to present at the end of this talk is amazing. It's the next generation for Quarkus. It's going to really blow your mind. So today we are actually taking a pirate's journey with How-How Reactive and we are going to explain how Quarkus has become reactive, why we did it. We are still going to speak about Reactive Roads because it's a big part of our Reactive journey, but you would see other stuff, other reactive parts of Quarkus and you may even discover how Reactive works under the hood. But first, of course, what's Quarkus? Quarkus is a stack to write Java applications that has been tailored for cloud-native and Kubernetes. It provides everything you need for microservices and serverless, but not only. You can write command-line tools and with a set of extensions that never stop growing, you can write almost anything with Quarkus right now. So what makes Quarkus different from the other framework? Well, if you use another framework, you generally develop, then go to your terminal, do maven, clean package, skip tests.  And then you start it, java, da, java, blah, blah, blah. At runtime, it will first locate its configuration, then will do class path scanning to find the annotated class, then for each framework build a model, and once each framework has everything it needs to stop managing, then it will start threads, pools, HTTP server, and so on. The main idea behind Quarkus is to do all this at build time. So at build time, we are going to pass the configuration, do class path scanning, build all the things that the framework needs, again, at build time. And because we know everything, we know how your applications is going to work, what it needs, we can actually augment or decorate the package, so the jars, with exactly the right set of bytecode instructions required to start all the frameworks that your applications depends on. Which means that at runtime, we are really ready to keep in. We don't need to do any other things than just reading this bytecode, well, executing this bytecode, and starting the servers, and so on. Thanks to this, we have obviously a faster boot time because all these tasks are taking a lot of time and we don't have to do them anymore. And the second thing is that it reduces memory consumption because, well, we don't have to do class loading to find class paths. We don't have to bring an XML parser at runtime and so on. So by reducing the number of classes, we get way better memory usage. Quarkus is not only this. It's also an amazing developer experience and you will see already an application running. I'm going to develop it and I don't have to restart anything. SuperSonic subatomic Java. We've already seen that with the build pipeline. You may have heard about the Quarkus capability to build native executable. This is actually the side effect of this build pipeline because during this build time, we can collect enough metadata on your applications to configure exactly how it needs to be built this native executable. A lot of people believe, oh yeah, the only thing you need is declaring reflection and resources. Oh no, you got it wrong. It's much, much fine-grained than this and you need to tweak and enable a lot of flag to get the right native executable. Best bread of libraries and standard Quarkus rely on many of already known standards and library but we're also innovating and we're going to see how we innovate in the righty space because that is going to be the topic of today how did we make Quarkus reactive? But first, why reactive? A lot of people say it's because I'm drinking too much. It's not only this actually, even if it's also true. Most of the applications we're building on the cloud on Kubernetes or whatever are distributed systems. There is one thing we know about distributing systems that they are going to fail. They are going to collapse. Something is going to break. You can use whatever framework, whatever technology is going to break. You may think that Kubernetes or the cloud make building distributed systems simpler or easier. Well, it makes them more affordable but it's only half of the story. Your application on top of that still needs to understand the distributed nature and all the challenges of distributed systems and actually being able to create different resources is adding another requirement to your applications the dynamic availability of these resources. So your application needs to track them, needs to be prepared that they may not be reachable or may not be there and so on. Reactives, thanks to reactive systems can be summarized as distributed systems done right. By using asynchronous message spacing as a main way to interact between our components to provide elasticity and resilience. Elasticity because we are sending messages to virtual addresses and then we don't know how many consumers we have. Maybe none, maybe 10 and this number can evolve over time. At runtime, without needing to do anything. Resilience comes from the ability of MessageMiddleware to do an acknowledgement but also if one subscriber or one consumer crashes to be able to dispatch these messages to another one. If you are able to handle the messages, handle requests, under load and when facing failure, you become responsive. You build a better distributed system. A system that has a better user experience and that's a key element, an essential aspect characteristic of your system. Reactive is not limited to that and one of the reasons we make Quarkus reactive is that there is new class of applications out there that only crowd and things like that. We are seeing over the past 5 to 10 years a lot more event-driven applications. Why? Well, the first thing is Kafka. Kafka has great popularized event-driven processing. Also things like IoT or mobiles are domains where messages are very common. IoT is emitting a lot of messages and you are seeing a lot of notifications on your phone. Machine learning, business intelligence, data analytics are also domains where we exchange a lot of messages. So reactive is going to help us shape and develop such kind of system because we are going to react to messages and send other messages, other reactions to that. So it's reactive. The last point is about the deployment density. As I said, Quarkus already helped in terms of deployment density by reducing the memory usage. But we can go a lot further thanks to reactive. Reactive is going to reduce the number of threads used by the applications. And with this, we are going to save a lot of memory and a lot of CPU, which means that on a set of resources you can deploy more applications that will handle more requests, more messages. That's absolutely amazing because you are going to save money thanks to this. The fact that reactive is able to use the resources efficiently is a key, well, it's essential today because, yeah, well, the cloud is expensive. So how does that work? Let's see this. So our reactive frameworks are built on top of these three layers. We first have non-blocking IOs, which leverage operating system facilities to have a single thread to handle multiple concurrent IOs. So if we take EPOL, but there are other things like KQ, IOU ring, or SELECT, basically we have a set of file descriptors that represent our interactions and one thread that would traverse this set of file descriptors to know when things are done, when we have the response or something like that. On top of that, we have a reactive framework that will make all these low-level aspects generally implemented with NetE in the Java world. So the reactive framework is going to make all those low-level aspects a little bit more consumable by the application code. But there is one thing, and that's why there is a bottle of rum here because we generally need that for this small, small issue. The non-blocking IO is calling the reactive framework using the IO thread, the EPOL thread. So that means that the application code is also going to be called with that thread, which means that you cannot block anymore because if you block, then the full model collapses. You cannot handle any more requests. Reactive is a different concurrency model that comes from the fact that we are going to leverage non-blocking IO, but you need to write non-blocking code. So how does that work? Because when you realize that, you say, oh, son of a biscuit-hitter, which you can check the private dictionary to know what it means, but you realize that something is going to be quite difficult. But how do we make it in Quarkus is to really simplify this. We still have our non-blocking IO based on vertex and neti, our Quarkus extensions, and then we have a routing layer. And the routing layer is going to decide whether it can stay on the IO thread or if it needs to switch on a worker thread. If it realizes that it's a reactive endpoint, no problem, we can stay on the IO thread and we stay on the thread so we don't do the switch. If we are calling something that can block or may block, then we switch to a worker thread. We lose a little bit some of the ability of reactive, but while we can write simpler code. What's your advantage to stay on the IO thread? Well, let me show you the last result of the Tech Empower benchmark. Go to TechEmpower.com and you can check that. This is round 19 that was run in May or something like that, earlier this year. This approach that I just explained is the approach used by Vertex. And that's what makes Vertex one of the prominent competitor on this benchmark. Whatever the category you check, you will see Vertex and a few variants of Vertex because we have Vertex Web and pure Vertex Core really, really fast, be able to under a lot of concurrency. Again, having a lot of concurrency means having an application that can under a lot of loads which save resources for the other applications. Let's go back to the slide and see how we did that. Let's have a look at what, how well, let's have a look at the Quarkus story. The Quarkus project started a long time ago but I'm going to have a look to the last two years or maybe three years. So the journey to become a prominent interactive actors has not been that simple because initially in the first proof of context, proof of concepts around Quarkus that was named Protean at that time it was absolutely not reactive, it was focusing on crud. So what we were able to do there was, well, what we can still do today is to have Jack Saracen point like this Hi Ho and I can call them, let me see I should be able to call it, yes here we are we have a Ho and what's important here is that we are called on a worker thread because yeah, Jack Saracen it's imperative. Quarkus supports a Spring compatibility layer so you can also write Spring code like this so if you are using Spring that should not surprise you and if I call this well, we still get called on the worker thread so that's great, that's not reactive but at least it was a start so how did things evolve after that? Well, after that I start getting involved in the project and because of my vertex background I say well, it would be great if we can run vertex on top of this new framework so we reach the vertex cape and be aware there are various tracks around the vertex cape so it can be a dangerous area so what happened here? Well the first thing we were able to do is to have an extension a vertex extension that was running and it's still the case so there is a managed vertex instance in Quarkus that you can inject that way then you can write well, vertex code like for example, I will create an HTTP server and it will get some request and when I get some request I will write a response like a hoi vertex and I'm going to write the name of the thread to know on which thread it's called where I am here and obviously I need to listen I'm going to listen on the port 8082 80 port so if I have this and I go back here oh wrong one sorry come on and I go to 8082 boom! I got a old vertex and here I'm called on one of the event loop so see here we were called on a worker thread here we are called on an event loop which is one of these IO threads so you may ask why I got 13 of them I got even more than this because the number of event loops is two times the number of CPU cores of your machine so that's explain it so that's great but well that's a second server that is not really what we want here we don't want to have a quarkus application with two HTTP server so that's what we did after this we went to the HTTP island where we have rebased everything on top of our vertex layer on top of our vertex extensions which means that we have now vertex and then our extensions and the routing layer so let me demonstrate that so it's not only vertex it's actually vertex and vertex web and one of the main component of vertex web is a router on which you can register roots and because it's running underneath you can well you can add roots but you can also use it programmatically so I got my router and I will do get on so I get request that on I I will I will response with response and say plus again get on thread get me so if I do this I go back here and I call it yes I should get this so now on the same server the same server that was serving the spring endpoint and the track service endpoint we got something called on the audio thread has it start to be reactive and we start to have a little bit more interesting here but I need to prove you that this code is actually executed even when we have Jax RS and spring so let me do something little bit different here I'm going to register a filter a filter when you use a router it just a handler that will get the request and let's say that here I want to put some header and I will call this chips and we will get one of the most known chips that we can use and then because it's a filter I need to call next or nothing else is going to be called so if I go there and I call my spring endpoint for example we see that we now have our new headers here and that's also the case for a Jax RS endpoint so what's important here is that you can thanks to this add reactive filters to your Jax RS spring or reactive routes that we are going to see very very easily speaking about reactive routes yes something that we may not really like about that is that well we want something a little bit more declarative than this even if router models are getting a lot these days we need to have some annotations some declarative things so that's what we are going here and we are going to do there I have another annotation which is a reactive route where I say ok I want to under get request on pass slash can router and when I got this I will say under I get a putting context as parameter and here that's going to be the same code I will do an and say where the booty same thing I am going to display the spring name alright so if I know I am going here and I am doing yes this one I should get our was the booty response called on one of the IOS thread so that's great it's already one thing but let's go back to the side and see where we are so we did we cross the STP island we have seen this we had a long adventure around the Kafka monsters that I am not going to cover today because well this is a big topic and well Hudson can re-invite me later this year or next year where I can go in depth around our fight against the Kafka monster but it's the same idea in the sense that you can consume or write to Kafka in an imperative or reactive way reactive on the bottom and then we have a routing layer in between but what I want to talk today is what happens on any pirate ships we got some kind of mutiny because well it's nice to be able to write reactive code and asynchronous code but it's hard to write and there is plenty of reactive libraries out there except if you want to be lost in a nomad hell it's not something that you want to read in six months or six months after you've write it and most of the time you don't maintain your own code you delegate that to someone else or yourself in six months and when you read all those chain calls you say what was that so we decided that we needed a better reactive experience here a better reactive programming library and we built a mutiny and how mutiny has been integrated is absolutely awesome in the sense that everything in Quarkus is actually or has a mutiny API and obviously one of the things that has mutiny API is our reactive routes so if let me copy this if I get something like this shantay which is a song sung by pirates I can return a uni which is one of the type provided by mutiny uni of string for example ok and then I need to return a uni a uni is like a kind of a futures it's have some differences but basically it's a reactive type that get a value an item in the mutiny lingo asynchronously probably later and here what I'm going to do is that I'm going to call this Quartz gRPC services that we are going to see in a few minutes so I'm calling this Quartz request newbuilder.build when the gRPC services sent me the response then I got an item that's my response and I'm going to extract from it to transform this response which is a Quartz reply I'm going to just extract the Quartz and just return this and now if I do this I should get one of the famous Quartz from pirates the Quartz is more like guidelines really if you know Jack Sparrow you can recognize this Quartz even if it's not Jack Sparrow that said it I guess so one thing we can do here too is to do the same thing but with stream I want this time to return a set of Quartz and let's say 3 Quartz so I will do multi, there are several ways of doing this but I don't know these days so I create a range from 0 to 3 and on item I will ignore this and I would just call getQuartz and I need to decide if I want to merge or concatenate I don't care in that case I would just do this and here if I do this I should get my 3 Quartz you can recognize the first one you can always trust the because you can always do it ok that's a long one and so on and so on but you see there are little bit mixed up because we just say ok that's my 3 Quartz send them there is no separator and nothing so of course that's useful when you have a byte array and you want to send chunk of bytes but here we want to have something a little bit better so for example I can say reactiveWoods. as JSON array and here I will get them but using a JSON array syntax which will be first item second item stop blowing holes in my ships which is a good idea and so on we can also say I want this on an event stream which in that case will create a SSC using the same thing so data this is the first Quartz ID0, IDR, 1, 2 and so on so it's very nice to have this integrated or to have mutiny integrated with reactiveWoods because that makes model a lot more a lot closer to JaxRS but yeah it's a different model and we will come back to that later one thing that is great with mutiny is that mutiny really is really infused everywhere in Quarkus which means that if I go back to my JaxRS endpoint here I can actually I can actually return a unit from a JaxRS endpoint so if here I want to get a pirate and I will get a pirate from my database we will see how it's done in a few minutes pirate.getFromThePirate yeah that's a pirate and here I should say pirate here so now we got pirate, sorry we got a way to return a synchronous result from a JaxRS endpoint using this homogenous API so the mutiny API and if I go back here and I call HTTP80 slash pirate I should get a famous pirate which is Alexander Dalzil not so famous at least I don't know him but he's one I found it on Wikipedia and I trust everything from Wikipedia so definitely a pirate we can do the same thing with SSC where I'm going to return a stream of pirates something like this so when you do SSC with JaxRS it's a little bit different than with interactive routes in the sense that you need to say that you produce an SSC and how it's going to be serialized every item of your streams so if you do this and now I do stream there we go we got every second one famous or not that famous oh William Burke I know this one pirates so okay so we've seen this but one thing that we have made in Quarkus recently is what I call the reactive bay that we already seen that Mutiny has been the homogenous layer everywhere in Quarkus you can use it in interactive routes you can use it in JaxRS but to be useful we need to have Mutiny APIs and what we did here is to have Mutiny APIs everywhere so we already seen in this this one that you can consume GRPC services using Mutiny which is great because GRPC is asynchronous by default so you can use a uni and multi for a uni for give a response and multi for streams that works very well implementing the service can also be done using the Mutiny implementation base so you just return uni, multi or whatever is required but it's not only this we also got recently Hibernate Reactive which is an implementation of Hibernate so the RRM you know that you use but on top of non-blocking reactive driver coming from the vertex ecosystem so it's blasting fast because of this driver which are used in the tech and power benchmarks that I've shown you and it's already provided Mutiny API and here because I'm not too familiar with Hibernate myself while I could use a name query and so on I could also use Hibernate Reactive with Spanish because we have it already Hibernate Reactive with Spanish is the Spanish we were using before but on top of Hibernate Reactive which means that all my methods are synchronous running on the event loop totally non-blocking and boom don't need to switch thread anymore so that's really great and the last thing I want to show you and that is going to conclude my presentation is something we have been cooking for a few months it's something that is not yet in Quarkus and that's what I wanted to show you today because that is amazing so let me switch to another oops no to another intelligent this one recently we got we had the chance to integrate something called RSTD Reactive and RSTD Reactive is an implementation of JacksRS but really, really reactive because right now when we use JacksRS well JacksRS is a little bit outdated in when it was created Reactive was not existing so here we can actually run JacksRS on top of the event loop so what we have here with JacksRS Reactive is that you can, RSTD Reactive is that you can decide if you want to be called on a worker thread by using the add blocking annotations or if you want to be called on the IOS thread with the non-blocking annotations and then our routing layer is going to detect that and decide if you need to switch or not let me demonstrate this very quickly so first I need to start the annotations here so to get that working it's a little bit more tricky because you need to build a specific branch a specific pull request but that is going to be mailed soon so now if I'm here I can say Matej which is my blocking one and I'm called on a worker thread and inside the same resources I can have a non-blocking one which is called on the IOS thread that change everything because that now you don't need to know two different models you have mutiny of the glue and you have the same set of annotations and look at this we have in dev mode some diagnostics that would tell you the efficiency of your endpoint like the first one, Matej so the blocking one it tries to say ok so you have a score of 66 over 100 so it's good but not that great and then you look my API is 83 over 100 so it's not too bad it's efficient enough but with this you can decide if you want to continue with imperative switch to reactive and decide and you will have details about all these steps when it will be mailed in Quarkus so that concludes my presentation that's what I call the reactive place where we are right now Quarkus is now a prominent player in the reactive landscape we have a hand to hand reactive story going from the higher level to the development model we have plenty of things like hibernate reactive but we also have access to Cassandra, Mongo, Redis and so on we have the complete vertex ecosystem that is available and we have the mutiny API for all of that we also have cameloractive which is great if you need to integrate with anything I would say legacy and this is because of the architecture and the ability we have in Quarkus to do all this reactive stuff how does that work? Well as I said we have a reactive core and on top of that you can decide if you want to go reactive or imperative and you can switch, you can mix, you can decide and thanks to the new diagnostics we have seen in the last demo I don't know if you want to stay on the imperative side or if you want to go on the reactive side that's all I have and if you want to see these demos except the last one because we need to build a branch it will be contributed as soon as it's made go to this GitHub repository and you will have all the rest of the code I've shown today if you want to know more go to the Quarkus.io website or code.quarkus.io and start coding immediately you can interact with the team you can follow us on Twitter and if you want to contribute or just like what I just said today go to our repository and give us a small star that is totally useless but that make us the Quarkus team quite happy thank you very much and yeah, do we have time for questions? Oh we are already a bit over time but we have a lot of questions see if we can cover them so first Andy is asking what is the performance of Quarkus running vertex compared to pure vertex regarding performance and memory footprint? That's an interesting question so of course Quarkus is adding some hover red but this hover red is actually quite small if I not mistaken the last measure we have done is less than 5% so except if you really hardcore you won't see the big difference is it's because we optimize a lot of things to really actually write the vertex code you will have written yourself even if it's a managed vertex instance the vertex instance we have tuned, we have configured correctly and well before in the vertex team we have the vertex team involved in Quarkus so we work with them to get everything blasting fast awesome and Steven is asking can I use Reactor with Quarkus? You can use Reactor with Quarkus our APIs are not exposed using Reactor there is a few issues so first you may have issues in native because Reactor is using some constructs that behave a little bit differently in native so before going to productions really double check that it's behave as you want it to behave but except that yes you can use Reactor awesome and can thus Quarkus support Reb to MQ do we have an abstraction for that? So that's part of the Kafka monster so we have a reactive messaging abstraction which support Kafka MQP and Rebit MQ by using the MQP plugin we also have support for MQTT and so on so we have one abstraction for that and as I explained it's all based on our reactive core and then you decide if you want to consume and send messages in an imperative manner or in a reactive manner you can also do GMS but these days that's not really a popular option so we have better in Quarkus everything I say works native by the way even Rebit MQ communicating with Rebit MQ works in native if you want to try awesome and Bruno our friend from Portugal is asking about the reactive route that you showed is that compatible with MicroProfile JWT or any MicroProfile APIs so yes OpenAPI supported JWT is supported too so we got all everything is it's just a beam so everything from MicroProfile is going to be supported except GraphQL we still do some work around that and I've seen some example combining that with Fortory runs so I know it's working even if when you are reactive the Fortory runs you do it a little bit differently but that works so yes normally it should work out of the box we have some tests we don't cover all the cases all the combinations because obviously that would be quite large so if you have any issues just come to us and we will fix it but also with rest easy reactive that is coming that is going to be merged in Quarkus well actually you won't change your model it's everything is you will decide what need to be reactive and so on and everything else everything in Quarkus is going to be supported out of the box awesome and Steven is asking again can I create an event bus in Quarkus we have the vertex event bus built in so just use it it's there yes so and Bruno is asking too you've shown the Quarkus the vertex rest part the last thing that you showed and you showed the efficiency number how is this efficient calculated oh that's a good question so actually if I go back to this here it's actually going to look at all the interceptors that are required to handle your your request and remember this is computed at build time here I'm in dev mode so there is no big difference between build time and run time but this will be computed at build time and everything is going to be in line at build time so that means that it's then just calling the function in the right order so it's all it's all generated but for each of them we know their efficiency cost either need to switch red if they need to do synchronization if they need to do all this and that what help us giving a score to every to all of them and compute this final score so typically need a worker spread dispatch boom that is quite bad a single resource instance for all request booms that is quite good so that's how it's computed we're still tuning a little bit all these computations it's pretty new but yeah I'm very happy to see that I found this diagnostics very very cool and and something I didn't mention we will soon have a better developer experience already better than what we have right now with a UI where you will find such kind of diagnostics not in your console but using some well HTML wondering that people can read without becoming blinds awesome well Clemence thank you very much for presenting this amazing content and answering the questions I'm pretty sure everybody is excited about this reactive stuff and well we'll certainly invite you to talk more about the other reactive stuff in other opportunities maybe next year and if you're watching this I'd just like to point out that next week we have Thanksgiving here in the US so we won't have a tech talk but we'll be back the the other week after Thanksgiving thank you very much for watching and stay safe see you soon thank you for having me bye


Going on everyone Sam here with late sports car. It's been one box of 23 tops chrome at Major League soccer hobby for Amane S Good luck here Amane. Let's do it for you, buddy See what we got dolphin chain going back on Derek etn jr. Come on Miller to 99 one ninety on blue many not this kid and Glover I love any made tile wear it all the time when they were winning and every other like whenever you'd you get the Chicharita nice one there flashbacks to Nino every time you'd like you we get the notification that he was in the There you have the dolphin chain on That is a black to ten Sebastian for area nice one there Houston Dynamo six of ten on the rookie that work Congrats. I'm on it. Very cool. That is a Leo shoe Wayne Rooney flashbacks 225 will you gotta or sporting Kansas City? Lime green auto Deandre Yedlin nice one there for Inter Miami To 99 congrats on that Amane take some Inter Miami, of course Carl's or Carl's gill. Oh, yeah true true Ricky Pueg Derby diamonds Deandre Yedlin Fracture Johnny Russell honey Muhtar Channel to is Lobby Bender to 99 Paula Rolla 199 Joseph Martinez to be the product compared to 22 Maybe bum and chrome they did Drafts about the same they did add another skew for draft this year Lucho Acosta So there's more base autos and in draft they added the choice exclusive parallels For autos flashbacks Frank Lampard in the mini diamonds to 75 Victor one Yama Derby diamonds and base But drafts about the same Hector Herrera. I wouldn't say it's Something I easier to hit the big names than it was last year 299 Richie Ledezma for New York City FC Jalen Lindsay and Diego Loondes new wave Jonathan Lewis for Colorado Rapids to 199 on Velasco refractor to 199 for the Columbus crew Aden Morris, maybe one the championship, I believe and That's Steven Sirwater. I'm doing for your break there Amane. Thanks for the support as always buddy. Do appreciate it Get him right out to you my man


Hello and welcome to this presentation of the STM32 Flexibles Memory Controller. It covers all the features of this interface which is used to connect external memories such as NOR Flash, SRAM, PSRAM and NAND Flash memories. The FMC controller integrated in STM32 MP1 microprocessors provides the external memory support through two memory controllers. The NOR Flash PSRAM memory controller and the NAND Flash memory controller. This enables the CPU to communicate with the external memories including NOR and NAND Flash memories, PSRAM and SRAM. This interface is fully configurable, allowing easy connection with external memories or other parallel interfaces. The benefits of the FMC controller include not only RAM and flash memory space extension, but also the ability to interface seamlessly with most LCD controllers which support Intel 8080 and Motorola 6800 modes. This LCD parallel interface capability makes it easy to build cost-effective graphic applications using LCD modules containing embedded controllers or high performance solutions using external controllers with dedicated acceleration. The mapping of the FMC bank addresses is fixed. Bank 1 is used by the NOR PSRAM memory controller. Bank 3 is used by the NAND memory controller. All other banks are not used by the flexible memory controller and are available to the SOC memory map. The FMC controller offers four independent banks to support separate external memories. Each bank has an independent chip select and an independent configuration. Each bank features programmable timings, a configurable 8, 16 or 32-bit data bus, and can access memory in asynchronous or burst mode for synchronous memory such as NOR Flash and PSRAM. Synchronous memory can be accessed at a maximum frequency of HCLK divided by 2. The FMC controller supports a wide variety of devices and memories. It interfaces with static memory mapped including static random access memory or SRAM, read-only memory or ROM, NOR or one NAND flash memory and PSRAM. Furthermore, the FMC interfaces with parallel LCD modules supporting the Intel 8080 and Motorola 6800 modes and is flexible enough to adapt to various LCD interfaces. The FMC outputs a unique chip select signal to each bank and performs only one access at a time to an external device. The external memories are connected either to the NOR PSRAM controller or the NAND controller and share address, data and control signals. The NOR PSRAM controller allows the configuration of various timing parameters for the supported memories. Address setup phase, duration of the first access phase. Address hold phase, duration of the middle phase of the access cycle. Data setup phase, duration of the second access phase. Bus turnaround phase, duration of the bus turnaround phase. Clock divide ratio, number of AHB clock cycles or HCLK within one memory clock cycle or CLK. And data latency, number of clock cycles to be issued to the memory before the first data transfer access mode. The FMC controller features a NAND memory controller supporting up to two NAND devices of the same type and a common ready busy signal, programmable page size up to 8 kilobytes, programmable timing parameters and 8-bit or 16-bit interface. The NAND memory controller has a hardware error detection and corrections supporting hamming code, one-bit correction per page and BCH code with either 4-bit correction or 8-bit correction per 512 bytes sector. The FMC also interfaces with NAND flash memories and supports error code correction or ECC for up to 8 bytes of data read or written. Three interrupt sources can be configured to generate an interrupt when a rising edge, falling edge or high level is detected on the NAND flash ready busy signal. Bank 3 is used to interface with the NAND flash memory. It is divided into two memory spaces, common memory space and attribute memory space. Both spaces are similar. The common memory space is for all NAND flash read and write accesses, except when writing the last address byte to the NAND flash device where the CPU must write to the attribute memory space. This allows you to implement the pre-weight functionality needed by certain NAND flash memories by writing the last address byte with different timings. Each memory space is subdivided into three sections. Data section, 64 kilobytes, used to read or write data from NAND flash memory. Command section, 64 kilobytes, used to send a command to NAND flash memory. And address section, 128 kilobytes, used to specify the NAND flash memory address. The NAND device, NCE1 and NCE2 is decoded according to the address bit 24, 16 megabyte range. Each common and attribute memory space can be configured with different timings for the NAND flashes command, address write and data read write accesses. The attribute memory space is used for the last address write access if the timing must differ from that of previous accesses in case of ready busy management. Otherwise, only common space is needed. Four parameters are used to define the number of HCLK cycles for the different phases of any NAND flash access. Setup time, hold time, wait time and data bus high Z time. Three additional parameters are used to control the timings for the address to read delay, the command to read delay and the minimum chip select high duration. The FMC generates the appropriate signals to drive NAND flash memory. The address, data and control signals are shared with the NOR-PSRAM controller. The command latch enable or CLE and address latch enable or ALE signals of the NAND flash memory device are driven by address signals from the FNC controller connected to address line 16 and address line 17 respectively. The ALE is active when writing to the address section and the CLE is active when writing to the command section. The FMC NAND memory controller includes support for the following features. Error correction code. The ECC algorithm can perform one-bit error correction and two-bit error detection per 256 to 8192 bytes read or written from or to the NAND flash memory. It is based on the Hamming coding algorithm. Three interrupt sources can be enabled to detect a rising edge, falling edge or level on ready or busy signal output from NAND flash memory. Weight feature management. The controller waits for the NAND flash memory to be ready before starting a new access. The MPU memory attribute of the FMC NAND bank must be configured as a device. The NAND controller offers three interrupt sources. Rising edge, falling edge and high level detection on the FSMC INT pin when it is connected to the ready busy signal from the NAND flash memory. The available Hamming code can perform one-bit error correction and two-bit error detection per 256, 512, 1024, 2048, 4096 or 8192 byte access from or to the NAND flash memory. It consists in calculating the row and column parity. This algorithm is supported by 8-bit and 16-bit NAND flash memories. To increase the error correction capacity, the FMC embeds a BCH or Bose Chowdery and Hock-Quingaman coder and decoder. It supports either 4-bit error correction with 8-bit error detection per sector or 8-bit error correction with 16-bit error detection per sector. The BCH encoder decoder module handles sectors of fixed size equal to 512 bytes. The error correction code or ECC controller can use one of two algorithms, Hamming or BCH, depending on the ECC requirements of the NAND flash device. The controller works at page level for reading and or programming the NAND flash memory data located in the main array and parity bits in the spare array, also known as OOB. The controller can use one of two modes, Direct Mode with CPU polling, applicable with any ECC or Automatic Mode with a sequencer and DMA transfers, applicable only with the BCH algorithm. To program a page in Direct Mode, enable the write access and the ECC computation. Write the 512 byte sector to the NAND flash page. While the sector is written, the BCH encoder computes the ECC value. Wait until the BCH code is ready. Copy the ECC value to the NAND flash out of band or OOB area. Repeat the previous steps for all sectors of the page and launch the page programming. To read a page in Direct Mode, enable the read access and the ECC control. Read the 512 byte sector to the NAND flash page. Read the ECC parity bits, 7 or 13 bytes from the NAND flash out of band or OOB area. During the reading phase, the BCH syndrome is calculated. Then the error location information is processed to detect potential errors. Wait until the error detection is completed. From the error decoding results, the software can correct the sector when it is possible. Repeat the previous steps for all sectors of the page. Data and ECC byte accesses can be managed automatically by the FMC command sequencer using DMA channels for the data transfer. One DMA channel is required for write operations and two DMA channels for read operations. The sequence is performed at page level, each page being one or several 512 byte sectors. The error correction is applied to each sector with the redundant bits located in the spare array. The NAND flash controller sequencer can perform one operation after another to program a complete page without any software intervention. For each 512 byte sector in the page, the sequencer sends the command and the address to the NAND flash main array. This requires only one DMA channel. Triggers a DMA request to write data to the NAND flash main array. While data are written to the main array, the parity bits are computed by the BCH engine. Sends the command and the address to the NAND flash spare array. And writes the parity bits to the NAND flash spare array. Once all sectors are written to the main and spare arrays, the sequencer generates the completion interrupt to the host CPU to issue a page program command to the NAND flash memory device. The software overhead is only one interrupt per page. During the interrupt, the next page can be programmed in the sequencer. The NAND flash controller sequencer can be pre-programmed to perform all operations to read a complete page without any software intervention. For each 512 byte sector in the page, the sequencer sends commands and addresses to read the NAND flash main array and the associated parity bits located in the spare array. This requires two DMA channels. Triggers a DMA request to copy data from the main array to a memory buffer. The sequencer keeps the data read access and the DMA transfer in sync. While data and parity bits are read, the BCH engine computes the error location polynomial to determine the potential presence and position of bit errors. This information is then recorded in an error log. When the error log is ready, the sequencer generates a DMA request to save the error log for this sector. Once all sectors are read, the sequencer generates a completion interrupt to the host CPU to process the error log and correct the erroneous bits in the memory buffer. The software overhead is only one interrupt per page. During the interrupt, the next page can be programmed in the sequencer. The FMC is active in run and sleep modes. An FMC interrupt can cause the device to exit sleep mode. The device is not able to perform any communication in stop and standby modes. It is important to ensure that all transmissions are completed before the FMC controller is disabled or the domain or system is switched down to stop or standby modes. To retain external SD RAM memory data while in stop or standby modes, it can be put in the self-refresh mode prior to entering stop or standby modes. Here is a list of peripherals related to the FMC interface. Users should be familiar with all the relationships between these peripherals to correctly configure and use the FMC controller.


As we learn more about receivables, we need to consider the underlying events that create receivables. So to start with, let's revisit revenue recognition. Hopefully you recall that revenue is recognized, meaning journalized, when service is performed or goods are delivered. The FASB has since revised this definition to say that revenue is recognized when a specific critical event has occurred and the amount of revenue is measurable. For an accounting principles class, the specific critical event that occurs are either, again, services are performed or goods are delivered. The amount of the journal entry is the fair value of the asset received. Usually that will be cash, but not always. The FASB has created a five-step process to determine whether or not revenue should be recognized. The basis of the five-step process is whether or not a contract exists. So here I've listed the five-step process. Let's look at each one of these in more detail. Step one is identify the contract, meaning does a contract exist? Are the parties of the contract in agreement are the terms clear? Things like that. Step two is identify the performance obligation, meaning who does what? Does the contract specify what is expected of each party? Step three is determine the transaction price, meaning what is owed to us? We need to consider both cash and non-cash receipts. Step four is allocate the transaction price to the performance obligation, meaning do we need to split up the revenue? If the revenue is earned over a period of time, we need to recognize it over that time. Step five is the final step. If the first four steps are met, then we can recognize revenue when we satisfy the obligations, meaning revenue has been earned as we perform our obligations, we can record the revenue.


Welcome to cyber security for a new America. I come out of foreign policy originally. So for me, particularly foreign policy and national security, when I hear cyber security, I think national security. I think defense. I think countries. I think the future of war in many ways. And that is what a large number of people in this town think of when they think of cyber security. But of course, recently, when we think of cyber security, we don't just think of countries, but we think of companies. And we think about how those two things are intertwined. Because if we're talking about Sony and cyber security, we're also talking about the United States and North Korea. So now we think of cyber security as military, but also commercial, and how those things are intertwined. But of course, independently of national security, companies are worried about cyber security simply from a straightforward commercial point of view. So those two areas I think most people think are, yes, right down the fairway when you talk about cyber security. But that's only a part of the picture. And the large part of what we're going to do today is to flesh out that picture. So obviously, the other, the next place we think about cyber security, which is rarely married, is consumers. So think about Target, think about all the places in which consumers, all of us, like me, go online and do most of our shopping online, hand out our information. Consumer security is cyber security, every bit as much. But then think also about students and job seekers and readers. Some of New America's cyber security work has been done in libraries. The place where many low-income people first encounter computers and have very little idea about what security means. Often they are either completely worried and afraid to do anything, which of course harms them in this world.  So educating lower-income people or middle-income people, but people who, and frankly, a lot of older people who are encountering the cyber world for the first time, that is every bit as much cyber security. Activists, activists in this country, activists around the world, people who are doing things that governments may not love. Our government, other governments, even people who are doing things that corporations may not love. Citizens, citizens' cyber security is every bit as important as national, high-level cyber security. So thinking about cyber security in the context of all the different sectors of the United States and thinking about how as we go forward to different kinds of conflict, a new economy, a new and much more active citizenry in a politics that has to be renewed, that's what we're thinking about when we talk about cyber security. There are lots of opportunities here, as I just laid out. We've got lots of little silos. One of the first things New America wants to do is break down those silos and bring together people who are thinking about cyber security, whether they use that term or not, from multiple vantage points. We want to learn from all those sectors. We want to collect ideas from those sectors and think about the newer ideas in terms of how we both conceptualize but also actually implement cyber security. We also want new voices and as I've described, there are many people who are working on cyber security from a citizen point of view, from an activist point of view who very rarely actually talk to folks who are thinking about it from a national security point of view and yet we absolutely have to bring those new voices into the debate. So New America combines all those things. I am the president and CEO. You have to have a little ad for New America here. We bring together a tremendous international security team but we also bring together the Open Technology Institute with people who are working on consumer and citizen security and more importantly, simply keeping the internet as open as we possibly can consistent with the demands of security for everyone. We're also trying to do this in a from a multiply geographic perspective. A couple of people here from California were saying that they should have little circles on their badges to indicate that they are both tired and cold and certainly on the cold front. So we want to be doing this here in DC, in New York, in California and we hope in other nodes around the country bringing together new voices, big ideas, technologists and policy experts from multiple places in the country. We also want younger voices. It is in the State Department, Alec Ross would always talk about digital natives and digital immigrants. I'm a digital immigrant. Most of the people who are making decisions on cybersecurity are digital immigrants. We need the digital natives. We need many, many younger voices in this conversation. And we need media relationships that expand beyond the more specialized columns and policy outlets and journals that speak to a very specific group of people. Cyber security has to be demystified and talked about in the same way we would talk about any other major public issue whether that's education or conflict or health. New America thinks about itself in terms of big ideas, in terms of being at the intersection of policy and technology and in terms of being connected to communities. What we hope to do with our cybersecurity initiative is to create networks, national networks with lots of new voices in ways people who are not here but who can be an equal part of this debate. We want to do this nationally and we want to do this internationally. If we're standing in Germany at the moment, this debate would look very different and the United States would not look wonderful either from a national point of view or a commercial point of view or a consumer point of view. So we want to do this internationally as well. We want to focus on big ideas, that is our trademark and solutions. Also events that we can hold both physically as here and virtually. And finally, we want to think about how you implement actual solutions. So what are people doing on the ground in individual libraries or NGOs or companies or cities? How are these different groups thinking about cybersecurity but not just thinking about it, actually doing it? And how can we plug into those networks and learn from them? Finally, I want to end with what we don't know and what we, a little note of humility. We obviously don't have all the answers, that's why we're starting what we hope will be a multi-year initiative. We are anxious to build networks and create a very inclusive project. We are well aware that there are other groups in universities and policy institutes and we think in cities and in NGOs working on these issues and this should be what I think of as a collaborative coalition, right? Lots of people thinking about different dimensions of this problem. We also want to include the folks in the government who are thinking about these issues, not only national government, but again, city government, even local in some places. And finally, in terms of really learning things and advancing ideas that are not part of the current debate, it is essential to be convening unlikely bedfellows. It is essential to bring together the civil libertarians with the national security establishment, not just in terms of yes, we want everything to be consistent with everything else. It's easy to say that. The problem of course is there are really tough trade-offs to be made and we want people who are advocating for lower income groups of various kinds and how they engage with the cyber world, talking to large corporations, just as examples, bringing a very diverse group of people together and we will be starting today and I for one am very excited because I actually get to sit and listen and take notes and think all day. So with that, I'm going to turn it over to our first panel and welcome. We're delighted to have you here. Thank you. Good morning, everyone. It's a little bit cold today, but we have to go through. So what is like to get hacked for your beliefs? I believe to get hacked in the US is really different than to get hacked in Europe or in Middle East, especially nowadays. So I will go through kind of like my personal story and why I'm here in the US today. So back to 2011, I used to live in the beautiful Damascus and at that time the civil movement started at the beginning of 2011 and a lot of people, they joined the civil movement when it was peaceful and most of these people, they were really aware about how our government is really strong regarding the civilians and the technology they had and they still have actually regarding civilians and all of control for the internet and the infrastructure. At that time, the Syrian government used to block the old social network and only the people with a good background with the knowledge about cybersecurity, they had access to the social network because it was blocked. In a very smart movement, at March 2011, the Syrian government removed the old block on the social network and these people who they were like, they needed to see what's going on, they joined the social network and it became a really huge movement. It was good for the government because they were collecting information but it was not only for collecting information, it was not only for social engineering, let's say, prospect but it went more deep into cyber attacks. Back to actually June 2011, in old Damascus, I got the chance to meet one of the British journalists that he came to film or to film a documentary about the civil movements, Sean McAllister, he worked for Channel 4 and he asked me actually if he can join me in the training that I used to do for activists and lawyers back at that time, teach them exactly how to protect themselves online and he found that but there was kind of agreement between us, like, okay, I will allow you to film this but at the same time you have to, I mean, at least encrypt your data and you let me teach you how to encrypt your data because you're here in a tourist visa and they can't just arrest you for any matter and I teach him, actually, I taught him how to encrypt his data and he's a film maker, he knows how to put the blood on our faces. He did his movie, he filmed a lot of people, a lot of very important sources also. October 18th, it was 1 a.m. at night, I received a message from a mutual friend and he was actually assisting Sean that Sean McAllister got arrested in a coffee shop and I have to go hide myself because they arrested a lot of people that they worked with and they got his storages, his backup. In my message, I asked him, is the data was encrypted? Do they got access to the video? He said yes, they got access to everything. Actually, he did not encrypt anything and it was kind of like underestimating for the power of the government back at that time. In a very famous coffee shop in Damascus, he was sitting and having conversation with other guy and both of them, they got arrested. Milan Jamal, he was with him at that time and he's still in jail until today. Manal Janabi, she was arrested for three months, then they released her and actually, they removed her from the country because she is not Syrian. If you're talking about cybersecurity for activists, but actually, it is important to know that technology today is really helping. Technology is playing two roles and they are very two important roles. It's connecting people very good, but the other side, there are a lot of technologies that they're helping governments to get access to information. I believe now in the new modern movements, governments get access more to the information than comparing to before. A lot of companies, Blue Code, which is a US-based company. I mean, it was the main provider for DPI technology for the Syrian government, Deep Packet Inspectioned, which allowed the government to get access to the, even to know the encrypted data that we were transferring between users. Actually, they were transferring in Syria. For example, a very simple face recognition technology that Facebook use, imagine if that technology, or actually it is available, in the hand of Syrian governments or any other repression governments, how powerful that will be. Today, ISIS, and actually, I don't know if you've heard, ISIS started to develop a malware comparing between the Syrian government, which they started developing malware after six months of their social engineering hacking techniques. ISIS started with the malware recently, and here they are, very active. They have access more than the Syrian government, by the way, because they are not under sanctions. As most of them, they have foreign or passports. So here we are, I move today to the US. IC project is a group of engineers we're trying to help people. We're trying to connect people on the ground with technology makers here in the US and different places, explaining for them that this technology is good to use, but this is not good to use. You have to improve this technology to make it better to help people. At the same time, we're trying to protect people on the ground by teaching them. And at the end, I just want to mention that it's not only Syria, it's half of the world that it's being ruled by governments like the Syrian government and many other governments. And today I can see that the threat is not only, it's not, they're not only threatened Syrian people, but they're threatening everybody outside. And we've seen recently how ISIS was active online. At the same time, the Syrian military army was active online. Technology is so fast. I see a lot of growing up in a technology that at the same time, I see there is a misconnection between all of these departments. That's what exactly lead us to the problems that we use to face in Syria. So I hope conferences like this, events like this will bring people from different places so they can talk to each other and understand what is good and what is bad. Thank you so much.