But, tell us, what are some of the unique challenges that people who remained in Ukraine face? There are two main groups of people that remain in Ukraine. 7.1 million are internally displaced because of the war, which means that they are living in a different place of their normal home because of the conflict. But we estimate that there are also 12 million people who are in cities and are attacked by the Russian forces. And these two groups have, to a certain extent, common needs. First of all, cash. There is a shortage of cash, and people need to buy essential goods for their survival. Secondly, medicines. There is a huge shortage of medicines. Hospitals and pharmacies have been attacked. And thirdly, there is an urgent need of shelter for those who are internally displaced. You know that 10 percent of the people that we have asked told us that they did not know where they would sleep that night. So this means that there is an urgent need to find shelter for the internally displaced Ukrainians.


the challenge of the Yukon. Hon-King Hon-Yosuke! The Wonder Dog King, swiftest and strongest of Eskimo-Leed dogs, blazes the trail through storm and snow for Sergeant Preston as he meets the challenge of the Yukon. Sergeant Preston was typical of the small band of Northwest Monty Police who preserved law and order in the new Northwest country for wealth and power led to frequent violence and bloodshed. But in spite of the odds against them, Sergeant Preston and his Wonder Dog King at that challenge and justice ruled triumphant. The Yukon Knights were long and dull for a boy of ten, but on this certain night in December, Jimmy Haven was bursting with happiness as he sat on a stool beside the man who to him represented everything that was heroic and adventurous.  I hope someday I'll be brave enough to catch thieves and murderers all alone the way you do. Why don't catch them all alone, Jimmy? I have King, remember? In fact, if it weren't for him, he'd be here to tell about it. He's such a wonderful dog. Do all the Mounties have dogs like him? Well, no, Jim, it'd be nice as they could, but there aren't many dogs like King. I was just lucky, that's all. But you trained him yourself, didn't you, Sergeant? For all the Mounties were as smart as you, they... Well, it wasn't the question of my being smart, Jim. It was King's native intelligence that counted. Oh. Did you start teaching him things when he was just a tiny pub, Sergeant? Or did you wait until he was older? I didn't get King when he was just a tiny pub. Until I did get him, I knew he was much more capable than I to teach the ways of the wilderness. King learned things from her that had been invangible. You mean a woman taught him? No, not a woman, Jim. His teacher was a wise old female wolf. A wolf? But King isn't a half-wolf, is he? No, he has a strain of wolf in him from his husky mother. But King was a wolf for a time by adoption. You've never told me how you got him, Sergeant. Please tell me the story. It was quite a long one, Jim. You see, I'm always on the lookout for good dogs. The dogs on my team have to be especially good because of the long patrols through the hardest kind of weather. They have to be fast and tough and strong. I had a friend down in Whitehorse who knew more about dogs than anyone I ever met. He raided them and supplied many of the sled dogs for the mounted police. Always made a point of calling on him whenever I got to town. One day, he rushed me out to his kennels and I'd never seen him so enthusiastic. You were just the man I wanted to see best of me. I've got a pup here that's the answer to everything you've ever wanted in a dog. He's kind of young, just got his eyes open. But is he a beauty? Oh, what breed is he?  The big husky I bought from Jim Toland. She's half wolf and half malibute with a good point of both. She's one of the funnest dogs I've ever had. The pup's father is Silver Boy. Well, I guess I don't have to tell you about him. Champion lead dog in the North Country? I'll see you, dog. Have you ever seen him? No, I always wanted to. The owner is a good friend of mine. That dog is one of the most abusive I've ever seen. Bigger and smarter than any dog I've ever had the pleasure of looking at. Oh, here we are. Now, quiet, Kayla. Here we are, Sergeant. Seven pups. And you don't have to point out that Dave, look at him. He's half again as big as the rest of them. I'll get him for ya. Now, keep still, Kayla. They're not gonna hurt him. Here he is, Sergeant. He is a dog that's going to be better than Silver Boy ever was. Oh, well...  Trying to act grown up before you cut your teeth. Dave, he's a beauty. I've got to have him. Well, Sergeant, he's yours. Ever since you saved my life two years ago, I've been trying to do you a favor. Here's my chance. Well, thanks, Dave. I appreciate it. One of this little fellow will be able to leave his mother. Oh, about three or four weeks, I'd say. You'll go north soon, aren't you? Well, yes, I hadn't planned to come back to White Horse for a couple of months. Well, I'll tell you what. I have to go up to Selkirk in about four or five weeks. I could bring the pup with me if he could meet me there. That'll be fine, Dave. Send me a telegram at Dawson headquarters before you leave, and I'll meet you in Selkirk. Something happened to me, Jim, when I took that pup into my hands. I wanted him more than anything I've ever wanted in my life. I waited impatiently for the telegram from Dave, and when it came, I got to Selkirk a day before he was due to arrive. But two days passed, Jim, and he didn't show up. Another friend of mine, Jud Ames, was starting down to White Horse, and I decided to go with him partway to see if Dave had met with an accident. We'd been on the trail twelve hours and were traveling along a narrow ridge at the side of a mountain when Jud suddenly stopped and called out. Sergeant, look down there below the ridge. You got a sled? Hello. Hi, old Husky. Where, Jud? Look down there at the bottom of the ridge. That's the sled turned upside down. Oh, yes, it is. And look, the sighted, half under it. Isn't that a man? Yeah, you're right, Sergeant. It is a man. We're getting down there right away. Where are his dogs? Inside of them? Traces must have broken or something, and the dogs didn't go with him.  I was moving up hill. Traces broke, the sled must have backed down on him and carried him over the ledge. I hope it wasn't Dave. Jud, help me lift the sled off him. He was carrying a heavy load. It is, Dave. Looks like his neck was broken, poor fella. He was one of my best friends. Wonder what happened to the pup he was bringing to you. There's no sign of his body. Hey, Sergeant, look! Here are some tracks. Where? Yes, they were made by a pup. He's alive. Must be around here somewhere. It's a little. He couldn't have... What's wrong, Sergeant? I guess we're too late. Look. Ah, wolf tracks. A wolf wasn't he? Yes, a wolf got here first. Yeah, but there's no sign of blood. It didn't kill him here. Probably carried him all somewhere first. Tracks lead up into that gorge. Look, look at this wolf track, Sergeant. Here are some clear ones. That wolf must have been caught trap once. The left front foot is only three toes. Yes, you're right. Yes, too bad all three toes got here before you did. You were sure counting on that pup? Yes, I certainly was. Well, nothing we can do about it. It's getting dark, Jed. But I got Dave's body out of here while we can still see. Didn't you try to track the wolf and kill it, Sergeant? No, Jim. I didn't see how that would help matters, any. I had to get Dave's body back to Whitehorse and see that his affairs were settled. It took about three weeks. It was over 200 miles to Whitehorse. But on the way back, didn't you try them? No, I was put on a case that took me up into the Arctic and I didn't even get back for over four months. Then one day when I was on a patrol near Selkirk, I met Andre Dupre on the trail. Andre was an old frontrapper. I'd known him for years. Hello, how are you, Huskies? Hello, Andre. Sergeant Preston, for a long time I have not seen you. How are you? How's the trapping coming along? I am fine, but trapping, she's not so good. Oh, really? Well, I thought there was lots of game around here. This has been a good season everywhere. For me, too, it would be a good season. Once I could catch Old Thrito. Old Thrito? What's that? She is big timber wolf that live around here. For more than a year now, I have tried to get her. But she has brain like human. Sometimes, I think maybe she is half-witch. Half-witch? Does she rob your traps? She knows so much about traps. Someday I think she will set one and catch me, Andre. Well, how do you know it's the same wolf that does all this? Once I almost catch her. One year ago, I set two traps. One nearer. She almost caught. In one trap, I find purple food. Now, two toes are missing on front foot. Her tracks I would know anywhere. How do you know it's a female? Because, in last few months, she has one young one with her. Their track, they go together. That young one is smart like his mother. She teach him every trick. Between them, they kill so much game, there is nothing left to trap almost. Andre, you say she has a young one with her? Way, for last two months. Andre, I'm going to help you track down old three-toe. You, Sergeant. I have a special reason. I'll tell you about it. Well, maybe with you, I could do it. But she is very smart, Sergeant. Me, I have tried to track her, but every time she fooled me, maybe between us we could do it. No, Jim, I hardly dared hope that old three-toe was the same wolf that had taken the pup from Dave's sled, and by some miracle had kept him alive. Gee, most wolves would have eaten him, wouldn't they? Yes, Jim. But there was a slim possibility that three-toe had had a litter of cubs, and that they had been killed by something when she was out foraging for food. She may have taken the pup back to replace them. Maybe the puppy was the same size. We'll never know what really happened. We spent almost two weeks with Andre trying to track her down, but she was too clever. Then, one day when she'd fooled us again by crossing some bare windswept rock, leaving no trail, I decided it was no use. Andre was ready to give up, too. You see, she is smart like witch. She'd disappear. I'm afraid I've spent too much time on her already, Andre. I guess we'll have to give up. Listen. Animals fighting sound like wolf and lynx. We're downwind from them. Okay, let's see what it is. It's a new edge of creek somewhere. What's screeching? That noise is coming from that crack in this cliff. That is too small for Andre to squeeze through. Not with these belly. Maybe, sergeants, you could do it. But not if you meet wolf at the end of it. Must wait until it gets deeper. Andre, you stay here and guard the opening. I'm going to climb up on top of that rock. If the crack widens, I'll be able to see down into it. Be very careful, sergeant. Jimmy, I'll never forget what I saw on top of that rocky cliff and peered over the edge of the opening. It was a perfect hiding place with a layer of three-toe. Six feet from the opening into the creek, the crack widened, giving room for one of the fiercest fights I've ever seen.  The big wolf and the lynx were in a swirling knot of fury, and slashing in as hard and as fast as he could was a half-grown silver grape pup who tore frantically at the flanks of the lynx. There's too much for old three-toe, and the battle was slowing down to the point where I could get a shot at the lynx. Guard that opening down there, Andre. Don't let anything out. I am watching. Was it three-toe? Yes. I don't think she'll bother your traps anymore. Well, I shot the lynx that was killing her. The pup. He is still alive? Yes. I'm going in after him now. But three-toe, if she is alive... I'm afraid poor three-toe is past being dangerous, but that pup's going to be mine. It's a narrow opening, Jim, and I squeeze to it. As I walked toward the scene of the battle, old three-toe was breathing her last. The pup was whimpering anxiously beside him, but when he saw me, he staggered to his feet, growling as viciously as he could. But so tired, he could hardly stand up. I made a small noose in the rope I was carrying to muzzle him, and I walked toward him slowly. Steady there. Now, if you just let me get close enough to put this over your head... Oh, my hand. I've got to get this noose on you. There. There, I've got you. Now, hold still. Hold still. Are you all right? I got him, Andre. I got him.  Now, you're going with me. Three-toe, she is dead. Three-toe is dead, but this pup's certainly very much alive. Now, young fella, we can just get through this narrow place. There we are. Look at him, Andre. Isn't he a beauty? I couldn't... He is a beautiful way. But so fierce. Oh, Sergeant. Sergeant, your hand. It is sliced to the bone. Yes, he put up a good fight for his freedom, Andre. But I like him, boy. Listen to him, Andre. Just five minutes ago, he was helping three-toe fight in lengths, and he still has lots of fire and spirit left. Come on, young fella. We're going to like each other. Where that big scar on your left hand is, Jim? You know, that was the first and the last time that King ever bit me. Wasn't it, King, old boy? Look, Sergeant, he's licking the scar. We've done that hundreds of times, Jim. I doubt that he knows just what he's doing. But I like to pretend that he does. These copyrighted dramas originate in the studios of WXYZ Detroit, and all characters, names, places, and incidents used dishes. They are sent to you each week at the same time. Hugh Holder speaking. This is the Michigan Radio Network.


seen that how we can effectively use the offset to take care of many situations in which you can have much better efficiencies by using this method which is only a method of application and changing your layout. One thing which I would like to point out here that by the use of this offset it can also make lot of difference in terms of your parameter selections or in terms of the design of the system. You can get much more flexibility of the design 6 meters, so in sprinkler efficient design you must have at least 6 meters of overlap in terms of the overlap in the vector diameter. In the vector diameter you must have for the design to be acceptable along the main line, you must have at least overlap of 6 meters but by utilizing the offset when you use the offset this limit can reduce to 3 meters, this overlap, overlap in the case of offsets can reduce to 3 meters. Now this gives you lot of flexibility in terms of if you have a situation where your DW requirement is coming to be very large now by using the offset you can take a DW which is or you can make the selection of the nozzles in such a manner that a DW which is lower than that level can also be made use of. So from that angle you will get lot of flexibilities by using the offset procedure and it also the use of offset also enhances uniformity that we have seen in the last lectures we had taken up the situation where we had seen that how the uniformities can be enhanced by the way we make the applications by creating the offset and locating the position of the nature. With that we will go to the next element which is the irrigation interval. Now irrigation interval is a very important element in the design, what do we mean by the irrigation interval first of all? The irrigation interval pertains to the time which is available for applying the irrigation. If you have an area let me take any one area, if you have an area now you are irrigating the total area through some system you have different options available as a designer you have different options available. You might run a mail line and then try to irrigate the area through two different settings half the area in one setting, half the area in another setting. You also might try to divide this into three components, now whether I divide it in one component or the two components or three components this decision makes lot of difference in terms of the total equipment requirement. If I want to irrigate the total area in one go I will need more equipment, it is not just the equipment also I might need different discharges I might need different set of all those parameters which can take care of this combination but that is the question is something different right now we are trying to look at the irrigation interval, from the irrigation interval point of view. If I have the total area divided into three compartments or three separate sub areas I first I irrigate this area then at number two setting I irrigate this area, number three setting I irrigate this area and then again I come back to the previous area. Now how much time I have taken in irrigating each of the area and how much time has lapsed in total between the first irrigation and the last irrigation? We have to look at that lapsed time, is it a time which cannot be this area cannot wait that long by the time I come back to this area, if that is the situation then your irrigation interval is much larger than what is the desirable interval, your irrigation interval cannot be of such a length where the soil moisture reaches below a specified or a desirable level. So if your irrigation interval is going beyond that that means you have to do something to ensure that you are irrigating the whole area in such a manner that you are able to come back to the first area where you started with within a period which is the desirable period which you can delay the irrigation or you can use the second irrigation after that much period and that will be a function of the climate, what is the rate at which the water is getting lost from that soil zone, so all those things we have to look into it and decide accordingly how the parameters have to be set. So when we say irrigation interval we are what we mean is that what is that the duration of the time which we can use for actual application of the water okay and the irrigation interval arrive at the desirable irrigation interval you will like to find out what is the total allowable depletion will be a function of total allowable depletion which in turn will be a function of these quantities, what these quantities are, TAD we have dealt with earlier is the allowable depletion, let us say this is expressed in millimeters, TAM is the total available moisture, total available moisture is the depth per unit depth of the soil, so millimeters per meter depth of the soil and the MAD is the management allowed, this is something which is a prerogative of either the management or the farmer and this is expressed in fraction whether you will deplete 50 percent of the available moisture or up to 60 percent or up to 40 percent that is what and DR is the depth of soil zone or effective root zone and meters, knowing the total available moisture which is a function of the soil type, knowing the management allowed depletion which is a function of again it depends on the crop type, how much, how sensitive the crop is we have seen all these things and depth of the root zone we also know, so knowing these individual quantities you can find out what is the total allowable depletion, how much deficit can be created in a particular soil with respect to the crop which we have, the TAM normally the total available moisture is the difference between the field capacity and CEW which is the limit of crop extractable water, so CEW you will see is the crop extractable water millimeters per meter, this is also the field capacity per meter depth, the TAM as we have just said that is a function of the soil type soil it is sandy soils, TAM is around 80 millimeters per meter sorry and for medium soils all this is available literature these values are standard values might change when you have more elaborate soil classification, similarly the MAD values again as we have just mentioned that depends is a function of what type of crop is in question, if you have high value crop is shallow rooted MAD around 33 percent, so the level of extraction is much lower when you have more sensitive crops, when you have medium value crops, medium rooted you can go up to 50 percent and for low value crops normally they are rooted and depletion can be as high as 67 percent, these are some of the values which are order of magnitudes not little values they can change, can change from situation to situation but in general you will find that the deficit which you can create which you can afford to have will be much less if your value of the crop is quite high and it can go up if the value of the crop is low because it is attached to the yields, how much the yields will be affected because of these higher deficits because if you create higher deficit there will be more stress in the crop, whether the crop can take that stress or not that is the question. Now the irrigation interval is basically now if we say that T i is the irrigation interval is nothing but total allowable deficit by what is the rate at which this deficit is being created or if you say that this is the availability of moisture because that is what you will like to replenish and then at this rate this is going to be lost, this 80 crop is the peak period crop water requirement, this is peak period crop water requirement millimetres per day this quantity is in millimetres you will have T i the irrigation interval in base. So this basically shows that how long you can wait for the next irrigation and that is dependent on at what rate the crop is utilizing the water and how much water is available. T i is the we are basically saying the total allowable depletion so this is the moisture which can be extracted which can be allowed to be extracted and that moisture is depleting at this rate so you can get a value of the irrigation interval which is which is permissible. Now it is not necessary that you have to complete the irrigation in that period you might decide that is again a management decision that is a decision which is which is dependent on you as a irrigator or as a farmer, how much time you want to utilize for the irrigation to be completed but it cannot increase this period the irrigation interval period. You must complete the irrigation within this interval it can be much lesser than this but when you try to reduce it drastically then to apply that water quickly you will have you will incur other problems. So you might not be able to for the design to be better for the design to be economical you will find that you might try to be quite close to this irrigation towel which is available to you because of the various other reasons which we will just look at as we go further. Then comes the aspect of nozzle selection criteria. Now this is a very important aspect in the sprinkler irrigation design because this is the main thing which is deciding most of the other parameters because the selection of this will influence almost all the other parameters whether is the rate of application or is the discharge or is the pressure or is the wetted diameter all those things are interdependent and even the spacings because all those the spacing also is a function or is dependent on which sizes you are using and what will be the distribution pattern what will be the wetted diameter all those things are interrelated. So if you look at this the background of this the nozzle selection let me give you some of the statements which are which will give you the interconnection which are there or the dependences but if we have a nozzle operating at low pressure this will result in operating cost the pressures are low the operating cost will also be lower is quite understandable. But if you have a lower pressure nozzle what is the impact of this selecting a lower pressure nozzle the impact is that you will have smaller wetted diameter as well as lower discharge rate after taking this this step you have landed yourself into this result that by selecting a lower pressure you have reduced the wetted diameter you have reduced the discharge rate also. Similarly if you select a particular type of the nozzle the nozzles can be they can be sprinkler head with a single nozzle they can be sprinkler heads with double nozzle so let us say that if you select a single nozzle what is the result may be that it might it will have a lower uniform to coefficient by the same time under the wind conditions it might be quite effective so it will be it might perform or it will perform better under wind conditions in comparison to the double nozzle sprinklers whereas the double nozzle sprinklers are uniform to normal conditions. Now this high uniformity is because of the increased discharges so in this case the discharges will also be higher in the case of double nozzle so they are when you choose one thing there will be some plus points there will be some minus points and that is where is is important to understand that the nozzle selection procedure is a very iterative procedure it has pros and cons so you have to you have to make a selection and then see for example the various indicators the various constraints whether they fulfill all the constraints or not and accordingly make the choice you might have to come back to the various levels make a selection if it is not satisfying your criteria make another selection and then ultimately select one which satisfies most of your conditions. So is a is a is a trial and error is a balancing approach that is important to understand but the general criteria you must look into make the nozzle selections these criteria these are the discharge should be gross application rate. You know that one of the gross application rates we have even looked at a table which we had formulated where we had given the gross application rates which are desirable rates under that the specific conditions so you have you should should intend to choose those nozzle sizes which have the discharges which are high enough to meet this criteria of having the gross application rate satisfied. The net application rate because gross application rate takes into account the the evaporation and the drift losses also that means the amount of water which is coming out of the nozzle should be at least taken care of by that selected nozzle but when you come to the other side the net application rate you have a criteria which is just diagonally opposite. The net application rate should not exceed the the intercrate of the soil that means you have a constraint on both the sides on one side you are saying that the gross rate must be sufficient to to take care of the application and the gross application rates. On the other side it should not be very high so that the net application rate becomes such that it produces the surface turn off. So you have a you have a close range to play within and that is where the nozzle selection becomes a very very important aspect. Similarly the selection of the nozzle in terms of the rate of application or the discharge which is prevailing discharge it should be let me say q should be sufficient to apply net irrigation. Now comes the the question of how much time you are taking to make the same application which is related to your irrigation interval. Q should be sufficient to apply net irrigation within the operating schedule. You cannot select a nozzle size which has such a low discharge that when you talk in terms of the time taken it should exceed the total setting or the total irrigation in the total area under your interest you exceed the irrigation interval. So that is another constraint put on the nozzle size because the discharge will also be a function of the nozzle size along with the other things like the pressure and those things of course. Then you have another requirement that the wetted diameter must be compatible with the spacing the main line spacing and the lateral spacing the lateral spacing and the main line spacing. So again how much wetted diameter you are going to have is a function of the nozzle selection is dependent on the nozzle and the spacing you have to have a compatibility between the spacing and the wetted diameter because we have said that there should be a minimum overlap of 6 meters. Now that overlap of 6 meters will come only through the overlap of the wetted diameters and the overlap will be decided also by the spacing which you have utilized. So this spacing is also related with the type of nozzle which has been selected as a result you can now appreciate that nodal selection is a very iterative it has to be a very iterative process is very very uhh can be subjective also because there are many sizes of nozzles which are available which when you decide it can be uhh they can be quite close if I give the nozzle selection to 3 different people they might come out with some nozzles which are which are keeping track of all their requirements or within their uhh their uhh their setting which they have decided on because all these things can change drastically the way you are going to operate the system. So you cannot standardize these things they are highly subjective but from that angle only all these constraints have been put they have been made elaborate elaborated through various uhh different uhh criteria so that you force the designer to be within those constraints and with that thing in mind there are many tables which have been developed to help the designer in looking at or in picking up these proper uhh design parameters and the tables I would not uhh give you the tables here I will just tell you that what type of tables are available what are the various parameters which they are uhh utilizing. For example there is a table which gives the wetted diameter n meters for different under different pressure the nozzles of different diameters so for different nozzles running under different pressures you have their wetted diameter or the wetted diameter varies because if you want to uhh uhh select a wetted diameter which is which is a desirable wetted diameter you can use this table. There can be another table which discharge in liters per second the other parameters are the pressure and the nozzles of diameter as you have in the case above the table above. So for different example I can give you the values of uhh some of the nozzles of diameters the range can vary this is from 240 kPa to around 380 kPa so we have the discharges which are uhh under these conditions what will be the discharge available. Similarly the many other tables there is another table which give you the average gross application all these tables will be available in the source material the average gross application dg in centimetres per hour in this table discharge per nozzle the discharge per nozzle is known for different nozzles in liters per second and uhh these discharges vary from 0.126 liters per second to 0.631 liters per second now depending on this theta plus the sprinkler spacing which is the mean lines spacing and the literal spacing for different combinations of spacing for example this table gives this is in meters for different combinations of spacing and for different discharge per nozzle what will be the average gross application which you will get obtained and gives the information on that so you can make the selection directly whether how much gross application uhh average gross application you will get in under those circumstances when you select a particular nozzle so that way there are many such aids which have been provided for making the designers effort quite uhh minimal and uhh the designs can be can be taken up quite quickly but the fact remains that this is a very very uhh specialized job in the sense that you must understand what you are doing once you understood the thing properly then there is no problem you can uhh make the designs without any uhh any big problem. Let us take a one small example to just go through how we make use of what we have gone through so far how we actually make use of those uhh those details or those elements which we have studied so far in an actual case we will take a small very small case where we have uhh some available data and how we can make use of that available data along with the various conditions which we have imposed to come out with a relevant and proper design. The data given is quite elaborate we are assuming that we are uhh using a side roll system the climate of the region is crop period requirement 7 millimeters per day then you will need some meteorological data and the meteorological data uhh this is this pertains to the peak period and the meteorological data is given in the form of the maximum and minimum temperature the minimum temperature is 10.5 degree centigrade maximum temperature absorbed is 27.8 degree centigrade. Now this you can obtain the average temperatures over the days 19.2 degree centigrade similarly the other meteorological law variables which are available are the maximum relative humidity is 93 percent and the minimum relative humidity is 39 percent which again gives mean relative humidity of 66 percent. Then you have the wind speed at 2 meters height is given to be 6.4 kilometers per hour. Or if you want to convert that you might need it in meters per second 1.78 meters per second. Besides this basic data there are some other data which are relevant and which is which are required for the design purpose they have been taken accordingly. The total allowable depletion is 82 millimeters maximum application rate we call it as 0.76 centimeters per hour or 76 millimeters per hour and along with this you have the design constraints the design uniformity which is desirable is 85 percent and the adequacy level is 90 percent. Now these are the various uhh data available there is one more uhh segment of data which is available that the spacings like to have is dependent on what type of equipment you already have available with you. So from that angle the main line spacing should be either 15 meters or 18 meters and the lateral spacing should be 12 meters. These are very realistic uhh constraints which will be normally you will feel that they are there because of the way things are either the farmer is already having some equipment so he will not uhh with each design he would not like to buy new equipment. There might be some flexibility in terms of uhh he has two different types of uhh pipelines or one of the pieces available how he can join them. All those things are equally important. Now besides this basic data there are some constraints on the operations also. So on the operations side the constraints which are there they are the system is to the operating time 20 hours out of 24 hours. This is quite likely that out of the 24 hours the 20 hours are kept uhh for operation the remaining 4 hours are for removing the pipelines and uhh those activities you need to have some time which will be the time when the system would be running. It is also advisable to run the system, it is desirable that the system should run on operating pressures which are this will reduce the operating operation cost. So the operator wants to run the system on the minimum possible pressures operating pressures. Another constraint use single nozzle sprinkler head. Based on this data and based on all the desirable uhh constraints you have to design the system. When you say you have to design the system what you will what you will design it for the design should include the selection of nozzle diameter, what size of the nozzle should be used, what should be the operating pressure, what should be the wetted diameter, nozzle discharge is once you have found out the selected the nozzle diameter and the operating pressure of the nozzle discharge can be known but you are interested in knowing the nozzle discharge also. You are interested in finding out the gross application, the actual time of operation. We had said that we will try to confine our time within the irrigation interval but the actual time of operation can be much lower or it can be within the irrigation interval. How much will be the actual time of operation that is what we have to find out and that will be a function of what are the other parameters which have been selected. I think we will stop here because you would not be able to finish the thing within the remaining time. I will give the answers to any questions if you have, okay. So we will take up this exercise in the next class.


According to HTTP Archive, a median page on mobile weighs 1.5 megabytes, and about half of that weight are images. Serving images of the right size, not too small, not too big, can speed up your site significantly. This page uses a lot of images. Let's see what Lighthouse Report can tell us about it. Well, it tells us that if you reduce the image dimensions, you can make your page load faster by three seconds. Now that looks like a good idea, so let's get down to it. Let's look at the worst offenders first. The best place to start looking is Chrome DevTools Network Panel. Here, you can see a list of everything loaded by the page. Let's select Image Filter to focus on images only. The page is loading 11 images, and the total weight of the images is 2.3 megabytes. The biggest one weighs over 700 kilobytes. This image is the hero image on the page. Because it's a hero image, it has to be as big as the window is, but it doesn't have to be bigger than that. The current pixel size of this image is about 2,200 by 1,400 pixels. Let's create two new versions of this image, a medium and a small one. This is much more than we need on most of our users' devices. Generally, the size of the image you need to use depends on the user's device. It's screen size and pixel density. High resolution screens display a lot of pixels, but don't go crazy. Start small and then test what works best. You will rarely need an image that's more than 800 pixels wide. A rule of thumb you can use is that most images should be below 100 kilobytes, and an image should be no bigger than 200 kilobytes times the portion of the screen it takes up. Because this image is used as a CSS background, I cannot use source set to tell the browser what images are available. Instead, I'll use media queries to tell the browser exactly which image to use with the respective screen size. Well, let's reload the page. You just reduce the page weight by over 500 kilobytes by optimizing only a single image. For another user on the 3G network, the site now loads three seconds faster. Faster images lead to better perceived performance on the site and can positively impact the bounce rate as well as user engagement. I hope you find this tip useful and thanks for watching. Check out our other videos for more tips on how to make your website even faster.


Next question is from Jackie 18. Is there evidence to suggest that eating more meals more frequently throughout the day is better for weight loss than two meals with the same amount of quality calories? There's, okay, so here's a deal with this now. Now, we've been told for a long time in popular fitness culture that eating small meals was superior, right? So if you ate, this was the story at least or the narrative.  It feeds your muscles, amino acids throughout the day. Therefore, it's better for burning fat, building muscle.  Okay, is there evidence to support this? Hardly any to zero.  Personal preference. That's the most important thing.  You're gonna eat five meals, it just makes more sense. And then supplement companies got their hands on this and said, oh, what a great way to sell meal replacement bars and powders because if I sell the average person that they need to eat five meals a day, they're gonna eat breakfast, lunch, and dinner or maybe just lunch and dinner. Difficult to prep all those ahead of time and then so you get other companies, the six-pack bags and all that kind of stuff, yeah. But I mean, that's something that's been crammed in almost like everybody's head in terms of like, that's the healthiest way to approach it. But honestly, it makes a lot more sense for a bodybuilder's trying to get more calories in because big, huge meals, that's pretty difficult to digest. Absolutely. Well, this myth originally came from the whole thermogenic effect from the calories. Which is the same, right?  So they're just smaller thermogenic effects. The net thermic effect is the same. Is the same, so it doesn't really matter. Where I see a lot of value in this and where I would have clients do this all the time was actually just to teach them portion control. You know, you do two massive meals, it's really hard to kind of get an idea of like what six ounces this is, what 12 ounce of that is, is how many calories is this really. Where if I had a client and I say, okay, your total calories is 2,800 calories and I divide that up over five or six meals, they see these little small portions and get an idea of like where their meal, what their meal size should kind of look like. And you just kind of teach good behaviors that way. That I liked it for that, or to your point you guys bring up with the body builders is yeah, when I was eating 5,000 calories, yeah, good luck eating that in two meals, especially if you're eating whole foods, just not happening. So for those reasons, it makes sense. At the end of the day, it's whatever you're most consistent with. So if you do better with prepping five or six meals and that you like to just kind of graze all day with small meals, because here's the thing that I also like about that too, you never get really, really hungry. And what I have found when clients get really hungry, the cravings set in, and you're more likely to make bad choices.  I'm driving home from work and I'm easily influencing. You know, Katrina's calling me, what do we want to do for dinner? And I'm like, I haven't eaten all day. I'll have whatever you want to have. First is if I had already had three, four meals, they were balanced and everything like that. I'm not starving like, oh, well wait, and then I'll have another one of my meals. So that's another reason why I like the small meals and that's more of the mental discipline. Yeah, and again, I've had clients that do far better with fewer meals. It actually helps them eat less calories and they're busy and when they're working, it's not that big of a deal.  Personal preference 100% should dictate this for you. How do you, and for me, for example, I'll give you an example, eating small meals throughout the day doesn't work with my gut. It just doesn't work well with my gut health. I do far better having long breaks in between meals, reduces inflammation in my gut, helps me with digestion and I just feel a lot better doing it that way. But I know people who are the opposite. I know people who are like, man, I can't eat one big meal. It hurts my stomach. I'm doing better with smaller meals. Personal preference should dictate this. There is no real significant advantage one way or the other, except for the extremes. Like obviously you don't want to eat like once every other day or you don't eat 10 times in a day, but within reason, doesn't make a big difference. Really just follow what works best for you. What makes you feel the best?


We begin by praising Allah by thanking Allah and by reminding ourselves that our purpose is not this world We weren't created for this world We are travelers in this world We are strangers in this world and If we take this world as our home We're confused this world is the home for the homeless at Dunya Daru Manila Darala We already have a home our home is in the next abode the next life Let's not be confused and We also are here to warn ourselves that we're returning to Allah and We come on Fridays to rectify ourselves and to beg Allah to rectify us To reorient ourselves to a higher calling to a higher purpose this world Catches up with us It hypnotizes us. We get busy. We get distracted. We get deluded, but in the end Waladarul Akhirat Khair Waladarul Akhirat Khair The next life is much better The next life is much better Waladarul Akhirat Khairun Laka Mina Lula the next life is much better than the previous one Waladarul Akhirat Khairun Wa Abqa the next life is Much better and much more everlasting And so we come on Fridays to remember that and we need this reminder Because sometimes we forget by our nature But in the end when we go to the grave and it's our turn When we're in the coffin and we're wearing our kefen The kefen has no has no pockets The kefen has no pockets We're not going to take anything with us So when we go to the grave Three things go with us and two of them return and one stays with us We go to the grave with our families with our money and With our deeds and our actions Our families go back our money goes back and the only thing that stays with us illuminating our grave is our deeds and So my question for us today Why is it? Why is it sometimes that we are satisfied with our level of spirituality and At the same time dissatisfied with our level of Materialism why is it that we're satisfied with our religiosity with our religiousness? But we're dissatisfied with our dunya. Why is it that we're satisfied? We're satisfied with how much how well I can recite the Quran But I'm not satisfied with how much money is in my bank account Why is it that we're satisfied with how many with my concentration in prayer or how much? But I'm not satisfied with how much I'm getting promoted at work Why is it that we're satisfied and with how much the kid we do and remembrance of Allah, but we're not satisfied with the size of our home Or the luxury of our furniture Why is it that we're satisfied with how many days we fast in the year? How much Sadaqah we give but we're not satisfied With the kind of car we have and the challenge today the invitation today is to switch those switch those two words satisfied and dissatisfied and Switch the lens in which we're living and and and traversing this light switch the lens and So that way we can be dissatisfied With my level of thick it and so I can do more Dissatisfied. I've only fasted. I only fasted Ramadan. Let me add a few days in the year Let me add out of that. Let me add 9th and 10th of Muharram Let me add, you know, three white days of the lunar month 13 14 15 Let me be dissatisfied with my concentration and prayer so that I can Try to concentrate more When we go when we look at our career, why why is my house not big enough? Why is my promotion not soon enough? Why is my raise not coming quick enough and We carry that burden. We feel that burden. We think about it But when it comes to how well I read the Quran, how much I understand the Quran It doesn't bother us. And so today the challenge is to switch these two lenses and The way we can do that is this prescription as follows when it comes to materialism dunya money cars house square feet Shoes clothes apparel when it comes to all of these things Which the Son of Adam is never satisfied except with dirt in the grave.


Imagine for a second that the tunnels you just saw are actually fiber optic cables, and the blinking lights are beams of light transporting data at over 300 kilometers per second. Light travels faster than anything else in the universe, which makes it perfect for the communications industry, that and the fact that it can transport information wirelessly. So what exactly is light? Light is composed of tiny, tiny particles called photons. These photons travel through space as oscillating electric and magnetic waves. The speed of the oscillation is what determines what color light you see. However, most light oscillates too quickly to be detected by human eyes, which is why we're not constantly blinded by radio signals. I love science because it reveals the hidden mechanisms behind everyday things, such as light. It's like a treasure hunt for the secrets of the universe, and every discovery can lead to amazing technological advancements. Seriously, imagine not having phones or...


So once again, to recapture this is what I have taken from my introduction. This is the input to the lexical analyzer, which is sequence of characters. And what it generates is a sequence of tokens. And in the process, it does error reporting whenever it finds that some token is not properly formed. And the whole thing is modeled using regular expressions, we then use finite state machine or finite state automata to implement lexical analyzer. Now before we get into really the implementation, we need to understand few terms. So one common term, I will actually introduce three terms to you. So one is what we know as the token. Another is the lexical analyzer. And the third term is going to be rules for construction of tokens. So if you understand clearly what are these terms and what does it mean? What do these terms mean? So once again, let me go back and start taking an example and introduce these terms by an example. Suppose I write an expression like this and I am trying to tokenize this. I am trying to compile this particular expression and obviously remember that this is in certain context. So I am not looking at the whole token, I am just processing on this one. And typically what I will be doing is I will be passing on information like saying that there is an identifier. There is another identifier, there is another identifier. This is an assignment operator and this is an addition of it. So my stream of tokens is going to be id is assigned id. So this is what my input to this lexical analyzer will be. So what we have are, if I look at this and this, these are really nothing but the tokens. But if I look at this string, if I look at this string and if I look at this string, these are really the lexies which are associated with these tokens. So tokens are this class which we are going to pass on to the syntax analyzer associated with each of these entities is going to be a string which we call lexie. And then we have rules which will say that how these tokens are going to get constructed. So this is the 3 terms we are going to use very commonly. So sentence consists of a string of tokens which is really a syntactic category. So if I look at identifier here, this is nothing but syntactic category. So this is one can be used. Second will be, so here is an example where we have numbers, identifiers, keywords, things and so on. And when I look at sequence of characters in a token which is really this sequence which is a lexeme. So for example, that is if I say 100.01 that is a number. Or if I say counter which is an identifier or I may say a keyword which is a constant form, there may be a string. So string always comes within codes and here we may say that this is really the lexeme which is associated with this particular token. And what are the rules of description? So I may have a rule like this. It says that how an identifier is going to get constructed. So each identifier must start with a letter and must be followed by 0 or lower of sentences of letter or number. And in the process what we are going to do is when I tokenize my input, I also want to discard all the useless information. So what is useless information here? So all the spaces here may be useless. So I may put one blank, I may put two blanks, I may put a tab, but that doesn't add anything to the meaning of the program. So I may just discard that. So all these white spaces which are blanks, tabs, new line characters, all these are going to be discarded. Unless they utter as part of a string. If they are part of a string, then that is really the lexeme and I cannot discard that. And also what we want to do is whenever we deal with numbers, I don't want to pass this as a character sequence, but I want to convert this into a number. So for example, when I am reading this, I am going to read six characters, which will be 100.01. But when I pass on this information to the syntax analyzer, I will say I have read a number whose value is 100.01. So I should be able to convert this character sequence into a number. So for all numbers, I will do this conversion. So when I pass on this information, I will say here is a token which is number and the value of the number is 31. I will not say the value of this number is as a character sequence p forward by 1. And we also need to recognize whether I have certain keywords. Now the rules of construction of keywords are similar to rules of construction of identity parts. But certain keywords in some languages or in most languages are not some. They are going to be reserved. So we will have to then take an input like this. So if I say that my input is counter being assigned counter plus increment, this is a common thing you will see x is sign x plus 1. So what will I pass to the syntax analyzer? This is what I am going to pass to the syntax analyzer. And every time I do that, I will have to check whether I am dealing with one of the identity parts, one of the keywords. If I say it is a keyword in my language, then I don't want to perhaps deal with these kind of situations. Some languages will permit that, but most languages will not. So I need to figure out that whether I am dealing with an identifier or I am dealing with a keyword. And keyword is a list of words which are reserved in a language. So functional specifications clear to everyone? What we are trying to do here? So let's move on and let's see how does it interface with other phases of the compiler. So if you go back and recall the compiler structure we had, we had somewhere in the first phase in this compiler, which was the lexical analyzer and then we had syntax analyzer. So really if I am looking at lexical analyzer, it is dealing with two entities, one which is input and another is syntax analyzer. It does not have to deal with any other phase other than the symbol table, where it will have to put all the information. So this is how the lexical analyzer looks. It is feeding information to syntax analyzer and is taking input from the sequence of characters. Now assume that the syntax analyzer is the one which is driving the whole process. So look at it this way that when I am starting my process of compilation, syntax analyzer says I want to pass something, give me a token. And syntax analyzer is asking for a sequence of tokens and who will pass obviously the lexical analyzer. So what it says is it just asks for a token and now to generate a token what lexical analyzer has to do, it has to start feeding characters from input. So it starts feeding characters from input and it starts forming now a token. So for example if I say I want to compile this, syntax analyzer says give me a token and lexical analyzer then reads A. But by reading A will it know that it is a token or not? It does not know, it has to read more. So it has to continue to read. So it will read then the next character and that certainly realizes that I have reached the word boundary and A was really between the word boundary was between A and assignment symbol. So in the process what it has done is it has read an extra character logically. So what happens here is that it has formed a token which is A and in the process it also has to say that whatever extra I have read pushed that back to the input stream because this is going to be the beginning of a new token. Is this point clear to everyone? So what we are trying to do here is that when lexical analyzer is trying to read characters and forming a token, it identifies a token and in some cases, not always, in some cases it will also have to push back all these extra characters into the input sequence. Logically that is what is happening. We will see how the implementation happens. So push back is required to look ahead because here I am saying that I will have to look ahead to find out the word boundary. And here is an example. So if I say I am trying to read greater than equal to or greater than, I will not know unless I have read the next character whether it is part of the same token or not. So this is implemented. This push back etc. can be just implemented through a buffer and all that means is when I am reading a character or pushing back character, what it means is that I have an input pointer which is moved left or right. So pushing back is not unget there like you go in C. You can just use a buffer to implement it and I have to take care of this input point. So keep input in the buffer and keep moving this pointer over the buffer left or right. So how do I implement lexical analyzer? So we understand what lexical analyzer does. Let's start looking at how I am going to implement and I will talk about three approaches to implementation. One is that since I am doing low level IO and I want this process to be very efficient I can always program this in assembly language. That is one option that is available to me. Another option is obviously I can use a high level language like a programming language C or I can use tools like lex or flex which are where I just write specification and I am going to then implement by lexical analyzer. So remember that not only I am worried about functional character of a phase I am also worried about the speed of a phase. How fast it can read my tokens because you don't want the situation where you have a program which is very slowly reading your characters and that becomes the bottleneck because remember this phase involves a lot of this kind like your program is going to be on the disk and there is a lot of IO which will take this. So which effort should I take? First one? Third. But what about efficiency? Development time will be very less. Development time will be very less. True. But run time? Run time will be slower than other things. So do I want that? I don't just remember the lexical analyzer. Oh, can be very difficult. Try writing an assembly program for this IO versus a character in a high level language. There will be noticeable difference in measure of time. So normally if I look at pros and cons this one is obviously the most efficient because you can do low level IO but also it is going to be most difficult to implement. This is definitely efficient not as efficient as this and it is difficult to implement not as difficult as this once again. But if I go to the third approach it is easy to implement but it is not going to be as efficient as the first two cases. Because I have no control over IO I am only hoping that my tool will be doing good IO tool will be doing good function management and that is why you see we had tools like flex which said fast lex because lex did not implement very efficiently in this. So this also goes back to the first point that you find that your tool is not efficient and you get a better tool then you can actually have a faster compiler. So normally what happens is in practice when we start implementing we will start with the third approach because we do not want to become a bottleneck for the subsequent phases. But as rest of the compiler is getting developed you keep moving to a high level language and keep implementing at least IO processes in assembly language. So to make sure that not only you are functionally correct you are also very efficient. So always start from this but slowly migrate at least to this level and then put on your IO at low level make sure that IO does not become bottleneck in whatever language you are using. So we need to therefore understand how to implement lexical analyzers using this approach and how to implement lexical analyzers using this approach in a systematic manner. So even when I want to write programs I want to write C programs to implement lexical analyzers. I just do not want to be writing arbitrary C program but I want to have certain structures over it and we talk about both these approaches of implementation. Is this point clear to everyone? Any comments, questions here? So let us move on and let us actually take a small language and try to construct lexical analyzers and see what goes on in lexical analyzers. So this language is going to allow white spaces it is going to have numbers and it will have arithmetic operators in an expression. And what it is going to do is it is going to return tokens and it is going to return an attribute to syntax analyzers. So token will be something of this class so it will say it is an identifier and my attribute may be saying either it is a lexeme or it may be an entry to the symbol table or attribute may be saying that so if I write something like this a is assigned say b plus 46 it may say that here token is number and attribute is number 46. So there is the information it is going to return and what we will do is we will assume that I have a global variable just for the sake of implementation of this program instead of returning a value I will say there is a global variable where I am going to copy this value and then the subsequent phases are just going to read this global variable and we will pick up this value. So token value is my global value which is going to set to the value of the number and what it requires is that we have a set of tokens which are defined and then we describe strings belonging to each of the tokens. So let us just look at the structure of such a C program. So I am just writing a standard C program without worrying too much about the structure the point of showing you this program is that how horrendous it can be to write the lexical analyzer which just involves so few tokens and then motivate you to use high level specifications and some tools which can then make sure that this job is done correctly and efficiently. So you will have all these hash input statements and I have initialized this token value to none none is somehow a defined character which is an integer now and here is a function lex where I have t as an integer defined and this is where the function closes. Now what are the things I need to do I am sorry this character this is not visible maybe because of brightness but what we say is while one that means going an infinite loop and keep reading a character so this is reading a character and first thing I do is I do a get cap I read the first character and then I find out whether this is a blank or a tab character this is a blank or tab I just ignore it I do not want any white spaces in my input I am just discarding it otherwise if this is a digit then what do I have to do if my input is a digit then what do I do make a decision make a decision like whether I have to wait or to do something I cannot wait there is nothing like waiting there so I have to read the next character and find out whether that is a digit or that is forming a number so I will keep reading as long as I get digits and as I am reading I will also keep converting these digits to a number and whenever I get something which is a not digit then I will say I have reached a word boundary and I will start beginning of a new token so this is what we do here we say token value is t minus whatever is as key value of 0 and t is then get care and then I say while I keep on getting digits keep on constructing token well and how do I construct token well I say simple arithmetic expression I take the previous value whatever I have read previous value is multiplied by 10 whatever I have read that is added and I go in this loop and I keep on doing it so long as I keep on getting digits now you can see that when I come out of this loop I will have the number as token well but I will also I would have read at least one extra character to find out whether it was digit or not then only I will come out of the loop so that is an extra character I have read so that is the first thing I will have to do then I will have to put it back into the input so I am getting that now once I do that then what happens so what other situations could have been there in my input okay so what other characters I could have got I have blank I have a tab which are white spaces I have a digit and what else I could have in my specification I have arithmetic symbols so here I know that I have recognized the number okay otherwise what I do is I say that token well is none token well is not a number and whatever is the T I just return that so if I read a plus for example I just return plus if I read a minus I return minus otherwise I return a number so this is the only specification I have I had expressions which consist of just the numbers and arithmetic operators and I will just argue about this now you can see that just to do this I had to write a program C program which is like 10 to 15 lines of code but more interesting part I had to write I had to use all these data structures I had to use this iteration here I had to do an IO here so this is what really makes a lexical analyzer complicated now imagine you have full specifications of programming language like see your passwords or read out anything and if you start writing a C program like this the chances that you will make an error somewhere in your declaration somewhere not using a loop properly not returning a character properly to the input buffer and so on are very nice so this approach is not clearly something we want so what do we do now so one extra thing which I am bringing at the end now read this what it is saying is that if my input character is a new line character then I am saying increment some line number by 1 and I have initialized my line number to 1 now why do I need line numbers here in lexical analyzer I am just returning this code and I am passing this structure so for example if I had something like this suppose my input was something like this I would have written the same set of tokens why I am capturing this information like line number how does it help me in doing passing and less cost compilation so when I have to do debugging at that point of time I must remember that for which line number what was the code which was generated because my view as a user is going to be that I want to take breaks at certain and use gdb how many of you are familiar with gdb almost everyone right so when you set a break point at certain line number so how do I map that line number and code somewhere I start generating this information so this information will also be communicated subsequently it will remain some as some tag within my code so that I can then start breaking at certain line number and this is if you now go back and start reading what I showed you in one of the files that compiler is part of overall program development environment and it has to feed information to so debugging was one of the phases made sense so so far we have seen some aspects of what lexical analyzer is doing but let's also see what are the kind of pitfalls we have to be aware of what are the problems you may face in writing lexical analyzer so when I start looking at specifications of a language I must trace certain flags in certain situations so what are the kind of problems I have a face here one is obviously that I am reading my input character by character so your I.O. has to be very efficient also look at character is going to determine what kind of token to read and when the current token acts so for example this is if I am reading this and then I read this this is going to determine what kind of token I had and this also is saying what is beginning of the new token so when I start for example something like xyz is a sign something by reading this character I have some idea of what kind of token or what kind of character I am expecting that will also give me a hint of what is the finite state machine I am going to use to identify this particular token and first character alone cannot determine what kind of token we are going to get so if I read for example first character of this so the example I already gave you if I have this and this is not clear just by reading either this or this what is it that I am going to get unless I read at least few extra characters in this case I am assuming to begin with that look ahead of one will be sufficient to find out but we will see situations where look ahead of one character is not going to be sufficient so next issue that comes is that how do I interface with the symbol table so what was my interface with the symbol table so if you recall very quickly what I had was a symbol table here and symbol table lexical analyzer is to put information in the symbol table and what kind of information it can put in the symbol table what information lexical analyzer has at any point of time it only knows the let's see and the token it has no other information so what do I put in the symbol table so when I say that I encounter A is a sign B plus C and it says A is a token what more information I have is the lexine so I should be able to then in my symbol table say that I have token which is of type identifier and it has lexine A but now imagine this situation that I have this A is a sign A plus C and this is what I am tokenizing okay now again you will say I have an identifier where lexine is A but that must have already been entered in the symbol table when I process this part so do I make a duplicate entry in the symbol table no so how do I know that this already exists in the symbol table see that information is there pointers are there but this is a table right which has multiple records so I must be able to look up this table and say whether such a token on such a lexine already exists right because if a token with this lexine already exists then I don't want to make an empty but when I come to this I will say again insert this identifier with a lexine C right so these are the two functions I need I should be able to look up in my symbol table and I should be able to insert something in my symbol table what do I insert the only thing I can say is insert this token and this lexine and look up will say look up this particular string okay and these two functions should be sufficient interface as far as lexical analyzer is concerned those symbol table I don't have to worry about rest of the structure of the symbol table I don't have to worry about rest of the fields in my symbol table right these are the only two fields I am going to deal with as far as lexical analyzer is concerned so this is what we do that I am going to store information for subsequent phases because I need to know what my lexines are okay and I need two functions which will say that save this particular lexine and this token and just return a pointer okay and before I insert I also want to look up and say that if this already exists then just give me an empty to the symbol table if it does not exist okay then give me another point then you say that it does not exist okay and these two functions are sufficient interface okay and how do I implement symbol table okay now if I look at symbol table one very preliminary implementation I gave you was that I want to have some kind of structure of an area of structure so what I want to do here is I want to have let's say one row corresponding to each of the variables I have in my program and this will then list of information like saying what is the token what is the lexine and then I will have more information so I will have for example type I will have address and some other information which is part of the symbol table but right now let's focus on this part okay now this is the kind of space I am using we will not worry about how efficient this is at this point of time that we will address later so assume that I have now an array okay and you can see that one thing when I do a look up here okay is going to be linear lookup right unless I continuously sort the symbol table and do some binary research okay so assuming that I have linear lookup because that's really not the issue at this point of time okay when I am implementing this okay look at how much space I am consuming okay and look at because at this point of time I am concerned only with these two feeds okay let's look up how much space I am consuming here okay now if I look at token okay how much space do I need for tokens to store a token so let's talk in terms of bytes which and bytes let's go to role level implementation right how much space do I need to store a token depends on the number of tokens depends on the number of tokens I have in my language okay suppose I have 24 different kind of tokens in my language okay then how many bytes I need 32 is the maximum 32 is something which is close to this so just 2 to power 5 I can do everything in 5 bits okay so if I have 24 kind of tokens then 5 bits are sufficient okay so that is very efficient right I can always and for each language I know predetermined I can predetermine what are the kind of tokens I will encounter I can encode it in terms of bits and I can have this compact information so there is really no space overhead here okay so what about the lexeme part how much space do I reserve for lexeme how much space do I need for lexeme depends on the depends on if I am storing my identifiers here it depends upon how many bytes I can have in each identifiers and most programming languages today will permit up to 32 bytes so you can have a variable which is 32 characters so that means I need to store I need to reserve space of 32 bytes okay but if I look at average size of variables when you have written programs right so what are the average size of variables we use variable length 5, 6 rarely more than that so average will be 5, 6 some variables maybe most variables will be like i, j, k and some variables maybe like 7, 8 okay and if you take average it will come to 5, 6 now 32 bytes when I know for sure that on the average I will not be using 5 to 6 bytes is highly inefficient space wise okay so I need to come up with some better data structure than this what word give me some ideas okay so this clearly I mean you yourself are saying there is lot of space which is being wasted here I want to recover the space so what do I do make it dynamic okay so what do I do make it dynamic yeah you are saying something okay so very good so what we can do is that I can have some separate memory which I can keep allocating for my identifiers and all I need to do is have a pointer here which will point to this so this is what my lexeme is going to be so let me say this is identifier 1 so identifier 2 and so on each one will have a pointer here right now you can see that what is my overhead pointer typically is going to be 4 bytes okay so if your pointer is only 4 bytes long then you know that what they are using is very compact and overhead on the average for each lexeme is going to be just 4 bytes okay and this is what is implemented almost in all symbol tables that fixed amount of space to store lexeme is not something which is advisable as it is going to waste a lot of space and therefore store all these lexeme in separate space and each lexeme is separate by some character because I don't want to store information like what is the length of the lexeme okay and symbol table has just pointer to lexeme okay so one implementation would have been like I have this fixed space for lexeme and all other attributes okay which is usually going to be 32 bytes what says I have all these separate spaces for lexeme which is stored separately and I have just the pointers to all these symbols okay so that makes my implementation space wise more efficient okay now next issue that comes is how do I handle keywords okay so how do I handle keywords okay so if I say so when I wrote something like a is a sign d plus c suppose I write a is a sign if plus 5 okay and as I start scanning my input from left to right I say that I encounter if and suppose in my language if is a result of keyword cannot be used as an identity file now how do I know that if is and as far as rules are concerned rule of construction of this is same as rule of construction of this okay so this will say it is an identity file how do I know that this is not an identity file how do I handle this situation but whatever we have seen so far there is a priority of something so if the keyword is conflicting with identity file then keyword here yes so I need to maintain a list of keywords okay if I maintain just a list of keywords then I know that first about saying that this is an identity file check it against the list okay and how do I maintain this list okay I can always initialize my symbol table by inserting all the keywords initially in it and whenever I do a lookup what will happen lookup will just say that this already exists in my symbol table and it is a keyword I do not have to worry about okay so this is really what we do that when I am saying that insert these as let's seems okay I just initialize my symbol table with all the keywords okay and since I have this lookup function lookup function is going to ensure that I will never conflict between a keyword and an identity file lookup function will always make sure because before I insert I always have to do a lookup so if I just do a sequence of inserts in the symbol table before the process of compilation starts okay then I have taken care of this and any subsequent lookup is going to return a non-zero value and therefore I will say that or this cannot be used as an identity file okay now as far as lexical analyzer is concerned is this an error no this is not an error right who will catch that this is an error which means parser will say that you cannot use a keyword in an expression right as far as lexical analyzer is concerned this is going to just return a sequence of tokens which will say identify, assign, keyword, add number and that's it okay so you must also remember what are the kind of errors which lexical analyzer can get and what are the kind of errors which subsequent phases are going to have okay so using a keyword inside an expression is as far as lexical analyzer is concerned or lexical analyzer is concerned is not an error but some subsequent phases are going to capture this information provided lexical analyzer has supplied information that this is a keyword and not an identity file yes okay so what are the kind of difficulties I may face what are the kind of flags I need to raise before I start designing a lexical analyzer okay so far everything sounds reasonable if not very simple so let's start now raising red flags okay so one the first red flag that comes is can I use a format which is this versus a format which is this these are two formats which express the same language okay what I have written this also in a form which will say so this, this and this will they mean the same thing depends on the implementation of what lexical lexical has nothing to do with implementation the reason is this is part of the specification of the language this language tells me that whether I can write an expression in this form or this form or this form okay if all the three forms are valid then I should be able to write design lexical analyzers which will say doesn't matter what is the input you give me even if you give me one character per input or one word per input or line of input I am okay with that okay versus their languages which will say no you cannot use this format you cannot use this format you must use only this format so there are issues like languages versus fixed format languages now this is not a part of implementation issue this is a part of language specification and lexical analyzer must implement whatever is specified by the language lexical analyzer is not supposed to deviate from whatever is the language specification so this is part of language specification it says that whether lexemes are in fixed positions versus it's a free format language right okay now do we know any fixed format language python and okay this is first language was the fixed format language fourth was the fixed format okay so whenever you deal with these formats okay you need to worry about whether you are in fixed format versus free format okay so typically if I will show you more examples of fixed format language and what kind of difficulties they can induce next issue we have to deal with this I said right in the beginning my input would be a sequence of characters and I need to tokenize it and then we said that I am going to define certain word boundaries and although I determine word boundaries I will say either I encounter a blank or some blank space that means either a sequence of blanks or tab or new line that will be a word boundary or some kind of punctuation which is like comma, full stop, semicolon and so on or I encounter a character from a different class of characters here and I come to a sign and I know it's a different class of characters this is the word boundary although there is no blank here okay but blanks typically most languages are used as word separators okay now let's look at slightly different situation so here is one expression let me write one more expression are the two same okay so answer is I don't know whether they are the same depends on the language specification now the language is we say that blanks even when it comes in an identifier let me just ignore it makes life more complicated okay blank can be put anywhere and as designer of the lexical analyzer I have to figure out what it means okay so blank here means saying that this is count ignore these blanks but don't ignore it okay this is to be treated like a blank similarly this blank and this blank can be ignored to say this is count but this blank cannot be ignored and this is end of count okay so even blank now becomes contextual okay where it occurs that makes a lot of difference so things like important blanks are just important in literal strings at rest of the places I just ignore blanks as if they don't exist okay so when I write counter versus count blank ER they are actually the same identifier okay and any idea I mean why such kind of format was prevalent is it by design by accident what was the reason I mean see as computer scientists and as student of this any subject I mean we must also know bit of history okay so I gave you one part of history like how compilers were designed initially right so is it by accident or by design do they like to make spaces do they do the programmers do they like to give spaces no actually it makes your program highly readable okay so programmers don't want spaces earlier programs were not typed earlier programs were not typed then they were written by hand they were written by hand and then how do I pass it on to the computer see whatever program you write earlier programs and today programs are all written by hand even today we expect that before you go to the lab at least some structure of the code in mind you will have some structure before you go and sit on terminal and start just banging on the keyboard but what happened was earlier so okay here is another example and this is really much more complex so take this and I will come back to this point of blanks once again so take this when I say do 10 I and there is a blank between DO10 and I is equal to 1.25 and this says do 10 I is equal to 1.25 okay now what in the first case is this is really an identifier which is DO10 I which is being assigned a value 1.25 okay real identifier okay and the second one says this is actually a for loop which says that I want to iterate from this statement up to the statement whose level is 10 and the iteration space is given by lower bound as 1 and upper bound is 25 in steps of 1 so this is do everything from this statement up to statement 10 for values of I varying from 1 to 25 so that is like a problem okay but interesting part is that I can also I do 10 I in this form I do not have to put blanks here okay so this now when I see this comma I have to figure out what I am dealing with is not an assignment but I am dealing with a for loop okay so I have to go back and tokenize this I must say that oh DO is a keyword and 10 is a label and I is an identifier okay so not only blanks are not important but in certain situation even if I do not put blanks okay that does not mean that I have the same token I need to take DO10 I and break that into three tokens okay and when will I know this when I encounter either dot here or a comma here interesting situation okay that means it does not matter how you write compiler is smart enough to figure out what you might that I could have written in any of these formats and compiler was able to figure out what was the language or what is it what was the intent of the program okay and it really happened the reason when we say it happened by design what it meant was I mean that was designed because we wanted to prevent certain accidents so the first line is a variable assignment second line is beginning of a do-do and reading from left to right one really cannot distinguish between these two till I encounter either this comma or a dot okay and why haven't we used these fixed formats and use these ignoring the blanks and not ignoring the blanks in some way because at that point of time we did not have these terminals where today I mean you have this board and terminal and you have an editor and you just go and type your program and visually you can see whether your program is at least space wise character not and then you can do various kind of formatting you can do editing before you pass it on to the compiler okay earlier we did not have that and really the way programs were typed was that we had these punch cards okay so you go and type your program on the punch card and it is almost impossible to correct a punch card you cannot correct a punch card you have to retype the punch card and people did not have that kind of time so situation was something like this that I typed my program on punch card each card will have one statement and having the thousand line program is no big deal right if you have thousand lines of program you have thousand punch cards okay now thousand punch cards will be a stack of something like a feed okay so this is typically our punch card loop I still have some old punch card for historical reasons and just take thousand of them so each punch card will have just one statement and you have thousand stacks and then you pass it on to an operator and go away this operator at some point of time will put it in card reader so there are hundreds of thousands of cards which are submitted every day this operator puts it and then suppose we had this kind of situation that you made in the state while typing a punch card okay you had no way of correcting it now if you come back next day and you find that only error in your program was because certain lines were not in certain right places okay the whole day is basically so you replace that punch card come again so whatever errors programmers could have made while typing punch cards compiler was trying to take care of that I mean today it's not required but for historical reasons when it persists because this language had you still have some old code and it persists okay so what happened here was that people were just punching their programs on this card and this card was then put on the card reader okay and you wanted to make sure that whatever errors you had during punching those are not really the errors which delay your execution and therefore all such errors you will try to tag in the phase of compilation and just ignore that because we did not have speed and interest at that point of time okay and that was an important use of punch cards what is the name of this card anyone knows what is this card called who designed it why it was designed it was designed before the computers it was designed sometime in 1880 for sewing machines sewing machines had cards but not these kind of cards they had bolts so sewing machines had designed cards but not these kind of cards I am talking about this specific card for US sensors data so this was designed by a statistician called Oliver in 1880 and he had a machine called tabulator and the first major use of this tabulator machine and this punch card was done was during the US sensors data in 1880 and really what happened was that if you have this punch card with certain holes you put it in certain stand up and there will be some connections which will be made so some leaders will do and where they can penetrate in the holes there the connection will be made and certain computations will happen so for the first time tabulation of all the sensors data was done and data on this company which was making these tabulators then after several murders actually emerged into IBM so that was perhaps beginning of IBM in some small way so let's move on and let's talk about different kind of problems so one problem we are saying is all this blank now what about this is this a valid statement in a program if it is a keyword in my programming language this is a valid statement in my program well I mean answer is if you say no that's not the correct answer you immediately have to ask the question is keyword a reserved word in my language so this keyword is not a reserved word then there is nothing wrong with this and the language is like PL1 which say keyword is not reserved and if they are not reserved I can write statement like this which is a valid statement and what is the statement it says if then then then is the signed else else else is signed then now it is for compiler to figure out which is a keyword which is a Boolean operator which can identify so here it says if that is true then that is signed else else else is signed then interesting right so answer is when I say that whether this is valid or not answer is not low but answer is is if a reserved keyword in my language or not and if it is then you know it is not valid but if it is not then I can write any kind of expression so you have to be aware of this here is another one if then then is signed another one this is also valid declarations there is oh we are running short of time so I think we will have to go here and then we will move on I think the next class is waiting outside so tomorrow we will start our decision of this one and those of you who wish you can keep these starts as soon as okay