This 10th year of Daily Tech News show is made possible by you, the listener right there listening in your ears right now, maybe your Ken Hayes or Phillip Shane or Paul Boyer or Chad Johnson, but whoever you are, we are incredibly thankful for you. On this episode of DTNS, what the heck is Netflix up to with its iOS game controller app? YouTube blanks out its home page and China cracks down on kids tech time. This is the Daily Tech News for Wednesday, August 9th, 2023, except no substitutes in Los Angeles. I'm Tom Merritt. And from Studio USS Hancock. I'm Sarah Lane. In Salt Lake City. I'm Scott Johnson. I'm the show's producer, Roger Chang. Now see, I wish I was in Studio USS Kenneth Bailey. Is USS Hancock a relation?  Am I related to an aircraft carrier, Tom? Are you by family? Yes. Yes, I am. My father served on the USS Hancock during Vietnam. And here I am to tell the tale today. My father served on the USS Kenneth Bailey in the Korean during the Korean War. Look at that. My father was old. Hey, you said the quiet part out loud. All right, let's start this show with the quick hits because it's supposed to be that technology. In its latest earnings report, Sony saw a 31% drop in operating income due to its financial services and movie businesses. But Sony increased revenue forecast 6% thanks to strong PlayStation sales, despite signs that profitability for the console may decline. Sony sold 3.3 million PS5s last quarter. That was up 38% on the year. But the company's imaging sensor business is expected to weaken as smartphone sales have slowed. Sony said it didn't expect demand for smartphones to improve until 2024 at the earliest. My old bet used to be to call Sony an image sensor company because it was the most profitable part. So I guess I have to switch that to game consoles now. There you go. Slack, which you may have forgotten is owned by Salesforce, has a redesign in the works. It's meant to make the interface less cluttered. A new home section will show channels, DMs and apps as usual, but a sidebar has a bunch of cool features. DMs from all your conversations in various channels all together on the left with the active DM on the right. A new activity window can unify your messages, mentions and reactions across all your workspaces. A dedicated later menu is meant for saving any stuff you might want to revisit later. The huddle video chat has been moved to the top right corner and a big plus button in the sidebar starts a new canvas or call like that. The U.S. Federal Reserve announced a new program for overseeing banks' crypto activity, also clarifying that lenders under its authority must get approval before engaging in digital assets activities. Crypto banking more or less remains the same, but puts crypto dealings under the new novel activities supervision program. That's where the feds, specialized experts in digital assets will work alongside the regulators regular supervisors. If you are a sysadmin, data center operator, you definitely want to want to pay attention to this one if you haven't heard it already, hopefully you have. Intel and Google senior researcher Daniel Moghimi shared a security vulnerability in Intel processors called downfall. Let's an attacker use memory optimization features to get access to internal hardware registers, which then in turn lets untrusted software access data from other programs, including things like encryption keys, which you do not want them to access. The vulnerability effects Intel processors made between 2015 and 2019 from 6th gen Skylake through 11th gen Rocket Lake and Tiger Lake, 12th and 13th gen chips are not affected. Intel is using microcode. They issued some microcode to mitigate the vulnerability. So you want to make sure you get your firmware updated, though you can opt out if you can't take the performance hit because like a lot of this microcode chip stuff, it does slow down the chip to mitigate the vulnerability. In the ongoing case of Apple versus Epic, oh yes, it is ongoing. The US Supreme Court declined to change a lower court order that said that Apple can keep its app store payment rules in place while it appeals a decision that would make it change those rules. Epic Games requested to let developers immediately start directing iPhone users to other purchasing options. Justice Elena Kagan denied Epic's request, but didn't issue an explanation for that reason. The 9th US Circuit Court of Appeals previously ruled that Apple violated California's unfair competition law by limiting the ability of developers to communicate about alternative payment systems that includes purchases through the Epic Games Store. Apple's appealing that part of the decision to the Supreme Court, not very surprising, but it means the case is ongoing. Yeah, we'll see if the Supreme Court even hears the case because if they don't, then everything just stands as it is and Apple has to let people tell people facts about where they can pay. I kind of want to see them go to the Supreme Court. I want to see Apple and Epic in front. I don't know why. Is that wrong of me? No, I don't know. I mean, I want to see this at this point. Come on, let's do it. For my own personal energy. I mean, if you're nothing else, then to get this thing settled. I want to see the two Tims out there having to testify and have a real circus on this thing. I'm in. Let's go. Timmy two tones. Yeah, let's do it. All right. Moving on to YouTube, which announced on Tuesday that users who disable their watch history will no longer see recommendations on the homepage. Now this might not be something that you as a YouTube user use a lot, but a lot of people do. Discovery is pretty big that way. So with watch history turned off, you'll see search. You'll see your left hand menu. You'll see shortcut to subscriptions, YouTube shorts, and also your library. That's it. The changes are rolling out to all users over the next several months. So this might affect you later than sooner. But just just know if things look different. This is likely why.  So does this change affect you and and if it does, how? Well, in theory, it does because you're going to lose eyeballs that otherwise would be not forced to see your content, but otherwise prompted to see your content in these ways. And by giving users this ability, you are limiting there. Well, they're they're self-limiting what they see. So as a creator, it makes you a little nervous. Just a little bit like, oh, I'm just trying to get my head around this now and now this changes things. What does this do to the algorithms? Does it really affect me or not? So while we're all wrestling with that, the other half of my brain is actually really excited as a user of YouTube that they're doing this. Not because I need to turn mine off because I won't be. I like my history, but I like when services and platforms give users more control and more tools over their experience. So what I'm going to like to think moving forward is that when you make your users happier, they're going to be around more and the net result is they're going to see your stuff more often anyway. And it's still on me to make good content and to find eyeballs, you know, the good old fashioned way.  So I say thumbs up overall. Yeah, I do too. You know, I mean, that's certainly an optimistic way to look at it, but you're right. If, you know, if you're doing the good stuff and you're putting your effort into that, then this shouldn't really cut you off from a lot of people in theory. I don't, I don't watch a lot of just straight up, you know, YouTube.com content. So my watch history doesn't really come into play that much. Tom, I don't know if you do or not. I don't feel like this is, you know, changes my life one way or another. I like the option. I think everybody should have that. So this post went up yesterday right around showtime and we were kind of kicking it around on good day internet why we thought they were doing this. Sarah, you suggested it. Maybe it was a compliance thing. We thought it could also possibly be just a good faith gesture that they know that not that many people will take advantage of. So, so maybe they build some good will without really undermining the number of views that much. I am now on the side of it's a probably some kind of compliance thing that they want to hedge off some aspect of some court case somewhere because there's so many of them it's hard to keep track. Yeah, because in August we, you know, we already gave users the option to not have their watch history be part of the experience. Why turn off watch history to do this? Why not just let me turn off recommendations. What if I want history? I want history and I don't want it to be shared but I want to see what I've watched so I can go and find that thing I watched again later because I do watch a lot of YouTube but I don't want recommendations. Why, why both? Why tie them together and that makes me think it's some kind of compliance thing and therefore if you turn off watch history of course that takes away the ability to do proper recommendations so they just got, got rid of it. That makes sense. But, but having the watch history, you know, I said I don't use YouTube, I use YouTube TV for my cable alternative but, but there are other platforms where watch history does come into play when I'm watching videos like Plex for example. I'm constantly going into like, what did I watch like a couple of days ago? I forget the name of that thing. Yeah, yeah, whatever. Like that, that is good data. So to turn off watch history in order to not get recommendations is like, yeah, you're right. I feel like you could, you could have one without having both. And then Bad Fink wonders if it's going to impact his viewing of the YouTube channel, the history of watches, you know, by accident. Yeah, Tom makes a good point though. I hadn't thought of it that way. I don't, I might, yeah, why not both? Give me both. Now I feel like I have less control. Why not both? Why not Zoidberg? Why not? Netflix is doubling down on its gaming offering. You want both gaming and TV shows? Well, great. Netflix is going to do it for you. They launched an app on Tuesday called Netflix Game Controller. It just appeared in the iOS app store. It's very mysterious. When you launch it, it says to begin, choose a game on your TV and follow the directions to connect. Except there aren't any games on any of Netflix's TV apps or at least none of the ones. I looked at WebOS. I looked at Roku. I looked at Apple TV. I looked at the video shield, none of them. The only place I can find Netflix's games in a tab is on Android and then it's in a row on iOS. But neither one of those would you need to use your phone as a controller for because you're already using your phone. Anyway, a little history here in October 2022, Netflix VP of gaming, Mike Verdu, said the company was, quote, exploring a cloud game offering. He also said Netflix was opening a new gaming studio in Southern California to be overseen by Chaco Sunny, the former EP of Overwatch at Blizzard. There's a lot of game development going on. Netflix has like five different studios, couple in Helsinki, couple in California. Scott, since we don't know what this controller on the phone does, we have permission to wildly speculate until they make it clear. What do you think? Yeah, they've left that wide open, haven't they? We all get to decide what this does until we get told what it does, but my gut reaction to this was this is possibly a cloud solution for controlling games. And it would have to be if you're going to be across all devices. If you want this to work over a Roku, a smart TV, an Apple TV and a Google device, you're going to want to have something that's universally going to work and not have to rely on AirPlay over here and some other technology over here or local Wi-Fi only. I mean, I guess it could be Bluetooth or Wi-Fi Direct, something like that. It could be those. Those tend to have real serious latency issues. Yeah, and not that cloud-based controls don't, but if there's one thing Stadia approved while it was briefly with us was that you can really do a good job with that. Those controllers, and they were hardware controllers, mind you, but those controllers working wirelessly with cloud based games were excellent. Their latency was next to nothing and incredibly impressive compared to much of the competition, including Microsoft's own xCloud beta. I think that that's the more likely scenario that we're going to have different ways, including hardware ways of controlling games, Netflix games in particular via any kind of TV set or set-top box via a cloud solution. Yeah, because everything else feels too janky to me and to, you know, not, I don't know. They have to do third party physical controllers or this is going to be really weird. If this controller app feels like a way to get people who don't have controllers to try their games to be like, hey, you don't have to go buy a controller if you don't have one. Use this to get involved, kind of bring people into it, but it doesn't seem like the optimal way to control games on any kind of set-top box. No, and there's a whole other question about what do you do marketing-wise? Are you going to tell people to go to Walmart and buy this Netflix controller with Netflix branding on it? Is it going to be a third party thing that they just like just use a PlayStation or Xbox? Yeah, exactly. That's entirely possible too. And that would be that's the way Apple does it. That's the way others do it. They say, hey, we recommend this. You can go buy a Series X controller on Apple.com so that you can run your Apple TV games. So I don't think that's out of the question either. But if they really want to make a solid play for gaming, if they really are digging their heels in on whatever the future of cloud is and they're making hires that indicate they want to make more than casual games, they're going to have to tell us soon because right now all it is... No, they don't. Why? Why do they have to? I guess they don't. They print money in it. They want the company to do that. That is true. That is absolutely true. This reminds me of when they launched streaming. When they launched streaming, it was first like who would want to do that? I can only do it in my browser. There's only 2,000 titles. But you know, what is this? Eventually, that became the business of Netflix. So this feels like it's in the same stage. For anybody who's interested in Netflix game controller, the app store description, this is iOS, says, coming soon to Netflix, play games on your TV with the Netflix game controller. The game controller app pairs with your TV and allows you to play games on Netflix using your phone or mobile device. So if you see that, or if you've seen that already and go, okay, upcoming, all good. It's just that the company has been very mom about okay, when's this all launching? How is it launching? With what games is it launching on? Is there hardware involved? Just kind of, you're gonna get a lot of confused, but hopeful people using this strategy. I don't know if this is on purpose or if Netflix just thought- It's on purpose. They put coming soon in the description. This isn't an accidental- It's on purpose that they did that, but I don't know that they're trying to confuse people on purpose. And start getting all hyped up to be like, ooh, what's it gonna be? I think they totally did that on purpose. I think that also helps steer the ship. They'll make decisions based on this chatter. I don't mean just the show, but just people, how they react to it.   Well, that will help steer their decision-making on what hardware solutions they aim for or whatever. So I kind of agree with that. I think that they can afford to do this. So this is how they'll do it. They'll just take their time. Well, we are gonna take some time next. This week to try out stuff. It's the third annual DTNS experiment week, swapping out our normal DTNS shows during the August doldrums to try out some new ideas. So if you like the barbecue and tech show or the tech John that have been going strong for a couple of years, those both started on experiment week. This year we're gonna have a show from Nicole Lee about online life. Roger interviewing people from tech TV about the origination of that network. I've got an experiment in the works as well, a little morning news sort of thing. That all starts right here. You don't have to do anything. It's right here on the feed or YouTube channel or Twitch channel that you're watching right now, Monday, August 14th. Actually it won't be on the Twitch channel because we won't be doing it live but it will be on all the DTNS feeds starting Monday, August 14th. I heard Joe yelling at me so I stopped. Well, we are gonna talk about this today and that is the Chinese government ramping up restrictions and regulations on how children are online and how they use apps. So the goal is to limit children's access to age appropriate content on their phones or smartwatches or speakers or anything else where the internet is available. Last week, China's cyberspace administrator rather released the guidelines for the establishment of miners modes for the mobile internet. This is a cross-platform cross-device government-led parental control system asking app developers, app store providers and makers of smartphones and other smart devices to develop a miners mode, kind of a cross-the-board type thing. Even though this is targeted toward Chinese companies, companies with a presence in China, maybe Apple or Samsung, also will be asked to cooperate with the system. We've spoken in the past depending on what market you're in, phones for miners, you know, kids under 18, being restricted in schools, for example. And the idea that too much time online does not help a child in any significant way besides keeping them from maybe learning more important things. So I guess when you say Chinese government, there might be some connotation that doesn't apply to other places in the world, but Scott, what are your thoughts on this? Well, I can tell you as somebody who tried to be as wise as you can be as a parent with their kids and their time with screens and digital life and gaming and whatever it may have been, you are always trying to do right by the balance of it. Like how much is enough? Is two hours a day okay? Is two hours a week okay? You really do wrestle with a range, but I think culturally it's just because that's where it's put on me. It's my job to do that, not the government's. And so when this sort of stuff happens, I bulk at it because I'm like, well, wait a minute, that's not how I wouldn't, I don't want the government telling me how to raise my kid. It's hard for me to pull away from that and look at this from a further perspective and go, all right, let's try to forget that that's how I was raised or that's how we generally do things around here and instead look at it from that perspective. I think it's actually admirable for any nation to want to see their kids, their children succeed because success in the lives of these kids as they grow, whatever that may be defined as, whatever success is, whether it be financial or other, but those things will lead to a stronger nation. That's the idea, right? I just really struggle with they have to tell my kids what to do instead of me telling my kids what to do. The risk of that, of not doing that, is that kids will just be on screens all day and never get anything else done and they'll be poorly prepared for any kind of further education or any kind of job or any kind of anything else. And I think those are real concerns, like those are actual concerns. So I don't know what the very happiest of middle grounds are here. I just think that on the whole, historically speaking, eventually that stops working. People don't like to be told what to do and this feels like a bit of that. So I guess my overall is, I'm in a very poor position to say because I just feel like this to me feels so intrusive, but I know I'm coming at it from a very specific angle. You also don't live on the mainland of China. Right. So, you know, it does, that differs somewhat. You know, and there's some more details about exactly what's going on here. You know, anybody who's followed this probably remembers that a couple of years ago, China introduced three hours per week limits on children playing video games. That was video games specifically, not just being online, although sometimes they're one and the same depending on what anybody's doing, regardless of their age. But yeah, I don't know. Tom, you know, does this feel like an overreach or is this just what perhaps, I don't know, a lot of parents, guardians, older people in China have noticed with younger people that has just sort of spilled into politics? Yeah. To me, discussing this as an overreach is a very American point of view. It's a very American centric point of view. Even a European centric point of view versus in China, I know there is a very different attitude and I don't pretend to speak for Chinese people, but from what I gather from, you know, listening to the Economist podcast that comes out of China from a Chinese correspondent there, people have a much more accepting way of saying, well, that's what the government's going to do. The government's going to do it. What I find interesting is that they, as you said, Sarah, put in that three-hour-per-week limit on children for video games and within a year, 70% of children had reduced time spent gaming. 29% reported more than three hours that were allowed. So most children had reduced the time and few of them were even going over the three hours. And if you're like, well, maybe they just reported that, maybe that's not true, 10 cent noted a 96% decrease in gaming hours. So that's the company saying, no, it definitely had an effect. And now China is saying, we want the developers, we want the app stores, and we want the device makers to all stop the kids from gaming. This is a great way to kill a vibrant part of your economy in a country that just announced deflation. Feels like maybe the cure is worse than the disease. And hadn't really thought of it from that perspective because the gaming across the world is a growing concern and I don't mean concerned in the pejorative.  Like a growing business. Yeah, it's like going crazy. And for you to purposely put yourself on the far outside of that financially means you don't want a piece of it. And the biggest piece of it right now is Asia, is China. Like that is the potential. That's the gold pot everybody wants. And to curb that so hard is probably not great for them long term, especially if it's working, right? Like if it's actually working, it sounds like it is and they're reporting it's working. Then that may not be what they intend. If their ultimate goal is economic strength and all of that, I think maybe they're barking at the wrong tree. We'll see. I feel like they'll just say like, yes, but we'll order people to take the time they were doing that and make more chips because that's our priority or grow more rice because we're trying to bring rice production back domestically which is another one of their big efforts. That's the way a planned economy kind of thinks. That's true. It'd be great if they suddenly said, we want everyone to spend an entire week playing video games to catch. You get, but you only get one week. You only get one. Yeah. Everybody play video games all week. That's it. But that's it. Then the rest of the year. Build chips. Forget it. Well, if you're the kind of person who plays video games, but when you're not playing video games, you might, I don't know, peruse your local target to see what's in there. Target has introduced a new perk for a drive up orders.  You don't go in the store. You order online or ahead of time somehow and then, you know, you kind of stand your vehicle or I guess you could be on a horse or something. And then you get your target items without going into the store new part of it. Starbucks orders. Now, not every single target has a Starbucks inside, but 1700 of, I believe 2000 target locations do so and will be able to offer this option starting in October. So as a customer, you don't enter the store. You might get, I don't know, whatever you would get a target, but then maybe also a Puppa Chino. I shouldn't say that too loud because I have a dog behind me.  A lot of stores do this. But yeah, this is a target and Starbucks taking it a step further. Who's in? What stuck out to me is that the pickup business, you know, it's not people haven't started going back inside altogether. So the curbside business is going strong enough to work on the app to integrate Starbucks ordering into it. Cause you have to know when people are coming in order to make sure that the drink is ready and hot at the right time. So you have to get people to hop in. There's a lot of work to make the app do that and apparently is worth it. Enough people are picking up their wild fable workout clothes to, you know, want to add Starbucks to it. Well, I think it was in a GDI recently, you know, Roger and I were talking about their grocery store experience. I'm like, put me inside a grocery store for an hour. I will just be the happiest person ever silently moving through the aisles. That's how I feel a target as well. Just let me inside a target. But hey, everyone's different. You might have a family. You might just not have an hour to kill inside a target. There's all sorts of reasons by the, you know, the pickup option is alive and well and thriving. Certainly the target near me, which is a large target as far as targets go. I think they call it a super target has a huge line of people waiting for their stuff to be just put into their trunk instead of going inside the store. So yeah, add Starbucks on top of that icing on the cake, so to speak. Well, if you are picking up your new Jean CD and a Starbucks latte on your horse at Target, please send a picture of yourself doing it to feedback at daily tech news show dot com. Speaking of which, let's check out the mailbag. Let's do it. So Joe had some thoughts about our conversation. We had a Monday about AI in Dungeons and Dragons and the fact that a lot of people do not think it has a place there. Joe says, I spend time in the online D&D community and the discovery of AI content comes on the tail of a dustup last January, where the Wizards of the Coast announced they were retroactively revoking their open game license, which was essentially creative common style licensing for the core mechanics in D&D. This caused an uproar because all the creative work and even business people had built using that license, which was potentially impacted the way the revision was worded. It would have affected both future and past works done with the open game license, allowing Wizards of the Coast to collect fees for many creators. Ah, now they canceled that revision according to Joe. So that makes sense that they then are worried about other copyright things since they cancel. That's a missing piece to that puzzle that Joe sent us. That's very cool. Thank you, Joe. Yeah, indeed. If you have any thoughts or, you know, inside information about this ongoing story, do let us know feedback at dailytechnewshow.com. In the meantime, we're going to thank you, Scott Johnson, because you're just a great dude. Let folks know where they can keep up with your latest. Thanks for being a great dude. Well, let me tell you, sorry, you talk about D&D here and that's funny because we're in the middle of one of the biggest and most successful video game launches in years for Baldur's Gate 3 and it is all based on the D&D, fifth edition rules. So speaking of D&D, we're going to talk about that game at length among all the other cool stories happening in the video game world. And you can find that on our little show called Core. You can find it anywhere you get your podcast, but if you'd like to go right to the site, it's frogpants.com slash core tune in and check it out. Patrons, you are the best. Thank you for supporting the show. You get an extended show, Good Day Internet. So stick around, we're going to talk about that lady in Canada who can't stop shoes from being delivered by Amazon. Like more than 50 shoes have been delivered to this woman and she has a sign on her door. There's a lot of them even. That's right. So I guess a hundred shoes, right? Cause it's 50 pair. Good point. Hundreds of shoes and she can't stop them from coming. We're going to talk about it. Stick around. But just a reminder, we do the show live and you can catch it live Monday through Friday at 4 p.m. Eastern 200 UTC. Find out more at daily tech news show dot com slash live. We're back with Shannon Morris talking about black hat news tomorrow. Don't miss it. Talk to you that. This show is part of the frog pants network. Get more at frog pants dot com. The timing club hopes you have enjoyed this program.


We will be revisiting some of the concepts that we had studied earlier. In the process, we will take some more examples. As we did last time, here is another example which requires use of two-dimensional arrays. This is about satellite images. There is a large lake located in a portion of land and a satellite image of that area is available. Estimate the area of the lake, so how will you do that? First of all, treat this as a real-life problem rather than a computational problem. In this real-life problem, do you know anything about satellite images? Not much, but the word image will tell you that it should be something like a photograph. Do you know about photographs? Good. Now, if you have a photograph of a land area taken from a very long distance in the z direction, say aerial photograph from an aircraft, satellite is merely an aircraft which is flying at 30,000 kilometers, a airplane flies at 20,000 meters or 30,000 meters, a satellite flies at 30,000 kilometers. Just like you can have a camera on the aircraft, you can have a camera on the satellite. So, some image has been taken. What could be the possible qualities of this image which will tell you something more about what is being captured in the photograph? So, can you speculate now? This is where you start making assumptions.  Real-life problems will not say evaluate this expression and find the value or find out the root of this quadratic up to correct up to four decimal places. Real-life problems do not come like that. In the real-life problems, you have to first figure out that a quadratic has to be solved. You have to frame that quadratic and then solve it. So, here is a similar problem. This is a satellite image. What you have been told is that there is an area in which there is a large lake present and a satellite image is available.  Now, generally, a terrain in which there is a lake will be how is it likely the lake is likely to be in a vast plain area? It is possible but unlike. Most of the lakes are found where the region is hilly region, where there are trees, where there are shrubs, where there are there is a there are rocks, black and brown rocks and so on and suddenly you will find a large water body. So, let us imagine that such is the area. What will be the peculiar characteristic of the photograph that you will see in terms of distinguishing the large water body which is lake versus rest of the area? Can you imagine? Consider the light falling from the sun on this land mass. The reflected light is what you see. Black bodies will reflect what light, hardly any light. Brown bodies will reflect brownish or grayish light. But water body will reflect light which can be seen to be very close to white. Now, it may not be exactly white but it will be brighter than most other points in the picture. So, is it not possible to analyze the picture element values of the light intensity and determine that it appears to us that these picture elements will probably be part of the lake and which are those picture elements which show the brightest possible reflection. You remember the histogram analysis that we had done. In general, you can do a analysis of pixels of any kind and determine that some pixels are higher value and some pixels are lower value around some threshold point. Now, the picture elements which are reflected from the lake need not exactly be white but they will all have values towards 255. All other pixels will have values towards 0 or 50 or 70 or 80. It should be then possible that I determine a threshold value. Elements of picture beyond that value are treated as white. Elements of picture below that value are treated as black. And everything that is white is a water body. You remember the mid-same exam problem where there were white patches in a camera. Can you now find a similarity between this and that problem? There you were to determine the area of the largest white patch. Here we are told there is one large white patch. You have to determine the area. So one problem is all. We know that if somebody gives us a satellite image of land area, I know how to determine which picture points belong to the lake, which picture points do not belong to the lake. That much is simple. But I am asked to estimate the area of the lake. Area is measured how? Square centimeters, square meters, square kilometers, square miles, square feet. In general, area has the dimensional square of something. If I have a rectangular shape, I know how to calculate the area. If I have a triangular shape, how to calculate it? If I have an odd shape like a lake, how will I calculate the area? Yes? This is a real life problem. It has nothing to do with maths. You have to estimate the area of this lake. There is no length multiplied by breadth or there is no circular regions of 2 pi r square, no cylinder, pi r h, etcetera, no regular shape, you have to estimate the area. Imagine you had actually a photograph, physical photograph. One possible thing is you put that photograph on a graph paper. You have the width and height of the entire photograph that represents the total area. On that graph paper, can you not find out if the graph granularity is small enough, every square in the graph is small enough, then how many of those granules fall inside lake and how many fall outside? So those granules which fall inside constitute the lake area. Those which fall outside constitute the outside area. If I can estimate the area of one square on that graph, then by counting the total number of square points inside the lake, I can find out the area of the lake. Now what is a digital image, if not an image drawn on a graph paper with every square as a pixel, so does it not tell you how to estimate the area? If you can find out all pixels which belong to that image, which is the lake, then by just their count multiplied by the area of that pixel is the area of the lake, very good. Now how do you find the area of a pixel? Basically we are saying we will divide this into fine granularity, a digital picture is a grid like this, this is a pixel, what is the area of this pixel, how do you estimate the area of the pixel? Let us say you need some more information about this picture, where this picture is taken. So somebody tells you all right, this picture is taken in the Sayadri mountains near Mumbai as you travel towards Pune and the region is somewhere between Khandala and Lonara. Now this is a large region, so you certainly can visit that place and find out this is the lake and by looking at the photograph this is the area around it, that much is clear. Now what? You still have to find out an area of a pixel, how do you estimate the area of a pixel? So think, have you seen a map, normal map, geographical maps? Maps represent features in that area, a political map will represent boundaries of states and districts, a physical cartographic map will represent hills and other things, a general map would represent roads and some locations of prominent points etcetera. But all maps have one characteristic which none of you seem to have noticed and that is the scale of the map, that one centimeter on this map represents two kilometers, that is how you estimate the distance between the map points, saying from here to here it is three and half centimeters and therefore it should be seven kilometers. If there is a scale on your image you would then be able to know because if there is a scale you can measure the length and width of the total image which is mapped into total number of pixel points that you have. So you know roughly the area of a picture element. But a photograph generally does not come with a scale, the fellow up there in the satellite has no clue on the actual scale, so he will just send you an image. So how do you determine the scale? So let us look at the physical problem of a map, you have given a map, somebody has forgotten to write the scale map, you have got the map now and say let us say take a simpler problem. In a map I want to determine the distance between some two points which are known to me, for example somebody has said this is the map of the region between Khandala and Lonavala or somewhere around that vicinity and let us say two prominent points, one village is there, somewhere here there are some trees and when I go to that region I can see this village and I can see those trees maybe about a kilometer or so. Can I not do the following, can I not go to one of the houses here and start walking towards these trees measuring the distance as I go along? Suppose this turns out to be one kilometer, then I know on the map whatever is the distance in centimeters or whatever is equal to one kilometer, can I not determine the scale of a map like this? I will have to do that, determine the scale, then come back to my digital image and say this digital image is so many centimeters by so many centimeters when I print it, this is divided into so many pixels by so many pixels. Now can I not know what is the area of a pixel? Second, is it right to assume that my pixels are square? Have you generally seen photographs to be square photographs or rectangular photographs? There is an aspect ratio of the photograph some height and width and you may do it as a portrait or landscape but that is the general ratio. So it is not really true that my pixel will be squareish but I will know what is the total height of this area and what is the total width of this area in terms of kilometers now because I have measured this and that will be equal to H number of pixels and W number of pixels, will I not know now exactly the dimensions of individual pixel, the resolution of an individual pixel. So if this is a pixel, let us say let us assume a rectangular pixel it could be like this or like otherwise. Now I will call this as horizontal resolution say resolution H and this is the resolution in width. No it is the other way round. Well horizontal resolution is like this, H is height actually and vertical resolution. So let me call it Rv is the vertical. This will tell me a pixel covers how much area. By the way in general when you talk about satellite images, satellite images already satellites already know what is the resolution of their camera. They also know at what height the satellite is flying. So it is possible to state with a pinpoint accuracy that a digital picture taken by that satellite each pixel will cover so many meters by so many meters that is called the resolution of the ground. In fact the GPS systems that are used by most people offer a resolution of 7 meters. That means you can determine the longitude and latitude of where you are from that GPS equipment using that satellite which is positional view to the accuracy of plus minus 7 meters. And the satellites which are now coming up for the general civilian usage will reduce it further to 6 meters and 5 meters. But such resource computing satellites or what you call digital imaging satellites. These are not satellites meant for general purpose people. These are satellites meant to fly on specific area and they have much higher resolution. One meter by one meter resolution is common in this satellite. And as we progress the resolution is coming out to be smaller and smaller and smaller. But this is additional information not related to this problem. Just wanted to tell you that having thought so much we should understand a little bit more about digital images. Coming back to the problem I would now like you to note we started with a problem statement which says a large lake is located somewhere estimated area if you are given a digital image. Before even you could think of doing any programming you had to resolve so many issues. And without resolving these issues you would not be able to write a correct program because you do not know what assumptions to make. So whenever such problems appear you will have to make assumptions. Some of the assumptions are stated here. One image has W pixels per row and has H rows. So H is the height. You know all digital images you count width in the positive x direction and y increases downwards. Typically that is the way you take origin as the top left corner of the image. So there are W pixels per row and it has H rows. So this is W and this is H. Next each pixel has a resolution. Actually I have made a mistake here it should not be R H we will call it R W sorry. So R W by R V meters and values of W H R W R V are known and are part of the image data. Later on then I will put up a bitmap image format a file called something dot BMP. You will notice that each BMP file has a header of 56 bytes. And those 56 bytes contain a whole lot of information which includes the width and height which includes the horizontal and vertical resolution which includes the color scheme of the image whether it is monochrome or color which includes how many bits per pixel are encoded. All of these information is there in 56 bytes. And this is followed by the actual image data in bytes. That is how the actual images are stored. These are all binary files. They are not stored as your what you call conventional text files and so on. However we generally deal with text files because we are used to inputting data on a keyboard where you type ASCII characters and you expect a C in statement or some such similar statement to take these character strings as 121, 255, 0, 72 etcetera and convert them into integer numbers internal. So that is how we will assume that these values are known as part of the image data and the image data format is something like this. So I have stored it in a text file. Line 1 contains the values of w, h, r, w and r, h. r, w and r, h are irrelevant format determination of which pixels lie on the lake. They are useful only from the point of view of estimating the area in square meters or square kilo w and h however are important because that will determine how will I read the data. And the next assumption says that next line will contain all pixel values in first row. So suppose the first row has 800 pixel value then first value will be written as say 124, 1 blank, 78, 1 blank or 2 blanks whatever normal way in which you feed integer values one after other blank blank blank blank blank and you presume that the enter is placed while editing this data file while preparing this data file only when the entire first row is entered that is possible that is for me. In fact you know that if you use C in statement to read the data in it is not necessary that an entire row be accommodated on one line only. You could actually put only one value per line does not matter. All that the assumption states is that first w number of values will come belonging to first row. Next w number of values belonging to second row. Why it is important because you want to assign in a two dimensional matrix the actual image values appropriate. If w is not known then you would not be able to know how many values to put in the first row and the second row and third row. Of course you may call it 0th row first row second row. With these assumptions now how do you solve the problem? Now this is a programming you have been given a data in a file which is a text file. Let us make assumption about the name of the text file. So what would you like to call it? Let us say image data dot this is the file. Of course if it is a text file and I know I am going to read only this text file and I know I am not going to now prompt the user give value of w, give value of h, give first row pixel values etcetera. Because I am most certainly not going to type out these values on the terminal. Anybody who is lion hearted enough to type 800 by 1200 image pixel values on a terminal nobody would do that. Nobody in the right mind would do that. So you would expect this data to be read from a file. We have made a simplifying assumption that it is a text file and therefore the best thing for us is to write our program and then use input read direction to read all the data because no other data needs to be read real. Only this data is required. So if my program is let us say prog dot CPP then the way I will carry on with this is I will say C plus plus prog dot CPP and I will simply say dot slash a dot out redirect the input from you understand this now. So there is no input to be typed on the keyboard. Whenever input is large you will invariably use this. Later on we shall see that this may not be adequate. Suppose I have to read data from a file and also read data from input. How will you do that? Normally you cannot using the read direction. If you say redirect then every C in statement that you write in your program will take the data only from that file. It will be disconnected from your keyboard. So whatever input you give on the keyboard cannot be taken. If you want to read from both keyboard and the file then in your program you must explicitly open this file and read from that file explicitly using F read statements or F get C F get S or F scan F kind of statement. Then only you will read from that file and then your C in statements will ordinarily come from the keyboard. You will of course not use redirecting. So these are the alternate. So having said this now we need to solve the problem. How do we count the number of pixels in a satellite image which has a value bigger than some threshold T? I have to declare my data structures. How should I declare the picture element values? Let us say I say int P for picture. I have to declare the size of P, number of rows, number of columns. Any suggestions? This is another assumption I am making. Please note that we have assumed h and w values will come from the file but we do not know what those values are. What are the likely values? Again you have to make some assumptions and they have to be realistic assumptions. So reasonable assumptions as I said. Now what is reasonable in this case? So speculate. Think anybody? You tell me what will you speculate? You are speculate so you are not responsible for what you say. 2000 by 2000. Any other numbers? 5000 by 5000. Any other number? Nobody is suggesting 20 by 20. Everybody agrees that 20 by 20 will be a scam. It will not contain a probably good image at all. So we are very clear of what is on the low side.  So all of you are sort of hearing around somewhere between 2000 and 5000. This is not necessarily based on your actual knowledge of any satellite image but this is based on common sense. You are perfectly justified in writing a program using your common sense but you must explicitly state the assumptions that you are making. You must state that the assumption you are making is that an image at the most is 2000 by 2000 or 5000 by 5000. What is another area on which this will depend? The size anyway. Let us assume 5000 by 5000. What is the total number of points? This 5000 by 5000 represent? 5 into 5 is 25. 6 zeros after 25. How many? Sorry, 20. 2.5 crores. How many million? 25 million points. Each integer value is how many bytes? 4 bytes. 25 million into 4 bytes will require how much of how many of bytes of memory? 100 million bytes. Today you are fortunate because even your small PCs have 2 gigabytes of memory. There was a time when memory of a personal computer used to be 64 kilobytes. 64 kilobytes. Satellites were there even then and people were processing those images. How would they do that? They could not do it putting an entire image in an array. It was not possible. Later on there was a time when the PCs had memories which were typically 64 MB, 128 MB or even 256 MB. Many of you would have seen some older PCs which are 256 MB RAM. In a 256 MB RAM, when there is an operating system, there are some overheads of the compiler libraries and other things and your program code itself, will you always be able to put aside 100 megabytes? Now this is another thought which must occur to you that whatever I am declaring as the size, is it feasible in the computing environment that I have? And even if it is feasible in your computing environment, you must make a note of it so that when other people try to run their program, they should know that they could not run it on a machine with a smaller memory configuration. So that is the minimum they should. We proceed with this now. I am not putting a semicolon here. I am just putting a comma because one style of writing program is to keep adding variable names or array names as I require them in my program. Since no c out needs to be given because I know that I am going to read the data from a file, I can directly read which things I can read W, I can read height, I can read the resolution on the horizontal side and I can read resolution on the vertical side. I have read four values. I must therefore declare all of them and please remember while writing in your programs whether you are writing it for your lab or practice or at home or in an exam and particularly in an exam, do not postpone the declaration of the variables much beyond after you write them. The moment you write them, you go ahead and add that because later on what will happen is something will remain undeclared and one of my TAs will read a half mark very happily for that. So do not make such mistakes. Next what do I read? I have to read now the image data and how is image data organized? W pixels first of the first row, then second row, then third row. How many rows are there? H number of rows. How many columns are there in each W? So it is very simple. Is this ok? Is this statement syntactically correct? The declaration of I and J is not done. Now is it correct? This is another habit I would like you to develop as professional programmers. When you write a portion of the code, then and there itself revisit that code to check whether the semantics or what you want to write is correctly written and check whether all variables are declared or not.  This works in an exam, this works even for writing programs. In fact there are a few programmers I have seen in last 40 years. Every year I see some who write their program once and it works correctly. There is no syntax error, there is no semantic error. That is professional program. Depending upon C plus plus compiler to tell you 200 errors is one way of simplifying your task. But it is a guaranteed way of not becoming an expert programmer who has trained his or her mind to perfection and that is what you should attempt while writing itself. So I have read the picture array now. What do I have to do now? I have to count the total number of pixels which fall within the lake region and that count itself if I print that is an indication of what is the area or if the resolution is given let us say in terms of meters then those number of pixels multiplied by r h and r v will be equal to the area of the lake. So I am going to count the number of pixels which are in the lake. I will need a variable called count. Since I am going to proceed to counting I must start with count equal to 0. This much is very clear. Now what do I do? Again I have to set up an iteration. Now I have to examine each picture point and compare it with what? Please remember at this point in my program I have a certain value of i and a certain value of j. So in that large image I am actually examining i comma j th element. I am at that point. So p i j is well defined and can be accessed at this point. Now this value if it is larger than certain threshold then we have said it belongs to image. If it is smaller than certain threshold we say it does not belong to lake sorry the first one belongs to lake and the other one does not belong to lake. So all that I need to do is if the value of this pixel is greater than that threshold what is that threshold? Made any assumptions suggest sorry 128.  The region is likely to have a pressure of things but he is presuming that all lake pixels will reflect a light intensity which is 128 or more. This is reasonable and this is quite okay but I would suggest in case of digital images two possibilities. One is to make an assumption slightly on the higher side so that because 128 if you look at the black and white or monochrome images 128 while it could be occasionally because of a dull image the lake may reflect that but it could also be the pixel values of some surrounding area particularly a patch of land which is sort of whitish or less brownish. However any number that you assume is perfectly fine as long as it is towards 255. So for example here will the assumption 78 be reasonable? The assumption 255 is more reasonable than 78 although both may be wrong because 255 is an exact white reflection which is unlikely to happen. So we will make here a statement PII greater than let us say we will put it arbitrarily as 200 and here we will state threshold 200 assured. So this is your assumption. Please note that all the assumptions which I have stated there are best written as a part of your program itself. So after you say IO stream and using name space STD either before that or after that nobody prevents you from giving a larger comment which says this program is written by me. It supposedly analyzes an image data from a satellite it identifies the region of a lake and estimates its area following assumptions are made.  So your thinking proceeds along with the program writing. However the thinking is done first program writing is done and therefore these assumptions or any statement that you wish to make about your algorithms should precede your program. Ordinarily you may write them on a notebook separately but you may also include the majority of those observations or assumptions in your program. This is called inline documentation as opposed to an external document and one is not the replacement for other. Both are considerably important. Anyway if that is so then what do you want to do? Simple and now you have to calculate. Agreed? So everything is correct. Something else is required here. Area is not declared. Now suddenly it should occur to me that area is not likely to be integer square kilometers. Is it likely to be integer square kilometers? No. In fact any area in real life will have some fractional value. I have made certain assumptions. The resolution of the horizontal scale and the resolution of vertical scale of a pixel I have assumed to be integer. If that is so then that assumption must be stated in terms of integer meters. In real life if you know the total number of pixels and let us go back to the previous slide here. I jumped the gun by several slides. So if this was my assumption made earlier and I had declared in my program R H and R V to be integer then I know that I have perhaps made a compromise somewhere. Having made that compromise I will continue to write here area and close the chapter because my program has ended with very clear understanding that this is the assumption that I have made. Then the resolution better be in terms of centimeters or in terms of whatever unit people are confident of having that integer value as a result. But that is not my responsibility that is somebody else's responsibility. However imagine that you are not merely a programmer but you are also an expert in interpretation of digital images and you are advising let us say the resources ministry of Maharashtra to tell them that this is the area of the land covered by water body. Then you want to be as exact as possible then you will have a team sent to that Khandala-Lonawala region to measure actual area as clearly as possible. Take the total number of pixels and not depend upon R V and R H which is given as that satellite image but determine that independently by actually locating all the boundaries on this point, this point, this point, this point. You will have a scale which will say 1 centimeter is equal to 0.839 kilometers. You will go to that level of resolution because you want to be exact as exact as possible. This is what you will do in real life but in programming you will notice that whichever way you resolve the other issues your program here which starts by counting count equal to 0, reads this image data and calculates this and gives you the estimated area of the lake as area is as accurate as possible. In terms of programming problem you have solved the problem. Now we will go further. We will say that look this is the water body but I want to know the contours of the lake I want to know what is the perimeter. Suppose I start walking around the lake say today morning 7 o'clock and walk at 4 kilometers an hour robust speed. How many hours it will take me to come back to this point that is perimeter? Radhakshina, how will I determine the perimeter? Yes, estimate the perimeter of the lake. The total number of pixels on the boundary of the lake how will you estimate that? All the other assumptions that you have made stand yes. Any other suggestion? He is suggesting that count all the pixels which have a value greater than 200 but which has an adjacent pixel which are not all 200 greater than 200. Here we introduce the notion of neighbors of a pixel. Suppose this is a pixel which i comma j that you are looking at. Then how many neighbors does this pixel have? 1, 2, 3, 4, 5, 6, 7 and 8. The 8 neighbors when will be a pixel on a boundary? Some of the neighboring pixels are belonging to lake and some of the neighboring pixels are not belonging to lake. Even if one pixel does not belong to the lake then I must be on the boundary. Very simple. If I am somewhere here imagine I am me and I have these 8 neighbors. Now I have to examine all my neighbors. White, white, white, white, white, white, white. Then I must be inside the lake. If I examine my neighbor black, black, black, black, black, black, black, black, black, black then I am outside the lake. Now examine neighbors white, white, black, black, oh some blacks. Who am I? White. Then I am on the border. If I am black, am I on the border? If I am black, no. Because I am not part of the lake. Border of the lake is defined by those points which are in the lake but on the border. So I must be white to begin with. However suppose I count all pixels which have at least one non-white neighbor. Will my estimate be wrong? Without caring for who I am. If I did that what will be I counting? That is I am saying I do not care who I am but I examine all my neighbors and if any one of those neighbors is non-white or the other way round. If any one of those neighbors is white then I count myself to be on the boundary. Will that be correct? If I did that I will be counting even myself when I am just outside the lake. So two conditions. One, A I should be white and B I should have at least one non-white neighbor. At least one non-white neighbor. As long as I have one non-white neighbor I am on the boundary. Now if I count all such pixels they will amount to what? The pixels on the boundary. But how will I calculate the perimeter? Perimeter is a distance measure, length measure not area measure. How will I do that? Ok. So let us look at some of the pixels. If I have a pixel on the boundary here then the length of the pixel is equal to the vertical resolution because it happens to be on something like a straight line. If I have a boundary pixel in this region then the length of the pixel is equal to horizontal resolution. If I have a pixel in some region like this here which is on the boundary then the length covered by it is equal to the diagonal of the pixel and it is not very easy to determine who is on the diagonal, who is horizontal, who is vertical and then some chokers will be neither horizontal nor vertical nor diagonal. In short we recognize that determining the length of the perimeter accurately is a harder problem. It is not very straightforward, not very simple. But I can make reasonable approximation and I can say that every pixel represents an average of this length, an average of this length. Suppose I made assumptions that the average length is somewhere between it is larger than the height of it, but it is lesser than the diagonal. Will I be accurate? I do not know. I am speculating everything depends upon the shape of the lake. If the shape of the lake is very arbitrary, if it is elliptical then there will be more pixels which will cover only the horizontal resolution and very less which will cover the, so this is not an easy area to estimate. However, I can do the following. I can say that look I will produce an output which will give you all pixel coordinates on the boundary and I will also give you the total number of those pixels. Now based on the boundary you determine what you want to do. So that is a reasonable assumption about programming problem. I am converting a physical problem into a programming problem saying that I do not know how exactly to calculate. Given more time I will do it. In 10, 15 minutes I cannot work that out. But permit me to do the following. Whenever I determine a pixel on a boundary I will output its coordinates and at the end I will give you total number of pixels of the boundary. Is that a reasonable approximation of the problem solution? The original problem said find the parameter. This is what you will notice. In an exam you will get specifically to determine the number of points on the boundary or coordinates of the points. In real life you always have to solve problems which involve physical dimensions and therefore some additional work. Now here what is the issue when you have to do such counting? Please note that you have two outer iterations already maintained. For i equal to something to something for j equal to something to something.  Now you have to examine all the eight neighbors of i comma j. How will you do that? How will you examine all neighbors of i comma j? Suppose p i j is me and I first examine whether I am lake or not. So if I am lake now I have to examine whether anybody around me is non-lake. If it is not lake then I have to increase the count. If everybody is lake then there is no issue. So if the non-lake count is more than zero then I am on the boundary. But I already have one fellow called count upstairs which is counting the total number of pixels which I will still use to count the total number of pixels on the boundary now. So I need another count which is called the neighbor count. Amongst my neighbors how many neighbors are non-lake? I want to count. So how will I write my program? I imagine now here that I already have this setup. I want to examine neighbors of p i comma j. Provided p i comma j is lake not other one. So if it is not lake I do not have to do anything. I can just go to the next iteration. So one statement which I can write here is if p i j what was the threshold that we had taken? Two hundred. So greater than or equal to two hundred or greater than two hundred? Greater than two hundred. Greater than two hundred. So if I say this is less than two hundred then I can simply say continue less than equal to two hundred then I can say continue. You know understand what continue is continue will break the innermost loop it will go to the next value of j. And therefore I have nothing more to do with this picture. So if I am not why if I am not lake then I have no reason to examine my neighbors. I come here only if I am lake now I have to examine all my neighbors. But I require an additional count. Suppose I say in n count this is the neighbors count or if you want l n count is the lake neighbor count is equal to zero. Now what kind of statements I will make if just look at this. If I am i comma j my i minus one j comma minus one is my diagonal neighbor above me on this side. If that fellow is not lake then I have to count one who is p i minus one j fellow above my head. I am i j i minus one is the previous row j is the same column so the pixel above me same thing I will have to do this for each one of my eight neighbors no shortcut sorry he is suggesting introduce a variable k and l and run a loop k equal to k varies from minus one to one l varies from minus one to one. And then p of i plus k and j plus l is less than 200 then l n count plus plus so I will have one for statement another for statement and this is therefore one way of doing it. When I finished everything my l n count will determine whether I am I am that image or not let me go forward and implement what he is suggesting for example I will say in k l what will be the maximum value I will come to that. Suppose k and l is equal to 0 I am examining p i j that is myself although I have already said continue there is no point in examining it but if I introduce this then I do not have to examine whether I was right or not because I am also getting examine in the process if I am less than equal to 200 count will become one. It is unlikely that others are all white around me if I am non white then one of my neighbors is also non white otherwise the lake will have a hole ok. So therefore this is also ok if the count is l n count is non zero can I say I am on the boundary so here what is happening is if I maintain let us look back at my program here if I have already said that if this particular statement look at if p i j less than equal to 200 continue that means I will never come to this point if p i j was not lake I will never come to this point. So even if this statement is executed it will not do any harm because it will not add anything to my l n count. So my l n count will still be correct now all that I need to do is if l n count is greater than zero that means around me there is at least one fellow who is non lake that means I am on the boundary whatever statement you want to learn and of course so you will add one to the count count this time is not the count of pixels which are inside lake but the count of pixels which are on the boundary do you agree that this program will give me the total count of pixels on the boundary and therefore when I when I come out I will have the total count printed and inside if I wanted I could print the coordinates of each of the points on the boundary ok the next problem ok I will have to draw this again let's say this is my lake unfortunately in real life when you have a large water body there are also small water bodies around it so when you have a large lake like this there will be a small pond here there is a small pond here there is a pond here ok there are some people who have gone for camping let's say a group of your people have gone for camping and you have put up tents and all those tents are white tents as far as the satellite is concerned the poor fellow cannot distinguish between the roof of a white tent and the water body he is just looking at the reflection so you also get counted as lake this also gets counted as lake that is not the intention of the real life problem the real life problem says that there is a large water body which is lake now Mr. Remote Sensing Expert or Miss Remote Sensing Expert please understand that there may be small water bodies here and there please ignore them and give me the area and the contour of the largest portion can you now see the similarity between the problem of the mid-same exam which said that you have multiple white patches and you have to determine the area of the largest patch this is one of the physical problem reasons why such a requirement will arise in practice there could be many such things how will you solve this problem for any one area you know how to calculate for any one region you know how to calculate the area so I will just leave this hint and work it out maybe I will put up this solution on the web the solution is that as you scan the pixels row by row when you come to the first row where you find a pixel which is white which is on the lake then you stop there and you freeze that i, j for example now you determine all the pixels which form the boundary and the region surrounding this area which is the connected area the connected area may be only one pixel long isolated pixel the connected area may be 28 pixels some 2 pixels in the first row 3 in the next row 5 in the third row 3 in the second row but all connected no discontinue you can scan the subsequent rows and again examining the neighbors you can determine whether you have the connected area or not you are not examining anything else now there might be another water body here there might be another water body here you are not looking at you are looking only at the connected pixels by looking at the neighbors in the next row of the pixels which belong to the lake in the previous row you will determine whether they are connected or not and you can keep on doing that you have isolated this region in a separate area structure I store this region I continue my scan when I come here I have no more pixel in this region now I go back to this i, j where I was I had left and I start examining this row again is there any lake pixel no I again come here is there any lake pixel yes there is one however this is part of an area which I have already identified so I can ignore that I continue here I come to the next row I come to the next row I suddenly find out a pixel which belongs to another area now this is not part of the earlier area which I have got this is a new area I do exactly the same thing I freeze i, j at this point and I examine all neighbors till I cover this entire area please note that when I come here I may if I go forward I may find some other water body but I will not go forward because I am only looking at connected pixels the next pixel here will be black so it is it is not part of this so I will find out all the connected area like this and I would have got another area identified in another area now I go back to this i, j and I again start scanning again so do I find anything here when I go to the next row I will find some pixel here but I will know that it is part of already scanned area that means while examining every pixel I have to determine two things a whether it is lake and b whether it is part of already scanned lake if it is already scanned lake I ignore it if it is a new lake like for example here I will find this even if there are twenty such areas fifty such areas hundred such areas I can put them into different hundred matrices I can have either a three dimensional matrix or I can have a two dimensional matrix where I say start point end point or whatever now that problem is bit more tricky but that is the problem that you will have to solve for a real life scenario so I will put up that solution on the web in the context of this problem and it is exactly the same thing as the problem that was given in the mid-sem so you will know the answer thank you so much


for Arrested DevOps, the podcast that helps you achieve understanding, develop good practices, and optimize your team or organization for maximum DevOps awesomeness. We are coming to you live from DevOps Day Chicago. I'm your co-host, Matt Stratton, and with me is Trevor Hess. Before we get started talking to our great panel, we have a word from our sponsors. You'll have to listen to the show later to find out what the sponsors are. Sponsors go here. Sponsors go here. So again, we are here at DevOps Day Chicago 2019. Live! Live. The sixth time we've had this event. And we've got a great panel of different speakers who have spoken at the event and had different experiences at DevOps Day. So first, starting to my left, just maybe introduce yourself for our audience. I'm Jesse Frizzle, currently self-employed. Veronica Hannes, I'm a contractor in Brooklyn, New York. Jeff Smith, director of production operations at Central, official black guy for DevOps Days. It's true! It's official, right? Everyone pauses and they're like, oh, he said that. Fair. What I'd like to do is maybe start, since you all spoke here at DevOps Days today, maybe for people who are listening to the show before the talks are online, maybe give a kind of a little overview of what you talked about in your presentation. And then we'll kind of get some feedback and talk about it. So I talked about open source firmware and roots of trust and why those are important. So I talked about, I gave an ignite talk and I talked about, very briefly, about developer use of comments and how attitudes for those comments affect growing developers and may affect their documentation styles later. And I talked about ethics and technology and computing and why it's difficult and hard. That's fantastic. If I'm not mistaken, when we were on the stage at the Holiday Inn last year for DevOps Days Chicago, you had an open space on ethics and computing. Yeah, I can't remember if I actually, this is the situation, I can't remember if I actually did that or not, like if I kicked it off, but I was definitely present and it was definitely something that informed this talk because a bunch of us had conversations afterwards and said like this is a conversation that needs to continue. And we had similar results today in that open space, a conversation that needs to continue to happen and grow. So one thing, I'd like to kind of have a little bit of a chat about because we have different experiences with DevOps Days and with DevOps Days Chicago in general. So kind of looking down this, so Jeff, this is the fifth time you've been at, speaking at and been part of DevOps Days Chicago. Jesse, I know this is your first time at DevOps Days Chicago but you've been to several DevOps Days. Veronica, this is your first DevOps Days ever. So maybe kind of starting with Veronica, what are some of your impressions you've had, some of your thoughts about the DevOps Days experience so far? Sure thing. So coming, I'm coming from New York City and this is my first DevOps Days so I'm very much like what do you expect? How does it work? And how does public transit work when you're not in New York City anyway? And all those little things that you worry about when you're traveling and one thing that's been really phenomenal is how much support the team has given. I tweeted earlier, shortly after I was accepted, they literally asked the speakers, would they like a special song when they go on to the stage? And I was like, I love this group more than anything else in the world because not only are they like, we're going to help you figure out transportation, we're going to make this party easy and that party easy and you have all the support and you're going to eat the best food you've ever eaten at a conference. But in addition to all of that, we're going to make you feel really amazing when you walk onto the stage. Like, how about that? So that is kind of the first impression I have in like being here so far. Nothing has surprised me, like nothing has gone against that first impression. So like, hurrah, hurrah organizers. I see all the moving parts moving like extremely smoothly. Jeff, what have you seen over the years that you've been here? How does the event feel different? Does it feel the same? Like, what do you see? In a lot of ways it feels the same, in a lot of ways it's different. You definitely see the event grow, right? And you see the process get smoother, audio video, funny I'm saying that now, but audio video has gotten a lot smoother. But the community just continues to grow. It's absolutely one of my favorite times of the year. And even if I'm not speaking, I would definitely be attending DevOps Day Chicago. It really is sort of, for me, it's like the bar in which I judge all of the other conferences because it's always such a tremendous experience. You know, the participants are great. The open spaces are fantastic. And there's just an energy here that for me is unmatched in a lot of conferences. And Jesse, you've been to some other DevOps days and I noticed your first time here in Chicago. Like, what did you, from what you participated in so far in giving your talk, what are some of your initial feels?  But yeah, also just like the varied audience background. So people who come from different fields, because I was talking to someone who does like data science and then one that's like a technical writer. And it's nice when conferences can draw different groups of people versus just like having like group thought or whatever. Fantastic. So I want to... I was going to say, so now that we're only about halfway through the event at this point, what have been some of your favorite conversations that we've had so far here this couple of days? So I think one thing that's been really exciting to me, a lot of the talks that I've heard have been really neat. So my background is not DevOps. I'm coming giving a talk that is interesting to a lot of folks, but it's like one of those varied conversations. And so kind of hearing talks where people are describing like situations that occur within DevOps, but like within the context of something a human would experience. We had talks that involved like, things going viral online and people getting tickets because like signs are difficult and what's that even anyway. And so one of my favorite conversations has been like when we were in open spaces and talking about what makes an interesting, what's like one hook you could have if you're working on your own talk submission is talking about ways you can bring in that the technical with like the lived experience portions. I think there was a really interesting parallel between Jeff's talk and Jesse's talk in different ways though. So my first question is did anybody but me, because Jesse's talk was in the afternoon during, obviously so I just want to get some context. Yeah, either of the three of you see Jesse's talk. Yes. Okay, fair.  And I think we're like kind of the thought around those ethics also comes in, right, is that it's like just because it seemed like a good idea to put a web server in there, right, because what could go wrong is how can the, you know, always think about how can these things be misused, right. And I'm interested to kind of see like where you see those parallels. Yeah, it's definitely something that happens, right. And when you see technology sort of misapplied and we sort of do it ourselves in the operation space and the engineering space where we might choose a technology for the wrong purposes because we want to play around with it or we think it's interesting, not thinking about all of the downstream implications of it, right. Like I think of the Zoom breach recently where they thought it was a great idea like oh we're going to install a local web server and automatically reinstall the software. And somewhere, I'm sure someone wasn't thinking of that as being malicious, they were thinking this is going to make it so much easier for me to be able to accomplish X. So it becomes difficult to think about all of the different paths that technology can take us down and the sort of consequences that come from it. So I think the only thing that we can really do around that is to have more conversations around it, to bring in more viewpoints, more discussions, you know.  So it's about, you know, sort of opening up the conversation, broadening the perspectives and, you know, trying to think one step beyond what am I trying to get done right now and think about the long term implications. Well, Matt even started with the question of what could go wrong with putting a web server in the sub layers of the system but why don't we ask the question what could go right? Or actually do ask the question what could go wrong, because that was the sort of thing I was thinking rhetorically, but yeah, actually say what could go wrong. Seriously ask what could go wrong not just facetiously ask what could go wrong. It's funny, I was looking at some permissions for someone in AWS and I look at their their policy and the SID for the IAM profile is what could go wrong? Allow, star, star. Well, at least that's like being self aware. I think like a lot of it is also a lot of employees are very process oriented, so if it's not a part of your process to like think or even ask that question what could go wrong. You just do A, B, C, D and then you finish your task. And sometimes I'm just like at what point were you like thinking or, you know, like wondering what could actually go wrong. What do you think what do you think kind of drives that you know, taking the box is going through the motions kind of thing because I think again we're not really that most people are wanting to do good work, you know, but there's something within the organization there's something that's caused this to be the I'm just sort of taking you know, going through the motions. I think sometimes that's a matter of like psychological safety with an organization because I've certainly been in positions where it would be extremely difficult to push process and to say why don't we X and there also been situations where people have been very open to that and the the amount of like we talk about innovation a lot in tech and like the amount of innovation you can do in an environment where it's like okay to say why is it like this and to take more time and to do research is, you know, that their night and day and also I think like what people feel comfortable asking for and doing is really like guides how much you know puts us in a position where it might it might feel best to check those boxes and to be like well there's might be well I mean if we tie it back to what Jeff was saying this morning about potentially the idea of some sort of ethical body around technology I think one of the reasons why we make those split-second decisions to do something potentially unsafe is because we have some pressure saying we need to get something accomplished or something finished but we don't often have the moral pressure to challenge just getting something done right you may do something that you know like setting all stars on an access policy right you may need to do that just to get your task done but you don't have the authority maybe or the moral authority to say this is wrong and is going to cause us a big problem and sometimes it's also like organizational standards and culture because you think of a world where those things aren't allowed I remember 10 years ago I was at a job and the idea of putting a password in a config file wasn't that crazy but then you go to a job and someone's like what's wrong with you why would you do that suddenly you're like oh that's not acceptable here and eventually that just keeps moving up and up and the pipeline gets more and more sophisticated but you know I'm curious I would just imagine like does anyone at Google submit a new function without unit testing right they probably get laughed out the door I hope definitely culture like if your culture is like make money even if it comes from the expense of exploiting your own customers and no one ever gets ramifications for doing that then that's like the culture that you said back when I was in a research setting you know in a research center where we weren't putting anything on the cloud yet because like we don't trust the cloud and especially like as a as a large government research center we definitely don't and so things would be stored and hopefully duplicated but if not if something crashed we lost data and that was you know there was definitely you know you lose data you grieve a little you get your head down and create it again and it's like you know that was part of almost an expected process like oh that happened it happens sometimes and now when I think about that it just sounds bizarre to me that we put ourselves in that situation I want to go back to Veronica when you're talking about a lot of this coming from people whether or not being in a place of psychological safety and so we like to speak in practicalities on the show every now and again so this might be a good time especially given kind of the balance of this panel so Jeff you're a management type person I mean that you know in a nice way so mature leader you lead teams and so first I want to think from the perspective of if you're someone saying I want to build more psychological safety on the team that I lead what are some things you do or some things that you do you know I believe you are vulnerability I think that's probably the biggest thing you can do is show vulnerability not being afraid to say I don't know one of the big things that we have on my team is you know I don't know is an okay answer it's just not the end of the conversation right you have to you have to figure things out but giving people that sort of room in that space to be able to learn to be able to explore another thing I like to do is push education as part of your job there's no reason I mean you're already on call why should you have to learn this new technology for my company's benefit on your own time spend time at work learning this thing because it is part of your job I don't expect you to just know it so if you've got to take you know an hour or two hours a week to just go sit in the kitchen and read that's fine I want to make sure that you feel comfortable doing that so you know between those things I think people begin to get comfortable I think when people also want to dissent on an opinion creating that safe space so that we can have a dialogue and talk about it because that's probably one of the biggest areas where people bottle up where they don't feel comfortable disagreeing so they kind of go along with something that they know is wrong or that they feel strongly against creating an atmosphere where people can disagree in a constructive manner and know that at the end of the day you know we're still a team and we're going to be able to figure this thing out I think that's strong and I think it's a testament when the teams disagree but at the end we come to a resolution and everyone is still all in. One more to say about the education piece one thing that I've noticed is you know I've been in work environments that were very helpful in this regard and you know could be very unhelpful as well and the and the major difference was you know having that time to be able to learn and like when things did go wrong you know in my research life one time we had like a piece of machinery that had a problem that no one realized for a month and there was a lot of like backtracking that needed to happen but we went through it in like what I think we would call a like blameless way and it was it was an educational experience for everybody like we said okay and we all knew how that machine worked inside and out at the end why because we had something go very wrong cost us time and we had to like trace back and like those those two pieces being able to like sit in the kitchen and get better at your job while at your job instead of having it have some be something that's burning you out in the evenings and having a situation where when something goes wrong it's less about you know the person who made the commit and more about like learning about the process better because that's obviously something the team needs to do have like been immeasurable been both feels that that I've worked in actually so I think what are maybe some again like thinking you know we kind of talked about like things that leadership can do maybe what are sometimes we're in a position where we're not able to we're not leading the team we're an individual contributor and we might be in a position where we don't feel that level of psychological safety what might be some things that we could to help influence leadership to help influence the team based on your experiences hopefully positive ones somewhere or not I would say in most cases where I was in situations like that I tend to have a lot of candor with leadership and that can go one of two ways depending on who the person is so I myself like if someone came to me and did what I do to other people I would be like super happy to know exactly what they felt but some people do not like knowing exactly how people feel so yeah it really depends I just want to work with you I think it's also important to think about leadership as a role not necessary as a position because I've been on teams where I wasn't the manager but I was definitely the leader of the team you know I don't remember what author said but if you walk into a group of people you can instantly pick out who the leader is regardless of their position so I think it's important to recognize that if you are the leader the emotional leader of the team that there is a bit of psychological safety cover you can provide for the rest of the team and you can be that person to engage with your manager and say like hey listen you know XYZ isn't working out for us maybe we can try something different maybe it's you that solicits the extra everything has sort of fallen flat you kind of know that like alright I know Max is stewing about this thing because he hates no JS so why don't I give Max an opportunity to sort of talk about it so just sort of creating those environments where one it's clear that you've got that person's back but then also set them up to be able to respectfully disagree I think as well like when you think of one of the things there's a lot of definitions around teams that have high level of psychological safety as an example is there's an equal amount of conversation everybody speaks the equal amount and that's easier said than done and if you're not in that again if you're not the manager I think about to like back here a couple years ago we had Otto and Simmons gave a great talk about lending privilege so if you are in that team and you have privilege you have a responsibility to help drive the you know what it's really easy for me to talk a lot surprise surprise everybody who's been at the event all day right but think about ways that I can use that ability that I feel safe doing that all day long to help people who are not necessarily in that position right now I think that's a huge point because you know when I first started in technology I was really taking any job that anyone would give me and as I became more experienced and became more confident now I feel confident you know putting stuff on the line and saying like you know what no this is a really bad idea and I don't mind calling you out on that so you're right lending that privilege to be able to you know perhaps shield someone and say like hey you know max has got a really good point and we need to talk more about this that can be huge for someone because if I get laid off or fired tomorrow I feel confident that I'll be able to get another job someone else may not be that confident in their position and being able to lend that privilege is huge for them because it gives them an opportunity to you know speak up I completely agree like starting out my career I wasn't necessarily the person who could like be kind of aggressive and get away with it but now I have like so found myself in such a position that yeah like I will do that whenever needs be because especially like having known the other side of it when you can't speak up I always try to at least say something one thing that I wanted to say kind of jumping back a little bit is when you're you know approaching you know when you're when you're taking a position where you're like hey I'm going to approach my manager and say hey this isn't quite working one thing that I found really helpful is the whole like you know praise in private praise in public reprimand in private not the other way I see you've worked for some of the people I've worked for so you've got to get that right but you know going to that person and recognizing that like they may be feeling their own vulnerabilities as well we all have different paths into leadership and comforts in that role and that person may be you know with their face on trying to figure things out and like feeling just as vulnerable as you all are so like you know taking the time when that time is you know being vulnerable and trying to make that a smooth conversation can help a lot some of the worst workplaces I'd been in would involve you know like people just coming up you know kind of ambushing you in the hallway kind of situations and that you know it's it can be really stressful and kind of ruin your whole prospect on what your day is and like make you want to hide in the bathroom and we don't need that when it comes to lending privilege too it's not doesn't need to be in the moment like in front of that person either like bringing people up in conversation reminding people that the idea that came that you're all moving forward with was somebody's idea and talking about them in that light that lets them shine in the best way possible is another way and a very important way to lend that privilege so as we're starting to to get towards towards wrapping up I want to go back to your talks into the things that you talked about today and if you had one key message from the presentation you gave what would be that thing you want people to take away that we need to take a bit of responsibility for the things that we're creating and we need to own some of that some of those consequences so that these aren't things that are just happening in a vacuum so when there are bad actions happening we can't just pass the buck on that it's up to us to step up and say like hey something's wrong and maybe we're not currently as an industry in a position where people feel safe doing that but you know it's on us to figure out how to make that safe for people to do it because as technology gets more advanced the stakes are going to get higher and higher comments are a form of documentation and documentation is good and we should make sure that we're supporting people and doing the best documentation for them I would say the people who work on various layers of software should talk to each other more and in talking to each other also actively listen and then kind of try to come to a solution on the problems between the interfaces fantastic and one last thing I'd like to do and then before we kind of wrap up because I know we've got a panel who's doing all sorts of interesting and different things and we want to give you an opportunity to plug a thing you're doing whether it's your podcast whether it's I'm not going to tell you so we'll let you start Jeff I'm in the process of writing a book and maybe one day I'll finish it I don't know it's a tough slog but right now I'm working on a book tentatively called Real World DevOps and the idea is to give it from the perspective of an individual contributor to what they can do and sort of imperfect organizations I think there's a lot of great work out there for leaders that want to do sort of a top down approach but there's a lot of people out there that are struggling in environments where there's a lot of stuff that they can do and they just really need sort of a field guide on how to go about accomplishing that so that's sort of the target audience for my book do out 2020 sometimes plus or minus Hey Matt, how's that book you're writing? Which one? So hold on to your hats. This is my first time announcing this publicly um I met two fabulous other first time speakers when I went to and spoke for the first time this February and the three of us are starting the quick developer guides um YouTube channel and we're going to have 10 you know a series of 10 minute videos on like everything from like how do you get started using version control to like so you're thinking of quitting your job and doing this like I'm going to be a dev thing how are you going to budget for that so like a whole bunch of different skills that people will want to consider if they're getting started in this whole this whole world so yet again some new project is announced for the first time on Arrested DevOps the Michael Ducey and Ross Clanton's podcast was announced first here I believe Jesse you and Andrew started your podcast or talked about it on ADO so like you know breaking news but yeah what new rad thing do you want to plug and promote? well I'm currently unemployed so I guess I'll plug some books Soul of a New Machine and Ben Horwitz is the hard thing about hard things very good and if you're job searching you should tell us what role you're looking for I am not actively looking for a job obviously I have a hard time believing she's blue right I will say it's like every time like wherever I'm working and something happens and Jesse you know like yeah I know I mean not that I don't want to work out do you know who you're talking about she's not looking she's choosing right exactly we would know I'm glad to have another wrap up another Arrested DevOps podcast here at DevOps Day Chicago I want to thank our awesome panel for joining us really appreciate it and also as an organizer really appreciate all of you being part of our program I'm really excited so thank you let's give it up for our panel it's a live studio audience applause when we recorded this in Minneapolis I actually had like applause signs so at least I didn't do that to you so yeah you can check us out on the internet at ArrestedDevOps.com you can find us on iTunes at ArrestedDevOps.com slash iTunes leave us a review in the iTunes store that's the thing you can do we are now on iHeartRadio apparently so that's a thing if you like iHeartRadio and we're on Spotify so we're all the places you can find us and listen and your heart's content and with that being said as always thanks for watching we'll see you next time bye