Hello everyone and welcome to today's advent of code. We're streaming a bit early today Because I have an event to go to Let me just finish it. Sorry. I forgot to set up one thing But it's yeah, we're half an hour off before schedule. So Yeah, it's yeah, we're half an hour So when people then Tune in eventually, you know, I'll be fine. Huh? Hey tan up zero. Do I know you? People have all these handles. I can't remember who's who but I feel like I know 10 up from somewhere It's like a planet Or yourself Anyway, welcome to the stream. I have to admit I My friend was discussing this problem today So I know how the output Input looks not the input. Yeah, how the example looks, but I haven't you know, I haven't like worked on it But I gave it a tiny bit of thought. That's just what happened. Oh, you see the input in there Anyway, let's get started on today's advent of code. By the way, is the audio working today a Because yesterday was like working on the recording as working in OBS But it was not working on the stream. So I hope Yeah, sounds good great Okay, so today We're yesterday we had like a machine and we were exploring the virtual memory of that machine now We are Looking at tree houses Tree top tree house. Okay So are all planted and carefully in a grade The excelsis when the previous acquisition planted these trees is your reforestation effort now They're curious if this would be a good location or tree house first determine Whether there's a good enough resin of tree cover here to keep a tree house hidden To do this you might to count the number of trees that are visible From outside the grid when looking directly along a row or column Okay, good. They also already So I knew this right we were talking about some length over I thought maybe we had to do diagonals And that would be really hard, but now we're actually only looking at rows and columns Okay, so they already knows a quadcopter and Each tree for some of that single digit would well use its height Where serious shortest in line is the tallest a Tree is visible if all of the other trees between it and an edge of the grid Are shorter than it Only consider trees in the same row or column that is only like up down left right from any given tree. Okay All of the trees around the edge of the grids are visible Is there already any eyes or no trees black moves in the example? I don't leave the interior nine trees to consider. Okay top left five is visible from the other top Okay The 16 trees are visible on the edge another five visible in the interior a total of 21 trees Consider your map how any trees are visible from outside the grid. All right, let's start off By grabbing the example This is fun because a Seems like we have an actual, you know, we actually need to do work That's not just a parsing, right Okay Module main where so is everyone here to know Haskell did anyone here listen to the Haskell interlude this Haskell podcast You're recording an episode today And I think it turned out okay read input is gonna give us a file path to IO and we're gonna return a list a little something we're not gonna do any fancy array stuff today read input equals parts that over read file Where parts? Okay, so first We're gonna split into lines, right? It's gonna be a list of strings and now we're gonna do map a Dig it to int I think it's like this Let's say import data.char Dig it to int Fmap and pars. Let's say pars is supposed to take pars. It's gonna take String to a list of ints, right? Dig it to as a lines Map map dig it to int. I think it's like this. Now, let's see here read input a Example Into print. Let's see a CD8 ghc oh day 8 a day 8.js and we are gonna Day 8 we're gonna time it also Okay We got the input so What I'm going to do is so I'm gonna I'm gonna So because we're always gonna look like okay, so so like from this side, right? So I'm gonna consider it like so first like do it like like a scan like this, right? 303.7.3. So check which is visible from this You do it like this, right? And then I'm gonna reverse and check what's Visible that way and then I'm gonna transpose it and then I'm gonna trans reverse the transposition. Okay a so Let's actually now a Let's map like let's map this let's add the coordinates there Okay, so a add chords It's gonna be a list of ints to a list of list of int comma int And these are the chords because we don't want to We don't already print them right add chords chords, okay Okay, this is gonna be sip with zero Sip with sip zero. Okay Do do do do do do do so what is the problem here? Uh cute match type a zero b zero review with a Sip with a inner The type of this inner it's gonna take a list of hints. Ah What if I do? Oh, yeah, okay, because it's gonna be It's gonna be the other way around So this is gonna be it's not gonna be this type, right? So it's gonna be int comma This is sip with a sip sip zero Okay. Ah, no, right. Okay. Yeah. Yeah. Yeah. Yeah sip with this is gonna take like the Okay, this let's let's make it back into the original chords int comma int Int okay, so sip with okay, so this is gonna take the like the row index Row index and it's gonna say a Sip with okay And then we're gonna take the the column index and we're gonna take the value Okay, and we're gonna return Row index column index Value Okay, let's see here And now let's turn this into map m print. So it prints every line Let's see what that does Okay, it prints every line and now we're gonna say add chords So it's supposed to be like yeah, zero zero three zero one zero zero two three Okay, and now we made sure that uh, so we're gonna collect all of the chords Of the ones that are seen Um, and then we're just gonna make sure that we're not doing too much like over counting, right? Okay, so variations of ours Let's call this a type Coord A type chord Co-coord list Equals so variations it's gonna be So now we're actually not gonna we're just gonna join them. Okay, so that's gonna be again a list a list of hints It's gonna take a list of this and we're just gonna go like copy things so variations of x's equals a A x's plus reverse x's plus transpose x's Okay, so First we're gonna we're seeing the uh, no I need to map reverse x's Okay, let's let's print out the variations here. Okay. Okay. So first we have a axis Okay, then map reverse axis Okay, and then we get them all from the Uh from the other side, right so in the other direction, right? So it's This is the first one And then it starts with four zero four one four two four three four four zero, uh Right. Now. This is the first one. Yeah, okay, and then it starts with from the other direction Okay, and then we're gonna say plus plus transpose axis Plus plus a map reverse transpose X's So these are all the variations Okay Now we are gonna say a scene in a list of uh int comma int comma int Okay, so in one of these lists So we are gonna have the scene here scene Okay scene of empty list is empty list Ah wait, so scene equals scene. Let's say scene equals scene prime Uh, and then we have the min so far This is gonna be zero Because that's a minimum height so far Where scene prime a min so far Ah no, this is actually max so far max so far empty list equals empty list So we don't actually care about this one uh scene prime a Max so far a max so far And this is going to be a Tree and so it's going to be the cohort and the value We don't actually care about the cohort here So we're going to say a and then the rest so Okay, so are they visible if they are If all that is between on the edge of going are shorter Okay, so if it's shorter Let's see. So max so far Okay, so let's say a case V bigger than max so far equals So then we're going to say tree Add and then we're going to add the scene prime a v A r otherwise it's just scene prime max so far r And now it's complaining because I think this one is not Correct, okay Now let's so this is a scene and I want to say Print variations and then I want to say Map scene Okay, now we get a bunch of trees. So from the left edge We can see the three and then we just see with just the three and then we see the seven Okay Now I am going to take the first of all of these. Okay Map a map fsd Well map scene Map map fsd Now we're going to drop all the values. We just get the cohorts And then I am going to Make this all into a set. Let's see the task one It takes in the list of little pins and it returns Okay, now that's going to be all this stuff task one equals. Okay. Um Task one So we map and we have all the cohorts Okay, and then we do a set dot from list Import set for this import a data dot set set Import qualified data dot set as set So we map all these sets and let me do a so then we have I'll uh a list of a Sets and then we do that dot unions And we're gonna do a set dot science now Print task one Boom 19 I feel like the answer is 21 Yeah The answer is supposed to be 21 We have some zero sized trees Yes, we did have zero sized trees on the edges. So we started out with zero Okay Let's see if this works for the input. Maybe we felt Let's see. I didn't do input Okay, maybe this might be too slow 12 milliseconds. Let's see if it's correct though. All right We did task one at 20 minutes All right, that's not bad. I think that was quite good. I mean, but it was also like I suspected like the input was crazy high Uh, like I'm big but I thought okay, maybe yeah ah looking up Okay, let me check Okay and Let's see Okay, then with the amount of trees of the coverable else just need to know the best part to build the tree house They would like to be able to see a lot of trees To measure the viewing distance from Q&T look up down left and right from that tree Stop if you reach an edge Gonna be a lot messier The elves don't care about a To measure viewing distance from a Q&T look up down left and right from that tree Stop if you reach an edge or at the first tree that is the same height Or taller than the tree under consideration If a tree is right on the edge at least one of its viewing distances will be zero Those don't care about distant trees taller than those found by the rules above the proposed tree house has large eaves to keep it dry So they wouldn't be able to see higher than the tree house Anyway Looking up its views have locked you can see one tree Looking left its view is blocked immediately you can see only one tree Okay, looking right as you look up I can see two trees Looking down its view is blocked eventually you can see two trees One of height three Then the tree of height five that blocks its view A tree scenic score is found by multiplying together viewing distance in each of the four directions Okay, for this tree This is four found by multiplying one times one times two times two So consider the tree middle of the fourth row looking up its view is blocked at two trees Looking left as views not blocking is a two tree looking down is one tree Looking right its views locked at two trees By a massive tree of height nine Each tree scenic score is eight Okay, so we just find the trees and then we're multiplying That tree scenic score is eight. This is the ideal spot for the tree house Okay Right So it definitely maybe do we definitely want one that's like seen from the edge? Okay, let's see I'm not like I'm not getting an idea here like oh, this is a good algorithm, right? I feel like yeah, we can't we could just calculate the score for all of them, but that would be A waste right, uh, is it going to be some dynamic Thing all right to where like the score of tree three Is equal to It's going to be like equal to like the scores of the trees around it, right? because Yeah, so like the the the right score of tree three is going to be Uh, it's going to be like one. Let's see what we can do here some dynamic programming stuff Okay, and Anyone have so anyone has anyone solve this part? I'm gonna have like a good idea here Um, okay, let's say let's change this array. Okay. Uh, now, uh, let's see a Data tree is going to have a tree It's going to have a height It's going to have the Courts, uh, it's going to have the These are the things we're going to be updating right it's going to have the left value It's going to have the It's going to have the up down left right like up up value Down value Left value and right value Left value and Right And and right okay now. Um So let's say let's actually create these trees. Okay. Now, uh task two. Okay, so let's say two tree Takes a list of these Takes a list of these and returns a list List of tree two tree Uh, yeah, okay. No, this one takes a it's actually just takes it Okay, and a it takes a returns a tree And it's going to be c and v and this is equal to t So the h is going to be the value Let's just call this c actually C and h is going to be v and c equals c u equals zero d equals zero l equals zero and r equals zero now let's say here a read input example Example and let's print a Add cohorts and and then two tree And I actually need to do driving show and I'm gonna say a It's gonna be map map and let's see what it says Ah, yeah, of course, it's gonna be like a bunch of Let's do map And Okay, so these are the trees Okay, now Let's actually write the instance q eq tree where we're gonna say t of c equal c a c1 equals t c equals c2 is equal to c1 equal to c2 So we just compare the cohorts to make the trees, right? Let's just actually t1 equals is equal to equal a c This is from data function Okay, and now we're also gonna We actually want to make this into an oar instance We would like to be like that heights, right? But actually we have to say compare equals compare on Coort, right? And then we're gonna have all the coordinate Okay, now we have this tree. Let's write a show instance Instance show tree where Show t We're gonna do some record pun in here We're gonna derive the show we're gonna say And show this is okay, so we're gonna just so each tree is just gonna be represented by a It's coordinate, right? It's gonna be a c c plus column plus a V now this is height All right, so these are all the trees and Now how do we compute this? Okay, so we can do it kind of a So if we're computing the left value Right that will only depend on the values of ones that we have seen so far Okay, so let's do that um Let's actually add the left value then to this Plus a okay, let's not show age, but we'll see your age And then we'll show the a U d l r Okay, so this is the current state of the tree okay, so To compute the left value we only have to look At trees in front of the list Right so to the left of the first one a So the left so So this is so Looking up its view is blocked immediately getting the one tree of high fives. Okay Can we just do it that way like first you compute all the left values then we compute all the right values Okay, and what is the edge view of the On the edge it's going to be zero, right? If a tree is all right on the edge, at least you want to be using this way. Yeah, okay Exactly so, um Okay, so let's compute the a Okay, so for the right so the computer right value compute R Val this takes the This takes the tree And it takes the rest of the trees in the row The returns a compute r val Is equal to a So t T bang bang Okay, so the right value here, so this is like the height Equals v And then okay Let's see here. So it's so how many trees it can see a This is then a rest rest of Row okay rest Equals a length a filter a p at a dot dot to So if the height is less than Or equal to uh Do we really look up left down some of your change out at the first tree that is the same height or three? same time of color And it's that the the he that the Agents less than equal to v uh of the Arrest compute r val Int okay So now we want to like update a row So we write to compute r val of tree Takes a list a list of tree and Uh, uh into a list of Let's compute a Let's just say a View score right score Scores okay, so to to scores Okay scores. Okay. So if we have an empty list we'd return an empty list Okay scores of the tree of a tree And trees is equal to Uh Yeah, so we could be smart right and like not recompute everything but I think we don't need to do that I think we I think it's fine this way Uh, but let's see. Maybe I'm horribly wrong. So this is going to be a a scores. It's going to be it's going to be we're going to Score the trees We're going to score the t A t s And that's that's the new tree, right? Uh equals this and we're going to just say We're going to say t a a Uh, and we have to pick which key it is Jing-ding to tree. So now we're we're we're listening to where we're updating a Here we would need like lenses, right? But we don't have lenses Or we have lenses. So let's say let's say as scores equals X scores is equal to 0 0 0 0 Okay, and this is just up down left right up Yeah, I can actually have it like a No, no, let's keep it like this So score and then we're gonna say a What is a nice way to do this? Let's write this. Okay. Let's just have this be actually s equals map dot from list Zip. Okay, so we're just gonna have a from list and we're gonna say Up Up we're gonna we're gonna do it like this, right? We're gonna have it a bit clearer what we're talking about in each case But we still want to be able to refer it by the key And so let's paste this get into position Uh comma up down left right Up down up down left right Okay, now as a score tree and we're scoring we're giving a specific key Uh, so actually sir can just be characters Uh a core tree Char okay, and then a Right next let's let's not let's not keep involved that in the score function. This is just gonna be Score here Okay, and the score here so where So View score equals score tts And now we are going to say that the This is gonna be e prime e prime scores ts, okay, and t prime is going to be t but a s is equal to a map map dot update we'll go uh map map dot update Ah map Oh, no, okay. Give me a i'm just gonna run first This is a risk if you get into the zone All right Nothing damaged, I think Yeah, I'll clean it up in a bit. Sure about that. Okay now did it up map a This bottle is a bit wobbly Okay, a did it up map dot lazy. What is this? Okay now Insert Okay, and then we do map dot update a Let's actually have this char here We don't care about it here, but this is gonna be the key map dot insert a k a view score A t dot s So what is it saying now a parse error on input scores? Okay. What is the problem here? Ah, there we go. Okay, and then this one was t at Okay, and then this s is because I don't actually find the s here. This is going to be a s Is a map from char to a Import data dot map import qualified qualified Okay Scores ts scores. I'm going to be keeping the same key and then Now here we need a This is actually a new extension overloaded record dot Language And I can do t dot s right, which is kind of cool where we're not going to show. Okay. Yes. That's a That's a understandable Have a nice day show h.com s Okay Let's just show the elements of us Okay now So this is the scores. Okay, so So now we have the trees on the scores and the chars Okay, so now I'm going to say okay task two It's going to be a list of trees to a list of trees Okay, a task two is going to say Uh, it's a list of trees To a list of this trees task one trees equals a map a scores Of right. So first we're looking at the right ones map scores Now let's see what this one does a Do-do-do-do-do-do Uh, so for the first one It's just zero Ah Yeah, because I printed twice. Sorry about that Um, so we get the three so the first tree can see three trees It can see the zero. Uh, wait a minute. They should be two right So zero one can see no trees to the right Tree number two can see One tree to the right. Yes and tree number Three can see One tree. Yeah, and tree number three. Okay, so the end can see zero That's all correct, but the zero comma zero It should be seeing Let's actually look at the example, right? That's this a One comma two Zero Uh, looking right as you can see. Okay, right. So because it's not just filter It's actually a Take while Because it stops seeing after the first big tree, right? So two zero zero one zero. Okay, and then this one One two is yeah, okay okay, so a task two is map scores are so First we score to the right Okay and then a And then we reverse And then we map scores to the left. Okay Boom boom So, okay, and then we need to Reverse again, right? Okay. So now this a A One two is is a one two is two two. Yeah Okay, so the model if I like left It's view it's blocked immediately. You can only see One tree of height five right next to it Okay Because now we're taking while like it's less than or equal to but we have to break So we're actually want to say a take while A So now we take okay, and if it's less than okay, okay, let's say where Score funk, okay, so we have the SC okay, so we have here we have the value in scope Okay, and then we have the so we have the current tree T and then we have the rest of the trees and This is equal to It is equal to Case a v is less than or equal to so h is less than or equal to v. Oh, no. Yeah Okay, so the height is less than or equal to v Okay, if h is less than the current value Then it's equal to uh one plus SC of trs Okay, so if it's then we continue if uh otherwise it's equal to One right? So if we're blocked it's one SC if empty list is zero No, this is not gonna be this is gonna be This is gonna be sc of rest Okay, so this one Five so it's zero two two They can rise me was not blocked looking left its view is blocked immediately. You can only see one tree. Okay, so Okay, right. So It's view. It's gonna only see one tree of high five. So this is the one in one two Five, so this is five and then why is it saying two two a Let's just show the s Right. I use uh word is again the terms Keith as ox as ox I want to see like paper to mute. Okay, so Uh, it's dlru Okay, so it's d D lru Uh Uh, but these are all symmetric, right? They're all equivalent, which is a not correct, right? Okay, let's see. Uh So this one works for the map scores are right. We figured that out so Yeah, this one can see two trees To the right this tree here was one and three one two Now this one here is immediately blocked. Okay And And then Okay Now I want to see If I reverse it, right So I have to do sorry It's not reversed. It's actually map reverse Let's not have this scoring function. Uh, we need the scoring function because if we have many equal trees in the road won't stop Okay, uh So this is actually gonna be Map reverse and then we have to map reverse again. So this is d Uh, l u r, right? Okay. So now it's saying Five to the right. You can see one tree. This one can see one tree. Let me see Yes Okay, this one. Yeah. Okay. Let's go to map reverse. Okay. Now we do this one Okay Now let's say transpose this transpose Try and figure out whether that's up or down uh So you take this like this and then we go to transposition So zero zero zero zero but Yeah, so this one becomes zero. Okay now so it's going a It actually doesn't matter, right? Let's say Okay, so Map scores are and then map reverse. Okay. Yeah. Now we fix it again So then we want to transpose it and we want to a map a scores a I think this is a No, let's just check what it says A compared to the S3 Ah I guess the terminal. Sorry about that. Do do do do do CD day eight and we run it back Now so it was D L u r right now we're doing D. So that's a first key So three can see a Uh, I need to transpose to get sorry So zero zero can see a Yeah, I can see two down this one here can see two down Okay, okay So then we're going to do transpose and map scores D and then we're going to say map reverse and we're going to say a map scores U Okay, and now we're going to fix it. So we're going to say we're going to say transpose of map reverse of Now this is looking like A proper Haskell expression right map reverse map map map transpose map map map Like that Okay, let's see Okay, now let's go for the test tree. So that's saying two one two one Do So two one two one. Yes Okay, now this one should see two two One two I think yeah, this is one one So this is down so you can see one down. Yeah one down Looking right you can see two Okay now Let's see for the a Now okay, okay now we want to score them So let's say a Okay, we're going to say a max score okay, so a total score takes a tree There's an int total score is equal to a Product of a map dot elements Okay, this is a total score of a tree so task two a E let me see Uh, so let's say here. Okay, this we do all the transpositions Okay, and we're after that we want to say map a total score map total score a map map total score We map the total score over it And and then we do Map and then we do maximum No, I think it's just max and then we do a max No, what is max here max is say Oh, yeah, right. So it's not max.  Oh, yeah, so this is just maximum but it's not mapping it Total score it doesn't like it because Uh total score maximum by a hook. Oh, how does maximum by work maximum by Oh Okay, right maximum by a compare on He doesn't like that Oh, right. So we'll find the maximum by again a maximum by compare on Total score Of a Okay, we're actually gonna say here Okay, let's just uh, let's just ignore this Tree, okay now a Best tree is equal to maximum of maximum of map maximum of Map map total score Okay, now let's see print task to a best tree I'm gonna map it where I guess I'm gonna print it So we get eight here, uh, and that's probably gonna be the Let me see here So I want this to work right so maximum by compare on a Total score, okay of the a map maximum by This is gonna be give us the best tree Maximum by I think that was what we were feeling before on total score Okay, now we get the best tree Let's see and that's gonna be that three comma two this one And the total score a score Forest Okay, total score a total best tree Okay, it's a best tree. So task two task two is equal takes a It takes a list of list of ints And returns an int, okay task two is equal to A total score of best tree of score forest of map map to tree of add codes And score forest score forest forest Score forest. Okay. Hey, let's see here And now we just do task print task two Okay Boom eight. What does it say for the x input? boom That is a big input, but let's see if it's correct All right We got it and it took us an hour not bad Good thing we started early uh Yeah, I mean did it in 82 milliseconds. We could have done better, right? because Let's see here gets There's a git add the 8.hs input Example git commit Git push All right, we could have done better How um We could have been no more like dynamic Right, we could have been a So we always look at all the trees, right? But you can kind of say that okay the the tree on the edge has scores zero Right, and then the trees like this tree And then you can say like, you know, if it's bigger than the tree next to it Then it has the score of the tree next to it plus one Right So and then we will kind of you know, tie the knot we start off here and then kind of compute it backwards But we didn't do that. That's just You know, we we would have done it if we had an even bigger input and we would have been running it for like multiple minutes or seconds But at this point, it's just a premature optimization, I think But I like it. We did it all point free. It was all map map dot map map scene map Transpose map. I like this. This is a You know, this is a work of art. I have to say Right map reverse so we score right and then we boom and then we score again And so always but I think that's the key to making this as simple as possible, right? We have to keep Um We just look at one in a row and then we just flip it around, right? Then when they just kind of update them by Yeah, but okay That's gonna be it for today. Thanks a lot for tuning in and I hope to see you all tomorrow. Uh, we have a Christmas party at work so Maybe I'll skip tomorrow and do both on saturday But I have visitors for the weekend But not on sunday evening. So they leave on sunday evening They arrive. Yeah, okay. So we we might do Okay, this is what we'll do I actually have free time in Between 10 and 12 tomorrow So we'll do like a stream, right? We at 10 You know, this is pre-lunch We're gonna be fresh fresh We did like a pre-lunch stream Uh, hopefully we managed to solve it in like an hour and a half And then I can do lunch and then I had because I have three hours So I'll be able to solve it. Uh, I hope it's not super hard And then we're done with that, right? And then we can do the saturday one early as well And then we do sunday one late. Yeah, because you know, I've had it where I do a couple of you know Many per day, but that can sometimes say I mean, it's okay, but then like they pile up and if you get two like one hard one, it's really hard to get into a A You know another hard like another one after that. So let's do it tomorrow 10 o'clock And uh, I hope to see you then All right, thanks for tuning in and uh, see you early tomorrow if you're there But if you're not there the recordings are always on you too. So It's gonna be there. All right. Thanks a lot and


Well, finally doing it. This is near-on bearing the hatchet. This is like entering my chest and then the best of will be it going through me and finally putting it to rest, putting season 15 to rest. Admittedly season 15 was a rough, rough, rough go. There was a lot of very poor filler episodes. There was a lot of story attempt episodes and I say attempt because they tried to make you interested in what was happening but the momentum for this season and that's not just because of corona was so little and so repetitive and certain story elements just fell away like the beginning. The beginning of the season for some reason started with all of these monsters and ghosts.  It's a monster so technically shouldn't have come up but that's just retconning right there. That was such a quick one and done thing and then the whole God being the villain thing had moments where it picked up but then it completely fell through. They felt like that they kept on flipping around back and forth with the ideas that they wanted to do and that was very evident throughout this season and you guys did point out a few of those things. For those of you who engaged in the polls sorry for one that you couldn't choose more than one option it was something that I threw together very quickly I'll try and do that better for the future but thank you to those of you who contributed to the polls for both the worst and the best episodes of season 15 and since you guys were so like there was 98 of you who did for the worst I'm going to read off what you guys chose first and then I'm going to give my own interpretation so without further ado let's talk about what you guys thought were the five worst episodes of season 15 and we start off with a triple way tie for third with last call hero's journey last holiday and drag me away from you so technically there's a four way tie here for third but all of those episodes got 8% and you guys didn't like any of them admittedly those are some of the weakest episodes with last call being the dumbest and worst filler episode I failed this entire season fall closely behind with drag me away from you hero's journey being a very poor attempt at some humor and then last holiday also being a very kind of dull filler episode with one good joke number two on the list was the series finale with 10% being carry on which I'm quite surprised that it didn't get higher because the number one worst episode of this season by 24% rated by you guys was inherit the earth and I don't blame you because it's not the greatest episode it's but thank you so much for contributing to this poll it was really cool to see you guys have this much effort into it and have this much to play into it so I very much appreciate that and I very much look forward to the best of but now I'm going to do mine I'm going to have one runner up and that is carry on now admittedly carry on is probably also going to appear in the best of but really carry on has some good and it has some bad and the bad at least for this one was deans death scene and just how poorly it was portrayed the idea of him dying from something so simple has a good connotation to it in terms of him just realizing that his journey is done he no longer has to worry about this anymore some people have made the comment that it actually probably should have happened in the previous episode that he should have died taking on Chuck and that's how it should have happened like if anything the second episode well being carry on should have been about Dean kind of coming terms with his death in heaven where as Sam is also coming terms with deans death in reality so that could have been a little bit more well established and the lack of makeup for him bleeding to death because if he's dying from that he's got a punctured lung punctured heart he's got blood coming out of the mouth right I guess they wanted to glorify and pretty his death and then also the makeup work for Sam was absolutely terrible and I think the thing that was the most obvious about it was one the death and two just how simple and very safe it was it didn't try anything different the montage of the end was so skipped through yeah it's a cool way to end it I do like how they ended it with the crew saying goodbye but this in terms of a serious finale it wasn't the worst episode of the season it wasn't the best but it definitely had a lot to be desired so now we're gonna start from five to one and the fifth worst episode of this season in my opinion is inherit the earth this was kind of a cruddy season finale it was set up from the start to be honest the idea of God being a villain I complained about this thing throughout the entire length of its existence I tried my hardest to look at it from the narrative's perspective I did take out that prejudice I had and I put it on the table and I thought okay I will try and watch this all the way through and it gridded me the whole time because of just how poorly put together Chuck as a villain was he acted like a baby anytime things were going wrong instead of this all-knowing deity everything that we have been given about this character for the last 14 years well technically 11 because he disappeared until he turned up in the last 10 minutes of season 14 it just didn't work it was very poorly put together it didn't have any narrative focus to it and he just made a shit villain he made a very very bad villain idea of the whole Thanos thumb snap thing everyone going away and then the dog having the most amount of emotional hold over you throughout this whole episode was hilarious the end where they use that macguffin jack bomb thing he went from going to the empty blowing up coming back and then apparently becoming a power vacuum but they didn't explain how that happened it just there was so much garbage with jack in this season that they try to make him important as a tool he literally became a tool he wasn't a character anymore he was a literal tool just how they made it like a guess what we were doing behind the scene and the fact that he just keeps on saying guys guys hey guys help me guys at the end was just sad and for Robert Benedict I don't know I would have liked to see him walk around as a human if not in the series finale in the season finale it would have been interesting get to see him live amongst the things he created and he was going to destroy but oh well number four on the list is the hero's journey this had a funny joke as the premise and that was it they didn't think this through the idea that the brothers had this luck of heroes was preordained destiny that they were as good at these things and they had as much luck and they had these things happen for them in concept does sound funny as a joke but not as a whole episode parts that I agreed with the most were the fact that the impala there's no way that this thing would still be alive the amount of time that they've driven it and the mileage on it must be like a jillion they probably replaced every single part and I'm not just talking about when it was destroyed in season one I mean like it literally had to have had every single part in it replaced by now the idea that they'd never seen a dentist that was it everything else was stupid the fact that they couldn't remember how to pick locks they didn't know how to fight anymore or the fact that when Dean went and punched that guy and he kind of punched him like a scooby-doo character and then he got done there was a lot of children's shows writers in this season and it showed a lot like I was quite surprised with how childish the demeanor of this show was and the fact that certain super fans are out there like this is so hard-hitting this is such great narrative content I'm like you've never advanced past Saturday morning cartoons like I'll admit certain Saturday morning cartoons have some pretty damn good hitting stories that man beyond had some fantastic hard-hitting stories a lot better than some of these episodes in fact I thought the whole monster cage fight part was very poorly done the only good part about this episode was Garth and he is one of the few characters that got a good ending in terms of anyone for a conclusion in this I'm still pissed about Jody number three in the list is raising hell this was part of the triple parter sort of how the world is ending storyline that they made up and then dropped after three episodes at the beginning of the season and raising hell just threw any sort of logic out the window because they wanted to have a kevin tran cameo for squee even though the reason for his cameo apparently he'd been sent to hell even though they watched his spirit go up into the fucking atmosphere apparently didn't mean shit apparently even sent the hell this whole time just so they could bring him back the logic with catching this episode I don't it's not just because I hate the character but he literally walked outside of the ring came back in and he was still pissed I came in the barrier he was inside the barrier and then walked to the outer of the barrier it just the logic of this episode made no goddamn sense I hated almost every aspect about it looking monster union was just idiocy the fact that they just hey let's bring jack the ripper because it's a lot of this episode was just because and it pissed me off with how dumb they took the audience to be for this episode sure the one afterwards wasn't the worst because of what rena did but there was this episode was asking a lot of stupid to be accepted and I I didn't appreciate that at all number two on the list is drag me away from you no idea what the brackets are there it doesn't matter this episode still sucks this is one of the two episodes I'm going to complain about a lot in terms of bringing up a character from the brother's past that just so happens to still have their number even though they've both died and changed their phone numbers a bajillion times by this point for some reason they go off to squamish to help this girl try and figure out what happened and killed her brother which happened to be the baba fucking yaga I thought this episode was a weird weird quasi filler episode but also trying once again to talk about the brother's past but we've done it we have done it there's nothing else you can do except retell the same story and that's what they did and it didn't push anything in terms of narrative the fight scene with the baba yaga was pathetic this episode came at the absolute worst time that's another reason why this episode was so disliked in my opinion it's because it came at like a very terrible time when we had this triage of filler episodes once they came back from the coronavirus break it came at a very unfortunate time but it also just had a very unfortunate non-existent existence and the number one well first off i'm going to say i didn't like last holiday either i should have put that in my runner up i didn't like that episode either because that was a weird silly childish thing but the number one episode i hated the most from this season the worst one is last song because this is nothing but a squee episode there's nothing happening on the side with sam that is of any interest because the majority of the episode is once again about dean going to help a supposed best friend or an old friend of his that he hasn't talked to in over 15 years but will drop everything to go and see him every time they did this in the actual show before this season the first time being in season one and then again in season three every time this happened these episodes were never that great i don't know why they kept doing this trope but i guess it was an excuse but it never worked well and i don't know why they thought hey it's the 20th time we've done it maybe this time it won't suck problem is it did this episode did nothing for the show's progressive movement in terms of this season it was a complete dead stop nothing forwarded the story nothing forwarded the narrative it was literally just an excuse to film jensen sing and show off his beard otherwise this episode is the worst the most pointless the completely most useless episode of this season i did not like this episode at all the fact that i didn't give it a one is because i respected the camera work because i thought that it was a decent job otherwise this episode just got me on all the wrong terms it never had any point to it never had any reason to it it's just one of those filler episodes that means absolutely fucking nothing and those are my five worst episodes of season 15 i hope you guys enjoyed this video i have been holding off on doing it for a while because i really just wanted to give myself a break from talking about supernatural i hope you enjoyed this video if you did leave a like and if you're interested in more subscribe be aware the best of will be coming soon once i can conjure up the effort to do it one more video and then we can go and start talking about season four we can finally go back to good stuff thank you for watching i'll hope you see you next time thanks for watching the video my name is nitz and you might remember me from the animated cult classic tv show undergrads it's been a while but i'm happy to say the click is finally getting back together in an all-new movie thanks to a successful kickstarter campaign but we are still asking for your support to see any and all updates about the upcoming undergrads movie be sure to check out and like the bring back undergrads facebook page and with any luck we'll see you guys soon


What is time? Now look this might seem like a very simple question But it's a deep problem as we try to look further into the fundamentals of the universe time Guides so much of our everyday existence everything you do everything you feel is in relation to time It's how we perceive the world how we measure our lives You see me now in relation to time but pause you can feel the time passing We see our lives as serious moments in time That are constantly moving forward, but the physicists and philosophers have told us this is not a new thing They have told us or a very long time The time is the ultimate illusion All that Comfort in chaos Giving it Back Have nothing to do with what I'm saying that there may have nothing to do with this theater You know our perception of everything is built on prior knowledge right the Compounding of memories placing emotional space into physical space and observing the world through our own Particularly shaded glasses. It's no wonder people see ghosts the space itself Conjures up hallucinations in the past Manifests itself if I ask it goes to appear here right now Will it come and which of you will see it?


always point it downrange the point is if it works uh... not shooting that's the last bit of the ammo right there


I will give the talk. Okay, thanks. Good morning, everyone. So, the talk today is about complexity analysis of S-CREF function in the parallel random oracle model and its application in the proof of space. But for time reason, I'm going to focus on the S-CREF function analysis and the mid-part of proof of space. The paper is my joint work with Joe Elvin, Chitin Kumar, Floodman Kongroff, Chishito Pratchak from ISD Austria and Chishito Tsaro from UCSB. Let's consider the following scenario. A user wants to register a new account in the website. He'll input his login ID and the password and the website will store the information in the server and later when the user login, the website will check if the password is consistent with the information in the server. But this kind of scheme is very insecure as the hacker can steal the information in the server and so now he can also login as another user and more seriously is that the password will be leaked. So mostly a random hash function f is used instead of storing ID and the password we store the ID and the hash of the password and also the thoughts. So now the website will check if the hash of the passwords is consistent with the information in the server. But for now the adversary, even if he knows the information in the server, the only thing he can do to login as other user accounts is to enumerate all possible passwords until the hash of the password is consistent. So now the question is what is the right function f should we use? And the answer is that we should use a moderately hard function f. We let C to be the least close to compute function f. On one hand we hope that C is not too large so that the user can use it. On the other hand we hope C is not too small so that it's hard for an adversary to execute a brute force attack as I mentioned before with low cost. So what is the right cost metric of C? Should be time, memory or energy? So traditionally the time complexity is considered where we measured our cost by the running time computation. So mostly in practice the solution for this is to use the iteration scheme where we can run the string iteratively as output last label. But this kind of a scheme has a problem that by the optimization of hardware we can use some application specific integral circuits say ASICs to speed up the hashing power considerably at the equal time cost. So now the adversary using ASICs can compute multiple inputs with the same time cost. So now the scheme is the longer safe against brute force attack. So motivated by this Percival in 2009 proposed the notion of sequential memory hardness. And the function f is called sequential memory hard if f on the one hand can be computed sequentially with a cost for example on the other hand it should be not computed with cost much lower. Like for example on to the right-hand side the function f is defined as epsilon for any constant epsilon larger than zero and the right-hand requirement still satisfied even if the adversary can do the parallel computation. So in particular here the cost means the size time complexity which is the multiplication of the memory size using computation and also the running time computation. Designing a sequential memory hard function has been a very very important goal. So it is now the primary target for password hashing computation. There are many proposed designs for sequential memory hard functions. For example as script Katina, Argon2i, Argon2d and balloon hashing and probably even more. But a very few of this scheme has a good proof of security analysis. So now in this case we are analyzing the core components of script called ROMX function will give a better security analysis of this function and to note that the ROMX function is very similar to the core components of Argon2d so our results will also have the attention to this and in the rest of talk I'll just use the script and ROMX function interchangeably by script I'll also mean ROMX function. ROMX function consists of two phases. It's based on a standard run-match function which can be implemented for example by SHA256 and in the first phase it's similar to the typical scheme that we compute n random string labels interchangeably and we will take output as the input of the second phase and the second phase will also compute n random string labels but here to compute a label xid from the previous label for example here is s and we will pick the corresponding xid computing the first phase and we will take the extra value of xid and the previous label s and invoke the hash function h once and compute the next label. So so on and so forth and until finally we compute the last label which is sn which is also the output of the ROMX function. First of all we will take out the memory hash function and on the one hand there is a strategy that computes this function rather fast but it will incur a large memory cost. The idea is that after the first phase the adversary will remember all the labels computing the first phase which is xi and in the second phase to compute a label after computing the corresponding index the function will invoke h once and compute the next label quickly and since there are n random string labels and the total running time will be on and the memory size is also on. On the other hand if we only have a small memory call memory we have to run this kind of function rather long for a long time to see this is to compute a label now after we compute id0 we have to run this label from the very beginning that's from x1 to x2 to x3 and only after id number of steps we can recover xid and compute the next label. Seeing there are n random string labels and for each label in expectation you need to take on steps so in expectation totally you need to run on square times though you only use constant memory blocks. So generally as you can see in this example we can prove that under the random oracle model well we treat the function h as a random oracle given a single input for any of the adversaries who use space sn and time tn for any constant epsilon larger than 0 the size time complexity is omega n to the 2 minus epsilon and note in each step the adversaries can query bounded function f on multiple inputs in parallel can we guarantee that no matter what strategy or adversary use we still guarantee that the cost of computing them in parallel is approximately equal to the cost of computing them in parallel. So in this example we can compute the function f on multiple inputs in parallel can we guarantee that no number of steps is approximately equal to the cost of computing them sequentially. But unfortunately if you consider cost as a size time complexity the answer is no. Why? Let's imagine there is a function f and on input 1 the computing process is like this. In the first step the adversaries have to incur a large memory cost say n but later on in each step he only need to use one memory size to play n number of steps to finish computation so get together outputs and computing f on input 2 is similar. So now computing the both input sequentially has cost n multiplied 2m because n is the memory size used and 2m is the running time of computing them sequentially so the cost is n multiplied 2m but on the other hand if you compute them in parallel we can achieve much lower cost. In the first step we compute input 1 which has memory cost n and in the second step we continue computing input 1 but we also initiate computation of input 2 and in this step we have memory cost n plus 1 and we keep on computing both inputs so on and so forth and after n plus 1 number of steps we can generate output of both input 1 and input 2 and this time the corresponding complexity becomes n plus 1 multiplied n plus 1 because running time is n plus 1 and memory size n plus 1 and it is much lower than computing them sequentially. Therefore size and complexity is not robust against computing multiple inputs. To handle this problem Alvin and Shapinco in 2015 proposed a new notion called the communitive memory complexity in the PRO model and in the PRO model he can query a lot of parallel queries to the random oracles and after receiving the output he can generate a new memory state s1 and then he can continue as queries to random oracle input and generate the second state so on and so forth until finally he can generate output of the function and we define the CMT of the versary to be the sum of the memory state size through the whole computation and basically it is the communitive sum of memory uses to the computation and this is a group approximation to an important hardware metric called area time complexity which is the product of runtime and area of the circuit computation. A good property of CMT is that now it is robust against multiple inputs in parallel so see the previous example now the CMT becomes m plus m minus one because in the last m minus one step we only use one memory block in each step and computing them in parallel doesn't help anymore now because you can see in the previous example the CMT two multiply m plus m minus one which is the exact cost of computing them in parallel so it is good to use the CMT instead of size complexity so now let's revisit our memory definition so now we would like to say that function f is memory hard if f on one hand can be computed sequentially with CMT for example o n square on the other hand cannot be computed with CMT much lower even with the parallel computation power and the first result is saying that under the pure model given a single input x for any anniversary who computes x and for any constant epsilon larger than zero the CMT is omega n to the 2 minus epsilon and in each step the reverse like in pure model definition can carry unbounding number of our inputs in parallel in one step but this result holds true so there is a caveat this result holds true for arbitrary anniversary only if we have to rely on a conjecture so if the conjecture is not true we may not say this so if we don't want to rely on any conjecture we may need to restrict the set of anniversary as pre-computation for example may just consider a simple anniversary which only store the random oracle's output in their memory state but this is not true so there are definitely more powerful anniversary for example anniversary after knowing several labels he can choose to only memorize the x value of his labels and later on as long as this figure he knows any three values out of four labels he can generate the rest label for free and this kind of functionality is now achievable by simple anniversary is inside and the entangle of anniversary says that after knowing any set of labels he can choose to generate a encoding of these label sets where the size of the encoding can be any chosen integer t and later on as I know any L minus t labels in the sets I can generate the rest labels for free and our second result saying that on the PROM model given a simple input for any entangle of anniversary this result will hold true and there is no conjecture but for simplicity in this talk we may just focus on the result with respect to simple anniversary but I emphasize that all the results will hold true in the entangled case okay so now let's analyze S3 function with respect to CMT how to analyze it the idea of AS15 was to model the function of memory half function by pebbling game which is proposed by dwork now and way in 2005 but note in their approach we require that the memory half function should be data independence while S3 is not data independent so their approach doesn't perfect solve this problem but let's first introduce what pebbling game is which is helpful so in pebbling game there is a graph maps to a particular label in the memory half function computation and the age represents dependency between the labels for example here the value of L5 depends on the value of L3 and L4 so there is an age from 3 to 3 to 5 and 4 to 5 moreover the graph can be pebbled so storing a label in the MHF is equivalent to storing a pebbled note in the graph and more generally a memory state with size S in MHF can be mapped to a pebbling configuration with S pebbles and AS15 model the MHF computation by pebbling game in particular a computation with memory space S can be modeled by our pebbling game with S pebbles so in each step the adversary can do the following first he can put a pebbled note if all of his parents are pebbled and for example here since we already pebbled 1, 2, 3 we can simultaneously pebble 4 and 5 and this corresponds to the carrying our input in the PIRROR model and second we can also remove any set of pebbles in the configuration this corresponds to releasing memory in the MHF computation and the goal of the adversary is to pebble the output note which corresponds to generate output function okay so similar to the commutative memory complexity AS15 defines corresponding parallel commutative pebbling complexity which is similar is the minimum over a possible adversary the sum of the configuration size where the configuration size means the number of pebbles in a pebbling configuration and for example in this figure the best strategy is as follows and the corresponding PCPC is 8 so now the natural question comes can we model the computation of S-query function with the pebbling game but as I mentioned before no because the pebble graph is not fixed and the S-query function is data dependent why because the ID we compute in the second phase is dependent on the value of the label S but fortunately we propose a new game called the randomized pebbling game which may help solve the problem and we have a reduction showing that the lower bound of PCPC for randomized pebbling game can give us a CMC of S-query function with respect to simple adversary and notes that we have similar results for lower bound of PCPC on a particular pebbling game and similar reduction for entangled adversary but for simplicity so now it's sufficient to only concede a randomized pebbling game and analyze this PCPC to get the lower bound of S-query so essentially randomized pebbling game model the second phase of S-query function computation there's a line graph with N-nodes where each node corresponding to a label computes in the first phase which is XI and initially adversary will choose an initial configuration P-0 and in each round the adversary will send a random challenge node which corresponds to ID and now the adversary's task in this round is to pebble this node and in each step he can do whatever he does in the normal pebbling game and after he pebble it the challenger will send a new random challenge independent challenge so on and so forth so in the second round he'll also need to pebble it so on and so forth and the adversary succeeds in pebbling all random challenge nodes and we define the PCPC exactly similar to the normal pebbling game which is the minimum or all possible adversary the expectation of the sum of configuration size where the randomness is taken over the adversary strategy and more crucially also over the choice of the random challenges in each round so our key line might say that the PCPC of randomized pebbling game can be lower bounded by omega n squared over log n squared so given this lemma we can prove the excreted bounds further excreted function so next I'll roughly introduce the proofing tradition of the lemma let's first consider the following problem after fixing a configuration P a new random chance coming and now the question is how long it takes to pebble this particular challenge and we only care about time and obviously the best strategy is to find the nearest pebble nodes on the left and keep pebble it and this figure it takes three steps and we define TIP to be the minimum number of steps to pebble a particular node i and we define the potential of a configuration P to be the minimum expected number of steps to pebble a random challenge condition on configuration P and then we have the 5P equals the sum of TIP divided by n since for a random challenge it has n possible choices and each choice has the same probability and our idea now to prove the lemma is that we will move the adversary into a much simpler game how to do that that's for any adversary in a randomized pebbling game let's see before the jace challenge is coming suppose the initial configuration is P0 and then the jace challenge is coming and suppose it takes an adversary about K steps to pebble this challenge nodes and go on for the next round and our reflection is that K will be at least approximately around the potential of P0 and though we need a little more trick to argue it but let's just assume it so now we will be able to put adversary into a new game which is much simpler but still care for analysis so the first random challenge and the only constraint in each round is that we have to ask the adversary to take these K number of steps in these rounds so more specific we consider expectation game initially the adversary will take initial configuration P0 and now in each round condition on the current configuration P the challenge will compute the potential of P and ask the adversary to take at least these number of steps in each round and then the adversary will obey the rule and run these number of steps and go on for the next round and the challenge will compute the corresponding potential and ask to take these number of steps and the game ends whenever adversary finish all n rounds and we define the PCPC exactly the same as in the randomized pebbling game and we have a reduction showing that the lower bound for PCPC of expectation game is the lower bound of PCPC for randomized pebbling game so to prove the lemma is sufficient to analyze the expectation game now and to analyze the PCPC of expectation game rely on two crucial observations that's for any pebbling configuration P first lemma is that the size of the configuration multiply the potential of configuration is large say omega n and after one step of configuration change the corresponding potential can decrease by at most one based on these two properties we can prove that the PCPC in the expectation game is lower bounded by omega n squared over log n squared this is one of the core theorems in the work but for time reason more details can be found in the proof so finally let's look at the first lower bounds on cumulative memory complexity which we think is I think better than size M complexity for S3 function with respect to entangle adversary and under a conjecture our results will hold true for the arbitrary adversary so it is an open question that whether our result holds true for arbitrary adversary without relying on any conjecture and moreover our proof technique can be found in the base and more details about this can be found in the full version of the paper okay and that's all thanks for your attention you have time for questions so this last thing it's still open as of today this you know arbitrary conjecture is it still open I think maybe still open but close to the answer but for arbitrary attackers so it's almost solved the thing is that there are some conjecture that make this things not tight, the reduction not tight but maybe there are also other analysis or approach that without any conjecture we can still prove the results so this looks square n I guess just to make sure what is the tight what do you expect so is a way to babble it it's a square step is it close to tight I mean can there like some oh that's okay I see also there is a better proof yeah alright so let's send the speaker thank you