Well, cool. My name is Major Hayden and I'm here to talk to you today about some new things in Fedora Cloud. If you're unfamiliar with Fedora Cloud and the value that it brings, we'll go through that too. Let me get things rolling. What I want to talk to you about today is first off, what is the Fedora Cloud Edition? A lot of people have never messed with it or they have an assumption about what it is. Then I'll talk about the new stuff that came in through Fedora 19 from lots of people in the community that contributed something, including some cloud vendors that came in and helped out with some things too. And then I have a little call to action if you want to get involved with the next Fedora release. And I'll try and leave lots of time for Q&A at the end if you have questions. All right. So a little bit about me. I live in Texas in the United States. I participate in Fesco and the Cloudsig. And my work at Red Hat is really focused on making RHEL the best it can be on public cloud platforms. I maintain way too many Fedora packages and I use far too many emojis. So you'll see plenty of those as we go through the slides. So first off, what I get asked a lot is, hey, what is Fedora Cloud Edition? What makes it different from a server? Or what makes it different from CoroS or something like that? So the Cloud Edition really is an opinionated installation of Fedora. And so it's an installation. It's not something where you're going to go and do a kick start or an initial installation in a cloud service. You're going to just go and deploy this thing as an image. We try to pack all that into the smallest possible image we can make. And we want to make these deployments really fast and really flexible. Because when you go into the cloud, everything is priced on a utility basis.  So anything that takes too long or takes up more space than it should ends up costing people more money. So this is a super quick overview about what it is. But if you have more questions, I'll share the slides at the end. And there's a really good detailed deck from David Duncan that explains everything behind the Cloud Edition and how the influence works in the community. And so what makes it different? This is a question I get a lot. People are like, okay, we have Fedora Server.  So in Cloud, you never do an installation. You're going to get an image that has been prepared or one that you prepare on your own. You're going to deploy it and you're going to put configuration into it during the deployment. So if you've heard of Cloud in it, technologies like that, when you create the instance, you will put in metadata and say, hey, I want you to install some packages or I need a user created or maybe I want to configure something differently. All that's done on the first boot. And then after that, it pretty much operates like a server. And like I said before, time is money. So if it takes too long for you to get a Cloud instance to do the things that you want it to do, then it's going to cost you more time. That instance is going to be on doing system administration type tasks instead of posting the application that you want to host or the containers that you want to run. And so the lifespan is really unusual for Cloud as well. Some of these instances, people may boot them for 30 seconds and do like a batch job or take care of something that needs to be done. And then it's thrown away. Some people will go and deploy one Fedora Cloud instance and keep that online for years and upgrade it just like they would a server or a workstation. So we have a challenge there in that we have to make, this has to be something that's useful for someone that's going to keep it online for a very short period or a very long period of time. And the last part is that you can customize your images. This is pretty exciting. If you've heard about Image Builder or OS build, you can actually go in and say, hey, I know what I need in my Cloud image. I know the packages I need. I know the configuration. I know the users, services, whatever I want. And I want to ship that to the Cloud with everything that I want in it. I don't want to have to do any like configuration after the fact. And you could do this too. So if you want to get Fedora Cloud today, of course, you can go and download it from the website, which I'll get to that in a short while. But you can download the image and send it to your favorite Cloud provider. But I've listed some there. There are probably more that you can get to. But I know with AWS, those are pushed nightly via automation. So you get nightly builds of raw hide and all the stable releases that go up there every night. So if you don't want to have to update nightly, you can grab one of those nightly images. Now, those don't receive quite as much testing as the official images that go out, but you have that option to you. And some of these Cloud providers will prepare a Cloud image themselves and make it available, which is what many of these others do. And also, if you want to customize it yourself, you have that option to do with Image Builder. And I'll get to that in a minute. All right. So you're probably sitting there saying, all right, he's talking about all this stuff about like, what is Fedora Cloud? But let's get to the new stuff. And someone always told me if you had a cute animal in your slides, people like your slides better. So I want to make sure I got that little dog in there. All right. So the biggest thing is, we have a lot more public Cloud CLI tools. Now, when you work with a Cloud, they all have APIs. Everything is an API. You change networking via an API, you launch instances via an API. A lot of them, when you go in their web interface and you create an instance, on the back end, it's just hitting the API and telling the API to do things. So having lots of tools available is really good. And so when we put these into Fedora, the great thing about it is that then you can build automation on top of those. So one example is if you want to connect to a Cloud provider and deploy resources, you can write scripts and things that use these CLIs and take care of it. Or the CLIs can take actions for you, like run backups on an instance or something like that. And in some Clouds too, you can actually have these tools inside your instance and they can interact with the Cloud where your instance is running and do things for you. So we have a ton of new and updated tools for all kinds of Clouds. Our goal really is to make sure we have some of the most common SDKs so that you can write your own code and then import the code from the provider and do things. But we also want to make sure the CLI tools are there too. So that way you can run commands and launch instances and you'll be able to get these CLI tools from a trusted Fedora repo. And the biggest ones, the newest ones that changed was Hedzner, Vulture, Oracle Cloud. I think those three were brand new. I think the Digital Ocean one came in with the last release. But AWS CLI 2 is a really big one because we had version 1 before. Now we have 2 with a whole bunch of new features and things like that, but it was a little bit challenging to do. And so it takes a few minutes to do some of this work. AWS CLI 2 had some pretty heavy requirements. It had some extra things that need to be packaged. And we said, hey, wait a minute. If we're going to do all this work, why don't we make it as sustainable as possible? That was the challenge. So we had some folks from AWS. We had Fedora community members and members of the packet team. And several other people from Red Hat came together to get this into Fedora 39 and get it really, really usable. And so the sustainability challenge was how do we make sure that it's easy to do updates, easy to test, easy for someone to come in and find out what's going on. And so we started using packet. The great thing about packet, if you haven't used it before, is it will automate so many of your package maintenance workflows. Use specified packet in a YAML file in your, the diskit repository for your package, if you do packaging. And you basically say, hey, anytime there's a new version available, I want you to go and make a pull request and pag your with all the new versions. But I want you to only do it for raw hide or maybe do it for raw hide and all the other versions. And then when I merge it, I want you to build in Koji and I want you to do the update as well. So packet takes care of a lot of this for AWS CLI 2. And I think more packages are adding into their packages. We also added elastic file system support on AWS. If you haven't used this before, it's kind of like having an NFS server that's made available to you in AWS's infrastructure. So you can mount it to multiple instances at the same time, just like you would an NFS server anywhere else. The cool thing is it comes with a mount helper that will automatically create an external connection so that your NFS mount goes over a secure link all the way into AWS's backend infrastructure. So when you mount via the mount helper, all of this stuff is automatically set up for you and you don't even have to think about it. So that's something that we got added into Fedora 39. And it's pretty cool. It also monitors your NFS mounts for any problems or anything like that takes care of them. The next one is UEFI by default on AWS. And the nice change here is that it makes things more consistent because UEFI is more and more common on physical devices as well. But the cool thing that it gives you inside AWS is that you get some access to some of the security tools such as the TPM and there's some secure boot capabilities that are still being worked on in there. And so it just adds more capabilities inside AWS for Fedora. Users still do have the option of saying, no, I want the old BIOS because that's the way that I operate or have some compatibility issue I need to deal with, you have that option at boot time. And the next one was a lot of these are AWS related features, primarily because we have AWS engineers who work inside the Fedora Cloud SIG a lot. And so we get a lot done and have a call to action for other cloud providers a little bit later. So as I was talking before, when you provision cloud instances, you don't do a kickstart. You don't do an installation. There's no anaconda. You're provisioning via metadata. So you boot the instance and you say, I want this instance type with this image with this network, that kind of thing. And at the very end, you'll say, okay, and here's what I want the instance to do the moment it comes online. And all of this comes through a metadata service. Now the great thing is when you could trust everything in the cloud and you could trust the metadata service, everything is fine. Sometimes you can't or sometimes you want assurance that you can trust that service that's on the other end. And so that's what I'm DSP to gives you. And so this is turned on by default now for Fedora and AWS so that all the instances that you boot will use V2 by default. And really the only change here is the metadata is all the same, but there's a session-based token that's used when you pick up the metadata. And so the good thing about that is that you know the metadata is coming from a trusted source every time you receive it in the cloud. And so this metadata is made available via, I forget the IP address. It's like a 169 IP address. It's unusual. So that way you can only get to it from that VM. It's the cloud provider kind of offers it up on a back end interface. And so one other thing was automatic reboots on launch after you apply updates. This was something we didn't have before. And there's been a bug open for a long time.  The cool thing about this is that let's say you launch today, you went and launched the Fedora 38 instance. Well, there's probably going to be some updates between where you are and what the latest of Fedora 38 is. So you have the option to say, hey, cloud on it, when you launch the instance, I want you to update all the packages. And then if any of those packages require a reboot, like maybe some D was updated or the kernel was updated or maybe something open SSL related was updated, it will automatically reboot that instance for you. So you launch the instance, you turn these two pieces of metadata on, the instance will update itself. And then the moment it's done updating it checks to say, hey, do I have anything that requires a reboot? I do cool. And then it reboots itself. So the great thing about that is is that you know by the time you log in, you have a fully updated, ready to go Fedora instance that you don't have to mess around with at all or wait for a reboot. Thanks to the Tracer team for helping us get that done. And then next, I know Emma was just on here and Emma helped us out a lot with the Fedora cloud website. It came in with the last release, but I'm still like so excited about it that I like to tell people about all the time. It's beautiful. It gets you to the information that you need as quickly as possible. So this is one of those places where I was telling you, you can go to the cloud website. If you hit download now, it gives you tons of options for deploying Fedora cloud. So some of the options are, hey, I want to go straight to AWS. You click there. It gives you the AMI IDs. You're on your way. You don't have to upload anything or import any images or anything like that. But then also you have other images for other platforms. For example, if you want to take an image to Azure, which we're going to have images in Azure soon from Fedora, not quite done yet, almost there. And you can pick these up and put them onto another system. If you have maybe like a VMware ESX server sitting around or you want to run one in KBM, you have all those options as well. You can just download the images here, load them up and go. And so, yes, the website is extremely helpful. And it's really nice that there's some automatic updating in there. It's fantastic. I love the way it looks. And then one last thing that I like to tell people about, it's not new to Fedora 39. It's been around for a while, but it keeps getting better as you can customize your own cloud images with Image Builder. If you haven't heard about Image Builder before, it's a really cool thing to check out. I've written some blog posts about it and the links will be in the slides if you want to read more or go try it out yourself. But the idea behind Image Builder is that if you know what you need in the cloud image, you know the packages and the configuration and users and this kind of thing, you could build that automatically. So you can build that entire image, package it up, and ship it with Image Builder. So you can provide your cloud credentials and Image Builder will build the image and then when it's done, it will ship it to that cloud and import it. And there's a few things happening behind the scenes that I like to remind people about is that every cloud is different with how you have to package up your image and then every cloud is different with what you do with that image to get it into the cloud. And then every cloud is different on how you import that image to be able to use it. So you have to know if you want to do this yourself, you have to know like all these little steps and know which parts take a long time. But Image Builder gets rid of all that. So for example, you can specify how you want your image built. And then right beside it, you can put your AWS account credentials past the commands or do it in cockpit. That's another option as well past those commands and basically just sit back and wait. You can just watch the system journal go or you can run a command to monitor the progress. And then usually, depending on your upload speed at home or wherever you're uploading from, usually like getting an image into AWS is maybe about a 10, 15 minute process usually on most machines. I think in Azure, maybe it's a little bit longer. But yeah, it's usually pretty fast. So yeah, this is extremely useful way to do this. Another way you can utilize Image Builder is if you make it part of your CI. So if you, like let's say you have a certain application that you want to deploy everywhere. You can package that in RPM or a container or however you'd like to do it. And then you can actually add Image Builder in your CI. So that way, your tests run, your packaging runs. And then all of a sudden you tell Image Builder, hey, build me a latest Fedora image with these packages and this config and then add my software and ship it. And so I have a proof of concept repo in GitHub that actually uses GitHub Actions to build an image builder and ship it to AWS. Now, of course, that's nice because at least the infrastructure in GitHub is totally free and it ships it on its own. And you can set that up on a nightly job or something like that if you want to. So there's some links here on how to do it on different clouds. I think two of these are Fedora and I think one might be REL, but the instructions are the same, no matter if you're using Fedora or CentOS or REL. And then kind of getting towards the end here, I want to make sure I have time for questions, a little bit of a call to action here to get more people involved. So I really want to get more people into the cloud SIG. We're always looking for more ways to reach people and more ways to deliver valuable things that people want in cloud. But one of the challenging things is, as I said before, everyone's demands for cloud are different. Some people may deploy something in cloud and keep it for years. Some people might deploy something and keep it for five minutes. Some might deploy just one or two instances and treat them as if it was their pet and they take care of them, things like that.  So it's all across the board. So one of the biggest things we love is hearing use cases from people when they tell us, hey, I use Fedora and cloud to do something. And then we're like, oh, how do we adapt to that use case? How do we find a way to make sure that we're fitting that use case as well? And some people also show up and say, hey, I deployed this cloud provider, but the image is not very good. Maybe we can work with that cloud provider to get improved or maybe we can ship the images directly to them so that way you'll get the best experience. We meet every Thursday at 3 p.m. UTC on IRC, although I think this week it may have been Matrix. We're still trying to figure that out like some of the other groups are. We have lots of open issues and our mailing list. If you have any questions or if you have use cases or maybe if you work for a cloud provider or you know somebody who does and you want to improve the experience there, we're always open for questions or anything like that. And that's it. I want to make sure there's plenty of time for Q and A because usually, I don't know, people always have strange questions about cloud versus server or anything like that. I don't know if there's any in the list. I may have put everyone to sleep. Who knows? But yeah, I mean, if there's not any questions, we could probably wrap up early unless my screen has frozen. That would be terrible. Okay, good. It's not frozen. That does happen from time to time. Oh, let's see. Contrast Cloud with Fedora CoroS. I should have put that in the slides. That would have been a good idea. Okay, so I write about CoroS a lot too. I like both. And I think there's good use cases for either. So I would say if you haven't used CoroS, I think there's about a million different ways you can explain what CoroS is. But my favorite thing to think about is CoroS is what you use when you have a workload that you want to deploy and you really don't want to think about the machine that's underneath it. So as an example, let's say you have an application that runs with like two or three containers that have to run together. You really care about those containers and you care about what's in the containers and you care about how those containers interact with each other. But you may not really care about the OS that's underneath it. So you may not really care if like them is installed underneath. Like maybe you don't, that just doesn't matter to you because you're like, I want to run my containers and I don't care about that. But I want to make sure the OS underneath is always updated. So I think that's what CoroS gives you is an automatically updating platform that sits underneath and supports everything that you want to do. And CoroS also has updates that if you have an Android phone, the updates are very similar, downloads the updates on the side and then reboots. And if everything is good with that update, you're good to go. Like no RPM updates or anything like that. And then if something goes wrong, it goes back to the previous release and then you're back online. And then later on, it can try that upgrade again to a later version that comes out. And so Fedora Cloud I think is more like a, it's more server oriented. So this would be more like if you need to run workloads that maybe care about the OS that's running underneath them. So maybe it's a workload that you can't containerize and you have to actually run on the host. Maybe it's a workload that needs to be installed via RPMs. Or maybe it's the system that you plan to keep online for a long time and have a lot of customization of the OS that's underneath. And I think that's where Fedora Cloud really shines. All right, let's see. And then Neil asked, any teasers for the future of Fedora Cloud? Ooh, that's a good question. I know that we're doing some work right now to figure out how to get the same automatic image updates for AWS that we have now. We'd really like to get that for Azure because we do have people ask us pretty often about getting images over there. We get asked occasionally for them in Google as well. And so we'd like to be able to do that. There's been some talk too about working with some of the cloud providers that build their own Fedora images now to try and see if maybe we can build images for them so that we can supply them directly from Fedora. So it's less work for them. And then we could do some of the CI work because we care a lot about testing those images before they go. And also too, it kind of it removes some of the things. So I don't want to say anything bad about the cloud providers because they've got support challenges and things like that too. But I would say some of the cloud providers will make changes to those instances. Instead of using Fedora as the user to log in by default, they'll change it to root because that's what a lot of people are just they're used to that. But we changed to Fedora for a reason because it was more secure to log in as just a regular user, keep the root account disabled and only accessible via sudo. So we'd like to see some of those changes be a little bit more consistent across the board. And then we're always looking for ways to integrate Fedora into more clouds. So just to find ways like where we can have more of these things that you would typically want to interact with on those clouds, make all those packages available to you so that those integrations like for example, the elastic file store at Amazon so she could just mount those just right off the bat and use them. Let's see. And in the chat, let's see. Mateo asked, what about OpenStack? Is it recommended to use this instance or recommended to use this instance to be used with Ironic as a base to deploy controller or compute node? Or is this image only recommended to host apps inside a tenant? That is a good question. I have not used Ironic in about five or six years. So I'm not really sure what has changed over there in a while. I would think that Fedora Cloud would be the image that you would run inside the instance on OpenStack. And that's where I've run it in the past. I forget the name of the OpenStack public cloud where we have Fedora available. Oh, Vex host. We did have it in there. And yeah, I would say definitely that was I would use that for a tenant instance on top of OpenStack. But yeah, I haven't touched Ironic in so long that I don't know if I could answer that question. If anybody else knows, put something in the chat.


All right, welcome back to 105. So thank you for joining me today this evening. Today we get to talk about if statements or, in other words, essentially the only reason why your computer looks like it is smart, even a little bit. So up till now, if we've been following the course right now, our programs, they always do the same thing. When you run main, it just runs line by line. It just stupidly goes from the next line to the next line to the next line until eventually it does a return and then it's done. The input may be different. So like if we take an integer, maybe we can type in a different integer. But that's about it. It's not really anywhere close to a real program that will do anything slightly complicated. But after today with if statements, that will form the foundation of being able to do different things. So there is a way to conditionally run code. So we only run code sometimes instead of all the time. And it is called an if statement. And it basically uses a Boolean to decide whether or not to execute some code. So the syntax, which again is just the rules of the C language. So how I have to write it in using my keyboard, I guess it's not kind of English. So what I have to do for an if statement is I write if. So that is a reserved keyword. So I'm not allowed to name a variable if or anything like that. Then bracket, then an expression. So something that actually results in a value. In this case, that expression should be a result in a Boolean. And then a statement that will run if it is true and if it is false, it will just skip that statement. So writing it like this, you can write an if statement like that. But generally, it's a bad idea. It's been a source of some very, very hard to debug issues that have come up. In fact, using this type of if statement actually resulted in one of the largest security breaches there's been in quite a long time. So don't write it like that for this course. Always write it like this. So you're sure what runs when that statement is true. So write if expression and then do the curly bracket. And then you can write a whole bunch of statements between the curly brackets. And they will run only if that expression is true. And again, expression, just a combination of operands and operators. So far, we've seen addition, subtraction, multiplication, that fun mod 1, division. And they've all resulted in another number, be it a double or an int. We don't really have anything that results in a boolean. So that's what we get to learn today. Oh, and yeah, before that, so just again to say that statements only run if that expression is true. So C will compute the results of that expression, convert it to a boolean if it's not already and a boolean is either zero false or one true. So if that expression is true or it's a one, it will run the statements between the curly brackets. And after it's done, it will run the next statement after the curly bracket. If the expression is false, it just immediately skips right here to the very end. So it will not run that code. So the expression in an if statement, it will convert to a boolean. We probably need to know some operators that actually result in a boolean instead of a number. So they are relational operators and they work with number arguments and then result in a boolean value. So these are all of them that you will use. So there is equal equals in math. That just means a single equal sign. So that's comparing if two numbers are the same as one another. So in C, it is equals equals, not equals because remember just a single equal sign, that means assignment. That means I'm updating a variable. So that may be the source of some issues you have. So whenever you want to compare two values, remember to always use equal equals. And that just means a single equal sign in math. You will have problems if you just use a single equal sign and you do assignment. So a exclamation mark equals, that's the same as saying not equals. In computing, we generally just say this exclamation mark is short for not. So this just kind of translates directly to not equals. So in math, you know, that's a sign equal sign with a slash through it. Can't write that just using a keyboard. So we have to use not equals. Then there's less than, so means less than, hopefully that one's self-evident. And then it's less than or equal to. So it's just the less than and then an equal sign. So that's the same as less than or equal to in math. And again, there's greater than which is greater than and then greater than or equal to, or at least how I remember the greater than or equal to. Did you learn like the crocodile goes and eats the thing at the bigger side? No? Okay, some of us might have, like even if you've done your PhD and stuff you still remember it like that. So I still remember the little alligator eating stuff to figure out which side is which. So don't worry about. All right. So some examples is I can see if two numbers are equal to each other. Remember, these could be variables as well. It's generally why I do it. Just writing is two equal to probably isn't the smartest thing. But serves as an example. So I could write two equal equal to and then the result of that is true. So two does equal to at least in this universe. I could also ask, hey, is three less than two? In this case, you know, the alligator is not eating the bigger number. So it is false. So we would result in zero. And then I might ask, hey, is three greater or equal to three? In which case that would be true. So I would get a one. So any questions about those operators? So those will take numbers and then we will be able to get a Boolean out of them. So those relational operators, they follow similar type rules to mixing ints and doubles. So if both operands are an int, then it does the operator just using integers. If at least one of the operands is a double, the other gets implicitly converted to a double if it's not on already. And then that operator just uses the real numbers or the doubles. So that's just done for the comparison. Sometimes comparing doubles gets really weird. So in general, if you have to compare doubles, we never use equal equals for reasons we will not get into. But it doesn't really matter. The result in either case is going to be a Boolean at the end of it. So is this true or is this false? So some other examples. In this case, if I write two equals equals two. So in this case, two is an int and 2.0 is a double. Well, what will happen is this two gets converted to a double. So it'll get converted to 2.0 and then 2.0 is the same as 2.0. So the final result would just be a one. So any questions about those operators right now? So just using those fairly straightforward operators, we can actually create programs that actually do something more complicated. Other operators we might use are some operators that only work with Booleans. So these operators are called logical operators. So they let us kind of connect Booleans together in order to come up with a more complicated condition. So all the operands are Booleans in this case and then the result is a Boolean. And thankfully, there's much fewer of these. So there is these two lines.  So these two lines, sorry, these two lines are mixed up. I'll fix that in the slides later. So these two lines are a logical or. So that means this or this is true. So in that case, if one of them is true, then the whole statement is true. And the only way that this statement is false is if both of them are false. So that's like, I don't know, I'm going to get up in the morning if it's sunny and warm out. And then, well, if it's neither of those, then you're not gonna get up. But if one is true, then you get up. So these two and operators, they mean logical and. So the result is only true if both sides are true. So if I say, you know, I'm going to get up again, if it's sunny and it's warm, then I will only get up out of bed if both of those are true. So as long as one of those is false, I'm staying in bed in the morning. And then there's also this unary operator that's just called not. And all it does is it flips the value. So if you say not true, the result is false. If you say not false, the result is true. So sometimes it's easier to say that like, hey, I'll wake up if it's not snowing or something like that. So any questions on those operators other than I screwed up the lines here? Yep. Yeah, so this operator here is logical or. And then this is logical and, and I will fix the slide after, but it makes sense because the operand, or the ampersand is an and, so that means logical and. And there is an operator that's just one of these in C, so one line and one ampersand. We will not cover what those do in this course. They do something else. So you will probably have some weird results if you actually type in just a single ampersand instead of two. So some examples here is if I have, if I do one and and one, well then both sides are true. So the final result here is going to be true. If I do zero and one, well that final result is false because they both need to be true in order for that entire expression to be true. If I do one or zero, well that is true because one of them is true. So the entire thing is true. And then if I do zero or zero, well that's just zero because they're both false. So the whole thing is false. And again, not one is equal to zero and then not zero is equal to one. So any questions about these? So they make a bit more sense when we actually have a program and tie them together, which we'll get into shortly.  So C does have rules for converting numbers to booleans if it's not already a boolean. Generally you should use one of the relational arguments all the time because if you don't, these rules are kind of weird because if C wants a boolean, so if it's an if statement, it will convert or cast that value to a boolean. And as a general rule, it gets a bit weird. So if the number represents zero, it gets converted to zero. Otherwise it gets converted to a one, which sometimes will be really weird for doubles. So for instance, if you say if 0.4, which is a double, then C is going to say, hey, that's not zero. So that's true, which gets really weird. So try and always use the relational operators here. So where we're at in precedence, a lot of rules so we'll get into some examples later is the higher precedence. So to connect them to things we already know, these are multiply, divide, mod, and then we have addition of subtraction. So all of the relational operators are lower precedence. So I would do all the math operations first or all the arithmetic first, and then I would do the relational operators. So here's the less sense, and then here's if one value is equal to another or not equal, and then our logical operators. So our ands and our oars that are a lower precedence. So it will always favor doing the ands before the oars. So just rules. Generally you should just probably get used to writing brackets around stuff instead of just remembering these precedence rules. So what can I do? Oh, yep. So how hard is this going to be tested on? We're not going to, we're going to ask you to write programs and they should work. So we're not going to say, hey, what's the precedence of this? But while you're doing that, if you can't remember, just put brackets around what you mean. So even like more brackets doesn't really hurt anything. So when in doubt, just use brackets to get what you mean. Because honestly, I forget some of them. So let us write our first program that does something using an if statement after all that blabbering. So we can now write a program where we can input an integer and it will do something, well, more than nothing, we can write an if statement. So we can do a scan F, get that number into that int called num, and then afterwards we can do an if statement. So we can say if num mod two is equal to zero. So that's saying if I divide two by one, my remainder is zero, which is another way of saying the number is even. So if the number is even, I will print off, it is even. So if I go ahead and run that, then someone showed a number to write. Anyone? Nine, all right. So nine, nothing happens for a nine because it is not an even number. If I want to see the if statement actually run this print F, well, I have to give it an even number, in which case I can say eight, and then it will print off, this is even. So now it is only doing this print line only if this condition is true. So only in this case, if we divide the number by two and the remainder is zero, we'll print off that the number is even. So any questions about that? Kind of cool, we're leveling up our skills. So this is a program that does something more exciting than just doing some calculation. And printing out the value. So now we're optionally just printing a line only if a certain condition is true, which is one of our first steps to writing real programs. So programs in the slides, so don't worry about it. And just in case any was confused about what statements run. So the same thing is true. It will start executing at main and then follow statement by statement. So it would run printf, input an integer, then int num equals zero, and then that scanf. And then the way you can think of the if statement is, what it will do is compute the value of this expression. So previously in the expression, I had num mod two equal equal to zero. So what it's going to do is compute the result of this. So in this case, if I enter, I don't know, eight, then eight mod two is zero, and then zero equal equal zero. So the result of that is true. So what we say is we go down, we call these branches. So we say we go down the true branch in that case, because well, we had an even number. So in that case, it would run printf, the number is even. And then after printing that, it would just go to return exit success. If in fact, like what I had before when I inputted a nine, well, this expression would be false, and then I would skip directly to return true, and I wouldn't see that print statement. And yeah, question and discord, do they give part marks on the midterms if our program isn't perfect? And the answer to that is yes, a human gets to grade it. So it's mostly in this course, at least on exams, thinking about your logic and making sure that what you're actually writing makes sense. Yep, yeah, so the exams, they're closed book exams just on paper, and the programming stuff is just through the labs. Yep, all right, any other questions about the structure here of this if statement? Yep, yeah, so if it becomes false, we follow this line here. So this is the line we follow here if it's false, and it goes immediately right to that return. So it skips over the print, right? Yeah, all right, any other questions what we have here? Yep, yeah, so the question is, essentially if I go back, is it bad practice if I just do like get rid of the curly brackets like this, and just write it all in one line? So yeah, that would probably be considered bad practice because it's really easy to like just write a line here and assume it runs if it's true, and it won't, in this case, it'll only run that single printed line, and usually it makes it harder to read. So for this course, like people that have been programming for 30 years have tried to like save the curly brackets and it cost, I don't know what the total amount was, like several billion dollars, so just always use the curly brackets, it makes it easier to read. All right, any other questions with what's going on here? All right, so, oh, and then there's a question, can we use exit success instead of return zero in the lab? And for that, sure, you can use that in the lab if you want. Generally, good practice not to have magic numbers. If you wanna remember the magic number zero, go for it. You might find that exit success is easier, and you always have to do all your include statements or something bad will happen, or it just won't be able to find the values. So if I want to use this exit success, I need this include here for standard lib because that's where that value actually lives, that's where it's defined. Alrighty, so let us level up our skills a bit more. So we might ask ourselves, oh, okay, well, we can optionally run some code if a condition is true. What about to just run some different code if that is false? Because right now, if it's false, we just skip over whatever the statements were and just go right to the end. So another valid syntax of an if statement is if expression, then a statement, and then else a statement. But again, we should always write the curly brackets just so the structure of the code is very, very clear. So we should write if expression statements, and then else statements. And what this will do is it will only run these statements if the expression is true, and then otherwise it will only run these statements if that expression is false. So each time through, I will either execute one or the other, but never both. So if it's true, I will run this. If it's false, I will run this. And then no matter what, the code will resume running at the end of this. So questions about that. Probably easier just to see it. So again, just so it's on the slides, only the statements between the curly brackets will run after the else. And these statements here between the else only run if that condition is false. So we can actually change our code a bit more and do something like this. So now we can use that else statement. So now instead of printing nothing if the number is even, well, I could have the same program, but I will write an else here. So if the number is not even, this will run and I will just print off the number is odd. So now if I run this program odd or even, then if I input eight, it should do what it did originally. So if it is eight, that means this expression is true. So it will run this print F and then it is done writing or running all of the code that will run if the condition is true. So when it's done, it will run return zero. And in this case, I had return zero instead of exit success. But again, same difference. And then, oh, we got a question. Why do we not put the semicons after the curly brackets? So the answer to that is you don't have to. So if we did, we actually could and it won't change anything. So it won't change anything. The compiler won't yell at us or anything like that. It's just a bit weird. So no one does that. It's just kind of a style choice we use because we don't need to put it there. I'll have a caveat of like dangers you can get into with just a semicolon because it's technically a statement that does nothing and generally it causes issues. So if we don't need it, we just avoid it. So, and then the question, can we put semicolon after include statements and the answer to that is a no, I believe, but we can try it and compile. Whoops, compile.  So in this case, it doesn't seem to mind it, but the compiler really, really, really, really doesn't like that we did that. Whoops. So we should probably not do that. All right, anyways, for this example, let's see. So now if I write, I don't know, an odd number, now it will print off that, hey, this is now odd. Yay, it does something different. That's kind of cool. Any questions about this? All right, I have a brain buster for you. If we've been paying attention a lot. So I just thought of this while I was preparing. So what happens if I essentially flip those two and do this? So is this program the same as what I had before? No, anyone say why not? Yep, well, let's see, let's try it out. So let's compile that and run it. So in this case, it should still work, right? So if I do eight, well, that number is even because if I do eight, mod two, the remainder zero, and then I would do zero equal equal one, which is not true, so that's false. So this would run, so it'd be this number is even. And if I do an odd number, it says this number is odd because my remainder would be zero, or my remainder would be one. So it looks almost equivalent. But this, hopefully you don't get a, if you got an exam question like this, it would be kind of mean maybe because there is a problem with this if we remember the weird mod rules from before. Oh yeah, I heard negatives. So it turns out that this doesn't work that well, if I do, is negative seven an odd or an even number? An odd number, right? Oh, yeah, this is why programming is hard because remember all those weird mod rules I went over four and it seemed like I was just yammering on for no reason. Well, I was yammering on because it might actually be an issue. So in this case, because of the mod rules, if I do negative seven, mod two, the remainder is technically by C's way of thinking about it is it's negative one. So if I wanted to write an equivalent program, what I could do is I could do num mod two is one or num mod two is equal to negative one. And in this case, if I do that, well, that should cover the negative case. So if I do negative nine, finally says this number is odd. So one way to remember that this rule is stupid is if you are seeing if a number is like an exact multiple of something, always compare it to zero. Do not try and compare it to any number other than zero. Otherwise, you have to remember the negative thing and it's just a whole hassle.  Of course this would not be an issue if I just didn't allow negative values. So that is another option. Okay, so here is my program that will print whether or not the number is even or odd. And here I do the smart thing of just doing the modulo and then comparing it to zero because as we saw comparing it to other values, we have to remember the negative rules and generally not a good idea. So if I took the structure of this program, how it runs is well it would start running from main. So if I break it down, what will happen is this program, whenever I run it will always print, input an integer and then do the scanf so I can actually enter an integer. And then it will evaluate that expression in the if statement. So in this case, num mod two equal equal zero or sometimes we just say equals. Kind of depends on your preference there. And then if it is true, then I take this branch and I will print the number is even and then after I'm done doing all of the statements in the curly brackets in the if, then I will go to the very end and return exit success. Otherwise the only other possibility for this program right now is if this result is false, I will print off the number is odd and then I will skip to the very end whenever I'm done executing everything that runs when it is false and we have an exit success. And then yeah, we have another question. What about if we have three conditions? Can there be more if or else statements in the same group? And the answer to that is absolutely. So you can see how this quickly could make our program look like it can do a lot of different things. So here I had two possibilities I could go through. Well, I could write it so that if I go in the false statement or go in the true, I could have two other possibilities. So I could write if statements within if statements and then if I wanted to, I would have like an exponential number of possibilities that my program could follow and then you have to reason that all of them are correct and that is where software problems come into play. So generally you want to make them as simple as possible and try and reduce the number of if statements you have if at all possible. And to follow up on that question, what happens if we have multiple if statements? So I already pre-shot this. So we could write a program that does this. So input an integer, so it starts off the same. So we scan F, get an integer, and then we could have if num mod two equal equals zero then the number is even we can print off. And then afterwards we can write if the number is equal to or greater than 10, we'll just print off that the number we entered is 10 or greater. And then we can write an else after this, but this gets into a special problem where if we actually just follow the rules of C, it is not evident what else this belongs to. So does this code only execute if the number is odd or does this else right here only execute if the number is less than 10? So turns out this actually has a special name and it's called the dangling else problem. So I just have an else here. I'm not actually sure what if it is connected to. So the way C resolves this is it says this else is always connected to the first if you read up from this else. So this else is actually connected to this if. So it will only run in the case that the number is 10 or less. So if we actually run this program, let's see. So here is that same program where I have an if and then an if and then an else. So kind of told you that because of that dangling else problem, this else actually refers to this if. So if I start reading my code from the top and start arguing about it, so it'll print off input an integer, declare an integer and just initialize it to zero just in case something bad happens. And then we do a scan F. So we wait for the user to type the integer and then it will check if the user typed a even number in this case. So if num mod two equals zero, so it means I divide by two, I have zero as a remainder, means it's a multiple of two, then I will optionally print off. This is a even number and if it's an odd number I would just skip right to here. I would skip to this line if it is false. Then next thing I would execute is I would check this condition. So the number, I would check what I entered and if it is 10 or greater, while I will print off it is 10 or greater and then I will just do this return. Otherwise, if the number is not 10 or greater, then I will go into this else and then print off the number is less than 10. So if I run that, if I run this and I type the exact number 10, it should say this number is even and then the number is 10 or greater. So prints both those statements. If otherwise I type in the integer, I don't know, 11, then that is a odd number. So it would not print this line and it would skip and it would go here and then check if the number is 10 or greater and it would print that, yes indeed, 11 is 10 or greater.  Let's say eight. So if I input eight, it should say this number is even and it's less than 10. So I get both of those print statements. If I instead input a seven, then I only get the number is less than 10. Then another question, what if we use the tab key to indent the group so the else statement only works on the indented group? So turns out the indentation we write for C, so if I did something, I don't know. So I think the question is like if I did something like this or I think this, but turns out C, the compiler, doesn't actually care about the indentation. It's just to make it easier for you to read as a person and yes, C does not care. Yep, so if you want, so if you just want it to, sorry, not sure of the question, like if I write another else statement.  Oh, like if you want to do this. Yeah, you can do that, you can pose many statements as you want there. Yep, yep. Any other questions since this is the first, you know, actual programming we've get into that's not just arithmetic. Gets more exciting from here. All right, slight murmuring. So here let's, so here's our dangling else problem. So how do we make the else statement act on both statements if that's feasible? So if I go here, if I wanted to have two else statements, whoops, then I could just do something like this. So just in this case, I'd say this number is odd in this case. So I could write something like this. So I have two if else statements. So it'll check this condition. If it's true, it runs this and then ends here. If it's fault, if this condition is false, then we'll run this and then we'll end here. And then we'll do another if statement. All right, any other questions? Yep, yep. So I can add code right here between the if and the else statement, no problem. After the if, where? It'll be else, like with code. Oh, here? Yeah. So if you write something here, that will be a compiler error. So it will say here, expected expression, because well, it's assuming that I can't just begin a line with else. It has to be connected to an if. So yeah, else by itself doesn't mean anything. So I can't have a line between the else and the if. So yeah, so else can't live by itself. It has to live with an if. All right, any other questions we have? All right, well, let us, here, let me hide this quick and see if we can come up with a game by the end of the class. So we can make a pretty decent game-ish. So here, oops. All right, so let's make a little dice game. It will be slightly silly. So let's assume that we're rolling a dice, you know, one to six, and then we as a user can place a bet on it so we can bet even or odd. And if it's even, or if we guess right, we win. And then if we guess wrong, we don't. So we went over random numbers last time. The seed can be set by the system time. So to actually do that in C, this will not be testable because it goes way beyond this course. But if I wanted to make the numbers appear random, what some things I can do is I can set the seed based on something that changes all the time.  So I can set the seed based off the current time so I get a different sequence of numbers every time. If I wanted to make this more secure, well, probably I set the seed off something that's a bit more random because someone actually might be able to figure this out. So if you played a game that generates random numbers, sometimes some people can break it because they'll figure out what the seed is and then they actually know what to expect. And then especially in a game like this, if you can predict the outcome, not much of a game when you win all the time. So here I set the seed based off the current system time and then I'll have enter your bet, zero for even, one for odd and then create a variable called bet and then scan F. So if I, oh, and then yeah, another question in chat, is there an if statement in C? Answer to that is no and we'll go over more complex if statements tomorrow or Monday. So in this case, if I wanted to simulate rolling a dice with my random number generator and I want to make this die value between one and six, one and six, what should I write here after RAND? So if we remember RAND before, RAND will give us just a random positive integer that's between zero and huge. So if I wanted to change that random integer instead to represent a dice rolls or something between one and six, what should I write here? Yeah, percent, oh, sorry. What does that keep, percent what? Percent max minus min plus one, yeah. So for a dice, at the end of the day, what's the answer for just a die? Okay, yeah. So if we do the math in our head, sometimes we get good. So we do percent, so mod, so mod six. So if we do RAND mod six, that will always give us a number because RAND is positive.  So if we want to go change a zero to a five, so we've got the right range. If we want to change it to a one to a six, all we do is we add one. So now we have our dice roll. And let's just, sometimes when you're developing programs, typically it's nice to just print F, print F your current value to make sure it's what you believe it should be. So let's just write here U, U rolled a percent sign D. So we want to print off an integer. So our format specifier is a percent sign D. And we end it with a new line because while that's the end of the line, we want to print to the user. Yeah, so, and then just to clarify, if I don't change the seed for RAND, I'll get the same sequence of numbers every single time I run the program. So let's compile this and I can actually show that quick too if you want. So enter your bet. So in this case, I'll just bet even and then it just says you roll the three, okay? So I run it again, you roll the four, run, oops. Run it again, you roll the two. So it seems to be different every time. So just to be sure, I can comment out that line. So when you comment out a line, the compiler just ignores it. So it's like it is not even there anymore. So if I compile and run that, I'll get you rolled a two. And because it's the same seed every time, every time I run this program, I'm going to get you rolled a two every single time. Gonna be a pretty lame game. So when I uncommented this line, so that's how we say that, then I get a random value or at least a seemingly random value every time. Oh, and yeah, this actually is an extension I use. So remember the argument names can actually have names. So you can figure out which argument is which. I have an extension VS code that tells me what the argument names are and just shows them here. So it's a bit more readable. So my code probably looks a bit different than yours. All right, so now we see our dice rolls. So now if I wanted my game to say you win or you lose, any idea is what I should write here. So I have the die, it will be one to six. So it'll be a random dice roll. So how do I know if I win? Yeah, so well, there's two possibilities here, right? I can either win or I could lose. So that probably should make you think there's some type of logic here. Sometimes I win, sometimes I lose so that should immediately make you think of an if statement. So generally it's easier to think about like the true condition first. So let's be optimistic and we can think about the winning condition first. So if I'm betting on even or odd, well, what's my winning condition? So if I can check, so if the die mod two, so that will give me essentially the remainder of the dice roll. So it'll be zero if it is even and then one if it is odd. And what I can do is actually just check if it matches my bet. So in this case, I formulated my choices just so it nicely matched with that modular remainder operator. So if I enter a bet here of zero, well, if I take that number and then get the remainder after dividing by two, if it's equal to zero, it means it's even and it means, well, my bet is the same as what I chose. So in this case, I would win, you win. And the other case, if we're being nice is I could have entered a one. So if I entered a one and the dice roll was say a three, then three mod two would just be one because it doesn't have any negative values or anything like that. So if that matches my bet, so it's odd and then I bet odd, then I also win because I guessed right. So now it can say you win. So what else should I have here if I want to tell the user they're a big fat loser? Did I hear the magical else?  So if I just have this and I compile this, whenever I run my game, I'll place my bet. So let's say I bet even again, rolled three. Well, I was a loser in this case, so it wasn't wrong. But sometimes when I run it, I rolled a two and then it also says you win, you are a loser, which is very confusing. It gives me an existential crisis here.  So we should put that in the else. So we should just write an else here, always do the curly brackets and we should move this printf up into the else. And because now it is within these curly brackets, each time we're in a new set of curly brackets, we should indent our code like that to just show the structure of it. So if I do that now and I compile this, we have a functioning game. So I can now bet, let's say I bet odd now.  So if I go ahead, play again, let's see, odd.   So with that said, just remember, I'm pulling for you, we're on this together.


My friend Jason told me he has a problem. He's involved in the community, his kids are involved in athletics, he does things, he goes to meetings, he goes to hearings, he cares about issues. When it comes time to vote he says I can't remember now how did she vote on that issue or how did he vote on that issue and and he's reluctant to vote because he wants to cast a smart vote. And so Jason said you know what you could do? You could make it so that I could press a button on my phone and see how she voted on that issue or how he voted on that issue and compare them. And I said well at NowCast we have 800 videos from all over the city of civic events that show what each of the candidates has done, the positions they've taken on all kinds of different issues and we can put them together and we can make it sortable, siftable, searchable so that you can say how did the mayoral candidates vote on these issues on water, on transportation and you can compare them side by side and then you can cast a smart vote and then after the election you could subscribe to those issues so you could stay engaged and you could stay informed.


I quickly want to remind you that after the pitch CMO Summit there is the happiness flowing your way with the pitch CMO Awards 2021 which gets bigger as well so be with us because the happiness will prolong and celebration will only take place with that but now it's now time to move on and join in in the fireside chat and first I want to welcome the first person well somebody who holds the key of super amazing thought and that is bringing wellness towards a greater heights where is the man who's driven this towards a great perfection an honor to welcome him here at the pitch CMO Summit ladies and gentlemen please welcome director Imami Limited Harsh Agarwal with us right now and joining him yet another amazing personality who is a leader who is thought person and always delivers the best investment comes to the knowledge and being creative and objectified please welcome our head for network sales Viacom 18 Mr. Mahesh Shetty and joining the two in the fireside chat our very own superhero chairman and editor in chief BW business world and exchange for media of AGRS Dr. Anurag Bhattra over to you. Thank you so much Mithin thank you Mr. Agarwal for joining us and you know again Imami really doesn't really need an introduction but I will introduce what you do and at least bring your branch to the floor welcome Mr. Mahesh Shetty for joining us and clearly again what you do is well known. Imami is a powerhouse of brands and today's whole day has been about brand purpose. I mean Imami has Boroplus, Case King, Mentho Plus Bomb, Imami Golden Duty, Imami Naturally Fair, Imami Emum Soul, Cream 21 and I can go on. These are brands that are built on the brand purpose of bringing well-being to consumers. Now Mr. Agarwal Imami is a very very venerable brand in business and it was set up many many years back. How do you make sure that you live the brand purpose on a day to day basis and especially in the last 12 months the brand purpose must have been tested. Give us a sense of how you make sure that you nurture the brands using the brand purpose. Thank you Mr. Dr. Anurag Bhattwa for having me here and also for introducing our company. I think see honestly brand purpose is something you know which can really make a very very big difference in the overall performance, the growth of the brand and the company. But my belief is you know not too many brands or not too many companies have very clear brand purpose or neither do they follow. In our company you know for the company we have a very clear mission and I will say the philosophy and you might also call it the purpose is making people beautiful and healthy naturally. So basically the word naturally you know is what is very very core to us. How do we make people beautiful and healthy but with the help of nature and in fact every day whatever we do the products we launch the brands we launch it's all around the brands and the products bringing in nature to them. How do we bring the best of the nature to the consumers be it the beauty products the personal care products of the health products. So from that perspective yes we are always in look out for the best of the ingredients because there are so many unknown herbs etc which are there which are used in different parts of the countries and they might have very very different benefits but people are not aware of it. There are herbs which are very very efficacious but still which are not unknown to the people. So we spend a lot around R&D as to how do we explore them how do we find out about them and how do we bring them to the consumers. Then is the quality of the product because ultimately if you have to give the consumers the best of the health. So how do you remain true to it how do you give the consumers the best of the products with the help of the nature but with really quality products. So that is something we are very very particular about. Sir Agarwal clearly when we talk of health we this talk of Ayurveda we talk of you talk to natural health. There is a huge movement towards Ayurveda there are huge movements to it natural ingredients in health products in beauty products. So clearly you know I would like to know from you how is Imami kind of leveraging this movement to be able to bring out new brands and new products that enhance the quality of life. And in the last 12 months one of the biggest things from a health standpoint is immunity. Health was always very important but COVID has made sure that our focus on health as individuals and as a society has gone up and we are looking after health even more than we ever did. So tell us how are you making sure that the increasing awareness about the source of ingredients what is being used in the product is going up you know people can search and find out people look at the product before they buy. So what are you doing to be able to leverage this trend of one of you know organic products of Ayurveda of natural ingredients and second is last 12 months the focus on health in every product. If you see the average communication of any product category which is utilized inside the body or on the body you know the health benefits are being doubted you know upfront much more than they were 12 months back. So give us a sense of how is Imami building on the brand promise of providing you know natural ingredients in its products. So yes immunity has been something which is which the consumers are looking for and yes COVID has something really increased the need of that. So in the last 12 months since COVID you know I would say in fact in the first three to four months we launched more than 15 products around immunity. So we were very agile and with speed we could launch more than 15 products around that. In totality in six months you know we could launch more than 30 products in our company and all products which were relevant to the COVID needs. So be it health be it hygiene so we launched a whole range of hygiene products under our brand Boroplus which included you know sanitizer hand was the soaps etc because we believe you know the brand Boroplus had the right to win in that segment and certainly you know COVID made us believe that more. Secondly in the health you know Jhandu which is therefore Ayurveda consumers are looking for more solutions which are natural which are Ayurvedic the trust around Ayurveda has increased and people were looking for the solutions. So yes and third we also launched a range of home range of products which was around the area of hygiene again you know but not personal hygiene but home care be it surface cleaning kitchen etc everything. So yes as a company we were very agile and with speed we could launch so many products and yes all of them based on nature of course because that is what we stand for and we believe you know we have given the consumers products which they needed in fact I would give you one example of you know we have launched a Chavanprash which is made of jaggery you know because all other Chavanprash are made of sugar you know they have very high content of sugar in it. So for the first time in the market we launched a Chavanprash which is made of jaggery to make it more healthier. So our continuous endeavor is how do we make products which are healthier and which consumers can consume without any why. Innovation the small innovation of using jaggery sugar can have huge impact on the health. Now Jandu was an acquisition that you did in 2008 right the company has grown through many acquisition of companies and brands as we move into 2021 and ahead for 2021 do we see Imami doing more acquisitions are new brands becoming part of your portfolio on the horizon. Yes of course I think you know acquisitions have been a part of our strategy and it will always remain to be. We have done some very successful and very large acquisitions in the past and we have been one of the most aggressive company in this area in the country right from Jandu then we acquired Kesh Kink and right now what we are also doing yes we are open for more acquisitions to answer you directly to that. If we get the right opportunity the right brand at a right value yes we are open to more acquisitions be it small or big we don't mind even if it is original brands if it is national brands we are open for it and at the same time not only the acquisitions because we believe the times have changed we are also looking for more partnerships you know partnerships with the digital first brands because that's a new ecosystem which is which has opened up so how is company you know we can partner with such entrepreneurs with such companies where one and one you know where we come together and instead of becoming three how do we make it 11 because everybody has its strength and we believe you know as a company we can't do everything right so it's very important that we partner with the right kind of people the right kind of company so that it gives us an entry in the categories or areas where we are not present so yes acquisition and partnership will be two areas of future strategy as well. Thank you so much Mr. Gowal my last question before I bring Mr. Manish Shetty into the conversation and make it a three-way conversation you know the last 12 months to build on what you said have what I call a 3c economy collaborative you talk about the partnerships compassionate because whether it's our channel partners or its employees we need to be more compassionate and the environment has made us more compassionate and third is contactless you know everything has become contactless we're doing this event virtually there is a rise of D2C brands digital to consumer direct to consumer now I know that you mommy is one of those FMCC companies who got into selling their products online really ahead of time almost all your products are available online and I want to ask in the last 12 months how much of your sales have gone online and are you looking to build some D2C products some new brands but are true to the purpose that you mommy stands for yeah of course Dr. Anurag you know I think direct to consumers brands products are only going to grow we very strongly believe in that yes in the last one year our sales have also multiplied right now will be somewhere around the range of 3% but we have aspirations that in the next two years how can we take this to around 8 to 10% of the overall sales and this will be happening not only by growing the sales of the existing products but at the same time we have already launched and we are in the process of launching many new products under the existing brands which are targeted towards the consumers or which will be only selling through the e-commerce route secondly yes we are also working on many D2C brands itself you know which we believe has potential and which we want to launch again you know in the e-commerce platform and maybe you know in the modern trade but yes more targeting this niche segment and the audience so going forward I certainly believe you know there is a lot of future in fact in Jhendu we launched we very quickly after covid so by july in just three to four months we launched a platform of Jhendu you know where we were selling all our Jhendu products to the consumers directly so apart from the 3p platform we have also created our own platform where we sell products then digitally we are also the consumers can come and take or consult with doctors Ayurvedic doctors again because lot many people at that point of time didn't want to go to doctors etc so even we launched those services there for the people where they can call and share their problems and consult the Ayurvedic doctors as well so yes I think this is again going to rapidly only increase and as a company we want to very strongly be part of this trend. Thank you so much Mr. Agarwal let me bring in Mr. Mahesh Shetty into the conversation. Mr. Shetty you heard Mr. Agarwal I heard Mr. Jhendu Kalroh was the MD of TTK Prestige just before that and clearly one of the things that have come across that for companies like Yamami companies like TTK Prestige that last 12 months have been actually very good they've been able to live up their brand promise and through what they've done they've been able to grow their numbers you know in a very tough year for most categories so as a media brand as a media platform that partners these brands in growth what are the top three changes you have seen in the brands approach when they do conversation with you Mr. Shetty? You know if I just look at the overall 12 months you know it's not one story actually if you look at Q1 I think Harshji would also agree with me actually none of us were sure how things will pan out and in part of one of this financial year most brands actually cut down on these pens and I think there was uncertainty and that led to that kind of a decision also in terms of communicating to consumers and generating you know brand pull when the consumer cannot go to the store to buy okay and when there was a situation of lockdown actually did not make sense and so if you see in terms of brands and their spins Q1 was a very different phase where brands held back their spins around Q2 which is around June is when you know the market started opening up lockdown kind of you know came down across the country and stores open supply chains kind of streamlined that's when brands got back to advertising and I think the kind of response that some of the categories got and I would say FMCG being the flag bearer of this entire I would say the consumer momentum and companies like Imami, Prestige and HUL, Reket and I think they really drove the entire category and I would say you know the momentum on any media company putting us and Q2 saw their businesses coming back okay and you know showing strong growths and that impacted their entire outlook towards media and I say you know media is a reflection of how the economy does and how key categories perform overall I would say television and I would say that about television because you know the bread and butter of television advertising is FMCG and since FMCG is a category kind of pulled back and H2 which is the second half of the year saw very good traction from brands across categories while you know there were challenges for most media companies where you know there was an anti-China sentiment and because of which certain categories stayed off certain brands stayed off actually which was in the mobile category or in you know I would say gaming certain categories within FMCG also faced you know headwinds and in some of our regional market some of the local retail channel you know clients also faced a lot of headwinds because of the lockdown and people not moving out however you know that got kind of covered up by some of the new categories that came up so edutech was you know saw the entire category saw a huge boom last year I mean I would say when I say last year this current financial year and gaming saw a huge boost also D2C company saw a huge boost and one of your speakers today Varun Alag his brand came on board for the first time I think it was their biggest marketing bet they came on Big Boss as one of the sponsors and I would say it was a very bold move from his side he was personally involved in that decision making and so I think overall there is a you know entire sense of optimism and that's also because consumers are going out and you know opening up their wallet and spending money in specific categories so and that has also led to brands also going back and you know going back to communicating their brand purpose their entire marketing campaigns yeah so overall I think when we started off which was Q1 sense of uncertainty and we are ending the year of financial year with a you know sense of optimism going you know as we go across the coming financial year okay thank you so much for sharing those inputs and clearly yes the first two three months of the lockdown saw a supply side issue and saw demand side issue retail was closed physical retail but what it did subsequently was that it brought in the whole omnichannel experience and during the festive season really the omnichannel experience led to record sales from certain product category and you're right a lot of FMCG brands have utilized the second quarter to up the end in terms of spends on television because an increase in share of voice would auger well for growing the market share in the immediate short term and clearly partnership became the order of today if you had to going forward Mahesh three trends that you see becoming bigger these trends may have been trends that you saw in the last 12 months and some of them germinated during the host covid phase but are possibly likely to stay what are those two or three trends that you see becoming bigger and likely to say from media brands partnering large FMCG companies like Imam I think I will go beyond FMCG I think one of the key trends is that I would say last 12 months has fundamentally changed consumer behavior and there are new categories which have become very interesting part of the consumers life edutek has become an interesting part of consumers life today last 12 months my kids have just been doing online education and that's happening across a country across every from small town to big town to you know all across and edutek is a category okay is booming and in that brands are looking at building their own equity and loyalty with their own consumers I think so brands which have been you know have become part of consumers life okay because of the behavior change the last 12 months are here to stay because now they're intrinsic part of the consumers I would say buying basket it could be edutek is just one example but also there is gaming because you know young youngsters were not stepping out so online gaming there was a huge boost and so what was growing at X space has gone at 10 X space and again because as those brands are becoming part of consumers you know life so there are brands within that space there are more brands coming into that entire space and there are more brands wanting to spend money to build their own equity so these categories will actually be very important as we go ahead as far as advertising go secondly I think consumers have become very comfortable dealing directly with the brands so you know adoption of online has again moved up 10 X okay in the last 12 months and consume so if you see across markets if you just go on Facebook or Instagram you will be flooded with new brands who are trying to engage with you as we speak in Bombay I keep getting notifications from a trouser brand called Bombay Trooper or ice cream brand called Noto these brands do not exist okay and they are also you know forming their own niche and with time they're also growing now as they go beyond the particular level they will have to move on to mass media okay to get to their own you know the ambitions that they would have they would plan for themselves going from one city operation to a pan India and I think these brands which are direct to consumer will also be more a period of time in the coming years be important part of the overall you know advertising your bouquet of clients thirdly I would look at FMCG I think FMCG like I say is the flag bearer of you know I would say television advertising or overall mass media I think they understand consumers the best and they understand the fact that consumer loyalty is very important and investing in brands is very important and that's why you know when the unlock process started okay I think the FMCG brands and I would compliment her you know her G also you know while we have with his we keep having you know a lot of negotiation discussions but what I really appreciate is the you know the the fact that they went out and invested in you know building the brands or you know communicating the brands and and this is across board and I think FMCG brands know it very well they understand that being in the consumers consideration set is very important and hence communicating actively is very important so I think this is something that will continue so broadly speaking new categories which is which have emerged in the last 12 months okay will become big brands in the coming days newer ways of engagement which is direct to consumer brands which are very small will I think grow and FMCG will continue to drive the you know to be strong and continue to drive their spends on advertising to hold on to their consumers so yeah that's what I think would be the three trends thank you so much Mahesh let me ask Mr Agarwal the last question before I hand it over to Mithin and the last question to you Mr Agarwal you know brand purpose has become more important in the last 12 months a lot of things that we talked about they would put in company brochures or in the boardrooms have actually come into play profits have always been important but purpose people planet have become very important sustainability and ESG has become very important and I want to know when it comes to the planet when it comes to sustainability what is the army doing to be able to kind of stay ahead of the game and contribute to mother earth Dr Bhatt, you know let me answer it in a different way because what I believe sustainability because all these are always taken as purpose for the corporates my belief is you know they cannot be the purpose of the company because if you see you know very simply if I say what is the purpose of the company you know it can be very simply defined as why how and what right so all the company knows you know what they do what kind of products they sell right they know how they are doing it you know what are the unique selling proposition etc but why they do it I think most of the brands companies are not at all clear why they do it in fact for me you know this thing of sustainability good to the society etc has been you know because there has been a lot of talk about purpose mission etc and so on and I think you know they are just good to have kind of a purpose but from the perspective of the growth of the company it has to be more strategic towards what you do and why you do rather than so this the thing of sustainability etc is more very peripheral to the overall company's purpose they cannot be the core purpose of the company right but yes for every company's agenda you know yes sustainability is always a part of it so yes for us also now whatever plastics that we consume now how do we ensure that you know the same is what is being recollected by the vendors is what we ensure so from that perspective you know to ensure that you know whatever is being used by the consumers is recollected and recycled and so we there are vendors you know with whom we have come into some kind of contract where they buy that much kg of plastic you know what we consume and recollect and recycle it apart from that yes we do a lot of csr activities where planting trees etc are part of that right but I wouldn't say that sustainability again is the purpose of our organization fantastic so you're saying that you know you know the why is equally important that's how you do it so clearly the organization leaders that can bring this common thread across their organization of why and build it in their brand purpose in the way they build their brand they build their businesses sustainability will automatically be a part of it it may be a part of the strategy of the organization thank you for talking to us and I know you may not want to answer this question but we are very close to the Bengal elections love to know who would win I think anybody's guess you know in fact I would love to hear your view on that see I live in Delhi I talk to my friends I do look at the sector market for trends because they are mostly accurate I've looked at all the polls and right now the polls as of yesterday were giving TMC an edge over BJP but it's a close contest today the Prime Minister did his rallies and obviously that has its own impact and BJP leaders including Mr Shah have been saying that they'll win more than 200 seats in Bengal but on the ground it seems like you know it's a close contest with TMC being little ahead that's how it is on the ground TMC is given between 60 to 65 seats by almost all both between 156 to 165 BJP is being given between 90 to 108 seats 25 to CPI and CPM and another five to others so really as of now that's including the group that Mr Shetty is part of these are broad numbers that the group has talked of but really elections are fought in the last two three days too and the Prime Minister's rallies in the interiors of Bengal would also bring some traction so really it is a close fight and we'll wait and watch so good to know good to hear from you these numbers but yes what we believe you know whosoever comes should be good for the business because ultimately that is what is going to bring in employment and the overall good for the overall state so that is what we hope for absolutely thank you so much and we wish you luck Mr Agarwal and we look forward to having a conversation in the old world physical way before I let you go and get Mr Shetty go I want to ask my last question to Mr Shetty Mr Shetty what is that one change in the consciousness of media companies that has come in the last 12 months has cost become a very important factor is innovation driving programming and product offering or clearly it is only about survival difficult question and I would say all actually you know when COVID hit us and like I said in the phase of uncertainty cost became a very important part of everything we did because frankly it was about survival and then growing so hence re-looking at costs and every cost line became very important and in a way you know it also opened our eyes to many places or spaces where we thought you know realize that we could you know reduce cost or optimize cost and in a way it was good I would say however cost cutting cannot help you grow an organization and that is just a short-term thing it is a quick fix it just helps you and I think if there is one thing that can help an organization grow and I would say even for every media company it is innovation and if you look at it today you know I think we are lucky that you know television still continues to be very strong and continues to have strong royalty across the country and having said that if we take that for granted I think that will you know I would say cause our doom okay and this is not like a immediate doom or something like that because consumers today I mean it is not a single screen audience that we're talking about it is a multi-screen audience the consumer is consuming television is consuming content on his mobile phone his YouTube so he's exposed to a lot of content and hence you know understanding consumer needs and ensuring that we and I would say that about all of us actually that we are right here in terms of understanding consumer needs and you know generating and creating content which kind of engages him I think that will be very important part so yes costs and all are important in their core for survival but I think it's innovation which is the most important thing and that's something that you will see you'll see a lot of stuff from the vibe on your team's table also in terms of new shows and new content and I'm sure it'll be across industry thank you so much thank you Mr. Agarwal thank you Mr. Shetty we're moving into our segment of the pitch CMO awards so thank you Mr. Agarwal you are our headline speaker you are we had a very good lineup during the day and I watched couple of presentations they were high quality and with the conviction you shared your brand philosophy and the why clearly it would inspire other young brands who want to make an impact and we wish you luck in your endeavor for your money and its brands to provide health and beauty in a natural way to its consumers so I'm sure there'll be many more opportunities to have a conversation we'll of course talk to you after the all the lectures to see what happens there and thank you Mahesh continuing to know it and partner with brands in a meaningful manner back to you Mithin thank you thank you Dr. Raghbatra thank you Mr. Mahesh Shetty and of course Mr. Harsh


ఈలాపా� టరా ి అలల౗ి అినినిర్భ����ౌౝం ంథ్ి�.. uations path sign means trial.  섞ers or messages from a sender to a receiver. Absolutely crucial to informally at wash. Did you?  Woman was shocked at different things. the second one is message passing approach, in which the messages can be transferred from sender to receiver. A process is a program in execution. Two computers are communicating with each other. We mean that two processes, one running on each computer are in communication with each other. Each computer of a distributed system may have a resource manager process to monitor the current status of usage of its local resources and the resource manager of all the computers might communicate with each other from time to time to dynamically balance the system load among all the computers. Therefore distributed operating system needs to provide inter-process mechanisms to facilitate such communication activities. This is the diagram of two inter-process communication paradigms. In figure A, the shared data approach can be shown where processes P1 and P2 are sharing the shared common memory. In figure B, the message passing approach can be shown where P1 can process P1 will be sending the message to process P2 and process P2 will be sending acknowledgement to process P1. In this way the communication between two processes can be shown in the message passing approach. Actually in this message passing approach information is copied from sender address space to receiver address space. Distributed system uses message-based inter-process communication IPC for most applications. IPC provides a set of message-based IPC protocol that hides the heterogeneous platforms. Two primitives send and receive is used by the IPC. Two higher level IPC systems are RPC and DSM. Here the meaning of DSM in computers and distributed shared memory is a form of memory architecture where physically separated memories can be addressed as one logically shared address space. A distributed shared memory system implements the shared memory model on a physically distributed memory system. The desired features of message passing approach simplicity, uniform semantics, efficiency, reliability, flexibility and portability. Now we are going to see all the features one by one. Simplicity. Message passing system is simple and easy to use. There is use of clean and simple semantics of IPC protocol and its primitives. Means the message passing system is very simple and easy to use and it is user friendly. And it is independent of heterogeneity. Actually heterogeneity means different computers having different operating systems like windows, linux or masintosh etc. So message passing system having one kind of compatibility so that it will run on all the machines. Independent of underlying network and its aspect means different machines having different hardware configuration and software configuration and having the part of different network. So message passing approach supports all kinds of networks and all kinds of configurations. Uniform semantics. Two types of IPC. One is local communication. Means communication between two processes on same machine and second one remote communication. Means communication of two processes on different machines. Semantics of remote communication should be as close as possible to those of local communication. Same system can be used for local as well as remote communication. Efficiency. Now in efficiency we are reducing the number of message exchange per user avoiding the cost of establishing and terminating connections with the same process for every message. So that it minimizes the cost of maintaining connections and use piggybacking techniques. So we are maintaining once the connection established between the sender and receiver number of messages can be passed from sender to receiver. So there is no necessary of establishing separate connection for every message passing. So this saves the cost of maintaining the connection. So in the context of computer science and digital communication the piggybacking refers to a situation where an unauthorized party gains access to some system in connection with an authorized party. This can happen in several ways including piggybacking on public wireless networks and piggybacking into a password protected systems. Next feature is reliability. So failure as such as node crashes or communication link failure can occur. It intercepts the communication in progress. The messages can be lost. Lost messages handled by the acknowledgement and retransmission technique. Duplicate message handled by the sequence number to messages. So every message here having the sequence number. So that we have to find the lost messages or retransmitted messages. Correctness. Feature related to IPC protocol for group communication. Issues related to correctness or atomicity means apply to all or apply to none. Order delivery means passing the message one after another. Survivability. Messages will be delivered correctly in despite of partial failures. Means in survivability there is partial failure but the messages can be delivered successfully from sender to receiver. Flexibility. IPC permitted should be flexible so that user have choice to specify the type and levels of reliability. So here in flexibility so many things in the user's hand just like type and level of the reliability. Correctness requirement can be chosen. There kind of synchronous or asynchronous communication can be chosen. Now next feature is security. In message passing system provide a secure end to end communication. So authentication of receiver by the sender means sender has to check the proper receiver. Authentication of sender by receiver means receiver has to check the proper sender. Means here we are checking the authenticate sender and receivers in the security point of view. So for protecting the messages we are applying encryption of messages. In this different encryption decryptions, security techniques are used for safe communication. So in this security feature we are providing the data, security to the data and messages. Portability. Two different aspects. Message passing system itself portable means a new IPC facility means inter process communication facility on another system constructed using basic design of an existing IPC. Applications written using primitive of IPC protocol should be portable of a new system means needs to handle heterogeneity and hence uses external data representation format on computers of different architectures. Now we are going to see the structure of message. Here the sender can send the message and receiver can receive the message but there is a specific format or structure of message. So here fixed length header and data of varying size. So header consists of three elements, address, sequence number and structural information. So in this diagram typical message structure can be shown. So this is fixed length header can be shown. After this variable size collection of data type then data in first column data or pointer to the data can be shown. In structural information the number of bytes and type of information can be provided. Then the sequence number can be written for every message. In addresses the receiving process ID and sending process ID can be written. Pause the video and write the answer of the given question. What are the different issues in message passing system? Important issues to be considered. First we have to check who is the sender, who is the receiver. Is there one or multiple receivers? Is received message acknowledged? Should sender wait for acknowledgement? What if node crash or communication link fails during transmission? If receiver does not accept the message then it will be buffered or discarded. Now we are going to see the next concept that is synchronization. Synchronization also occurs between the network nodes to ensure that data streams are received and transmitted correctly and to prevent data collision. It usually uses a clock signal transmitted in sequence with a data stream to maintain proper signal timing. There are two types of semantics used blocking and non-blocking in synchronization. In blocking semantics blocking send is one of the semantics and blocking receives another semantics. So in blocking send the sending process blocked after execution of send until it receives the acknowledgement. In blocking receiving process blocked after execution of receive until it receives a message. Synchronous communication, the non-blocking semantics. In non-blocking semantics send the sending process continues its execution as soon as the message can be copied to sender's buffer. Non-blocking received. The receiver process continues its execution after receiving message into its buffer. These are the references. Thank you.