While I change the battery in the microphone, hopefully this works. Anybody have any questions on project two that we can talk about now before we get started? Yeah. So the get token function in the lecture.c code, that's how we're getting input in? Yes. Or do we have to use c in the cn? No, you shouldn't be reading anything, right? So the token, the lexer, is reading all the tokens in. So the whole point of the assignment is you're learning how to use the API of the lexer. And that's... Useable. So that's what you'd be using. Okay. Yeah. Is there, would you be willing to like record some kind of like how to debug with the lexer baby? Because I was having problems and I couldn't figure that out. I just ended up copying the individual studio and doing that. But I know I won't always be able to do that. Correct. That's a good question. This battery also did not work. Anybody like AV tech? Try the third one. So we'll not be putting it in upside down. I don't know. I think it's a 9 volt battery. I think it only goes in one way. I mean, it did turn on, so it's not getting that. There we go. Hello? Hello? Yeah. Yeah, maybe send me an email. It takes a long time, but it's hard to come up with a good example. Or just a link to like a good resource that you can use. Yeah. Yeah. Email me. I'll be happy to do that. Yeah. I mean, GDV takes a little bit of time to get used to, but it's time well spent because I use it all the time debugging C code and C++ code. Okay. Yeah. I've been actually meaning to do that, but it's just a time section. Okay. Cool. Any other questions? Project two? Okay. So where we left off, we were talking about parsing. So what's parsing? What do we care about parsing? What is parsing? Turns a into potential strings. No. What is that? How do we take a grammar and turn it into a string? Derivations. Yeah. So derivations, right? We can take a grammar. We can do derivations to get a string. We can also create a parse tree from a grammar, right? That will also give us the strings. Parsing is essentially the opposite of that. What would be the opposite there? A string. No. That's lexing. Very close. After that, after we've lexed, we have a series of tokens. That's not what we want to do. Yeah. Match it to a grammar, right? And how do we know that it matches the grammar? I was just saying something. What? The rules of the grammar. The rules of the grammar. Correct. Yeah. So we want to build a parse tree from it, right? So we're parsing. Parsing is we want to take in either a string or a string. Either a string or a series of tokens, right? The series of tokens from the lexer. And we want to say, did this string come from this grammar? Right? And if so, what's the parse tree specifically for this grammar? So that's what we're studying now. We're studying now the reverse, right? So we've looked at, okay, it's pretty easy to, if you're giving a grammar, right? I can, like this, expression. You said taking a string and making sure it follows the rules of the grammar? Yes, at a high level. That's what it's doing. Our goal is, from parsing, we want to take in a string, and we want to output the parse tree that that string corresponds to of the grammar. Right? So if we have these rules, we can very easily apply these rules over and over, right, until we've reached a string that has no non-terminals, only terminals. And we know that string is definitely in the grammar. But now we want to do the opposite, right? We want to start backwards. We want to, we start with the string and say, can this string come from applying any of these rules? Is that easier or more difficult? More difficult. More difficult? Why? There could potentially be multiple ways to parse a single string. Yeah, there could be potentially multiple ways. Yeah, we'll get into that. It's kind of what we talked about with ambiguous grammars, right? There could be multiple parse trees. Actually, if you think about it, that could make our job easier, right? Because we have two targets or many targets to go to, right? We're starting at the string and we want to find the parse tree. So generating all these strings, right? If I asked you to generate, like, write an algorithm to generate all possible strings that this grammar could create, would you be able to do that? No, you can't write one algorithm to do that? You may never finish, but it's pretty easy to write it. Just apply this rule, apply this rule, and if this rule doesn't fit, then the next time you try this other rule, right, you're just trying all possible combinations of rules to spit out strings. But here we're going in the reverse, right? We're starting with this string 1 plus 2 times 3, and we're trying to ask the question, is there any possible way, any possible combination of applications of these rules that creates this string, right? So it's actually a very kind of a tricky problem. So let's kind of think about how we're going to do this. So what are the two things, what are the things I need to know to be able to do parsing? My inputs, let's say, to the parsing. You need your string of tokens, and then you need your rules of a grammar that you can try and match to. Exactly, right? So you can't, like, parsing is specific to a given grammar, right? If you don't have the grammar, you'll never know. You can't answer the question if it matches or doesn't match, right?  So can somebody describe kind of what this grammar, what strings in this grammar looks like? Somebody over here in the back who hasn't spoken in a while? Morning. What are you asking? What do the strings look like? What do the strings that this grammar produces or generates, what do they look like? Yeah? It contains only A or B. It contains only A or B, right? So you can see that S, right, so S is the starting non-terminal, so we're going to start from there, all strings must be derived from S, and then it's going to be either A or B, and this will be any number of B, A's, any number of B's. So when we're parsing, we want to build a parse tree, right? This is our end goal, we want to build a parse tree. So what's the, wow, as we're going to talk about, right? So S is always going to be the root node of our parse tree, right, whatever the starting non-terminal is, because every string that this language generates has to be, has to come from S, right? Any string that's derived has to be derived from S. So this is all we have. We have the rules, we have the string. How do I decide what's the child of S here? Pick one, check the token. Pick one, check the token, which token? The first one? Yeah. The first token? So check A, but A doesn't match big A or big B, so how do I decide which one to choose? The first one. Which events as children could yield little a? Which of these children could yield little a? What do you mean by yield? Like, which one, which one would generate little a? So how does that help us? It's possible to be A, to be big A. Possible to be A? Is it only possible to be A? So if you check B, it does a little B, so you have a little B. Well, out of, out of the children, the only one that can generate little a's is big A. So in this case, it's simpler, but in a more complicated grammar, it would be... We don't have to worry about other grammars yet. We're building up to that. But, yeah, we want to think about this example, right, and try to see, okay, how do we actually do this? So remember, once again, we're building, our goal is to build the tree from the top down. We're doing top down parsing. So we're going to start with S, right? So now we need to decide, okay, which one of these does S, which one of these rules was applied to generate this string? Was it S goes to A, or was it S goes to B? Right? And we can look at our input string, right? And we'll look at it left to right. And so we look at this first token, A. Say, okay, can big A generate little a's? Yes. As the first token? Yes. Can big B generate little a's as the first token? No. So we know it definitely can't be S goes to B, right? And so now we can say, okay, S goes to A. So we know that's the first rule that's applied. But did I actually match this little a when I applied this rule? No. In this tree? It's just possible. Right, it's just possible, right? We know it has to start with a little a, but we don't know that this rule here, applying this rule didn't generate any terminals, right? So we can't just move on and say, okay, we've matched that. Now let's try to match here, right? So let me go to this rule.  So which one of these rules apply? Because we need to generate more tokens than we are. Yeah, but how do you do it just with looking at this string, right? Well, if we only do little a, that's a terminal. We can't generate any more tokens from that. And since the string that we're trying to parse is not a single little a, we can't choose that child. Cool, so let's think, have we parsed this little a yet? Have we matched it up to a terminal in the grammar? Yeah. No, not yet, right? So we still have to consider this a, right? So is just looking at this a helped us distinguish between these two rules? No. No, right? Because, because why? Because we can't look that for the machine. We can't look that for forward. I didn't know about the machine, right? If we just think this a, right? These two rules, remember, before we can say, okay, we can determine between big a and big b, right? Just by looking at that first token, right? If it's an a, we know it has to be s goes to a. If it's a b, we know it has to be s goes to b, right? But here, just by looking at this, well, we can say, hey, either of these two rules could possibly match, right? It could be little a big a or it could just be little a, right? But if we look one more ahead and we see, in which case, so if we looked, you know, one more ahead and look at these two tokens, right? Then can we distinguish between them? Yes. So why is it not the little a? Why is it not this rule? This is more than one a, right? Yeah, if we choose this rule, we have to stop. And there's no possible way if we choose this rule, we match the string a, a. So let's choose this other rule. Isn't it kind of the same concept from what's called analysis where we're looking for the longest possible match without any other potentials? Current match would be the little a and possible. That's a good question. I think there are some similarities there, but I'm unsure if it will cause problems if I think about it like that. That's exactly what I was saying.  So you can't finalize it. We give here. So is this a valid parse string? No. It's a parse tree that this language can generate, right? It's a valid parse tree. Is it a parse tree that matches that input string? No. No, exactly, right? Because this represents the string a single a, which is not the same thing as our four a's. Exactly. And we can tell that by looking at two characters this time, right? We can look at two and say, okay, we know it has to be, this has to be the bullets applied. Now, how much of the string have I parsed so far? Have I matched up in the parse tree with the input string? Just one, right? But I looked at two. So does that mean I consumed those two and try to start parsing from here? It never reached the end of the line. Exactly. So this partial parse tree that I created at this point, even though I had to look two tokens ahead to decide between the rules, right? Even though I had to do that, I know that this token, I know that this one is actually in the tree, right? So I know I've actually parsed this token. But now I still need to match three little a's. So then applying that same logic to this a, which rule then do I choose? I don't want to terminate you. Yeah, we can look at the same thing. We look at the two a's, right? And so which rule do we pick? Little a, big a. So how much of the string have we parsed? Two characters. Two characters. Are we done? No. No, because we still got a big a, right? So now we can do this again. We say, okay, which one applies? By the same logic, right? Little a, big a. And so now I've parsed three, right, of this string. So now I get to this last one, right? So which of these two rules apply? Chess little a. Because you try to look ahead and you say, ah, there's no more, we've reached the end of the string, right? There's nothing more there. So we can say it has to be this one, right? It has to be this little a. So now the question, the self-check, right, is to first ask yourself. Let's do that a little bit. All right, the self-check, right? Is this a valid parse tree in this grammar? And how do you know? How do you tell it's a valid parse tree? It ends in all terminals. It ends in all terminals, yeah. All the leaves are terminals. Yep, that's one way. Each subtree corresponds to one of the rules. Yes, each subtree corresponds to one of the rules, right? Each parent-child relationship, right, each of the levels of the tree corresponds to one of the rules. So here we go as S produces a. We have the rule S produces a.   And at every level we have that, right? So then we know it's a valid parse tree. Is this parse tree our input string? Our input string was four a's. This is the string as we go to all the leaves, right? Four a's. And so we successfully parsed this string. So we can say yes, this string was definitely in our input language. Right, this string is in, is one of the strings generated by this grammar. And how do I prove that this is one of the strings generated by this grammar? Yeah, the parse tree. I showed you the parse tree, right? And you can validate. You can say yep, all the leaves are terminals. And at every parent-child we have an application of the rules. So yes, this is definitely a valid parse tree. Another example. So here we have the string or we have a grammar. So what does this grammar represent? So some of you try to describe this for us in plain English. Is it an a's or an even number of all b's? An even number of all b's and an even number of all a's. I think there's one caveat maybe. It has to be at least two. At least two, yeah. Right? Yes, it is. Right? So this is at every a's going to generate two a's and a little a's or just two a's, right? So we'll be all even numbers. Let's try one. So what do we start our tree at that we're trying to parse? Kind of like a five or something like that. Okay, yeah, it still does. All right, so now here's my input of strength, just two a's. Right? So let's look at the first character. By looking at the first character can I tell which rule to apply? S, yes. Or S, yes, why? Because there's only one way that you have any chance of getting a little a's to choose. S goes to big a's and then you have to figure out what to do with that. Right, so if we choose, so it has to be a's because a only generates big a's or little a's. But what about if this next character's a b or a c or something? The whole string's involved. Yeah, okay, so we can look at this one a and this one a can tell us exactly which one to choose, right? So why is it that we can just look at this one a and we don't have to look at any of the others? You'll still have to. Yes, okay, so that's definitely true. So you're already kind of going ahead, right? Like how are we going to parse this when we get down to here? I want to kind of think about here, right? Just at this level, at S, how do I decide between a or b? And how can I decide just by looking at that one character? What do we know about every single string that b could possibly derivate and produce? There can't be an a, but specifically about that first character. It has to be a b. Yeah, exactly, right? So if I were to think about if I had a function, oops, that's not how you spell first, right? If I had a function that took in like a non-terminal in this grammar, I was able to calculate what's the first all strings, what are all possible strings? What are the... What are... What is the first character that exists in all possible strings of this language? Just a b, right? So this means that every possible string that is derived from a b must start with a little b, right? Any other options in here? So how do you know? How do you know that? Yeah, you can look at every rule of big b and you can look at this and say, okay, little b, little b big b, what's the first character that this sequence of terminals and non-terminals is going to generate? It has to be a little b, yeah, exactly, because it seems trivial, right? And then you look at the other side and say, okay, little b for this rule, well, I can also choose b goes to this rule, right? So what would be the first all characters, all strings that bb generates, what's the first token character terminal that they start with? Little b, yeah. And if it wasn't, you just put the or sign and put the other character there? If it wasn't, so let's say we could say or c, right? So this is a set, so we could just say the set containing d and c, right? So this is all possible characters that strings that b generates can start with. What about the first of a? What are we going to say? Anything else? What about the first of s? We'll get rid of c for now. Right, so we know s can go to either a or b, right? So that means if we choose s goes to a, well, since we replace the s by a, then whatever a starts with, s also has to start with, right? And the same way it goes through the other way, right? So whatever strings b generates, whatever character they start with, s also has to start with that. So it's kind of crazy, so I just want to reiterate, right? So we're able to, I mean right now we're kind of doing it by intuition but we'll see there's actually a way in algorithms to generate this.  All these rules. What do we know about the language described by g for this set? What are some things we know? Is it a finite set? It's an infinite set, right? It contains every possible string of even greater than two, even number of a's and even number of b's, right? So this set goes on forever. But with these functions, right, we're able to say something about the strings in this set, right? We're able to say something definitive. We're able to say, hey, every string with s starts with either an a character or a b character, right? And then we can say, hey, any string derived by the rule b has to start with a b. And any string derived by the rule a has to start with an a. So if I calculate all these, right? Now, if I have the choice of s goes to a or b, how do I know using these, how can I tell which rule to apply? Yeah, look at the first character of the string and then what do I use of the first sets? Yeah, whichever rule applies, right? So I can say, hey, is the first character of the string in the first of a? Then it's got to be derived from that. Is it in the first of b? Then it must be derived from that, right? So this actually helps me choose which rule to parse with. So what language does this grammar describe? A string that starts with a's and then has zero or more a's and then either a c or b. Yeah. I think one or more a's starts with one. It starts with a which means it has that one and then zero or more a's. So all strings that have one or more a's followed by either a c or a b. So let's try to parse this, right? So let's have the string, so I start with s, right? So which rule applies? So what do we do before? What was the first, how do we kind of try to tell which rule to apply? Looking at the first character but that wouldn't help this year. Exactly, we tried to look at the first character, right? We'll just look at the first character for your help, right? So why doesn't this help? Because both a and b start with a. Yeah. Right, so I actually can't look at only the first character because that doesn't help me choose between these rules. I have to look for the first non-a character? I have to look for the first non-a character? And even then, am I done? Well, the problem with this language is that it could be infinitely long or at the very least your worst case could be very, very long. So you would really not want to have to move through the a's from the front. You just want to grab the final Right, so part of the problem is right as I can't decide. So I could maybe try to say well, I can't decide, so let's try just for argument's sake we'll try s goes to b and we'll try to create a string from that so that doesn't parse anything here. Then can I choose which one of these rules apply? No? Yeah. How many characters do I have to look at? Two. Two, right? Yeah. If I look at two characters, I can see it's got to be this one. So I got a little a I can do that again so now I've parsed this one so now I have the second one so I can say a little a big b I parsed the second one now I try to look at this rule again so does this rule match either a, b, or a, b?  Then it was going to end with a b this first rule so I was like, I can't choose between just by looking at the first character so I'm just going to choose one but now I need to backtrack and revisit that choice because I can't parse the string like this so maybe I have to choose a so now I have to go back and start this all over again start with a and then I can decide here by looking at two okay it's got to be a little a big a and then I can choose it again I'm going to play big a and finally I can go with a, c and that's that string a, c where I got that there so what was some of our goals that we wanted from a parser? Is this efficient? Why not? Well it works out okay if we have two possible rules that we have to choose from but if we have like 30 it's going to take a long time to guess right What if I had two choices here and here I had two choices and here I had two choices right so my number of possible choices explodes right it's going to be two to the whatever number of choices I have to make and so I've got to try all possible of those choices until I either find a tree that matches or what it's been out here so I say no tree matches I tried all possible combinations of the rules and nothing worked so if we were to write c what's the first set of a what about c? right so every string that a generates right has to start with a little a right even though yes there is a case where it's going to be a little c followed by it the fact that there's a little a there means that it's just a what about the first of b? also a so then what was the problem here why couldn't we decide why looking at that first character? because what? the endings were different the endings were different specifically with the first sets right we couldn't tell just by looking at that first character because in the first set of a and the first set of b right their intersection they have an overlap there so if we see an a we have to say oh it could be either from s goes to a or it could be from s goes to b I want to go over how we're actually going to build a parser to look like code so let's go through an example and then we'll kind of walk through one so the idea is in top down parsing so we want to build these parse trees right because the parse trees represent the way the rules are applied when we actually create these we're going to want to essentially write a parser and our parser is actually going to mimic the tree itself and the structure of the calls so we'll do this very quickly so we have we're not very quickly but we'll definitely look at this so we have a grammar here s goes to big a big b big c a goes to little a b goes to big b little b b and c goes to big c c or epsilon so what's the language described by this grammar this tree is empty a single a any number of insect of little b's or any number of little c's yes is that right how can we just have one c, can you have one c? yeah yeah, why? yeah so we can first say c goes to big c little c and the next time we say that big c goes to epsilon we say epsilon to cat a with c is little c so what we're going to do we're going to write a function for each of these rules for each of these production rules so so what's the what's the first set of big a just a little a right there's only one possible string that a can generate and it's little a what's the first set of b little b what's the first set of c epsilon or c because c can generate nothing so we have to keep that in mind so based on what we looked at that before can I efficiently decide from s can I efficiently decide between which rule to parse for s each of the first sets are different there's no intersection there so to write this in code it follows pretty much exactly from our intuitions from this so we first say okay what's the get token function it returns the first token of the string yeah it returns the first token right this is exactly the same semantics that you have in lexer dot c that you've been coding against and using in project 2 this is why you do that not just because we like it so what do I know how do I check if I have rule big a applies I look at this t type I look at this token type what am I checking if it's a if it's a then what so what do we know about get token from the lexer what are the semantics there so it returns the token type what else does it do it also stores whatever token value stores the token value stores the line what does it do to the string yeah yeah eats the first token from the input and moves the lexer forward through the input because it made the decision to parse that token and so next time you call get token it starts after that input but if we think about our tree that parse tree that we want to create have we actually parsed little a here does s generate generate little a you're shaking your head possibly parse little a or parse a yeah so it doesn't say right the only rule we have right now right now we're just concerned with parsing s so we need to decide which rule to apply right big a big b or big c right but neither of these actually generates a non a non sorry a terminal none of these rules generates a little a free right we have s goes to big a but we haven't actually created that leaf node for a there right because this rule does not parse that and so if we don't want our token to be consumed yet because we haven't actually matched it and parsed it then what do we have to do with the lexer was that yeah we want to put that token back right and say okay we're not really ready to actually parse this because a goes s goes to a doesn't generate any terminals right I just had to look ahead and kind of peak at the next to tell which rule to apply but now I decided right I decided I know it's a little a so I know it has to be s goes to big a but I'm going to let parse a figure out how it wants to handle that so then we're going to call parse a right and parse a is going to be very similar it's going to make sure that it parses everything else do we know after after we've parsed a what what do we know about the input for the input we're done we'd better be done right what if there's more after we try to parse a right yeah that string is not in our language so if we get token again if we set our t type you can get token if that's not in the file then we know there must be a syntax error that we know that this string did not come from this language right now we're going to abstract this into like a just a check into file function that reads from the token exactly that reads from the token and say is it the end of file if it's not then throw an exception throw an error or say that there's a syntax error so what's the next t type we want to check of this get token so it's b so what's the first thing it's going to do unget the token and then what parse b and then what check the end of file so what about the next one what if it's a c if it's c or epsilon can't can you read in an epsilon token what's your lexer what are the types what things are your lexer going to return when you call get token so you're going to return token okay because you're trying to ID number tokens yeah so it's going to return one of your tokens that you've defined what else can you use the length the length the length no value well the problem is is you don't put epsilons in your generally you don't have epsilons in your string because you could have like if you they get abstracted away exactly yeah you don't have epsilons in your strings right so your token your lexer so you've read the lexer c code right it returns either the token what does this check eof looking for for the end of the file right that's a valid thing that your lexer returns it's checking for the end of the file right so end of file is kind of a meta token or token that represents that you've reached the end of the input file what's the third one error right yeah if you've read an error token but can you check so none of those are epsilon right none of those three are in epsilon so let's check okay so if so if this token type is a c right then how do we parse this we want to un-get the token we want to call parse c again and then what do we want to do check for the end of file to make sure but we need to make sure we match one other string what was it so each of these cases what are the strings that each of these cases match what was it yeah strings that start with a strings that start with b, strings that start with c is that all of the strings that this language can generate no which string is it not matching or what string the empty string so how do we know from what the lexer returns how do we know if it's the empty string if it's end of file if it's end of file why it's saying I didn't receive anything which is equivalent of say empty string yes let me check if it's the end of file right and I actually need to update this I should actually put that in here but we'll see other examples as we go forward because we still so can s itself generate an epsilon no right just like s itself didn't generate any little a's s itself didn't generate any little b's or little c's so actually this is incorrect because s shouldn't be handling the case where it's an end of file right who should handle that c because c knows what to do if it's an end of file right or c knows what happens when c goes to epsilon right s doesn't have to worry about that the only thing s has to worry about is s goes to big a s goes to big b s goes to big c those are the only things s is only deciding between those three cases that's it all the other languages are going to decide that so what if it doesn't match any of these three or four cases throw an error say syntax error so what is this part should be exactly like this part and actually you can put these in the same thing here you can say if t type is c or t type is end of file so note from this that we've so the only reason we're able to do this to look one token ahead and be able to decide which rule to apply is because we know that the first of a the first of b and the first of c they're all disjoint they have no intersection no overlap here but we can still write this in a similar style of hey try to parse a and if a says hey that's not a valid a you try to parse b and then if it says hey that's not a valid b you say okay then try to parse c so you can implement backtracking parser very easily but if you have a language like this where you can tell right off the back then you can make it a lot more efficient and so that's the idea of these what we're going to call predictive recursive descent parsers so recursive descent that means that we're going from the top down right and we're recursive because we're always calling this parse s parse a parse b parse c functions what does predictive mean predicting which branch s is going to take based on some parameter right so we're predicting and what we really want to do so it's predictive because we're we want to be efficient and the key point is that we're going to be efficient because we're only going to look at one token ahead and that's going to tell us exactly which way to go so are all grammars can all grammars support a predictive recursive descent parser or a grammar that does not if you had one that you needed to look at to tell the difference you needed to look multiple tokens ahead can we look at any of those examples today which one ones that we're looking at the end whether the difference was b or c yeah the ones that ended with either a c or a v right just by looking at one token ahead we can't tell exactly which one to take and so what helped us determine if we could actually support this kind of a parser exactly looking at the first characters that each rule can produce if they can each produce distinct characters then clearly we can tell just by looking at that one it's kind of a recursive definition we want to be efficient so we want to only look one character ahead so how do we know if each of the rules looking at one character ahead if they're all distinct and disjoint so that's why we're going to use this first function and this first function is going to be defined so this is just a little bit more specific here so the idea is that so alpha you're using alpha here to represent a sequence of terminals and non-terminals so we ask what's the first of little b little b we can say it's clearly little b or what's the first of little a big a well it's clearly just a so it can be any number of sequence of grammar symbols and then it returns a set of terminals and epsilon so this is something you should keep in mind because this helps you think about what the type of the first function is so that when you're doing this by hand you can say that inputs is a sequence and it's a sequence of terminals, non-terminals and epsilon and it only returns terminals and epsilon so if you're trying to compute first and you get a big a or a big b some non-terminal in there this helps you to self-check that okay and then on Wednesday we'll look at this isn't the only thing we need and we'll look at why we need that and what other functions we need


Welcome to this lecture number 12. So, in which we will continue with our previous lecture article on steady flow through wells. So, in lecture number 11, we discussed the steady flow through a confined into a well through a confined aquifer. So, in which the confined aquifer thickness was B and the well was fully penetrating the entire thickness of the confined aquifer and the water table was horizontal before the pumping began which resulted in a steady flow into the aquifer into the well and the which also resulted in a steady discharge of Q from the well and we have got the expression for the discharge which is popularly known as the, yeah this is the expression and yeah the original expression in terms of the hydraulic conductivity is Q is equal to 2 pi K into B H 2 minus H 1 there by natural log of R 2 by R 1. So, this is popularly known as the Thames equation and this when we simplify as you applying the boundary conditions at the extreme points that is the extreme point wherein the there is no drawdown and the radius is equal to the radius of influence R capital R and H the head is equal to the total this head or the piezometric head and that the so this is the upstream most extreme and the downstream most extreme is the cylindrical wall where this S the drawdown is equal to the drawdown in the well equal to SW R 1 is equal to the radius of the well that is R W and H 1 the head is equal to the depth of the water in the well in the confined aquifer. So, we get this expression and these expressions can be used for with the in case of pumping test to determine the hydraulic the aquifer parameters such as the hydraulic conductivity and transmissivity. So, therefore, so these expressions can be used in steady flow pumping test for fully penetrating wells in confined aquifer for determining the hydraulic conductivity K and the transmissibility or transmissibility T of the aquifer. So, here we get an expression for the hydraulic conductivity K for the steady pumping test through the confined aquifer having a fully penetrating well as Q divided by 2 pi B into H 2 minus H 1 into natural log of R 2 by R 1 the same thing can also be written as Q divided by 2 pi B and in this case that is SW natural log of R divided by R W. So, here so this is the expression for K steady flow pumping test a fully penetrating well in a confined aquifer. Similarly, the same expression using these equations you can write down the expression for T as Q divided by 2 pi H 2 minus H 1 into natural log of R 2 by R 1 this can also be written as Q divided by 2 pi into SW into natural log of R the radius of influence divided by R W the weld radius. So, this is the expression for K, T. So, this is the expression for K and this is the expression for T. So, in a steady flow pumping test through a fully penetrating well in a confined aquifer. So, we need to know to determine this hydraulic conductivity K and transversivity T. We need to know the steady flow rate from this fully penetrating well in a confined aquifer. We need to know the thickness of the confined aquifer. We need to know either the depths between two the observation wells the depths of water in two observation wells that is H 1 and H 2 and their radii with respect to the radial distance with respect to the well axis the vertical well axis R 1 and R 2. And either we need to know these H 1, H 2, R 1, R 2 or we need to know the weld radius R W the drawdown in the weld SW and the radius of influence that is capital R. And so, in this case, so we can easily determine easily estimate the value of the two of the three aquifer parameters formation constants that is the hydraulic conductivity K and transversivity or transversibility T. Now, let us go to the case of steady flow a fully penetrating well in an unconfined aquifer. So far we have seen the steady flow through a fully penetrating well in a confined aquifer. And now, let us go to this steady flow through a fully penetrating well in an unconfined aquifer. So, for this the diagram would be a well which is fully penetrating through an unconfined aquifer. And in this case, this is the water surface that is the water table before the pumping started and after the pumping started. So, this water table will show a steady drawdown. So, this is the well axis and this is the steady discharge from this well in the unconfined aquifer. This is the lower impervious strata for the unconfined aquifer and this is the radius of the well is R W and the diameter is 2 R W. This is the radius of the circle influence or radius of influence radius of the circle of influence is R and the head there measured above the bottom impervious layer as capital H. And at any two points and here what happens is so this is the we need to apply the Dupitz assumptions and so this is the water table by Dupitz assumptions and this is the true water table. And here this is H 1 and the drawdown there is S 1. And similarly for the second observation well the head is H 2 and the drawdown there is S 2. And obviously here the Dupitz assumptions which we discussed in the previous lecture considered that is applied. So, the Dupitz assumptions accordingly that is say for small inclinations of free surface the streamlines can be approximated as approximated or assumed as horizontal. And second assumption is the hydraulic gradient is equal to slope of free surface is independent let me write here independent of depth. So, here the first assumption that is the streamlines are assumed to be horizontal. So, this is more or less true except close to the well where the streamlines are significantly deviating from this one but still with these assumptions that means the error in estimating the discharge is quite less. So therefore, because if we consider the inclination of the streamlines near to the well. So, then we have to modify our expression and for the discharge and it will make it more complicated it will make the expression more complicated. So, therefore, we are making the two Dupitz assumptions and so here the so let me show you the flow that is radially into the well and here this is hw and this is sw and at any general point this is h at a distance of r from the well axis the drawdown is s. Now, we will derive the expression for this steady flow. So, we know that the radially inward velocity vr is given by k into dh by dr this is by Darcy's law and this is by Darcy's law. So, therefore, the steady flow rate through the well is given by this vr into the area which contributes and that area which is contributing in this case will be equal to 2 pi r which is the circumference of the circle at that radial distance r multiplied by h which is the depth of water measured with respect to the horizontal impervious flow multiplied by this is the area multiplied by the velocity that is vr and this is equal to 2 pi r h into k into dh by dr. So, therefore, we can write this as q divided by 2 pi into k into dr by r this is equal to h dh. So, this expression needs to be integrated that is between the limits r 1 the lower limit r 1 and the upper limit r 2 and for the h the lower limit is h 1 the upper limit is h 2. So, therefore, we get q is equal to pi k h 2 square minus h 1 square divided by natural log of r 2 by r 1 and in this case. So, this is the expression for the flow rate. So, at the extreme points. So, here this case there is h 2 is equal to h r 2 is equal to r and h 1 is equal to h w r 1 is equal to r w. So, therefore, this expression can be rewritten as q is equal to pi into k into h square minus h w square divided by natural log of r divided by r w. So, these are the expressions for the steady flow rate in terms of the hydraulic conductivity k h which is the depth of water above the impervious layer in the unconfined aquifer h w is the depth of water in the well and r is the radius of influence r w is the well radius. And of course, if you express the same thing for two observation wells in that case. So, this is the expression two observation wells at a distance of r 1 and r 2 at a radial distance of r 1 and r 2 where the depth of water is h 1 and h 2. So, these are the this is the expression. Now, let us so in this case it should be noted that it is to be noted that time required for achieving a steady state is longer for unconfined aquifer. And so these two expressions let us write down the approximate forms approximate forms of equations for the steady flow rate q. So, when s w that is the draw down in the well is very small. So, in that case that is s w is equal to h minus h w is small relative to h. Therefore, h h square minus h w square you can write this as h plus h w into h minus h w. So, this h plus h w is approximately equal to 2 h and h minus h w is approximately equal to s w. So, therefore, the approximate expression for the steady flow rate is equal to 2 pi that is pi into k into 2 h s w divided by natural log of r divided by r w. And this can be written as 2 pi into t into s w divided by natural log of r divided by r w. So, these are the this is one approximate expression for q when the s w is very small. Similarly, this we can also write this q is approximately equal to 2 pi into t into s 1 minus s 2 divided by natural log of r 2 by r 1. So, in this case that is. So, here that is h 2 square minus h 1 square. So, here that is assuming h 2 square minus h 1 square is equal to h 2 plus h 1 into h 2 minus h 1 and this h 2 plus h 1 we can take this to be approximately equal to that is 2 t that is h into and this is s 2. So, this is s 2 h 2 minus h 1 is equal to s 2 minus 1. So, therefore, we get this expression that is. So, these 2 expressions will give the approximate expressions for the steady flow rate through this fully penetrating well in an unconfined aquifer. And obviously, they are almost the same as the expressions for steady flow through a fully penetrating well in a confined aquifer. So, now we have discussed the steady flow through a fully penetrating well in an unconfined aquifer as well as a fully penetrating well in a confined aquifer. And now in this case. So, here we can also write down. So, therefore, this t is approximately approximated as k into h 1 plus h 2 by 2. So, therefore, this k into h 1 plus h 2 is equal to 2 t. So, this is with this assumption. So, we get this approximate expression for this q. Now, let us consider the unconfined aquifer. It is unconfined aquifer with uniform recharge. So, in this previous 2 cases, we did not consider any recharge into the well. So, now let us consider the unconfined aquifer with uniform recharge. So, in this case that is the ground level and this is the well in the unconfined aquifer and this is the water table. And of course, so here we are getting the uniform recharge. And let us take this as W, recharge rate W. And this is the steady flow through this well is q w. And here, so this is the lower impermeable strata. Let us consider where in to the inflow is q and outflow is q plus dq. So, this dq is the one which gets contribution from this recharge, the constant recharge. In this case, let us consider the water table. Let us consider the steady height as say h 0 and the radius of influence as r 0. And here, so this radius is r and then for the elemental strip of radial distance dr. So, now we can write down for this case, we can write down the expression for the discharge dq is given by the area that is minus 2 pi r into dr into the uniform rate of recharge. So, if we integrate this one, we get that is q is equal to minus pi into r square into W plus the constant of integration. And the boundary conditions are at the well r tends to 0 and q tends to q w. Therefore, q w is equal to c. Therefore, we can write down this q is equal to minus pi r square into W plus q w. And if we substitute the expression for q which is minus 2 pi r into k into h dh by dr. So, here this k into dh by dr is the velocity as per Darcy's law and 2 pi r into h is the area which contributes flow. So, this is equal to minus pi r square into W plus q w. So, if you integrate this expression integrating applying the boundary condition, it is h is equal to h 0 the upstream most boundary condition and at r is equal to r 0. So, therefore, we can write down after integration, we will get an expression for the drawdown curve h 0 square minus h square will be equal to this is W divided by 2 k into r square minus r 0 square plus q w divided by pi k into natural log of r 0 by r. So, this is the expression for this drawdown curve in an unconfined aquifer uniform recharge. So, if we know the value of the depth of water above the lower impervious layer, the uniform rate of recharge hydraulic conductivity and the radius of influence r 0 q w which is the steady flow through this well fully penetrating the unconfined aquifer. So, in that case, so this will be the expression for the drawdown and we know that when r is equal to r 0 q is equal to 0. That means beyond this the cone of influence, there is no flow contribution. Therefore, substituting these values, we get q w is equal to pi into r 0 square into W. In this case, so that is so when r is equal to r 0, in that case, so this q is equal to 0. Therefore, if we apply this expression, so in that case, this q w is equal to pi into r 0 square into W. Therefore, so this is the expression for the steady flow through this well in an unconfined aquifer having a uniform recharge and this is the expression for steady flow a fully penetrating well in a confined aquifer, in an unconfined aquifer with uniform recharge. So, it is fairly simple. So, simply the area of the circle of influence multiplied by the uniform rate of recharge. So, that will be given by, that will give the expression for the steady flow through the well. And now, let us consider a well in a uniform flow in an unconfined aquifer. So, again this is a fully penetrating well in a uniform flow through. So far we have seen, we have considered the water table to be horizontal, so that only after the pumping starts, the well starts getting contribution from the aquifer. Now, instead of that, suppose we consider a well, which is drilled through an unconfined aquifer having a sloping water table below the sloping ground. In this case, let us consider, so this is the sloping water table, so with slope of I and let me denote the well axis here, the uniform discharge through this well. And here what happens is, after the pumping starts, then the water table will show a drawdown curve like this, so this is the drawdown curve. And in this case, obviously here, so up to this point, only there will be contribution to the well. And obviously, on this right side, it is fully flowing this one. And if you draw the, so in this case, let us, I am sorry, so this is let us say, this is a confined aquifer. And here, this is the top confining layer and the confined aquifer thickness is B. Now, in let me, so this represents the stagnation, this vertical line represents stagnation. And let us also draw the top view for this, if this is the, let me draw the top view. In this case, this is the well, so here, so this represents the stagnation surface, within this, so these are the stream lines. And here, at any, let us consider this as plus y l, let us consider this as, I am sorry, so this plus y l goes all the way up to here, this is minus y l. And this is, this distance is say, minus x l and obviously, so this is the x and y coordinate. And beyond this, the flow lines will be like this. So, now, for this case, so there is stagnation surface, because of the original slope, that is the original hydraulic gradient due to an inclined water table. So, in this case, we can write down the expression for the hydraulic conductivity as 2 q, k is equal to 2 q divided by pi into r into h u plus h d into i u plus i d. And here, this h u is the upstream saturated thickness, h d is the downstream saturated thickness and this i u is the upstream water table slope and i d, this is the downstream water table slope. By superimposing radial flow and 1 d flow, we get, we can write down the expression for this stagnation surface, that is y by minus y by x is equal to tan of 2 pi k B i divided by q into y. So, this is the expression. So, this B is the saturated, that is the aquifer thickness and q is a steady discharge and of course, I am not going into the variation of this. So, therefore, and this y l is given by plus or minus q divided by 2 k B i. So, this is the distance of the stagnation surface at a distance and x l is given by minus q divided by 2 pi k B i. So, we will stop here and we will continue in the next lecture. Thank you. Bye.


What's up trade hackers welcome to today's update today is Wednesday, March 11th So what is happening in the markets today? Another wild ride? S&Ps down 128 Dow down over 1300 Nasdaq down over 300 Russell down almost 80 looking at a chart of the S&Ps here I mean just just the size of these bars is it just continues to be crazy And so a couple things in the news today Obviously the World Health Organization came out and officially I'm giving air quotes here if you can't see me Officially said the coronavirus is a worldwide pandemic as if we didn't know that at this point But what does that really mean?  Obviously with a situation like that where people aren't gathering They're not traveling Revenues are gonna be down Ford profits are going to be down and so that's what the market is reacting to Obviously in addition we're still in this situation with oil where OPEC is now Meeting Wilson lobbyists are going and trying to get this thing solidified But oil still down a little bit today Obviously nowhere in comparison to the drop that we saw Sunday evening into Monday But so it has rebounded a little bit since then so we do have oil positions on and we're just we're being really patient with this We don't want to get caught in a whiplash situation And so we're just kind of being a little bit patient with any adjustments the same thing with bonds bonds actually pretty flat today They were up a little bit now. They're coming back down and so what's interesting about that is, you know Typically when you're seeing a big sell-off like this in stocks where the market's down four or five percent You're gonna see bonds going higher But that was not the case today and same thing with gold You know a lot of people think that there's a very large Inverse correlation to gold in the market so when the market's going up gold's going down and vice versa That's actually not the case gold is fairly uncorrelated to the markets And we're seeing that today where the the markets are down and gold is also down Whereas, you know, sometimes we'll see the market down and gold is firing to the upside Well today's markets down and gold is down as well So some interesting price action Across the board want to take a look at some of the stocks here I've set my chart up to show year-to-date. So you see instead of the price on the right-hand column here You're seeing percentages. So for example gold year-to-date is up 6.81% but I want to take a look at some of the individual stocks starting with Apple Everyone's favorite stock Apple down just 8.3% So Apple has actually held up much better than a lot of other stocks for example Boeing which first initially had that issue with their Max being grounded and then some continued news releases about today They came out and said they're cutting their workforce as well as freezing all-new hires and anyway, you look at Boeing It's down 43% year-to-date If you look at Bank of America as a metric for the banks down 36% if we look at booking a big travel company down 30% Costco holding up really well still up 2% on the year even though they're out of toilet paper and water supposedly Some of these others that I was looking at if we look at like Delta Airlines DAL obviously the airlines getting hit wrong ticker DAL Delta Airlines down 27% Some of these casinos if we look at win down 10% today down over 43% year-to-date Walmart, you know, it's holding up relatively well only down about less than 4% so oh united health care After you know that super Tuesday excuse me down just 5% so holding up pretty well in the health care sector And if you look at stocks like Tesla for example, which had that huge run up really uncorrelated to the rest of the market And then it has come down obviously since then but still up 47% on the year So Tesla one of the big performers to the upside But like uber and Lyft really getting hit recently, but only down 15% on the year So interesting stuff. So game plan going forward for us We've been very quiet as far as new trades this week Just waiting for things to shake out just a bit if we get another push lower tomorrow We'll definitely start adding some more short premium with him with implied volatility Just through the roof getting some massive credits when we're selling premium both Delta Neutral Strategies and Iron Ducks all we've really been doing this week is continuing to roll down our short Delta So rolling down our strikes rolling down our strikes rolling down our strikes We haven't really added much of anything and so that's that's what we've kind of done to this point through Wednesday but tomorrow I think we're gonna start dipping our toes back in and Potentially adding some new positions. So look for that. Everybody have a nice evening. We'll talk to you tomorrow You


I think the pressure I get to me about this week, I just came out here to do my base. Did that pressure that you've got at Champs help you to walk yourself through this race knowing that you would be under the same type of pressure? Yes, I think it's a learning process, I just need to get used to it. How do you feel about winning the gold medal for sure? Winning the gold medal is just a really good thing, the time actually, I'm a little bit disappointed that it's win legal. Yeah, congratulations to you, well done. Back to Terry and Ricardo.


Pn. Chairman, Pn. Secretary General, Pn. Excellencies, Pn. Ladies and Gentlemen, Pn. In May 2017, Pn. Wanak Rai Ransom were attacked 150 countries and approximately 220,000 systems. It crippled hospitals, banks, and transport systems all over the world. In November 2017, 3.4 million records were leaked in the Paradise Papers incident. In March 2018, data of 87 million individuals were affected in the Cambridge Analytica Data League. Last month, the world woke up to the Facebook security breach in which accounts of 50 million users were exposed. This list goes on. It goes on beyond countries and it goes on beyond borders. Cyber security incidents have become the norm. This is now the world that we live in. Internet of things are being targeted all the time. As we know, any device with Wi-Fi capability can be hacked. Top targets of ransomware cyberattacks are financial services, healthcare, and of course the public sector. According to one report, cybercrime will cost the world some 6 trillion US dollars annually by the year 2021. The hidden cost of data loss far greater. The question for all of us is what do we as a union have to do to address this? We have put some measures in place. In turn, we see bad actors getting even more creative. We are mindful that it is the ITU members who are responsible for the internet, which is the engine that drives the global digital economy. Rolling out infrastructure, improving QAS, and of course affordability, and driving transformation. That all is a given. However, the more we connect our people, the more incidents they are. Hence, the need for us to do more about these cyber incidents which are increasing by the day. We need practical concerted measures to adequately deal with cybersecurity issues. That is one of the reasons why we are here today to find a way to manage all this on a global scale. We need a platform that can deliver one that can act swiftly and cohesively for the greater good. We know this better than most others. In 2014, when we lost MH370, we asked the BB14 for help, and the union came to our assistance immediately. Today, almost all commercial flights can be tracked in real time, and we must thank you for that. There is a lot more that needs to be done. While we open up a world of possibilities to the world's citizens, we also have a duty to protect, and that duty is paramount. Malaysia will extend our full cooperation in this. Together we must make cyberspace a safe place. Mr Chairman, we congratulate you on your appointment and the Government of the United Arab Emirates for hosting this conference. Thank you very much.


I'm Adam Cranfield with Cal OES. This week, Cal OES recognized May 1st through 7th as Wildfire Preparedness Week. In collaboration with Cal Fire, Cal OES toured the states to talk about the importance of being ready for wildfire season. Cal OES has dedicated enhanced technology, more personnel and additional equipment to help keep Californians safe during fire season. The state is also investing millions of dollars to protect our most at-risk communities, ensuring they have the outreach and education needed to prepare for, respond to and recover from disasters of all kinds including wildfires. Also this week, through Listos, California, Cal OES is coordinating an outreach effort to engage more than one million Californians in high-risk flood areas ahead of the possible snowmelt from a historic snowpack in the Sierras. The calls will include flood awareness and preparedness information while encouraging residents to sign up for local emergency notifications. Finally, Cal OES continues to assist local, state and federal partners to provide disaster survivors the resources they need as spring storm recovery efforts continue. Madera, Mendocino and Mono counties were added to the Presidential Major Disaster Declaration making them eligible for federal assistance. Visit our website to learn how to register and find disaster recovery centers near you. To see more from us, visit news.caloes.ca.gov and follow us on all our social media platforms.


When someone you know is depressed or anxious, especially if it's a loved one, you feel the urge to help, to afford some Sakhour, to be there for that person. We are great believers in the power of words. That is a philosophy behind talk therapy. We believe that if we were just to say the right thing, things would get better. And usually, this is actually true. But you need to know which things to say and which things to never say. Because if you were to say the wrong things, this would exacerbate the situation, make the condition worse, deepen the depression, render the anxiety debilitating. You need to know what to say and you need to know which sentences and utterances and thoughts to avoid which cliches to delete from your dictionary. Anxiety, depression, life crisis, they are not easy things to get through. Above all, you should respect the individuality, uniqueness and idiosyncrasy of the person you are trying to help. We are all once in a lifetime creations.   And we all experience our lives differently. It's difficult to communicate or to access the subjective experience of sadness, of helplessness, of hopelessness, of depression, of anxiety. And you need to respect these differences. You need never impose yourself, your point of view, your judgements, your opinions and even your experiences on another person. And this is the topic of today's video. What to say and what never to say when you're trying to help other people. Stay tuned. My never ending ill-tempered rants aside, the truth is that most people are well-meaning. Most people are empathic or empathetic. Most people would like to somehow solve the wounds, afford succour, extend a helping hand, extricate others from the shadow of the valley of death, depression and anxiety. When we come across someone who is in the throes of a life crisis, someone who is given up, someone who is depressed, anxious and fearful, sad, it is an instinctive, reflexive reaction to somehow say the right thing. Reverse course. Help the drowning person, the overwhelmed person. Help him or her out of this seemingly intractable situation. This kind of altruism is again almost biological. We can't help ourselves in the vast majority of cases. And this is doubly true when the person in question is a family member or a good friend or even a neighbor or a colleague there, we feel a kind of obligation to help. And yet when we do try our best to assist, to afford succour, to somehow ameliorate or mitigate the anxiety and the depression and so on, very often we say the wrong things. These sentences, these utterances are automatic. They're embedded in the social fabric. But they're counterproductive. When you say the wrong thing to someone who is depressed, the depression deepens and darkens. When you say the wrong thing to someone who is anxious, the anxiety escalates and takes over. When you minimize or invalidate someone else's experiences, they tend to become either aggressive or self-destructive. In all these cases, this is not the outcome that is desirable. This is not what should be done. And in today's video, I'm going to discuss the wrong way of going about helping people in depression and anxiety. The things you should never say to them. My name is Sam Baknin. I'm the author of Malignance of Love, Narcissism Revisited, a former visiting professor of psychology and currently on the faculty of CAHPS. As I said, well-meaning people, empathic people often make things worse. When they try to intervene or interfere or extend a helping hand or be there, serve as a kind of presence, you need to know what you're doing. This is not extemporizing. This is not improvisation. You can't tackle mental health conditions such as depression and anxiety as an amateur, however gifted. So sentences like get a grip, move on, snap out of it, get over it. These are the wrong sentences because they minimize the experience of depression, anxiety, hopelessness, helplessness. of the person you're trying to help. It's as if not getting on, not moving on, not getting a grip, not snapping out of it and not getting over it are choices. As if this person is somehow spoiled or pampered. As if this person who is literally submerged and immersed in an ocean of depression and anxiety, which is unfathomable, which is endless, profound. As if this person is choosing to be like that, as if it's some kind of a manipulative ploy using the depression and anxiety to control other people. There is, in these sentences, get a grip, move on, get over it. In these sentences implied criticism, criticism which is unfair, counterfactual, counterproductive, hurtful. Because again, what you're telling this kind of person is you're pampered, you're weak, you're spoiled. Another type, another class of sentences which are really, really seriously paired and should be avoided are the sentences which minimize the experience of the person you're trying to help. Sentences like, I've had the very same experience and look at me, I survived, I overcame, or you're not the only one. Many other people have had this experience or nothing that has happened to you is unique or you're just one of many. Or the world is like this. All these sentences imply that the circumstances that have led to the depression and anxiety, external circumstances or internal circumstances that resulted in perhaps grief of some kind, breakdown, a meltdown, depression, anxiety. That all these experiences are actually nothing special. They're very common. They're typical. They don't warrant any special attention or cry for help or perhaps treatment. And anyone who claims to have an experience that is unique or idiosyncratic is lying because this experience is common. Minimizing the suffering person's experience in validating the suffering of the person, the torment incumbent upon mental health illnesses and conditions. This is a really bad thing. It's cruel even to a large extent. Every person's experience is unique to that person. Experiences cannot be compared. This is not a competition as to who has suffered more and don't make it one. Help, if you want to help, help the specific person in the specific circumstances with his or her specific suffering and extend a helping hand which is not demeaning or debasing or critical or conditional. A helping hand which is truly empathic, a helping hand that says no human experience is alien to me. Yes, I've been there before and I know what you're going through, but I can never understand fully your particular, your unique, your personal, your individual experience. The best I can do is offer you a bridge to myself, expose our commonality as human beings and maybe there is comfort in company and maybe there's not. Do not become grandiose when you're trying to help others.  Help is not a transaction. Help is not a form of narcissistic supply. Help is not about making you great again. Help is about restoring another human being by making clear that this suffering person is being seen, is being attended to, that you care about him or her. It's about the other person, not about you as a caregiver or helper. You're not a rescuer and you're not a savior. Another type of sentence which is really, really bad is you have your whole life ahead of you. It is never too late. You're relatively young. Time heals all wounds.  You're not dead and so on and so forth. These are really bad sentences because they imply that with patience and endurance and perseverance and resilience, the depression or the anxiety or the adverse life circumstances or the crisis can and will be overcome. By implication, this kind of sentence says you're overly pessimistic. You're wrong. You're weak. You're not resilient. You're not strong. You are not realistic. The last thing, a person who is embedded in a crisis, a person who is experiencing a collapse of his or her own world, internal and external. The last thing they need is another bout, another round of criticism. They don't need to be told that their perception of reality is distorted. And it is distorted. It's true, but they don't need to be told this. This should not be pointed out to them while they are in the throes of depression and anxiety because it would enhance the depression and anxiety. So there's a question of timing. You need to weigh and consider what it is that you're saying. Is it the right time to say it? Is it the wrong time to say it? Is it the right thing to say? Is it the right person? Because you need to tailor your messages. You need to customize them. Your messages need to resonate with a specific person you're talking to. Do not use canned messages, cliches, because this implies that you don't really care about the other person. If you use cutouts and all kinds of cliches, then it means that you don't want to invest an effort in truly seeing the other person discerning the other person's condition and then investing time and effort and resources in tailoring and customizing your response. It implies that you don't care. At any rate, time does heal many wounds, but not all wounds.  When a person is experiencing a crisis, there's no past and there's definitely no future. A crisis is a state of being 100% present. A person in a crisis cannot contemplate the past because the past is painful and hurtful and the past has led to the crisis. The crisis is the outcome of the past, so there's a rejection of the past. And a person in crisis cannot contemplate the future because he or she is hopeless. There's no hope. There's no horizon. There's no dream. Broken dreams litter the landscape. There's no fantasy even. Even fantasy defenses crumble. So what's the point in telling someone, you know, it's, if you wait long enough, things are going to improve. Or it's never too late. Or there's a long life ahead of you. Or what's the point in telling, in saying all these things? You can't get through to the person with these kind of arguments and you're very likely to antagonize the person, push him or her deeper into anxiety and depression and a feeling of guilt for having rebuffed you and rejected you. The worst sentence you could say is there's really no need to be anxious or there's really no need to be depressed. This kind of sentence which is extremely common is the trifecta, is the mother of all wrong sentences. When you say to someone there's no need to be anxious, there's no need to be depressed, what are you saying? You're saying you're not perceiving reality properly. So something's wrong with you. You're saying you're minimizing the threat or the pain or the sadness or the negative emotions or the envy or the anger. You're minimizing them. You're saying I've reviewed your situation, I've observed you and I think you're wrong. I think you should not be experiencing these negative emotions or at least you shouldn't be experiencing them to this extent and with this intensity. It's again a form of criticism.  Something is wrong with the way you react. Your reactivity is wrong. Whereas most people would not have reacted with depression or anxiety, you do and there's really no need to be anxious, no need to be depressed.  So you're reacting this way with depression and anxiety when there's no need to and therefore something is wrong with you. Minimization, invalidation, humiliation, also implying that there's something wrong constitutionally or fundamentally with a person. This is by far the worst conceivable sentence to say. Anxiety, depression and trauma are subjective experiences. They are not objective facts. Ten people are exposed to the same experience, two of them are traumatized, eight of them are not. Ten people undergo the same life crisis, three of them develop depression, seven are happy go lucky. Ten people are facing the same threat, five of them become anxious, five don't. It is clear therefore that trauma, anxiety, depression are individual subjective mental experiences, not objective facts and not objective ontological outcomes of things, of events or people react differently to the very same circumstances. Stimulize, triggers, cues and information. Why do they react differently? Because they're genetically different. There's a genetic predisposition probably because they have a different temperament. Because they were brought up differently. Because they've had a different type of childhood. Some people have had adverse childhood experiences. Because they've had a different life trajectory. They've been exposed to different events and mishaps and fortunes. So not two people are alike, which is why psychology is a pseudo science, can never be a science. Not two people are alike and you can't hurl, you can't throw at people sentences which are cookie cutter sentences, cliches and you can't expect these sentences to work identically on everyone. You need, if you really care about someone, you need to get to know them a bit. You need to observe them and you need to see them in the deepest, most profound sense. You need to connect. Empathy is about connection. And then having garnered and gathered and harvested all this information, you can tailor your response in all intended to help them. You can tailor the advice and the succor and the help and the compassion and the pity and the empathy that you offer. And if you don't, you're likely to make the situation much worse. When someone is going through a difficult period, you need to validate their emotions and reactions. You need to understand the enormity of what they are going through in their own eyes. As far as they are concerned, their experience is unique, has never happened before to anyone else, and they are right about this. Because experience is individual and idiosyncratic, it is not replicable or repeatable. My sadness, my depression, my anxiety is only mine. And there's never been anyone like me and it's very unlikely that there will ever be anyone like me again. I am unique. I am idiosyncratic and therefore all my experience is a one-time, a one-off. You need to have respect for the complexity of humans and their condition. So when someone is going through a difficult period and seems to be stuck, unable to move on, you need to validate their emotions and their reactions. And you need never minimize and you should never compare them to other people. Never commit these mistakes. You could say, I understand what you're going through. I understand that you feel that it is really bad. I understand that you consider your reaction to be justified. I hope things get better for you somehow, sometime. I'm here to help in any way I can and you deem appropriate. You're in the driver's seat. Tell me what I can do for you. All other types of responses are wrong. If you invalidate someone's thinking, someone's judgment, someone's opinion and someone's actions, you're gaslighting them.  You should replace, you should substitute my thinking for your thinking. You're thinking wrongly, my thinking is right. You're misperceiving reality, my perception of reality is the correct one. That's why you're depressed and anxious because somebody's wrong with you. If you were to emulate my example, you would be in a much better state. There's some grandiosity here, some haughtiness and arrogance in making such a statement. You're not in the position to substitute your experience for anyone else's experience. You cannot enter or access anyone else's mind. You need to rely on their self-reporting and you need to trust them when they say that it's really bad, that it feels hopeless, that they feel helpless, that they are lost, they don't know what to do. You need to accept this. It's a threatening message. People feel threatened, they want to run away. And so they try to counter the message, undermine it, challenge it by saying you're wrong. It's not helpless, it's not hopeless, you're wrong. You're not helpless, you're wrong, you're wrong.   It's too terrifying to contemplate this or to countenance it. You can't accept the innate indifference of the universe. The fact that evil exists and manifests and proliferates. You can't accept these things. So when people come to you and say, I've had the most horrible experience, I don't deserve it. I feel hopeless and helpless. I feel the world is unjust. I don't know what to do. Your initial reaction is to reject this message, to say, no, you're getting things wrong. Your view is absolutely mistaken.  I've done through similar experience, everything was fine. Or you shouldn't be that anxious and that depressed. You're exaggerating. You're minimizing. You're invalidating people. That's not the way to help. And if you are always optimistic, that's invalidating. That's minimizing. To be constantly optimistic, always on optimism, almost malignant optimism is the wrong way to go about it. Because it's delusional and it's divorced from reality. There is place, of course, for optimism because it is true that people who are depressed, people who are anxious are not perceiving reality correctly and appropriately in the vast majority of cases. Not in all cases, by the way. In some cases, their perception of reality is pretty accurate. If you have a stage four terminal cancer, pancreatic cancer, yeah, your perception of reality is correct. So, but even though the majority of people in need, people who are sad, people who are broken, people who are damaged, people who are traumatized. Even though in the majority of cases, these people have an impaired reality testing. They're misperceiving reality. It is not your job to point this out to them. Their reality testing will be restored once they are no longer depressed and anxious. Pointing out to them, pointing this out to them right now will make them only more depressed and more anxious. And when you're constantly optimistic, the message you're broadcasting is, you're wrong. You're wrong about your perception of reality. You're pessimistic, but you should be optimistic. You're pessimistic because you're misperceiving reality. Something is wrong with you. Is this a message you should send to someone in need, to someone who craves affection and compassion and empathy? That's the message. Something is wrong with you.  Everything is going to be fine.  Is this a message? Isn't this, I would even say it's a humiliating message, a cruel message. Go along. If you want to help someone, you need to walk in their shoes and to follow their path. They need to guide you and lead you, not the other way. They know themselves better than you. You should listen to them. You should see them by being silent most of the time. The capacity to listen to truly listen, not to hear. Hearing is a biological function. Listening is a determinant of wisdom. You need to listen and you need to see and you need to be patient and you need to accept. You need to be accepting and you need to let the other person go through the motions and the transformations that they require in order to heal, in order to recover, in order to restore themselves.  Everything is true but you're not overwinning. You're not domineering. You are not criticizing. You're not minimizing. You're not invalidating. You are not being dismissive. None of these things. None of these things is good for the mental health of the person you're trying to help. You need to be there as a combination of secure base, someone who is there and is safe to talk to. And a mirror allowing the person to get a grip of reality through you when he asks you to. And when someone feels hopeless and helpless, you just listen. You don't always need to respond. There is this tendency to, it's as if there's some expectation that you must respond somehow. You must provide a solution. You must solve the problem. You must reverse the condition. And this is a savior complex. It's a rescuer complex. It's not healthy. It's not your job to save or to rescue or to heal or to fix. It's not. Your job is to be a friend, a good family member, a good neighbor, a good colleague and above all a good human being. A fellow human being, fellowship, companionship is the only thing you can safely contribute. To a conversation, a therapeutic conversation with someone who is depressed and anxious. They feel alone, lonely, atomized. And here you are sharing their journey with them, sharing the burden. And that's what you should focus on. You're not in the position to change anything. You shouldn't attribute to yourself powers that you don't possess. You should not take on tasks and obligations that no one asked you. You should not develop expectations and you should not expect and accept expectations. This is not what it's all about. Friendship is about listening, companionship, sharing, caring and being there. End of story. Leave the rest to therapists, medical doctors, priests and pastors. It's not your job.