alright welcome to day 14 of the advent of code in Haskell we've been at it for 13 days now and we're more than halfway through right so but it's getting harder so let's see if we can keep it up yesterday was pretty easy in Haskell but yeah we're not always that lucky but now we have more tools available right and breath first search is so fast anyway some Haskell I'm also using this bottle it's not a Haskell bottle but I actually got it from soon known for such things as the processors in almost everything no anyway thanks for tuning let's get started on day 14 I already created some skull tin here make it bigger so a lot of our viewers are actually on YouTube not live and one of them said make the font bigger I can't read it on my mobile and now for those people I just had to say you know pretty impressive that you're watching these in my mobile anyway let's get started and what are we doing today we did some distress signals yesterday we were figuring out packets we went up the hill we fixed the screen so much you're doing okay so now the signal is coming from the waterfall and then we go behind the waterfall okay there's a large cave system oh my god my familiarity okay so we are definitely like it's like a continuum we're like the same person all right you begin a moment if you're gonna you feel ground ground movement sad because pouring into the cave if you don't quickly figure out what is going you could quickly become trapped fortunately your familiarity with analyzing the path of fall material will come handy here you scan a two-dimensional vertical slice of the cave above you and discover that it's mostly air with structures made of rock your scan traces the path of each solid rock structure and reports the x y coordinates that form the shape of that path where x represents a distance to the right and y represents the distance down each path appears as a single line of text in your scan after the first point of each path each point is the actual input okay so this is the input now let's see here for example who pays it into our example a each path appears as a single line of text in your scan after the first point of each path each point indicates in the end of a straight horizontal vertical line to be drawn from the point for example 498 4 498 6 496 6 this can means that there are a two paths of rock the first path consists of two straight lines and second path consists of three straight lines oh yeah by the way I'm not drinking I'm drinking what I call Martian coffee it's just a caffeine as an alpheanine in hot water it's not good anyway okay so it scan this okay let's see in front of 8 2 4 9 8 6 4 2 6 and then 6 to yeah okay the side is pointing into the cave on the point 500 point comma 0 okay yes okay areas dot plus this becomes... sand is produced one unit at a time and the next unit of sand is not produced on the previous unit of sand. It comes to rest. Unit of sand is large enough to build one tile of air in your scan. A unit of sand always falls down one step if possible. If the tile immediately below is blocked by rock or sand, the unit of sand attempts to diagonally one step down and to the left. If that tile is blocked, the unit of sand becomes... okay, by rock or sand. If that tile is blocked, the unit becomes sand because I only want to step down to the right. The sand key is moving along as long as it's able to do so. At each step, trying to move down, then down left, then down right. If all three possible destinations are blocked, the unit of sand comes to rest and no longer moves, at which point the next unit of sand is created back at this source. So drawing a sand is kind of like this. Oh, okay. Yeah, and then ding. Okay, this is a bit fun. Okay. Finally, only two more sand can possibly come to rest. Once all 24 units of sand shown above have come to rest, all further sand flows out of the bottom, falling into the end of the void. Just for the fun of the path of any new sand before falling forever soon, hair was tilled up. Using your scan, simulate the falling sand. How many units of sand come to rest before the sand starts flowing into the abyss below? Okay, now let's start scanning these. Okay, data input. This is going to be i and it's going to be a pair of integers and comma int. Okay, so each line is going to be, yeah, a list of integers. Okay, now a deriving show. Okay, instance read input, where? Now I want to, so we should probably put this in the utils, where it's like this reads preq equals util. So I want to do import a read text dot parser combinators. Combinate. Okay, so I'm going to actually re-export it. So text, this is going to be chunks. And I'm going to, so I'm going to say this read a preq pars is equal to text in pars and reads this. Combinators dot read p and then we just re-export the module text dot parser combinator. Can I do this like this? No, I'll just say module. Okay, import text dot parser combinators. Ah, somebody's watching reads read preq a import qualified text dot parser combinator combinators read preq as rp. Okay, preq pars takes in rp and returns. Okay, and we'll export req pars as well. Now we will import util here, import util. Now read input will be a where reads preq equals a pars preq pars where pars equals undefined. Now, it won't, it doesn't want this preq pars, I call it pars. Let's call it pars preq because that's the one I guess it was then we should probably be named like that. Pars preq. Pars preq, that's probably where pars sec comes from actually. Let me see a manager. Okay, so pars preq. We have to do all these explicit in exports because we are re-exporting a module. Okay, so pars, so this is going to be do pars pair is equal to do a reads, read as to p reads, read as in. This is going to be a pars pair. So a sap by, okay, sap by one, pars pair, and then this is going to be skip spaces, and then a string skip spaces. Now, and then this is a read p of p. Now reads add in a jar comma read x, read as to p return x comma one. Okay, rent this a read input to input io input, a list of input, read input equals a map read map result. We're going to fmap dot lines over read file. All right, now do read input x, the day 14 example. Okay, at least the type checks and we get the input. Now we have to simulate this. Okay. Okay, first of all, I want to shift it all a by a 500. Okay, I don't care. Let me see. This is all 500 for some reason. Okay, it doesn't actually matter, but it's still I feel like. Okay, so Okay, so we can have this map and we can like make it update. Let's just see here. So for a, okay. So where does it stop? Okay, let's take here and blocked takes an input and returns. It returns a range. It returns a set of chords set import data dot set set import the set as set. So block takes an input and it we will like generate the range that off of the ones that are blocked. Okay, blocked. Okay, empty equals set dot empty input. Yeah, so this is actually I have empty is set of empty. How to do this in let me see. Okay, so, so I'm actually just gonna do like I of x, y, p one, p two, rest. Okay, now. So anything else will just be set that empty. This is equal to set that union p two, p two, r. Okay, and where Ellen said, okay, where Ellen said is set of eight comma eight. So Ellen said and then we're gonna just give it p one, p two. Okay, Ellen said we could actually Okay, this might be like a very long lines. So they might have a lot of points. Okay, so let's just aim. So let's a let's not do it like that. Let's actually do here. So blocked takes a list an input and then and then chord and a and we will actually check whether it's between those two chords. So yeah, okay. Okay, so we're taking an x here x, this is just equal to false. Now x comma y. So let's do a p add. Okay, so x one comma x two, p one. Okay, let's not do it this way. So let's say p one, p two, we're just simplified. Okay, and p and then we say if between between between between p one, p two, p, then target is actually between p one or p two or blocked i, p two, r. Okay, I'll just have this c set of functions. Okay, and now between, oh my god, let's not call it between then because that's reserved, it's called between between in comma in in command a x one x two y two x and y. This is equal to okay. Now if a point is between two points, then it's a So, so either of a, okay, so it's always going to be okay. First, we have to sort the points. Do we do this some other day? Okay, so if x one is equal to x two, so then there is a line like this. If x one equal to x two, then we have to check that a y one less than equal to y and y two less than equal to y less than equal to y two or y two less than equal to y less than equal to y one. We don't know which order that points are in else. And let's actually just, okay, so if they're not equal, then else if y one equals y two do the same but for, hi, do you know how I can go from one comma two to one plus two in Haskell? I'm trying to change it together with a custom fold. So yeah, I would use a fold one. Let me show. Ah, Haskell question. G-H-E-I-T fold l one. So fold l one plus one comma two. Okay, did you get that? Did that answer your question? Okay, so okay, so the twix there, it will, well, okay, so what do I need to know here? Well, I know that either x one equals x two or because all the point will always have one of them will be equal because we're always checking the line. So I don't actually need to check if x equals x two and x equals x one else if y equals y one, then we check this otherwise false. But I know that the lines are always, they're always going to be equal. All right, just ask again. We also do Haskell help sessions. Let's see, I think betwixt is correct. No, let's load day 14 slash day 14. Okay, let's say one comma two and three comma two. And then I want to check if two comma two is betwixt. Okay, three comma two is betwixt. Four comma two is should not be betwixt. Okay, now two comma two is betwixt, but two comma one should not be betwixt. And three is just for a, okay. I think this is the betwixt formula now blocked. So okay, now we're going to be checking a lot of betwixts. I feel like we should take all the inputs. We get all the betwixts, right? And they should have some, we should have some markers, right? So let's actually not do it like this. Let's actually just go from inputs to pairs. Okay, cancel this hashtag canceled. Okay, so I want to go from a two lines equals, go from list of input to a list of list of int comma in two lines. Okay, so empty is empty two lines. A A B rest R as of input. Okay, so let's for one input prime equals input to list of, it's actually like, okay, so let's write here type code equals int comma int. Now I want to go to code. Now this one should go to a list to go or a code. So this is actually two lines. Court a court. Okay. A concat map a two lines. Okay, this is fine. We just concat map two lines prime. So two lines prime of I A B R RS is equal to a comma B two lines prime. B R two lines prime. There's actually nothing. We're just doing one line two lines I B R. Thanks. It could work, but it gave me, can I turn to fold one plus two plus three plus four a Jedi tri fold R one instead of fold L one to fold R one. That is exactly the other associated. Now, what is wrong here? Thank you. You are amazing. Wow. How's that for a start to your day? Okay. Now let's do print. Let's say two lines. So these are okay. No, wait. Yeah. These are all the lines we have. Oh, yeah. And two lines prime of anything else is just empty. These are all the lines we have. Okay. Now we want to divide this into X lines and Y lines. Okay. Is a vertical is X line line takes a court. Then this is type line equal court comma court. Now is X line line to full is X line X. So this is going to be X one. Y one. Okay. X two equals X one equals X two. Okay. Now we are going to partition is X line. This is from data.list. Okay. And now we have the X lines here. Okay. And then we have the Y lines. Okay. Now we are going to accept it. So that's what fold R one is, right? It's like fold L, but it does it from the other direction. You probably should be using fold R if you can. But I never remember which one is which. Okay. Now. So let's go. So to X map. This is takes in a line. We're going to assume it's an X line for to X map. It takes in X one comma Y one X two X two comma Y two case X one not equal to X two equals error. Not the next time. We can actually add. We don't actually have to do this. We just do is X line. Okay. Two. And then we don't even need to disrupt it. Okay. Now to X map. The whole thing equals into math. So I am dot single ton. And the key is going to be X and the value is going to be Y one comma Y two int map. Actually int comma int data dot int map int map import qualified data dot int map as I did ding ding ding ding. Okay. Now we do the same for the Y map. If it is X line and we say not a Y line. Okay. And then the Ys are equals X one X two. I am single ton Y X one. And I'm actually going to be a bit more clever about this. So I'm going to say here mean Y one Y two and max Y one Y two. So they're always going to be in order mean X one X two X one X two max X one X two. Okay. Now let's do here. So task one takes a list of input and returns a pair of int map. So a collision map is so a call map so collision map call map type call map equals int map my int. And this one takes and it will give us two call maps. I'm actually going to be very clever here and just say int map int comma int. Okay. Task one input to call map map. So task one equals a so this one gives us a wind map. Okay. Yeah. Yeah. Yeah. Yeah. It's because what might have like multiple lines in the same like non non contiguous lines. Okay. And then this is actually going to be the list of these. Okay. And now task one going to give me a call map. So I got to take the I'm going to take the imps equals a so where X is Y equals partition is X line of two lines in and then I'm going to do I am that unions with plus plus X's. I am that unions with plus plus Y's. And then this is because dollar two X map to X map and then this was going to be the same to Y map. Now let's actually not do this. We do print task one. So then I have these collision maps for X and Y. Okay. Now I want to be able to add a point to those. And it would be nice if we could kind of unify let's write here compact int map in command to int map in command. So compact takes a fmap come back compact where compact prime. Oh my god. You see I don't think there was anything funny there. Sorry about that. So compact. Are we are we too eager here? So I want to be like I want to be like so I want to kind of join together lines that are together. Okay. Let me let's wait with this. Okay. Probably don't need this so far. Okay. But like because we're going to be adding grains of sand grain in comma in. So where it ends up to the call map grain X my L equals so we insert into so I am okay this is going to be I am dot alter adjust. I am adjust. Okay. So we're going to do I am dot adjust. Let's put that up in the here. So I want to adjust. So for the X lines I want to adjust adjust and I just want to add a Y comma Y I want to add that to the X XL I am dot adjust. So we add a grain of sand. I knew you can see now why I would like to kind of be able to merge together things that are like if I add something I just want to merge it but let's uh I mean it's pretty efficient already because we just kind of look up in the map and then we look up and it's always going to be increasing because we add the grain. Okay. Let's just do a collision call map in my end so collision and XL YL X Y then I'm going to say if we check the X collision so we take XL I am dot bang X okay and then we check just a axis any uh so we get uh we get the Y1 Y2 here uh Y1 less than equal to Y and Y2 less than equal to and Y less than equal to Y2 of the axis. Okay. Either that or I complains equals either that let's see where X call equals so that's going to be this so we check the X call okay this is actually a Y call but anyway Y call so then we check the axis nothing X call is the same but the other way right then it's YL and Y and Y X1 X2 X1 less than X2 and Y is here nothing falls uh X call or Y call okay now a lot a lot faster if we can binary search search okay so let me take how we can actually do that so instead of checking all of them you see the idea right we have this collision map and we're going to add the grains so we're actually gonna just take okay just let's just say here compact we're actually gonna pretend we compact but compact equals eight we're not gonna do it but we we we should do it okay and okay let me actually print up this map and we're gonna do it with the same ranges here so we're gonna print zero to nine and four ninety four to five hundred and three just to check that the collision map works okay so let's generate all the coordinates EX EX coordinates equals a let so we're gonna do the combination over 493 to 503 all right 494 to 503 zero to EX coordinates all right okay now we're gonna now we're gonna print these these are actually the X coordinates no they're supposed to be like this yeah okay and uh now print a map collision X okay so now we're gonna print these X coordinates okay so let's say um do four import control dot mona and we do 494 to 503 and do maybe we can do four loops in a four m a zero to no now we want to do it already the other way zero to nine it's gonna be a y2 494 to 503 it's gonna be a x2 do now if let's say let's get the call map first here let's go task one cmap is task one over read input if collision cmap a x comma y then putster dot uh putster dot else putster hashtag and then we're gonna do putster ln okay now let's see what this does right and then this one needs to be outside the four okay if collision we want the hashtag otherwise we want this okay so the collision map does work we could have we could have we could have screwed up there but we did not now let me compact the let me compact the map okay so so let's see so what is the grain end up first one that ends up at a so it's about 500 comma 8 so let's see here a a grain 500 500 comma 8 okay we're doing it every round or whatever that did not work okay so how do i uh so here i want to actually uh maybe i want to but it is 500 and let's see 500 comma 0 okay so my add grain function is not doing the correct thing let's print out the results uh print add grain 500 comma 8 uh cmap let a c equals where do you see okay if i am adjust okay let's see uh maybe it's because it's not there i am adjust update uh so alter i need to alter actually so it's not adjust it's actually so if it's something there just l equals just pl afp of nothing equals just so we're gonna say here uh and then i think it's the no so the x this is all the y coordinates yeah okay x x okay so eight okay so let's see how the way we're okay a y x x y okay now we've added to the list okay now i'm gonna add two grains a add grain 500 comma 7 right so that's like the next one i mean it's not the next one but we imagine we added something there now i want to now i want to i want to combine this a to come back compact okay so first of all i am dot a so we're gonna fmap compact over f my compact frame where fmap so where compact prime is going to be first of all sort okay we gotta we gotta sort it import control dot monad sort but is it going to be very i'm probably going to be very expensive to sort it every single time so let's assume that it is sorted so let's construct it and then we sort it fmap a sort sort so we maintain them sorted import a yeah it's actually pretty insane that sort is not there by default okay so we maintain them sorted uh variable monoscope sort didn't i just add it here i did okay now uh okay so because i think the initial one will actually will be fine okay so now i'm adding to the list and i want to change the and we're not going to compact it every time we're just going to do the alter function okay so if there's already a list there i mean so um okay so it's going to be sorted a okay so this is just going to be let's let's actually because we're adding single points here y x no yeah y and x okay so it's going to be i okay so we have just the list okay now we're not going to add it to the front so let's actually make it so that we can actually see this happen to 508 and then this is okay now we're gonna see this happening so we are gonna say a equal so we're gonna do uh first and then rest a equals where so uh span we have start and end and we are gonna say start is greater than the end of the i uh so while the end okay so we're taking until the ends are are so while we're taking while it holds right ggi doc span what do you think it's not possible dude i think we can do it uh we're longest prefixed element that's satisfied okay yeah so while it's smaller than i okay a of l now uh so we have start and we have start and so it might be like putting a line in like between and we're gonna we might be okay so there's gonna be some head of this list so this list is not gonna be empty okay let's actually do it like this extend so we want to kind of retain the the so it will only ever extend by a one point right okay so then we can just do a so maybe if it extends a starting point okay so just a let's say uh just pl okay let's uh let's actually just sort here can i do insert somehow like in a insert i can just do insert just insert verify data dot list as least and then this is listed insert okay now not actually compacting because we just maintain it here so we insert now so we can insert it into the list okay insert okay let's just be a bit shameless here now okay where l prime is equal to uh insert l prime now i want to see where that ended up so we're gonna say just a let's call this x here x comma x a let's see a let's call this p equals x comma x and then we insert the p not just e is a list dot index of in fine index now let's just list dot find index okay and we find the a uh lm index list dot lm index p l prime lm index index piece oh piece okay now we find the index uh so here i'm gonna say okay so now we're gonna check whether we can merge with the start or the end of some other list okay let's see a let's write that merge in comma in comma in comma in so they're off by merge okay x one y one oh x one so i start one start two uh e one uh start one and one and then start two e two is equal to okay so if uh so if the distance between e one if f so s two minus e one so the distance between those is less than equal to one then s one comma e two yeah and i'm gonna assume they're sorted let's say maybe now okay now let's see here uh okay now uh okay so let's uh so we could like potentially merge all the pairs here i think maybe yeah maybe that's just fine if we just kind of that's the original compact idea right there's check it we can merge anything and then merge it uh but let's actually in this case it's actually only one there's only one there's only always just one place we can merge okay so we're gonna want to like do it like this okay so l prime prime a is equal to if i is larger than equal to if so i if i is a larger than zero okay so i mean it's going to be larger than equal to zero um so if it's larger than so if it got inserted at the front then case l a prime of then it's a point here and there's another point and there's a rest and then we just do case merge p p two p one p two of just r and just p three of p three r otherwise it goes to be it's just p one p two r okay and then this one will always hold because if we have uh we inserted someone and then the list was not empty then we're gonna have this something at the end else okay then we're gonna do case gt lsc split at one one two three case a split at uh okay i minus one actually l prime oh so we're gonna have here the front of the list we're gonna have the p zero like point previous point the current like the new point and the point after that and then the rest now this might not okay so if it's p zero p one empty list then a case merge p zero p one of uh case merge p three per one of just p three and then it's f plus p three p three otherwise it's just f plus otherwise it's just l prime we actually yeah we can do that here l prime and then here we don't even have to have the error okay it's just l prime okay so if if there if it happens to be this way uh but then so this is okay anyway now otherwise we have the front and then we have p zero p one p two and the rest case merge p zero p one of just p three so then we're gonna do case uh case merge uh p three p three p two p one prime case merge p one prime of just p three so then it becomes so then we merge all those three points and become f plus p three r okay now uh okay we cannot merge p one prime and p two then we just f plus p one prime p two r now if we cannot merge p one prime then we are gonna say case merge p one p two of just it's gonna be a nightmare to debug if we have to debug it a p one p two of a p two prime and then we do uh f plus p zero p two prime rest otherwise we didn't manage to merge anything we just return okay so i'm thinking can we remove this uh so split at minus i minus one zero okay so if it's zero i think we can remove this if statement here so if i is zero let's see split at zero and what if i do split at minus one okay so it will just kind of work okay okay case merge okay like this okay now this is crazy okay let me print that five seven seven eight eight okay all right then i'm not returning so i'll return all prime prime see and now i got merged to seven eight now let me add a hundred comma six and we come six eight so let me add five here then it's five five and seven eight and if i add grain five hundred comma six ah it merges the whole line all right so now we can add grain super efficiently and it will kind of maintain the invariant now uh so collision so i don't have to check for all so i can actually just do um i feel like i think so much time optimizing this one it's probably completely useless um let me see here uh x call case i lmx y call so these x is okay so um let's you see take case uh take while uh e s as in take while s larger than y so if i take while s is larger than y so it will break once x is smaller than equal to uh so if it's empty and it just falls if we have an s comma e uh and then i check if s of y less y less than equal to e right and this is x is so then i can kind of just yeah collage collision like that now we don't have to check all of them but we do have to kind of scan through the list okay it would be nice if we could simplify this even further but uh let's say because we should be able to do like a binary search of the list and something like that but i think it's just premature i mean we're doing we've done a lot already right oh no i did it why did it work for the other one but not oh okay it didn't work ah let's just keep it any we've done a lot of work merging them we should still be able to utilize the fact that they're sorry we did all this work i should be able to check do this again uh is take while s comma e that we take while uh s is drop while s s larger than y oh s uh we're doing a lot of these collision stuff let's write them function okay into it and just so it's sorted uh but it's a list right so we don't actually have like a an array yeah okay so it doesn't matter because we don't have an array we don't have random access to the list we have to do it all anyway so it doesn't actually it doesn't actually matter but okay but it's nice to be able to merge things okay uh now let's actually go do the task um so grain so we're we're gonna do a grain falls okay so we're gonna have the current call map okay um now we're gonna do grain form int comma int comma and okay so grain fall it's gonna take an int to int to an x int to int we're gonna take the call map into uh int to int to um either so either the new coordinate or it's going to um turn maybe final coordinate either maybe uh this is a bit too bulky anyway grain fall call map okay then um g okay so we're gonna say a if collision cmg x gy if collision a a dmg there's something in the way then if collision cmg x go it's gonna fall down one step always falls one down one step if possible okay so so we have the current state of the set so if collision gx comma gy plus one so if that if there's a collision if not collision then grain falls cm gx gy plus one so then it keeps on falling else else if collision gx if it so it falls uh the other side i don't want to want to set it down and to the left gx minus one um gy plus one else if not collision then grain fall cm gx minus one gy plus one else if not collision cm gx plus one gy plus one then grain fall cm gx plus one gy plus one okay so if all of these collide then four possible collision is about then okay left gx gy okay now and i'm gonna check here also that so i have the x map okay and i have the uh so it's out of it's pulling into the void if there so uh cm add care about the what i forgot about the y here and i'm gonna say the like the min key min max and uh find min minimal key of the map find max delete update max okay we don't we don't care about that uh look up min equals uh look up max and we don't care about it and we don't care about the we don't care we care about that we care about okay so we look at max in name and it's gonna be just a okay uh so if this is the case and y max and when gy gy is larger than equal to um okay let's just actually do the grain fall and the current and then we actually just return a new call map okay so if it's larger than y max we are done we return cm okay this is the base case a now we do otherwise grain fall a equals m dot look up max so if we're not um if we're not out of the out of bounds a let's say init pause equals 500 comma zero so grain fall then else a add grain a so cm prime equals add grain a g cm in grain fall cm prime init a pause okay now if anything if it falls into the void then we are done okay so okay so here's where it goes and if not okay otherwise it goes to rest and and we end when okay let's just see what this does okay let's um if collision let's say cmap if collision cmap like this now let a g map equals a grain fall cmap init pause if collision cmap then put string else if collision g map x comma y let's put string dot okay it looks exactly like that yeah okay now we need to figure out we have the g map a and we have the cmap okay now let's figure out how we can how do we figure out intersect because we uh we joined all the we joined all the lines so now we actually don't have the okay left bias intersection so we actually want the difference a difference difference okay so then we do a let a diff equals a g map without a cmap g x we don't care about the gy here a cx and then let's print out the x cx without a gx sorry gx i am dot slash slash gx okay let me print diff okay and say here um range size x int to int a a range size s comma e equals e minus s plus what okay so the diff is going to be the i am dot lm's box lee i am dot four i am dot lm's conkat conkat map map range size we're gonna sum 22 uh there's 24 let's see a quite annoying uh right because uh because uh merging okay these will just be the keys that are not in the map so let me just do here grainfall 24 okay now let's not print the collision map a cmap task one read input task one okay let's see here a we're gonna be the cmap and then task one is first of grainfall zero cmap init bonds not task one see if it still works still works no did i fetch the input already no this is the old input i didn't fetch the input 737 let's see if that's correct all right we got task one what does cmap at mean zenith is asked so this is a trick in haskell one lot of trick it just means that a we are going to give this thing here a name let me explain so we're because we're kind of unfolding the pattern and we don't want to repeat the whole thing again so we actually so here so right so instead of so you say v at and then we say whatever the pattern matches and match against and then instead of having to say i comma cm again here we can actually just say a v right so we we gave whatever this pattern matches and name right i'm called that v all right a okay now let's go for task two i hope all this collision stuff was worth it there is not there wasn't one who's got there's a floor and you're standing on it you don't have times gone far so you assume the floor is an infinite horizontal line with a y coordinate equal to two plus the highest y coordinate of any point in your scan okay the two plus the highest y coordinate of any point in your scan any example above the highest y coordinate of any point is nine and so the floor is at y plus 11 okay and let's see two lines in ps and we have the highest y coordinate is the black box on the corner oh no there we go don't know what happened camera seems to have stopped broadcasting that's how long this stream is uh sorry about that i hope it wasn't too long okay but thanks for pointing it out anyway a now we're gonna have to figure out the highest y to task two okay so we have these all these inputs and we want to figure out the highest y point just stop there task y in ps and a let's get just no input so what is an input an input uh okay let's do two lines what do we need to two lines the input is just an i and okay let's do uh we will find the highest y of all of them a y of a x comma i've been having some trouble with the camera i don't know con concat map yet y and then maximum so let's see what the maximum is task two should be 11 no it's nine okay and then and so floor is equal to two plus this okay so this is the floor and the highest okay so minus infinity to infinity with the add floor the example about now looks like this okay so now we do this again but we will add a line to the y's uh right and now where y's is gonna be okay so the line uh minus a min well i think what is it called again uh enum enum has a no max min bound yes so the x coordinate here is a min bound map floor and the y coordinate x quarter max bound for oh let's print it again call map c map now uh c map is read input task two i need to check my camera because it's a shouldn't be doing that day 14 example okay and let's just let's just call this g-map no okay if collision g-map so we're doing it twice but whatever okay uh and now we need to print to 11 let's print from 490 to 505 okay now we have that we have the floor okay the final summary you look like in the example above the situation follow looks like this until a unit of sand comes to rest at 500 comma zero okay so a grainfall we have to change this is a grainfall two now it's not actually a y max we actually check uh if we have a collision case a collision cm init pause i comma cm and then it's just the same uh so this is two two two two and we have the grain and uh it doesn't like this grainfall have two different number of arguments i think is i don't care about this one let me see here now uh let's see i comma the c map is the original one now let's see and now let g map equals grainfall zero comma c map a init pause a i comma bar comma to the rest init and then we're gonna say g-map here again oh it's not good so they never stop trace show aid okay so let's do here a okay this is just supposed to be trace show sorry about that okay it never seems to hit the floor which makes sense ah wait okay so the c map is the correct one right i mean it's just like it's like they keep falling let's see if not collision okay let me keep going and then we add it so it's like the first one keeps falling right it's not actually finishing anything so it's not the condition that's wrong you print the c map here okay so this is the 11 okay let's not do collision there right let's just so instead of uh let's just have this int here and then this is just wise and we're gonna need this okay and this is gonna be uh int comma comap and it's gonna be the floor okay and here we have the floor okay so if it hits the floor then okay so we say a okay so we want to end the whole thing here now grainfall to floor a v y comma c m a g at g x comma g y and the case is that g y plus one is larger than you get the floor okay so when i'm on the floor equals let c m prime equals add grain okay i think this might work g c m and grainfall to y plus one comma c m prime it wasn't even running it okay okay let's add the floor here just because it looks better y is equal main bound comma floor as already let me print it this way so we need to add a few more 85 to 515 okay but let's print the r here 93 okay quite fast now let's see i want to do just a print task one and i want to do input print task two let's see the floor okay and i'm not gonna print the c map it's r am i tracing somewhere trace oh i'm with me printing out task two okay a we print out this and then we're gonna do task two on the input and then a c map i g map i r i floor i task two reading before i c map print might take a while up five seconds two eight one four five all right we finished day two yeah sorry about the camera issues took my camera out and i put it back in and now it's misbehaving i'll see what i can do about that i have a backup webcam but you know that's not as cool anyway thanks for tuning in sorry about the camera issues let me do git status git add day 14 git status git add util git commit am day 14 all right thank you for today and let's see what happens ah little lanny is here nice let's see let me see if i can fix the video for tomorrow oh sad i think it's like the power something blah blah i'll just take it out fix it up but anyway thanks for tuning in day 14 we are more than halfway through not bad ah i could share on masked it on ah that's very cool all right thanks again and uh yeah see you tomorrow all right bye bye


Hello guys. Myself, Samprit Patel, Assistant Professor, Department of Computer Science and Engineering, Walchand Institute of Technology, Sholapur. Today, we are going to learn about how to apply geo-location to your HTML page. After this section, students will be able to apply different methods of geo-location or location service to retrieve the location of the user. So what is geo-location? So we are required many a times to get the location of our user or the visitor of our web page so that we can provide a better service to that particular user. So for example, you might have observed that many of the websites take your location and according to your location, you get the search results or the options you want to browse. So you frequently need to recover the client's location information in your web application. For instance, the location of the map to show customized data, et cetera. So HTML geo-location API is used to get the geographical position of the user. So this position is retrieved from the user or the device with the help of different components like GPS. So we use a JavaScript that can capture the latitude and longitude and can be sent to the backend web server to do fancy location-aware things like finding local businesses or showing your location on the map. Since it compromises your privacy, the position is not available unless the user approves it. So you have to allow the website or the browser to send your location. So these are some browsers that provides the geo-location API. So Chrome provides the geo-location API from its version 5.0 and onwards. Only the current version 50.0 provides the geo-location API to HTTP services. So it does not give your location if the services through HTTPS that is the secure browsing. After that, Internet Explorer from 9.0, Mozilla Firefox from 3.5 onwards, Safari browser from five onwards, and Opera from 16 onwards. So geo-location API is accessed via a call to navigator.geolocation. This will cause the user browser to ask them for permission to access their location data. If the user denies the permission, the location will not be sent to the web browser, web server, and the location service or the script that we have written to get the location will not be executed. If they accept it, then the browser will use the best available functionality on the device to access the information. So there are three basic methods used to get the position or location of the user. First is get current position. This method retrieves the current geographic location of the user. Watch position method retrieves periodic updates about the current geographic location of the device. This is usually used in maps type API or web pages. Clear position cancels the ongoing watch position call so that when it is not required, it clears the data retrieved from watch position or stops the watch position method. So properties of geolocation are geolocation method get current position and get position using method name specifies the callback method that retrieves the location information. So there are a number of properties which can be called through these methods. These methods are called asynchronously with an object position which stores the complete location information. The position object specifies the current geographic location of the device. The location is expressed as a set of geographic coordinates that is the longitude and latitude together with the information about the heading and speed. These are some properties. So chords that is coordinates we are using a particular short form for that. So it specifies the geographic location of the device. The location is expressed as a set of geographic coordinates together with information about heading and speed. So this is one of the mandatory things that you have to give in your JavaScript. After that chords dot latitude which will return the latitude estimate in decimal degrees. The value ranges from minus 90.002 plus 90.00. After that we have chords dot longitude which will return the longitude in decimal degrees. Again the range is minus 180 to 180. Then we have chords altitude. This is optional. It specifies the altitude estimate in meters above the WGS that is 84 ellipsoids. Similarly there is chords dot accuracy. Again this is optional which specifies the accuracy of the latitude and longitude. Many a times you might have seen that accuracy to 50 meters, accuracy to 10 meters and so on. After that chords altitude accuracy. This is also optional. Specifies the accuracy of the altitude estimates in meters. Chords headings specifies the device's current direction of movement in degree counting clockwise relative to the true north. Chords speed specifies the speed ground speed in meters per second and the time span stamp which specifies the time when the location information was retrieved and the position object was created. So take some time and try to answer this question. What are the methods used to retrieve the location of the user? So the answer is first method is get current position which will get the current position of the user in latitudes and longitudes. Another is watch position. Watch position is used to keep a watch on the position and it keeps on updating the position or the location or the latitudes and longitudes periodically. Clear position is used to terminate the watch position method and clear the data retrieved by watch position. So let's see a program of geolocation. So geolocation should be written in a JavaScript. So see this is the HTML page that we have created to retrieve the geolocation of our page or rather of the user. So here we have given the HTML and body. We are just displaying that click the button to get the coordinates and on click we are calling the function getLocation which has been written in JavaScript and we are displaying the coordinates in the p tag. So here is the script which helps you to retrieve the location of the user. We are taking a variable x which will have the value of getElement by id to demo. This demo is the id which we have passed to the p tag. We are creating a function getLocation in which we are using if navigator.geolocation that is this is particularly to ask the permission to access the location of the user. So once this is executed it will pop up the browser will give you a pop up asking you for the permission to access the location. After that if this is true then navigator.geolocation get.getCurrentPosition will get the position of the user. Else it will display the message that geolocation is not supported by this browser. If we deny it or if the browser is not supporting the geolocation API. After that using showPosition which we have passed as a parameter to get current position x.innerHTML that is used to display the latitude by the help of position.coords.latitude which we have seen one of the properties of geolocation that is coords is the coordinates dot the latitude which will return the latitude of the user's location. And similarly we are taking the longitude using position.coords.longitude, okay. So now let's just execute this, okay. So when I click the try it button first thing it will do is it will ask for the permission to access the geolocation. So see this is the pop up that the browser has given. Will you allow this local file to access your location? So I'll say allow. The this app wants to use your location. Do you want to turn the location service? Yes, after clicking yes we have got the latitudes and longitudes of the user that is latitude is 17.6714 and longitude is 75.9234. So this was the example of geolocation. These are some references that I've used to make this video head first HTML5 programming by Eric Freeman of O'Reilly media and HTML5 and CSS3 second edition by Pragmatic Bookshelf. Thank you.


So, we're here to talk about how bill packs we're going to tackle basically handling multi-architecture image builds. The QR code in the top right is for rating this talk, and it will have it also at the end, so you don't need to scan it right now if you don't want to. My name's Terence Lee. I'm one of the, I guess, co-founders of the Cloudany bill packs project. Look at Salesforce and Heroku. Juan was on kind of the description if you looked at the talk, and unfortunately he couldn't be here due to visa issues, but he's actually the one that has done the bulk of the work that we're going to be talking about here, and we're going to have a video kind of later on where he will be able to kind of say a little bit. He'll say he's a contributor, but we've actually elevated him to a maintainer, so we're super excited about that and the work he's done. And then I've replaced him in your stock with this guy, Joe, who also works at Salesforce and a different part of the company, and also co-founded the bill packs project with me. So in this talk, if you don't know anything about bill packs, we'll do a quick kind of intro on them, pretty brief, and then we'll talk about why you should care about multi-arch as a whole, dig into how bill packs can help you kind of deal with that and how we're approaching and solving it, and then Juan's going to, we'll have a little video from him where he's going to talk about key takeaways from the talk itself, and yeah, let's get started. So if you're not familiar with bill packs, we take your app source code and transform them into production grade images, focus on developer experience, and things like security. And the quickest way to get started is to use a tool called pack that is part of the project. It's a CLI that interfaces with the Docker theme, and this is an example of the output that you get when you run a pack build, very similar to a Docker build. And what you do is you get these images that are kind of fine-tuned for your application itself where we can split out basically like build and launch concerns. Bill packs have the option to provide a software build materials that can be done at build time. So the actual things that are ending up in your image are the things that can get documented. Given the same inputs, the builds are going to be reproducible. We care about security things like doing things as non-root as we do that. I mentioned kind of the ability to kind of put the right things in the image, and that's due to some of the things we have with the ability to have more events caching, kind of more granular control that you normally get compared to Dockerfile, and that allows us to also do things like be able to rebase images. And so what I mean by that is that with build pack, built OCI images, we know the theme of where kind of your app layer ends and where the base image starts. And so with that data, we're able to kind of, with ABI compatible images, replace the underlying image without having to rebuild your entire app. And so you don't have to basically do that compute for your fleet of images across your entire inventory. We're talking about pack. It's actually what we call a build pack platform. There's a handful of them out there. And so this is the main one that if you're getting started that you're going to be familiar with in using. People always use it as part of their CIC pipeline as a quick way to get started or all the way to production. As part of the project, we also provide a GitHub action to have pack accessible so you can actually just like leverage this in a GitHub action workflow. K-Pack, which was recently brought to the project, is our Kubernetes operator for that. And then at the other end, we also have the Spring Boot project, which isn't associated with the project, but they also have a way to kind of build build packs right from Spring itself. The easiest way to actually distribute build packs is through a concept we call the builder image. And so this essentially takes the build packs that you want to run. We've been in them into the image. And then we have this concept that we're moving away from called stack that essentially is your build and run image. And so all those things combined, turn them to an image and you can treat it like any other image and you can use that to essentially distribute build packs as well as your base image that you're using. And then we also have the life cycle. So the project itself is mostly a specification project that kind of defines the interactions between what a build pack author needs to do and with build packs as well as like how a platform interacts with it. And so the life cycle kind of sits at the center and is the build pack runner that combines those things together and allows us to kind of do all the magic that we're able to do as a project. And so those are kind of the core concepts. You'll need to understand what we're going to be talking about in the talk. Yeah, it's really that simple. That's all you need to know to get started. But this talk is about a lot more than just getting started. It's about how we use build packs to deliver multi-architecture builds. And we're going to use Salesforce as a case study. So as Terence mentioned, I'm a principal architect working at Salesforce on our Hyperforce platform. Hyperforce is just a fancy way of saying Salesforce running in the public cloud. It was delivered originally about four or five years ago. So we've been running the public cloud with great success for some time. Our customers are happy with the scaling and the elasticity and the data residency and all those things that come with the cloud. But we also have to make our shareholders happy. And that means raising the bottom line. There's a few ways we can do this, but I think many software, organization, software companies are doing this by driving down cost to serve. Which is really just another way of saying wasting less money in the cloud. So lots of different ways to drive down cost to serve. You can right size your services and applications. Make sure you're not wasting money on excess resources that you're not using. You can strategically locate your compute sort of arbitrage where you're paying less price over here than over there. You can write more efficient code or you can just simply pay less for infrastructure. And with the introduction of AWS Graviton, this is a very real situation and something that provides a lot of incentive for large organizations like Salesforce. So AWS Graviton is a new series of server processors that are based on the ARM architecture. As opposed to the x86 architecture that we've been using for so long for a couple of decades. ARM is by design more energy efficient, uses less power, generates less heat. And therefore platforms like AWS can charge less for them. So typical software organization may save as much as 40% on compute spend by switching to Graviton. So Salesforce has a very large AWS footprint. We have our core Salesforce CRM product. We have properties like Heroku, MuleSoft, Tableau, Slack. So I won't quantify this, but I will say our footprint is larger than your footprint. So we stand to gain a lot by switching to Graviton. But cost to serve is not the only reason to do this. We also have internal developers that are working on Apple Silicon now. And so even in our developer experience part of our product, we have to deal with multi-architecture images. So all that said, multi-architecture is not only coming, it's here. And as software developers, we have to accept that the free lunch is over. We've gone for 20 odd years, not really worrying about things like processor instruction sets, and now we have to. It's very similar to when multi-core processors came about and we have to start worrying about concurrency and making sure that our code is safe for concurrency. But before Salesforce started this journey and started actually lifting its services on to new architectures, we had to do some work and pack to enable pack to produce the builds that target the architectures that we're trying to deploy on. And so Terrence is going to talk a little bit about that. Thanks, Joe. So when we talked about multi-architecture for build packs, what you care about probably depends on where you fit in the spectrum of the end user for the project. And so kind of all the way at the one end of the spectrum, ultimately at the end of the day, as a business, you want to deliver multi-architecture images that can run in production, like Joe was talking about. So these are kind of the app developers, right? Like they don't really care how they get these images, they just want to be able to build them, right? And then you have build pack authors who are building these build packs. And in order to support these app developers, they actually have to be able to produce multi-architecture build packs that can actually do that thing. And then you have the platform operators actually running platforms like Hyperforce or your Google Cloud Run or other build pack platforms that have to be able to kind of support these use cases. And so they have to be able to be using pack as part of that CID pipeline, like pack has to be able to run in both all the architectures you want to support. Lifecycle has to be able to do that as well. And then also the builder images that actually contain these build packs and the base images also need to kind of support these things. So we actually have to go and support a bunch of different things, right? And so as the project, we created this checklist of the things we need to do to actually support something like ARM64. So luckily for us, we've been building pack and lifecycle binaries for both AMD64 and ARM64 for a while.  But most of the build pack vendors aren't actually producing ARM64 build packs, which makes it kind of difficult to kind of support these use cases. For the stack images, for the build and run images, you can inherit from an ARM64 image already. So that kind of makes it much easier to kind of get those.  So without those ARM64 build packs, you're not going to get ARM64-compatible builders. And so these are the areas we're really going to focus on. So the first place we wanted to target was for these build pack authors to actually kind of produce these multi-architecture of build pack images. And to start, we wanted to provide kind of the low-level, like the low-solve primitive similar to Docker manifest of like actually being able to produce multi-architecture build pack images because at the end of the day, when you're distributing a build pack, it actually is just an OCI image or a layer inside of an OCI image. That's one of the main distribution mechanisms. And so we take one of these things. This is the kind of blowout of what that looks like. This is an OCI image with the build pack layer, and it's just pretty simple. It has configuration and then the build and detect that you need to actually execute the build pack itself. And then if we do a Docker inspect and inspect the OCI image config, you'll notice that the architecture itself is empty. So it isn't architecture dependent, which makes it difficult when you're actually trying to run this thing at the end. So what we actually have to do is we have to produce, if you're not familiar with the image manifest inside OCI images or Docker, is that we have to actually produce the image for both architectures independently, and then we have to link them together inside of the manifest. And so the manifest is just a JSON that points to the essentially full images that are out there for each of the architectures that we want to support. And so in the next release of pack, we're going to have these commands. So you don't have to kind of go out to your podman or Docker to kind of do this, that you can just use pack to create the manifest, annotate it with the architectures that you need. And in this case, it's going to be AMD64, ARM64, point to the images that it needs to kind of point to, and then push this image to the registry so you can actually use it. This is actually a bunch of work, and so we're not exactly happy with this, but at least kind of gets you going and off the ground. And you, like I was mentioning, they like podman, Docker do allow you to kind of do this already today. But we do want to bring a bunch of this stuff in the house. And so there's a current RFC that one has that is what we're calling phase two, that is about improving the developer experience around this. And so, you know, we have those commands that I showed in this phase one of the next version of pack that's coming out soon. And we're going to replace that with a single command. So you're going to be able to run pack, build pack package and enable multi architecture and have it actually just build that manifest and link all that stuff for you without having to kind of do all that stuff by hand like you have to do today. And any of the tools that you're gonna do when you're doing any of this stuff kind of in this ecosystem, right? And so the way we can kind of get away with that is that there's kind of two key changes that we need to introduce into the system. So the first one's gonna be that we want a new build pack directory layout that actually is multi architecture aware and can basically differentiate between the different kind of build packs that we want to have for the different architectures. So using our current example, you'll see a directory structure that looks like this that allows to basically in a single directory have multiple different architectures that we want to actually package the build pack for. And the second thing that is happening is that we've been slowly moving away from the stack concept and moving onto targets which more closely aligns with how things just exist in the OCI image spec anyways. And so this allows us to get more information around the OS and architecture information itself. And so as part of the build pack configuration, when we run that command, we know what architectures this build pack does support deemed by the build pack author. And in addition to that, to make this compatible with builders, we want to bring this concept forward to the builders as well. So that allows us to essentially have a single command once we have those build packs and we can point to them, essentially create a builder with one command not have to kind of stitch all this stuff together after the fact by hand. Yeah, so a lot of what you've seen is stuff that's coming in the future, but what is there today is enough to start doing multi-architecture builds with pack. We just hope that it'll get easier as time goes on. So at Salesforce, we're doing that. We're taking advantage of what's there today and doing a little bit manually and some extra steps just because of the friction. But I wanted to share some of the lessons that we've learned and some of the decisions that we've made in this journey is I think has the potential to help you. So at the beginning, we made a few strategic decisions. The first of which was that we weren't going to cross-compile. There's actually a lot of edge cases in cross-compiling. You hit one dependency or you have one language ecosystem like Ruby that doesn't play well because it has native dependencies or something. And you're in for a world of hurt, right? Next thing you know, you're contributing upstream to an open source project so that it can cross-compile. And we really just wanted to avoid that so we decided that we were going to go ahead and spin up build infrastructure that matched the target infrastructure we were trying to deploy to. And ultimately, this was, I think, a good decision. We're running pack build in the environment or in the architecture of the environment that we're going to deploy to and it just simplifies a lot of things. The trade-off, however, is it creates a lot of circular dependencies. So in order to get something running in this new architecture environment, you have to have stuff that's been compiled for it. So we did have to go through this kind of awkward manual bootstrapping process to get the images, our runner for pack and the build packs themselves compiled for the new target architecture. But then once they were in place, everything was running smoothly. So definitely a decision that we're happy with. The second strategic decision is that we would always build both architectures in parallel and then stitch them together at the end with Docker manifest commands. So because of some of the things that Terrence described that aren't available yet, we're using Docker manifest. And because we're building both architectures in parallel, it actually simplifies the developer experience for our end user, which is our internal Salesforce developers. They simply express that in their CI matrix that they want this new architecture and then from there we spin up the new build infrastructure, we produce the images, we send them to registry and everything is enabled downstream. And also doing this with Docker manifest created a level of consistency or homogeneity across all of our images. We use build packs a lot, but not exclusively. So a lot of the things that I'm talking about we're having to do for Docker file builds as well. So by doing it this way, the runtime clusters don't really care how the images were built. And so that uniformity makes things a lot easier for us and makes adoption of the new architectures easier for our internal developers. So some lessons learned. The first one is do not couple the migration to multi architecture to anything else. Many people, many teams in your organization will see this as an opportunity to fix technical debt and fix things that they've always wanted to. At Salesforce, we did have to upgrade our operating system to a real nine that's part of what was necessary to get onto the new Graviton processors. But with that came a lot of things like, oh, we should change the way that we create users and the different users that we create on the operating system and so on and so forth. And that starts to transform what should be a simple, compile it on the new architecture to now application developers are having to deal with interface changes and things like that. So just good practice, cut scope, focus on multi architecture and don't let those other things creep in. The second thing we learned is that services are going to need to run in a mixed mode. And I don't mean like longer term, like definitely longer term, some services will run on this architecture in that environment or this other architecture in this other substrate. But I mean in the transition process, they're going to run in mixed mode in a single environment. And that's because this is not flipping a switch. You're going to build on the new architecture, run some instances, test them, find some problems, maybe roll them back and then you're gonna iterate on it a bit. And this can take weeks, it can even take months. And during that time, these development teams can't just stop coding, they need to continue shipping features. So we needed to approach this in a way that would support the ability to run both architectures at the same time and kind of go back and forth between them. The final lesson learned is really about the user experience. I think thinking about how your internal developers are going to adopt this, how they're going to interface with it is really important. As I mentioned, we gave them a single entry point, this architecture definition in their CI build matrix, made it really easy for them. We then used things like admission controllers on the Kubernetes side to determine which services were going to which architectures. But really streamlined things for developers so they didn't have to think too much about the inner workings of what it meant to be configuring your HelmChart or your deployment pipelines or things like that. So in addition to the services themselves, as I mentioned, we had to actually build the build packs for the new architecture. We don't have the advantage of some of the things that Terrence was describing with the directory structure layout for different architectures. So we did have to kind of make some compromises. We had to upgrade dependencies in some places and remove dependencies on other things to get the build packs built. But once they were built, they provided a lot of leverage. If we compare the build pack builds and the build pack multi-architecture builds to what developers are doing with their Docker files, it's really something that we had to do once in one place and then service developers get leverage from that whereas Docker file becomes a set of instructions that people follow and copy, paste things and so on. Yeah, so we're looking forward to all the phase two stuff. I think when this is delivered, even as soon as pack zero three three, it'll just make the experience a lot easier for you and hopefully make multi-architecture real. I am a CMB contributor. Unfortunately, I was not able to be with you today on site, but here are the key takeaways from this amazing session. Support for ARM architecture is really important for CMB tooling ecosystem. But today build packs authors and enterprises struggle with hacky CI city processes to do it. We are working towards making ARM64 and multi-arch images a first-class experience in vehicle bags ecosystem with functionalities that will allow you to create and maintain multi-arch images effortlessly. As always, we are happy to hear from you and your feedback is very valuable for us. Please keep in touch in our social medias or join us in our weekly working group meetings. Yeah, that's all we had for the talk today. So thank you. Again, this is the QR code for the rating. Please join us in the Slack. I would say come to the booth but I think that is closing the next eight minutes. Reach us out on Twitter and then the build packs kind of GitHub group. And yeah, I guess we're open for questions. People have been excited to hear that you're saying you're focusing on this target base builds and away from the stack base builds. One consideration I wanted to ask that you consider using stacks for avoiding duplicating files and artifacts that are architecture neutral. So if you have no data files that are going into the image that are pretty much identical for Intel as well as for ARM, how is Build Pack going to avoid this wasted duplication? So let me repeat the question and see if I understand. So you're asking about like artifacts or things in the service code that are either architecture neutral or something that maybe you don't want in that architecture and how to... No, that are architecture neutral. So if you have data files, if you have like huge static files that are simply the same for both architecture. So are we going to avoid having to have that stored twice in the image? Oh yeah, store in each of the two images. Yeah, do you know if there is a solution to this? I mean, it's just player sharing, I assume is the only thing. Yeah, I mean, one of the advantages of Build Packs is that they can like given a Build Pack that's creating a layer for whether it's, whether it's compiling Java code or installing the JDK, it can produce a layer with a SHA that is identical to another execution of the Build Pack that did the same thing, right? And so it doesn't matter where that fits into your image, that can be deduped. So this all depends on the design of the Build Pack, but if the Build Pack is written in a way that it takes that artifact, that large file, stores it in a layer consistently just by nature of the Build Pack execution environment, which does things like strip timestamps so that you will actually get the same SHA, that can happen just automatically, so to speak. But it does require effort on the side of the Build Pack author to make that happen. All right, well, we will be around for the rest of the day. Please grab us if you'd like to chat and we're always happy to talk about Build Packs. So thank you everyone. Thanks, Naran.


The Bloom study aims to evaluate the impact of a government-implemented agroecology program on pesticide exposure and dietary diversity in agricultural households. This study will provide robust evidence of the impact of a large-scale, transformational government-implemented agroecology program on pesticide exposure and dietary diversity in agricultural households. Additionally, it will provide the first evidence of the nutritional, developmental, and health co-benefits of adopting agroecology, including malnutrition as well as common chronic diseases. This article was authored by Lindsay M. Jax, Lillia Bliznashka, Peter Craig, and others.


Hello weaver it's actually why from it's a weaver. It's a wife. I know but they don't tell the viewers They think it's a weaver Do you want heels no, I've got heels you were hitting hit, okay I'm not a hitter No, I'm a support you have more damage than me. No, I'm putting on my healing gear after this No, you have more debt. Yeah, we don't want to be here all day Thank you wrong That's not my fault is it get good pips, huh? Sorry, I'll get a hundred percent power, but you know Good okay, I will do it. Yeah, you won't Yeah, that's right. Yeah, that's right. Yeah, I will. Yeah, good. I will It's frozen boy. He's a he's pretty chill He's mean. He hit me. He's pretty chill, you know, just a chill dude. No, he's mean 100% can confirm. He's chill No, he's like an ice cube. You can't be more chill than an ice cube, you know Nice me like you're mean I Agree, I don't like you Thank you for tuning in to the road 100 series. We've come to a standstill now because Brent's bullying me Yeah, I was actually really funny is We've been like left on a like cliffhanger of road 200 and the last bit was like we're quitting and I haven't posted one in like two weeks. Oh Oh Yes, it's over. Yeah, it's 100 is actually over. So, you know guaranteed like this is this is it Yeah, we're finishing Celestia and then we're leaving. Yeah, we are actually finishing road 200 at the end of Celestia Can confirm. Yeah, this is the end of road 200 of road 200 forever It's been it's been a pleasure, you know, tuning in for you guys We kind of just decided that it's not worth it anymore Yeah, providing you with content when we can But yes, this is the end. I just barely killed that guy So, yes, I hope you guys did enjoy the road 200 series flashback Really, we need three Yeah, we need three. You're not you're not believing in our power, Brent. You can't get three from two people No, it's physically impossible. Nah, nah, nah, okay? If you get them if you get them all this run all this one thing You owe me a hundred dollars If I get them all yeah, this first battle $100 if I get them all through in this battle. No, no Is this a loot? Is this loss? Yes, this is lost Yes, very much loss and a flashback. I didn't get any of them. Ha ha hundred dollars, please Um, I got one. I didn't get one dude. No, you got none. Yeah, it didn't even get one Wow, why did you go first so rude? Are you like that? Are you like the support or something? Jeez? Who do you think you are? I support people these days. Oh, so disgraceful. Oh Okay, how do you In this economy What economy this economy There was a 101 economy.  I support without cleanse I start off this episode of thinking I would hit and then forgot that you had woodworks gear So I'm sorry and take the time to transfer over a hundred cleansed charms From my death to my balance because I never go on my balance because we never record Sorry about it. Maybe next time I remember I understand When it suddenly gets way too real for you So I'm like, what's going on? What is my life become? Oh my lord I'm suddenly tired all the time.  It's not I'm not I'm not happy right now Yeah, it's it's not it's not very cool. I want to be I think I haven't eaten lunch so probably not probably why it's like three p.m. How have you not eaten lunch? I forgot that lunch was a thing essentially. I forgot about food for a minute. Sorry I forgot about food for like two hours. Yeah, sorry about it. Uh, I forgot lunch was an actual word Meals that you should probably have you know, yeah, I mean food food is just like food food Who needs that? You need it. Yeah, dude. Who needs food? Oh, those kids in Africa are just you know talking about nothing really They should they they don't need to eat Cut that one out the video. No, we're not cutting that one out. No, please This is this is a great clickbait title. This is how we do it Finn hates Africans. What? Oh my god, this is bullying. Finn's racist. What?


Okay. So thanks everyone for joining me today. I'm really excited to share with you this very unique resource that most of y'all may not be aware of, or you remember it back from like orientation when they were like sharing a bunch of information with you so my name is Paris Whalen and I am the Media Literacy Librarian here at UTK and before COVID-19 I spent a lot of my time in a space known as the studio. So for those of you who are unfamiliar with the space, it's basically the creative media center of the library. So this is where students come to do their graphic design, their video projects, audio recordings and things like that. Okay. The purpose of the studio is basically to help you creatively communicate your message using a combination of different media forms. So we're talking your audio in your video or your your PowerPoint and your audio stuff like that. So with that being said, I kind of want to take a look at the studio and what we have to offer who our staff is and what are available spaces I'm going to be during this very odd time period. All right. So on to my next slide. This is our lovely studio staff. First off we have Michelle Branagh. She's the head of the studio. This is basically her brainchild. She knows everything that there is to know. She helps us manage our software and make purchases. Shelly is our studio manager and her purpose basically is to focus on the expertise for video and photography. That is her expertise. She's really good at it. So if you have any questions regarding that, she's the one you want to hit up. We have Trey Hobson, who's our technologist. He helps manage our software on our computers in our actual computer lab and he helps update them. He also is really good with audio. So if you are creating a podcast or if you're recording a song, he will be the person you probably want to talk to at some point. And then there's me, the media literacy librarian and my focus is mostly on graphic design things because that's my background. So we're talking logos, posters, anything along that line. That's what I handle for you all. So we all have more than enough experience to get you started on a project. We also have enough sense to know if we need to pass the buck to someone else. So feel free to reach out to any of us if you have any questions regarding your project. So now that you've kind of seen the faces of the studio, let's talk a little bit more about our physical space. So we are located in Hodges Library in the South Commons in the far, the farthest desk on the right hand side is our public facing desk right now. And I say quote simply because obviously we are not doing in person consultations and things like that at this time of year due to COVID-19. So what you see on this slide is basically what we do have available to you all. So the studio has a chat service just like the library. So if you need to contact us to ask some questions about something simple such as I need to customize my slide in PowerPoint and I don't know how you can chat in and ask us. And we will gladly set up an instruction or consultation and I'll show you how to do that and a little bit. Okay. So we have our video and graphics stations. That's these two sections right here. Our graphic stations are our single monitors. They're usually set up with a scanner attached to it so a negative film scanner like your 35 millimeter films or your letter size scanners. And then we have our video stations and the only difference between our video station or graphic stations is that our video stations have dual monitors, meaning that there are two just to make your video editing process a little bit easier. Okay. These are attached to two types of scanners we have our 11 by 17 or 12 by 18 big scanners. And then on the backside right here these towers that you can't really see. We have digitization equipment so if I came in and I wanted to digitize my 1996 Christmas video where I'm wearing Christmas sweatsuit and black and white cowboy boots. This is where I would come because I want to keep that memory from ever obviously. Finally, we do have our print room and I bring this up because a lot of people ask about it. Our program is stuff only but it's specifically for large format print so if you need to print a poster or anything that's over 11 by 17. You're going to submit that to us and we're going to take care of it. And I'm going to show you where to do that as well. Right. Now, COVID-19 has changed a lot of things for us obviously so I wanted to show our spaces that we do have still they still exist and I'm sure some of you have heard of them or experienced them. But they're not able to be used right now because they are high touch environment which is not safe for CDC guidelines. Right. So, first of all, we have our desk this is where usually a student or staff members sitting and we are available to help you and get you started and check in. All of this is now online. Okay, so can we have our audio room right here, not available but we have keyboards, microphones and other software that's already installed in this room and ready to go. Okay, this is where people do their podcasts and things like this. We have our video room up here whoops in the top corner. This is where you would do any video production we're talking your green screens. We have 4k cameras, your photo shoots, your interviews. This is a really great space that we found to be really useful in the past. Shelly uses a lot to do some stuff at the library. So hopefully whenever we're able to open it back up you all can experience it. Next we have our VR room. Basically the VR room is what I'm telling you what is not available at this time because we have gotten a lot of questions about the existence of virtual reality. But why they can't use it and basically that we have the HTC Vive and it sits on your face. And right now that's not okay so we do have this available whenever we are able to come back in and work together or play together really. The virtual reality room is more of a, it tends to lean towards leisure side of things so people play games like Beat Saber and things like that. However it has been used in classrooms to say you use Google Earth and kind of discover things around there that you would notice or to look at museums and things like that. Now that we have our whisper room right here and this is where people just record audio. Now this has like cloth all over it so therefore we're not using this room either but these places do exist. So what we have done is a studio is a dot to this. And so we moved our online, our public service desk online. We've created a bunch of guides for easy access and practicing different ways to basically help our patrons, who are trying to be successful media creators so while these rooms are unavailable. We have compiled alternative ways to recreate these spaces, which leads me to our next slide which is basically our website. So if you'll drop that in a chat for me, I'll send an end the show and I'm going to navigate to our website and just talk to through that really quickly. Alright, so this is where the studio website lives. Lib.utk.edu forward slash studio right here on this right hand side if you have any questions for us this is where you would go chat with the studio and our online chat hours are right down here. Alright, so if you try to contact us outside of those hours more than likely you'll get a overall library employee and they will send your request towards us, or you could just send us an email and get in contact with us. Next I'd like to talk about consultations. So, consultation sorry and instruction, consultations are basically one on ones or one on groups with groups where we kind of break down what the project is what you want to do and we assess where your skill set is and how to get you to point B.  And what's your final project to possibly look like. Now the instruction sessions a little bit different, simply because that's usually a professor who request that. And in that case we do like a general overview of the studio and our resources but we also give some very specific software for the project they're working on but it's not based on say individual skill sets just kind of you know begin our intermediate and advanced we give you a bunch of options alright. So something else that's really important is our office hours they're not often taken advantage of but they're very very useful. During these times right here a studio staff member is on standby on zoom, and we're just waiting for some to come in and chat with us about whatever they need help with so if you need to like I said resize the PowerPoint slide, you can drop in during these hours, and they'll add in and they'll give you a zoom link, and I can show you how to do that we can do a Camtasia so you can remember there's a lot of options for us so don't let us being virtual scare you. That seems to be a problem right now people think that just because we're virtual they can't get help from us, we absolutely can help you. Alright. Over here on our left hand side we have more information about the studio so we have like our workstations and equipment. We have more information about what kind of software we have as well as what equipment would be available, if we were at home right now. This includes most of our stations are we are pre loaded with software they're not all the same software but there's generally a couple that are always on there so we're talking like your Adobe cloud suite. We have a movie audacity for audio those types of things are most of the computers but we do have specific computers that have software like rhino and Camtasia and logic on it so if you have questions about what kind of software we have you're welcome to come here or you're welcome to just chat in and we will let you know okay. Down here we have our large format poster printing. So if you need to print a research paper. You can click on this link in it will take you through the steps to submit one to us and we asked for just a 48 day lead time okay. Once we have our instruction consultation again, we have our comments equipment does which I'll talk about in just a second and then our recommended tools okay so early I was talking about how the studio has made some tools tips and tricks for y'all to go through, even though we're not in person or to visit the sites and just see what we have available and I'm going to open this a new tab and kind of show you what's going on. This is basically a live guide which is an aggregation of information or research research on a particular subject and ours is obviously all media related. And you can go through by the media format and see what we have to offer you so for example, Shelley did our videos have and she gives you some software that we have available at the studio, some basic guys that she makes for whenever she's out in the field. She gives us some tutorials for the software. There's some beginners there's some more intermediate and advanced like Adobe Premiere and so on, and she also gets some resources such as ebooks and journals if you want to know more about a specific time period or something like that. Okay, and that goes for each one of our media types so print graphics line audio podcasting and photography are the same thing. Because y'all are unable to check out some of our more quality cameras and digital cameras and just really nice constant things like that. We have made a nice tab here called the smartphone smartphone media production guide, and this is going to teach you how to use your basic cell phone. You can use your Android or iPhone and make some really decent video so take some time to go through this not everyone has like a super fancy camera at home so might as well make use of what you have okay. She'll just put together some really awesome resources, including ways to record sound without going out to buy some fancy microphone, you know you can go back to your old pillow for and things like that. I have a content and resources page. This includes all of the, not all of them but many places that you can get royalty free images and video resources so if you need to make a video you don't have the ability to film something or you're struggling, you can get a clip or you can get some music to put in over your clip from these links right here so don't be afraid to use them. We can help you figure out how to incorporate them into your work. The final thing I want to show you is the studio is right down the studio desk is right down the. I want to say hallway space from the equipment desk and even though we're not lonely out equipment, the equipment desk is. And right here on the left hand side we have a link to their desk, and you can see exactly what they have available to you to check out okay. And one of the things I mentioned earlier was, here we go, tripods and iPads and things like this, this is where you can check them out and it just has a date where you need to return them okay. These are, they are high touch, but these are easy things to write down versus say a camera so just be aware of that. So now I'm going to navigate back to my PowerPoint. And we are going to talk about how, even though you know the studio seems very amazing it's very intimidating for the most part let's talk about how it kind of ties in with your experience as a first year student. So some of your coursework may require you to create a media project okay. So these products range from recording, you know, over a PowerPoint to doing a video resume that includes your logo and some other things that are part of your personal brand. There's a general process that the studio follows and I think will be very useful for y'all to know so you know what to expect from us and it's not just like some vague cool space that you feel intimidated by okay. So, first thing I do want to make clear is, yes, we are in educational space, but you are able to use our space to work on your own personal projects so, like I said earlier. If you want to digitize that VHS with your UV and your Christmas lights and your cowboy boots, we can help you do that all right. So, starting out with your project, there are two things that could possibly happen. Your instructor could assign it to you and set up an instruction session with us, or you could set up a consultation with us and just move forward or you can. You can have an instruction session with your professor and then you can come see us for consultation because maybe you need some more in depth information. Either way, this is generally the next step for most people. So after you kind of have an idea of some software to get started with in some of the steps in the process, even if you're a little, you know, confused, you can kind of start creating. So that means you taking your, your script, your different iterations of your logos and things like that and you drop them into the software and you start playing with them and this is when you can chat in with us, or you can zoom and we can help you problem solve, or we can help you learn some tools that will be useful in this particular subject. And then the final thing we do, once you feel good about your project is help you preserve it. So that means we help you save it so that it's editable, editable in the future. And it's something that can be exported and uploaded easily to either Canva or wherever you need to share it to. Okay, so we have the tools, we have the experience and if we're unsure, we will definitely find the answer for you. So if y'all just take a moment for me I know that was a lot of information about the what the studio has to offer, but what kind of projects have you been assigned in the recent on the past that the studio could help you with I think this is kind of a good way for us to learn together and see if we're meeting your needs, or if you need more information about what we do so if you guys will go to the outlet link that Alison is dropped and just fill out some things that you think the studio can help you with, I would greatly appreciate that. And I'm just going to pull it up on my screen. Yes, learning to edit videos. Yes, we have tons of software for editing video between iMovie, Premiere, Final Cut, we can teach you all the vocabulary that you need to get there. Okay, Green Screens is a really, really fun one. I'm going to show you an example of that in just a little bit. Captivates a fun one, we use that a lot. We also use Camtasia. Oh, you use a whispering for a podcast assignment. Yes, we recording an audition video. Yep. An ePortfolio, yes. Many of us have done ePortfolio so we can help you with that. Doing service is a really big one, especially right around Eureka and stuff like that, and using Camtasia. So great. So it seems like you all understand what we can help you with. Do y'all have any questions? I cannot see the chat. Nope. I don't see any questions in chat. Oh, here we go. Does the studio have Photoshop? Yes, we do have Photoshop. We have the entire Adobe suite, and we know how to use it. So watch out world. A couple seconds for some more questions if y'all have them. So y'all know what we do. Y'all seem to have an understanding. Last night it was really late but I decided to put together something really quick. I gave myself 10 minutes to kind of showcase some things that the studio has worked on. And we've all learned together on so I put this lovely video together for y'all and I hope that you enjoy it. And let me know if you can't hear it, okay? All of my staff.   Dancing? No, that ain't dancing, Sally. Fine. You're sneak. Remember to be thorough and percent decent work because either Shantae, you stay. Three hops and signing off at WVLT 8. So I hope you all enjoyed that. My favorite is chilly doing the music for the newscast. Every time I watch it, it makes me a chuckle. But basically this is what the studio has to offer and many, many more things. This is us learning together and just like y'all, we don't know everything, but we are here to help you and help you get to where you need to be. All right. So that basically concludes what I'm going to talk about today. Thank you all for taking the time out to hang with me and let me share this with you. If you have any questions, you can feel free to email me at pwailin.utk.edu or you can ask me some questions right now if you like.


ڈ电磡 ڈ叶 ڈ direction ڈ  committees are being� свои lines by agree on financing his आर अग्प्रु सिंटेइबा


Well, we're big GoPro fans in our house, but we've been talking to Michael Rubin of Yee Technologies And he's got what he says is a GoPro killer. Why don't you tell us about it great? Well, I actually didn't say that but a lot of the press have been saying that oh, that's who you were quoting Okay, got you voting. Yes. I won't take credit for that statement. I won't disagree either So tell us about he's got an answer. This is audio and video by the way, so describe what you're showing So this is the 4k plus camera. This camera is the only action camera that can do 4k at 60 frames per second So you can over crank and you can get that slow motion action There's nothing else like it and in terms of battery life It does over 70 minutes at that level and it is so small so lightweight and so well designed It has comes with the waterproof housing and it sells for 339. So it's cheaper than the hero 5. Yeah, exactly You don't need to be a hero now There it goes. Now. I was really impressed by the display on the back. So the display is really bright and Really intuitive and in general it was faster. I'm going to tap on screen there I'm going to do a slide to unlock for you. Wait, it's the other way That was the only thing so I tap on screen. I can change from photo to video. I'm doing the demo for you there I can go into time lapse video and it's it's just really fast and responsive Uh, where did how did I get to the settings? Here we go. I've got the resolution at 12 megapixels I can bring that down. I'm really doing the ad for you here, aren't I this is great. I'm just a hand model I love this. Yes. Yes So Michael is a fine hand model. Yeah, what I was gonna say is this has a 2.2 inch screen It's a touch screen. It's incredibly responsive One of the best things about it is that the umbrella h2 chip in here is really low power It lets you power up the screen. You're able to do touch screen. It's got remote. It's got live streaming It's got voice command. So there's absolutely nothing you cannot do with it. Did you say voice command? It has voice command. So you'll be able to say start shooting stop shooting You don't need to touch it. You can actually do what you say unlike the other smart assistant Yes, it does. We've trained it well Well, that's a new thing all by itself So if people want to learn more about the the yee, where do they go? Best place to go is yee technology. That's yitechnology.com All right. Very good. Thank you very much. Oh wait. Oh, yeah, are you shipping? Oh, absolutely. You can order it today and get it in about two days. All right, sounds Price points at $3.29, right? $3.39. Sorry, $3.39. Don't hurt yourself. I'll give you the 10 bucks off Just for you. There you go. All right. Thank you very much, Michael. This is pretty cool. Thank you. My pleasure You