Parasomatic, magnetic, effortless. There's just something about them. They may not look like Thor, but somehow the gods have blessed them with the gift of sex appeal. They seem to just naturally have it. That indescribable presence, personality, or attitude that excites and attracts others easily. Here are five common signs of strong sex appeal. Do you show any signs? One, how you kiss. According to sex therapist Dr. Laura Berman, 66% of women say they would break up with a guy after a bad first kiss. She's referring to a kissing research study from Susan M. Hughes of Albright College. In the study, 59% of males and 66% of females admitted that if a first kiss wasn't very satisfactory, at all, they would end the relationship. It might be a good way to assess someone's sex appeal, right? Dr. Berman explains that you really learn a lot from a kiss. She says, you're seeing if you like the way they smell. All your senses are engaged and you get a sense of their sensuality, their connection, whether they're a take charge kind of person or more of a stepping back kind. Wow, yeah. You may find someone has a strong sex appeal from how they kiss you, but it seems there's more you can sense as well, which brings us to the next point. Two, dynamic attractiveness.  Sometimes it could be your tone of voice, how you phrase things or how you express yourself. This is called dynamic attractiveness. Dr. Ronald E. Rugeo, PhD, explains in an article for Psychology Today that it's all about body language. It involves the expression of our emotions and our underlying personality and is a critical element of an individual's personal charisma. So what can you do to increase your dynamic attractiveness? Rugeo adds that expressing positive effect, which can be a smiling face, an upbeat tempo, and expressive eyes and facial expressions all associated with dynamic attractiveness. Three, to wear red or not to wear red. Have you ever heard of the red dress effect? It's a phenomenon in which a woman wearing red clothing, perhaps a dress, is seen as more sexually appealing as opposed to other colors. But it might not just be the women in red that have sex appeal. According to findings reported in the Journal of Experimental Psychology, the study's researcher, Andrew Elliott, PhD, says, our findings suggest that the link between red and sex also applies to men. 25 men and 32 women were asked how attractive and pleasant a man was in a black and white photo of them. Would the image either surrounded by a white or red mat? The American Psychological Association, which published the study, stated that women who looked at a man surrounded by red or white, rated the man surrounded by red a little over one point higher on a nine point scale of attractiveness. A statistically significant bump. So the question is, are you gonna wear the red or a blue shirt on your next date? Number four, the pitch of your voice. American psychologist, Dr. Gordon Gallup, asked 10 men to rate 10 female voices based on attractiveness in an experiment. Several audio clips were of the same woman, but at different times during their menstrual cycles. Why? During ovulation, females produce more estrogen and more estrogen can raise the pitch of their voices. So what did they find? Men were found to prefer the higher pitched audio clips from women. Dr. Gordon Gallup explains that when females are mid-cycle, when they're the most fertile and the most likely to conceive, their voices are rated as being significantly more attractive. And number five, situations and context matter. If you love horror movies or haunted houses, we've got good news for you. Here's why. According to Dr. Ronald E. Reggio, a great deal of research in social psychology tells us that the situation matters. What does he mean exactly? Well, for example, if you knew someone liked you, you may just find them in your thoughts more often because of this new information. And thus you may start viewing them in a new light. Reggio explains that we tend to reciprocate affection, enjoying rewarding and pleasing experiences together makes a partner appear more attractive to us. Reggio also refers to the misattribution of arousal where one mistakes physiological responses brought on by something else such as fear as attraction. Perhaps you're watching a horror movie with your date and feel a kick of adrenaline at a scary scene, but you may just misattribute this as feelings of arousal for your date sitting next to you. Situations matter. Maybe you'd have more sex appeal at a haunted house. Oh no, rickety old bridge. Do you relate to these signs? Is there someone you find attractive? If so, do you see these traits in them? What are some ways you can improve your sexual attractiveness? Let us know in the comments below and let us know if you enjoyed this video. If you did, don't forget to click the like button and share it with a friend or crush. Subscribe to Psych2Go and hit the notification bell for more content like this. As always, thanks for watching.


To be monogamous with a chain or polygynous with full chest Another drama at the grave site a morning wife had defensive children a known or unknown other woman Children that bear a photocopy like resemblance to the man laid to rest factions in the extended family Tension uncertainty I could go on painting the scenario But at one time or the other we have all heard stories like this that touch Bringing us to my advocacy isn't it time to be practical Marriage has been defined as the union of a man and a woman for companion and procreation However today the definition has changed globally with different viewpoints and institution a partnership and as a responsibility Marriage is going through a lot of bashing with the main bone of contention being whether a man can be monogamous Is he polygynous by nature or made monogamous by man? Which is in more natural state with the prevailing rate of men in monogamous? Marriages with at least one other woman in his life this advocacy is not talking about philandry men But men who deliberately keep a second or even a third woman in a similar state of matrimony Without the document and have children with these women and on the day he dies all hell breaks loose The family is the bedrock of any society and currently it is facing so many challenges That cannot be all addressed in this advocacy on this side of the divide we need to make up our minds What we accept as marriage we have three types of unions in Nigeria civil unions Islamic and traditional marriages civil union is based on the adopted legal framework of the British of one woman one man Which the church subscribes to as standard while the country retain traditional marriages, which is our culture in most cases You have the man marrying both or more women using different methods secretly without a clear understanding of what we want to recognize and practice We're going to keep having unfortunate situations fractured families in heritance fights and battles and unnecessary bad blood a couple of men have stayed true to who they are and Have been clear that they are polygynous and have lived their lives and conducted their affairs So thereby mitigating drama The surprises have come when the man has Confirmed to societal norms not a problem But men who find themselves in this dilemma need to make arrangements while still alive to mitigate the pain and potential Damage that could occur after their demise if not for the women involved for the sake of the children Women have an innate need to be recognized along with her children But as long as the prevailing practice is to bury our heads in the sand on this one There will always be rancor unless the man settles provides for her while he's still alive or reduces his wishes into a will But then he better have a strong loyal lawyer willing to do his bidding even in death Either way the evil that men do I think I was about 24 and I'm not going to mention his name. It was the last born of his family He was completely pampered. He was loved and all that his father died And lo and behold on that day realize that suddenly I'm not the last one again. He was frightened He was shocked. He was upset. Everything came upon him and he kept saying oh So while everybody was devastated and scrambling and trying to figure out how when we Yeah, I don't look at the last one. So I think I think the major issue there is the dishonesty of it True everybody's veins and but the second wife knows about it But the third wife as the case might be but I think it's the first one. Yeah, that's the oblivious everything Who somewhere in our mind has Reverved that husband and father. Oh, he was a good man. He loved me provided for me then upon his death Realize that But it was a good man I think there's there's always been a problem and that's the problem of Culture Okay, the society For systems down our throat nature and we don't Well, the world the world is we don't own those things. We don't decide to Be be me. So if I agree polygamy is the way for me. Why don't I just Which is how much I'm a polygamist. I'm thinking what will people say what would this person say? And that is shaping The things I do. So so we need to have a case where more people I Do anything with with a conviction so Many people are going to monogamous marriages or even getting married at all without a conviction But yeah, it's the next thing you are your your man. You're going close to 30. You have a job You have this next thing is to Get married I you know I interesting that we're having this kind of conversation today because in the last few weeks Or should I say months recently I've said questioning the fact that where did the narrative of monogamy come from bless you That's my you know that question had said come in and I said I said ask and I mean most of my adult life I had pretty much stayed on all the idea or the knowledge of being monogamous like Like money you said that because of what? Society had said now, please don't get me run. I'm not saying I want to be polygamist But then I asked myself something really and truly what exactly is the problem with it What is the issue with it because there are situations where I found it very saddening that? First only for men who am I to the first wise and therefore whatever reasons not because I want to be philandering Eventually do meet somebody or someone and then they actually have a better relationship with the next second or third wife A lot of women I've had women who literally wants to spec, you know stone me and I'm saying that Really it might be time for us to look at what exactly is it that we want to be what does culture say and even for religion Especially the Christian religion. I told something that the British method of the you are the one who have adopted What has the the book that we follow what has he really said about it? I said and the part about reference to one man one man clearly stated was about if you're holding a Position within the institution of a church, but in the prayer times for them. We've seen men who had numerous wives a lot of other people outside all called today come combines and I'm like this story is a this narrative is a very Dyson I really I think but I do not think I have a problem with comfort advocacy comfort. You said When he decides I think now and here in the 21st century We should remember we should remove the fact that it can be a he in this situation truly. I think it's both genders Okay, so for me my advocacy was coming from what we already have we haven't even finished Which is a man and I love the way any so you distilled what the advocacy is really about and that is please let's be practical Men and for me are not built to be monogamous We women have more of that because once she settles with a man and all you know, she's she guides her She secures her position her children brings everybody up, you know keeps whatever the man is meant to What do you call it propagates? He's a lineage. I think they'll if we're more honest and I don't think it's culture. That's our problem Our culture wants to marry more women our men want to marry more men It's the adoption of strange laws that we have come and put and twisted religion into it for me that is causing the problem What is our culture now is not is not necessarily our original culture. There are so many things that we do as Nigerians Okay, that's Too many Look at even when we marry you one person who want to go to church Cards have traditional wedding go to court. That's true. It's it's not coming from what has become our new culture I don't know what could last quite For me, you know, whenever I look at the situation of marriage and you know people's perspectives Um, I would like to say I can be solo one on one side. I don't mean I'm not in reference to myself I mean I mean men can be solo one on one side And of course they are men that would just want to stay one woman and not want anything else and Like we've mentioned the importation of culture funny, um The people that brought us to culture, you know When they were being taught religion by the original people that had it And then they went to do crusades back to collect the holy land from those people don't have monogamous situations so It's somewhere along the crusades the mentality of adoption of a culture forcefully put by europe Like we wonder why One church is in Rome. So kule nice one. I think you've ended it very well So now onto politics with kule As he's giving us the 10 commandments of what a political aspirant should live by don't go anywhere


Hi and welcome to the session. Let us discuss the following question. The question says in figure 10.39, this is the figure 10.39. A, B, C and D are four points on a circle. A, C and B, D intersect at a point E such that angle B, E, C is equal to 130 degree and angle E, C, D is equal to 20 degree. Find angle B, A, C. Let us now begin with the solution. In the question we are given that angle B, E, C is equal to 130 degree and angle E, C, D is equal to 20 degree. We have to find angle B, A, C. Now angle C, E, D plus angle B, E, C is equal to 180 degree since they are forming linear pair. Now substitute the value of angle B, E, C in this equation. So we have 130 degree plus angle C, E, D is equal to 180 degree. This implies angle C, E, D is equal to 50 degree. So this angle is of 50 degree. Now consider triangle E, C, D. In triangle E, C, D angle E, E, D plus angle E, C, D plus angle C, D, E is equal to 180 degree because sum of all angles of a triangle is 180 degree. Now substitute the value of angle C, E, D and angle E, C, D in this equation. As substituting the values we get 50 degree plus 20 degree plus angle C, D, E is equal to 180 degree. Now this implies angle C, D, E is equal to 110 degree. Now angle C, D, E and angle B, A, C are equal because these are angles in the same segment and we know that angles in the same segment are equal. So angle B, A, C is also equal to 110 degree. Hence our required answer is 110 degree. This completes the session. Bye and take care.


I am Lisa Van Gelder. I am VP of Engineering at Stride, which is a consultancy company here in New York. And before I worked for Stride, I used to work at Guardian Newspaper, and this talk is about some great caching disasters that we had while I was there. So I joined the Guardian in about 2008, and really soon after I joined them, the websites had a going down every lunchtime. It was really weird. So lunchtime was peak traffic, but it wasn't higher than normal traffic. It was pretty much standard. There's no reason why it seemed to be going down. So it went on for about a week before someone finally thought to look at the caching stats. What we found was that right before the website went down, the cache was being cleared. And this made sense. So traffic at peak time about then was about 2,000 requests per second. We're doing that on 12 servers. So the only way we could serve that quickly to rely very heavily on caching. So if you clear the caches at peak traffic by the time the caches fill up again, the website's down. The servers can't cope with the load. So now we understand it's caching causing the problem, but why? So you started going through the logs trying to see what was going on. And we noticed that right before the website went down every time, someone submitted a poll. So this is the example of a poll. It answers such burning questions as who has the better hair, Jennifer Aniston or Justin Bieber. And the poll at this point was actually numbers, so not percentages. So 29 people wanted to vote for Justin Bieber's hair. And someone submitted a bug. They said, right, 25 people voted. I voted. It didn't go to 30. What happened? The answer was caching. So developers were great, I can fix this bug. So every time someone submits a poll, we'll clear the caches. The numbers will be correct. So at lunchtime, someone submitted a poll. Website goes down. To learn two very important lessons from this, the first one being if caching is important to you, then monitor it. The second one is never build a clear cache system. Why?  And you know if there is a big red button, someone is going to push it. The other reason is that you build a clear cache system when your caching is complicated and you don't want a complicated caching system. Why? Because caching is really hard to test. And it's vitally important. And the more complicated it is, the more likely it is that something is going to go very badly wrong. So the trick is to keep it as simple as you possibly can. The other good trick with caching is to cache for a really short amount of time. So often when people build a cache system, they think that, well, the longer I cache for, the more I protect my servers from load. The long cache time is a really great idea. But you have to think not only about protecting servers from load, but how long it's good to show users stale data. So long cache time means stale data. So we build a three-day cache at the Guardian. And this three-day cache served to cover up a multitude of really bad SQL queries. We had some awful really badly performing SQL that did things like build a list of articles for the site. And some of the articles are pretty old. They didn't change very much. To protect ourselves against those queries, we cache them. We cache them for three days. Every now and then, one of those articles would get deleted for legal reasons. And when that happened, we would send the cache system notification to remove that article and just that article from the cache. So there came a day when that clear cache message got missed. So an article got deleted from the database, but not from the cache. The three-day cache is a hibernate query cache. If you hope that hibernate would deal gracefully with something being deleted from the database, you would be wrong. Hibernate through an exception.  Hibernate powered our website. So at this point, half the website is showing sorry pages. We're kind of half down. Effectively, we have cache poisoning. So the cache is showing bad data, but we're still serving from cache. So we're not stopping. This would have been bad enough if the cache time had been, say, a minute. We would still have turned sorry pages across the website, but the cache would have naturally reset as the expiry time reached. But this is the three-day cache. So we're showing sorry pages for three days. We were lucky that this happened at four in the afternoon, so we could clear all the caches. The website didn't go down immediately. But all those horrible queries that we tried to protect ourselves against by caching for three days, we're running them all, all at the same time. So performance on the afternoon is absolutely dreadful. So the lesson from this is don't try and fix awful SQL with caching because at some point it's not going to work on you on them anyway. And the other one is cache for the shortest amount of time that you can get away with. So we did a bunch of testing at the Guardian to find what a good cache time is. We discovered that for us, actually one minute was the optimum. So it's long enough that it protects our servers from most of the load, but it's short enough that if something goes wrong or uses C still data, that we notice. So work out what the optimum cache time is for you and it's probably shorter than you think. Does everybody recognize this guy? This is Julian Assange, the creator of Wicked Leaks. So in 2010, the Guardian did a live Q&A with Julian Assange. This was really the first test of our comment system and it's caching. It's the first test on the load. And we're feeling pretty good about the comment system at this point. We've got a really simple one minute HTML fragment cache in front of the system. So we're feeling pretty good. So the live Q&A kicks off and pretty soon the response time is dreadful. It's absolutely awful from the comment system. So we look at our cache stats, which we learned from last time. And actually the cache hit rate is really good, but it's not helping us. Actually, the better the cache hit rate gets, the worse the performance is. And weirdly, we're doing a lot of database callings, which makes no sense. So ordinarily, the comment system is one of the least important parts of the website. So if the comment system was running really slowly, we would just turn it off. But the core came down to my editorial that this was the most important thing on the site right now. So we had to keep it going. So we turned off pretty much everything else. We got the main site serving stale content. We turned off article updates just to keep this thing running. And we didn't go down. We clung on by our fingernails, but we didn't go down. Now, the end of it went to investigate, what happened? Why didn't caching save us? What we discovered was that it wasn't just HTML fragment cache. It's a cache with processing instructions. These are basically server-side includes. And what they're doing is actually building links. So Guardian services didn't know what other services were deployed to. So at runtime, this thing was doing a database query to try and find where the other service was deployed and building a link to it. This is a terrible idea. So caching works really well because you can serve cache content really quickly. If you add processing instructions when you're serving cache content, it's going to slow you down. If you add a database call for every bit of cache content you're serving, you're done.  Never do this. Only cache that in content. I'm going to finish with a woolly rat. So pretty much every company has a woolly rat. This is the one piece of content that suddenly goes crazily viral. And it could be days, months, sometimes even years after this thing got published.  This is ours. It's a new species of woolly rat. It went viral because it's huge. No one had ever seen this thing before. And it's a massive woolly rat. We came from Papua New Guinea. It was discovered in 2009. We got the front page of Reddit. And then suddenly this thing went absolutely crazy. But the interesting thing about this kind of story is, yeah, it's crazy traffic. It's happened like you've never seen before in your life. But it's crazy traffic to one story. Or in other words, this is a brilliant test of your caching system.  In fact, if you get hit by woolly rat and your system struggles, there's something wrong with your caching system. Go investigate it. In our case, the thing that was wrong with our caching system was that our cache was manual. It relied on a human being there going, oh, traffic looks a bit dangerous. But it turned on our extra caching layer. We got hit by a woolly rat 8 p.m. There were no humans, noticed that the traffic was high and turned on the automatic cache system. So after the woolly rat, we made that automatic. So we had our servers notice when traffic was getting a bit dangerous and turn on caching automatic. So that could be automatic. You may have noticed that all the dates in these slides were pretty far in the past. This is partly because I don't work regarding newspaper anymore. It's also partly because we finally learned our lesson about caching. Caching became much simpler, much shorter, just one minute HTML fragments. And since then, as far as I know, there have been no great caching disasters. So these are my lessons. I added an extra one on this. I actually did a preview of this talk with some other people. And one of the people in the audience worked with Fastly, which is a CDN. So I've adapted the last slide to say, never build a clear cache system unless you are actually a CDN. So if the entire purpose of your company is to do caching, then you probably want to build clear caching. Otherwise, never do it. Leave it to the experts. Keep it as simple as you possibly can. Thank you.


The Managing Director of the Niger Rail Recoperation Engine Afideh Oheria says the increase in rail-track vandalism is becoming alarming, especially in the narrow gauge. He is calling on all hands to be on debt to curb the deep-seated menace. Afideh Oheria says the increase in rail-track vandalism is becoming alarming, especially in the narrow gauge. He is calling on all hands to be on debt to curb the deep-seated menace. Afideh Oheria says the increase in rail-track vandalism is becoming alarming, especially in the narrow gauge. He is calling on all hands to be on debt to curb the deep-seated menace. Afideh Oheria says the increase in rail-track vandalism is becoming alarming, especially in the narrow gauge. He is calling on all hands to be on debt to curb the deep-seated menace. Afideh Oheria says the increase in rail-track vandalism is becoming alarming, especially in the narrow gauge. He is calling on all hands to be on debt to curb the deep-seated menace. Afideh Oheria says the increase in rail-track vandalism is becoming alarming, especially in the narrow gauge. He is calling on all hands to be on debt to curb the deep-seated menace. Afideh Oheria says the increase in rail-track vandalism is becoming alarming, especially in the narrow gauge. He is calling on all hands to be on debt to curb the deep-seated menace.


Well, it's that time of the week again. It's time for Chit Chat Across the Pond. This is episode number 761 for March 4th 2023 And I'm your host Allison Sheridan this week Our guest is Bart Bouchotte with another installment of Programming by Stealth. How are you doing today Bart? I am doing good The I've ended up with different show notes than I had planned to have and slightly different than what I promised But I really like them. Does that make it better? It's good Yeah, yeah, well, we don't know that it's not right It's not what you thought it would be, right? Yeah, and I'm I have also learned that there's a few more things I want to teach you because I was doing I was trying to do examples that didn't use anything we hadn't done and I realized that we're missing some fundamental pieces that I completely slipped my mind like say the ability to do mathematics We forgot that so that's that's not on the agenda for today But that is I have added that to the I've started to create a list of silly things I forgot early on and we did boolean stuff But we didn't do the obvious next step, which is math So that's you know, you do need to do that from time to time, you know add one It seems like I should be able to do that, right? We've been talking a lot about the fact that I can't add one to the number of podcasts I've done So yeah, that's a good one to do. Yeah, the other thing I'd completely forgotten about on my mental map Is that uh bash doesn't only have arrays. It also has dictionaries, which it calls associative arrays So trying to cram arrays and loops into this episode and then also get associate of arrays in was a terrible idea So all arrays are next installment But the other thing I had forgotten was quite how many loops bash has Four we're going to learn about four types of loop So that is sufficient I think and the great news is I like the good loop. They all They all Provide a nice way to do a common thing So in theory you can simulate every loop on planet Earth with a while loop. That's true in pretty much every language But it's often you get much nicer code when you use different looping constructs and you get code that reads more like English And that will make future you very very happy Because okay, so you can do it in a way that's not wrong But it's not as elegant and good looking and logical looking as it could be Yeah, which I would which the fancy pants word I would put on that is maintainable Right Yeah, because I don't like it and he was oh you're just wasting time I was like no I am making this code maintainable and I promise you in five years times when there's an emergency We have to fix this in two minutes. You will be very thankful. This code is maintainable I get it grumbling. Okay, fine. It's an investment then. Yes, it is not a waste of time an investment. Anyway, I'm getting ahead of us so We will be learning about while loops until loops for loops And something that's sort of kind of a loop because it does go around forever a select loop and I have Never come across anything like a select loop in any other language Um All four of these loops have a very very similar structure, which is very pleasing So if you remember when we did if there was the if keyword to start a conditional and then we had the then elif else and fee commands to control the conditional Sort of define the code blocks. Well for a loop you have less that you need to define You don't have this concept of an and an else, right? So what you have is the four loop kinds and then they all they all four of them use do and done So while something do done Which again, it's clean. It is clean. So what so while whatever do done Until whatever do done for whatever do done Select whatever do done Okay So the while loop is the most generic loop while some condition is true Keep doing these commands Right, so you're going to have while and then you're going to have your condition And then you're going between you're doing you're doing you're going to have a list of things to do And as long as the condition evaluates to true, we execute the commands We check the condition again We execute the commands we check the condition again and we keep doing that as long as the condition is true So could you make an educated guess as what an until loop might be for? Until it's false Or no, no as long as it's false As long as it's false or until it becomes true So a while sounds backwards to me, but okay Well, it's an inverse right the and until is the opposite of a while So a while does something as long as something is true. So while something is true. We keep doing this Uh an until loop is Keep doing this until something happens So the most common form of until loop is to wait for something That takes time and you don't know how long you might have an until loop that just keeps checking You know check wait five seconds check wait five seconds. Oh, thank goodness. It's finally true now I can continue my code Or okay, that makes sense asking the user for input I want an integer. No really an integer. No really an integer. Oh, thank goodness, right? So Now I'll be able to remember it. There you go the for loop is for Methodically making your way through a list if you have a list of things you have to process a for loop is probably what you want Because a for loop will start at the start of a list work its way through and then finish and the last one the select loop is It's an infinite menu It presents you a list of all the possible options lets you choose one Executes the loop for that value and then gives you the list again And it will keep doing that until your code tells it to stop So if you have it specifically for user interaction Specifically it is a user interactive loop So it is used in terminal apps that present you with the menu, you know, they're not as popular these days But you used to log into something like Before all of our switches and routers had web interfaces You would tell that into them and they would give you this menu You know choose one to set your dns server to choose two to do whatever And then you would do whatever and then it would just ask you now What do you want to do and it would give you the same menu again choose one for your dhdp. So, you know, whatever Those are what a select loop is for So basically we ask the user we do what they said and then we say hello What would you like now and then we keep doing that? So cool So as I've said the structure is always the same Loop command followed by whatever arguments that loop command needs followed by a do Then as many commands as you would like followed by a done So that is and they're all that shape, which is very pleasing that they're all so similar The other thing we have Is that all three all four of them support two flow of control commands which They exist in javascript and we have talked about them and I adore them But I don't know if many people use them They are continue and break. Do you remember what continue does in javascript? I don't remember the context for it So in a loop know what the word means in a loop in javascript Whether it be a while loop a for loop a for each loop If you use the keyword continue in javascript, what does it do? I don't remember Okay, but thankfully it does the same thing in in in bash, which is nice for people to remember So when you're in a loop you have a bunch of commands The continue command will skip everything else left in the current loop And go on to the next iteration So it won't exit the loop, but it'll just jump to the next cycle So it's very good for skipping things So imagine you're looping over a file and you want to skip blank lines at the top of your loop you could say if square bracket square bracket minus z my variable named square bracket square bracket Do sorry if then continue fee That will mean that you go into the loop you say is this an empty line? Yes, it is skip on to the next iteration And then all the code below is is ignored for your empty lines It's much easier than putting everything else in an else statement Especially if you have five or six checks to do right? What if you're checking for empty lines you're checking for comments You're checking for something that's invalid if you have lots of different checks If each of them is just a simple if statement where they continue Your code is much cleaner than if this goes wrong else if this goes wrong else if this goes wrong You end up with some really horrible mess otherwise So the continue command is fantastic for short circuiting a loop around a loop And the break we weren't talking about conditionals. We were talking about loops And all your examples of continue were just in a conditional Okay, so you want to loop through something to process it Right, so you're going to go around the loop An amount of times right could be could be 10 could be 100 So you're going to have say 10 lines of code for do what I want to do On those 10 lines of code you're probably going to have some conditionals right if Whatever i'm processing is like this do this otherwise do that If you meet a condition that says i'm done here I don't need to do any more work in this pass through the loop Then you would say if whatever the heck is going on continue And I will just jump you to the next thing Okay, I think I see it now. Got it. Okay. Okay. Now we do have examples So you will see these in action and continues big brother is break It just means I am so done here I'm leaving the entire loop. I don't care if I was supposed to go around another 100 times We are leaving this loop. This loop is over So break is a real We're finished with this loop. I So it will definitely require a conditional to trigger break Yes, run into this situation Abort abort. Yes, exactly. So yeah, so continuous like Stop this one And break is just stop If that helps, okay yeah so Let's start with the while loop because it's the most generic And it's possibly the one I think you will tend to see most So just like with the if command You say while space and then you Basically provide a command and it's the exit code of that command will determine whether or not the body of the loop gets executed So the stuff between do and done only gets executed if the command after a while Gives you a successful exit code Which is zero Which is zero exactly so Get ready. Okay And it will so it will the condition is checked So the command is executed and we check the exit code If the exit code is success, we do the content of the loop If the exit code has failed, we skip the loop. We never we execute the loop is zero times, right Assuming we get a success on our first attempt We execute the code of the loop and then we go back to the top and we run the check command again So whatever was after the while we run it again We see whether we've got another success if we've got another success through the loop We go again and we keep doing that until there is not a success And then we jump to to beyond the done So then yeah, we continue executing our script after the end of the loop In other words after the done Make sense Yeah, yeah, perfect so Possibly the most common use of the while loop Is for reading a file's content line by line Because you don't really know how long it is. So a for loop is a very bad fit Whereas the while loop when combined with our friend the read command that we've seen before will Cycle through line by line by line Until there's no more lines So we have seen that read Can be used to read from standard in And so if standard in hasn't been jiggered with for want of a technical term Then standard in is connected to the keyboard. So when you ask read to read something from standard in it comes from the keyboard But if you jigger with it standard in can be anything So the pipe command for joining two terminal commands What it does is it takes a standard out From the command on the left, which would normally go to the screen It diverts it And turns it into standard in for the command on the right So what would normally the keyboard is not the keyboard It is in fact the output from the previous command And so we can use a read command to pull The content of whatever was whatever's on the other side of the pipe And what we didn't really say when we used read for reading from the keyboard, but it's kind of implied Is read goes one line at a time you hit enter And that took the value and brought it into your script because enter is the end of a line So if you use the read command and you pipe it five lines of text The first time you run read it will read the first line And then it will stop and it will give an exit code of success If it did read a line or fail if it didn't read a line So can you see how a while loop in combination with a read command can let you cycle through a file? Yes, yeah, that makes sense. So that is the single most common now. There is one little caveat here By default because it's expecting you to type stuff in on the keyboard by default the read command Obeys escape characters So if you want to type into the input to read A new line character you can say backslash new line and it will accept that as input instead of ending the line But if you're reading the content of a file It could contain actual backslashes so you want to tell bash to Read without sort of to repress in my mind. I call it repressing the escape character So the minus aura flag basically means I want the content of this file and I don't want you messing with it I don't want you turning backslash quote into quote or backslash new line into new line Just give me the actual characters that are in the actual line of text, please Okay, all right. It's just a habit you have to get into read minus or So let's stop being all hand wavy The first of really quite a few examples in this installment. I went up as far as the letter g So I don't know how many well a b c d e f 2 or yeah more way more than five anyway So our first example, we're going to read as a content of slash etc slash hosts Which is a file that exists on every flavor of linux on the mac, which is why I've chosen it Um, it's often doesn't have all that much in it. But anyway, um In there is where you get to define mappings of ip addresses to names that exist even when dns is broken And the file allows the octo sort for the pound sign to be used as a comment So we're going to write a little script That prints out the content of the host file, but it ignores comment lines Which gives us the opportunity to play with our continue command in real well, okay So you will find the code in pbs 146 a dash while That sh So we have our usual shebang line then we echo at a message your computer has the following host entries And then the first thing we do is we cat the content of etc hosts into a pipe And on the right hand side of the pipe We have a while loop So we cat etc hosts pipe while Read minus or and then we choose the name that that we want to read the line of text into And so we are going to read the next line of text into a variable named hosts entry Okay, so just a reminder. Can I say back what that means what you just said? So cat is basically saying get the contents of this file Correct And it's in the file we've chosen is slash etc hosts and then use the pipe so that it becomes That the text that you just pulled from that file becomes the text that's standard in To the while loop Which is going to read and we're going to say minus r because we wanted to repress thinking about escape escaping a special character so that it listens to it and we're going to put all of that into Each line will go into a host entry correct, they be added to host entry or They become host entry for that instant in time For that pass through the loop until the next time you call read right? So every time you call read it replaces host entry with the current with the next line It got and the next line it got and the next line it got and as long as it gets lines It does two things update the variable give an exit code of success update the variable give an exit code of success and when it runs out of input It doesn't update the variable and it gives an exit code of fail Which will end our loop. Okay, so I should I should have Said more than in my description because I didn't understand that as while read is you said read looks at line by line So it's not reading the whole etc host file. It's reading at once Over and over again until it runs out of lines to read and that's correct. It's false The exit code of one correct Yes, okay, which has the effect of ending the loop. So in effect, so we started a while loop Yeah, so everything between do and don is going to get executed once for each line in the host file And we can access the content of the line with dollar host entry So the first thing we do after our do Is we check if the line is empty because we don't want to waste our time printing an empty line So we say if square bracket square bracket, and then we use the minus z operator for checking for emptiness Or for checking for zeroness, I guess if you want to mnemonic Did we already learn that minus z means? We did We did we learned about it last time but we learned about a lot of operators So I would I imagine you you will end up looking back at the previous installment as a little crib sheet And I imagine you'll make friends with the ones you use most often because everyone's coding style is a bit different So everyone's going to make friends with different operators Uh, I I much prefer a minus z to checking if something's equal to the empty string. I I don't know. I just prefer it that way It's not wrong or right, right? It's This is how my brain does it so if minus z Dollar host entry says so for this line that we just read because host entry was the variable name that we created for the One line we just sucked in from etc host If minus z meaning if this this one line is empty Then and then then and you've got to continue So it says don't even do the rest of this thing start out go to go to the next line Bing Bing Bing so we've short circled the rest of the loop Okay, the next thing we do is we have another statement So this time we're going to take Host entry and we're going to echo it so echo just means printed out and then we use the pipe To shove the content of host entry into the egrep command which lets us check for a pattern And the pattern we want to check for is starts with the octo-sorp symbol the pound symbol Whatever we're calling it today the hash symbol. We haven't said that word yet So if you're wondering why a minus q Well read it out loud because they haven't they don't know that there's a minus q It says if echo dollar host entry pipe egrep Minus q and then the starts with octo-sorp. Yes So normally you would use grep to show you to show you the lines that match a certain pattern But we don't want to print out of the screen the result of this grep We just care about the exit code And grep will give exit of success when it finds at least one thing And fail when it finds nothing So minus q says don't bother printing it out. I don't care what lines you found I just want your exit code. So it's q for quiet Oh, okay. Okay. So you're saying egrep would have printed it out It would have printed it out, which is very annoying this I know because the first version of the script I forgot the minus q And then I put it back me up again. What is the purpose of this script? This is going to be to find everything that isn't a comment So there was a host name Precisely so the actual entries in the file. So an empty line isn't an actual entry And a comment is not an actual entry Precisely. Okay. And this was a way for me to show you the power of continue And to show you the power of loops. So I spent a bit of time picking this example So if we haven't fallen through either short circuit Then we arrive at the last line of code inside the loop Which is simply echo a star sign to make ourselves a markdown style bulleted list Done or host entry done So if you run You will see probably on a new mac you'll probably see two entries. Uh, basically an ipv4 Actually, no, you see three entries an ipv4 for local host an ipv6 for local host And then the broadcast address for broadcast host I have local host broadcast host and local host again Yes, so colon colon one. Yeah, that's that that is the world's shortest ipv6 address That is literally the shortest ipv6 address So there we go. So that is an example of a while loop in its most common form Reading through lines of text from something So in this case it was from capping a file Let me describe it from the top again because we didn't really we didn't actually finish it very much But so you said echo your computer as the following host entry. So that's what we're going to see spit out on the screen Then we did the catetc host. So we get we get the file and we pipe And we pipe pipe it into while read-r host entry So it's going to pull that one line Then it's got to do and a done at the big picture But inside that we are we want to skip empty lines So we do the if minus z dollar host entry. So if it's nothing then continue So go to the next line We have another if then which we didn't actually describe the if then but the if was to uh, take a look at the host entry and using egrep Quietly find out if it has an octo-thorpe at the beginning if it does then continue Otherwise the next thing that's going to happen. We don't have an elif or anything But the only other thing it can do is echo Uh and a star for the markdown dollar host entry perfect Okay Right. So again, just I didn't have to make that file executable to run it because I did Because I did before zipping it Okay, thank you Yes So just to draw your attention again I'm going to keep saying this because it confuses me and I've been writing these scripts for years. Therefore. I know it's confusing our listeners So the read command we pass the name of the variable host entry When we go to print it or when we go to echo it We have to say dollar host entry because remember dollar means value of So i'm just repeating that for repetition sake. So it's just value of yep as soon as I saw it I went way up. Oh, right But I had they argument my head Yeah I'm also just drawing attention to the minus z from last time. It just means check for an emptiness basically So minus z will work with arrays, which we haven't met yet and strings And I believe it also sees zero as empty.  I can't pronounce my typo You got it good because that damn loss on that one And if I'm going to make a note to myself that I should put a link in the show notes here to detain me the terminal episode on eGREP That probably will help people who have not done take me the terminal first So the eGREP command accepts from standard in Some text And it checks it against a regular expression in pcre format So the hat symbol means starts with and then the octo-sorp means the octo-sorp So we are literally checking to see if the host entry starts with The octo-sorp Right So I've spent a lot of time on the while loop Because it's the most common and because all of the other ones are very similar So we don't have to spend nearly as much time because I can just say Like the while loop So let's immediately jump into our first new friend. It is going to be the until loop So until is exactly the same as while not But I find while not hard to read So I will always use until in languages that support it But it is it is literally a while not loop if you want to think of it that way And the most common use of while not is for us squishy humans so The next example I've been a bit arbitrary here and people will complain at me slightly that names can have dashes in them and stuff But I was I don't want this to get too complicated. So the script example b Is going to expect the user to enter a name and then it's going to greet them by name And it's going to check that they really have entered what it considers to be a name And to make it a realistic example We're going to say you can either give me the name as a command line argument Or I will make you type it in But no matter how you give it to me if you give me garbage, I'm going to ask you again So if you pass it as the first argument and it's not valid I'm going to ask you if you don't pass any arguments I'm going to ask you If you pass me the correct name as the first argument that I won't say anything The script will not prompt you. It will just greet you. Is that does that make sense? Yeah, yeah, I think so Okay, so again, it's pbs 146 b dash until that s h We have our shebang line And the first thing I do is I simply assign a new variable named name And I give it the value of dollar one in other words the value of the first argument gets put into a new variable with the name name And that may or may not be empty right because there may or may not be your first argument It doesn't matter So we then go to the until loop where we are going to keep asking for a valid name until we get one So we say until And then just like with the while loop we need to give it a command And what's going to matter is the exit code of the command But in this case if the exit code is fail We do the loop and if the execute is success we don't Do the loop it's an opposite. It's an upside down world So again, we're taking our name variable and we're piping it into egrep And the pattern we're looking for is starts with An alpha character. So not alpha numeric Alpha, which means you can type in accented characters. I was friendly enough to foreigners to do that Uh Followed by one or more of so the plus symbol means one or more of followed by End of the string. So start of string one or more letters End of string is the pattern for a name Okay, so the so the artist's formula known as prince wouldn't be able to do this but Yeah, as I say, I it's not realistic It's the point is to have a condition on the input and that's like that this will do So okay, so so the first time you run it it's going to be false because you haven't yet done the do loop Well, it might be true Right, if you passed me in a successful if you've passed me in a valid name then the first time through the loop But we'll not go through the loop Okay Okay, that's right because you can add the argument after you say to run the command Exactly and we will have taken it and put it into the variable name So when we echo dollar name It will already be valid. We will pipe it to egrep egrep will say. Oh, yeah, I find this pattern Until we'll say oh, you succeeded then I shall do nothing because remember until is upside down world success means fail so Think of it like 1984, you know pieces war Whatever you want to put anyway So insider do we simply have read minus p. What's your name? And we read it into the variable named name. So minus p means prompt So in other words, we will type the text. What's your name question mark space and then you will have to type in your name And it will go into the variable named name So this is straight from why doesn't name have a dollar sign on it We are we are specifying Where to go we are not saying give me the value off So at the beginning of this uh little script, it says name equals dollar one But that's only that'll only do something if it got a if it got a name Well, okay, well either way it could contain an empty string is what that means So name either contains some text or the empty string, but name does exist But you can write over name Correct. So that's what we're doing. So read minus p is going to write over name So read expects as its first argument. Sorry. Yes, this first argument It expects the name of the variable to write you so we are writing to a variable named name Okay What's the minus p again? It's the prompt. It's the bit of text that will appear before the blinky cursor Okay That's it's so backwards you're saying read Something that I'm about to cause to exist Minus p prompt. What is your name that then goes into this variable? Yeah, so read what prompt where so read what where I don't see this backwards, but I don't know maybe maybe that helps you funny Read what where is how I think of it Okay, and and that's inside that's the only thing inside the do the do done It's just that read. So then we'll just check. Did you give me what I wanted? Have another go. Did you give me what I wanted? Have another go and until You give something valid another or something that successfully meets the egrep It will keep doing that round and around and around you will go And finally when you give it something that matches the egrep The loop will skip over and you will end up with the echo statement at the end Well, hello there dollar name smiley face And I confirm that it keeps going if you give it a one a parentheses or an accent But if you give it an accent at e It says hello there e perfect, which is why so square bracket colon alpha colon square bracket means any letter including weird ones in other alphabets Which is cool. That's kind of an important regular expression because a to z as a character class Is a valid regular expression But unless you're actually sure that it's really just a to z it's actually not right because accents do exist outside of us English-speaking people, you know I did I did find it funny when you said to take care of foreigners like I'm in I'm in the United States and you're in island. Who's a foreigner? That is yeah, okay. That's a fair point. That's a very fair point Just languages that use accents in names. Yeah. Yeah Okay, so that's the until loop. It really is just an inverse while loop like you could rewrite that code with a while not But like I say until there's so much easier to read until it's valid keep doing it So then we come on to our friend the for loop whose job it is is to do something over a set of things so the Okay, so the way the for loop works is the first argument we give the for loop is going to be the name of a variable The second argument is the keyword in And then all other arguments are going to be what the loop loops over So the first time through the loop The first thing after the in will be put into the variable with the name you gave it as the first argument The second time through the loop the second thing after the in goes into the variable The third time through the loop the third thing after the in goes into the variable And you keep doing that until you run out of things So in is the keyword in it's literally in it's the letter So for space a name you've chosen space in space your values I can read that and I can hear you saying it. What does in mean? it Pretend it's a symbol but It's it's a marker What does do mean? It's it is The language says you must type the characters i and It is the rule. It means to execute something in must be to like to look inside it It's it's it's just a marker. It's just it's a marker that makes english sense for Name a variable in some set of things. It's It's a marker. It's a it's it's a placeholder So we've got something to the it's for something in something. What what is what are the two somethings? What are the which one is which so the first something is the name the variable will have inside the loop The name the variable what variable okay, so the thing Everything after the in is going to be stepped through one by one by one When you're stepping What do you call? The current thing you're stepping Well, the answer is whatever was on the other side of the in huh So for i in one two three four The first time through the loop i will be one the second time through the loop i will be two the third time through the loop I will be three And one two and three will be called the the word that you get put between four and in Yes While you're in that step so four pancakes in Waffles dot html Okay, waffles at html is one thing so the first time through the loop the variable waf pan Ah, what did you call it? Sorry? For for pancakes in waffles dot html. I'm picturing waffles dot html as a whole list of stuff in it Ah, okay, but if what okay if waffles html has the whole list of stuff in it Then you're going to have to do a cat or something to pull the whole list of stuff out Okay, so okay. No, no, no, I I think I have an example for dessert in Pancakes space waffles space popcorn Okay So we're not reading a file here. We've just got a list of stuff Correct. So the everything after the in space delimited Will be the values that go in so it's arguments, right? Just it's a command with arguments So first argument after in yeah Because everything's a command now So actually, yeah, the dessert example is actually a good one So if you say for dessert in pancakes waffles popcorn the first time through the loop dessert will have the value pancakes The second time through the loop dessert will have the value waffles the third time through the loop dessert will have the value popcorn Okay, okay Now in your example So I have some more English to say so The list of arguments Supports shell globs, right? So if you have the command LS Okay, so I'm about to explain So when you have the command ls, you know, you can say ls star And that behaves as if you had typed in every single file in the current directory That's actually what bash does Is it the star character expands into everything that matches it which has actually put there as First file space second file space third file space fourth file So those expansions are called shell globs So you can do for file in till the slash star And till the slash star will actually expand into documents downloads Whatever a desktop whenever picture pictures videos movies whatever apple calls them, right? So each thing in tilde will actually appear on that list And then each one will become the variable one by one It's just the name of that thing Yes, so the thing between the four and the inside that folder just pictures the word pictures becomes Yes, yes, yes So our example is pbs 146 c for files that sh And we have our usual shebang line Echo the files in your home dear colon And then we start our for loop. So for space file space in right so for is Baked in and in is baked in and I have chosen the name file And then what is it we're going to loop? We're going to loop tilde slash star Which bash is going to expand into whatever the heck is in your home directory Which is going to be different to mine and if you're on linux instead of the mac it'll be very different to mine Then we have do Echo our markdown style star space dollar file done Okay I think if I hadn't been reading the show notes what you were trying to explain with four and in would have made a lot more sense Because I kept looking at four file in tilde slash star what? But now that you've explained it now I've Backwardsly caught up if that makes any sense It does so again if you run it you will see it though. It just lists the content of your home directory One line at a time with a little markdown bullet point in front of it. Yay, cool So the other very powerful thing you can do after the in Is you can have a command that outputs a bunch of words And then loop over those there's lots of commands Unfortunately, it's very hard to find something that's cross-platform. So with my real world hat on The modern versions of red hat linux use a firewall called firewall d And it's controlled with a command called firewall dash cmd and firewall cmd outputs its information as space delimited values So I am forever looping over the the output of the firewall cmd command like forever doing four you know service in Dollar sign open round bracket then my command close round bracket and my command would be something like firewall d Firewall cmd minus minus list minus services And then I will get back ssh HTTP HTTPS as the values for my for loop or whatever is enabled on that server Right, whatever the firewall is configured to allow on that server And then I will do something You know, I'm forever looping over the output of firewall cmd So any command that outputs text can be used after the in as long as you use the dollar open round bracket Your command close round bracket, which basically means you get the value of the output of this command And it will just every time it meets a space it'll just say oh, you're the next thing I have to worry about and it will loop through them which is strangely powerful So Like I say, it was hard for me to find an example that will work for everyone whether they're on a mac or whether They're on linux, but I did find a command the groups command lists every group that you remember of separated by a space so Our next example is not named in the show notes. That's a terrible omission by me So the the actual script is going to be d 146 d dash for command ssh Usual to bang line Echo you belong to the following groups colon for group space in space Dollar open round bracket groups close round brackets. So that is saying execute the command just type groups It I tested this because I was trying to understand it if you just type groups in a terminal It just lists all the groups. They were like you said So that's why you're saying for group in dollar Open parentheses groups. So as it spits out this space delimited list Exactly and then every time you go to the loop, it'll be the next value in the list and you will be calling it dollar group So for group in dollar open round bracket groups close round bracket do echo our markdown star dollar group done And that will print out that's actually pretty cool Very powerful. Like I am always fussing around with my groups. Unfortunately. Yeah, so I didn't realize there were so many of them But there are on the mac a particularly more modern versions of the mac There's even more of them anyone that starts with an underscore is a super secret apple group And the other ones are but there's also a bunch of like com. Axel Com.apple.access underscore screen sharing which is also an apple one. Yeah This account has allowed you to now do screen sharing And ssh. Yeah, I don't have I don't have a particular one Sharepoint com.apple.sharepoint.group.3 and .2 I don't do sharepoint Microsoft did that I was going to say there's a there's a non-zero chance you have one drive installed and one drive is sharepoint Okay, that's probably it. All right I see clam a v Clam a v grand don't even ask you don't even ask you haven't done a clean No, no, this is my brand new no, no, this is my brand new m1 mac I did not install clam a v that group came into being somehow. I don't think clam is oh interesting that group exists Anyway, yeah, lots of groups The point is you can so the most common use of while is to loop over a file The most common use of four is to loop over a commands output But it can also do more traditional for loop things So the for loop actually has an entire other optional syntax Called the c like syntax, which I find confusing as all heck Because it does something called automatic Variable expansion Which means you don't use the dollar to get the value of I Which breaks my head every which way But it lets you write something that looks like c code if you squint very hard So if you want to loop from one to five you can in bash and it is valid say for space Round bracket round bracket i equals one semi colon i less than or equal to five semi colon i plus plus round bracket round bracket Do echo the value of i is dollar i done That is valid bash I am not a fan of this approach But it is what do you like about it i is less than five not dollar i i That's i though i gets to do whatever i want or if i could put pancakes in there and it would work Because i'm actually creating a variable and then accessing it twice And i don't have to use a dollar while it's inside the two the double Roundy brackets because inside the double round brackets. You have this magic variable expansion But later on inside the loop's body. It's still dollar i I don't like it. It's also very verbose Because there is a better way. There's a much better way So bash provides an operator called the range operator Which is open curly bracket a starting value dot dot an ending value close curly bracket And it will expand into a space separated list of numbers Between the first one and the last one So the range to to demonstrate it i've put a little table of examples So open curly one dot dot five becomes one space two space three space four space five Five dot dot one becomes five space four space three space two space one so you can loop through in either direction And it works with letters So a dot dot f becomes a space b space c space d space e space f so Why would you bother with four? Bracket bracket i equals one semi colon i is less than or equal to five semi colon i plus plus When you could simply do something like four n in Open curly one dot dot five close curly And then n will become nice and clean nice and clean So as an example, we have pbs 146 e For range s h which is going to print out all of the valid hexadecimal characters by using two range operators So we say four space car space in space open curly zero dot dot nine close curly space Open curly a dot dot f close curly so the first Range will become zero one two three four five six seven eight nine space a b c d e f So the end result is perfectly spaced zero to nine a to f in other words every valid hexadecimal character Now did you have to put a space in between the curly brackets for to get a space there? Yes, otherwise, I would have ended up with a single loop entry called nine a Nine a that's what I was wondering about by the way when he said car He means a variable. He's created called c h a r For character a character. Yeah Now in bash version four, which apple have not dained worthy of sharing with us There is an optional third Parameter, I guess To the dot dot operator where you can say start dot and dot dot step So if you want to go in twos you could have dot dot two Doesn't work on the mac. We are on version three, but don't worry There is a terminal command that can do sequences in every way you care to imagine It's called seq is the command sec for sequence If you do the man page it can do way more than I'm showing you here If you give it a single argument it assumes you want to start at one And count up to that single argument So if you say sec five you get one space two space three space four space five If you give it two arguments it assumes you'd like a range So you if you say sec 10 15 you get 10 11 12 13 14 15 If you do it in reverse it's perfectly happy too. So sec five one will give you five four three two one And if you give it three arguments The first argument is your starting point. The second is your step and the third is your finishing point So sec zero five 20 becomes zero five 10 15 20 So the middle one was the was the step the middle one is the step which is mildly annoying if you're used to writing in bash four But the sec command is portable the sec command will work in all versions of bash and it will frankly work in sh Because the sec command has been around forever So if you want to we if you need to do funny sequences the sec command is your friend it's very powerful And it works on all versions of bash and sh and zsh. So it's portable as well So as an example We have a little a little script called four step range and sh Which prints out the even numbers between zero and 20 by simply saying four n in dollar round bracket sec zero two 20 In other words started zero in steps of two as far as 20 And then we say do echo our little mark down star dollar n done That's fun. That is fun. And I could say I really like the range operator because most of the time you're going in steps of one So the range operator works a lot of the time and it makes for such friendly code For i in one dot dot ten. Oh, it's so nice Okay, so I added in javascript now. I know So that brings us on to our final weirdo friend the select menu loop So select works like four Only instead of it going through everything in order It asks you which one you'd like and then only does it with that one And then it gives you that list again and waits for you to tell it what to do next So the example I have here is Our pancakes example from earlier actually So the example is pbs 146 g dash select s h and it will ask you for what dessert you'd like until you tell that you've had enough Which gives me an excuse to use the brick keyword Which is of course the only way to get out of here apart from the exit keyword, which really gets you out So we have our usual shebang line and then we say select dessert in So again, it's dessert is the name we're choosing in and then come the values So i'm giving it the values pancake waffles Popcorn and then quoted so the space doesn't break everything enough. Thanks And then we have our do So inside the do we have if square bracket square bracket dollar dessert is equal to enough. Thanks Then break fee Echo have some dollar dessert So when you run that you will be asked whether you like pancake waffles popcorn or enough. Thanks And you it will put numbers next to each one automatically and you just type the number matching your choice And then you will get the appropriate echo And if you type four Which is enough. Thanks. It will stop because the break will pull you out of the loop I like it. I like it. I think I would have said, uh, thanks for eating here Yeah, you get the idea, right? It's you know, it's some sort of escape close So I have a challenge for you Oh goody I would like you to write a bash script Which takes Input from the user in some way. Well, actually, okay. I'm gonna be a bit more specific I want you to take input from the user either as the first argument Or by prompting them But I want to get from the user A whole a whole number that is Greater action or just a whole number. I think I say which is good enough. Yeah, and give me a number Then I would like you to print out The table the multiplication table for that number So if you give the number three the output should be one x three equals three two x three equals six three x three Equals nine all the way up to 10 x three equals 30 And so if you run the script again, you give it five. I want the five times tables. You get the idea Uh a little hint The way I would like you to do the math is not the best way It's the way that's the most portable Because it's a terminal command called bc Which does not stand for before christ. It stands for basic calculator And you can either google bc or bing Or you can use man bc to figure out how to make the bc command do your math But the bc command can do the math you need to do here a simple multiplication Oh, okay. Good. So we don't have to do the the we don't have to do the bit that I haven't taught us yet Which is how to make bash do the math itself We're going to let the bc command do the math, but we will learn how to make bash do the math later So if you'd like some bonus credit So by default, I want you to go from one to ten So the five times tables would be one times five up as far as ten times five But for bonus credit, I'd like your script to allow the user to optionally also specify how far to go So if you optionally tell it to go to 20, then I want you to go all the way up to 20x Whatever the numbers that they gave us the first argument So this means figuring out how to get it to put those numbers in as well Not hard coding one times It does so input equals Yeah, so I figured I want to give you exercise in the most important thing So you're going to have to make a variable You're going to have to use the read command to get input from the user You're going to have to deal with command line arguments You're going to have to loop You're going to have to print things out And you're going to have to call a command and use the output of the command for something else So you're going to use the bc commands output for something So that's actually a really good sampling Of everything we've done so far You probably have to check to see if it's a number two You do, yeah So that's again, you're looking you're you're doing some conditional work there of some kind Whether that conditional is an if statement or whether it's part of a loop up to you There's a lot of there's an infinity amount of correct ways to do this challenge But you will have exercised A very big subset of what we've learned This sounds fun And not that hard, but I better get stuck Well, that's the joy of that's why I chose this assignment. It's not long, but it does make you use many concepts at least once And since you haven't had much practice, I would expect this to take you You're going to end up with very few lines of code And probably many hours to get there and that is expected an hour hour per line, right? Yeah, exactly. That is expected and that is normal Uh, so at this point in our journey, we're actually making really good progress But I like I say I realized as I was trying to come up with examples that we have some work to do so Like, you know, they you know, love and marriage go together like a horse and carriage Well a raise and loops go together like you like love and marriage, I guess Um We really do need to do them next and it's been really really hard to avoid using an array For all of the previous installments because arrays are so powerful in programming And we should also learn about dictionaries because they are also Darn useful or associative arrays as they're named in bash world So those two will keep us more than entertained next time because they are very important and I want to do them justice because It's combined with loops. They are extremely powerful and you will definitely need them to to start writing scripts that do real world problems You need to be able to have arrays and associative arrays So that's where we're going next That sounds like fun. I like this stuff part. This is this is really cool I'm having a I'm having way more fun than I thought writing these show notes. Um I I do I've been doing a lot of bash programming But I've been learning about it piecemeal and now I'm getting to learn about it As as a whole say in unit and telling a story and I'm learning so much writing these show notes So many things are making sense to me. Yeah, it's it's actually a very logical a very simple language But it's a bit weird When I say a bit what I mean is heck and lotta weird. Anyway, here we are So I so this is uh is evergreen content, but I think This story will still work with evergreen content. I got a um Masted on toot from a guy who said he was really enjoying. He's starting to to uh do taming the terminal And he said it's great, but Bart talks too fast And so I suggest I said well, you can always go point seven five acts and he wrote back and he went Yeah, okay that helped and then I realized what was wrong Same problem. I had with listening to you on a podcast Smart speed is does not work with Bart's teaching So I've been I was listening I was listening to an episode of let's talk photography and I'm like, oh my god Bart slow down No, no, no, you you just finished the last concept. I don't have it cemented yet. Wait, wait, wait, wait, wait And then I went oh man, I bet I've got smart speed on so I wrote to the guy again And I said do you by any chance have smart speed on and overcast he said oh my gosh, this is so much better Yeah, I'll pause quite a lot I I make heavy use of pauses because I'm used to teaching in real world speed in you know in in actual classrooms Yeah And smart speed goes oh emptiness. We shall have none of that I guess you have a backing track.  It's horrible I was ready. I was gonna call you and yell at you for why did you why did you do that episode like that? So anyway, I'm glad you noticed also that was a fun episode if it was the AI one The first day I won't I forget. Yeah. Yeah, it might have been All right. Anyway So until we get to meet our friends the array and the associated array Happy computing If you learn as much from Bart each week as I do I'd like you to go over to let's dash talk dot i e And press one of the buttons over there to help support him He does 98 of the work here I'm just the stooge that listens to him and asks the dumb questions If you go over to let's dash talk dot i e you can support him on patreon You can donate via paypal or you can use one of his referral links I really hope you'll go over and help him out in the meantime You can contact me at pod feet or check out all of the shows we do over there over at pod feet dot com Thanks for listening and stay subscribed


Hello and welcome to the Crab Box Manage! I'm Andrew McFinn and James, and today we're playing Rizwanohan Red 100 Episode 31! 18! And today we are doing the last of Malibun, the Big Ben Clockwork Dungeon. So yeah, let's get into it. You were about to end. Oh! I steeped off! Steep off. Steep off. My god, battery! What did they do?  Here we go, I'm on, I'm on. Oh, I steeped off!  Yes! So this is probably going to be a longer episode because it's the last episode of Malibun. But yeah. So yeah, basically we want to kill these guys as quick as possible just because it's such a long dungeon, James. So blade and then hit pretty much. Blade and then hit. Yeah. You don't have a hurt.  Not my DM. Not your direct message. Yeah. Stop fiddling with your fish. Stop fumbling your fish. No, they're balanced.  Oh, Larry, convene it. I don't know how to say that. I'm not hoping that hits Storm. You're hating? I can't hurt. Why not? I'm going to set out my DM. I'll set out your deck then. I know what I need in my DM, alright? What do you need in your deck? Tempest, blade, and colossus. And then I'll move on. Tempest, Tempest, colossus, colossus. Colossus, colossus, blade. Oh my god, thanks James. Oh, prison. Oh, here we go. Hitting. Hitting. Killing. Trapping. Maybe. Just in case. Who are you hitting? The key. Okay. I'm hurting, bro. Yeah, no you are. I was just... Sweetie, sweetie. I've also boosted them, so it might be a lot of decent amount of damage. That's because I put that trap down. For James. You've killed someone before. He's killed someone before. Not this recording session. It's been last recording session, which was August. So, yeah. Sai, can you add easy destruction? I can make my way up to the maintenance areas if you take the elevators. I'll see if I can get ahead of them. Take out some of the colossus. Yes, you don't need that many. You won't be able to find your Tempest. Well, are you killing them? Yeah. Since you're the only one on? Yeah. Oh yeah. Killing him boss? Yeah. You don't even have an AoE yet? Noob. AoE? Yeah. I'll show you the pictures of my AoE platform. I pulled it apart. Don't hit this. No, hit next. I'm blading you. Who? I'll do... Things. I got a thing. Fine. I'll blade you next, James, so you can help. He's trolling me. He sent me a lini face. I'm not going to give you that one. He gave me a lini face. He gave me a troll face. I'm so boosted right now. Oh, that shield. Tough. You couldn't have done it on the other one, which has a storm shield. He only put that up this round, so you didn't know. Plus, that one's mirth anyway, so it's fine. Plus, I boosted on the other guys as well. You boost on this guy, James. Plus, you have two blades. He tried to save his deer, but he's going to die anyway. The other guy actually tried to save them. It's a bit of a deb? A bit of a deb. Richard tells the... I don't even know what I'm thinking about this. Sorry, I had to change my decision. Blimey. Those were a lot of stairs for me to climb. I got a squirrel. I'm not as young as I once was. There's no way I could have helped fight those guys at any rate. I tried to get ahead of them, but they blocked off the stairs. You'll have to continue on your own from here. I'm sorry I was of no use. Good luck, Gov. Good luck, Gov. Good luck, Gov. Rise into the top. I got a quest from Jack. Yeah, you don't need that quest. Yeah, we're rising to the top. Tap, tap, tap, tap. Who's hitting? It's Shelled Myself. Just for awhile. I haven't Shelled for a while. I'll blade you next round because I've got an OP blade in hand. Capsicle. I love your head as well. I want a cake. Can I have a cake? Yeah, you had one before, but you had to remove it. I'll blade you twice and then you can hit. Just round and then next round. Next round you're hitting. The same. 25. That's a 30 and I've got 25. No, Finn's got the accuracy stuff. Finn's got accuracy. Yeah. Put it up this round A. Huh? Look at this teamwork. This is how we get dungeons done. Not really. Yeah it is. Another blade and accuracy and then a hit. And boom, nothing can go wrong. That's why reverse is the best one. Yeah. I just got dropped back on my seat. Actually it doesn't really matter even me off in the first place as long as we're before James. So I have to be locked. Oh you're the header. So we can blade you before you hit. What's this? Hold up, what's this? No flake. There's also the thunder club as well. No, we only look at the one that's on. It's called Defeat Miao Yari. You won't have it probably. We just need to rise to the top of the tower basically. You leave it. I was trying to find which one we're on. I'm like, oh yeah, this is so hard. I just tower shoot. Oh we're freezing. I'm doing like crackdown. I'm going to run home. I'm doing storms. By the way, I'm doing storms. What are you doing, James? Lighting. Next round on storms over. What did you do? Probably not. No, probably not. I got a 10% mix. 10%? Woo! You don't lose that much health ever. Yeah, no. If we do it really quick, we don't lose any at all. What are you doing? What do you need? Oh yeah. You got this? On the wood beneath it. That's probably why he dies.  No, I just normally move my tank here. Like, because it says water. Push it around the room. Walking the dog. Walking the fish. Going for a fish. How many stacks he's got? He only has three blades. That's my draw up. Second blade stacking. That should really... Well, we're not as high as level as you, James. We can't, though, James. Because we're not as high a level as you. Oh, I'm sorry, we're not 77. Yeah, he had rank 5 boss. That's fine. As long as James is last, it's fine. We don't want James first. Oh, that's wrong blade. Delete that blade. This was actually a very smart move. Why? The one that I'm doing. Why didn't you mess? They've called only one of them strong. Yeah, but you boost if it's a spirit and converting strong to myth. On the balance is a good idea because you boost because myth is a spirit school. And balance boosts off spirit schools. Really? Because you clicked it straight away. I guess I can probably still kill him.  Of course you can still kill him. I know, we're really good. Yes, you're right there, James. Brits hitting. Brits hitting.  I'm hopefully getting the storm shield off. I'm hopefully getting the storm shield off so you can actually kill. There's only one storm shield. Why are you doubting me? Oh, I got the storm shield off. Perfect. A less. I'm not a girl. It's a less. No, it's a less. What? He's dead. He's dead for days. Boasting. Boom. Look at that damage. Look at that boost of a day. Oh, you're heaps this time. What's this? This is dog. This is milk. A dog. Don't spill the milk. James, you're winning first. Oh my God, James.  No, I'm clipping. It's not smart, James. Why not? It is smart. I'm just going to freaking bring some hit this round. A bulls. Enjoy the room. Oh, it's pretty killing. Okay. I won't hurt. Why am I hitting? Because James was in first. Okay. I'll try. I'll just need some blades. So, you don't want me to hit? I'll stack all my shields. It sounds like a good idea. Stack and build. I can take them all over the room. I can heal. I don't heal. No one heals. We've lost so little life that we don't really need to heal. The one who's lost the most is fun. Yeah. James, you should heal fun. Should I?  I said heal after a bit. I'll draw a card. I'll draw another card. I'll draw a card as well. I'll draw another card. Oh, that's helpful. I can use that. What's this? Put it down next time. Hurry up, James. Can't be right now. I passed. I'm hitting next anyway. Why are we going to do selfish? Good. See if the next moves. Oh, God. Oh, God. Oh, my God. Really, James? Have fun with that. He didn't even touch me. He did actually. He touched your favourite part. He just fell on you. I know. Disgusting. It's why it hurts me. I'll cry. It's not hurting me.  Get a rect to mate.  What did you get there? Oh, it's the dry end. It's booby lady. You see how boobs it's pouring? This is literally a porno now. I don't know. Sometimes same. Yes, everyone does. We just don't speak of it. I just need another one. No. I can do it. Dude. Oh, I can draw a card. What is it? I'm doing a spirit blade because obviously you're doing a spirit thing. Definitely not. Dude, I don't know what this is going to do. Why are you polymorphing? What is that? Why are you polymorphing? What are you polymorphing? Oh, my God. He took a tree. Why? Why? What do you do? It gives you a deck of a tree. You can have a tree deck, except the battle is probably over soon anyway. I can trick it. Get it? No. It's not funny.  Oh, my God. Now look, Opie, compared to the amount of damage it actually does. Oh, I hit him not.  I tried it. I think there's another booby lady. Oh, sorry guys, sorry. I'm going to have to put R18 on this now. Explicit content for booby lady. Look at them boobs. Don't we just love those boobs as a student of the life school? Oh, her life's way so nice.  Oh, that's a shame. You don't like that word. Did she wreck you? Did she wreck you? A wreck? A wreck. Look at that boost as well by Brent. Thanks, Brent. Did you get a wrecked by her? Please stop, James. I'm going to wipe them all out. No one attacked. Oh, Brent, you're attacking. Yeah, you said that I was. Change. Change. No. Do it. No. I'm allowed to hit. I wanted to get a clean sweep. You've had your time to shine. You've had a lot in the last few. What are you doing? Stop. The booby lady. Stop with the booby lady.  At one perp. Yeah. Good deal, mate. I fizzled.  I can still hit next time.  I can still hit next time. I'm going to hit next time. No. With what? You don't... Oh, yeah, let James hit this. These hits are cool. This is a natural attack. I'm going to hit just because of us. Mine is a natural attack. Yeah. I was six, eh?  Oh, you quit. He got huge. He got games. Okay, what is it? It's moon. You can't. No. Okay, so what was the combination? I can come in. Don't step on the plates. I have. James. I stepped on the board. Don't. James. James, stop it. Don't step on them. Let me do it. Snowflake. Bird. It's so close to me stepping on it. Can I pull the lever? Yeah, not yet. Tell me when. I'm standing here. Bird. Dog. Fine again. Dawn Rider. Moon. Pull the lever. That pollen. I didn't even see that one. Have you pulled it? Yeah. It worked. It didn't work. Pull it. James, pull it. I pulled it. James didn't pull it. I pulled it twice. There we go. It didn't work. It didn't work. What did we miss? Oh, someone pressed that. Oh, fuck's sakes. That one needs to be on. Pull the lever now. It worked. Yay. Bird. I got pulled. Oh, my God. James went in first. What was that? It's like, go faster.  That's not how it works, but okay.     Oh, did I show you guys to pull it? I think we'll let James die. I can hear myself, actually. That died man. You're hitting now, right? That's round two? No. Why not? I'm killing myself. Why? Hit.  I might need a mess. Hit. James, why do you go first? I got pulled. Because he thinks he's good. Why didn't you wait at the door? I did wait at the door. I was sitting right beside the door, and I got pulled. Mm-hmm. It serves him right for going in first. It goes back in your deck. Yes, it does. Yes, it does.  See, look at that nice wee tempest there. Tempest, James. Like, a storm symbol surrounded by mountains? Yeah, it's a mass storm prison. I didn't make too many clothes there.  Because you're bad and went in first, and couldn't hit last round. Because you didn't have things guidance. How's it my fault? You did it all wrong. You couldn't pull the lever. No, because someone... ...pushed the wrong things. No. Uh-huh. Yeah, definitely. Oh god, first. Actually, I'm second, so lol.  Last games. I wanted to make sure I was last, so you girls don't get along bad. What's going on here, James? I don't want you girls to have your period, TC. Okay, hit.  Hit your fork. I'll hit you, lady. Lady. Can we please be mature adults, guys? We never mature adults, honestly. Well, we should be. I was a mature adult. When? Never. Past life. Past life. Look at that.  Oh my god. James is a question now for me. He's just the main crouched. Yeah, I know that happens a lot. I like crouching.  No, no, I haven't. You know what I'm talking about? What? Why? Because I cast a spell on her. I'm scared. Do you get it? Yes! Ha ha! I wasn't trying. Why is it a race to see who goes in first?  Just as long as James does. I'm racing not to let James go. Should I just do a mess? Just hit. Right now. No. Yes, hit. Does he have the bits too? Oh my god. I should have done the guidance.  Because you would kill. No, I wouldn't. Yes, you would. I wouldn't kill him. Yeah, well other people can hit for you. Look, I killed her. I think it's... It's all selfish. I only killed about some people. I really like it. I kind of want this dungeon done, because this dungeon is annoying. And we've... Yeah, we've... Yeah. James is still crouched for me. Same. I'm still finished. He's still axing. I'm finished. He's crouching under all the shots. Are you hitting, James? I'm not hitting. What's hitting? Oh, I changed the plaster. No you didn't. Yeah, I did. I knew. No you didn't. Well, well, well.  Why? What's that? I'm gonna wake up after this. No, we'll calm down. Don't yell, Boobie Lady. Boobie Lady! Oh, Scotland, swearing me. can we please not like let's leave this out of it we're nearly there it's only because James is being a bitch about it he's trying to summon booby lady when really he should just summon the waves he just needs them waves yeah you could summon this two turns ago as well yes it's not gonna be hurt God what are you being you want some milk nice nice lot of calcium there you want cement I fizzled I don't think I didn't fizzle he fizzled it doesn't matter just pass please stop please stop copyright copyright strike you're gonna be kicked out of our recordings forever soon I know I wanna maybe we do my life first James a storm PVP they're the same level I wonder who would win then James yeah and who won no that was me actually can you stop muttering please it's annoying I'm trying to record here none yes sir the one without a faint the one with the blades you know shield myself I'm trying to find a no it's my dick isn't set up for but I think it's more for utility so yeah I just need to find my same storms and I'm fine yeah we're gonna see and buy a stick I mean once we finish this because James is refusing to help you port to us yeah take that guy tap that fucking you shuffle I don't want you that was hard wasn't it James it's not the fact we don't need you it's just faster with you I I didn't say that Finn said that and it's faster with you actually 3-8-3 did you see that balance Opie can you please be sensible yes yes yeah actually we probably shouldn't get big oh this is time for this you realize you're too late with a croco-nomicon I need to follow me to dragon spire meowie arty take care of this past once and for all it will be a pleasure to take care of this meddlesome wizard once I scratch you off our list we'll have no one to stop us yay the final boss yeah when we're both in the battle there well we can't because he's first no you can't because he's first unless he fuzzles no but he's he's he said that he would hit this round okay mm-hmm a heel really a critical heel on me oh thanks no thanks it makes everything better for the way for the way I didn't say for okay hit just in case you just go yeah go the death yeah you're effective against me and finna hitting so you'll probably be no next round I can boost them two more times but I can you stop arguing please it's really annoying that beast of a bit he's dead he's dead he's dead he's not dead well he's not heading he's polymorphin into a tree and I'm gonna use finna fizzles even though he has a hundred percent accuracy lol go go go boom gg so only just killed him yeah we're done you need to get a quest to do that let's go talk to show up bones and the Royal Museum then we're done with Molly bone showlock speak you've defeated mea yachty and driven malice tear from our fair city our thanks to you wizard yeah our city is most grateful I get your honorary detective you are our city saviour thank you from the bottom of our heart indeed indeed fantastic work you should publish an account of the case you won't I will for you do visit us again and feel free to stop by the museum too now that malice tear has the croconomicon there will be no limit his aim was to steal the croconomicon from the museum all along why else would malice tear risk-freeing mea yachty but to get past the anti-magic defenses in the museum you must leave for wizard city at once and tell headmaster ambrose what has transpired here yay I get judgment I've leveled up I get judgment it is ope that is actually I'm actually level 27 actually. Only 50 levels below him. This could be trouble. Okie dokie. That's perfect. I got a new spell. What did I get? I got Bladestorm. That's perfect. Another blade. Anyway, thank you for watching. Next time we will do Wisteria. Thank you for watching and we'll see you next time. Bye!