nice good morning everyone i'm just going to send out one more notification one more notification unscheduled live stream let's have breakfast together just send us out on discord because i know twitch notifications don't go out all the time i said uh live streaming on twitch within minutes but we already started so give people the chance to roll in this is by the way these are our tomato patch we got we actually have a gigantic tomato plant over there one tomato plant hanging okay and we have one two three four five six seven six tomato plants here okay it's gonna pop out the chat sangoku hello hello good morning good morning x how are you doing should i show you guys what we got for breakfast sky big bolo yogurt okay we're gonna put bananas in it and we're gonna put some of these things in it okay let me show you what i got here this is uh by the way this is sort of a typical breakfast that i have this is at apples and i do apples uh a lot in the mornings apples and yogurt okay so we got apples we got some crunch crunch cereal okay it's like nice that's a lot of yummy yeah we're gonna put some walnuts nice walnuts we're gonna put some pumpkin seeds in there we're gonna put some elder gosh we're gonna put some hemp parts nice protein okay i don't know if it's gonna focus there it is there's the hemp parts nice beautiful hemp parts they're really watching your monopoly videos i got to which notice i ran the monopoly videos are awesome gosh we're gonna play a game uh i'm gonna go visit my grandma in a couple of weeks and we're gonna play a game with the family we got some coco nibs that's beautiful it's like what time is it here and you're wearing my favorite shirt nice nice in this one or the monopoly one it's like 720 am i'm gonna put some uh cinnamon in there as well so what i'm gonna do is this is my big bowl of yogurt i'm not we're not gonna this is like a bigger version it's a clearer one so you could see what's going in there oh yeah but good weekend this weekend you know i hope so too i hope so too let's dump in the apples this is a whole apple it's a smaller apple okay get in there let's eat up all the apples tomato plants are amazing lots of tomato plants i'm collected i'm connected to electricity i hooked myself in and we're not relying on the battery no more while we might have renowned that this is my your favorite shirt nice i got it as a present from my aunt let's throw in the bananas we're having breakfast this is my and this is a medium-sized banana right so yogurt apple banana so far i throw in the cereal last and i don't mix it up i eat it slowly mix it in so we get a crunch crunch no crab apple butter or sourdough it was to go with it but i do have tea to go with it right i'm gonna throw this is uh the pumpkin seeds right pumpkin seeds are crazy good for you crazy good crazy good okay so i'm not gonna throw in this much this is too much i'm gonna throw in this much okay take a look we've got the wasps going yeah man look at this food no yogurt oh you're lactose intolerant i think we're gonna throw in some cocoa nibs not this much cocoa nibs but enough to give it a where's no phantom cereal everything everything's beta with better better so little with the coconuts coconuts are crazy good for you too right we're gonna put in i want to break in some walnuts in here for a minute there i thought you were having a beer with it has happened before but not today so these are half walnuts right i'm just gonna break it man do i ever throw honey in there most definitely i'm going to be throwing honey in there this is honey yeah we're going to take a couple of spoonfuls of honey and throw it in there sorry it must be Armenian chia seeds yeah but chia seeds uh i don't add in the in the morning chia seeds i prepared the night before so if i'm having chia seed breakfast i take chia seeds and uh take yogurt add water to yogurt so sort of uh you know not diluted but make it more watery and then i add the chia seeds in there and i add pumpkin seeds and walnuts and some other stuff they haven't had our hand parts though but mainly pumpkin seeds and walnuts and i put it in the fridge and let the chia seeds soak in the juices right and then i have it in the morning so i soak chia seeds overnight and sometimes if i do that i do a lot of chia seeds and uh i have chia seed breakfast like three days in a row and it's super good honey honey after five hey chicho starsky how are you doing nice weather nice weather we finally start getting summer void how are you doing yo maz be on guard for trolls there were two three last time oh okay i should have actually changed the uh the category we were in to uh social eating or something but it's okay oh yeah and i got some cinnamon cinnamon i'm eating dairy-free cheese yum with ham in gluten-free bread you're like the anti-chicho i'm gonna put some cinnamon in there cinnamon is crazy good for you too right so a little bit of cinnamon nice that's good that's good i wake up around uh five in the morning five five thirty i'm up i'm doing my exercises by like six six thirty and i have breakfast after i'm gonna put in the hemp seeds hemp hearts okay should we put the whole thing let's see a little bit more okay that's good now we're gonna put some honey in there no we're going the wrong way here's our honey right honey and yogurt oh so good nice this type of breakfast is fantastic really and then the spoon we can just put in the tea and let it dissolve in the tea yeah we have uh some wasps and stuff here so they pop up dump in the cinnamon by accident oh that would have been crazy but we're still eating it elder god is here so sharpened smith how are you doing the man but i can salad table one hope he doesn't have a good breakfast or good dinner or good lunch thank you the world being happy makes the world happy right look at this beautiful goodness look at that nice now what i do i mix it in and then i add our cereal on top good breakfast then that spoon technique makes me want to eat maple syrup i don't know if i if i guys do that in other parts of yeah for sure maple syrup if i don't put honey sometimes i put maple syrup actually i switch between maple syrup and honey and sometimes i don't put anything right but in cobec we lay hot maple syrup onto snow oh we've had it here too then eat eat eat out and so good yeah in the farmers market and uh the one farmers market or family had uh we set up a booth there was a guy doing that they had a slab of ice and then uh they would take maple syrup and put it on the slab of ice and then they had like a sharp utensil i guess they would just go flip it flip it flip it and then maple syrup became hard and they would give it to the kids and well anybody would buy it and you would eat it it's so good yeah unfortunately um yeah misery loves company it's not seagulls actually you're hearing different birds right now sometimes you might hear a loud crow go kaka maybe a zero Canadian ketchup where you get your shirt from this was a gift this was a gift from my aunt so thank you aunt so good let me keep it a little bit right i like my cereal crunchy crunchy so i don't let it soak in the just a little bit right just enough to get your cereal going very good double double and the farmers around check the calories check the calories brother it's pretty high calories this keeps me going all morning like this is fantastic the calories in this must be pretty high this is the other view the view you saw last time was that way and this is our grapes coming in we're going to be harvesting some of these we have a patio so i like natural sun sun is good void as far as i'm concerned outdoor is the best that's my personal preference outdoor nothing like the sun worked hard to putting this together this year yeah i agree elder god movie stream i can't wait great idea by the way the movie stream it was elder god's suggestion we do it i don't know a fantastic suggestion right no i haven't seen it we tried a couple of nights i tried but i haven't seen it yet dingbobber thank you very much for the twitch prime sub thanks zarya my pleasure dingbobber thank you thank you hi jack don't wall thank you very much dr p greeting is a blessing the cure um Monday blaster how are you doing i'm not sure to say goodbye good morning say good morning but good evening since i'm watching from Germany oh hello good evening to you good morning to me simmer how are you doing welcome to a stream nice that's good zarya as far as i'm concerned everybody should be growing anywhere that's legal you should be growing just like tomatoes and if you've got a huge harvest share and localize everything much love jack starski i agree with you um everybody should have an online presence as far as i'm concerned that's the reason i i went online right like online presence you have to have it i don't care what you're doing well no within reason right like well i can't think of anything that you don't need an online presence for tell you the truth so yeah if you can do it do it don't feed the trolls just be chicho and yourselves read them this no simmer we're eating yogurt with um coconuts that's not going to come out sunny coconuts pumpkin seeds walnuts hand parts honey cinnamon banana apple and cereal and having tea i promise streaming fixing toilets what's that you prefer an offline presence to commit crime that yeah maybe or a lot of crimes committed online right look at wall street have a huge presence online the commit crimes all over the world right dr p if let us know on discord and i'll look into it question off topic for chat anybody remember cartoon redwall it was a medieval no i don't remember uh vitamins i'm taking uh vitamin c since covid hit i've been taking some vitamin c if i feel down i take vitamin c i take vitamin d every now and then uh my my partner gives me zinc every now and then but in general i get my i try to get my vitamins from food dolma rules dolma rules dude we just i'm gonna upload the dolma video today hey chicho have you seen the iranian film under the shadow of netflix it's a great horror film finally a horror film no i haven't seen it dolma rules if you haven't been around today we we cooked that we did a cooking live stream dolma cooking live stream i'm going to upload the video today i'm going to let it boost on youtube and bitch you today oh i gotta load it up on youtube i forgot to load it up on youtube uh later today good evening singapore mm-hmm b went on the microphone i saw that's why i went there's another wasp come on buddy autistic hey chicho the strawberry liquor turned out me it actually has um become a thick and droopy liquid it doesn't taste bad but not eight out of ten either i think it would taste great on vanilla ice cream so it's very syrupy so the odds are you added too much sugar diluted with vodka right vanilla ice cream but i want to improve the taste when i drink drink it flat what what you got any tips it has been sitting since six of june did you add a lot of sugar autistic if you add a lot of sugar it would make it syrupy right so diluted with vodka the other thing you can do is get a big glass of ice and just have lots of ice and pour the strawberry liquor on top and let the ice melt and just dilute the liquor it'll taste better i think that's my mind that's like age i also become thick and droopy funny greetings rohan from sweden how are you doing just ate the first batch of our own strawberries have a nice never tried to make liquor out of them super delicious we're gonna go to the farmer's market today to get some strawberries so i can make it on monday strawberry liquor the gals yeah actually there are some seagulls we can hear now zahra you might have heard these earlier than i didn't hear them what those rats yeah seagulls zahra you got a sharp ear you heard those and who was it that just said gals dr p yeah but earlier on i didn't hear him at all so autistic when making it i thought i didn't add enough sugar i experimented a bit a bit more with the ingredient ratio also searching for a new flavor to make lemon i try to find organic lemons in town that i'm having a hard time i can't find organic lemons so we might not make lemon liquor but make orange liquor peaches would be good berries it's cherry season right now cherries are delicious and blueberries are really good zahra yeah live a block away from pacific some used to hearing the gals sounds like home to me they're actually um seagulls are endangered species i believe they're part of the protected species what you want you want breakfast we have wasps here wasp and bees vanilla extract liquor i don't know i've never made that would be good though would that even be possible maybe add some to one with fruit are seagulls white birds near uh mcdonald's and french it's a whole another name yeah they're big ones and they're like predators too i've seen a seagull take down a pigeon just grab it by the neck and go the sea is amazing you live in the middle of the uk i think if lovecraft taught me anything it's that one should be weary of the sea the sea is unforgiving don't mess the oceans can swallow you up done or water large bodies of water can swallow you up haha the bers horror remake with the gulls yeah it's right in the center 170 miles to sea oh waiting potentially for the big one i bought some floaties just in case dr p grew up surfing favorite time was hurricane season 18 foot faces rather oh my god persic in touch we should roughly translate to wild peaches nice i don't know if that's the correct translation they're similar to normal peaches but have a different form and taste a bit sweeter nice oh wow dr p imagine laying down on the ground and bodies of water white water coming at you the size of telephone poles what do you think about the unmarked vehicles picking up uh protesters in oregon pretty trippy pretty trippy but that's what the u.s military has been doing around the world for a long time right renditioning a lot of people so and with the patriot act they legalize renditioning american citizens and obama legalized just droning assassinating american citizens and now they're picking up american citizens off the streets this is something that has been going on sorry since the patriot act came into effect with bush and then obama and then trump this was something that was going to happen i'm not sure why people thought that it wasn't going to happen concrete is unforgiving and cliffs are forgiving i guess the oceans can be as well hurts much worse when you fall on concrete yeah but the oceans can swallow you off the currents just one wrong breath with a wave coming in and water going into your lungs while you surf you know dragon's down i was wasting time on another stream trying to break in the eardrum and people don't know how you all this world really is no they don't and once they pay attention they see it they a lot of people cower away they get scared any great books on mass statistics um that book that i mentioned and uh my calculus book is fantastic i can't remember the name uh howard uh is really good ouch then mugga well i love it so powerful 10 years since you saw the sea last semester wow mathematical statistics by miller and miller is a goodie really okay smooth mathematical statistics nice it's been a while since i read a math book that's the kicker right sorry i just made lemon pancake using a zest from lemons in the batter nice i highly suggested to everyone in here nice oh the wasp is coming around for the food now is a cost effective time to travel with the tourist industry taking such a hit go see the ocean go see the ocean hey come on mm-hmm bees are harmless and wasp they're curious they're looking for meat they're looking for food once they realize you're not food they'll move on they just want to check it out right and wasps are good because they eat pests in your garden so yeah good breakfast fantastic disney world has opened up and mickey wasn't wearing a face mask the plants look crazy happy here we're very happy they have a bunch of wasps in the front yard they always leave them leave my cat uh and me alone and we're hanging out yeah they just come and check you out and if you barbecue if you put meat on the side my wasps will love it it's uh the name of it is pp i forget what it is it might be a hybrid it might be a hybrid i don't know what tell you true we'll find out we'll find out it's a happy little plant not a happy little accident but a happy little plant pp how are you doing pp louver hope you're doing well welcome to a live stream we plants are happy plants we plants are happy plants also i can't wait for the tomatoes though the smell of tomatoes leaves is amazing it is feminized it is feminized it is female if you're talking about the plant love pp love pp love pp we don't want the plant to be gender neutral we don't want the plant to be female rude the rallies rude the rallies fun i gotta go upload the r i can't believe i forgot to upload the cuckoo stream on youtube lgbtq happy plants i'll be gtq happy plants oh funny funny oh god it's asexual it's actually really interesting the whole steps germination pollination other things like that ah cool next it will be what up chichou jake how are you doing what's up chat the flower is the color of the rainbow oh you want the red hairs on the flowers and stuff orange red yes orange red yeah you want the hairs fantastic try chou chou milky gang that was a good breakfast thank you for uh sharing it with me i hope you're having a fantastic day it's a nice Saturday okay nice weekend thank you school was a long time ago for me oh my god so fun i think i'm gonna go load up the uh dolma live stream to youtube i can't believe i've ever got to load it up it's gonna take at least it's like a four hour video a four and a half hour video it's gonna take two three hours to load up and then i gotta set it fix it so it'll be later on today wait was this a schedule stream that i forgot no kudio just an unscheduled stream i can do more of those now because i have less students during the summer so i still can't set up a regular schedule that difficult with my partner having shift work right so she has shift work so i i follow her lead thank you very much for the follow golem i stream in liqueur i think it's monday i had cereal i had yogurt cacao cacao nibs it was good uh here cacao nibs you won't see it it's too sunny cacao nibs pumpkin seeds walnuts hand parts oops hand parts it's not gonna come on honey cinnamon banana apple crunch crunch cereal unscheduled improvised any research on shiva brama shiva brama i know that name my pub is so busy today people are everywhere really already that's oh i guess so yeah you guys have serious food there too so kudio chicho maybe i'll get some more fruit before your liquor stream this week and fill up my other two mason jars still got plenty of vodka left yeah do it man the more you have the more you're like oh i want to try this i want to try this sleepy ways how are you doing sleepy ways i'm looking forward to the covid stream i want to talk about disruptive innovation coming up from the situation today being a man hat today being in a man hat and so weird nobody here besides homeless and essential workers really yeah new york must be trippy you living in the us must be tripping right now tripping really we feel the energy in canada but it's different here never put pumpkin seeds in the oven and throw salt on yeah for sure avoid i actually we do it in a cast iron just low heat salt is good and like fresh pumpkin seeds like when we eat pumpkin just take out the seeds and make it fresh i saw a vr startup kicking up a program that simulates working in what working in an office weird simple pills reality must be totally should be shattered it's super saturday and yes most patreons have put super saturday i don't know what that means isn't every saturday super saturday trippy in warm and blue states trippy everywhere i think in these states right now just the energy coming out of there is we feel it in canada most canadians are very much like what the hell is going on oh you're near soho did you hear that what's going on in portland right now yeah yeah indeed i think zahra mentioned that or someone else mentioned that you can save it for the current events livestream though because we'll probably have more info by then yeah slick mic how are you doing i have a book that i coincidentally read today it was called walt widman's guide to many health main manly health details all about how to live better and uh he's such a great poet that i'll all uh phrase so eloquently would highly recommend that i i know that name walt widman but i can't play some everything's still boarded up for the looting wow crazy dragons from junior into 24 yeah i want out before it gets worse it's gonna get worse and well dr p soho was not looted although it i wish it was sleepy waves it's only the beginning it's only the beginning soho was looted for four days straight last month i was watching the whole time really dragons and w a new world order i'm sick of the world cold word covid all i hear are lies everywhere but i will rant on the stream yeah i agree with you on the ground everybody's lying because we talked about this no one really knows what the hell's going on but we'll save it for the current events and covid walt was a poet thank you coolio thank you coolio widman is a classic american author he wrote the leaves of of grass okay oh we're getting trolls going in gang should we call the stream let's call the stream the trolls never sleep around these parts yeah and it's summertime the kids are out right a lot of a lot of the weak trolls are just children being indoctrinated with an current education system so they don't have half a brain in between them unfortunately right life is gonna gonna be a rude awakening for them when they get out of high school that's for sure i wish them well i wish them well some of those trolls i've seen they are people who think they own everything right zero respect you hang around bars long enough you see certain people come in that either flaunting their shit when they shouldn't be or talking too large with people they shouldn't be and it's life changing for them unfortunately hey man chicho they took our jobs needs to calm down please same some silly stuff peace love okay gang let's call the stream good morning spider man how are you doing so tomorrow tomorrow comic books and i know initially we started with five six and we read one we said we're gonna add anymore until we went through the five but elder god pointed out the other five were pretty gloomy so i'm gonna add a more lighter comic until it evens out the field where we have at least two light-hearted comics and you know evens it out okay so tomorrow we do comic book reading gang i hope you have a fantastic rest of your day again thank you very much for joining me for breakfast i hope you're had a good breakfast lunch dinner snack drink and i hope you have a fantastic fantastic saturday mods thank you very much for taking care of business for those that follow thank you very much for following and subbing okay very much appreciate it see you guys tomorrow bye everyone


Hello and welcome back in this final lecture about iteration constructs. We are going to look at how to reason about loops in a program. Here is a quick recap of some of the things we have already studied earlier. We have looked at sequential and conditional execution of statements in a program. We have looked at iteration or looping constructs in a program and we have seen how to solve some simple problems with iteration constructs in C++. In this lecture, we are going to see how we can reason about loops or iteration constructs in a program both as a design activity and as a post design activity. And in that context, we are going to learn about preconditions of loops, post conditions of loops, loop invariance and loop variance and soon you will see that these play a very important role when you try to reason about loops before you have written down your program when you are trying to plan out your program or even after you have written your program if you want to make sure that the loop that you have written is indeed doing what it is intended to do preconditions, post conditions, loop invariance and loop invariance have a very crucial role to play. What is a loop? A loop is a part of a program with an iterative construct and as far as this discussion goes, we are not going to make any distinction between the three different looping constructs in C++ that we have studied. What does a loop compute? When we entered the loop for the first time, there is some relation among the variables of the program. This is often called the precondition before entering the loop and when you exit the loop, the loop would have done some transformations in between and so some potentially different relation might hold among the variables of the program and this relation which holds after the loop has been iterated and once we have exited from the loop is also called the post condition of the loop and what the loop effectively does, it incrementally changes in each iteration the values of various program variables such that we move from a state of the program where the precondition is satisfied to a state of the program where the post condition is satisfied. Remember the precondition and post condition are simply relations among various variables of the program prior to the loop being executed and immediately after the loop being executed. So let us recall the min max example that we had seen in an earlier lecture. In that example, we were given positive integers m and n and we were required to find the value of 3 raise to min mn and also the value of 2 raise to max mn. What I am going to show now is really a fragment of the program that we had seen earlier to solve this problem and I am going to show only that only a fragment because this is the fragment that will involve the loop and that is the interesting part that we want to reason about in this lecture. So if you recall, we had some variable declarations, they were integer variables called min mn and max mn. It is obvious what they are trying to represent the minimum value of mn and the maximum value of mn. They were both initialized to 0. We also had 2 variables called 3 raise to min and 2 raise to max. They were both initialized to 1 and we also had mn, the integers that are going to be provided by the user and we also had 2 variables i and j which were to be used as counters and then we had a loop like this. Now I am not going to go into the details of this loop right now but this is just to refresh your memory that we basically used a for loop which iterated max mn times and within the for loop we had an if condition which made these statements conditionally execute min mn times whereas the other statements outside the if block executed max mn times. So let us not get into the details of these statements we have already discussed these in detail in an earlier lecture. What we want to focus on in this lecture is that there is a for loop here and we want to do some reasoning about it. Now these integer variable declarations and their initializations can be conveniently captured by a precondition where we are saying that there are these integers m which has to be greater than equal to 1 and has to be greater than equal to 1. The problem specification itself says that they must be positive min mn and max mn were both initialized to 0, 2 raise to max and 3 raise to min were both initialized to 1. So this is the precondition these are the relations on the variables that holds prior to entering the loop and after I have executed the loop I want this post condition to hold that min of mn should indeed be equal to the minimum of mn, max of mn should indeed be equal to the maximum of mn, 2 raise to max should be equal to 2 raise to the max of mn and 3 raise to min should be really equal to the value of 3 raise to min mn. The loop that we saw in between what it is really doing is it is incrementally changing values of variables such that starting from the precondition before the loop is entered I finally end up in values of variables that satisfy the post condition. Now you know one can say that suppose I did not give you this loop I just gave you the precondition and the post condition and I said that design a loop which would allow us to go from the precondition to the post condition. So this is a design activity basically we are asking how do we incrementally change variables to affect a transformation from the precondition to the post condition. Alternatively I could give you this loop and then ask well is it the case that this loop really affects the desired transformation from the precondition to the post condition. So this activity is also called verifying a loop and as you will realize it is a post design activity once you have designed and written down your program we can ask this question is this program really doing what we wanted it to do. Now it turns out that both designing and verifying loops requires very similar kind of reasoning and so we are going to look at both these activities together in this lecture. What a loop is really doing is it is iteratively changing values of variables so that the relations between these variables changes in the following way. The relations between these variables satisfies the precondition when we start iterating for the first time immediately after exiting the loop the values between the variables satisfies the post condition and I want to view both this precondition and post condition as special cases of a relation that holds every time we are about to iterate and I will call this a loop invariant for obvious reason this relation holds invariantly every time we are about to iterate. So right at the beginning of the first iteration the loop invariant is really similar to the precondition and the last time the loop iterated and when we went back and checked the loop condition found that it was false and came out the loop invariant at that point should be similar to the post condition. In addition it is also desirable that a loop terminates we do not want infinite loops in most cases. So in order to ensure termination it is desirable to have a certain metric which is integer valued for example the value of a counter and we want to ensure that the value of this metric monotonically changes towards a fixed value so that we know that after some time it will reach that fixed value and at that time the loop will terminate. So such a metric whose value monotonically changes towards the fixed value as the loop iterates is also called the loop variant we will see examples of this right away. So here is our min max loop we have the precondition and the post condition here and I have written loop invariant and loop variant but kept them blank because we want to see how to arrive at a possible loop invariant and the loop variant in this particular case. Now let us see what we want to do here we have two given values to us let us say m and n these are represented by the heights of these two blue vertical bars. We want to initialize i and j to the values of m and n initially so initially the maximum of i and j is this the minimum of i and j is this and we also know that initially min mn and max mn have both been initialized to 0 so they are here. Now as the loop iterates what is going to happen this is how we begin the loop i set to m j set to n min mn and max mn are both set to 0. Now as the loop iterates i and j both reduce whereas min mn and max mn both increase now in this picture the red arrows show the values of max ij min ij at any point of time the blue arrow shows the value of min mn as well as max mn in this case and please note that this blue arrow is the same as the blue arrow over here so the amount by which min mn and max mn has increased is exactly the same as the amount by which both i and j have reduced and as the loop iterates basically the i and j arrows will come down and the min mn max mn arrows will go up so we have this then we have this then we have this and then we have this and at this point notice that j has become 0 and so we want to stop the iteration at this point and say that now we have obtained the minimum value of m and n. So now let us see how we might get a loop invariant from the little animation that we have seen just now. Now if you look at this animation what you find is that the length of this red arrow which is max ij plus the length of the blue arrow which is really the value of min mn as well as max mn gives the whole of m that is the maximum of the two values whereas the length of this red arrow which is min ij plus the length of the blue arrow which is once again the value of min mn as well as max mn gives the minimum of the two values m and n and this is what we want to utilize we want to say that at every point as the loop iterated the value of min ij plus the value of the blue arrow which is the value of min mn actually gives us the minimum of m and n the two inputs that we read in. So we want to write that as an invariant that min ij plus min mn is the minimum of m and n of course when both i and j are greater than equal to 0. So that becomes an invariant that is true every time that we iterate around the loop and now what you observe is that when one of i or j becomes 0 for the first time then min of ij becomes 0 and therefore at that point 0 plus min mn becomes minimum of m and n which means min mn gets truly the value minimum of m and n and this is the time that we want to stop changing the value of min mn any further and we now want to go and calculate max mn. So how do we do that? So this is the time when j has become 0 i is still not 0 we have got the value of minimum mn let us stop changing min mn any further and let us try to get max mn. So what do we do? We get rid of the j part and then we keep decrementing i just like before until i becomes 0 and if you see what happened here once again the value of this red arrow which is max ij plus this blue arrow which is max mn equals the maximum of m and n. So max ij plus max mn equals maximum of m and n and that holds at every point as we iterate and therefore that should give us the next loop invariant that max of ij plus max mn is max of m comma n when at least one of i or j is greater than equal to 0. So clearly when the last of i or j becomes 0 then max ij becomes 0 and I get 0 plus max mn is max of mn which is exactly what I wanted max mn should be truly the maximum value of m and n. Now you know we had this little complication here about when both i and j are greater than equal to 0 then I can use this relation how do we get rid of that? We basically can use something like this saying do not let min ij fall below 0 cap it at 0. So this basically takes care of that little artifact when both ij are greater than equal to 0 and of course here when we said that when at least one of ij is greater than equal to 0 this is exactly how we iterate around the loop when both of them have become less than 0 you know we stop the loop we stop the iteration of the loop and therefore we can say that this relation holds at every time when the loop is iterating. And now of course you know what is the value of 3 raise to min and 2 raise to max we want the value of 3 raise to min to be 3 raise to min mn we want the value of 2 raise to max to be 2 raise to max mn and we have just seen that when min mn becomes equal to min of mn then of course this variable will get the value of 3 raise to min of m and n and when max mn becomes equal to the max of m and n then 2 raise to max will become the value of 2 raise to max of m and n. So this is basically what is happening in this loop i and j were both initialized to m and n they were both decremented we iterated the loop as long as we had greater than equal to 1 for at least one of them when both of them finally became less than or equal to 0 we stopped the iteration and min mn and 3 raise to min were basically incremented and updated as long as both of them were greater than equal to 1. So this is really the loop invariant in our case what is the loop variant in our case remember it has to be an integer valued metric that monotonically changes towards a fixed value. So in this case we have a non-negative integer valued metric which is max of ij that monotonically decreases towards 0 in every iteration. So since in every iteration this is monotonically decreasing towards 0 it must reach 0 at some point and at that point the loop terminates. So this is the loop variant once we have identified this and we know that this changes in every iteration monotonically towards a fixed value and we know that it is going to reach the fixed value after finite number of times we know that the loop is going to terminate. Now obtaining the right loop invariant or variant after you have completed the design is not always an easy step however it is crucial if you have to reason about loops. So the best practice is to write preconditions post conditions invariance and variance as comments when you are programming. So in summary in this lecture we have seen how to reason about loops in programs we have looked at preconditions post conditions loop invariance and loop variance and we have also seen the importance of comments to express preconditions post conditions loop invariance and loop variance. Thank you.


Stegosaurus is one of the world's most distinguishable dinosaurs, instantly recognizable by its two rows of upright dermal plates. These run all along its back towards the powerful spikes at the end of its tail.


Good morning. Today is May 4th 2023 and Santa Rosa City Council will be having a special meeting So I would like to call that meeting to order madam city clerk. Thank you mayor Councilmember staff here councilmember Rogers here councilmember O'Crepkey here councilmember Fleming here councilmember Alvarez Vice mayor McDonald here mayor Rogers Present let the record show that all council members are present with the exception of councilmember Alvarez Today we will have a closed session. We have items 2.1 conference with labor negotiators and item 2.2 public and employee Appointment madam city clerk may you please conduct public comment on those items? Thank you. We are now taking public comment on item 2 if you are in the chamber And would like to make a comment, but I have not provided a speaker card or your name Please make your way to the podium if you are participating via zoom Please raise your hand or dial star 9. You will have three minutes and a countdown timer will alert at the end of that period May I'm seeing no participants via zoom and no one in the chamber wishing to make public comment Thank you. We will now adjourn into closed session And may I test can you hear me? Yes, we can. Yes, great. Thank you We are ready All right, we will now reconvene our meeting seeing a quorum madam city clerk. May you please call the roll? Thank you mayor councilmember staff here councilmember Rogers councilmember O'Crepkey here Councilmember Fleming here councilmember Alvarez is absent vice mayor McDonald here and mayor Rogers President let the record show that all councilmembers are present with the exception of councilmember Alvarez Moving to item 3 report on closed session madam city attorney Good morning the council met in closed session this morning on items 2.1 and 2.2 No final action was taken and council gave direction to staff. Thank you very much Thank you and seeing no additional items on the agenda. We will now adjourn the meeting


All right, we do have with us the co-founder of the Exchange for Media Group, Mr. Nawal Ahuja, request him to please come up on stage and welcome you all formally. And he likes to be acknowledged with a loud round of applause. Thank you, Subarna. A warm welcome to all of you. Apologies for the late start. We finished the conference whoever was here. I'm sure you must have enjoyed the deliberations during the day. One of the things that I'm very happy about today is the fact that, you know, we are doing a larger event. We started the PR corporate communications awards and conference eight years back. Last year, in fact, you know, we went to a pub, that's where we did the award show. This year, we're back in a corporate setting in a bigger place. And I'm glad to see a full hall, a lot of people here from the PR corpcom domain. First of all, many thanks to Dr. Bharu for taking time out for the, you know, for heading the jury to all our jury members who spent their precious, valuable time to judge, as Subarna said, the 90 odd entries that were showcased to them. Thank you, Rohit, for flying down from Mumbai.  I see her somewhere in the crowd. Thank you for coming down from Singapore. You guys have been great to listen to. You know, without much ado, I'm sure Subarna will take the mic soon. I had a couple of thoughts I wanted to share. When we started exchange for media, for us, the pillar of the media business used to be the mainline media, which is television, print, marketing, advertising. One of the things that has changed in our business in the last few years is corporate communication has, PR has gone mainline. You know, if you look at what businesses are doing today, or for that matter, look at our own government. This government's two primary pillars are how they are engaging. In some cases, people say driving media's agenda and the other part is social media. These two are interrelated when it comes to driving messages. And by virtue of that fact, PR corporate communication has become a domain which is in limelight. I don't know of too many advertising agency heads that other day I was chatting with some friends of mine who were talking about the old days where advertising agency heads used to sit down with client, MD, COs, owners, and spend an evening dining, whining with them. I don't know of too many advertising agency heads who do that today, but PR agency, COs, owners, MDs have direct access to client, MD, COs, and owners. And that says a lot about how the nature of the communications domain has changed. Advertising agencies are seen more as, you know, the ones that drive marketing campaigns. PR, Corcom companies are the ones that are seen as driving images, image of a company. And that certainly is more important for our owner or CEO and MD than the marketing campaign, not to underestimate what a marketing campaign does. So with that, I think it's time to celebrate the good work that is happening in our industry. The industry has had a lot of challenges this year. In fact, last month, our weekly magazine impact did a cover on the industry. This industry is growing by leaps and bounds in another three years time from what we printed. It is expected to touch 2,000 crores of revenue, not counting a lot of unmeasured media that is bought on the side. So the domain has grown, the importance of the domain has grown more importantly than the numbers. It is in the name light. There's never been a best time to be in the PR corporate communications business. So as we gather here to celebrate all the winners tonight, let me congratulate all of you. Thank you for being part of it. All our friends from the industry, I see a lot of them. PRCI has been very kind to support this. Nitin is sitting somewhere in this audience. Thank you for being here. Prema, I saw you some time back. I don't know whether you're still around. Thank you. Madan could not make it. Kunal is here. Sorry if I'm missing out names. Archana was here. I saw her some time back. Thank you for being here. And I'm sure you'll enjoy the night. Glad that Suparna has put together this event again. She's been with us now five years. She is a specialist herself in the corporate communications domain. Good show, Suparna. I'm sure we'll all celebrate the winners tonight. And have a great time. Thank you so much. Thank you so much, Anurag, for giving me the opportunity for doing this for you. You've done this for eight years. You and Anurag, and I think this is the sixth year in a row that I have put this together for you. And I wish you all the best for the future.


Welcome to our user report of Azure installation in production. We had the OpenTelecom Cloud run in Azure instance and would like to share with you the experience that we made with setting up, configuring and doing a day-to-day operations of this continuous integration platform. My name is Nils Wagnus, but I'm just kind of the host of the session since I have the pleasure of introducing Artem Goncharov to you, who is the main designer and chief architect of our Azure installation at the OpenTelecom Cloud. The stage is yours, Artem. Thank you, Nils. So our report, well, I'm expecting pretty much everyone who is here right now is pretty clearly understanding. CI and CD is a must in every kind of really normal, modern software development process. Might be some years before, five years before, there were not so many fitting installations or fitting really options for CI, CD. Nowadays, there are many more of those. You can count on Travis, GitLab, GitHub, CI and many more. But for our installation, we have actually weighted all the advantages and disadvantages of every possible solution. And since we are downstream OpenStack installation or downstream OpenStack provider and offering some additional services on top of OpenStack, literally it is clear that we are also running some OpenStack and we are having in our development process the same requirements as OpenStack has. So we have said, Zoo is the best fit, simply the best fit for all of our needs. Then we have evaluated basically that compared how Zoo is being used in OpenStack installation with all this huge amount of projects and tried to map it to our use case. And we said, Gerrit is cool, but it is way too complex for many of the developers. If we are expecting some of the developers or users of the OpenTelecom Cloud to contribute into development of our CLI extensions of the additional Ansible modules or whatsoever, Gerrit workflow is too complex for anybody who is not really familiar with OpenStack development style. And on the other hand, GitHub is already there and it is providing the required code review features that Gerrit is actually mostly for. So we have said, Gerrit we will not use and GitHub since we are already historically hosting all our source code on the GitHub is the way for us to go. So we came to our first POC, it was around two or three years ago and more or less the only working solution back those days or yeah, useful solution was to deploy Zoo on a bare VMs and we have decided to use WindMill for that. The project which is helping to configure components of the Zoo using the Ansible roles. So we deployed one scheduler, ZooKeeper cluster, one node sharing, node pool builder and launcher, one executor, one web instance, we are publishing our logs to Zoo and we were also able to push some changes to the ZooSource code to address some of our needs like support for security groups and something additionally. Well, after the installation of there it is time to really say whether this is top of loop whether this is good or not. Well, when you are starting with Zoo I'm pretty much expecting that everyone who is trying to do operating of it would enable debugging mode on back those days. And as of now, but especially back those days hackers were not sleeping and they have actually found sensitive data in our logs. So from the GitHub where we are storing our project config, ZooConfig, there are links to UI of our installation where you can find links to the logs files stored in Swift and some of the log files we are containing unfortunately credentials and pretty sensitive credentials so that literally the whole domain was compromised. What you can do in this situation simply tear down everything and try to reduce the damage. So the installation was gone after probably couple of months of running so it was running, it was helping us but yeah, not that long. After some time trying to decide what should we do next and due to some organizational issues this time was a bit long it took us around nine months before our second attempt was started we were waiting options for running an OpenShift cluster or Kubernetes, but due to needs for having additional efforts for really maintaining of the OpenShift or Kubernetes cluster itself which is also something yet additional knowledge you need to bring. We have still decided to go to continue with bare metal installation but this time a bit different. From the overall architecture you will not see anything new here. We have three executors compared to first installation. We have three pools where isolated pools where the test VMs are being running so that the danger of compromising is somehow reduced and some facts to that our second attempt. Our installation is still publicly visible publicly accessible we store our source code on GitHub and we expect that Zool is tightly integrated with it meaning that log files of the execution runs are still available to everyone. We are doing installation on the RV metals like I already mentioned and this time we have decided to give a try and use Fedora Core OS image a pretty nice and cool operating system which gives you a nice opportunity to scale up scale down very flexible everything in containers so modern, more modern how can it be but the issues that we have faced with it pretty much immediately after might be some days Fedora Core OS is liking random reboots not really random when the Fedora Core OS image Fedora Core OS operating system detects that there is update of the image it fetches update and reboots without asking anybody well, while being cool feature of running containerized loads this is not very cool and Zool doesn't like it then the next challenge everything is inside of containers you are sure but what about node pool builder this is not really working properly at least back those days when we were starting with the second try it was still not possible especially when we are talking about SE-enabled SE Linux-enabled images so node pool builder cannot be properly containerized might be today it is different but back those days it was not and then back to the issue with reboots Zool Keeper cluster pretty much dies after each reboot if you have a cluster of three instances and two of them are just rebooting to install updates your cluster is gone yeah, that's it so we were actually forced to move some of the loads and some of the components to the regular operating system operating systems like either CentOS or regular Fedora installation so basically we have moved Zool Keeper cluster node pool and Zool scheduler to those proper operating systems and everything else remains as of now on Fedora Core OS everything is running in containers well as I mentioned already node pool builder pretty much everything with some exception and containers we are using root less, root full depending on what exactly so we are using this complete wildness of what Podman under Fedora Core OS gives to us in second for the second installation our GitHub Zool application is directed we have packed it with new keys connected it with Zool in the meanwhile, GitHub itself improved a bit with regard to how it handles privileges and permissions so what was previously criticized by many is that being an admin in GitHub you can literally do everything by passing Zool completely and since then since our first installation at least some parts here were improved and in some areas you can really enforce that even as an admin you cannot overrule Zool and then very important thing to mention we are running lots of functional tests against our cloud we are developing lots of public oriented tools like Terraform driver which is packed with support for our additional services our own additional Ansible modules our extensions to the OpenStack SDK CLI and so on and so on so we would like to deliver good quality of the software therefore we are in need to run a real functional test in the real cloud and this still being publicly visible so security is still there and need to be treated carefully some facts about our workflow the workflow is nothing really very weird it is pretty much following the regular recommendations of the Zool installation documentation so we are enforcing that every project managed by Zool is having branch protection otherwise Zool simply ignores you check pipeline must pass otherwise the change the pull request will not be merged code review is also enforced include admins option is also on to at least help us exactly the thing that I mentioned to help us avoid that with admin privileges you can merge pull request really without test passing and Zool application itself is also allowed to write a bit annoying thing considering the fact that you grant already to the Zool application right permissions in the project or in the installation but still you need to explicitly allow it to write into the protected branch well we are using a pretty new feature of GitHub draft pull requests which are in our case some kind like helping us to identify work in progress pull requests and in some cases later on that in details covering partially workflow functionality of the Garrett check pipeline is pretty much as usual we are also having cross project dependencies and using depends on feature really very heavily and then we are having our post review pipeline check post we were forced to introduce this pipeline since yeah Zool is treating secrets in a bit different way compared to all the other CIs and it enforce you if you would like to use secrets in your job this job must be must be reviewed before it is executed by somebody. So since we would like really to run those functional tests for our projects before we try to merge them we were forced to introduce this pipeline and together with draft pull requests we are here relying on the pull request approval giving kind of meta approval and still having a draft pull request and this gives us possibility really to run those tests before before merging and the gating is implemented by taking pull requests with the merge label pretty much standard way how you expect it to be and we can actually look to the limitations and problems in detail that we have faced with this type of installation and those are exactly the things that we would like to discuss with the community maybe somebody is also experiencing the same problems. So again, we is gating and using label gate as a trigger for merging with dual there is no possibility to limit who can do really that in get it you have rich real possibilities to limit who can trigger workflow in GitHub. Unfortunately it is not possible and actually everyone who is having more than read permissions in the project is able to manage labels. This means it is pretty hard to isolate that. Admin maintainers, users with admin or maintainer privileges in the project they are still able to merge pull requests by passing Zool. So yeah, while we are enforcing that check pipeline is passing we are still able to bypass really gating here and this is a challenge what we are not really able to properly address as of now with the exception that we are trying to give only maximum right permissions to every users in the project and that we are using more or less isolated administrators or managing their privileges properly. Managing manually over 100 projects in GitHub. Well, we are currently having two organizations in GitHub and Zool is taking care of more than 50 projects as of now. This means that for all of those 50 plus projects you need to configure all the branch protections properly, you need to verify that the user accesses are done properly and manually doing that is what we are having as of now is becoming really a challenge and we are trying to come up with some automation but this automation is only possible if Zool whether this automation is triggered by Zool or not is then having real kind of like really super admin privileges in GitHub what is already a security relevant issue what might be not very nice. The issue what we were also having from time to time is that Zool doesn't respect or was not respecting back those days and as far as I know there is a work in progress towards fixing that Zool was not respecting code review requirements. So yeah, in GitHub we can configure that code review is required but Zool itself is not really looking what exactly is required whether there is more than one code review is expected or whether code owner review so basically from a special, from somebody special is required. So basically Zool is triggering is trying to gate trying to merge a change but it fails means Zool is consuming resources without being really able to do the merge. So from this security point of view everything is clear but it's really a resource waste. Single maintainer or contributor in the projects while in Garrett with Garrett it is possible in GitHub as an owner of the pull request you cannot review your own pull request. This means that if you are the only contributor the only maintainer of the project with this particular Zool workflow you would not be able to merge a single change into your project. This is not good but I don't see as of now any work around any proper work around some of that. Then the challenge we see there is no easy way to trigger or a trigger jobs from other pipelines like periodic pipelines or promote pipelines without involving admin. While using GitHub heavily we are addressing regular developers who are not necessarily having deep Zool understanding means involving them in Zool administration is not really proper way or triggering permanently Zool administrator to just to trigger a job is also not something good. There are definitely ways how the possibilities is right in your own admin UI for those purposes or really using JVT but this is still not a very nice concept. This is still requiring understanding of Zool internals or at least deeper understanding of the Zool that you cannot expect from a regular QA guy who is responsible for having periodically jobs running, test running. And the next challenge what we have is the secrets handling in Zool versus the one, the concept how you have it in Travis and GitHub in everywhere else in all the other CIs is pretty much different. And we are really having challenges explaining people why this is important and why we are requiring them to do some workarounds or to change the regular workflow of their development just to achieve this security. So while definitely something required for the security but it sometimes really makes life complicated. What we have next, separation of logs with sensitive data. Have I already mentioned we are running functional tests against real cloud and running functional tests meaning you are playing with real accounts. While using secrets is helping definitely, there are places where you cannot really do it in any other safe way and those credentials still might leak. So we need to work on the way how really to distinguish whether logs of the run should be treated in a separate way and should not become publicly available. We are having also issue with direct continuous delivery scope or actually with lack of those. While Zool is running Ansible and Ansible is able to do everything, it is still not very easy to use Zool for continuous deployment, continuous delivery with the help of Ansible. Inventory is there but you cannot really do that much with it. So continuous delivery is possible but not in the way how we would like it to be. Lack of Ansible collection support, I guess there is a work with regard to that but at least as of now there is no. We observe also from time to time periodic losing jobs and that Zool is really looping in retries of individual jobs or actually for all of the jobs and we are forced to reset completely to restart all the processes which is not good. Unfortunately, we had not enough time to really go deeper in details on that. And then as I said already Fedora Corviz is coming with Podman means we are using Podman for all of our containers and we are getting all the problems of Podman like periodic crashing, like ports being not bound to like problems with overlay FS and so on and so on. But yeah, we try to overcome that. Future plans of our installation at least migrate some parts when not everything onto the OpenShift cluster. We are not clear as of now with the way how to which project to use for that whether we would like to use some existing projects or whether we'd like to come up with our own solution. But this is a clear direction for us. At least also start running some jobs in OpenShift cluster not running, not spinning VMs for that and definitely do more of the continuous delivery with Zool. So as I said, we are doing already some parts with continuous delivery like publishing our documentation somewhere on some web servers or whatsoever but we would like definitely to do more. And yeah, this is all with regard to how we, what is our experience with Zool installation? Well, thank you a lot, Artem, for your brief overview of all the details. And well, we are open now for question and answers if time permits and please connect to the conference system here. I ask your question or get in touch with us directly on the last slide. We have our contact details as well. Last thing in this session I'd like to point out is our OpenStack Scavenger Hunt, easy treasure hunt. There are a few questions to be answered on the occasion of the 10th anniversary of OpenStack itself. We do a refer of a photo drone. So some nice nerd gadgets to win. And if you're interested, there is the URL for the link for that. For that set, thank you very much. And we're looking for feedback, comments, any questions, whatever. Yeah, thank you very much and bye-bye. Bye.


Leila Mukaddim, you are from the African Development Bank. Welcome to WPC-TV. What are the obstacles that the ADB faces? Thank you very much first. I just come from Egypt, four years in Egypt, and I think Egypt is a good example where we can identify some of the obstacles that the African Development Bank is facing. And one of them is to be able to leverage public money and mobilize private sector resources. And for that, of course, I mean especially to finance infrastructure projects and important projects including industrialization and also the value chain. So the difficulty is to find the ecosystem to leverage these private sector resources. In particular, if we talk about public-private partnership, what are the laws? What is the legal and regulatory framework? What sort of sectors do we want to target? Water, not very successful. Airports, very successful. And how to push the government to take the right sector policy decisions and implement them. I mean, one comment that's always made, especially about the developing world, is that corruption gets in the way of the most practical and most effective solutions.  Is that true? I don't think it's true because all these multilateral institutions, including the African Development Bank, they have put very strict procedures and policies towards the combatting corruption, basically how through our procurement rules first, but also and most importantly through the monitoring and supervision of the projects we are financing, in particular public sector projects with the government. So the government is the implementation agency, but they come back to us on each and every procurement, of course. I mean, it's light, it's not cumbersome for us to review and provide our non-objection. And also our presence in the field is very important towards that. First, to reach our development impact through these projects in partnership with the government. But second, to make sure that all the procurement process is done based on our own procedures and it's done properly. So the monitoring is kept in place. Very strong. Excellent. Thank you so much for coming. Thank you.