Welcome back to our lecture series Math 4,230, abstract Algebra 2 for students at Southern Thai University. As usual, I'll be your professor today, Dr. Andrew Missildine. In this lecture, number 12 in our series, I want to talk about the idea of a unit for which if you're not sure what that is in ring theory, a unit is going to be an element of a ring which has a multiplicative inverse. It's important to recognize that unlike groups, multiplication and rings, it doesn't necessarily have inverses. I mean, hey, one of our assumptions about a ring is that it may or may not have even a multiplicative identity. We talk about rings versus rings with unity. If there's no unity, there's not going to be any multiplicative inverses, a.k.a. there's no units, right? So even if we have unity, there's no guarantee for a generic ring with unity that we have multiplicative inverses. And as such, the consequences of a version in group theory don't always carry forth into ring theory. And so there's some things I want to mention that are on the screen right now. In particular, in group theory, one of the results we get because of inverses of elements is this idea of cancellation. So cancellation usually looks something like the following. If A, B, C are elements of a set such that if B, A equals C, A, that implies that B equals C. So that's what we typically call right cancellation. And then similarly, if A, B equals A, C, that implies B equals C. OK, so this was a theorem we proved in group theory back in algebra one. But in general groups, excuse me, general rings do not have this property. So in this context, I'm actually referring it to it as a cancellation axiom. And it could be that you have an algebraic structure with binary operations, we'll call it, we'll call that binary operation multiplication for the lack of a better term here. Does your operation satisfy the cancellation axiom or not? Groups always do because of the inverse axiom. It implies cancellation. But in the general algebraic setting, you might not have that. Honestly, semi-groups, which is a generalization of the idea of groups, they don't have cancellation in general. But quasi-groups, a different generalization of groups, this is sort of like their thing.  Then, of course, we're focusing in rings in this conversation. In rings, cancellation is not guaranteed. And so in this lecture, as we talk about the idea of an integral domain, we'll see that integral domains are really those rings with the cancellation axiom as satisfied. And I want to point out one of the main reasons we can't do cancellation in a ring is actually because of this idea of dominance. Sometimes it's called absorption, where if you have an algebra, so that is there's some set with a binary operation attached to it, maybe there's multiple operations, but we'll just consider one binary operation for a moment. We say an element is dominant. If you take that element, excuse me, we'll call the dominant element zero here, thinking of ring theory. So if you take any element of the set, any element of the algebra, zero times that element is always equal to zero. And that element times zero is always equal to zero, because we're not assuming it's commutative necessarily. So this in some respect is like the opposite of the identity. If we're thinking of like multiplication here, what's a multiplicative identity? A multiplicative identity would mean that one R is equal to R1. So it commutes with everything. But then that's equal to the other element. So a dominant element is kind of like Narcissus, you know, he's always thinking about himself. He's always reflecting back to him. Every product was zero, give you back zero. The identity is more like echo. Echo is always thinking about someone else, or in particular, she's always thinking about Narcissus, right? To continue with the Greek myth there. So a dominant element is like the opposite of an identity. In particular, if you have a dominant element, then you cannot have universal cancellation. Because of every element times by zero gives you back zero. If there's two non-zero elements, even if there's one non-zero element, right? If R doesn't equal zero, that means zero R equals zero times zero, which is equal to zero. You can't cancel the zeros and get back R, right? You couldn't tell the difference. So in rings, the zero element, which is why I denoted it like this in this axiom, in a ring, a ring always satisfies the dominance principle. Zero is always an absorbing element, all right? And so this is a theorem we prove for ring theory. I've listed it as an axiom because there do exist algebras, which would assume dominance as one of its fundamental axioms. We're not going to delve into that too much right now, but just like how cancellation is a theorem in group theory, dominance is a theorem of ring theory. And so rings always have a dominant element and it's the additive identity, which we typically could call zero. At that, I should say it's dominant with respect to multiplication because it's the additive identity. It's a consequence of the distributive law. But this idea of cancellation goes beyond just zero, right? I want you to consider the ring, mod 6, of integers, mod 6, Z6 here. Consider the following equation. Three times four, that's equal to 12, which is congruent to zero, mod 6, but also take three times two, that's equal to six, which is also congruent to zero, mod 6. So when you look at that equation right here, three times four and three times two, you can't cancel the threes because four doesn't equal two inside of this ring. So this issue of cancellation is beyond just the dominance of zero. We have things like this going on right here. You can't cancel three in the rings, Z6. But it turns out, and we'll talk about this in just a second, that the reason we can't cancel three is actually because it's related to six. In particular, three times two is equal to six, and six is zero, mod six, of course. We'll delve into that in just a second, right? But let's look at some matrix rings for a second. So imagine that R is just any ring and little R is any non-zero element in the ring. OK, if I take two by two matrices, so let's take an R in the one-one position, zeroes everywhere else, we times that by the matrix, which has an R in the two-two position, zero everywhere else. When you think of the multiplication, you take this row times this column, you're going to get zero plus zero, which is zero. You'll take the first row times the second column, that's still zero plus zero, which is zero. Then you take this row times that, you get zero plus zero, which is zero. And then the second row times the second column, you get zero plus zero, which is zero. So the product of these two rings, excuse me, the product of these two elements is going to give you back zero. But in fact, I could replace this with a whole lot of other things, right? Why doesn't have to be R and R? I could put R and S and we get the exact same thing again, right? In particular, if you set that to be zero, there you go. It's like you can't cancel this matrix because I can't tell what's happening here. You might be able to say something about the matrix, but it's like, whoa, there are lots of different matrices. In fact, I have a whole, I could replace little R with any element of the ring. And so no cancellation can happen. At least I should say that cancellation doesn't happen in general, inside of a ring. Now, there is one important place where cancellation can happen. Say that R inside of a ring is a unit. Remember, unit means it has a multiplicative inverse. That is to say R times R inverse is equal to the identity, multiplicative identity, we'll call it one in this situation. Because if you're in that situation, let's say R X equals R Y. OK, who cares about R, who cares about X and Y here? But just think about R, if I times both sides of the equation by R inverse, R inverse here by associativity, we redo it, R inverse times R times X. And then you're going to get R inverse times R times Y. R inverse is one in both situations. We have one X equals one Y and therefore X equals Y. So if you have a unit, we can cancel units using their multiplicative inverses. This is the exact same proof we used in group theory in abstract algebra one. So units are elements that can be canceled. But a curious thing in rings is that we can have elements which are not units. That is, they don't have multiplicative inverses, but still can be canceled. This cancellation is sort of a weaker condition than having a multiplicative inverse is inverses imply cancellation. But cancellation can happen without being a unit. And that's the topic we want to explore a little bit more right now. So now we approach the main topic for this video.  We say that R and S are proper divisors of zero if, first of all, they are nonzero values, OK, so R and S themselves are not zero, but their product is zero. So R times S is zero, but neither of the elements R and S are themselves proper divisors of zero. Now, why do we say proper divisors of zero? That is the full term proper divisors of zero. Sometimes people call these divisors of zero, you drop the proper. Sometimes we could these are called zero divisors. What do we mean by here in this situation? Well, I should mention before I finish this definition, the adjective proper is used here because, you know, if you did have R equals zero or or if S equals zero, then, of course, R S equals zero. That's always the case, right? If you have zero times S, that's always equal to zero. So in some respect, every number is a divisor of zero in a ring because you can times it by zero to give you back to zero, right? So proper is significant here that, you know, it's not zero is not involved in the product or I should say zero is not the factors involved, but you still get a product that's equal to zero.  Every element of a ring is an improper divisor of zero. That doesn't mean much. It's the proper divisors of zero we care about. But because we only care about the proper divisors of zero, sometimes people just drop the term proper and talk about divisors of zeros or zero divisors, and that's what that's always to be understood as. OK. All right. So zero divisors are elements of a ring, which are nonzero, but whose product is zero. Then we say that a ring with the unity is a domain if it has no proper divisors of zero. So there is no product of elements that give you zero without using zero as an element itself. When it comes to a domain, we always do require it has a unity. And then, of course, it has no zero divisors. A commutative domain is typically called an integral domain. And so one has to be careful in the literature that some people, when they talk about domains, they really mean integral domains because they're so entrenched inside of commutative algebra. That is the study of commutative rings that the thought of having a non commutative domain never comes to their mind.  So they say domain. But for those who study non commutative rings, well, you often are interested in domains that are not commutative. So you talk about domains versus integral domains, that is the that's the dictionary we will use in this lecture series. A domain could be commutative, it might not be commutative, but an integral domain will always be commutative. But if we talk about a domain, we're making no assumptions about whether multiplication is commutative or not. So speaking of axioms that we've introduced into this lecture about dominance, we talk about cancellation, the non existence of proper divisors of zeros can actually be axiomatized. And that's what would be called the zero product axiom. So I'll use language of a ring, because this is where we really care about it, because after all, you need to have a zero element to even talk about zero products. So when we talk about zero product, we're really talking about a dominant element. Our multiplication has some dominant element, which again, as we're studying rings, we'll always call that element zero. And so is it possible to have a product of two elements equal the dominant element without one of the factors already being that dominant element using zero? Specifically, the zero product axiom would be that two elements of the ring, if their product is equal to zero, that means one of the two factors was equal to zero. A, B can only equal zero if A equals zero or B equals zero. In other algebra classes, this is sometimes referred to as the zero product property. This is a property of the real number. So like many college students or high school students as they're doing early algebra classes, they learn about the zero product property. They use this to solve polynomial equations. Right. So if X minus two times X plus one equals zero, excuse me, that means X equals two and X or X equals negative one, because you can set with only with the product equal to zero is one of the factors equals zero. And therefore you consider the two possibilities will maybe X minus two equals zero, that's where the two comes from, or maybe X plus one equals zero. That's where the negative one comes from. So the zero product property and like college algebra is a useful technique to help you solve a variety of equations like polynomial equations using factoring. So this is a this is a property that's nice to have in a ring. So given that the definition of a the definition of a ring doesn't actually prevent such a thing, in fact, we saw on the previous slide examples of the product to non-zero elements that equals zero, like think of those two by two matrices, there are rings that don't satisfy the zero product property. So sometimes we have to add that axiom to the axioms of a ring in order to guarantee it. And with that perspective, that's exactly what a domain is. A domain is a ring with unity that also has the zero product axiom. OK, if you have no proper divisors of zeros, then you satisfy the zero product property if and only if. So domains are exactly rings with unity with the zero product axiom, in which case then an integral domain is just a domain, which then you throw on the commutivity axiom. So we can stack these axioms on top of each other to make more structured rings. I should mention that the rings, Q, R and C, these are all examples of integral domains that are commutative because they satisfy the zero product property. For the same reasons I was talking about here in College Algebra, these are the rings you're looking at, Q, R and C. They satisfy the zero product property. In fact, these rings, Q, R and C, they're actually fields, right? And so every element other than zero has a multiplicative inverse. Every non-zero element is a unit. So if ever you have a product of two elements, R, S that equals zero, if R and S are not zero, then you can multiply both sides on the left by R inverse, right? R inverse times zero is going to be zero. But R inverse times R is the identity. It's just going to be one. And so that means R inverse times R, S is going to equal S. So if R is not zero in a field, the other one had to be zero. And a similar argument also works for any skew field. So every field is an integral domain because every non-zero element is a unit and a skew field, which is not necessarily commutative, but every element still has a multiplicative inverse. That's also going to be a domain by the same reasoning. So we've seen so far that units imply cancellation. Units also imply the zero product property. So if you fail the zero product axiom or you fail the cancellation axiom, it turns out that this is because of some lack of inversion, some lack of units here. Another example of an integral domain is the ring of integers. Now, this is a very important example because the integers do not form a field. In fact, most integers do not have multiplicative inverses. The only ones that do are the unity, which is its own inverse. And it's additive inverse, which is also its own multiplicative inverse.  But Z here is still also an integral domain. The only product of integers that gives you zero is because one of the factors are zero. And the easiest way to see that is that the integers live inside of a field. They live inside of the rational number. So any product of integers that equals zero is also an equation, it's also a factorization of rational numbers. So you could use the rational inverse of N to show that M has to equal zero or something like that. I mean, that's a topic we'll talk about later on about extending an integral domain into a field, but that's that's a topic for another day. All right. But I also I really want to mention this example because this example really is the reason why they're called integral domains. Because after all, integral, not the calculus sense. Integral is the adjective form of integer. So if something is integer like, we can call it into integral, right? So an integral domain is a ring that essentially behaves to some degree like the ring of integers. The ring of integers is the archetype for integral domains. And that's where the name comes from.


r you to do a statement about here's where we are these are the big expenses these are ones we didn't expect this is what we're going to have coming up why we need to be looking at our budget things like that and I'm very interested in our departments being asked for their expertise in making their operations more efficient in each department for ideas on maybe crazy ideas to put out their brainstorming maybe we could do this instead and it might save us some money I've never seen my name pop up on their phone and I know it's in their best interest to answer it at least deal with it now versus multiple phone calls you're scary though we're constantly going through bills and reviewing expenditures and cutting stuff out that we don't need because you're the experts you know it and you know how you can do your job better I'm not going to hear it any other comments from the public? then it's no one minds I have one other quick item it's going to be real quick and it's not on the agenda but it's just a scheduling issue the chair and I have been working trying to set up the diversity training and we have it scheduled tentatively trying to first so it would be the regular night of our board meeting there will be no closed session and instead of having closed session we'll have the training for one hour then go into the meeting and this will make sure that everybody can attend I hope with the breakfast moment we can attend so it's regular board meeting night of 21st the hour we normally meet for closed session so I hope that all of you can attend I don't think I have okay great the meeting is the last of the series third of the series we still have the consent it's not oh I want to I want to end we have to approve I need to pull the item for the 21st and abstain because I was not present for the what? the meeting on the 21st on those minutes because I was absent we don't have that on here it's in the packet oh the consent on the agenda isn't correct but the packet is February 21st the agenda says January 23rd it should say the 21st as well the packet has it but the agenda doesn't February 21st and she wasn't here I think 11 a.m. would be heard it's 123 I didn't get it on the agenda but I added it to the packet the backup's in there but it's not on the front page of the agenda that item will need to be placed on a future agenda that's the case alright then now you can return that's why you didn't know about it yeah alrighty are we done? yeah are you sure? can we adjourn? wait wait do we accept the two that are on here though the consent agenda I believe approval of the two consent agenda items I second what? wait a second I'm confused I'm sorry so the two agenda items on the consent agenda are the N27 correct but 27 is not in here it's 221 that's where I made a mistake and so it may be the 27 content but it's labeled 221 so I suppose we could vote on the January 23rd which is basically nothing or we could hold it over until the next one let's hold them over until the next one let's just forget it I'm confused now okay so we're we're we're adjourning this means can you say the time is that okay with everybody 9.39 just passing just passing


Мы опубликовали босс на STP-сетях, на IA-сетях, и это и среклассно реклассно. Это будет, как они говорят, на YouTube-сетях. Мы будем организовать все материалы в один, в том числе видео, все обучения, и все ваши посты, и все листы патисментов, и вынер и вынер из постер-сессии тоже. Если вы хотите победить, пожалуйста, подпишитесь, потому что если нет, то нет. Окей, давайте продолжим сейчас. Как я сказал, основные симуляции, как балансы, температуры, флорады и другие основные симуляции, они очень основные, и могут быть сделаны довольно просто, даже с помощью номерикалов и севдекодов или субчаналанализов, но также с руками, потому что первые реакторы были калкулированы нередко с руками, или с логарифмикой рулёрой, или с предыдущим калкультером, даже с севдоками. Однако, когда оно идет к транзентам, оно становится гораздо сложнее. В транзентах есть различные типы транзентов, например, реактор стартап, который очень слегка, может быть считан как сервисы из Several Steady States, но есть эксиденциальный транзент, который является результатом эксиденции, и это включает основные эксиденции. ДБС, мы говорим, когда реактор стартап нормальный, или он может быть дровом или релизом на сингл-контаро, что result in the power excursion, и также loss of one of all primary pubs, but it is a protected accident, which is with normal shutdown. However, this is what is included in the design and must be simulated in the design stage, but in addition also for simulation in the design stage, we have so-called design extension condition accidents, which includes, okay, there are different terminology, I would not go to the details, but generally this is this accident, that are severe accidents that may result in core melting, or core damage, or core disruptive accidents, what we say. And that what we want to prevent, or in generation 4 reactors we want this, or innovative nuclear energy system, we want to practically eliminate this possibility and with core melt and practical elimination means to create the design that physically eliminates the possibility of such event, or when it is physically impossible to make the design measures, which will lower probability of this accident to the negligible values. Not zero, but something like very low probability compared with other potential effects, like meteor or, I don't know, which is, and then we call it practically eliminated. And it's one of the goals of generation 4 international forum, generation 4 reactors. Never thought, I mean, no, not never thought. For this reason we also should simulate, even those possibilities are practically eliminated, we should simulate also those transit, which may or which result in core disruptive accidents, just to see what can we do to prevent it, how to mitigate it, and what potential consequences it could be. Of this is the most important and most dangerous, it's so-called ULOV, unprotected loss of flow, and it's most serious accident, and it means you have, you lose all your pumps, and the counter roads and shutdown roads don't work, so shutdown system does not operate. That's what happens with the reactor. Another severe accident of this type, I mean design extension conditions, is unprotected trip of power, that could be related to the sudden, for whatever reason, drop or release of the, or full bank of the counter roads, so like all counter roads are out of the reactor, what's happened next. And another type of the accident, I mean, I'm counting only main one, it's a core flow blockage. For whatever reason, for example, we have some, let's say, we did not control oxygen carefully, and we have some pieces of oxides, which are collected somewhere, and then block the inlet of the fuel assembly, and that will reduce the flow rate, whatever, significantly, or even totally block the sub-assembly, then, if you totally block the sub-assembly, what's happened next? It will melt, of course, inside, the cladding will fail, and the fuel probably will melt, but will it distribute it more to the other sub-assemblies, or it will remain local accident that can be mitigated as a result. So, and the loss of heat sink also, let's say, for example, for whatever, like, decay heat removal system don't work, it's also kind of accident, and it's also transient, but, let's say, they're all in the different time scale, when your love is very quick, it's several seconds, for example, for SFRs, and for, like, most of heat sink can, and several hours, days, and so on. So, to solve this problem, we will need, it will require coupling calculations from hydraulics, nitronics, mass transfer, a kitchen of states, and probably some structural material calculations, which we need how materials can survive this accident or not. This is very complicated, multi-physics problems, and for this, we have several computer codes developed, and I just want to show you several examples. Of course, we have no time to discuss all the details, but I can show you several examples. I took, let's take as an example of the Astrid, former Astrid reactor, which was presented by Christian two years ago, here in Trieste, and this is very advanced, definitely one of the leading generation for concept, even the Astrid is not officially part of the sixth generation for concept, I believe, ESFRs of this. Anyway, this is innovative, sodium cooled fast reactor, which satisfies all criteria for the generation for reactors given by GIF. So, you have, it's a pull type reactor, here, and we have the, so reactor is here, vessel, relatively big vessel, inside we have a quarry, which is, I will show you later, then you have this vessel, and here we have a pump, which pumps coolant from the so-called hot plenum on the upper part to the cold plenum, and then we are, the flow goes inside the reactor, which is released as usual in the so-called cold plenum, because coolant already hold, then it is sorted in the heat exchanger, and from heat exchanger it is released already cold to the cold plenum. So, it's not directly connected, like outlet and inlet of the quarry with heat exchanger and pump, but you have heat exchanger and pump actually in different positions, slightly different positions. So, it's also, it's a little inertia to this system, so it's not immediately react on, according to the temperature, does not change very quickly, it remains there, and also, okay, then we have this intermediate loop, steam generator, or maybe other system, like conversion system to the electricity, and so on. So, here, we have innovative quarry designed for enhanced safety features. As for the standard, problem as we're discussing already, it's a sodium void reactivity effect. And there are several design measures, assumptions, and many numerical simulations how to reduce this sodium void reactivity or eliminate, or practically eliminate the possibility of the severe accident in such a quarry. So, this part is shows the example of the simulation of the Astrid. It's the same picture from the previous slide, as it's simulated with SAS-4A and Simmer-3 codes. Simmer-3 is two-dimensional safety analysis code, multi-physics. And in this case, we use two-dimensional version, because three-dimensional would be too much for this system. You see, the quarry is again here, we have somehow simulated pump, heat exchanger, this upper planum, upper structures, and the die grid, and the inlet is here. This shows the temperature distribution and the nominal conditions in this quarry. You see, I will show you maybe more details for the quarry. So, it's more or less simulated and the nominal conditions. Now, what happens if you have a UFO accident? Before we go there, let's explain a little bit about the enhancement of the safety, which was done for this. This is one of the versions of the Astrid. It's not, of course, final. The feature was published like five years ago. We can see. So, the features of this quarry, as you might see, we have a quarry with different sizes. In this case, it's homogeneous, but it has different sizes of fissile fuel assemblies here. And also it has extended sodium planum, especially here it's extended. And the sodium planum is extension of the sodium planum, the purpose of this sodium planum. So, it's like more or less empty subassemblies on the top of the outlet. It's due to the leakage, reduced. So, if you don't have sodium here, it will actually have negative reactivity effect. Because in the central part of the quarry you have actually always, you always have a positive reactivity effect, which you want to avoid. But in the upper part of the quarry we don't have fuel, but we have sodium. And if it's sodium voided, we have reactivity effect. So, finally, total reactivity effect is positive. Even this plus one, and this should be like about 500 pcm positive. But we don't expect that the sodium boils immediately, removes from every part. So, what we expect, and what's the purpose of the upper sodium planum, that since we have this also negative reactivity, sodium will boil in the upper part because temperature in the upper part is higher than, it's maximum temperature of the coolant. And pressure is lower than. Plus, also, it's a little bit different altitude, I would say, height. So, pressure is lower. And also, pressure is lower during flow, coolant travels through the quarry. It loses the pressure. So, minimal pressure in the upper part. And since it's minimal pressure there, so boiling should, in principle, start in the upper part. And if it starts in the upper part, which has negative reactivity, then we expect negative reactivity, will lead to the reduction of power and shutdown of the reactor. So, assimilation is done for this. This plot shows flow rates through the quarry versus time. So, as you see, it's very quickly, not very quickly, but relatively quickly, actually in few seconds, pump stops. But then, this flow rate becomes like about 10%, after some time, 10% of the nominal and remains of the nuclear circulation only. It's 10% of the nominal flow rate, provides nuclear, sorry, natural circulation effect. Then, when, in this case, as you have very low flow rate, power is nearly nominal, a little bit less than nominal, you have, obviously, overheating and sodium starts boiling in the upper part. Once it starts boiling in the upper part, you have decrease in reactivity here, and you have decrease in reactivity and decrease of the reactor power as well. Then, sometimes boiling stops, because it becomes colder. Boiling stops, in this case, sodium comes back again and you have again 740 plus P7 of the reactivity. For some calculations, it should be like a periodical process like this shown on this paper. So, it boils and stops, boils and stops with the power a little bit even close to the nominal, no, sorry, it's reactivity, it's reactivity flow. But there are several other cases and they are very sensitive, it shows sensitivity and I will show you probably on this page now. So, here shows the reactor power. This here, it's logarithmic scale, so actually power becomes like maybe 30% first thanks to the Doppler and something, after the trend it first becomes a little bit lower and then this process starts again. And let me show you. It should remove like... Okay, thank you. So, this slide shows the simulation. So, we see time goes after the accident and then you see in this area the boiling starts, we have empty voided area. Then after some time it stops because it becomes the reactor power lower and becomes colder. But later it's again. So, sometimes you can see interesting effect like it's stable, boiling stops starts like periodical process. However, it's very sensitive. If you change parameters, in this case it was parameters of coupling between SAS 4A code and CIMER code, you can have either immediately secondary power excursion which destroys excursion very quickly showing power, you see, in red which could be up to 500 of the nominal power peaks. Or you can have like stabilization of the process simply without any boiling on this shown in the blue line. I'm showing this because it shows how complicated could be this effect. And also especially if you do it for the new reactors and you try to find out whether this still numerical simulation shows that several possibilities possible because you see this sensitivity analysis shows that we don't know exactly. We cannot say what would happen in the reality and we should consider all the variants and unfortunately in this case we could, maybe it's not very realistic but we should be conservative in this case that it could happen that still this will not help us and other things. However, it's these results were like it's not how to say the final answer of course but because we don't know the code should be, you cannot validate such systems complicated on the real situations because we don't have experimental data and I hope we will never have such kind of experimental data for the fast reactors or whatever reactors as well but this is very complicated problem that cannot be solved and we should work and then on the design stage we should demonstrate that our reactor can do this and this and if in case of accident we could this so it was actually wrong timing so it should be for the coffee break. Okay and to help our member states in validating and verifying their numerical simulation codes and models on the regular basis so-called CRPs or coordinated research projects or benchmarks on different aspects of this kind of system and most of them are simulations of the reactors, transit and so on. This slide shows recently finished in 2016 benchmarks that was CRPs that was conducted for years its benchmark analysis of the EBR2 shutdown heat removal test so that time on the EBR2 it was a relatively old reactor it's very interesting and very complicated system it's mix of pool and the loop type actually it's pool type reactor with coolant circulating in loops inside I would say and from the lower part it's actually the pool type connected through the Z pipe so it's actually loop type reactor so the purpose of and they conducted this test in INL to prove that reactor could survive CV accident it was like maybe 40 years ago or more Finally those experimental data became available and INL decided to open to provide the data for the community and for the IEA and the purpose of this therapy was like it happens like okay, first we define the configuration define the experiment and whatever happens whatever had thermocouples what was measured, what was not but also the initial conditions boundary conditions as much as possible and then participants start blind calculation simulation so they model the core whatever model they have with whatever simulation code they have then after let's say about one year of simulation they gather together again and compare the results compare the results for between each other and versus experimental data then at this stage the experimental data the results of the experiments are disclosed and you can compare and here this I put just on one slide several slots so you see this specific test shut down test number 17 which was connected to the it was protected loss of normal and emergency pumping but was protected and you see this like many about 20 or maybe I believe it's 15 simulations of this code and the results are compared with each other and with experimental data as well so then basically after that first comparison we would refine their models maybe they would choose another code or they introduce another model or update their models what they are using in the simulation of such accidents and then compare the results finally again and we have like document which describes the experiment what was done and actually this document provides a good very good base if somebody want to validate a new code a new model they would take this document repeat the simulations and compare and that would be a very good case of the validation that how we try to improve and share the knowledge on this technique on this complicated sophisticated computer code methodology for our member states that is another slide on the bar shutdown it's another it was one protected loss of flow and unprotected loss of flow but however it was screen was disabled station block out but it was an additional pump actually pump still was working so it was not classical it was complete loss of coolant but it was some calculation so and this slide again shows experimental data calculator for different temperatures and then again one example of comparison of the participant data of UC we have many calculations very wide range some of the source of the discrepancy could be simply error in the input data because it's very complicated system as I say you can you should model very carefully geometry and other many many other things and any mistake of course you should different codes use different models even within the same code you can use different models different machine whatever there are many many things that can affect the results and the task this was to compare not to say that this was not to let's say assign the best available performing code in this case of course but it was just compare and give the participants possibility to improve to refine their models and also to give the further let's say to share this all experience with other possible participants but for the people who are developing such codes and need these experimental results for validation of their codes and that was successful CRP which was published and I believe it was very successful CRP everybody were happy especially under the INL Argon National Laboratory was really leading this CRP organizing and it was very good example of organization and join work on this benchmark problem now we started two new CRPs this year and one of them is another which is called which mark analysis of FFTF loss of flow without scrum test it's how they call loss but usual name is you love but since that original test was loss of flow without scrum so we did it keep this name for this CRP but it is simple FFTF is fast flux test facility in the PNL now it is not in decommissioning but still innovative but can be restart operation on this time but it was stop like 20 years ago about and like 30 years ago they had some experiments so this reactor was a prototype of the SFR which is 400 megawatt thermal sodium cooled fast reactor of the pool type because low power is lower and it works on the mox fuel mixed uranium with dioxide and it's loop type with axial and radial reflectors and the total volume of the core about 1 cubic meter is small and with 90 only centimeter height and diameter is like 120 actually fissile core is very small for the fast reactors and one of the features because we need high neutral flux and we need high power options of course high power density it's several times higher than let's say water reactors and one order of magnitude higher than let's say high temperature graphite reactors and so on and to demonstrate the safety features of this reactor, FFTF they did several experimentals on the loss of flow without scrum test and at that time they already implemented okay passive safety system which is gas expansion model interested system like say if you have lower flow you insert more gas and I will not go into detail but the purpose of this particular test was to demonstrate that this passive shutdown system works well okay and so the test was it's one of the many tests that are on this particular test the reactor was working on the nominal power or 50% of the nominal power and main coolant pumps were turned off and normal control scrum response was disabled so then more or less you see the results of the experiment okay this is not so and temperatures were reached some somehow the maximum values but it was still within the margins of the safety limits and thanks to this gem gas expansion model passive shutdown system reactor was safely shut down without exceeding safety margin however let's say notice it's at 50% power and I believe if they start from 100% it would be not very successful in this case of course they had some let's say if temperature would reach some you know unsafe values or limits they would shut down the reactor anyway but in this case reactor was not shut down I mean by control it was shut down automatically but thanks to this gas expansion model passive system so more or less you see here shows the coolant temperature it was rising and then going down and comparison with Rhapsody which was by the way they compared with something and the result is that coolant temperature never reached the boiling limit and it was I mean good demonstration so now it's and that we don't have boiling it's very good because once you have boiling the solving of the problem becomes much more complicated and very oops, sorry and it's uncertain and the result becomes very uncertain because it's very complicated physical phenomenon in this case and never the less even in this case it's very complicated task how to simulate this system properly accurately using only this input data and we had already first meeting that we will have but already we have specification and in October we will have a first meeting where the participants which is about 25 organizations from 15 or 17 countries are participating now when participant will discuss decide what they actually need how to model to find some general common solution and then go for their blind simulation for the first year and just in addition I would like to show you another CRP which we started it's not ULOV and not transit analysis but it's Neutronic Beachmarks of CFR startup test it's pure Neutronics where people will use Monte Carlo and deterministic codes it's standard task relatively easy I say relatively because it's it's not easy at all but since many countries many organizations and many participants have great experience in simulating of such kind of let's say only Neutronics you don't have to simulate coupled with some hydraulics or whatever so this I expect if we could receive a good results and if you need experience in Neutronic simulation and many people let's say and I believe your organizations you are presenting are also several participating in this CRP it's another example of CRP we have and what importance already Chirayu on the first day or he explained that we are to you know that the idea of this CRP is to collect data experimental data to have a benchmark and then to provide for the future users this set of data so you can repeat this experiment and simulate this experiment and compare your results future models with this data however if you have only book it's very very complicated specification it's not always easy that's why we are in support of this let's say participants now and for future they develop so called digital nuclear reactor it's the storage of the data on the core on the reactor which helps the users to calculate and we have this already for the CFR startup benchmark and we are planning to have it also for the FFTF reactor core at least I just want to note one more thing which I've forgotten in my first presentation and maybe useful for you within the NAPRO CRP sodium properties we will issue not only text books or hand books on sodium properties including physical and chemical sodium properties and friction factors and heat transfer coefficients for the sodium coolants but also online sodium properties calculator when you can there is a working version maybe we can also check how it works it allows you to use all relations included in those handbooks will be also included in the system so you can easily see the results obtain the result see the comparison and also you can extract the computer code I mean the code exactly which can be used in your models for the modeling in your computer this is Java I believe and it should be also easily converted to C programs as well ok thank you very much for your attention and thank you very much


Hey everybody welcome back to the channel today. I'm going to be talking about a script I made that will allow people who don't want to install DWM manually to install my rice of DWM on their systems So I'm gonna walk you through how I made it what it does some of the things that's limited in not doing and Some of the things that I'd like to do in the future. So let's go ahead and jump in All right. So first we'll take a look at the Script on github. So it's called DWM ricer not the most original name ever, but whatever and Basically all it has it has the script has this image here. It has a readme, which is all the stuff down here and It has the fonts that you'll need now the it Now the fonts themselves will not install by themselves you have to do that on your own and And how you do that really is up to you You can a lot of desktop environments while you just double click on them and install them that way You can also move them to users slash share slash fonts. I believe you may need sudo to do that. I'm not actually sure Uh, maybe someday in the future. I'll go through and have the script install them for you but as of right now These fonts here are the ones that you need to install and that's just for the Icons up here at the top in order to actually show up. So you'll have to do that Other than that everything else is fairly easy. You just you know clone this and install it and I'm going to show you this on Arch and I'm going to show you this on Ubuntu. So by default the script is set up for arch Linux And uh, if you're going to use it on Ubuntu, you'll have to uncomment a line So I'll show you that as well. So let's go ahead and go through and do it on arch first So I have arco here. This is arco with xfce. So we're just going to start the The vm and let it start up. Now as you can see, this is a brand new installation of arch Linux or arco in this case. I guess um I have done nothing to it So the first thing you'll need to do is find the script. So just go to your firefox or your browser or whatever and type in github hub.com slash mtwb 47 that's my github page and click on repositories dwm riser and then Copy this code here now Whether you do this on an arch based distro or you do it on ubuntu You will have to have get installed before you can install this The script itself will not install get You can't even get the script unless you you know copy and paste it. I suppose Without actually having to get installed. So open up a terminal if you're an arch sudo pacman dash s get okay, and I I know arco already has this so it's just going to be a reinstalling oops Actually got to have to spell pacman right at There we go, and then as you can see it says, um Actually, maybe it does have I have doesn't have getting installed on medic. So i'm god. I'm doing this Lesson learned arco always has get installed. I thought maybe not anyways once you've got that installed And we'll zoom in here And make this full screen Then you just want to get clone that URL that you just Downloaded so get clone and then control shift v to uh paste and enter and it will clone it And then we're going to cd into dwm riser and we can We can clear this and do an ls and we see this file here will not be there That's in there by accident. We have the script. We have the font folder We have the screenshot that's on get and we have the read me So if we them into dwm install that sh What we have here is just a simple bash script and First thing we're going to do is install dependencies. So the dependencies are going to be different depending on What distro you're using so if you're using arch all you'll need is sx hkd and alacrity So And and this is by default It's uncommented all you'd have to do if you want it to is just run the script If you're on arch linux or are an arch based distro If you're on ubuntu, you'll have to come in here And you'll have to comment this one out here. So get into insert mode Do a do a pound sign and then delete this pound side here that would that would switch you from the arch script to the ubuntu or debian based script But i'm an arch this time so We'll leave that one uncommon now I'm going to talk a little bit more about the dependencies for ubuntu and debian when we do that in a few minutes. So after that We clone a few things. So we clone my scripts that will allow the um Scripts for the bar to work and we clone my pack my sequels folder, which has dwm st surf And d menu all in it all and it will all go into a suckless folder inside your dot config directory Once it's done cloning it will CD into the suckless folder that it just downloaded It will move the dwm to your home folder because that's where it needs to be It will cd back into the home directory and then it will cd induce the scripts Which is what the thing that it it downloaded up here from git and it will move the weather dot pi the pack update dot sh to Uh user dash local dash bin, which is your main path now Weather dot pi will work on any distro, but pack update dot sh will only work on arch So if you are downloading this for ubuntu, just know that that particular script for the bar Will not work And i'll show you that when I When we go to the ubuntu part after that we'll cd back home it will do and now we're going to do Now we're going to go through and um make the stuff that we need to make so we cd into suckless dot dwm And we remove my config dot h because it's going to make a new one and it's going to sudo it make install It's going to do the same thing for st s l status D and d menu it doesn't do surf I think surf is actually there But it doesn't make it so if you're going to want to want surf you'll have to go through and make it yourself It would be the same thing. You just cd into it. So we don't make install make sudo make install and you'll be fine Uh s cd is back home. This one here is where things get a little squirrely. So Uh s cd is into the x sessions folder and this what this does is it goes through and creates an entry in your login manager In order to create dwm in the login manager For whatever reason it required me to change the user to the user On a boon too. I don't know if it had to do that on arch because I tested this on papa west first. So Um, it required me to change the user for some reason So I just put this in here. It doesn't hurt anything to change it So it's just done. So it creates a dwm desktop file Changes the user and then it cats this stuff out into that full folder using A cool way of catting things which I'd never used before I had to look this up. So that's done And that's literally the entire script So let's go ahead and get out of this And let's go ahead and run it. So in order to run it you do dot slash dwm install the sh Okay, and then you hit enter It's going to ask you for your password You know, I don't actually have to have the password because I've just entered the password earlier But it will ask you for your password and it's going to ask you to confirm Whether or not you want to install these things so it's going to install lacrity It's going to install sx sx hkd. Yes, it's going to install those things And then it's going to go through and do the script And then it should be done all we have to do now is close this Close this and say close tabs and we're going to log out now SDDM does not like Virtual box all that much so I have to get out a full screen And try to get this to work Sometimes I have to go back into full screen and back out of full screen And then try to get this to work. There we go. Now, as you can see dwm is here Now this is going to look different for everybody depending on what login manager you use Most distros use light dm. So there might be a Like little gearbox up here at the top. You'll just have to look for it and then you just type in your password We'll make this full screen again. And as you can see we have DWM now if you There are a list of my key bindings On the git page for this github page for this, but super enter will get you will usually get you a terminal and it does So and this is alacrity. So that's how you get it on arch. Now, let's go ahead and jump to ubuntu Okay, so this is just a log standard lts version of ubuntu. I've done absolutely nothing to it Uh and the process is basically the same except for a couple spots So let me talk about those when we get there. So let's first get the script. It's going to be exactly the same We open open up firefox go to github dot com Can't type m mtwv 47 And then repositories and then dwm riser And then we copy this url here now we open up a terminal And we zoom in so that we can actually see this Okay, now the first thing we want to do is sudo apt install git Okay, and then type in your password And then hit y for yes, and it will install git Now that is an absolute must this will not work without git Unless like I said you copy and paste the script and then put it into a You know a text file and then change the Uh permissions on it. It's much easier just to install git So We'll clear this and we will go ahead and clone dwm riser. So we'll get Clone and then control should be to paste and let that clone We'll cd into dwm riser We do ls and we have the same files as we did on arch. We're going to vim into dwm install the sh Oh, I don't have them installed. So I'm going to that's another I could you could use nano So if you have if you don't have them installed, which apparently I don't on this machine you do nano dwm install Okay Now here's the things we're going to want to do you're going to want to go through and Comment this out so Hit the pound sign at the beginning of this line and delete this pound sign here Okay Now what this is going to do is download the dependencies that are required for ubuntu. So if we zoom out in just a little bit So we can actually see some of this and make this full screen maybe It's still not going to be all beyond one line And I know that's going to bother some people that they can't can't actually see this. So where the hell is my There we go. All right, so it's going to install sx hkd. It's going to install build essential which is basically the make commands And dwm requires libx 11 dev lib zanorama dev share util suckless tools And lib xft And l ibc 6 Those are all dwm dependencies now You could theoretically install st and ddim d menu in this line here But I prefer building them on their own that way you can go through and patch them later if you choose to so after that The Script is exactly the same. So it goes through and does everything exactly the same. There's nothing else you need to change You just need to save this which you can do by hitting control x and then yes And then enter Okay, now here's the thing Alacrity is not packaged for ubuntu. So my build of dwm will not have a terminal functional for you If you are on ubuntu, that's just a sad fact of it now If you're on pop you can install ubuntu from their app store. You can't do that on ubuntu Apparently I'm actually I could probably go through and make sure that's actually true If this thing actually want to load this is a snap so that it's going to take forever to load. Here we go So we're going to search for alacrity. I don't think it's here. Oh, it actually is here so you can go through and download alacrity from the The software center And you have to do that because I can't you can't do as far as I know You can't do sudo apt install alacrity no But you might be able to do sudo snap install alacrity No, so you have to install it from the uh the software center You have to do that before you log up And log back into dwm after you've done run the script because you'll need alacrity. Otherwise, you'll need to go into dwm The dwm folder in your config file Change the alacrity thing Actually, I think alacrity is called from sx hkd now that I think about you'd have to go so you'd have to go into the sx hkd Thing in dot dwm, which is in your home folder change the alacrity Thing to a terminal that you have so either can I'm terminal or termite? I actually probably can't get termite I don't go into either or not. I think about it But anyways, so to run the the script It's exactly the same so dot Slash dwm riser dwm install a sh Hit that it's going to ask you so normally you'll have to enter your password But we've already done that once so you don't have to do it again It's going to ask you to confirm yes, and then it will go through and install those dependencies It'll take a few seconds Shouldn't take too awful long to really depend on your internet connection. I guess For me it takes about I don't know 45 seconds or so. It's almost done And then it goes through and does the script And it looks like it was all successful now Here's the thing and I didn't mention this with the arch if it fails The reason for the failure will be in this nonsense up here somewhere You'll see an error now. We do have some errors here. That's just because there are some unused functions within the dwm script that I use For usually are on gaps, but usually where you're going to find the errors is going to be up here either in The dependency section or after the build and it will tell you that if If it didn't build it'll tell you why And if you encounter something like that File an issue on github and I'll try to help you but don't lose this if you enter if you Get a if you get an error copy and paste this stuff so I can actually see it Okay You can always go through and run the script again. You should be able to get the same errors in case you do lose it All right, so we've ran the scripts. All we got to do now is close this Close this hit close tabs And no, I don't care about updates And then we're going to log out And then here in Ubuntu you have to click on your name and then there's this little um Let's see if I can actually main no camera. So down here at the bottom. There's this little Uh Year or something you just hit dwm type in your password And by the bam by the boom you're in dwm and I didn't install lacrity. So if I hit control enter or super enter, I'm not going to get anything so if You get to this point and you don't have a lacrity installed Hit can hit super p that brings up d menu Okay, and you can go through and Type in a terminal that you know, you we do know that you know you have so we know we have genom terminal So it should be here somewhere Good lord, there's a lot of genom shit here terminal So we just open that up and we have genom terminal And then you can go through and install any of the things you needed to know In order to change this so we if you want to change to genom terminal So let's zoom this in here.  Sx hkd. You can't say the freaking letters And then then if you hit super enter you should get the terminal which it did not do I wonder why There we go. It didn't actually go through and register Uh the sx hkd refresh But it did now so I can hit control enter as many times as I want I don't know why you'd want get on terminal as your terminal, but Whoever floats your boat Uh The one thing I didn't talk about in this video is rofi. I did not install rofi Uh, so I don't know actually meaning because I forgot so I don't know if we can sudo apt install rofi I don't know if that works or not. We'll see It actually will Okay So now if we hit super d we'll get rofi So if you'd rather prefer rofi, I think what I'll do is before I after I upload this video I'll go through and change the script so that it will install rofi on both arch and Ubuntu that way this is possible because I do have all the rofi stuff here so, um One thing it will not do is get my rofi theme So you'll have to get your own themes. You can just do rofi You should be just to be able to rofi theme selector, but apparently that's not here. Um anyways That's the script. It's Not a good script I'm not a good Bash descriptor like at all. I mean as you see the syntax is very Uh, childish Immature, I don't know. Um amateurish amateurish I'm still learning but it works it works and I've tested on both Ubuntu and arch now if you're on a different distro What I would suggest is commenting out both of those dependency install lines Just comment on both out and install the dependencies on your own now if you're on fedora or open suza I'm not sure what the dependencies are, but I'm assuming they're going to be the same as Ubuntu I'm not not sure if the package names will be the same. You'll have to go through and find that out I don't know. I've never installed dwm on On um fedora or open suza. The only thing I've ever installed it on is debian based distros In arch based distros, so and I know that this script works in there Now if like I said if you have an issue file it on github, I'll try to help Make sure you give me as much information on errors that you received during the run of the script As possible so that I can you know try to help. Anyways, thank you for watching You can follow us on facebook and twitter at the linuxcast You can support us on patreon at patreon.com slash linuxcast. I'd like to thank our patrons devon zack marcus american camp Thanks for your support. Thanks everybody for watching. I'll see you next time


I think a fair definition of perfect is anything that functions exactly as it should. If you bought something, a household appliance, a device, or whatever it was, and it functioned exactly as it was supposed to, you'd say, well, it's perfect. But we don't extend that same definition to our humanity. So when we as humans struggle with fear and anxiety and depression and mental health issues, and we struggle with jealousy and envy and bitterness and we are judgmental and we are unkind, all of that really is proving that you are functioning. We are functioning perfectly as human beings. And I'm not saying we should stay in those things, but I'm saying I want you all to be kinder to yourself. Because to have those things here in your life and allow them to tell you that you are deficient, you are less than, you are a flawed, broken version of humanity is not true. All of those things, all of those flaws, weaknesses, things we hate and dislike about ourselves and others are just proof we're functioning. We're perfectly functioning as normal human beings and we're on a journey and I want you to be kinder to yourself and to others rather than allow those things to wrongly define you. There is not such thing as a perfect human being except in our minds or on social media. So be kinder to yourself today. All right, love you guys.


Hi, wrth gwrs dyna yn gweithio i ddau i'n tyfiau. G factorynd ar generally er i fwylltiad gyda gwych ag am gywir i'r Eri Maid ac gan gyda'r tari hwnnw i'r gweithio'r corwg, oherwydd mae o'n ddewch ar y wahanol. O'i ffordd i'r web app. Rydyn ni'n gynghyddol, a'n ddau'r werthio, maen nhw'n ddiwedd â'ch wef gwsio ysgrifwng. Ar ystod, mae hwn arnyn mewn i'r ffordd. Fy gallwch yn gweithio'r bydd y bydd mwy fo'r ar y gwrth pause, I think it wasn't the best title. So what I really want to do today is talk to you about my journey learning, SANIC, and learning the ASIN IO ecosystem in terms of doing web development and web frameworks. But first of all, just quickly, who am I? I'm a Scottish Pythonista, and speaking of which is extremely hot here. And my hotel AC is not working, so if I fall asleep, it's because I didn't sleep well last night. Otherwise, I'm the Python Glasgow organiser. I'm an open source maintainer of a number of projects. The probably the most popular is MKDocs, but I've actually been fairly inactive on that lately. I'm an open stack developer at Red Hat as my job. And in the past sort of 10 years almost, I've done a lot of Django and Flask development. So I've done quite a lot of web development. So this has been really quite an interesting lesson for me in terms of learning about ASINQ web frameworks. Because while the actual web development can be very similar, there's quite a specific mindset that you need to take because otherwise there are pitfalls that you'll hit. But first of all, I just want to talk a bit about how we got to this. OK, just checking it was updating. How did we get to this point of where people are able to use ASINQ IO for this kind of development? And I think a lot of it comes from the transition that's happening from Python 2 to 3. I feel like as a community we are kind of at the tipping point where most people should either be on Python 3 by now or they should have a clear transition to Python 3 that's under way. And if not, you're going to be in a sort of a nasty place and not too long, I think. But if you can make the assumption that most people are on Python 3, then most of them are also on Python 3.3 or above, which means they have the ability to use ASINQ IO. So this talk is not really about what ASINQ IO is, but I just want to quickly sort of define it for people if I can, which is a fairly tricky thing to do because it's something which could have multiple talks itself. It's quite a big subject. But essentially, ASINQ IO provides people a way to have single-threaded concurrent code using co-routines and essentially you have an event loop. So this is something that isn't particularly new. It's not an innovation in ASINQ IO. It's Twisters has been doing it for a long time. Tornado done it more recently. Node.js made it very popular in the JavaScript world. However, I think the sort of the real important thing about ASINQ IO is it's given everyone a common base to work on. You don't end up with silos where there's all these sort of twisted projects. Everyone's hopefully, everyone will start moving towards ASINQ IO as the standard event loop, which they can then build an ecosystem around and improve things. So I think that's a really important. And I think that's the most important thing that ASINQ IO has actually done. I have a confession to make that initially, when I tried ASINQ IO and that was about two to three years ago, I essentially dismissed it. I didn't like it. It felt awkward. For those that remember, and I guess as before Python 3.5, you had to use a decorator to specify co-routines. You had to use yield from and it just felt kind of awkward to me. It didn't feel like regular Python. But with the addition of the ASINQ and Awake keywords, I feel like it's a lot more natural and a lot more comfortable to use. I'll have some examples of these. So if you're not too familiar with them, you'll see them in a bit. But the point of that is that I've had a lot better experience using ASINQ IO this time around. So if you have looked at it in the past and you've maybe dismissed it for similar reasons, it might be time to start taking a second look. And that then takes us to SANIC, which is the sort of the thing which binds this whole talk together. SANIC is a small, contained, bed bones web framework. It's got a similar scope to Flask. I don't know if they have any plans to change that over time. I suspect probably not, and it's going to... So Flask is really powerful for being minimal, but then it's really powerful because of the ecosystem that's built around it. And I think that SANIC over time will have an ecosystem which hopefully builds and adds the sort of similar levels of power. And if anyone's sort of wondering what is special about SANIC and using ASINQ IO, why is it worth the effort compared to Flask? What can you do that you can't do otherwise? So I find this quite hard to explain, and this is because I'm probably not an ASINQ IO expert, but essentially the event loop allows you to sustain or keep multiple connections open at the same time. So that means you can take multiple requests and process them and you'll just be waiting for IO. So say for example you have a web app which has an endpoint which requests something from a database. When your code reaches the point where it makes a request to the database, it can release that IO will happen in the background essentially, and then another request can be processed at the time, and you'll keep switching between the different tasks on the event loop. So say for example the equivalent and say something like Flask would be that every request would be processed one by one, it would wait for the request to start to finish, and then they'd be completely sequential, whereas with ASINQ IO they're concurrent essentially. For people who don't understand the ASINQ reference, the web framework is named after this internet meme, which is maybe a sign of how serious it is, but that fits in quite well with the Python ecosystem I think. I don't fully understand the meme, I have to say, but essentially I think it was a kid or somebody who had done a really bad drawing of Sonic, the hedgehog, and people just found it hilarious and shared it, and these things explode. I mentioned that there has been an explosion around ASINQ IO recently in terms of frameworks and options, so what made me pick Sonic over the others, there are a whole bunch of other competing web frameworks which are hoping to get users. The number of reasons, and honestly they're fairly simple, it just seemed like the easiest to use, it was the quickest to get started with. As someone that's done Flask before it seems very familiar, and it just didn't really get in my way, it essentially provides you with a way of doing your request and your responses, and then you can call out to other parts of code as you need, which is exactly how it feels when you're working with Flask as well, I think. I started using it initially probably in early January, I think, and I think I was quite lucky as well, to be honest. It seemed like the most active and it seemed like the nicest to use, but then looking back at the stats now, it's really the only one that's gained traction, and it's the only one that's really active on GitHub with lots of issues and poor requests in community discussion, so I think I jumped on the correct train there, which was definitely partially luck, but also probably a testament to how easy it was to use. Getting started is as easy as you would expect. There is one catch, and I found out that Sanic doesn't actually work on Windows at the moment. The reason for this is that rather than using native Async.io, I actually use this UV loop. This is a faster implementation of Async.io written in Scythyn, and largely on, say, on Macs and Linux, that's just an implementation detail you can ignore. They're compatible in dropping replacements, but if you try and install Sanic on Windows, you actually get an error at the moment. I thought it would fall back to Async.io, but I found out earlier somebody showed me on Windows that it'll actually just, the installation will fail and complain that UV loop does not support Windows. So I'm not sure if that was a regression or what happened, but hopefully there'll be a way to use it on Windows at some point. So this is the, this is of the mandatory Hello World, which shows you the sort of the very bare bones API. And again, I'm going to reference Flask quite a lot, but it will seem very familiar to Flask developers. Unfortunately, with the layout of this room, it's quite hard for me to point up there, even with my laser pointer. It's kind of above me, but you can see the, so Sanic has the concept of apps, and that's probably why I include apps in the name of my talk title, but essentially you define an app to represent the, what you're building, and then you add routes to it just like you would in Flask. The key difference here is the Async keyword. So if you're not familiar with Async.io, this is a syntax that was added in Python 3.5, I think, although I did not write down the version here. And what that does is it tells Python that this is a coroutine, this function. So that means that you can await on it, and it can await on other coroutines internally inside it. But otherwise, this is just a very simple example. It just returns the plain text Hello World, and it's a fully working example. So as long as you've got Sanic installed, you can just run that. And when you do, this is the output that you get. So this is obviously the ASCII version of the drawing that we've seen earlier. And this is one of the things that I think Sanic is doing really well. We could do with some more innovation in ASCII art and entertainment when you're running your apps. Joking aside, it's actually reasonably useful because that will only appear when you're running the app in debug mode. So it's a good kind of red flag that you've forgotten to turn debug off. Otherwise, there is the standard things you would expect. This is just a great example showing you how you'd return plain text like you did in the first example, returning JSON and running HTML, which could obviously be like a rendered ginger template or something like that. But what I don't really want to do is basically talk you through the documentation, talk you through the API. So we're going to try and just do a slightly more interesting example. And hopefully I can talk you through that. So I think WebSockets are one of the best ways to demonstrate why an ASCII framework can be useful. For those of you that don't know, WebSockets are a way for your JavaScript to speak to your server in essentially real-time communication. So rather than polling for updates, for example, they'll open a connection when the page loads and then they'll just sit there waiting. Well, actually, they can send data to the server as well, but they'll also receive data from the server. It's a two-way communication and it's essentially instantaneous, I mean, other than the sort of network latency. But it allows you to do real-time websites, which is really good for things like chat or notifications and so on. Anyway, for the WebSockets support in Sanic, you need this extra package. So this is an optional dependency, essentially. It's an AsyncIO WebSocket library, which is really nice. So even if you want to do something with AsyncIO and WebSockets, but not with Sanic necessarily, I think this is the best option. It's written by, I think, it's one of the Django core developers originally, but not using Django itself as far as I'm aware. So when you have installed that, you can then use the app.websocket function, or decorator, sorry, to define a WebSocket endpoint. So, again, this is a very simple example. We have the Async keyword to tell us a code routine, and then we have the two awaits. I can't actually point, I can't read that, so I'm just going to have to explain it. Yeah, so if you're new to this stuff, if this can seem like quite a strange pattern, because it looks to you like this function could just lock up indefinitely, because it's a well-true, it's an infinite loop. But actually, every time you get to the awaits, so when you have the awaitwebsocket.send and the awaitwebsocket.receive, it will actually, the IO for that will happen in the background, it will be waiting there for something to be sent or something to be received, and then it will return to the event loop, and then other requests can be processed concurrently. So this is why it's so important to have something like Async IO for this, where you can have concurrent requests. You can't really do websockets in something like Flask, because it requires you maintain the connection, and keeping many connections open in Flask just doesn't really work. And the same applies to sort of Django and things. There are ways to do it in Django now, and so what people used to do is they would run something like Tornado or Twisted, and they'd have a websocket server, and then they'd have the Django or Flask server, and then they'd speak to each other behind the scenes, and they'd sort of send notifications, that you have to deal with keeping them all in sync and everything. Anyway, this is a very simple example from the documentation, and I think we can do something a bit better. So in danger of angering the demo gods, if you could all just try and go to this web address, it'll be kind of interesting to see if this works at all. It won't use much data, so you can use your regular cellular data, and thankfully, if you're European, you won't have any roaming charges now. But essentially, what this does is it shows the number of people that are connected to it, and it shows the lists of the user agents of people connected. I'm trying to load it now, so it might take a moment for the Heruqo app to start up. Has anyone managed to load it? How many people are connected, does it tell you? Okay, all right, I was worried this might happen, but essentially, it's a bit of fun showing you that I can still walk you through the code in the same way. 20 plus, that's pretty good. So I've done a demo of this talk in Glasgow, and I had far less people at it. And I have no idea how many it can handle before it falls over, but it seems to be better than the Wi-Fi, but that's not too surprising. How many? 31, that's pretty good. Yeah, so all of you are basically, all your requests are concurrently open and all being handled, and they're sitting in the background waiting for the IO events to finish.  So this is a slide where I really needed to be able to point, but I'll just talk to it from top to bottom. So the first two variables at the top, the connected equals set and the user agents, they're essentially tracking the web sockets that are connected, so the number of web sockets is connected to the set. The user agent is then just a dictionary of user agents, which I routinely send to the browser. And we have our co-routine, again, which is called feed, and when the request is opened, the web socket is added to the connected set. And then we just take the user agent from the request and add that to the user agent's dictionary. And I have a little printing statement, which was useful from the console, and I probably should have removed that. Fully enough, I said that the last time I gave this talk, and I never removed it. But then we go into the actual loop, which is happening here, which is then sending the data back to the client. So what you can see is I've got a web socket.send, and it's just sending Jason, it's sending the user agents, which is a dict, as I said, and then the web sockets. I'm just doing the length of that, so it's just sending the number so it's more efficient. And then we await on that data to be sent and it just happens over and over. And what we have, the next line, is the asyncio.sleep. So it's sleeping 0.1 seconds, so that means it's sending the information updates to the client every 0.1 seconds. Assuming everything goes okay. The one thing that's really important to hear, and this is an example of where you need to understand asyncio and make sure you don't do anything which is blocking. You can't use, or you could, but it'd be a bad idea. You shouldn't use the time.sleep function here. You have to use the asyncio.sleep, because when you use the time.sleep, it would just block that loop at that point. But when you use asyncio.sleep, it then releases back to the event loop and allows other requests to be processed. So the thing with something like asyncio, it's not that you can't do blocking code, it's just that you need to make sure your code is written in a way that isn't blocking. And this is one of the gotchas I find. It's because you might be trying to use a third-party library, but if that library does anything blocking, then that will affect your run as well. And then in the finally part of the try, finally, we just do some cleanup. So we remove the connected web socket, and then we remove the user agent and print out just the number of connected sockets for my debugging again. So if anyone still has an open, you'll see that that number will decrease as people start to close it as well. So it's quite nice you get the real update there. So for example, this could be a very simple tool to just show people how many other people are looking at a web page, which perhaps could create like FOMO because it's like 20 people are looking at this hotel, book it now. I think there's one website I go on that does that. And the one thing I should note about the web socket, so when somebody closes the tab, the next time that we try and send data to that web socket, you'll actually get an exception, which is something like web socket closed. So that's when you break out of that loop and that's when the finally is called. So we never close the web socket on the server side that's only ever done on the client side. And then Sannick just handles that exception as a like end of request type thing. It doesn't treat it as an error. It's just like we're done, we're good. And then just for completeness, this is the JavaScript I wrote and it's kind of horrible. It turns out it's actually quite hard to do something very concisely in JavaScript when you want to deal with the web sockets. I'm not really going to talk through this. I mostly edit, so if anyone stumbles across the slides, they've got a mostly complete example they can work with. I actually have all the code in a GitHub repository, so if anyone's interested, I can link you to it. I forgot to add that link to my slides, but it's pretty easy to find as well. But what I found really exciting and really fun about writing this is the full thing is only 80 lines, sorry, 85 lines of code. So that's the Python, the HTML, the JavaScript, the Heroku config, which is only a couple of lines admittedly. But creating something like this was fun, but also you can see the path of how this could be useful, even though it's such a short example to write. Of course, with something like WebSockets, the complexity comes at the next stage. It's what you do with this. So say, for example, if every WebSocket was making a request from the database, you could potentially be in danger of overloading your database with connections. So on Heroku, and so in the app that I'm using Sanit4 on my non-toy app, not this one, it uses Heroku Postgres, and I'm on one of the cheaper tiers, so you only get 20 connections or something. So it's very easy to have too many WebSockets open that you run out of connections. But you can get around these problems using things like PG Banser, Postgres Banser, and have that running on each of your Heroku dinos, which then means you have potentially 100 connections or so, which only translate into one or two real connections. But I mean, that's just an example, but yeah. So this is a very simple one, but you will find that the complexity does come later. And I did say I'm not going to read through the documentation of Sanit, but I just wanted to highlight a couple of the common features that people have asked me. It's like, does Sanit have this? Does it not have this? So just to quickly mention them. Class-based views are there. So these are very like flasks, class-based views. So this means that rather than having a standard function to handle your request, you can have a class which breaks out your post gates and the other types of requests, which is quite a nice way of doing it. There are blueprints, and these are again very much like flasks blueprints. You can see that they actually say in the Sanit documentation that they are flask-like, I think. So they really are trying to mimic the flask API where it makes sense. So the blueprints are a way for you to write reusable apps, which can then be added onto endpoints. So it's kind of hard to explain, but basically it's for making reusable web apps or components to go in part of web apps. There's also an unopinionated configuration which provides multiple ways of loading up the config, but essentially acts like a dictionary, so it's easy to store the config how you want. And then it's got support for things like cookies and so on and everything you serve expect. So when it comes to testing, you need another optional dependency. So this is AIO HTTP, which, as far as I'm aware, is the most common HTTP-requesting async.io library. So essentially it's the requests of async.io, although I did hear that request is going to have a async-compatible part to it added at some point, but I don't know when. But anyway, for now, this is, I think, the most popular, and Sanit uses it internally to make requests to itself, which allows you to then test your app with it, is my understanding. And this is a very simple example of how you use it, and really testing with Sanit is simple, because your Sanit layer is such a narrow layer in your app. But the challenges I found with testing were actually much harder in general when using an async.io app just because. So when you have all your code expects to be run on an event loop, so that means essentially your tests have to set up an event loop, run it once, and then tear it down again, which is quite an overhead for each of your tests. And if any of your tests misbehave, so for example they don't shut down the event loop properly for some reason, then you'll have a test which just gets blocking because it's waiting, it's got an event loop that's stuck open. And yeah, so something I would actually be really interested in, and this is kind of a request out there, anyone else that knows about this is some input on how to best test async.io or asynchronous apps, just in general. Somebody should submit a talk on that or a blog post or something, that's my request. But it's definitely not a fault on async itself, I think it's just more inherent complexity of your overall architecture as it changes. This is just a small note, so this is something that I missed when I first was using async and it greatly impacts the performance. So the thing you should be looking at on this slide is the worker is equals eight. So if you don't provide this, async will just default to one worker. And what it means is it will spawn up multiple processes, which will then root your requests across these processes and handle them. So it obviously makes your app run a lot faster. So this is quite similar to something like gUnicorn, which will spin up, say, multiple Django or Flask processes and root the requests. But then with async you have essentially an event loop in each process, so you've got multiple event loops going on and you should be able to get quite a lot of throughput doing that. The documentation or the async developers, at least they seem to recommend one worker per CPU that you want to dedicate to async. So if you have a four-core machine, you might want to give it all four cores and use four workers or you might have something else running on there, so maybe you only give it two. The ecosystem is probably the biggest sacrifice that you'll make if you were to head in this direction compared with using a more established framework. So there is a small reasonable set of extensions listed in the async documentation. That seems to be the best sort of collection of them, but it does feel like your mileage will vary a lot with all of them. And more often than not, you end up having to roll your own integrations. So there was, I don't know, I've tried a few. There was the async limiter, which is a rate limiter. That seemed to work pretty well, but then I tried another one to do with session handling, and actually that didn't work well for me because it didn't provide the back-end I needed, so I ended up writing my own session handling, which is kind of a pain. And really I should probably rip that out and release that as a, you know, like a sanic Postgres sessions or something, but I've not done that yet. If anyone's interested, I could look into doing that. And then there's, you then have to start looking at how you would integrate with other systems. So I've mentioned Postgres a few times, so it's not a surprise to people that I'll be using that. And the thing with Postgres is you need to make sure you're using a non-blocking Postgres library. So the most common one is AIOPG, and it nicely provides integration with SQL Alchemy, so that allows you to use SQL Alchemy with a non-blocking connection, but it only allows you to use certain parts of SQL Alchemy, so you can only use the core API, you can not use the ORM API. So people are familiar with SQL Alchemy, you'll probably, people tend to use one or the other, you don't tend to use both. I used the ORM API until I started doing this, and then I had to use the core API. And they're both fine, but it's just, I don't know, it's just a pain that you have to be aware of what you can and can't use, otherwise you're willing to sort of trouble. So I think it's kind of interesting to think about when should you consider using Semic? So my top title is to do with web apps, but I don't think people should really be looking at building a large web app with Semic. You want to think of it more about high throughput services, something that you need to go really fast, or something like a microservice would work really well, so it's something that's quite lightweight, but it's going to get lots of requests, or the smaller web apps do work. And it's not to say that you couldn't do a larger web app. I think it's just when you start to require things like sessions, and then you start to have to roll your own, and then you'll need auth, but I'm not sure there's many authentication packages out there. It just becomes a lot of work. So maybe as the ecosystem grows, then maybe it'll become more like Flask, where you can just add these extensions, and it becomes almost like a full stack framework. But at the moment, I think it works quite well as sort of discrete small services. And I just quickly want to note the other options that are available. And this is something which is a bit of a tongue twister to explain, but I think a project that we should be keeping an eye on is UVCorn. So this is by Tom Christie. He's the author of the Django Rest framework, so he's very well experienced in this kind of area. And UVCorn is a commandewe of GUNICORN and UVLOOP. So he's essentially writing an AsyncIO version of GUNICORN, but using the UVLOOP rather than the standard AsyncIO loop. And this will then use the ASGI interface rather than the WSGI interface, which is the standard web server gateway interface used by Flask and Django and everyone else. The reason that this is so important is all of Sosanic, for example, it kind of has to mangle AsyncIO on top of WSGI, which is never designed for Async. So yeah, I would definitely check out UVCorn, but I know it's not ready yet. Tom actually tweeted a couple of days ago. I've seen that he thinks it's not ready for prime time, but I think it's definitely going to be a promising option for the future. And with that, I think I'm actually ready for questions, which is good, because I'm almost out of time. So I'm not sure we have time for questions. Thank you. We don't have time for questions, but this is actually the last talk in this hall, so please. Did you try and manage to success configuring WebSocket Secure? Yes, so the example I had was actually using WebSocket Secure. So Herucu magically made the app run HTTPS for me, and it's using, so you can see... In the top line there, it says it figures out whether it should use WSS or WS as a protocol for the WebSocket connection. OK, we have problems with that on Sonic, so that's what I'm asking. But yeah, it seems to just work, which is great. I had very little to do with it. Can you show the configuration file somewhere? Pardon? Do you have configuration files for Sonic? So where do you provide the certificates? So because I ran it on Herucu, it's all handled for me. OK, so that's a different case. I had a question. So maybe you've picked Sonic over, for example, AO HTTP for speed, right? No, not necessarily for speed. I actually tried AO HTTP, which is one of the, I guess, other more popular frameworks. So I only experimented with it for a short time, and I think it was probably more just the API. I'm not sure how similar it is. I'm afraid I can't remember the comparison well enough now to comment, really, but I just found it didn't enjoy it as much, perhaps it's the best way. Or it wasn't as easy to get started, perhaps. OK, so do a quick follow-up, maybe comment or call for comments. So do you feel that we are getting too many frameworks? Or maybe we should focus, for example, on creating libraries, so every other framework doesn't have to, you know, repeat mistakes of every other framework, for example, in the comments.  I don't know, the answer is kind of yes and no. I do think this is why Tom's project, Uvicorn, is important, because it's implementing the base layer in, I think, a more correct way. And then maybe over time something like Sanic could move to that, and then hopefully they could then remove a bunch of the nastiness they've had to do. And maybe ARO HTTP could do the same. So, yeah, it's hard to say, because I think also there's a lot of innovation going on at the moment, so it's important for people to experiment in different ways, but I think over time we will start to converge together, hopefully. Thanks. How do you deal with logging in a synchronous environment? That's a good question. I'm not sure if there's any particular, I've not done anything particularly special with it, to be honest. I maybe need to check my logging's not working. Check my logging's working, okay. I'll actually try to answer this here. Maybe you can actually try to keep a unique request ID for each request, and then include it in all the logs so they can actually combine, and see all these are all connected and isolated from the other one. Anyone else? I can answer the one regarding logging. So Sanic has implemented logging, so you can just import logging library and do logging.emit, and that's the new Python 3.way. It's very hard to overwrite the default logger. I tried and failed. But you can also pass the configuration for the logger like from the dict, that's also used by other Python applications. Configure from the dict. The same syntax, the basic library of Python. Okay. Thanks a lot, Google. Great job.