Hello everyone and happy Friday. How's it going Isaac Ben and see Grover over on Discord and let's see Halati over on YouTube. Thanks for tuning in folks. Let me shuffle a couple of things around. It looks like I have sound at least into OBS so I think we're good. Let's see. How's it going Beata? Happy Friday. So let me turn off a couple of these previews and shuffle these windows around so I can see the chat. Take a drink of water. Alright and now we can get going. So hello everyone. My name is Tim and I go by FOMIGuy on GitHub and Discord. This is the CirclePython deep dive program. This program occurs every Friday at 2 p.m. Pacific or 4 p.m. Central Time which is the time zone that I'm in or 5 p.m. Eastern Time or you can find out whatever time zone it is for you by converting one of those times. In this program we are taking a deep dive into CirclePython. We are either usually looking at CirclePython libraries or coding projects or perhaps sometimes the core of CirclePython itself written in C code. So we are really getting into the kind of deep nitty gritty details of CirclePython on this program. This was a stream that was originally started up by Scott Shawcroft, the lead developer of CirclePython. He is away right now on paternity leave so I've been taking over and doing this stream for a little while and so that's what the stream is. If you are brand new to all of this though and you don't know what I'm going on about, let me take just a moment to introduce it for folks that might be new. CirclePython, this is basically an implementation of Python that runs on these tiny computers called micro controllers. This is the main website, CirclePython.org. You can go here to learn more if you're interested. We basically have a version of Python that runs on all of these tiny little computers. They come in all different shapes and sizes. They have all different kinds of things you can hook up to them, to do with them like sensors and buttons and beepers and lights and there's Cherry MX keys as well as RGB lights, knobs, screens. We do a lot with screens on my streams typically. You can save Python code to these devices and it will run for you. These just show up like a thumb drive essentially when you plug it into your computer. There's a Python code file on there. Open up that code file, edit your Python code and save it and it will automatically run on the device. That's kind of like high level what the project is about. It's an open source project. Anybody is allowed to help contribute. If you'd like to join the community, definitely head over and join us on Discord. That's a good place to go to get started. If you want to help with development, it all occurs out in the open, out on GitHub. You can join us over there. You can coordinate with us, chat in Discord. There's weekly meetings that occur every Monday inside the Discord channel. Those are a couple of different ways you can get involved. Like I did say though, it's an open source project. It's free to use. Everybody is allowed to contribute. Everybody is allowed to use CircuitPython on their devices. If you're a third party hardware manufacturer, you're allowed to port CircuitPython to make it run on your device for free. You don't have to pay anything in order to do that. CircuitPython as a project, though, is supported by this company Adafruit. They're a hardware and software company based out of New York. They're the company that is paying the team who works on CircuitPython. Some folks like Scott, Catney and Dan and Jeff are paid full time to work on the CircuitPython project and surrounding community and related things. Some other folks like me and a couple others are paid to work on the project part time. So thank you, of course, Adafruit for paying all of us to work on the project. And thank you to anyone watching if you want to help support the project by purchasing hardware from Adafruit. You can do that over at Adafruit.com. They sell all sorts of hardware, the microcontrollers themselves, all of the different kinds of sensors and doodads and add-ons and all those things that you can plug into your microcontroller to build interesting projects with. So thank you to them and thank you to anybody who does purchase hardware from them. Jumping into today's program, though, sounds great on YouTube. Thank you. I got here on time almost. Nice. Yeah, you're pretty much on time, I'd say. Thanks for tuning in, Harold. Let me catch up on a couple of the other chats here. Nas recently went end of life. Uh oh, thankfully, it was a long and productive life. Nice. Let's get at least eight years on a spinning disk. Happy, let's see, good midnight. How's it going, Axl Magnus? Thanks for tuning in, everybody.  That's not what we want. Nobody likes a ruined pie. This is a little fuzzy, isn't it? Let's see if we can sharpen that up just a tad. Jumping into today's program, though. What I'm going to work on is we're going to take a look at a that's a lot better there. We're going to take a look first at a utility made by community member C Grover, C de Grove Studios. So thank you to C Grover for making this and sharing it. This is a circuit Python palette filter and what this does for folks that were watching last week. I don't remember if it was on Friday or Saturday last week, it was one of my streams. For folks that were watching last week, though, this this idea spawned out of something that came up in one of last week's streams. We were talking about the idea of being able to sort of filter a palette by colors that are similar to the transparent color.  In circuit Python, the way that you would do that is part of your image will be a certain transparency color such as I like to use green because it makes me think of a green screen, you can actually use whatever color you want. I'll show you an example of this if we can find one of these. Do we have two things where is? Right, these ones are the papyrus ones. That's right. So in this example, I have a bitmap image where I have green, the green becomes my transparency color. So on the display I O palette object, there's a function called make transparent, I think it is. And you can pass it the index of the color that you want to represent transparency. And then to let display I O will essentially, you know, neglect to draw any pixels that are that color, it will just skip them. So whatever was drawn beneath there will show through it will be as if it was transparent like in a PNG. So this is a common thing we want to do with display I O is use this idea of the transparency color, where the hang up comes in, though, or what this discussion was spawned from was when you have a transparency color, but because of some of the manipulations of your bitmap, the edges get a little fuzzy sort of the edges get anti aliased, or is it aliased, I don't actually know the correct term, the edges get kind of fuzzy, and it makes it so there are multiple shades of your color. To show you this, I'll open this file in here inside of GIMP papyrus. It is the font the font on this one is, well, it's technically it's called parchment, but I believe it's supposed to be very close to papyrus. This was one that I found that seemed to have a permissive license. And as far as I can tell, it is a copy of papyrus. But I don't know for certain. I don't actually recognize it. And I can't say as though I actually did look at papyrus specifically as well. My PC doesn't have papyrus. I think it comes preloaded like in Windows and maybe Mac. I'm not sure. Mine didn't have it. So I got to try to find a download of it that I can take a look at to compare. Excuse me. Okay, so when we have an image like this, we're going to have a palette. The palette is all the colors that are utilized within the image. And what you see here is we have like several different shades of green because of the manipulations that occurred on this bitmap. If I zoom into these edges here, then you can kind of see where these are coming from, right? We have like all the way green out here. And then we have a little bit different green, a little bit different, darker, darker. You know, each of these are like kind of close to green, but not quite green. So this is a utility that's going to try to find all of these, you know, similar colors to your transparent colors so that you can hopefully set them all to be transparent without necessarily having to like alter your palette. Because like here, you know, you can see what I've done is I've scooted all the greens to the beginning of the palette. So basically the first, you know, 12ish, maybe 11 colors are different shades of green. So then in my circuit python code, I've gone and said, you know, four loops, zero to 11, set, you know, make transparent that index, you know, zero, then one, two, three, four, all the way up, right? So, you know, that's not bad, but it's some manual work to come in here and go to your palette and, you know, drag these things around to get them all at the beginning or at the end or however you want to do it. Wouldn't it be nice if we had some kind of utility to help us do that and Cedar Grove has stepped up and said, yes, it would be nice and here it is. So that is what I'm going to play with first. Let me take a quick look at this. Okay. And of course I intend to use this most immediately on this flip clock, which I've got running on the device there that you saw. But obviously this is like, you know, a much more dynamically useful thing, right? Like this, there's lots of different uses for this thing within display IO. You could use it for lots of different reasons and it makes this idea of kind of like cutting out these colors much easier to do. So I'll clone it to start with, here's the link. I'll drop it in the chat if anybody is interested. I mean, you can obviously see the URL there as well, but if anyone else is interested in taking a look at the library that I will be tinkering with here and I'll close this thing. It takes up so much space here. Let's, there we go. I'll just clone it and then we'll start, take a look at the examples that are in there and just start tinkering away. And eventually we could try to work this into the flip clock. I don't know exactly if I'll do all of that at once. I do also want to try to work on the MPY file size thing, but I want to take a look at this first and foremost and then we'll see kind of where we go from there. Let's see, this is actually something different. Sorry about that. Let's go close that. How's it going to Shippu? Thanks for tuning in on this. I'll open it up in here. Let me open up one of the other ones first. Let's see if it's C for circuit Python I think. No pilot filter rather. This is always wanting to like change environments now. How's it going DJ Devon? So I will copy this over to my device as well and take a look at the code. Oh nice. There's a box PDF in here. Replacing color index values, target color along with the tolerance parameter. So you give it the color you want to target. You know in my case that would be the green which is like solid green. 255 green, 00 for red and blue. And then you give it a tolerance and it will kind of find all the things that are close to that tolerance. Well to that color and then you know far away enough based on your tolerance. Creates a new palette. Nice. Nice and I will say this bit's most likely over my head. The actual algorithms involved here. I'll pull this up though because I'm always interested in taking a peek at the kind of essence underneath a functionality. Color distance. Okay color difference. So this does this idea Euclidean distance. Sequels. Like we've had a bunch of different versions of this throughout the years. Got better and better probably and also has like different screens and different printing capabilities and all that stuff came along. I'm sure we can like more reliably represent more colors so it would make sense we got to get better and better being able to tell them apart. Let's see. Start with the examples that are in it and then we'll play with it some separately as well. This one is going to make a source. Colors does it. It looks like okay this one okay so simple test this one will just have the palette and then change it. There's no actual bitmap in this. Let's go to code. Let me do code as let's go papyrus flip clock. It's really flip digit I guess it's only one digit. I have flip digits with crossbars now too. I was working on that last night. I didn't stream it but I was working on that but I have not tested them out on the device yet. I haven't taken a look at them. Just generated the spreadsheets and worked on the generator script. Maybe we'll do that later on as well. Although I am like I said earlier I'm also interested in getting into the MPY file size thing I worked on a couple weeks back. We got some new new feedback to work on for that. I'm definitely interested in getting that project moving forward. So code pie here we can we already copy pasted something else so we'll go back and grab this. Oops oops oops. Authors. There we go. I had put something else in there. Did I change the font? I did yeah well it's called parchment technically but I think it's a copy of papyrus. I need to look a little bit further into it to make sure that's the case. That's what I that's my understanding so far. I did change it to that parchment which and the reason I chose parchment is because I found a copy of it with a license so if we want to put it in the repo then we need to have the license to it. Although it occurred to me after the fact that images I don't think we would need the font license for. So maybe I just won't maybe I will use pyrus but then just not put the the font itself in the repo because I think it's not I don't know that it's like open source or whatever. I mean it's easy to find but I don't. It's licensed for doesn't seem to be licensed for open source. So this one's mostly just gonna print and we'll need to be connected to the serial console in order to see it so it's it's one let's just take a step through the code here it's going to set up this palette the target color is 080808 which is must be some sort of grayish right I guess so this one's here and then okay these are all like one two three four five six seven eight nine okay and then they're all the same pattern. Okay so they're basically shades of gray and then it's got target color is eight fill color is none tolerance is set to four create a palette from the source colors so this is a list we make a palette we loop over the source colors we add them to the palette this is basically just making the palette wouldn't it be cool maybe this would be something we should do one day is a constructor for palette that takes a list then you could not need all this code at the application layer it could just be display a palette and then source colors you pass it in and it just creates it for you that'd be pretty sweet that would be a I think a change in the core but it would be easy enough I think it wouldn't be too bad probably I don't know I don't know that I if I worked with lists inside the core I think so maybe as tuples I don't remember for sure set the source set the source palette to make transparent and then it's in this case it's going make transparent three zero one two so that's this one you can see at the palette filter so you go source palette target color fill color tolerance it has print target color source color well source palette header row loop print these things index color and then is it transparent or not is transparent is this on palette I didn't know there wasn't is transparent it's pretty useful is that one palette must be right let's get my signature I also use papyrus uh for my name on the back of a pcb nice we'll have to see uh one yeah one list constructor make palette or or yeah it could be make palette I guess to instead of the uh if there's some reason it shouldn't be a constructor I've seen somewhere there's like functions that are like make thing or whatever inheritable oh inheritable so you could extend it how's it going arjun over on youtube thanks for tuning in it's not enough so there we go color converter well color converter is similar the palette should be a class also right it's going to be down lower it's transparent yeah I didn't know that had that interesting nice it's a good one to file away uh and then new palette so it's going to create the new palette for you uh we'll make it accessible on here yeah okay so palette filter palette and then it will print so it'll show us which ones are transparent in the after essentially so let's let it run and so this one was transparent initially and then here we end up uh true true true and it's the last three but that is because source I'm fine have a great day thanks yeah I appreciate it um so target here is targeting which one to make transparent in the output of this and then tolerance would affect the number so if we go I don't know if it goes up or down probably I guess if we make the tolerance bigger then that means more things could be made transparent so if we got a bigger a bigger tolerance we could eventually probably get it to do this one transparent also let's make sure to actually understand that though so if we tried six I don't see what the scale needs to be like oh yeah there we go nice okay okay sweet yeah that's pretty straightforward you just give it your target color it figures it out for you let's try this one graphics test zero for single color oh okay nice so you can you could still target it down to a single okay zero and then oh you know what let me switch back to this real fast I want to try a few more things if this is out of order does it uh so like if this was here okay nice so this basically this makes it so that you don't have to rearrange your palette which is awesome this means your palette can be all scrambled as long as you know your one target color so I guess I'll say your target your your palette can be scrambled if it were me I'd still probably move my green my one base green I probably move it to zero index zero but the rest of the palette can be scrambled you can tell it that green index and then it will find all the ones you know similar enough close enough based on your tolerance graphics test was designed for pi portal we can tweak it around if we need to yeah I can if I need different graphics or anything uh we can get it tweaked I think and I I have a pi portal here as well actually so if we need to switch over we can ultimately do it like uh flying lars let's copy that is it super big let's see oops is uh 320 by 201 let's see we could scale it down some or we could just try it 320 I don't remember what the size is let's see what it does this is like 240 by something let's take a look through this one it's gonna this one has got the image file uh couple of display parameters brightness for the display rotation background color none scale one okay image file target color as green fill color none tolerance invert what does fill color do we'll have to try that a little bit invert false tolerance one instantiate the display built-in display set the brightness at the rotation create a group for primary layer show it on the display create a rectangle that vector IO or shapes let's see shapes okay create a rectangle with shapes x y width height fill background color that's going to be fill none I guess on that one background color put that behind everything put the palette while image load bitmap source palette from this image file here I'll grid for it add it to the group that's showing create a label next text has target anchor point anchor position this one may end up off the screen for us we can tweak it to move it somewhere else or I'll probably just grab the pipe or actually it's right here as well target block smaller rectangle 30 by 30 fill it with the target color add that to the group add the label to the group fill label position fill color is none okay just set this transparent label if if fill color is none another 30 by 30 tolerance level label so we can print the tolerance this one has the word tolerance this one it looks like we'll get the value invert false add them all to the group there's our palette filter source palette target color fill color tolerance invert and then uh 765 frames count by twos so half that so then just change the tolerance each time so as the tolerance changes we get to see uh you know each time how close it is right we get to get a sense for like how close are those colors at that tolerance level so when we see it we'll be able to do that you could replace range uh let's see you can also replace range of colors with uh and another color paint range of colors with another color it's a range of colors oh like replace like you could replace them all with uh like you could replace them all with the target color or something like that so you could find like all of the near greens and change them to absolute green is that what you mean I'm not sure if I follow okay I will just load it on the pipeline because I do have one right here but which one is this is this standard no okay yeah this is mini about time for a desk cleanup it's probably past time for a desk cleanup if we're honest yes right right okay interesting that's a cool way to do it as well so you I see so you paint you mean paint like paint bucket fill basically because it essentially gives you that effect you could fill a region of near colors with a new color interesting all right let's grab the library again this one that on this device which is now the the pie portal oh but I didn't unplug the feather actually let me unplug the feather oh but now the pie portal is going to be circuit pie one here let me unplug invert we'll create masks of the non background create masks of the non background masks of the non background I'm not sure I follow that either but we could I'll try it out with true false I think that will probably make it easier for me to understand is this what is running here does this print anything oh okay oh I see it doesn't have the actual speaker hooked up I don't think I don't think well I mean we might as well I don't know if it's a simple test or if it was modified so it should fail the first time because I didn't copy the image I didn't copy the library either oh this one probably shouldn't be inside lib actually though let's put this out here cut paste it let it restart paste it pasted like gray ish why grayer than the rest of these like ever so light ever so slightly a darker color okay okay here we go I don't know what the colors are but it did run okay so we've got our photo of lars it's changing the tolerance down here and it's cycling through tolerances just counting by two which is giving us the ability to kind of see like once lars is pretty much cut out all the way then like that's probably the tolerance about where we'd want to use somewhere right around 350 ish I think it was so let's play with it a little bit manually let's just go pass on that one then let's go this one's a much broader range whoop uh oh we don't need this this one's a much broader range than the previous one the previous one we had a low tolerance like only four I bumped it up to six and then this one we're in the hundreds I think I saw it around 350 maybe 340 whoops wait I wonder did I actually set it maybe it's not actually so well yeah no we need to set this yeah okay let's do let's do this one here let me put that back also I'm gonna try it lower again update the tower grid to use this palette yeah okay so we got little bits of it taken out at 200 and then closer to around 300 we'll have more it's darn close there the only parts left at 300 are the shadow they're definitely gonna be the hardest bits for it to understand because they're the most you know the most different from the actual green that one's pretty good there's still a little bit under there lining up with about what I thought I saw I'm just trying to get a feel for like the different different values here we got some extra bits down there taken care of with that 10 I didn't update the I didn't update the tolerance on the label we could do that let's go for complete mistake tolerance value dot text tolerance into object has no find find what does find do on string is that a thing let's turn down find didn't know about that either so we're so close there okay let's try this with one of these also actually let's try this with one of these that is I still have one of these that is not rearranged it did right I mean I could run it again well actually I guess this one would be whoops oh this one has the crossbar in it too actually nice okay yeah that one's jumbled up it does look like zero is like pure green that's what it looks like to me at least the other thing that might be interesting is like I wonder if you target something in the middle like or if I targeted that one like that one maybe I could have a lower tolerance I'm not sure with the tolerance it's probably the same either way is it well no I mean if you pick the center of the range that you're interested in and you should be able to have smaller tolerance yeah that's probably the best way to go right is target the one in the middle so so so like the range of colors is like the brightest you know most vivid version of that color and then like the dullest is the one on the other end of the spectrum and that's the range you're interested in if the one you target is in the middle then your tolerance only has to get you halfway on each side but if the one you target is the most brightest or the dullest then your tolerance has to get you the full range am I thinking about that the right way maybe that's not actually how the math works out okay let's do give this one a try though so this this one's got it all jumbled up although this is probably too big isn't it yeah I don't think this loads let's generate a smaller one like 32 well like the this one is a 100 tall I think so see where we went down by 20 oh also though I want animation frames five they're way wider than they need to be they're actually like really wide oh oh the height was 100 not the width the width was uh the width was only 48 that's a little bit more reasonable we could uh we could tap the font size up a bit I think I know we don't like this these details don't matter for our test of the palette thing but I'm also working on creating the sprite sheet here as well to have one just to share for this library so might as well take a minute and get them lined up how we want being truthfully well the zero it's okay that's probably getting pretty getting close to about as big as we can do it we don't have too much more width for the zero I think else honestly maybe a tiny bit but what is static looking like horizontal bar is on the four but unfortunately it's a little too big isn't it was that by offset in a line color I don't think I did have a centerline size argument yet have it as a variable here or isn't it coming out to four pixels though play a half size coming out to three pixels oh okay because we we start it we basically go minus one for one side plus one for the other side I don't know what it will do if we put it on one will it actually be smaller to actually make it smaller with that math no that's smaller yeah okay one thing I noticed about this font papyrus or parchment is that it's a little bit weighted towards is it top or bottom anyway I introduced a Y offset here which allows you to move it a bit because it was kind of not quite centered initially so I figured this would be nice like some fonts might be further down towards the bottom or some fonts might be further up towards the top and you might want to like nudge it up or down by a couple pixels in either direction in order to get it to be how you want your flips to look um so I do think we want a little bit further back up I think right is this going which way does this actually go yeah okay 65k okay so we've got we've got full green at zero I'll get like a halfway ish nearby and we'll try targeting those as well I don't know if it'll actually have room so see if it's this or I guess we have plenty of room right it's got like eight megs yeah the room is actually not the problem the ram it was the problem not the room class calculates the differential so picking the center shade might help but not so not not significantly okay I'm gonna go top animation is it sheet top animation sheet I think so target color oh yeah actually you don't your target color doesn't necessarily have to be the zero index either nice though this one is taller right it's running off the bottom down there that's fine could maybe rotate it might fit but it doesn't matter too much truthfully and I wonder what the tolerance is like on this one maybe we should we put it back through the hundred is almost there not quite let's let it go back through it's uh this thing here put these back off do these oops oh why did that not oh I don't want this one still well that makes sense actually because the overwhelming majority of ours is straight green right we only have those couple of pixels around the edge that does make sense actually yes I think that's probably good 200 pull over 200 actually I'm gonna look at it straight on curious what let's see what the effect of I mean the second there is how do we out this oh there's a sort inside here and okay we don't have a great way to target the uh or to figure out what the second one is so I'll find like a middle ish maybe uh maybe one of these okay so then if we go with that one we can have smaller tolerance that looks like sweet spot between there maybe there's not quite a zone maybe there's not a good zone with this one okay it cuts both actually so the target one maybe that's too dark try this one that was right above it I think a little brighter that's a pretty good cut set go five to cut the gray if we go higher quite let's look at the let's look at the loop again on this one round 130 it takes out the bulk of the background but there is still a little bit maybe like one row of pixels there we cut that we're around 230 240 that's about like the hot zone kind of which was about the same yeah so it's about the same maybe it can I mean 210 gets us most of the way there so we can go a little bit lower but not that much like Seagrover was saying not significantly definitely one one gross sweet so this gives us a way if we want to do less work with our transparency less manual work of manipulating the palettes by hand which is awesome because I spend a fair amount of time going back and like reorganizing palette colors in order to make them transparent inside Circle Python so this is awesome thank you for making this and sharing it Seagrover I definitely will want to add this as an option inside the flip digit to where the user could well it kind of can just it'll work alongside the flip digit truthfully because the way that I set it up is the palette gets generated aside the palette gets generated at the user code level rather than inside so you could use this in conjunction and actually this library doesn't have to change flip digit will work as is because you initialize your images which means you get your palettes as well you make them transparent however you want and then you pass them in and then internally the bits that it does are the fader to go brighter and darker but the actual transparency is handled outside nice if there's no uh if there's no stage of green that you want to preserve then the target color is not critical oh okay I see if you wanted to keep some greens then going further away from it helps you keep them I see interesting okay that does make sense so then the green just targeting the base color like this probably makes the most sense and looks pretty good too I think these edges actually look better this one the right edges there nice it was 250 just 250 do anything else I don't remember what we had when we were like this it was 250 okay this is awesome try the fill color and invert yeah thank you I should do that let's go we'll set them up here right invert so let's try invert false well it was just on false let's try invert true okay I see keep everything except okay nice so you can do positive or negative basically that's really cool as well actually yeah basically that means it works for it works for both ways whether you're trying to cut out your transparency or whether you're trying well I said whether you're trying to cut out your transparency but it's really like whether you're trying to cut out your color or keep your color you can do it either way I see then fill colors so let's try like blue or let's try um pink capitals to match these ones but then this will replace it yeah so it is it's like bucket fill kind of like paint paint drop fill sort of you can and then it has a square here but my pink is already on top of it actually yeah this is this is really cool actually this kind of really gives us a lot of a lot of flexibility that we didn't have with display before or I should say it's not that it's not that it's flexibility we didn't have it's that it was manual you would have had to like manually set up your palette figure out your indexes and set everything this is giving you a nice quick easy to use api that is not manual at all you can just take your image whatever it is throw it on the screen try out a couple of tolerances find the one that looks best and boom you're done you don't have to worry about any kind of like palette manipulation at all you don't need to order it you don't need to shuffle it to put your transparency at the beginning you don't even need to know anything about the palette honestly because you don't target it by index you target it by color so like you don't you honestly you don't need anything you don't need to know anything about the palette and the palette doesn't need to be in any way specially prepared other than like you have to will have had a transparent color in it but like no other manipulation it simply needs to exist which is awesome that is really cool is there there's not a rotate is there what's the easiest way to rotate this there's not one let's see it's like roto zoom i think is probably the easiest and only oh well i could well i could rotate the display does that help us yeah maybe let's try rotating the display touchscreen color picker cursor oh interesting so you can so the user of the application could select the color more so than the like developer of the application interesting you can still see part of the repel behind here surprised by that i think maybe the size is different i think the size is making it weird now something with the rotation made it weird it's like it's still had part of the old rotation on it huh it's probably just because it didn't redraw the whole thing nice okay yeah this is amazing big thanks to see grover in the chat this i think really does like i said it was it's going to give us a lot it just makes it makes dealing with transparency inside your bitmap so much easier not having to manually move all of these uh palette indexes around and worry about all that stuff it makes it a lot more like i mean it's one step closer to p and g basically where it just supports transparency natively obviously we're not there yet but it makes it makes it feel more like that um even closer to that than what we have today so that is awesome thank you again for creating this and sharing it uh if anybody's interested in playing around with it i did drop that link in the github before eventually i think it will end up in the community library bundle potentially not there yet but it's up on github right so you can still play around with it if anybody wants to um and yeah i will set up some of the examples in the flip clock repo to use that instead of what i have today which is i think like range i did range zero to 11 for my transparent indexes but that's like 11 is just a magic number right i just had to look at the palette and find that and also rearrange the palette so that all 11 were at the beginning i don't know why i just put that in there i'm actually i gotta run and fill up my water i am super thirsty this evening for whatever reason so i'm gonna fill up my water real fast and then i'll be right back and we'll dive into some impui file size stuff so vrb yeah oh nice hand drawn silk screen fonts catany font okay there we go okay next thing i will get into is impui size stuff so this is something i started a little couple of weeks back let's go to cookie cutter cookie cutter this pr this pr is has the work that has been done so far basically for folks that don't know and and there are a couple streams that cover this a few weeks back so if anyone's interested in this stuff um and didn't catch those and want more of the background filled in you can catch those vods on youtube um and you can see when we were working on this before um this is basically a thing that will let a github action print a comment on a pr with the size of the impui file for that branch and specifically it will compare it to the current size of that library that way we can have a quantitative thing that says you know like if we emerge these changes then the size of the impui file goes from you know whatever 1.2 k to you know 1.4 k or whatever right like we'll be able to see those things print it out as a comment on the pr and it will happen automatically from the actions the specific thing that i am working on oh nice just one of the catney boards itc potentiometer i got one of those do i know mine's a yeah i do i have the oh no mine's a roadie rotary encoder not a not a um not a potentiometer rotary encoder i have i don't think i do i don't think it does say catney on there either unfortunately um so the specific thing to work on is the way it's getting the current size so i said it compares the new size or the changed size with the current size well the current size the way it's calculating it is not what we want so we talked about this a bit in the meeting last last week in the in the weeds i think it was so if anybody is also interested in more of that context i would encourage you to go back you can find the old meetings on youtube as well the meeting during in the weeds we talked about this a bit and jeff raised the idea of the way we're getting the current size is um by using the bundle which let's dive into the code a bit because it has size tools let's go here it's going to be a cool dev ops yeah data point in py size yeah totally agree totally agree eventually i hope to get to a point where we're importing on a device as well and maybe getting ram i think that would be super cool but one step at a time you've got to walk before we can run inside of here size tools it download latest bundle so this would be what it's using it's getting the current size from the latest bundle published version so it says download latest bundle download the latest bundle change directories inside of it so this must download it and unzip it then change directories to go inside of it change directories to go inside a lib create a variable because we need to handle single file npy files versus multiple file ones so if it so we make a variable for the single file we check if that file exists if it does we get the stats from it so we're just downloading the bundle trying to find this file if it exists we get the stats from it if it doesn't exist then we assume it's not a single file it's going to be a multi file and so in that case it is going to get the package name it's going to cd into the package name directory and then it's going to get sizes from directory dot slash which will add up all the sizes of all the files inside that directory and so the key thing right now is that this is downloading the bundle this says download latest bundle so that's where these are coming from these ones that it's comparing to we want to do something else instead of download the latest bundle we want to clone or check out the main branch build it as an npy files and then compare against that rather than whatever's in the bundle and so we think about it so right now the build of this branch comes from other actions see because we're using this so this is the bit working on checking the size for the current version the version that's been well not current i should say the changed version the version that's in the pr and it's actually just finding some built npy files that already exist they already exist because there's another action that created it firefox switch tab not deallocate i think i would like to see is having ci upload uh bin sizes onto a database with a board id and a get hash bin sizes on into a database the bin sizes of the um the builds inside the core repo you mean or do you mean library binary sizes and so one thing is there's kind of a lot of steps to building the current one so this is going to check out the current repo this is what builds it and so we'll actually need to do our well we'll we'll either need to add another step that builds the main branch or we'll need to do that inside of our stuff i think i lean towards trying to do it inside but it's also partially that i'm just less familiar with github actions because i did one thing i don't see is how does it know which branch it's checking out out current repo actions check out is this is this like is it built in to just know what branch can you tell it a different branch and can you give it like a directory or something because the thing is like if we check out like we if i check out main then it's gonna like change everything to be main i don't really i don't really want to have to change back and forth and i also don't want to break any of the other actions that are assuming that could be assuming the branch that it's on only a single commit is fetched by default for the hash that triggered the workflow set fetch step zero to fetch all history for all branches and tags doesn't look like you well this one okay this one does have a repository and then branch i guess can you give it a location can i like clone it relative path okay that's getting closer i think so this one basically is okay so let's see where did i i was trying these somewhere um it's been a couple of weeks though i'm not sure that this one was this one nice branch if environment branch ref equals main then i assume it knows because it's in the environment variables it's taking to the core mostly but library sizes would be cool too so this would basically give you this would basically let you have a list of all the boards that are supported and what size their binary is and then because it has get hashes you could presumably like see it over time or maybe over time is not the right way to think about it but like over code changes which happen over time that would be interesting that would also let us see if and which boards are very close to the limit potentially which is probably helpful information to know because right now it's like we go to add something and then like some of them are now over the limit and then we gotta go and like try to cut elsewhere to make room back okay so let's say name clone we're gonna say clone main branch main branch repository so that's where it gets weird because we want this repo but could we just not give it a repository and then it will check out the one that we are made the action from we could give it a path of main branch repo we could then give it a ref of main because it said that could be a branch thought it said that right the branch tag or shot to check out yeah otherwise it uses the default branch so okay the the default is github repo so that will check out this one and then ref we can tell it the branch we want so we should end up with a folder called main branch repo that is a copy of the main ranch main did I say main ranch I think I said main ranch right there unclear if it was for salad dressing or plot of land where they house cattle maybe a bit of both I don't know let's just see if this works because I don't like I said I'm not very like I don't have a lot of experience with actions I don't have a lot of like trust that what I'm doing is right uh test uh check check main check main run why does this happen LS main branch repo CD CD main branch repo is there like get uh get status get status yeah let's do that let's try this what are we missing files oh bundle stuff okay that's fair sizes this is one thing I maybe we want to do is we'll get to we'll cross that bridge when we get there one thing I'm not sure if this prints out anymore it might only go to the comment and we might not be able to see it in the actions output that's the case we might go back and make it so it prints out as well but explain what what you're trying to do again I am so right now well here I think this will make it easier to understand as well if we can see the old ones I did so does did this actually get to print all this stuff out so all these okay no not quite though because it doesn't have the comparison okay let me go here maybe okay yeah so these are the outputs this is what the actions command that we are working on will output um and right now what we have here is published version which is taking it from the bundle the currently released bundle and that's where it's getting these numbers from for the current version for I mean for the published version what we want though is we want this bit here to be main version not necessarily published version the vast majority of the time those two things are going to be the same thing like most of the time whatever is the published version in the bundle is the same thing that is in main but sometimes it might not be the case it might be the case that a pr got merged thus main has been updated but a new release has not been made yet or possibly a new release has been made but then but it hasn't made it into the bundle yet because the bundle also gets generated once per night so it could be the case that whatever is in main is actually different from whatever is currently as of right the second in the bundle it will probably catch up by tomorrow and be the same again you know if a release has been made or if not yet then probably it will catch up within a week or so when Eva makes the releases for us but for those scenarios where they might be different we want to be comparing to the main version rather than the published version that way we're always comparing the changes in this PR against what is currently in main rather than what is actually currently released already let me know if that makes sense and so then like most immediately I'm going to have it check out main see if that worked and then if it did we're going to cd inside of main and we're going to build the mpy files for main and then that's where we will get our main version numbers from and then we'll swap them out for the published version we push here and then we'll wait see the actions on pull there's actually two actions that trigger there's one for push and one for pull request and I guess pull request is the one we would want to be doing this on do we have any limiters I wonder we probably want to limit this to not run unless it's the pull request since this runs on push also I guess we wouldn't want it to run if it was just a push to main because there would be no PR to comment on we pretty much only want to do it on a PR I think see there is an mpy size of main the last release and the version in the bundle yep are you planning to store the mpy size in main or to calculate it again on every PR uh I hadn't really considered it but definitely where my mind was going was calculated again on every PR yeah I think that's what I lean towards because if we tried to like we we could calculate it and then check it into main and then we could just read it from there like an adjacent file or something but we'd have to make extra commits like after each merge it would have like a follow-up commit where it updated the size maybe it would be more efficient because then we wouldn't need to build main during the PR so that would like definitely cut down the amount of stuff the actions is doing it's an interesting idea actually storing it yeah I hadn't I definitely had not considered it what are these post post job cleanup it's new I don't recall ever seeing post stuff before huh so it didn't crash that's gotta be a good sign check main oh we should have I oh okay check clone main here we go check out repository config changes stuff counting from check out doesn't tell us much here as far as like did it go to the right directory just as far as I can see oh actually right there it does main branch repo ls main branch okay okay we got all these files we did uh get get status or whatever or unbranch main what did we have it do cd okay ls it cd into it and then get status it so this is all the get status and so it does show that it's on main nothing to commit all of that stuff makes sense so now inside of here well let's build we could build from here too right can we or no where is uh where's build in py build assets library location yeah we can where's it is it gonna build um hmm is it gonna build is it gonna put them inside the library the ones it builds or is it gonna put them inside the directory that we are currently in so I'll leave check main for now obviously we won't really need this one in the final thing but I'll leave it for now build build main build main what is this mad about scheme of validation required string actual object so here library location would not be dot instead it would be dot slash main would I say main branch repo or something yeah main branch repo main branch repo uh let's see caching it would use less actions that's definitely true although I think it if it isn't paying for that since it's all open source and public repos but it's consider it I think they pay github for something I don't know the specifics but I think they are a paying github customer I'm not a hundred percent sure so I reserve the right to be wrong I certainly could be wrong about this or really anything but I think they pay for something and I don't know if it's like I don't know how it works if it's an amount of hours used or if it's just like support or I have no idea but I feel like I recall somebody mentioning that they do pay for uh to like be an organization on github I think do you have to pay for that I'm not actually sure uh something like that though I think and then actions is like one part of it I would assume so we should you know what we should do though is we should move our check main until after build main that way we can see after it's built why does it paste like that high charm does not understand yaml very well this yaml yeah gotta work on that I'm gonna change this to look at just because check is close to checkout which is a get action which is not what we're doing and for a second I almost confused myself with it this one says check size as well but maybe we should do like size measurement measure sizes we still have check down here as well I used check quite a bit actually that's interesting we have nothing there is there any other kind of caching is there like is there any place it can be cached that's not inside the repo can like actions just cache some JSON data and then access it again in a future action without it actually being in the repo or would it pretty much have to commit it and push it into the repo if there's some like in between place where you don't have to make a commit but you could save it there that would be pretty cool because it would it definitely would be nice to not actually calculate it every time okay while this is running I'm gonna run to the restroom real fast because of all the water I've been drinking so I'll be right back again okay I also want to set up a locally hosted runner which we played with a little bit when I first started this as well because it'd be nice to be able to like get a look at what's going on inside the actions container more specifically all right so here's our build main deleting existing build yeah so that I think this I think this deleted the I think this deleted the one that got built before so build assets here this generates this generated this and zipped it I think this deleted it this is now saying delete existing build and this is the same directory but probably a different commit I guess right isn't that a commit hash maybe not 909 now that does say the same this is quite a few times this is kind of odd I am surprised this is the same shouldn't those be different and it doesn't have they're not inside of here but I guess what we want is maybe do this you cd main branch repo and then this is actually going to be back to dot what was that 909 that's actually not any of these commits is that the current what's that line behind or something it's different you could run any script you want I think the right place to make it happen would be inside the build tools I'm not yet sure where to store it I can't think of a reason to not commit it to the repo um mostly I'm just scared of having the actions like make a change and commit it because if it goes wrong then it might like delete something or add too much or do something weird I mean I guess we just test it and try to make sure it doesn't do that but could have artifacts artifacts would be interesting we use artifacts for the builds I think workflow artifacts if those can be accessed by a future workflow that might be a good candidate I mean the the other thing with the committing it is then essentially every commit becomes two commits or every pr becomes an extra commit which I guess doesn't matter right commits are free it doesn't really matter how many we have so maybe that's not a problem artifacts does seem like an interesting idea though if that can be accessed from the next one you can download it okay so we could post like a JSON file into the artifact and then we could download it now artifact so are these per branch or per repo or all artifacts perhaps we haven't managed to crash one of these yet honestly so this one did its thing build its stuff one main branch build main cd yeah see this time we don't have the deleting okay and then this is okay yeah we actually do have two different numbers now as well hashes so this one which should be the changed branch is 2a0 and then this one which should be main is 093 makes sense for main this one is 403 I don't know where we got the two 2a0 maybe those aren't commit hashes I assumed they were maybe they're not 2a0 or did we get do we already have multiple commits no I have a 2a0 I don't know where that came from for a github action run but I don't see download this one yeah the official one doesn't support that there's an issue for that this does actions download artifact I see download this one should download artifact so yeah I'm not I'm not sure about this hash that seems odd to me I don't know where it got where it got that but but as I understand this should be the one that's building the branch from this PR this one now looks to be building main and if we look inside of here now we have these which is perfect inside of these it's going to have the MPY file that we need to use check against so inside of here nope we don't have it open actually okay let me open it probably not gonna be in recent well it's in there somewhere but size tools so this is gonna now be main version branch version download latest bundle so we're not gonna we don't need to download anymore honestly it's gonna behave a lot more like this one here's our is file this will look in the current directory to find this file okay so before we do that we want to go os.chdir main is it main repo branch main repo branch is that right yeah no main branch repo okay CD to there then find the version 8 MPYs go inside there go inside the first directory you find go inside lib then do basically this stuff but this would be main branch version and the good news is like this is all the exact same stuff in the other one so besides the output I don't think much else needs to change and this does need changed version size changed version size strings curve version size oh okay so where we do these we actually want curve I should probably change it to main version instead of curve version but string file okay um let's say change to compare with main branch instead of published received two 10 000 mAh batteries got a possible hurricane headed this way and starting to charge up everything yikes good luck I hope it doesn't get too bad out there every rat hope your batteries get charged up and get you through as well it's definitely nice I got a big battery bank and it's definitely nice when the power's out to still be able to do some stuff okay so that is now pushed we pretty much need to make another change here though and push it that way we'll get the actions to run again let's comment that out for now you know one thing else we probably want to check is like do we need to cd anywhere else because oh okay no this is already original working day this is already gonna change us back okay nice nice nice nice okay that stuff doesn't matter I'm gonna leave that we'll commit it again later I wonder if those push actions are failing so find out when I check my email after this I think it sends me an email for failed actions 10 k batteries are brand new products max used to be 6600 oh nice that's like another 30 3400 that's pretty good size increased 30% I did to try it out with my weather station I'm sure we'll get some work this week logging everything data for dayo as long as I have Wi-Fi anyway it's to log to your phone as a tether yeah that's true yeah tethering your phone to have stuff join the network is pretty nifty it's definitely helpful sometimes especially if the power is out and therefore the internet like Wi-Fi is out then cell phone network is definitely super useful you have like an sd card or something in your in your project you could cache data to that as well and then even if you had no network connection it would still be inside your local file you could either like upload it after the fact or be able to look back on it uh-oh this time we failed no such file I guess it's because it was cd'd into the wrong place right it was cd'd into wherever this left it so this won't work we need to go back to uh we need to go back to the root which was that original I think right original original location or something did we actually get that from original working dur yeah oops there first so that xd card in is a great idea I haven't set that up yet have an sd card on the feather wing though nice oops I should have uh changed the commit message but I'm gonna close this one and this one probably close device workspace as well but this will at least make it so it doesn't have to scroll and then I guess I don't know we'll comment this one more or I don't know oh that uh is the youtube oh no the discord is running off the screen too oh goodness didn't check my uh preview well enough today okay it's the youtube super tiny that's just my preview pretty tiny let's make it okay there's a little bar there that's like the top margin we could try to cut that out as well but I'll jack with that later I don't want to do too much inside OBS while it's running I think that looks better I'll have to uh yeah I wonder if there's like can I set a default I'll have to try to remember to uh-oh where's the rest of our stuff oh I don't know something went wrong here because this is also pretty much current version instead of instead of main well that main and publish but I mean in this case main and publish probably should be the same hmm so what was this was okay output string uh yeah yeah yeah we need to not do that I guess we probably want this still and then this should be plus equals um why is main that different than published though published we had only 766 the main is bigger 25 days ago 28 days ago so I guess though in my case main could be behind maybe my main is behind I think Adafur Dio has a way to import a log from an SD card well you can write the code though right you can write code that loops through the SD card and then uploads it to Adafur Dio definitely not with Whipper snapper yeah that one I definitely know less about I've only done the most basic with Whipper snappers so far I'm using as your name main real-time nice to temp this too for the temp sensor and TFT feathering too many projects yeah it's not a problem though too many problems too many projects is a good thing lots of projects is a good thing okay so we pushed our size I think so it would be checking out foamy guy main I think right it because it would be checking out the branch that spawned it and in my case or is yeah okay but yeah mine is is a while back still so maybe my main is behind slash wrong I'm gonna go foamy guy main merge from Adafruit main push this gets foamy guy main caught up then we go back to here maybe we should have it output this hash as part of the comment so yeah I think when you upload it using MQTT it'll give data points with the wrong timestamp it only works in real time can you specify a timestamp in the JSON uh that I'm not sure about but I mean you could always yeah I don't know if there's like a built-in timestamp it may be automatic you could make another field or whatever and submit your own timestamp yeah if there is an automatic one you may not be able to change it I'm not I'm not too sure if there is or isn't I also have only limited experience with Adafruit IO more generally too I've done the most basic stuff with whippersnapper done a little bit more Adafruit IO but not that much truthfully I don't think I've even ever done any sensor readings to Adafruit IO the stuff I used it for was like pushing a video not on a video pushing an image to it and then showing that image on the screen uh in typical Omega fashion is that for showing stuff on the screen but it didn't fail this time this is now different 629 okay there's our output so the changed version here is I wonder if we should print the difference I mean people I guess could do the difference themselves I don't know it's the difference nice to have maybe it is same just with basic stuff whippersnapper I use MQTT and JSON manually on the S2 to get it working then moved it to another project so this one was basically not quite a hundred bytes maybe like 60 or 70-ish bytes bigger the strings though actually are a larger percentage so it almost looks like it looks like pretty much all of the bytes that were added were strings because yeah because that's like that same 70-ish added to that interesting yeah I wonder if we want a third section with like summary or conclusion or something where it it could do the subtraction to say like additional size with this branches x bytes additional string sizes x you know whatever this the percentage I mean I guess it could subtract the percentages as well we'll see maybe I'll ask for feedback on that on the comment I don't know if it's worth having it print more or if it doesn't if it's not worth it because it basically just the numbers that are already there doesn't actually give us new information just puts it into the comment for us I do think that worked though I think we could take this out and then we could basically go back to cookie cutter put in this new stuff having the difference done for people to be helpful I don't think this works but we added we didn't change this because all that logic lives inside of here so really the things we added were after clone size tools and before check sizes clone main branch build main branch supposed to be so which are stand if we wanted it to comment this would be in here we'd basically go we should store the percentage there we go and one more this one down here now we have those as variables so then after this kind of stuff we could be doing output string plus equals another one of these summary and py file size difference changed version minus cur version and py strings size difference changed cur py strings percentage changed eventually we're going to remove all this stuff I'm going to leave it so for right now but add summary section size comment differences okay so we removed that so we should pretty much get the same numbers as last time but with the summary why are you spilling all over me water and I think I'll be heading out here pretty soon so thank you again to everybody for watching I will watch this one to the end we'll see if it we'll see if it's working or if we need to tweak anything I may make the tweaks but actually once we get this one printing the summary section here I'll probably be turning it in for the night so if anybody has any last minute questions or comments or anything else that you would like to share or say now is the time to do it and beyond that we will hang out for a few minutes and watch the actions here and then call it a night I got to say definitely thanks again to see Grover for that palette filter I think that's definitely going to be a super cool utility for display oh I think that makes a lot of stuff easier for us so thanks again for sharing that and sending me the link to take a look at yep you do the same as well DJ Devin have a good night to you and everybody else who's watching yeah for sure let's say quite a while huh okay there we go finally you just got to just got to say something about it it's all it knows it knows got ears ears everywhere pre-commits I don't think I haven't run pre-commit for a while I guess I've been passing though right that's a good sign oops thanks for the stream good to be watching yeah for sure thanks for watching definitely appreciate you watching hope you have a nice night as well uh Harold got here building assets so that's the changed version I will say the uh while it would save us some time to not have to build main honestly it doesn't take hardly any time at all one second only for the build I'm surprised it's not longer truthfully though okay I think we're looking good let's head back to here there we go PY file size difference was 69 this dream's difference was 73 we didn't round our percentage let's do that the same way we did the others I haven't been running pre-commit on this got some line too long those to take care of yeah for sure thank you uh see Grover happy to happy to tinker around with it take a look and definitely looking forward to using it so store percentages and variables what else do we do oh output the summary add summary section I guess we already had the summary section didn't mean we just tweaked it a bit we did um yeah some of this stuff is old actually we did round round uh summary percentage two places to add the percent sign that's relatively minor and then code format yeah really those are the only two things we did but format makes it looks like there was more changes than there were but it's all right about summary wrong oh well it's forever etched into the commit history now so yeah this is odd to me that these are different right does that make sense that this could be different that feels wrong doesn't it oh tim hope you're having a good day yeah I'm I am I hope you're having a good day as well I'm gonna be heading out here pretty soon but I think thanks for uh thanks for watching and mentioning that Roy appreciate that um couldn't these be the same or or if not the same shouldn't the file size be as big or bigger than the strings size it's not that simple because it feels like if there were 73 more bytes of strings wouldn't there have to be at least 73 more bytes of total size because the strings are part of the total size it must not be one to one like I'm thinking there must be some cases where the things inside the strings output are actually slightly bigger I guess than they end up occupying in the final file that's the only thing I could think of they could cause that but all right I think that's where we will call it tonight we got our summary print in there I did go back and make the change to truncate this to two percentage uh decimals like these ones are and also add the percent sign but I won't bother making another commit for that right now only other thing really to do still would be to commit cookie cutter and I'll hold off on that I think what I'll do is when I do test this I'll test it another time to get another printout with the updated percentage year and then once that's done I will push those commits to cookie cutter that way I can link back to the comment that has the latest stuff in it in that cookie cutter pr and I'll probably end up doing that tomorrow during my stream that's my guess as far as right now at least so you're interested in seeing that or seeing the continuation of this project come and join me tomorrow morning on my stream you can find it on foamy guy underscore twitch or if you come to the live broadcast chat which is the discord chat that's on the screen down there then I'll put the links there in the morning that's tomorrow morning at 10 a.m central time so I'll be back working on this stuff again I think I will see if tomorrow brings anything different as well I may branch out into some other things also but I'll probably start here so that's what we've got for now thanks again to everybody for watching I do hope everyone has a good evening yeah again definitely appreciate everybody purchasing hardware from Adafruit thank you to Adafruit for sponsoring myself to work on circuit python as well as paying the rest of the team of folks who work on it so huge thanks to them and thank you to everybody for watching


role of media in Pakistan. Being the student of political sociology and as the citizen of Pakistan, I think this topic is of quite importance for all of us, that what type of role media has in Pakistan. Because the information revolution, it has changed all the political landscapes throughout the world. And Pakistan is not the exemption. In the case of Pakistan, we also experience that what actually happening in the country, what actually we have to think and what actually we are thinking. These are very minor differences, questions, but who is the source of all of these? It is our media. There was a time in which civic culture was meant to be evaluated. In a society like Pakistan, it was seen that who is the one who gets up in the morning and reads the newspaper. And through the newspaper, this information was taken. Even though it was news of the past, but on its basis, people would sit together and discuss. And along with political events, the source of social economic cultural information was print media. Then with the passage of time, television was involved and the news of television was a very important source of information for the whole family. But then in the country, along with many other events, the media revolution came and through that revolution, there were traditional newspapers that were big, big newspapers such as Dawn, Nawawak, Junk, many such newspapers whose media was very important, started replacing them with a lot of electronic media information instruments. And then television, which was a PTV in a time, on its place, and a lot of media channels started taking their place. After that, the change that came in this whole phase, what happened in that change, a confusion was created in people. What confusion was created? That those instruments, which were made by groups, through which a responsible character would be designed for journalism and mass communication. Sometimes they have their strong affiliations with their ideologies or media divide on the basis of their ideological affiliations. Then a new phase came when with the introduction of lot of many media channels, now there is no consistency in the information as well as the behavior of media. Now media is dependent on the owners, their policies and their affiliations. Now they decide that through media, what information and what kind of information should be communicated to people, especially regarding the social issues. A lot of such issues are presented as thrilling activities in the case of Pakistan. What is happening is that those irresponsible attitudes, it is communicating in the youth of Pakistan. The new people who are coming, who have to be involved with the media, their attitude also becomes that the more thrilling stories they can create, the more their voice, their speech, or their fame will be added. Along with that, another important development has taken place, in the case of Pakistan, is that media rather to play the role of to bridge the gap between the government and the people, media is trying to manipulate the policy making and even the government making in the case of Pakistan. That is, the role of the media in a country like Pakistan, where there were a lot of issues, which were religious, sectarian and social, where people were trained by the government, by the political communication, by socializing with the people, or by giving them civic education. The media itself began to perform its role as a party in such a way that we do not see responsibility, we do not see positivity in it. In fact, it seems that the media is a party and media has its own preferences, media has its own priorities regarding the government, even regarding the leadership. So nowadays, with context of role of media in Pakistan, there are a variety of concerns in every circle of Pakistan and even the masses too.


Okay, can we start? Okay. What is the answer of this question we were discussing? Yeah, what is the answer of this question proving? Why it is a? Why it is a tell me? See when you write down the expression for Kp for this reaction that will be the partial pressure of CO2 and Kp value is given which is 0.009 5 Okay, it's a partial pressure would be this Now it is saying that 1% CO2 in air is sufficient to prevent any loss in weight when M2 usually is heated, right? So 1% CO2 in air. So what is the partial pressure of CO2 in air? that will be equals to The pressure of 1 by 100 into the total pressure of air That will be 0.01 into P Or we can say 0.01 atmospheric one atmospheric pressure if you did Right, so now the question is 1% of CO2 is sufficient to prevent any loss In weight when M2 CO3 is heated Right Kp for this is given Question is how much would be partial pressure of CO2 have to be have to be to promote This reaction at 120 degree Celsius. Okay, so you see the partial pressure of CO2 for this reaction We are calculating which is 0.0095, which is almost equals to 0.01 Okay, so if the pressure in air and Pressure of CO2 from this reaction is almost same then the reaction will not proceed then nothing will happen in this reaction right but The question is how much would be the partial pressure of CO2 have to be to promote this reaction? Means what should be the partial pressure of CO2 so that the reaction will go in forward direction? So for that process what happens is the air also has this much Atmospheric pressure almost this much the partial pressure of CO2 that we get from this reaction must be less than 0.0095 Then only the reaction will proceed in forward direction So option is correct here question number nine. Oh, this is again. I'll repeat see what I said The reaction that you have from that reaction According to the Kp value the partial pressure of CO2 that we get here is 0.0095 and the partial pressure of carbon dioxide in air according to the question It is again one percent rights one percent of the pressure Right, so one by hundred into peer pressure of air, which is one atmospheric pressure So the partial pressure of CO2 in air will be 0.01 atmospheric So this 0.01 atmospheric is almost equals to the partial pressure of CO2 that we get from the reaction Which is given in the question Okay, so that is why that is why since the partial pressure is almost same So the reaction will not go in forward direction Not to proceed the reaction in forward direction the partial pressure of CO2 must be less than this value Then only it will go in forward direction. That's why option A is correct Okay, so this one is the simplest one option D is correct simple one again Kp is equals to Kcrt to the power del n Option D is correct here. What about the 11th one? Is it Kp greater than Kc because since del Ng is greater than 0 So Kp is greater than Kc 12 and 13 These are the question based on Kp and Kcr relation. Tell me quickly. 12th one is a correct 13th, it's not same You see here. It's Kc by Kp and here we have Kb by Kc So option A is correct not B. That is how you make mistakes in the exam also Yesterday also I was Discussing this and read out the question properly see it properly like what is the question? Correct. So minus one again This question You should get plus four right you actually have lost five marks That's why I'm saying don't make these kind of mistakes Okay, read out the question properly. Don't assume the question like okay. This is the question the question should be this See it properly. So Kc by Kp is option D. Next one 14 Equilibrium constant depends only on temperature. So it's remains same So I'm here and this week and poor week. What are you doing? Kc depends only on temperature, right? So with whatever you change the temperature the concentration that won't affect the equilibrium constant It would be same. These are the few key points. You should keep in mind. Don't Do these kind of mistakes? Question number 15. Is it be what week is getting be at the three question, right? And once we add the equilibrium constant will get multiplied Fine So when you add all these three The equipment will get this equation and for this the K will be equals to K1 into K2 into K3 So option B is correct. All of you are getting a 16th is a it's correct if you're getting so I'm not solving this okay 17. What about 17th all of you are getting C C is correct If you want me to solve, let me know done all of you So I'm here. What happened? I think he's not there. Anyways 18th and 19th I need equilibrium. Okay, I'll give you some questions on I think also solve these two 18th a is correct 19th you solve then I'll give you some question of any equilibrium 19th again, you are getting a this is also correct 18th a is right 19th a Is again, right? You want to solve some question of any equilibrium? Go on any equilibrium. I'll give you that question only then tell me yes or no, okay so You see this question. I'm giving you this question because I don't have the picture of this You have to find out the pH of pH of 10 to the power minus 4 molar OH minus solution 330 Kelvin if KW is given at this temperature and That will be equals to 10 to the power minus 13 0.6 Tell me the value of pH There are two options nine and nine point six There are two options. I'm giving you nine and nine points is other two are four and ten Tell me the answer nine point six exactly you are getting right. We know this KW is equals to what? Concentration of H plus into OH minus Which minus concentration is given so H plus concentration will be 10 to the power minus 9.6. So pH will be 9.6 Okay, next one you see What would be the pH of a solution obtaining by a mixing? We have to find out pH right. I'll just give you the question in short pH we have to find out and we have a mixture of five gram of of Acetic acid plus 7.5 Grams sodium acetate the volume is equals to 500 ml a a is given 1.75 into 10 to the power minus 5 pk a is 4.76 solve this 4.80 4.80 is exactly correct your concentration of CS3 COH Five divided by moral master. This is what? 60 into thousand by 500 so that will be 0.166 Concentration of salt if you calculate this will be 7.5 is the mass given and for this the masses 82 molar mass thousand by 500 It is 0.183 Okay, now this mixture gives you an acidic buffer right acidic buffer so pH for acidic buffer will be what pk a plus log of Concentration of salt divided by concentration of acid Okay, pH is 4.76 plus you will get some value over here the point is what here When you solve this you'll get log off 1.1 approximately Okay, now when you see the option like the option is given pH is 4.70 option a option B pH is less than 4.70 option C H of the solution will be equals to the pH of the acetic acid is 4.76 to 5 Like this. Okay. So you see if you are getting log greater than one over here Right greater than zero actually then this value will be what? Greater than 4.76 hence the option will be answer will be this if you exactly solve this your answer you'll get 4.80 Okay, so like this if log value is not given according to the option you can choose whether it is less than pk a value or More than pk a value any option Right, so this is the answer we have here Understood Can we move on next one you see you have to find out again pH of a buffer solution it is mentioned of a buffer solution prepared by dissolving 30 gram Of na2 co3 and for this we have 500 ml plus Aqua solution of this 500 ml of aqua solution of this and it is dissolved into one molar at cn 150 ml pH you have to find out for this a is given for co3 minus 5.63 into 10 to the power minus 11 what happened option you want options are 10.197 if you need any log value you can refer to log table or Calculated anything if you have 9.858 and the last one is 6.400 na2 co3 plus at cl forms nacl Plus na at co3. What is the molecular mass of this? What is the molecular mass of this 106 right? So number of moles for this will be what? 30 divided by 106 Is the number of moles and for this the number of moles will be what? It is given One or molarity So one into 151 50 Is the number of millimoles actually? and here the number of millimoles if you calculate for this so That will be 30 into thousand divided by 106 and when you solve this You will get 9.98 you are getting So you see here we have 283 283 millimoles and 150 millimoles right So when the reaction proceeds, what is the millimoles of this left 283 minus 150? Which is 133 Of this salt will left this will be zero this forms 130. Sorry 150 moles millimoles of this and 150 millimoles of this The solution containing any two co3 133 mole of any two co3 and At co3 minus acts as an acid buffer So ph formula will be pka plus log of salt salt is what co3 2 minus By acid is excuse me na h so3 or h co3 2 minus All these value you have to substitute Ph is nothing but minus log of k a plus log of co3 2 minus is 133 divided by 150 So this is what you have to solve and when you substitute all the value You will get 10.197 approximately 10.197 yes 133 133 By 150 because 150 millimoles of this na h co3 is forming And what is the salt left the salt left is this 133 to log of Concentration of salt by acid Understood tell me fast two more question. We'll discuss the last two questions Write down solid full twice gradually dissolved 10 to the power minus 4 molar and a 2 co3 solution At which concentration At which concentration of ba plus 2 precipitate of ba co3 begins to form begins to form ksp 2 3 is given And that is 5.1 into 10 to the power minus 9 What is the answer You want options 5.1 into 10 to the power minus 5 7.1 into 10 to the power minus 5 4.1 into 10 to the power minus 5 8.1 into 10 to the power minus 7 minus 2 You are getting a 5.1. It's correct What is the condition for precipitation The Concentration the product of ba plus 2 and co3 minus 2 Should be greater equal to its ksp value Then only the precipitation takes place Right so ba 2 plus concentration we have to find out So that will be what ksp 5.1 into 10 to the power minus 5 minus 9 divided by 10 to the power minus 4 So it will be 5.1 10 to the power minus 5 Option A is correct This is the condition Now the last question Today Acid is given HA plus plus A minus of 1 molar solution 5 Find Its Dissociation constant Condomia is getting 10 to the power minus 10 Nothing is given here So we assume the initial concentration is 1 0 0 Ph is given so we have the h plus concentration which is 10 to the power minus 5 And since 1 1 mole ratio we have So the concentration of h plus Would be equals to the concentration of A minus And how do we get this when this Acid will dissociate So when this 1 moles gives 1 To get 10 to the power minus 5 mole 10 to the power 5 moles of this must Dissociate So 1 minus 10 to the power minus 5 This is the equilibrium concentration of this So we can write down the K for this acid Is equals to h plus into A minus 10 to the power minus 5 Into 10 to the power minus 5 Divided by 1 minus 10 to the power minus 5 So since 1 is far Greater than 10 to the power minus 5 So we can neglect 10 to the power minus 5 with respect to 1 This is equals to 1 And hence K is equals to 10 to the power minus 10 approximately How did you get 10 to the power minus 3? What did you do? Sai Me Ram Chiran Don't do all this kind of mistake You are not losing 1 1 marks But you are losing 5 marks So whenever you get some easy questions Take your time and solve it Read the question properly And one more thing You are not going to solve all the questions So up the question And then read it properly And then solve These are the easy questions Don't lose marks in these kind of questions Anyways, so We will wind up the class here only And Next week probably I don't know, next week probably you will have class This week you don't have any chemistry class Tomorrow you don't have any chemistry class So wherever you feel Like you have less confidence Or something We just revise those topics I have sent you yesterday The Boron family questions Assignment I have sent you yesterday So today also I will send you Carbon and other groups Questions Those you have to go through Okay Bye bye See you soon