Welcome back everyone to our lecture series Math 3130 Modern Geometry for students at Southern Utah University. As usual, I'm your professor today, Dr. Andrew Misadine. It's good to have you. In part 31 of our series, I want to talk about today the axioms of area. Throughout this course, we've talked about a lot of undefined terms such as incidents, points, lines, between, congruence. I think that basically covers most of them. Maybe I missed one or two there, but it turns out that's just the tip of the iceberg on the type of undefined terms we could have in a geometric axiomatic system. Today, we're going to talk about yet another undefined term, the notion of area. After all, if you had to explain to someone what area is, do so. Could you do it really quickly without using really synonyms to describe it? Areas, how much stuff is in a two-dimensional figure inside it? It's not so easy. In fact, we're going to treat it as a logically undefined term for axiomatic system. I want to talk about this today about area in general congruence geometry before we talk about area of hyperbolic geometry in the next lecture. With this undefined term area, we try to make meaning out of it using our axioms. First of all, by area, we mean a function from triangles in a congruence geometry to a unique real number, which of the triangles denoted ABC, we'll call it the area of the triangle ABC. We'll often use A to denote the area when it's clear from context. In which case then, we have to define axioms so we can understand what this undefined term means. For area, there's essentially three axioms. The first axiom we'll call it the positive axiom, which says that the area of each triangle is a positive real number. I had mentioned earlier the areas of function. That's really putting the cart in front of the horse there. The positivity axiom of areas specifying that associate to each triangle is a positive real number, which we call area. Axiom 1 is a definition of what we mean by this undefined term, but that seems backhanded there. Really, that's what we always do with axioms. We're giving meaning to the meaningless, the undefined terms there. Area will always be a positive real number. No triangle can have zero area. That's not a triangle. No triangle can have negative area, not even situations like hyperbolic geometry. Now, admittedly, one only needs a notion of congruence in order to define area. These area axioms, this area undefined term, will make sense even when we are in places like elliptic geometry and we don't have the full-blown axioms of neutral geometry. The second axiom of area we're going to call it congruence preservation. It gets not the most clever name out there, but it'll serve its purposes. This axiom tells us that if two triangles are congruent, then they will have equal areas. After all, area is a real number, and so we can talk about equality of those. Congruent triangles will have equal areas. And lastly, the third axiom, the additivity axiom, tells us that if we have a point D that sits between A and B, then we can actually dissect the triangle into two pieces. I should have left myself some space here on the board, but let me kind of sketch out what I mean by this. So if we have a triangle whose vertices are A, B, and C, and we pick any point that's between one side, if we pick a point between two vertices of the triangle, so D sits between A and B, if we consider the two triangles, so we cut this in half along that median there, then the triangle A, D, C, if we take its area, which is a number, and we add it to the triangle D, B, C, the sum of the, so we take the area of this one and the area of this one over here, if we add these two areas together, we retain the area of the original triangle. So that's our additivity there. Now in terms, so area is a defined, I should say areas defined for triangles, but we can extend this to the area for polygons in general, because after all a polygon is just going to be a union of triangles, maybe something like this. Just as an example of a polygon, well as this triangle has area, so does this one, so does this one, so does this one, each of these triangles has an area, and as the polygon is the union of all of those triangles, we'll take the area of the polygon, so the area of our polygon is just going to be the sum of the areas of each and every one of the triangles that shows up in this sum. And in fact, this way of defining area for a polygon is going to be a well-defined notion, because after all when one has a polygon, there could be multiple ways, multiple different ways of partitioning the polygon into triangles. Well, as two different partitions by triangles, we'll always have a common refinement. Because of the additivity principle, every refinement will have the same area as the original partition did, and so since partitions have common refinements, we see that area will be well-defined. And this sort of this way of extending area to general polygons and getting that the area as a well-defined function for polygons, this reason is the exact same reasoning we used to extend the notion of defect in hyperbolic geometry from triangles to polygons and showed why defect is well-defined for all polygons. And the arguments there are essentially the same. What we're going to see, we'll talk about this in the next lecture, but what we're going to see is that the hyperbolic defect function actually satisfies the axioms of area, and therefore bizarre as it might seem, defect is an area function in hyperbolic geometry. What I want to do today, though, in this lecture is focus mostly on area in elliptic geometry, but let's first kind of continue on with this general notion of area in geometry. We say that two polygons are equivalent if there exists a partition of adjacent, non-overlapping triangles for each polygon such that there exists a congruence preserving one-to-one correspondence between the triangles among the two partitions. It's kind of a mouthful there. But the idea is if we can take a polygon and dissect it into, you know, let's start off with say a triangle, right? If we cut that triangle into two right triangles like this, right, and then we copy, we sort of like copy and move pieces around, you know, let's say we don't want it, we don't want this poly, or this triangle on the right, let's say we cut it off, and then we move it, say like down here or something, something like this. This polygon we've created, this was a quadrilateral now, this new polygon is equivalent to the original one. We just dissected it and moved some triangles around. That's what we mean by equivalence, that there's this congruence one-to-one correspondence between the triangles and the two different partitions. Well, from this definition of equivalence, we can actually state a theorem relevant to area that polygons that are equivalent, that is polygons are equivalent if and only if they have equal area. This having equal area gives an equivalence relation on the set of polygons, that makes sense. And it turns out that this notion of equivalence we just defined on polygons is the equivalence relationship defined by area. Now, equivalence implying equal area is fairly straightforward. I mean, there is an argument that has to be made there, but it's a pretty quick application of the area axioms that I'll leave for the student to do here. But the basic idea is by the congruence preservation axiom congruent triangles will be have equal area. And so if two polygons are equivalent, there's this congruence one-to-one correspondence between the two polygons looking at these sub triangles. Well, that that congruence correspondence will those we equal areas for each of the triangles involved, it's the same number of triangles. So all of those are there. Additivity of a polygon, that is the activity area of a polygon, you add those up, that's all equal. That direction is pretty easy. The other direction is much more challenging to show that if two polygons have equal area that they're equivalent, because after all, if they are polygons, we don't necessarily have to have the same number of vertices and such, you have to find some way of constructing this one-to-one congruence preservation between the triangles. It's certainly doable. It's a very lengthy combinatorial argument. It comes down to like intersecting triangles and triangles overlap triangles. You get more triangles and quadrilateral. There's a lot to it. I'm not going to provide the detail here. Intuitively, it kind of feels clear that's not a good enough proof technique, but that'll be sufficient for this lecture series here as well. And with that, we actually can talk about what we've got an area geometry. If we have a congruence geometry that satisfies the three axioms of area, then we call it an area geometry. And honestly, when I say congruence geometry, I even am willing to accept a weaker notion of congruence geometry than we originally defined, because the way we've defined the congruence geometry to remind you is we took Hilbert's axioms of incidence, then we stacked on top of that the axioms of order or betweenness, depending on what you want to call them. That gave us an order to geometry, and then we stacked on top of that the six Hilbert axioms of congruence, and that's what we call a congruence geometry. In order to define area, all one has to do is we have to know what a triangle is. That does come from the order axioms or triangles is the intersection of three angles, angles has to do with betweenness. We need betweenness preservation. So we do not know we need to know what congruence means. So as long as we have a strong idea of what congruence of triangles is, that is what congruence of triangles means, then we have a notion of area. And so that's what we mean by congruence geometry, we just need to know what congruence of triangles are. And so the side angle side axiom is basically what we need to have. And so we need to have a geometry for which side angle side makes sense. And we define triangles using order, but one can define what a triangle is without using the Hilbert axioms of order, like in an elliptic geometry or spherical geometry, we can talk about exactly what we mean by a triangle, even though betweenness doesn't quite work, trichotomy fails, for example, if you're on a sphere. And so in that context, we can still have area, and we'll actually talk about elliptic area a little bit later. So just a little caveat here, when we talk about congruence, we just need to have congruence of triangles. And then we get an area geometry. We'll revisit this issue when we come back to, when we come back to elliptic geometry later this semester, or I should say later in the series. So I want to take, take the rest of this lecture and kind of focus on Euclidean area. And that terminology itself might seem very alien to the student right now. What do you mean by Euclidean area? Is area a Euclidean thing? And the answer is absolutely yes. I mean, because first of all, when I ask you what's the area of a rectangle and you reply base times, base times width there, or base times height, length times width, whatever you want to call these two dimensions there, it's the product of the two dimensions, really your price should have been, what's a rectangle? You know, the fact that we're talking about rectangles means we're talking about Euclidean geometry. Rectangles only exist in Euclidean geometry. So if that kind of makes sense, okay, the area of a rectangle is Euclidean, but what about like a triangle or a right triangle or parallelograms? Those things exist in hyperbolic geometry and other non Euclidean geometries. Can we talk about area for those as well? And we will, but the area function will be fundamentally different in like, say hyperbolic or elliptic geometry compared to Euclidean. And in fact, the classic formulas that we know from geometry class will in fact only be true in Euclidean geometry. So let's kind of first start off with, if we're in Euclidean geometry, why does the area of a rectangle have to be length times width? Is there anything that determines that? Well, if we start off with a rectangle, so we'll take the rectangle ABCD, which I'll draw for you on the screen. So this is a genuine rectangle we're in Euclidean geometry. So we have these four right angles, like so. Whoops. Let me fix that. And so we'll, so we have a specific length of the rectangle. So let's say that the side AB, we'll call that the length of the rectangle. And let's say that the side CB is its width. Now, because rectangles are parallelograms and Euclidean geometry, opposite sides of parallelograms are congruent, it doesn't matter which side we talk about the length of the width. There's a little bit of ambiguity there normally, but Euclidean parallel posture gives that the length is well defined, whether we mean AB or DC doesn't matter. And width as well, we could talk about BC or AD didn't matter. So what we're going to do is we're going to take one nth of the length. So take your pot, your favorite positive integer, and we're going to find points. We can find points say BN between A and B, and CN that sits between D and C, so that the length of the segment ABN is exactly one nth of the segment AB. That is, it's one, it's L over N. So we can divide the length like so. And so because, so we get something like this, and at the moment we see now we have a secondary quadrilateral because this side right here is going to be congruent. So ABN is going to be congruent to DC and how do we know that? Well, because we have still a parallelogram, let's see, do we know what's a parallelogram yet? We do know, well, I guess I might take it back, we don't have to worry about parallelograms all yet. We do know we have two right angles from the original rectangle, and we chose the points BN and CN so that the corresponding side lengths are congruent to L over N. So they'll be congruent to each other. Since we have a secondary quadrilateral in Euclidean geometry, that does force that the summit angles are right, and therefore we have a rectangle. And by the additivity principle of area, because we did this once to get one, we got a rectangle, but then we could kind of tile the original rectangle using these congruent these congruent rectangles. And so by additivity, we're going to get the area, the area of the original rectangle, ABCD, this is going to equal one or N times the area of these smaller ones, ABN, CNDN. And this comes from the additivity of those. Since, well, additivity and congruence preservation, because we can tile using congruent rectangles here, here, here, all along the way, we can tile the original rectangle using congruent smaller rectangles. And so then we get the area, the larger one is one and the smaller one as the smaller one we did. And so this right here is essentially using the notion of similarity that exists in Euclidean geometry.  I'm talking about the similarities of the polygons, the smaller rectangle is similar to the larger rectangle. Well, I mean, not I should be careful here. I mean, it's not the lengths, the lengths are similar, the widths are actually equal to each other. We didn't shrink those down at all. So it's not exactly proportional in the way I usually mean by similarity here. But but in Euclidean geometry, you can take smaller versions of the things, again, only distorting the length, not the width. But you can tile, you can tile rectangles using smaller rectangles. Tile ends and hyperbolic geometry are fundamentally different. Tessellations, those type of things, but we can tile a rectangle using smaller rectangles. And so that gives us this relationship that the area of the bigger rectangle will be in times the area of the smaller one. Well, we can do that with the length, but we can also do it for the width.  And so then we get another rectangle, which is going to be one inch of the original one. And so this smaller one will be proportional to however small we want them to be. It's going to be small, small like that. And so because because when we put these things all together, then the area, the what am I trying to say here, the length of a rectangle is directly proportional to the area of the rectangle. That's what I'm trying to get from this first statement right here, that the the length is proportional to the area. And likewise, the width would be proportional to the area as well. And so therefore, we come to this equation right here, the area of a rectangle, it'll be proposed jointly proportional to the length and the width. Right, that's what we see right here. And then we have this proportion constant whenever one has, whenever someone has a proportion, we have a constant that measures how close the proportions relate to each other. All right, and this proportionality constant k is arbitrary. And in fact, it defines a measurement scale, you can think of. For example, if anchor of acres is our desired measurement for area, you know, people who have farms and houses like to measure their property size and acres, we could measure distance and miles, which then would be appropriate to measure area also in square miles. But if we want to measure an area, right, what's the conversion from a square mile to say an anchor, right? Well, the area of a rectangle would actually look like a equals 640. So with this example right here, the area looks like 640 times length and width, where length and width are being measured in miles, but a is being measured in acres. And the idea here is K, your your proportionality constant is just the conversion of 640 acres per square mile. Now, often in practice, though, we will measure area as a square unit of length and the same length that we use to measure the same distance I should say to measure the length and width of the rectangle. And therefore, in that situation, you often take K to equal one. And in that setting, you then regain the usual area formula for a rectangle area's length times width. And so because of the because of the proportionality arguments we can make about rectangles in Euclidean geometry, the area of a rectangle has to be length times width. And so this in some regard could be taken as an equivalent to the Euclidean parallel postulate. From this important formula, that is the area formula of a rectangle, we can recapture in fact all all of the usual area formulas of polygons and other various geometric shapes. So one could find the area of a right triangle of a standard triangle of a parallelogram of a trapezoid of anything you could think of. All of these things come from the area formula of this rectangle. So I want to illustrate this with showing that the area of a parallelogram is equal to the product of its length, the product of its base and its height. So we have to be a little bit careful, we understand what these words even mean.  So by base of the parallelogram, what we're talking about is really just one side of it, the length of the side. And when one draws this parallelogram, we typically refer to the base as the bottom side, assuming there is a vertical side, the base. So we did a similar thing when we talked about security quadrilateral is the base. Now the height of the parallelogram is the distance between opposite sides of the parallelogram. And as the name suggests, opposite sides are parallel and Euclidean geometry, this distance, which we might illustrate like this right here, this distance, the height, it doesn't matter which points you choose, because parallel lines and Euclidean geometry are equidistant. And so the distance between one point of the line is the same as any other point of the line. And so when we talk about if you call say the base little b and the height little h, then the area is going to be base times height, which is essentially the same thing for rectangles. After all, rectangles are special types of parallelograms for which with a rectangle, the height is actually a side length of the rectangle. And the base is always a side length. So this gives us the formula we had before. So with that in mind, we can be clear of what we're trying to say when we say the area of a parallelogram is base times height. So let's, let's let's prove this formula. Now, if we had a rectangle, we would be done just like I said a moment ago. This, this formula for the area of a parallelogram generalizes the notion of rectangles. So we don't have to prove it for rectangles. So let's assume we have a non rectangular parallelogram, much like I drew before. So and so if it's not we are in Euclidean geometry, the angle sum of this parallelogram has to add up to be 360 degrees. That's true because we are Euclidean. And for parallelograms, opposite angles are congruent. So like angle C is congruent to angle B, right? And angle D is congruent to angle B right there. And so if one of the if we have a parallelogram and one of the angles was right, let's say for example that angle A was a right angle. Well, that would mean that angle C is also a right angle. And then between B and D that still remains 180 degrees to be accounted for. But since B and D are themselves congruent, you have to have two angles that have to be 180 that are congruent, they'd have to be right angles as well. So if a parallelogram has one right angle, then all angles are going to be right. And that's that's equivalent to Euclidean parallel postulate. But we're in Euclidean geometry, so we're using that fact right now. All right. And so what I'm trying to say here is if we're non rectangular parallelogram, we can assume that some of these angles are acute and some of them are obtuse. The way that I've drawn this picture, we can assume that angle B and angle D, which they're congruent, we can assume those are the obtuse angles. And then therefore A and C would have to be acute. All right. And so with these, with this situation in mind, let E and F be the feet of the perpendicular lines dropped from D and C onto the line AB. So the foot of the perpendicular drop from D, we're going to call F. And then the foot of the perpendicular drop from C, we're going to call E right here. And so as the picture seems to suggest, F is between A and B, and B is between F and E. This is actually why we cared about the obtuse angles before. By assuming that D is an obtuse angle, this will guarantee that F is between A and B. And this also will guarantee that B is between F and E. There is a between this argument there. But if this weren't true, then it would force the quadrilateral to have an angle some greater than 360 degrees. Or basically, we could construct a triangle, which has an angle some greater than 180. So really, the fact that D is obtuse will guarantee this picture even in hyperbolic geometry, even, even though we only care about Euclidean geometry right now. So because this parallelogram is Euclidean, opposite sides of the parallelogram will be congruent with each other. So in particular, the side AD is congruent to BC. Because the, because parallel lines are equidistant, the line DF is congruent to CE. And as these are right triangles, the hypotenuse leg condition applies and guarantees that the triangle AFD is congruent to the triangle BCE. So we got this triangle here, and this triangle right here, they're congruent to each other. And so if we, if we focus our attention on now the quadrilateral FECD, so Foxtrot Echo Charlie Delta, which I'm coloring here in yellow, this is going to be a secondary quadrilateral, because angles F and E are right. And we have that's the the equidistant lines DF and CE are the same. That's what we meant by equidistance between the parallel lines there. So we have a we have a secondary quadrilateral, it's Euclidean, so it has to itself be a rectangle, like so. You'll notice that once the top side of the rectangle is none other than I mean, it's equal to DC, which is congruent to AB, which was the base of the parallelogram. And then the side lengths of this rectangle is just the height. The other the other side of the rectangle is the height of the parallelogram. So you'll notice we've now constructed a rectangle whose area is base times height, right? But this rectangle we've constructed is equivalent to the original parallelogram, because basically we just took this triangle ADF, and we move it over here, because BC is congruent to it. And so the rectangle we formed is equivalent to the parallelogram we started with. And therefore the area of the rectangle was base times height, which will give us the area of the parallelogram. And so this kind of can show you the importance of equivalence equivalency in terms of area. If you have an area problem, that's hard to do. You can always dissect it, move some triangles around our other polygons around to something equivalent. And go go from there. A common argument that we can use in hyperbolic geometry is to take a triangle and to replace it with its equivalent secondary quadrilateral. That's a topic we'll talk about another time here. So the last thing I want to talk about here in this lecture is the idea of a shearing map. Because I mentioned before that all of the area formulas we know from Euclidian-Jomchi can be derived from what we already know about rectangles. We just proved something about parallelograms. You can prove the area formula of a triangle is one half base times height, basically from the argument that a triangle is half of a parallelogram. Again, there's some details to provide there, but I'll leave it for the student to finish that up. Area formulas for everything else will come from those. Now that'll take care of the area formulas for polygons. If you're talking about areas of general regions like circles and other sort of non-polygonal regions in the plane, you might have to use calculus to talk about the areas of those things. And if you're doing calculus, you need some type of continuity axioms such as like the Dedekins axiom, for example. So we won't delve into all of that, but if you think of like in calculus one, calculus two, the Riemann sum, the area under a curve, you can approximate the area under the curve using rectangles. And then you take the limit as the number of rectangles goes to infinity. That gives you the area of the region. Those integral problems you do in calculus come from areas of rectangles. And so all of those even non-polygonal regions, the area is derived from this Euclidean area formula. So let's talk about the idea of a transvection or a shearing map. What do we mean by that? Well, a shearing map is one that distorts things in the plane. I should say displaces things in the plane according by some type of angle here. So let's say we have an axis, which we could think of as like the x axis. And we're going to take some to shear, say horizontally by a certain direction. What this does is you're going to proportional to how far above the x axis you are is how far you'll move. So if you're one unit above the x axis, you'll move one unit to the right. If you're two units above the x axis, you'll move two units to the right. If you're three units above the x axis, you'll move three units to the right. And if you kind of connect these dots here, people who live on the x axis don't get moved whatsoever. But people who are below the x axis, they are going to move to the left proportional to how far below they are. So that's what this definition means by the signed distance. It occurred to me I never actually read the definition here. In plane geometry, a shearing map is a map that displaces each point in a fixed direction. What I have illustrated here is a horizontal displacement by amount proportional to its signed distance from a line that is parallel to that direction. So if we're like, oh, we're going to shear things horizontally, we take the x axis as this directional map, it's if we're horizontal, that means we're parallel to the x axis. And based upon how far above or below the x axis will move things to the left or right. You can share, of course, in any direction with any axis, we'll think of the x axis right here. If we try to think of how Euclid thought of these things in the elements, if we could think of this in terms of like parallelograms, we could say that a parallelogram has been sheared is if you take the original parallelogram A, B, C and D something like this. And so if it's a parallelogram, that means opposite sides live on side of parallel lines. Well, if we keep one of the sides fixed, so we keep the base fixed, and we take this segment right here DC, and we translate it somewhere else down the line, keeping the same length that we did before. And we connect the dots. We will make a new parallelogram. And this new parallelogram is a shear of the first one. And of course, we can do this for general polygons as well. But this is how one would could share a parallelogram. And one thing that that Euclid noticed and he proved this in the elements is that when you share a parallelogram, the area doesn't change. Just so you're aware that in linear algebra, if you want to shear, this would be multiplication by a map of the following form 1m01. This is a horizontal shear in the m direction. And these things don't change the area of the parallelogram. In linear algebra, this is realized by saying that the determinant of this matrix is one and in determinants is a way of measuring area in linear algebra. But I'm not going to say too much more about that. So let's talk about how the area is invariant when one shears it. What's a geometric argument for that argument I was making earlier about linear algebra. So it suffices to look at the unit square, because if we can show that the unit square, its image is going to be one squared unit, then this will be true for all regions in the plane here. And so let's say we shear the unit square, it is a square after all. And so there's basically two pictures you get if you shear the square up to like reflections and symmetry and things like that. Let's try this again. So let's start off with the unit square, which you see illustrated right here. So we're going to label it A, B, C and D. And let's shear it. Let's shear it in the following manner. And so we get that we have some point E right here, some point F right here. And so we have this parallelogram right here, that's a shear of the unit square. So we want to show that these two things have equal area. That's one possible picture you could have. Another possible picture, another possible picture you could have is something like the following. So let me sketch that real quick. So we get our unit square again, trying to be conscious of how I label things. So if you compare the two pictures, you get something similar. So you get this, it could also be that the shear, and I should have done this side up here in red. It could be that when you shear, you get something like the following. And so the issue is basically the following. In turn, how are the points D and E related to each other? When you look at the top line, do we have A, D, E, F as a between this relationship, or we have a dash E dash D dash F, both of these pictures are possible, and we have to consider them and up to without the loss of generality, these are the only two pictures that are available to us. Now, because we do have parallelograms and opposite sides are congruent, we do have that A, B is going to be congruent to DC. This is true for both situations. We have that be will be congruent to CF. Again, this is true, whichever the two situations you're in. And then the last part is that BC will be congruent to AD, which is its opposite side. But BC is also the opposite side of the parallelogram EF. So we get that EF is congruent to AD, which will be useful in our observations here, because they're both congruent to BC. So AD was congruent to BC. We mentioned that one. And what else? Yeah, let's go on from there. So if you look at the first picture where E comes after D, what's going to happen is these lines are going to cross at some point, we'll call it G. And so if you use that point G introduced right there, consider, it's going to be the intersection between AF, I'm sorry, not AF. It's going to be the intersection between BC. I might have labeled my points a little incorrectly here. Sorry about that. Not BC. We want BE and we want DC. I have to double check those later. And so I hope my other things aren't labeled so incorrectly here. But if we look at the triangle AFD, yep, that's not right. Sorry about that. What triangle we mean would be the following. Let's take the triangle. Well, there's a couple triangles we want to look at here. But if you take the triangle ABD, this one right here, it is congruent to the triangle DCF. So we have a congruent to triangles there, DEF. And those are congruent by side, side, side. Right. And I think I fixed the typo before I started the lecture here. I think it should be correct what I'm trying to say right here. And so trying to figure out which triangles I'm interested in here. The triangle ABE should be congruent to DCF. So let's go back in time a little bit and see what I meant. So ABE, ABE is congruent to DCF. So ABE is congruent to DCF. Okay, that was the picture I was trying to draw earlier. Is that even correct? Well, I'm perplexing myself right now. I'm sorry about this. I'm going to fix these. I'm going to fix these typos in the lecture notes. Because there's some issues going on here. I apologize for that confusion. But basically, what we're trying to get here is that when you look at the triangle, or look at triangles here, you get a triangle here, you get a triangle here, those are congruent triangles, whatever their labels are, you get this triangle right here is congruent to itself. Notice how this yellow triangle is part of both parallelograms. And then you have this little guy as well. It's kind of part of that's involved in both of them. So you're taking a difference.  And so you can argue that this square we started off with is equivalence to the rectangle by some dissections. And like I said, I will fix these in the notes to make sure all of these vertices are correctly. That's if you're in the situation where E comes after D. If you have the situation where E comes before D, it's basically the same idea where you take this triangle right here, which is equivalent to this or it's congruent to this one. And so by moving those around, you get equivalent things again. And so the shearing of a of the shear of any map will be equivalent to the original one, despite my little typos in the proof there. And so shearing will be shearing maps will always be will always preserve area there. And so it's really kind of interesting to see that the existence of arbitrary rectangles, which is an equivalent statement to the Euclidean parallel Bachelet, in conjunctions with the area axioms is sufficient to prove the traditional area formula. And then all the other area formulas can be derived from the area of a rectangle. So our usual notion of area can thus be described as Euclidean area. And the conference is also true that in an area geometry, it's Euclidean if and only if rectangles are proportional to its length and width. Next time I want to talk about area of hyperbolic triangles and hyperbolic area just in general. And we're going to see it's very, very different from from our notions of Euclidean area. And so that concludes our video today. I want to thank everyone for listening. If you liked what you what you what you saw here, feel free to subscribe. Make some comments. If you have any questions, please comment below. I have a link in the description of this video to give you a script of what we saw here, which will be updated since this video had some errors in this very last proof. So take a look at that sometime if you're interested. And I'll see you next time. Bye.


إن الحمد لله نحمده ونستعينه ونسوفه ونعود بالله بمن شروري أنفسنا ومن سياد عمالنا ما يهده الله فلا مُضِلَّنا وما يُضِلْ فلا هدِلَه واشَلُوا الله إِلَا مَا إِلَّا الله وحده لا شريكَنا واشَلُوا أننا سيدنا وحبيبنا مولانا سيدنا محمن العبده ورسوله خير النبي إن شبه وهدى للعالم اللي أرسله أرسله الله وبيلين الحق ليدر عدين كله ولو كريه الكافيرون اللهم صلي وسلم وبارك على سيدنا وحبيبنا مولانا سيدنا محمن وعلى آله وأزواقه وغورياته وأصحابه واتابرين بإحسان إلى اليوم اللي أما باري باد الله وذكركم وإيايا بتقوى سبحانه وتعانه وذكركم من خوله سبحانه وتعانه في القرآن كريم هدى قول يا أي والدينة أمر اتطل الله حق دخاته ولا تموتون إلا وأنتم مسلمون وذكركم بيخذ في سيدنا محمن صلى الله عليه وسلم بهدى القرآن الكريم السلام عليكم ورحمة الله وبركاته أن crosses are there if we are hosting this most honored and most generous guest a guest thanks to the warehouse once a year for the duration of a month the guest arrives at an appointed time and departs at appointed time the beauty of this guest is that it brings the most sought after gifts for the one desiring Allah سبحانه وتعانه it brings Allah's mercy and generosity ويخبرها إلى أمريكين الذين يُدعونهم. يأخذ أفضلهم في يومنا، ويأخذ الأمر ويأخذ أمرهم. يكافنا من الإهل العام and يتكففنا من شيخان ويخوضه. يأخذ أمرنا فيه العمر ويأخذ للمعاة ويأخذ الأمر والصتحة الأخيرة من المجتمع الأنجل من سبحان. اليه أن المجنون I've been talking about the month of the pre-dancer who were made, and Meel at the end of the day of Ithkha, it is a month when deeds are multiplied, the month of Qiyam and the restful evening prayer.  In Sha'a al-A'ala Allah will give us the ability in upholding the obligations in honoring this guests among the Amin. وإن أسواف الأمرسة من الله التي أننا مقابل لتعلم أننا نقابل لتعلم هذا المقابل وعلى أخرى who have residence in proximity to this place do not have that honour of hosting this guest خلص لك من المفترضة اللهم الذي قلت على أثورية سلمان فارسي وخلصة أن الناس للبطار والسلم الله ورسلم  minist was said that this last month has come upon you a month containing plenty which is better than a thousand months Allah has made fasting obligatory during it instead the Stealth interfere in its knives and worship as a voluntary act whoever undertakes an act of obedience during the month with a righteous deed it is if he is performed an obligatory act ومن who performs obligatory act wearing it is one who performs 70 obligations in other times It is a month of patience, and the reward for patience is paradise And Allah makes us of those people It is a month of goodwill during which provisions are multiplied The Prophet ﷺ continues in this hadith by saying whoever feeds a fasting person will be compensated with forgiveness of sins and salvation of his soul from hell He will also receive a reward equal to the person of that person that he feeds without causing them any reductions The Prophet ﷺ said or the companion said is the Messenger of Allah ﷺ Not all of us have the ability to feed a person The Prophet ﷺ said that Allah gives a reward Whoever feeds a person with even just a taste of milk or a date or a drink of water Whoever crunches the thirst of a fasting person Allah ﷺ will make them drink from my pond ﷺ That which you will never feel thirsty again until he enters the paradise It is a month whose beginning is mercy, whose middle is forgiveness And whose end is emancipation from the Hellfire May Allah allow us to be hosts that will give honor to this guest I wanted to use that as setting a precedent For, Alhamdulillah, what we are experiencing now In almost 48 hours as we approach our second day of Ramadan However, my message is this My message to all of us who have transgressed against our souls We all came into the month with high hopes for this Ramadan And we want this Ramadan to be different We want to get out of the shortcomings that we find within ourselves And all of us have set goals for this month But only two days have gone by And perhaps we find ourselves still attached to those bad habits And our first response may become angry with ourselves We promise ourselves that we would make all of our prayers on time We promise that we will be patient with people We pledge to Allah SWT That we will leave off those things in our lives That we know our major wrongs But yet they stare at us every day in the face We are struggling with our prayers perhaps Shout out a loved one A mother, a spouse, or a child But then we ask maybe what Ramadan is Not for people like myself Because I always mess up three single time The fact that the devils are locked up this month I think maybe has no impact on me I'm referring to the Hadith here That puts Ramadan squarely The reality and the obligations of Ramadan Squarely with myself The Hadith that the doors of mercy of Paradise Are flung open and the gates of Hell are locked So Allah sends forth out His mercy onto this Earth And holds back the evil that comes out Of the Hellfire Those baseless misgivings The Whispers, the Shi'aqeen being locked up That means that the reality of Ramadan The reality of those blame-worthy things That I see inside myself The negative aspect that I see inside myself Is not She'a Haan, that is me That is me Alhamdulillah this month Gives me a blessed opportunity Of 29 or 30 days To come to know myself at a deeper level So Alhamdulillah Just as we go to the physician And they give us an analysis of our health This is now the ability to find out Where we stand in a relationship With Allah SWT A person may ask themselves Contemplating Giving me to those misgivings of She'a Haan Maybe I'm a lost cause Maybe there's no hope for me Maybe I don't deserve the blessings In the mercy of Ramadan Maybe Allah SWT is rejecting me Perhaps all of these doubts enter into our minds If this describes any of the feelings that you are having Then you have misunderstood the reality The reality is that Ramadan was made For people such as this It was made for this person with shortcomings And sins that stands in front of you right now Because Allah SWT Says أصرفه على أنفسهم لا تقنكوا من رحمة الله إن الله ينفروا الغلوبة جميعا إنه هو بفور الرحيم Allah SWT says in Quran And this is the month of Quran Allah SWT says in the Quran And this is the month of the Quran Say, oh my servant Who have transgressed against themselves Do not despair of the mercy Of Allah SWT Do not despair of the mercy Of Allah SWT Give glad tidings to each other For the mercy of Allah SWT Give glad tidings that Allah SWT Gave us life to be in this month Give glad tidings that Allah SWT Put us in this community That is filled with love and mercy And generosity Allah forgives all sins The verse continues Indeed it is He who is forgiving The merciful Sometimes we are harsher on ourselves That Allah SWT Wants us to be We punish ourselves By telling ourselves That we do not deserve the mercy Of Allah SWT And that makes us give up on both ourselves And on God And on His mercy Allah SWT But know this That Allah SWT Allah SWT's mercy is not deserved Rather it is given to all Especially those of us who are struggling Who are trying In spite of everything In spite of all the challenges That we have in our lives In spite of the situation That have happened to us in the past That Allah SWT Is there for every single one of us Allah SWT says in the Quran ورحمة وصعب كل شيء That my mercy encompasses all things And that mercy as I said before As the Prophet SAW Reminded us That that mercy has a special place During this month of Ramadan الحمد لله May Allah SWT Give us the ability To avail ourselves To His mercy in this month Not like we do at other times But in a special place During these special days In these special nights Along with my army The Prophet SAW Have said In a hadith That some have Categorized as weak But in our tradition With فضال عمال It is appropriate And it is legally sound To narrate a hadith If it is weak For the benefit of people The Prophet SAW رحمة وصد عمفرة وقيرو That the first half The first ten days of Ramadan Are mercy Mercy pouring down In a manner That it does not pour down In the other days Of this year Making it unique May Allah allow us To avail ourselves To those mercies The Prophet SAW Has said That Allah SWT The status that He gives us Whoever observes In mercy During the month of Ramadan Out of sincere faith And hoping to attain Allah's reward That all His past sins Will be forgiven All of His past sins Will be forgiven This should reach us At our core This should reach us In peers All of the doubts That we have And make it into our hearts That that is Allah SWT That we are here That that is the month That Allah SWT Has written for us To be a part of here And may Allah Give us life To see the end of this month May Allah Give us the ability To see the end Of this month Alhamdulillah These are the gifts From our generous Lord So we need to Let things go Of that month That which has passed Is gone What we have is right now Let go of the anger That we feel towards ourselves The self-doubt A criticism That is not beneficial Let go of these feelings Of unworthiness That somehow I am not worthy Because it's a trick Of the lower self It's a trick of the nuts The more we antagonize Ourselves The less that we will do The more we have hatred Towards ourselves The more we will give Into our base desires That pull us away From Allah SWT It's a vicious cycle The iman That Allah has given us Allows all of those doors To be locked It is only these doubts That creep in That will cause the door To be opened When we talk about this idea This concept Of some of the conversations That I have With some of the youth If they trust this idea Of not being worthy It means that they don't know Their relationship Visibly Allah SWT Perhaps those doubts Of thoughts That they may have About themselves About being unworthy Of all any of us Have thought about this It's not coming From Allah SWT Because Allah SWT Says That Allah SWT Has said that I have honored the children Of Adam We are in honored And blessed state And on the Guidance Of Ali And Paul He pleased with him We don't have to wait Until the end Of Ramadan For it to read Because he said He said He said that Every day Is a day of Eid For the one Who is obedient To Allah SWT Every day Is a day of celebration Every day Knowing That our rewards Are accruing In a matter In which we can't even Comprehend Subhanahu Wa Ta'ala Pouring on his generosity In this time Allah SWT Subhanahu Wa Ta'ala How can we move away From Perhaps these doubts Or these thoughts Or these bad habits That we have Brought into our efforts One of them Is having complete trust In Allah SWT One of the things That I have found In the work That I have been doing Over the years Is that a person Has complete affirmation That Allah SWT Is the forgiver And they have Complete affirmation In the mercy Of Allah SWT And they will affirm All of the verses And they will affirm All of the حديث Of the Prophet Speaking about The Divine Mercy Of Allah SWT But the challenge Is that they Cannot forgive themselves But look What the Prophet Reminds himself He said A person Can commit sin A person Can commit sin And said My Lord Have sin Forgive me His Lord Said Is my slave Acknowledging That he has a Lord Who forgives sins And punishes For them I have forgiven My slave That as much time Past Is Allah SWT Willed That he committed a sin And said My Lord I have sin Forgive me His Lord said Is my slave Acknowledging That he has a Lord Who forgives sins And punishes For them I have forgiven My slave That as much time Past Is Allah SWT Willed That he committed a sin And said My Lord Forgive me His Lord said Is my slave Acknowledging That he has a Lord Who forgives sins And punishes For them I have forgiven My slave Allah says I have forgiven My slave And we know this That if we Are free from Associating partners With Allah SWT That Allah SWT Will forgive All of that It will be difficult To have the type of month That we all want spiritually If we cannot allow ourselves To fall into the mercy of Allah SWT To be enveloped by the mercy of Allah SWT To be permeated by the mercy of Allah SWT At all levels of our being We will not allow the ability Of complete trust to welcome Allah SWT And therefore We will prevent us We will prevent us From having the types of openings And relationships That we can have With Allah SWT Because that doubt is there This concept of mercy is there To erase that doubt Not from me But from the words of Allah SWT And from the Words of our Prophet And from the examples of our Prophet May Allah SWT May Allah continue to bless The Quran tells us That Allah SWT Want from us And you You want to be So there's 2 things here Allah wants to accept Your repentance This is the relationship لدينا محاولة في حالة الله سبحانه وتعالى تكون جاهزة بالنسبة للمساعدة ولكن المساعدة سيكون علىنا لكي تأكد أنه قد يكون معاك ولكن الذين يتبعون من المساعدة يريدون أن يتعرأ إلى رئيسة ويساعدة الله أحبه في المساعدة ولكن المساعدة يتكلم ويكلم يمكننا الله أن يتفعل ذلك الحمد لله هذا الوصول من الله سبحانه وتعالى يتحدث عن مرسي في القرآن وهي يخبرنا بأن Our Renewal is in our hands وقد يخبرنا بأنه سوف تساعدنا عندما نعود ولكن يجب أن نأخذ ذلك ونعود إلى نفسه سبحانه وتعالى يجب أن نساعد هذه الأشياء الأخيرين وأنه يعمل بشكل جيد أن Our Renewal is available to us at every moment and every day يجب أن يكون at the center of our consciousness during this month ونعود إلى أن الله سبحانه وتعالى will continue to stretch out his hand in the night so that the sinners of the day may repent and continue to stretch out his hand in the daytime so that the sinners of the night may repent until the sun rises from the west This past does not matter as long as we are making a choice in the present to turn back No matter how many times we fall returning to Allah سبحانه وتعالى over and over again it is all counted in our favor and it is all counted in our favor but one might say that I am so tired of myself and this is Allah سبحانه وتعالى I will respond to you if you feel that fatigue O son of Adam as long as you call on me I shall forgive you of what you have done وَلَا أُوْ بَالْي and think nothing of it This is Allah سبحانه وتعالى O son of Adam even if your sins were to reach up to the clouds in the sky and then you were to ask my forgiveness I would forgive you وَلَا أُوْ بَالْي and I would think nothing of it This is Allah سبحانه وتعالى O son of Adam even if you were to come to me with sins nearly as great as the earth and you were to meet me after death not worshiping anything besides me I would bring you forgiveness nearly as great as the earth رمضان is for us and tomorrow is a new day this life is a struggle and no one gets to the top of that mountain without struggling and sacrifice without doubting and telling themselves to turn back without thinking that they will not make it but with the strength of Allah سبحانه وتعالى Allah has facilitated for us the path of ease that we will make it to that top أكون القليحة وصفل وصفل وقمسة ربطنية وقمسة ربطنية وقمسة ربطنية الحمد لله حمد للكثير وشهر أن لا إله إلا الله وحده لا أشهر إله وشهر أن ناسيه وحده وقمسة رحمة العمد ورسوله ربار الله أذكركم بتاقوا الله سبحانه وتعالى وذكركم نخوري سيدا محمد صلى الله عليه وسلم حيث يكون في الحديث إتاقوا الله حيث ما كنتم وذكركم بشرك مكان مسطة صلى الله عليه وسلم حيث يكونوا وسنعرف إن الله وملاركة هو يوصدون على النبي يا إلينا أعمل وصدوا عليه وسلم ورسول الله صلى الله عليه وسلم وبارك على سيدا محمد وعلى عالي سيدا محمد كما برك على سيد إبراهيم وعلى عالي سيد إبراهيم إنك أنت حامي دون مجيد الحمد لله يجب أن نضع هذه الأفكار التي نحن في المشكلة في المشكلة أننا لا نفهم أن المشكلة في المشكلة وعندما نحن there نقول سبحان الله أنظروا ما يفعل ويجب أن يكون لديه لأنه في المشكلة التي أتحدث عن هذه المشكلة ليست في المشكلة ولكن هناك شيء أفضل فهو ما يفعل ما يفعل وعندما يفعل عندما يحدث عن جدنا أنه ما لا أعيش وعندما يفعل وعندما يفعل هذا العالم ومعنى أنه أفضل وعندما أنه أن يقوم بالمشكلة أن كل أفكار كل مشكلة من أبوه وإنهم يقوم بالمشكلة ويقوم بالمشكلة لا نعرف ما هذا المشكلة يفكرون عن هذا في الوصول على العالم وعندما يقوم بالمشكلة إذا كنت أعلم ما المشكلة يكون لديه كل يوم أن الله يقوم بالمشكلة الله يقول أنه أفضل في المشكلة التي لا أعيش لا أعيش لا أعيش حتى يكون لديه وهم يكررون سقول الله أنه سي will take The reward of the fasting And I will keep it for myself To reward when I did not reward In other things And then وتركيبنا


So hello, I'm here to talk about how web servers work. So this is not a very formal thing. It's more like just train of thought. I'll, I have some notes and I'll talk and then take questions via the HackMD you see here. And this was this spontaneous event we thought of this morning when we realized in order to do some stuff with web programming, there's some other things. Like it's good to know how the technology stack fits together in order to do stuff. And then doing stuff teaches you how the technology stack works. So maybe try to start somewhere by showing you some things. So what does it take to get something from a web server to your computer? So I sort of put it into these different layers. There's the transport or TCP IP level which is basically making the raw network connection. Then there's hypertext transfer protocol which is the language the web server speaks to the client. And then there's the server processing of stuff and then how your browser presents it. So let's sort of talk about this some. So I'm not really gonna spend much time talking about the network level but it's sort of how to make the actual connection. So let me give an example here. So actually let's search for something. Python, a simple Python web server. Yeah, here we go. So if we run this Python command we will serve a web server. And what we noticed there's, so Python three, we're running this module and 8,000 is the port number. So we see 0.0.0 8,000 and if we go to web browser and type local hose 8,000 we see the web server just responded. So in order to connect to anything the most the things you need to know are the address and the port number. And here we see it's listing this empty directory. Okay, and this is really no different than any other network traffic. There's nothing special to web here. There is a translation from names to IP addresses like here we had local host. That's the same as <IP_ADDRESS>. And to do this mapping, well at least on Linux there's host, let's take skicom.alto.fi. And it says skicom.alto.fi is an alias for read the docs. Read the docs has this IP address. So yeah, so by default if you don't give a port number it's port number 80 or 443 for SSL. So this address and port stuff is mainly relevant. So if you can't connect to something you're debugging that means there might be something wrong with the firewall or routing between your computer and the other thing. In which case you look at the network and make sure everything is open and the things can go in. Another case that often happens is if you're developing on another server and there's no network access and you need to connect. So for example, let's say I SSH to kosh.alto.fi. And then, okay, so here I've started running this on a remote server and I wanna connect to it. So say hi to my cat. If I come to my web browser and try to connect to kosh.alto.fi it does not work because there's a firewall and you can't connect. So let's say you want to get the connection into there. So SSH to our rescue. So kosh and we say dash L which means make a local port forwarding. So we want to connect port 8001 on our local computer to a local host, 8000. So this means on my computer, listen for connections on this port, send it to the other side which is kosh. From kosh it will connect to local host which according to kosh is, well, local host itself to port 8000. So let's try this. So now it's 8001 locally. So it says cannot connect. Oh, because I haven't run this yet. And if you wonder what this SSH no mocks mean that means it's an alias I have set up to disable the multiplexing stuff. And what do you know? Here we are on kosh. So if I touch a file in this directory, it appears there. So there's other different ways of doing this. I can add one, which you can look at yourself. I don't think we need to spend a lot of time on that now but when you're doing this kind of development being able to get the network connections going to and from anywhere is really useful. Okay, any questions so far? If so, write them in here. Okay, or even comments. Is this what you're looking for? Let's go to the next phase then. So at any time if you have questions just write where I can see it in the HackMD here. No, like, interrupt at any time. Okay, next up is HTTP. So this is sort of the main language between the client and the server. And it's existed since, well, the web has started. It's gone from something very simple, like HTTP one, which basically you made a request and it sent a response to all sorts of things like web sockets and asynchronous communication and so on. But the idea has basically remained the same. So the basic idea is you make a request and then on this connection, the client sends the server git and then a path. And there can also be headers like this. So here it says request header of something. And then the server sees a request for a certain file. How does it come back from the server to the client? Well, the server responds with something like a status line 200, which is the status code. And then some message, which in this case is success. Then there's can be response headers like this. So an example response header would be all kinds of metadata.  So let's try to look at this in practice. So one really nice thing we can do is web developer tools. Actually, let's go to our local host one because who knows who else will be connecting to my thing on Cosh. So Firefox and other browsers have something called web developer tools. So for Firefox, I can find it in peers, more tools, web developer tools. My cat is getting too interested in me right now. So please, if you're following along, find where this is in your browser. Okay, so let's go to the network panel here. And this shows all the connections that are happening. So I will click refresh. And I see what's going over the network. So first I requested, we see there were two requests here. It went for the document root, which is well, the file path and then save icon, which is like the icon that you would normally see here otherwise. If I click on something, I see headers. First, I look at request headers. So my browser sent all of these things. It's sent except the encodings. I'm not sure what sec fetch modes are. I mean, over time or user agent, which says what will be rendering it. So all of these things have been like slowly developed over the decades that the web has existed. All kinds of standards like language, negotiation and so on. I see the request line was get this path, the server status was 200 okay, some version amount transferred and response headers. So like it declares how long the content should be. It should be HTML and this kind of stuff. See is there, let's look at raw. Okay, so I can turn on raw. So the raw request is this here. Get host, all this stuff. Raw response is, well, it doesn't include the content here, but I guess it would be right below. And here's the content they got sent back. Okay, and that's sort of what everything is built upon and using these web developer tools, you can really go in and see what's going on and yeah, what's going on under the hood. Types of queries. So there's get queries. So if we gave arguments like this, the convention is if there's a question mark and then you have argument equals value ampersand argument equals value and so on. Let's try this here. So here we see it says directly listing for argument equals value. So it clearly, this simple Python web server doesn't do any of this processing. If we look at the request, yeah, just like this. So basically this web server doesn't read, doesn't parse this value and turn it into what the options are for the call itself. But other programs that would return this would split this off and handle it specially. Yeah, this git was the, then it just post. So you can post to again, some file path. This is not specific to post, but I included it here now. So you can say what the host, like what this domain name you're requesting is and what does that mean? So this is used if you have multiple servers running on the same IP address. So it can select the right one to respond to things. And then there's a request body. These things are HAD verbs or methods. You can't see my camera, but if you're looking at the recording, then you can see some, my cat trying to eat me here. So you could say git and post are the most common verbs, but there's more. And there's nothing intrinsic to the protocol here. So you can send whatever you want. They have different context dependent meanings. So feel free to look at this and see how things are built. And many of these are added later. Like for example, there's a connect verb, which I think says, okay, we're not speaking HTTP anymore. Let's open a web socket and so on. So there's other conventions. So for example, oh, did I mention the status code? Yeah, that's 200 success. So if we open, so there's convention that a git request should not modify the server side state post does. So basically a web browser, if you refresh a page that's gitted, it will just refresh it. If you request a posted web page, it will say, are you sure you want to resubmit this page? It might say, repeat your purchase or do something else again. Okay, the status codes. So like we saw here, the response contains some status. And there's a huge list of what all these codes means. Maybe one of the most common ones is 404 file not found. Meaning, well, it did not find, like the resource was not available. And let's open this and take a look at it. The status codes. And we see there's very many of them here. And again, these are all sort of conventions. Like you could go and make up a status code. The text of them is sort of conventional but can be specified separately. But yeah, you could return anything to the web browser and it may or may not know what's going on. Maybe we often see internal server error, which meant that the code that was generating the response itself failed. Okay, so you can compose these into several things, like this location here. Let's say you want to return a response that redirects to something else. So you say, you can look up the status code for redirects and there's say, move permanently. There's move temporarily, see other and so on. And if you read these, you can see what it sort of means. So let's say we want to return a moved permanently. So now this response, the browser would look at the status code and say, okay, I need to go somewhere else, look at the location header and then redirect you there. So for example, this is how it would redirect you from non SSL to SSL. It would say, okay, the connection came in. This is not coming over SSL. So I'm going to redirect you to the HTTPS version of it. Actually, maybe let's try to do that. So let's make a new tab, open the developer tools on network and let's look at ski comp.alto.fi. Notice this is not SSL. Let's see what happens. Well, it's loading a whole bunch of resources. If I go up, I see what do you know status 302. 302 found. And it says location the HTTPS version. For some fun, just go look and see what all these other headers may mean. There's things for caching, there's things for anything I'm forgetting about the HTTP part or any questions you may have. And someone gives some feedback. Are we doing remotely what you're interested in? What's about half the time, so seems okay. You can also comment by voice. So now that we're done with the HTTP side, what happens on the server? So once the connection comes in, how does the server even decide what it's going to return? There could be, the question's coming. So sometimes you have to give the windows to narrow. Is there like some sort of, if you click something like here and it goes out, can you find? I'm starting another Chrome browser and let's take a look. So here I see it here. I basically have the web developer tools on, I know the shortcut, so you can find it. Cause I come here so often to figure out why stuff is broken. Okay. If you don't see any data in the network tab, then you need to refresh the page. So basically it doesn't remember past things, but you have to open the developer tools or the network tab and then make a request and then it will appear there. Okay. So how does the server decide what to return? As in how does it make this kind of response? Well, that's really up to the server. So every server can do its own thing. So some simple strategies would be to map to a file system path. And that would be basically a web server, like a lot like this Python one here saying, okay, let's look for a file one and it tries to find file one under the web route and then returns it with some minimal headers. But if we're here, we're probably doing something more fancy than that. We want to actually run some code to make the content. And for that, it's up to the API of whatever tool we're using. So an old fashioned way of doing this was the common gateway interface. It was basically a UNIX process-based interface. So anytime a request comes in, if the web server is told use common gateway interface to return the answer, it will run a UNIX process for that request. Environment variables convey all of the headers. So for example, HTTP, what was the header we saw? Like this request header becomes an environment variable in the CGI process that HTTP request header. The request body comes in via standard input. A standard output is the raw response, which importantly, there's headers and then there's a blank line and then there's the body content. And if there's no headers, it needs to start with a blank line. And with this, you can basically map anything from the request to code and then process stuff and then return it. So CGI is old and somewhat inefficient because it has to start a new UNIX process every time there's a new request. So web frameworks these days have many more advanced ways of doing things. Basically every framework will have its way of listening to the request. It might include its own web server or it might be some efficient connection process to an external web server. The code comes in and then it does processing and returns it. So here's an example request in Django. Let's look in. So, well. We're not going into details of how Django works but the point is once you have a view like a function will be called for every request that comes in. And in there you have an HTTP request object and there's for example dot method which would be git for example or dot headers which is a dictionary of all the headers or body which is the body text and so on. And if you look at Django request object you get documentation for it and basically see all of these things. And every one of these somehow maps to the thing I told you about HTTP. So path shows path to whatever was given. Let's look at some fancy things. So here HTTP request dot git it says it's a dictionary like object campaigning all HTTP git parameters. So what that means is let's find our git request. Here we go. It was git file and then question mark argument equals value, argument equals value. So Django knows the HTTP convention and will automatically put this into a dictionary of argument to value because that's a useful thing to do. But that's still somehow dependent on the choices the framework makes and I mean you don't even have to use that. So there probably is a way to get the raw request. Well, I can't see it here immediately but I know there's some way to get the raw, get all of this raw information from Django. And likewise, there's a way to make all of these things here in your framework. So looking at Django, we see make an HTTP response. Response equals HTTP response body content. Response dot headers equals whatever. So here I'm setting content type to text plane which is how we would say that the web browser should parse it as a plain text file instead of a HTML file. But let's look at response objects here and we can see even more. How do I get the table of contents? The response, we see response subclasses. Let's come here. And we see there's built in things for like HTTP response redirect which is a simple way to redirect. So this would set status code equals 302 with some message and then set location to whatever you're giving. And you see these other things here or you know, make them yourself. So this is the point where you need to understand your own web framework, like what these things mean. But in the end it's going to map to the raw plain text HTTP that's going over the wire. There's plenty of other fancy stuff that can happen here like web sockets which instead of being a request and response kind of thing, it's a request and then it opens the connection and then it's a continuous socket that stays open for long-term communication which I guess is used for all kinds of things like dynamic web pages or web pages that will probably this hack and dee here uses web sockets to give continual updates. There's plenty of modern standards like including multiple requests in one request and then returning multiple responses that wants to make things faster and so on. I'd like this idea. Let's look at this hack and dee. In the developer tools and see what happens. Network is open, I will make the request. Now let's see what fits in here. There's git, we see several things that are blocked by an extension. Git, git, git, git, git, git, git, git, git, git, git, git. Okay, here's a post request. Let's go into edit mode. I'm actually surprised I don't see a web socket opening here, well that just goes to show that I don't actually know that much about web stuff. Probably one of these opens it somehow. Anyway, let's continue. Any questions so far? Please write, I'll give a few minutes here to think. Okay, let's go. So then client side. So once the web server is sending something back to the client, how does it actually present things? So there's some hints from the server. Actually, let's try this. So I just made two files here. So let's try opening file one. So file one, this presents and it looks like HTML. So if we look in here, we see it says content type is text HTML. Let's look at the other one. This looks different. It looks like it's monospace text. So if we look here, we see content type was text plain. So when viewing something alone, you can, the server can send this content type back, which might give a hint about presenting the file itself. But most stuff is HTML. How does HTML work? Let's again, have the web developer tools open and do inspector. Is inspector good? So this is what's in the body here. So I'm not really gonna go into HTML. So you've probably seen it before. If not, it's like such a much larger thing. I think it's sort of besides the point of what I'm talking about here. But the basic points, the HTML is the structured content of what's in the web page. So by hovering over here, we can select each element and there's like a header. There's, here we see within the HTML, it's also sending a content type. Okay. Another common thing you see is CSS or cascading style sheets. So here's example CSS and example HTML. So there's body. We see some bold text and we see span with a certain class and some content. So here the bold elements will have color red applied to them and then notice there's a period here. Period here. So class AAA gets colored blue applied to it. Let's come back here. If I look into here, let's take this H1 object. We see styles here. And here I can sort of override styles. And there I just turned this heading blue. So this is often useful when you have a page which already sort of works and you need to modify it and figure out how to change things. You can come here by clicking on any element, you can see where the CSS comes from and then adjust it dynamically. Let's go to Wikipedia here. If I, I'm not sure why right click is doing that. I right click and go to inspect the element and now it opens here. It opens right up to the inspector. And I see there's this element here, multiple choices. Yeah. So what do we see in here? This is a DT element. And if I look in here, I can see where the different styles come from. So this DT was defined in, well, whatever this resource was. And you notice how I can turn it on and off. I said not, I wouldn't go too deep here, but this is something that just coming and playing around with stuff like this, you can start learning a lot about how the web browser is like how all these things work. So yeah, have fun, break some web pages. Okay. And then JavaScript runs in the browser. So one of the types of resources that can be sent, let's come to the network here, refresh. We have type, okay, there's images, JavaScript. So, and this is somehow loaded through the HTML. So the HTML says, there's header, script. Somewhere here, you find the HTML saying, please load this JavaScript and run it in this context. And the browser loads the JavaScript and then runs it and it can do things like edit the content of the page, make other requests, serve dynamic web pages and so on. And yeah, and at this point, you sort of need to study how JavaScript works because that's a whole other topic of conversation, which I'm not really prepared to talk about. But still, I mean, JavaScript is nothing more than a different resource that's loaded via HTTP. So overall, maybe we can summarize. So I go to Wikipedia here. My web browser looks up the IP address for yenwikipedia.org, sees I'm connecting over HTTPS. S means SSL, so it knows it needs port 443. It makes a request to the web server and says I would like this path on this host. The web server runs some dynamic content and returns one HTML page to me, which is the master document here. And this document here includes references in the HTML. It says load these images, load this CSS, load this JavaScript, which are all processed by the web server and assembled into the web page itself, which is a layer I'm not getting to. And now it's been a little bit, okay, that's my cap, pushing buttons, and now it's been about an hour. So I'll stop here and just answer questions. And if there's no questions, I will feel free to ask me a voice. It won't appear in the recording. Yes, yeah, so I guess this is a question of what server resources can you use? So you can request, for example, a virtual machine which will basically install everything yourself, so the web server, the web framework, and so on. And then you request the Alto firewall people to open it to connections from the outside on the certain address and port. There's also shared hosting, where there's basically one web server that runs many different sites and it uses this host header in order to select the right site to serve things. This works well for static files, for dynamic content, then you get to the point of like sharing, well, multiple people running code on the same server and I guess containers and virtual machines have sort of taken this over. I guess other options are to use containers at CSC. Or another option is you can set up, like start developing it on your own workstation or something. And when you need to test it, you use these SSH tricks to get connections to the inside and then you only open it to the world at the end whenever you really need it to be open. With clever programming, you can do most of this on your own computer and then you sort of like a simple, put somewhere permanent at the end. I don't know if this really answered your question. Like there's so many different things there's like where you host it, there's what you run on there, how you access it. Not exactly. I mean, for static files, there's things like users.alto.v but that's not really dynamic code. So, I mean, maybe I'm forgetting something simple, but if there was, I guess, people would probably be using it and I wouldn't know about it.  So old web servers with CGI would do things like they would su to the user and then run the code as that user. And that way you could have multiple people running dynamic code on the same web server. But there's all kinds of security related things that can go wrong. Exactly, yeah, yeah, yeah. Yeah, so like there's, you see this giant cascade of stuff. Yeah, like, but it all starts from here and this somehow refers to these things. Well, for example, we see lots of images. That's sort of obvious, like an image file looks like, let's try opening this file in the web browser. So file one, so we see a broken image here. What do we think the network says? So file one, it tried to get this other image. It broke and we see the server returned 404, the status not found, but it doesn't know it needs the image until it gets file one. And that's one of the reasons for things like HTTP too. So before the server would have to return the response, process it by the web browser. And then the web browser says, okay, give me all this other stuff, but people try to do fancy things like package all the stuff together and then, well, send. The web server can predict what the client will be requesting and send it in advance. So what about dynamic sites? Like, let's say it's your uploading data to a web server. Well, then it runs this arbitrary code and then would store it in a database or store it like a pen something to a file and so on and so on. And that's basically like an extension of what we've seen here. So the question was how specific code is to a certain web server, which I interpret as meaning web framework. Yeah, I guess that depends on how standardized your web framework is. I think for many of the web frameworks I've seen, it's pretty specific to the framework itself. Like translating from Django to say tornado is not necessarily a simple thing to do. So I guess I would just assume unless you have reason to believe otherwise, you would need to change it. Of course, you would just need to change the way it interacts with the web server. Like for Django, this API of request object and response object, you would need to adjust that but the code that actually does whatever, rendering or computation, that can be the same. And I'll bet someone has made a framework of frameworks. Like you can write your code with this framework and then you can connect it to Django or multiple other frameworks but just getting to some crazy levels of abstraction and I don't know if it's any use or not. But for web server itself, let's see. So for example, Django itself can run on multiple different web servers. So, okay, that's a good question. So Django, yeah. So in most of the Django sites I make, the thing that your browser is connecting directly to is not Django itself. So first it connects to another web server. For example, Apache or Nginx. And then it says, okay, if I connect to this web server, let's take this Python example. So if I connect to here, you localhost 8000 file one, it returns this file. And then if I access the web app path, it would take that and say, oh, this is a special thing. This isn't a file. This is connected to this web application. And then it sends it to the Django internal web server. And then it renters that, returns it to the outer web server and then forwards it on. So there can be multiple ways of doing this. I was looking for here for, okay, using Django, how to install it. Let's see. So this thing we see here, WSGI stands for web server gateway interface. It's a standard Python protocol API for communicating between web servers and web apps running in the server. So it basically is replacement for the CGI that I explained before. So instead of the web server starting a new Django process for every request, it keeps some requests open and then basically is piping them into Django and Django stays running and then serves them in sequence and then sends it back. And let me find something. Oh, here's an example of configuration for Apache. So web server gateway script alias. So now here the whole root of the web server gets redirected to this Python file. Actually, I bet I can open a, and this is an example WSGI module. Exactly what would be referred to here. So we see at the bottom, it says application equals get WSGI application. So that means this web server, it knows how to call methods on this with Python that say, here's a new request and please give new response. And this is sort of like the connection between the web server written in C and the application written in Python. And I guess this involves something like, I really don't know, there's different options here. But this is just one of the options. Another option you could do is use Django's built-in web server and the outer web server could do a reverse proxy. So basically the connection comes in on HTTP and then it sends it over the localhost network to Django and then it renders the response and then sends it back. Here's a mod WGSGI demon mode. So this will start an external process and somehow be able to communicate over a, well, something. Here we see an interesting section serving files. It says Django doesn't serve files itself. It leaves that job to where their web server you choose. You recommend a separate web server as a not Django for serving media. So here we see, for example, directory static. It's granting access to things that are in there. And then this would be combined with the script alias. So if it comes in and it matches slash static, the web server serves it from this path. If it doesn't match that, then it will definitely match a single slash and then send everything else to WGSGI. So for example, images are served by the high performance web server written in C or Rust or whatever cool people are using these days. The Python stuff is rendered otherwise. And that's all a matter of tracing the pipes and how things are connected. More questions. Thanks, I hope this was helpful to someone. I guess I'll stop the recording and then we can continue discussing. So if you're watching this later, thanks and I hope this was helpful.


Hey everyone, this is Gabrielle with Oxmerotic Group. Today I'm here at Oxmer Toyota and now I have Chuck here with me. Chuck's gonna go over some details on the Customize. This is the 2019 Toyota Corolla and it's an SE. So Chuck, if you want to go over some details on the Corolla and then tell everybody what's customized on this, that would be great. Absolutely, so the 2019 Corolla, the body style changed in 2016. They made it sportier. This is the SE, so you got the honeycomb grill here. So it's a really distinct sporty look. It has Toyota Safety Sense P. This is a millimeter wave radar.  So all those features, standard, sporty car, fun to drive. It's the best selling car in the world. But then we've customized this one. We've added 17 inch TRD wheels to this to give it a very sporty look and a customized look. You're not going to see a car like this out on the road. You can make it your own. And so we're able to do that. We have our accessories department here and you see how good those tires look. But you can do anything to customize a car and to make it your own. We've got some wheels here. Body side molding for the cars that gives it a more distinct shape on the outside. It also protects your doors from door dings, all weather mats. We can add any size tire, you know, to a vehicle as long as it fits. And you just see all the different options to make your vehicle yours. So you buy a Corolla. It's again, the best selling car in the world. We sell a lot of Corollas. This one's distinctly yours because we added those tires to it. Right. Exactly. All right. Thanks so much. You got it. All right, you guys, if you have any questions on any of our accessories or on the Corolla, please feel free to let us know. Now, the best phone number you can reach us on is<PHONE_NUMBER>. You can also visit our website. It's boxmortoyota.com. I'll make sure to have a link to the Corolla in the comments. So thanks, you guys, and hopefully we'll see you all soon. Bye. Bye, guys.