Skip to main content
View on YouTube to comment and like!

Syntax Video

Working on Debug December Days 6 - 12 | AOC Day 5 | Clash of Code | Syntax Bytes w/ CJ

Chapter 1 00:00

Transcript

What's up everybody? Welcome in to Syntax Bites with me CJ. Today we're going to be solving some debug December challenges. And if you're not familiar with it, these are a series of challenges released every year through the month of December uh that you can solve and win prizes. Um and it's by Sentry. Uh and the idea is each one of these challenges is like there's a bug in the code. It's very similar to advent of code, but instead of solving algorithmic problems, you are instead trying to uh fix the bug in the code or or sol solve the error.

So that's the plan today. Uh last time we did up to day five and today we're going to do up from day six all the way up to day 12. That's the plan. Uh if you're if you're here in the live chat, say hello. I will say hello right back to you and uh and we'll get into it. I see a few of you. Thanks for being here.

And thanks for the follows over on uh on uh Twitch. Um good to see you, Stony. Welcome in. And Anati, both of you ready for duty. Great. Great. Uh and so Petro, thank you for that follow as well. Um and SMC Mayi, good to see you over on the the syntax side. And Wesley, hello. What's up? Welcome in.

We also got Sasheen and Cybertech Bits and Neon Tuts and Dave Pratt. uh all over on the YouTube side. Uh Dave's from UK. Welcome in. Good to see you. I don't know if the X broadcast is going to work. It looks like it's working now. I think the chat is open. It wasn't open last time.

[laughter] Uh but welcome in everybody. And uh if you would like to solve these, head over to dubdubdub.debugdimber.com. You can give them a try as well. I recommend that you give them a try uh before watching me solve them. And what's up, Pranjal? Good to see you as well. But we're going to jump right in.

And uh when we finish this, we might take a look at Advent of Code day five again. Like we we tried it last week, got to part two. It was pretty hard, but we'll see. We'll see. Let's jump right into it. Day six of debug December. All right. The Yeti is setting up the party live stream so everyone can watch the festivities. He needs to distribute viewers across multiple streaming servers to handle the load. Fun. One of the develop developers implemented a roundroin load balancer to evenly spread views across the servers. But something's wrong. The stream keeps cutting out after just a few viewers join. The partygoers are getting restless and the Yeti is starting to panic. Can you figure out what's broken in this load balancer before the party starts? Okay, we've got an array of server hosts and then we've got a generator function and then for each one of those uh we are yielding one of these. The thing is um

if we want it to be round robin then it needs to wrap back around. I'm not familiar enough with generators to know if it's possible to do that. Um, we probably I mean it is possible. Let me let me talk through this. If we want this to be an infinite generator, we could have a variable that starts at zero. That's the index and then we have an infinite loop that yields and then we yield using mod.

Is that what we have to do here? I think that's what we have to do. Let's do it. Let's use our JavaScript brains. Um, so we say current index started off at zero and then um I think you literally just do a while true but because it's a generator function um it will um not run forever because it yields a single value and then and then um pauses and the next time it yields another value. So here we could yield servers at current index modded by the length of servers and then uh increment current index.

That's it. Cuz then this will just go forever. [laughter] Let's see if I created an infinite loop. Yeah. Yeah, I did it. Cool. This is this is a fun trick like if you haven't worked with with generators before. I worked with generators because I I uh was in a React codebase that did a Redux Saga. I do not recommend it. Um [laughter] it was fine for what it was, but there are better ways to do things these days.

Um, but basically Redux Saga was uh a way of building out Redux actions or thunks and you could yield values that then um had their action types that would pull the state or update the state in the Redux store. I don't recommend it. It's too much overhead. Like you have to think too hard about what generators do. But if you didn't know it, uh that's why this doesn't create an like it this doesn't block this doesn't create an infinite loop because you call this generator one time. you're going to get this value and then it pauses and then if you call it again the code will resume it'll increment the index hit the wild true and then yield a new value and then it'll pause and it'll just do that over and over and over and over again.

So uh that's that's the fix. Did anybody else get it? And what's up uh Mr. A? Good to see you. Um any other thoughts on how we could also solve this? I guess if they want it to be a generator function, then this is kind of the only way to solve it because a generator actually returns an object that has the value and the ability to call next on it. Yeah, their breakdown says the generator only iterates through servers once before exhausting. A proper roundroin generator needs an infinite loop around the for loop to continuously cycle through the servers. Cool. All right, on to day seven. The yeti steps into the elevator to head down to the party hall on floor one. He presses the button, but nothing happens. The panel shows too many floors, including some Phantom test floors that the maintenance team added during setup but supposedly removed. The Yeti tries to delete them from the system using the elevator's control panel, and now the elevator won't move at all.

Can you fix the floor removal so the Yeti can finally get this party started?

Cool. But I had seen some comments on um on the pre let's let's look back at day six because uh what thinkverse is saying is you can add a while true around the for loop and it seems like the correct answer is that the same thing if you just do a while true. So what was the what was the code like before?

Because it was just a four of

Oh, I see. Around the entire for loop. Yeah. Yeah. Yeah. You couldn't change the for loop into a while loop. If you just wrap the for loop in a while true, that will just keep going back to the beginning of the array. Yes. Yes. Yes. Yes. Okay. That that would work as well. I like this solution better. [laughter] Actually, no. That solution is probably more clear because it's just a regular plain old for loop. You don't have to think about modulus.

It's a good point. Okay, day seven. Um,

here we go. So, we have a function called remove floor. We get access to the floors and the index. We delete the floors at that index and then return the floors. Okay. Are floors an array? So, instead of deleting, we need to like remove it. Sli splice it. Slice it.

splice it. Um affected expected array length to be before after removal. Yeah, I think we need to splice it instead of just delete. So delete you typically use on objects to like delete keys. So instead we will splice at that index and then we want to remove one element at that index. I think that's the answer.

Looks like I know how to write JavaScript. [laughter] Um the delete operator doesn't actually remove items from an array. It just seems the slot. It just sets the slot to undefined, leaving a hole while keeping the array length unchanged. Use splice or filter methods to properly remove array elements. Very good. Very good. All right. Day eight. We're cruising.

We're cruising [laughter] right along. The Yeti sent party invitation emails, but they all went to spam. After investigating, Yeti discovered the email system spam filter uses a string reversal function to detect suspicious patterns. Something's wrong with it. And now the filter thinks all the party invitations are malicious. Nobody knows about the party. Fix the string reversal function. So the spam filter works correctly. So we get a string, we split it, we reverse it, we join it.

Uh it has emojis in it. So Wes talks about this all the time. I think I think this is the issue. The uh Yeah. Yeah. So there are some emojis that make up multiple that have multiple values inside of them. I forget the name for it. Um, but if you use array.split, it doesn't account for that.

Yeah. Yeah. [laughter] What's up, Calvari? Calvaria, good to see you. Looks like Sentry needs to stop using. No, I mean, Sentry is here to help. [laughter] If you didn't notice, the error log below is Centry being like, "Hey, you messed up." Or maybe you used AI to code. Um, yeah. And think for for the previous challenge, I said, "I didn't think of that. I just returned the floors filtered with number. Yeah, I mean that's a mutable a an immutable way of solving it, right? And if you write a lot of React, that's probably the solution you would gravitate towards is create a new array with that value not inside of there. Uh but it didn't say we couldn't mutate it. So yeah. Um and uh Kristoff, good to see you. Welcome in.

Okay, I think we can do instead of a string.split, we can do an array. because array from is aware of combined unic code values. Too easy. Um Wes did show a trick that didn't use array. There's some sort of like string breaker upper or something. When did he do this? Oh, I know. Okay, I know he did. I know when he did it. I'm going to look up how he did it on the on the in the YouTube video. This was when we were doing this challenge.

You may have He showed cuz like uh so with this challenge you have text and you want to animate each character up or down when you hover over [snorts] and he showed that you basically he's splitting up the text but he showed that it worked with emojis. Um let's see how he did it.

Yeah. here.

We'll find it. Oh, no. This is this when we were reviewing it. I'm going to find it. Here it is. Okay. No, no, no. He's using sibling index segmented. Does anybody know what I'm talking about here? There's a specific JavaScript function that he used to break up the string.

Yeah.

Is it Intel? Is is did he is like a it's in the Intel namespace.

Segment. He used an array segment. So, Intel segment is what he used here. Granularity letter and then he segmented the content and then did array. Interestingly, you don't have to do that. You actually just can use array. But there probably is some sort of languageaware thing happening with Intel segment.

Yeah. Yeah. And what's up? I'm Nicole. Good to see you. And I Tequito, thank you for the follow. Yeah. Uh so basically uh what what Wes was showing is the black Santa Claus emoji is two emojis. It's a black person and Santa Claus. But when uh an emoji viewer or parser encounters those two emojis next to each other, there's called like a zero width joiner so that it actually gets rendered out as a single emoji. And there's a lot of emojis that do this. like the family emoji I believe is actually like four different emojis all single width joined together and then it renders out as the family emoji. Um but if you do a stringsplit it's going to split it on those single width or zero width joiners. I don't know if that's the right term. Um but if you use something that's aware of those it will it will not. Yeah.

Yeah. Emo parsing is painful. We we dealt with that a lot on coding garden because we had our our overlays with like the Twitch chat and parsing new messages coming in. Yeah, Intel segment is the way to go. Let's look it up on MDN.

Local sensitive text segmentation enabling you to get meaningful items from a string. Fascinating. Oh yeah, and uh and check this video out if you haven't seen it. It's pretty fun.

We uh we try to um implement that text effect on the Lando Norris website. Um it's funny how I turn green when I the lights like this. But when you hover over these menu items, you see how they they animate up and down. All three of us attempted to recreate this and then compared solutions. So, it was pretty fun.

All right. Uh, we also could have used spreading into an array. Right, on to the next challenge. Um, but thank you 420 Koala for that follow. Um, and Stony says they made their own chat overlay, too, and it still messes up. Yeah, a C# headless server that serves overlay widgets. Fascinating.

All right, day nine. The eggnog supply is running dangerously low. The Yeti rushes to order emergency refills from multiple suppliers at once. He fires off a batch of payment requests and waits for the audit log to confirm everything went through. But when he checks the log, something's very wrong. The credit card charges went through, but now there's no way to tell who actually got paid. The payment system is supposed to track which supplier ID was processed in each transaction, but the audit log is a complete mess. Can you fix the batch payment processor so each charge gets recorded with the correct supplier ID?

I think I can. So, we have a function prepare payment batch. It accepts an array of user ids and an individual product ID. And then we have the requests for each user. We grab its ID and then we push the okay, I think it's going to have to it has something to do with the scope of this function, I'm guessing. So we push a payment for that user and that product into the payments array. But then we have a callback which when called will use the current ID.

Yeah, the issue is this variable needs to be scoped to this callback current ID because if not JavaScript is going to uh hoist up hoist it up and then whenever this gets called it'll be the last value that it was assigned to um this current ID.

So if we it should be as easy as just making this a let variable. So that way when this when this call back is called later on this value that it was set to is still in scope. And uh I should be fine. And while we're at it we'll change this var to let as well. We don't have to but we will [laughter] done debugged. So var is function scope.

Yeah. to talk a bit more about like what what actually happens there is when you write code like this what the there's a first pass that the JavaScript parser does and it goes and it finds every variable declaration at the top of this function and it actually moves it out here and it becomes something like this and then inside of here it reassigns it.

So if you wrote your code like this and then this whole thing run ran this call back is going to get called later on which means when this code is done running current ID is going to be the last ID in that array because that got set and now it's in scope here and then later on when this callback gets called it's just going to be that last value.

Um and so the fix is to use a block scoped variable. So let makes this block scope which means it will not be hoisted out of here. it only exists within these curly braces, which means you're going to have the right value there. Uh the other fix, which is how we did this before um [laughter] uh before we had block scope variables, uh is to put this into an immediately invoked function expression cuz this will create a new scope like so. Um actually, I'm going to solve it this way cuz this should still work.

Basically, we create a new scope which closes over this is a closure. This closes over the value of current ID so that later on it has the correct value. This should fix it, too. Yeah. Look at that. I s I solved it without a let. Um, fascinating. All right. Yeah. Yeah. What's up, Eddie? This is the syntax channel. We're over here today. And, uh, VJ, thank you for that follow on Twitch. This is a closure.

Yeah, you are correct. IQ uh because this close it closes over this variable here so that later on the value of that variable is locked in when this function runs. So this is a closure. Yes. Yeah. And think versus not going to lie this took me a while to get. It's a tricky one. I mean, honestly, these days, that's why if we just default to using let and cons in most situations, we don't run into these bugs cuz it it just handles it for us, right? It's just like, oh yeah, I meant for that variable to only be accessible in this iteration of the loop. I don't want it to be overwritten, you know? So, cool.

All right, next challenge. Day 10. The party photo booth is a huge hit. Guests are lining up to snap festive pictures with props and filters, but there's a major problem brewing behind the scenes. The Yeti just discovered that none of the photos are getting backed up to the cloud storage system. The photo data streams in perfectly. It's processed for printing, but when the backup system tries to save copies, it comes up empty every time.

The print queue is working fine and photos are coming out beautifully. Yet, the backup storage shows zero bytes saved. Something's gone going wrong in the way the photo stream is being handled. Can you fix the backup system before all these memories are lost forever? Okay, I'm going to have probably have to look some stuff up because I'm not super familiar with streams. So, this reads the stream and then we send it to the preprint processing and then we back up the data.

That gives us our backupes. I'm curious if we if we just need to await both of these, but I actually don't know what stream mechanism is being used under the hood. Um, so we'll try this and then if not, I have to look into how how streams work. Yeah.

Well, it says we need to make this an async function, but I don't think you can await streams. This can't be the answer, right?

Okay, this isn't it. I think it might be we need to clone the stream because the stream is read once. Um like we read the stream and then the this like consumes the stream and so before that we need to clone it so that way it can be consumed again. Something like that. Um, I'm guessing this is Node.js code. I'm going to look up Node.js streams because I'm not super familiar with them.

And maybe like stream clone. Is it possible to clone a stream or copy a stream? Yeah, copy it without consuming it. We can use pipeline. So, let's look at pipeline in the docs.

Hopefully, I don't have to import anything. Um, I am curious though. Let's let's log the generator to see what we're getting back because it could just be an object with some functions on it. Um, so we'll log the generator and then we'll also log the type of the generator because I don't know, we might be able to add uh like core Node.js imports. So, we could potentially pull in pipeline if we need to, but I don't know if we need to. So let's let's just see what we get here.

It is an object. Um what what keys do you have? None. [laughter] What's another way to to inspect?

I guess I could try to stringify it. That might break some stuff cuz there's probably like some internal functions. It just stringifies to an object as well. Okay, I'm guessing my I'm I'm going I'm going down the path of potentially using pipelines because um this uses the stream, but we need or like is there a way to clone the stream?

Okay,

I guess we'll look at the process data as well because but this is this this is the process data post printing. So this isn't the data that we want to back up, right? Oh no, this isn't even the process data. This is just the number of bytes that were processed.

Yeah, I just need to learn more about streams. Um, is there a clone or a copy the streams promises API?

So we can use pipeline. We pass in a stream. That stream can then go into multiple functions. Um how do we

actually like get the return value of the stream? I'm going to look up Node.js uh clone stream. Yeah, this is I we want something like this proper way to clone a stream. So, okay, we have stream, we have a readstream, we can do pipe. So, stream.pipe directly. No, no, no. Yeah, yeah. So, this is a stream and then we do a pipe and then we do a pipe.

Let's try it. Um, so if we do generator.pipe, will it let us do that? I'm going to I'm going to save this code before.

Pipe it there. Pipe it there.

Oh no. So they're using a pass through stream. So that will Okay, let's just understand what clone means because it's definitely not in the stream terminology. Reading the original, it seems you want to pipe the same source stream to two destinations and you want back pressure handled.

Would you prefer the conversation can or hear there? Anyway, this is the example portter from coffecript. So, they have the contents and they're piping it into two separate streams. Oh, maybe I have to do this and then pass those streams into the functions. I think that's what I need to do. This will probably break. Like pipe is not a function. Yeah, generator.pipe is not a function. Let's try creating the streams like are in this example. Um I'm first of all I'm curious can we even require in stream like like is this possible or is this going to break?

require is not defined. Can we import it in

can't use import statement outside a module. Okay, so we have no access to these.

I'm almost curious if we can we just use some sort of clone directly cuz I guess I don't know what the generator does. um like generator copy um something like [snorts] uh what's the built-in way of doing a deep copy? I forget the name. We used it the other day.

Structured clone. Structured I don't know why I did that. Structured clone is what we want.

This seems this seems silly. I don't know if this is going to work. Object.structured clone is not a function.

Is it? It's just um Oh, it's not object. It's just at the top level.

What? What am I What am I thinking of? Yeah, internet doggo says I'm way over complicating this one. [laughter] Okay, I guess [clears throat] if we, you know, let's take a step back because I can't require I can't import, which tells me that we're not, we can't do anything too crazy with the streams.

So, um

I mean I don't think

I don't think a like a weight doesn't have anything to do with it.

Yeah. Let's read the read the prompt again. Uh, the party photo booth is a huge hit. Guests are lining up to snap festive pictures with props and filters, but there's a major problem brewing behind the scenes. The Yeti just discovered that none of the photos are getting backed up to the cloud storage system yet. The photo data streams in perfectly, gets processed for printing, but when the backup system tries to save copies, it comes up empty every time.

The print Q is working fine and photos are coming out beautifully. Um, yeah, since we can't import anything in, we could call read stream again, but that doesn't seem right to me because once you've read the stream, you can't read it again. Um, but let's try it. Instead of putting it in a variable, we're just going to read the stream both times.

That was it. Okay. Generators can Oh, so it's a generator. It is not It's not an actual stream. It's just a generator. Generators can only be iterated once. After it consumed the stream, the generator was exhausted and had nothing left for backup data to read. Okay. But a generator isn't a stream.

[laughter] Like a generator is a generator. Um,

the stream generator. So, are these things saying this is a generator function? There's really no way to like inspect this. I I Okay, actually there is actually if we would have No, cuz I thought you had to do like next. Um let's look up generators because when you invoke a generator you will get a next value. Okay. So what this is telling me is if we do generator.next that will exist because this is a generator function.

Yeah. Okay. It was just [snorts] I think for me it was just confusing because the word stream was used and so I was like are we actually dealing with streams? But literally just recreating the generator. Um no no recreating the reading the stream in two separate times so there are two separate generators is the way to go. Okay. I didn't like this one. It's a little confusing. Let's move on to the next one. I'll also I'll also read the chat. Um and VJ, yeah, thank you for the follow. Uh yeah, Mumi says, "I'm confused by the task. It doesn't even tell you what the three functions are." That's the tricky part.

Like I I tried logging the return value that didn't tell me it was a generator. Um and when I I guess I did type of and that gave it me an object, but I think technically the type of a function is an object. And I guess it wasn't a function. got next was a function, but even when I logged it, I couldn't see that that exists.

Yeah. Uh M says, "I did the dumbest thing and it worked." I think it's it's I guess it's not dumb if you know what you're dealing with because generators can only run once. So, if you create two separate generators, they can uh rerun. Yeah, I I indeed got stuck on the wrong word. I got stuck on stream. What's up, uh, Samuel Libre over on, uh, on the X side?

Good to see you. Welcome in. I see you. Anybody else tuning in on X? [laughter] I actually got it working today. Well, the first link is broken. Uh, the second link should work. Obviously, people are tuning in. Uh, and the chat is open. Last time I forgot to keep the chat open. Yeah.

Yeah. Bingo. What's up, William Cameron? Welcome in. What are what are these? What are these numbers? Oh, you're a top fan. Sweet. [laughter] Internet doggo, number one top fan. William Cameron, number three top fan. Appreciate y'all. Um, think says there was some discussion on the Sentry Discord about if this was the correct way or even a good way to call a generator multiple times. I think if they would have made it clear that that gives us the current value because like what what was a little bit off to me is if I'm if I'm processing the stream when I call readstream my thought is if I call it again I'm going to get the next stream like the the next photo that was taken not not the current one. [snorts] So maybe if read stream was called something like get current stream generate generator generator or if it was passed into the function in some way then uh that would have told me oh this is unique to this function call instead

of being do you get what I'm saying because to me it felt like read stream is almost like a global that if I call it again I'm getting the next value not the current value. I don't know. I don't know. Um, and what's up 1236? Jesus, good to see you. Yeah, 75 XP from chatting. Nice. I didn't know they were gamifying the the YouTube chat. The stream threw me as well.

Generators are a different thing. I I would have to agree, but but maybe not. Okay, day 11. Here we go. [clears throat] The Yeti spent hours setting up the perfect party playlist, complete with a premium audio streaming service. He locked down the system configuration to prevent any pranksters from messing with the music during the party. Everything seemed [snorts] secure at first, but suddenly the audio streamed started playing weird sounds and distorted audio. Someone is tampering with the streaming API credentials. The Yeti is certain he secured the configuration properly. Can you fix the security before the playlist turns into chaos? So he's using object.freeze.

I'm guessing object.freeze like isn't deep and so maybe there's like a deeper object in there. Um yeah. So this freezes the top level. I' I've never really worked with object. But my my guess is it's not deep. So we need to freeze.

Um and also does this modify the object or does it return a new object? Let's look up uh object.freeze because I am not familiar with it. Okay, freeze is an object. Great. Um does it talk about being deep deep freezing? Yeah, the result of calling object at freeze only applies to the immediate properties.

If the value of those properties are objects themselves, those objects are not frozen and may be the target of property addition, removal, or value assignment operations. To make an object immutable, recursively freeze each non-primitive property using a deep freeze. Yeah, I don't think we need to get that complex with it though because it's only one level deep. So, I think if we do object freeze on config.appi, that should do it. Yes. Yes. So, object.free freeze only performs a shallow freeze. Wonderful. All right.

Day 12. Here we are. [clears throat] The pizza pizza is on its way. The delivery person arrives at the automated security gate, which requires entering guest codes from the approved list. The gates virtual machine is ancient and doesn't even have set implemented. Oh, fun. So, we we get to work with old old JavaScript. Um, so the Yeti quickly, actually, I don't know if that's the case, but that got me thinking. What if there were some maybe this is it, but what if there were some debug December challenges where like you only had access to ES5. Then you'd have to do some real real digging to to fix things like the one with the having to change it to let if you only had access to ES5, you would have had to have used an ify.

Okay, I digress. Uh so the Yeti quickly coded up a simple custom set to track authorized delivery codes. Simple enough, right? But now the gate is acting strange. It either is either refusing valid codes or completely crashing when certain normal code words are entered. The pizza is getting cold outside. Can you fix the simple custom set before the delivery person gives up and leaves? All right, we have a set.

We're storing it all in an object. When we add a value, we're putting it in. If we're saying has, oh, so if we're checking for the value, we're making sure that it's not undefined. And then when we to string it, we're getting all the keys.

So we we basically just list out the keys in the set. Um the one issue here is both of these have the potential to to um access the like the object prototype or the constructor because this isn't guarded.

Um yeah. So

has of tworing constructor all of the built-in object things are going to return true. So we should guard this um with instead of this. Storage value not equal undefined we can just say this.

Oown. There's a there's a new um I don't know if it's top level. Yeah, it is top level. So you can do object has own and then you don't got to do all the weird like has own property stuff. So has own value like that.

Okay. Um I like this. It's it's twofold. So there's a bug [clears throat] in adding two string should not throw an error. Got cannot assign to read only property to string. Um I think we also have to do something similar with object.keys is object object.key keys is that automatically has own an object's own innumerable stringed property names.

[clears throat]

Okay. Okay. Okay.

What is the error that is thrown here? Um, let's actually grab the keys and see if we can log them.

There are no console logs. [clears throat] Bug in the ad. Oh, they're trying to put two string on there.

I see. Adding two string should not throw an error. Cannot assign to read only prop. I see they are when they call add, they're trying to they're trying to mess with it. They're trying to pass in the value two string here and that means that we're overwriting it. So, I'm guessing like instead of simple object storage, do we have to use like two arrays? one array of keys, one array of values, and then just use the indicy.

Um, that way we can store things like two string. That's that's the path that I'm going to go go down. I'm just going to say keys is an array of strings and then um values is going to be an array of values and um am I going to have to implement this whole thing because then we have to search does the key exist? Um, can I just use a set inside of here?

Because otherwise, uh, we're going to have to say, um,

oh, no, no, there is no keys and values. There are just values. And then we just need to hold on to um, the values are the keys. Okay. Okay. Yeah, I think we could do something like um this.keys.push value, but only if that that value does not exist in there.

So if this keys dot uh could we use an includes easy enough push it otherwise and then um or has we just say is it in the array and here we can literally just return this keys that will uh stringify it. Now, this seems to solve all of the the requirements. Uh, this isn't necessarily performant because includes has to search the entire array every time. I don't know. Let's see what this gives us. Okay. Has should return true for values that were actually added.

Um, are we should we not put two string in there? Did I just fix [clears throat] Did I just fix it to uh to put two string in there? Let's let's log every time we're adding a value.

So we push in uh gif tag 001 and then when we're checking has we're using includes in includes is like just a shallow comparison check on an array um like this. So if it has it, it'll return true.

Did we mess up the stringification as well though? Um let's look at the what stringify was before. So stringify

um was object.key keys. So an array of strings and then stringifying it.

has should return true for values that were actually added. Um, let's see what they're asking for.

Has two string, has constructor, has own property.

um and then let's also log if it has it two string false. So we add it and then this is returning false.

Um, oh, if it does not [laughter] if it doesn't include the value, push it in, man. That's that's the fix. There we go. Sweet. Okay. Um, plain objects inherit from object prototype. So, checking this returns true. This is extremely relevant for the recent uh React server component vulnerability. Um the initial one with remote code execution uh was because they didn't use a has own property check and then they were able to because of that get access to the function prototype which lets you pass in arbitrary values. Um so that was fun. Um use object.create null or a map. I did it neither of those ways.

[laughter] My my set is not very inefficient because every time you call add, it has to look at every single value in the set. Um, and then every time it calls has, it has to look at every single value in the set. It works, but it's not performant. But there you go. This is how you this is how you created a a set with just arrays. Um, let's catch up on chat. Uh, John Henry, thank you for the follow. Yeah, no 10 CVE here. Exactly. Yeah, the um the [snorts] vulnerability in React server components was because of a similar issue. Um and what's up by Takito who says do you know any resources to learn websockets especially the fundamentals like authentication.

[snorts] Um Stony is recommending this. What is this? Oh hey that's me [laughter] five years ago. um I don't have any resources. I will say authentication is not a fundamental of websockets. It's actually in my experience one of the hard one of the hardest parts about websockets. Um so I don't have any resources.

[laughter] It's it's poss it's definitely possible to do authentication with websockets, but you basically have to keep track of all of that state for your connected client. So when a client connects you check do they have the credential and then if you do you mark them as authenticated and potentially any request in the future needs to all you need to also make that check especially if they like disconnect and reconnect. It's it's a tricky problem and thank you Edwin for that for that follow as well. Yeah.

Uh it's literally the the video I learned the basic of websockets and made me curious. Oh nice Stony Eagle. That's fascinating. So this is how Stony Eagle found me [laughter] five years ago August 27th 2020. Wow. What did What did we build in this stream? Did we do the Did we do the mouse game?

Um.

Oh, look at that. I'm drawing diagrams and explaining how websockets work. Okay, maybe the stream is good. Maybe I I at least tell you how real-time communication works, but uh I definitely don't talk about authentication in this video, I don't think. What did I What did I build in this stream?

Just examples. I'm I'm drawing diagrams like crazy. What What What happened to me? I don't do this anymore. [laughter] I actually don't remember the stream. Um, fascinating. Okay. Yeah. Um, Centry just tweeted the day 12 blanket.

Oo, let me pull it up. Let me take a look. One moment.

It's me. It's inception. [laughter] I'm I'm on the sentry page. Um Oh, that's that's the blanket. Whoa. Oh, you didn't you couldn't see. You couldn't see. But um that's cool. I like the like the the patchwork. Um,

first of all, I was pointing out the fact that they they tweeted that I'm streaming and so I'm on this I'm on the it's it's stream seion, but uh I didn't mention it, but if you do all of Debug December, especially up till today, they're doing a raffle today for this blanket, which is really cool. Look at that. It's got like the what do you call these?

It's like patches. Not not patches, but these are like little little clumps of insulation. This is a cool blanket. I like that blanket. It looks like it comes in a in a cool bag, too. Little little squares. Um, but I didn't mention it. If you check out the intro to Debug December, they've done giveaways on the 3rd, the 6, and now they're going to do a giveaway at the end of of today. So, as long as you've completed all of the challenges up to day 12, you will be entered to win one of those blankets today.

Um, let's see. And there are 20 of them. So, there are 20 20 of them available. Um, so if you want a chance to win, you should do these challenges. That's a cool blanket. I want I want that blanket. Okay. Quilting. That's what it is. Thank you DB Night Dream. It's like it's like a quilt. It's like a quilt. I like it. Um, exactly. Along with Chris, we all had a little bit more time uh that particular year uh in 2020. That's that's when I started streaming a ton. I I started streaming in 2016 2017, but 2020 is where I was streaming like four days a week and uh distracting people from the realities of the world. Um, okay. Internet Doggo says, "I could have used maps in this challenge."

That's misleading. Was that day 12 or was that day 11? Oh, we just did day 12. Great. I qualify to enter for the quilt. Um, yeah. So, that's misleading because it says, uh, this virtual machine doesn't have set implemented and map and set were introduced at the same time, I believe, in ES 2016 or 2017.

Um,

when when did these get introduced? ES 2016. 2015. ES 2015. Fascinating. But [snorts] map and set got introduced at the same time, which made me think, well, if you don't have set, then you don't have map. But apparently, you can use a map, which which would have been fine. [snorts] Um, oh, nice. Stony Eagle. Um, thank you for saying that. So, you could have used maps. I just used arrays, so that's a thing. Um, have I played photonic chips bugs? No, I haven't. Yeah. Oh, you got the mug thing first. Nice. Hoping for the PS5. Yeah. So, on the final day, um, there will be day 24. Well, second to last day, I guess. There will be one PS5 given away uh to everyone. I believe you have to have completed all of the challenges.

You'll have to read the terms to know for sure. Um but that is that is how you will get your entry to win. Okay, that was fun. Um we learned some stuff today. I I again shout out to the uh creator of these challenges because they do they teach you a lot about JavaScript. We're learning about generators. We're learning about the intricacies of regular expressions. Last time we learned that some regular expressions are stateful if you use certain flags.

Um, what else did we learn? I guess if [clears throat] if you're like me, you implemented a set using arrays. That's fun. Um, that's just like a classic computer science interview question, like can you implement a set? Um, I never use object free, so we got to learn about that. We're working with generators, which was fun. Yeah, debug December is cool. You should you should definitely go give them a try if you haven't yet. Uh, and Silver Surfer, thank you for that follow over on Twitch. Okay, I have been live for about an hour.

Let's do some other stuff. Um, and we'll we'll vote on what we're going to do, but let me tell you the options. We could Oh, yeah, and today's the final day of Advent of Code. I forgot about that because they're only doing 12 days this year. But last time we started on part two of day five which has to do with calculating all values within the g given ranges and we got stuck. We we couldn't solve this day five part two. So this is one option is we go back back to the code I was writing and get it working for day one part two.

Um another option is we can just go do some code wars. It's been a long time since uh uh I did code wars on stream, but these are just algorithmic problems. They're not themed for for uh Christmas, but [laughter] uh we could we could do some of varying difficulty, some easy ones, some hard ones. Um we also could play Clash of Code, so anybody watching could join us and uh we could battle to see who can solve the problems the fastest.

What else? Yeah. Oh, Stony says, "Let's raid coding guard." No, I'm I'm not going to stream on my channel today. Uh, yeah. So, Photonic Chips bugs are making a photonic computer in Germany, and they've made the chip that's playing Doom. Wow. Uh, internetgo says, "My last advent of code stream convinced me to give part two another go, and you managed to solve it. Love to hear it."

Yeah, the thing is I feel like I got really close, but there's probably just one or two more things we need to do to get it down um to fix it. Okay, so Advent of Code, Code Wars, Clash of Code, and I'll also mention that if we do coding game Clash of Code, or if we do Code Wars, I'm open to trying other programming languages. So we could spin a wheel with rust go hasll [laughter] and whatever it lands on I have to use that programming language to to solve the problems. Those are your options. Let's do a quick poll and uh and then we'll do it. So here we go. Uh what to do?

Advent of code day five part two code wars or clash of code.

Okay, boat down. I can't get the timer focus for AOC debug December seems more my time block. Exactly. I that's kind of what I'm running into is it is an incredible amount of time you have to set aside to do advent of code. But uh Pablo, good to see you. Uh debug December hype. That's my favorite advent of except for the spot one. Oh, you know what? Um, I haven't even looked. Do they have new challenges this year? Yeah, I haven't even looked this year.

Wow. Oh, no challenges this year. Just 24 days of spelt knowledge, tips, and insights. Cool. Uh, while people are voting, I'll look at this day one.

Inspect.trace. trace

added in spelt five. Place this rune as the first statement inside any effect or derived to get detailed console output about what's naughty and what's [laughter] nice. Fascinating. I don't Yeah, I haven't used that. What about Why are these out of order, by the way? Day two, actually. So, my wife made me an advent calendar of this year. uh like she she made it herself out of cardboard and velcro. Um and all the dates are mi uh mixed up on the on the calendar and she put little chocolates in each one. But that I'm bringing it up because that makes sense.

They're for whatever reason they're in a a random order. The spelt CLI. Cool. Yeah. So these are just tips, not challenges. Looks like we only have seven votes and there are 47 people watching on YouTube, 13 on Twitch. So, more of you should vote or you might just be here and you don't care what I do. [laughter] So, that's okay, too. But, uh, click click the link in chat to uh to vote on what we do.

Yeah. And and I would uh completely agree with with William Cameron who says AOC is very rewarding, but they get intense. Yeah, I mean I spend hours on them. Um, yeah, every one almost takes me every part takes me almost an hour. Sometimes it's it's easier, but then part two will take me like an hour and a half. So that it averages out to like an hour per challenge, which is is quite quite the time investment.

[snorts] Yeah. If you tag your ch channel in the title, then everyone who follows you there will be see you live and get a notification that you're a guest on syntax. Can I do that?

Level up your collaborations. Looks like you're streaming with Coding Garden. Start a shared chat to bring your communities together.

Did it work? Um, let me know, Stony, if you see it. Like, does it show does it show up in your following feed that that I'm now um linked to Cody Garden?

What's up, Brandon who says, "I was interested in your home server setup, but you weren't on the last podcast episode." Yeah, the thing is I don't have a lot to share at my home setup. I need I have more work to do on my home server setup and [snorts] a lot of my stuff isn't in my home. I'm hosting it in the cloud. I need to do more work on it. But this was a fun episode to hear how uh Wes and Scott have their like Synology server. I think Scott has his Mac Mini with a bunch of stuff running on it. Yeah. But I don't have a lot to share there. I will soonish.

[laughter] Thought you'd have a crazy home lab. sort of again like I do I have a server rack and I I have um a firewall that I set up myself. It's running uh open sense and I'm load balancing two different internet connections. I pay for Centry Link and Exfinity and my um OpenSense or OPN sense firewall uh load balances the two with um they're both gigabit connections and so if one ever goes down or one is ever slow my internet stays up for the most part. Um, I've got VLANs which have my uh security cameras which are not connected to the internet, but it's it's it's it's Modge Podge. Did I say Century Link? Oh. Oh, no. C [laughter] I did say Century Link, but it's this Century spelled the other way. They're they're an internet company here here in the US.

Okay. The poll says we will spend 20 minutes on Advent of Code day five part two. And if I don't get locked in, then we'll try to finish it. But if I get fed up with it, we're going to move on to Clash of Code. But we will do at least two Clash of Codes today. So stick around if you want to participate in that. In the meantime, let's do some Advent of Code day five part two. Let me get my codes set up.

and I will reintroduce you to the problem and tell you where we're at so far. So, [clears throat] actually, I'm going to grab some water. So, [laughter] I'm going to take a quick two-minute break. I keep I keep uh clearing my throat. I'm going to take a two-minute break. When I come back, we're going to do Advent of Code day five part two. And uh thank you uh Subly for the follow over on on Twitch. Yeah.

Uh, Paulo is saying, "I'd love to set up a small home server to host random stuff. I have a header VPS, but it would be cool to have one at home." Yeah. I And so that's the other thing why mine is like hodge podgeed because I also set up a uh just a Linux server that had Claude code on it and that way I could just SSH into it while I'm at my house and then [clears throat] vibe code from the couch. So, that's something else I set up. And I also set up um uh open web chat with O Lama so that I could have a fully offline LLM. But again, it's not it's not self-contained.

It's not pretty. It's just a bunch of random stuff. I I I want to get more streamlined with it and then I'd be more willing to share my share my setup. Um do I have a site recommendation for easy medium code challenges and builds? Uh maybe. [sighs] No, I don't. Not off the top of my head. I know there's something. It's like front end. Maybe it's front-end mentor.

Is this a thing? Yeah, front end and full stack coding challenges that build real skills and help you get hired. And they do have um free challenges. They're basically these are basically like uh CSS UI and JavaScript challenges.

So, this is something this is one thing to check out. Um, and then also, uh, Floren Pop has an app ideas GitHub repo that has tons. Yeah, this thing has 88,000 stars. Um, fascinating. He's got a sponsor on a GitHub repo. That's fascinating. It's fascinating. Okay, but this repo has projects broken down into beginner, intermediate, advanced, and then any given project typically will have screenshots or also user stories that tells you like what this app should have. So, this is if you're just looking for um something to build or something to practice your skills if you're like learning a new framework or whatever.

This is another cool repo to to check out. Yeah, fully embracing AI. No, this was when I was in in kneedeep in AI. Like that's the other aspect of it is I was like somewhat uh obsessed, somewhat addicted because I'd be like sitting on the couch and be like, "Oh, I have an idea for something, but I don't want to get out my laptop." So, I set it up so that I could just prompt cloud code from my phone.

Um, yeah. I don't know. My home server is refurbish refurbished HP Elite Desk with a Cloudflare tunnel slapped into it. Yeah. all of the so like that uh lots of the stuff I've used are also using cloud for tunnel so I can access them externally um but I have I think it's a I think it's a an HP of some kind it's like a it's not server hardware but it is um like enterprise desktop hardware and I got it for pretty cheap a few years ago on with the intention of setting up like a big um Proxmox setup with a bunch of virtual machines. Yeah.

Yeah. And what's up, Eigor? Who says, "When you solve this task, how do you know that this specific task is an example of some specific algorithm if you've never used it?" That's the hard part. But um through trying to solve the problem, you could potentially uh when you're searching the web come across that particular algorithm. Um, so if if I can't solve it in 20 minutes, remind me and I'm going to do some web searches to try and find this because I'm guessing that there is some existing algorithm for collapsing overlapping ranges. Like I came up with my own algorithm here, but there might be something easier, there might be something that's more performant, and there might be something with some computer scientist's name slapped onto it, but I would never know unless I started searching the web for it. Uh, but yeah, that's that's the only way to know is to start searching. And when you when you start searching, then you can come across terms like breath first search or depth first search or different things like that. Um that's not going to be the solution to this,

but that's that's basically what we would do. Um yeah. Yeah, great great call out, Brandon. Uh West Boss's JavaScript 30 I think is free. Um and he's he's the OG. He was one of the first ones to do this. Uh 30 challenges.

Uh yeah, it's free. completely free and you have 30 different challenges. He gives you the challenge, you implement it, and then he shows you how he he would implement it. So, this is another another great spot to find stuff. Okay, but I do need to take a quick break cuz I got to get some water. I keep clearing my throat. But I will be back in 3 minutes time to solve Advent of Code part two. And then after that, we're going to do Clash of Code. It's going to be great. I will see you all very soon.

[music] Heat. [music]

[music] Heat. N.

[music] Heat. Heat.

[music]

[music]

[music]

[music]

[music]

[music]

[music]

[music]

[music] baby. Hey [music] Heat. Hey, Heat.

[music]

[music]

Heat. Heat. [music]

[music]

[music] Heat. Heat.

[music]

[music]

[music]

[music]

[music]

[music]

Hello, we're back. If you are just joining us, we are going to attempt to solve part two for day five of Advent of Code. This is a series of algorithmic challenges released throughout the month of December. We're now on day 12, which this year is the final one, but I stopped at day five. And last time on stream, I attempted part two. We sort of got there, but we didn't get the final solution. We got it working for the test input, but not for the final solution.

So that's what we're going to work on. After that, we're going to do Clash of Code. Let's jump into it. So for this particular problem, your input is a list of ranges. So all the numbers between 3 and 5 inclusive, all the numbers between 10 and 14, 16 and 20, and 12 and 18. And uh what we need to do is find all of the numbers included in all of the ranges.

And so my solution is to first collapse all of these ranges. Basically, anything that overlaps should be combined into a single range. So for example, um 10 to 14 and 12 to 18 overlap. So that could be uh collapsed into a range from 10 to 18. And then 10 to 18 and 16 to 20 overlap. So that could be collapsed into a range from 10 to 20. So the algorithm that I'm trying to create is given a list of ranges, collapse it into the smallest possible number of ranges um for those given sets of ranges. So this should be collapsed into three and five and 10 to 20.

Now, uh, where we were at was, um, we we read in all of the ranges. And let's actually just run this on our sample input to remind us where we're at. So, we have our sample input, we read it in, and then we have this function called get reduced ranges. And that essentially iterates over all the ranges that we read in and tries to create a single list of reduced ranges.

So if we run this on our sample input,

we get the value 14. But we don't want to log out the sum. We actually want to see what are the ranges that we reduced it to as well to make sure that we're reducing it in the right way. Okay, so our code is working for the sample input. Given this list of ranges, we collapse it to three and five and then 10 and 20.

And the thing that we have to solve is after that um how many numbers in total are there? And so um if we do if we calculate the number of values in each of these ranges. So 5 - 3 uh is 2 + 1. So there's three values in this range. So 3 4 and 5. And then uh there are 11 values in this range. So 10 11 12 all the way up to to 20. So 11 + 3 is 14. So there are 14 total values. Our output is 14. [snorts] So um when we run this same algorithm on the pool input, we get this big value which did we take note? Is this too big or too small? We didn't take note. So, I'm going to submit this value again, and it's going to tell us if this is too big or too small. My guess is it's too big because somewhere in all of these ranges, they are not collapsed in the

right way. There's some overlap in here that we didn't find, and that is causing us to get more values than expected. So, when we submit this, oh, our answer's too low. Oo, that's not good.

Huh? Okay, [snorts] that means we're missing some or we're getting some rid of some that we shouldn't have. Too low. Um, also I'm going to update my title everywhere because um we're doing Advent of Code now. So, give me one second to do that.

Okay, Let's try to come up [clears throat] with some kind of de better debugging plan. Um I think especially to find overlapping ranges. Um, I think we could just implement an ins squared. Um, yeah, we will implement an ins squared validator that compares every range to every other range to make sure that they're not overlapping [clears throat] after we've found our final ranges. I think that's that's that's one path we could go down. Um, is we'll just do this here. So, create an ins validator. So it would it won't be performant but the idea is we'll compare every range we extracted to every other range to make sure that they aren't overlapping. Um the the point of doing this would be um validate

no more overlapping ranges. However, because this tells me our output is too low. My thought is we have actually collapsed ranges that we should not have resulting in the overall numbers being lower. Right?

Because we're missing numbers. Um so here's my game plan. Just uh validate slwalk through existing code. After that we'll make a plan and we'll choose one of two things. So we are either going to create that in squared validator um or come up with a new algorithm.

Okay. I think up until this point we should be completely fine. Basically, all we've done is we've read in all of the ranges. And if we look at the input, it's just a bunch of these, but we're sorting them by the start.

Um, yeah, I guess I'm also also like I guess if the starts are the same, then we should sort them by the ends as well. Yeah, an internet doggo is giving us a tip. If you sort the ranges by their first number, you won't need to change the end numbers of any ranges.

Fascinating. And and we are doing that. So um if we if we look at our sorted ranges first and let's run this on the sample input.

We are sorting all of them by the start.

Um, and if we think about our algorithm, we're going to come across this, put that into our reduced ranges, and then when we come across this, we're going to combine those two into a new range. And then when we come across this, we'll combine that into the previous range. That's that's our current algorithm. But let's let's let's dive in. So, um, we have the list of sorted ranges.

We're starting with a brand new list of empty uh ranges. And for each one in the sorted list, we need to either put it into that list of unique ranges or combine it with one that's already in there. So for every range value, we're going to look at um all of the reduced ranges that we've already found. On the first pass, we haven't found any. So we literally just push in the first one that was found. On the second pass, the next one that we're looking at might be within that range. So, we might actually go into this for loop. Um, I actually think I want to I want to run this through a debugger.

I'm gonna I'm going to set up debugging. Um, how do I do that with VS Code? Let me look that up because then we can step through and we can take a look at what happens step by step after sorting this because I'm guessing after we sort it, we're going to come across a collision um on the first try. So, let me let me get uh Noode.js debugging set up really quick.

I wonder if there's a way to just set this up. So, um, go to the debugger, run n debug. This is NodeJS. Um

that is okay. We need we need to just open VS Code in day five.

Okay. So uh we are attached Now we'll do it again, but we'll set a break point and we'll run it on the regular input.

Okay, we have our sorted ranges which we have read in And we've got start and end for each one. And it does look like this range would be inside of this range. So those two are going to collapse on our on our first iteration. But um we start off with me zoom zoom out a little bit. We start off with an empty array of reduced ranges.

Um, and then we're going to look at each sorted range. Now, like I mentioned, on the first pass, there's nothing inside of reduce ranges. It's empty. So, the first pass is just going to skip over this loop and then push that initial range into reduce ranges. Great. Now, it's going to go back around and reduce ranges has a single range inside of it with this start and this end.

And if we take a look at what the next range is it has a start of that and an end of 8476082394860. [snorts] Um, and so that's the exact same end of the one that's already in there. So if our code is correct, we are going to find the one that overlaps at the end.

This is my guess is that we're going to jump in here because the start is less than or equal to the end and greater than or equal to the start of the one that we're looking at. Um well no the ne it'll let's see let's let's see what our logic says. Um so we're comparing this start that has a lower value.

Yeah I think I think this one's going to be within because the start value is greater than that start but the end is the same. So this will actually be within it and it's not 8476082394860.

The start of this range.

it's less than so it should be this next one. Or maybe we're not accounting for that one. That could that could be the issue. Um, the end is greater than the start and the end is less than or equal to the end.

I'm getting confused, but these two variables start and end are the current one that we're looking at. R is the um the reduced range that we're going to potentially be collapsing it into. So end and start are so start is higher than the current one that we're looking at.

[snorts] So if the end of the one we're looking at is greater than or equal to the start, which is true, and the end is greater is less than or equal to the end, which is true because they're the same. We're going to combine them. So, we should be combining them into a range that has this start and the previous end. Um, so we found it.

We're updating it. Now, I would expect to see that my um list of reduced ranges now has been updated. Oh, that's the wrong start value. That's the issue. [laughter] It should be the lower start value. Well, that's at least one issue. Um,

yeah, because this range start I mean I think we could just do something like math.min. Find um the minimum value of this start and that start.

Okay, that's that's one one fix. Um should we do

Um, I guess do do we do a math domax on the end? Cuz if the end of the one we're combining it with is less than or equal to the other end, um, no, it will just be that end.

Okay, that's that's one fix, but I do think we So, basically what we're doing is we're going back to the be if if we've overwritten it, we go back to the beginning of the loop to make sure that it doesn't overlap with any other existing range. Um,

so I think we need to do this to overwrite both of them. And then I think we're going to do something similar here. So if the start of the one we're looking at is less than or equal to the end and the start is greater than or equal to the start.

Oh, this this my logic is all all off here. Um, okay. We're coming across a new range. We're looking at that new range of start. Is that new range of start less than or equal to the end of the pre? Okay, so it's overlapping at the end. Is it less than that and greater than the start? Then that means we need to update the end to be the max of both.

Um cuz if it overlaps at the end then the start will yeah cuz this start was greater than or equal then the start stays the same but the end now becomes the max of end and range.

I think this is our issue because we were overwriting it with the wrong value. Um, and then we do the same thing here.

Okay, if this fixes it, great. Because all we had to do was one debugging session to realize that we were overwriting the wrong one. So, let's make sure this still works on sample input.

It does. And then if we run it on the regular input, we're looking for a value bigger than this. That's much bigger.

So, is this it? Did we solve it? Not the right answer. Your answer's too low. Okay. [laughter] Oh man,

I am wondering if we can look at like look at each of these. So, um it's so hard to tell with these these big numbers, but like is this greater than that? I can't tell how many digits there are. 41269 089149346.

Okay. If the start and the end are exactly the same. Um

that should just give us one number and it does because n minus start is 0 + 1 is 1. Okay. Um, that is fascinating though that that it ended up in its own range. And technically, this could be combined with this range. It doesn't matter because we're still accounting for it. Um, I'm just going to [gasps] Would it make sense to look at each of these individual values?

987 91 96 96 98.

Yeah, I don't think we need to do the work to like combine this range with this range because we're still getting the same total number of numbers. But I'm guessing that could actually result in would it result in extra um ranges? I don't know. I'm going to I'm actually going to do the work of looking at all of these and see if I notice any anomalies and then we're going to go back and do our do our verification.

Yeah.

Yeah. So, uh, in the chat they're mentioning that start and end are the same. They are, but, I don't think that's an issue because we're just trying to calculate the total number of values. And, um, if start and end are the same, it's inclusive. So that basically includes that one value. So when we're doing the calculation, we do end minus the start, which would be 0 + one. That means in that range there is just one value. So I don't think that's the issue. Um especially if our our values that we're getting are are are too low. But I'm going to read the chat. People are suggesting things.

Are the values in JavaScript's safe integer range? That's probably another another good call out. Um do we reach a point where these numbers are too big? Um what is what is max safe integer

max save int what is it called

m oh number.max safe. It's a static property on number that um I don't think I think like the largest value in here is is is way less than that.

Yeah, it's the the maximum number I have is way less than that. I guess even the the total value of numbers is is way less than that. I think

yes. Okay, let me let me catch up on the chat. What's up, dynamic voyage? Good to see you. Uh, Sorcerer says advent of code tag. I I think I put AOC in the in the chat in the in the title.

I need a tag for that, too. I'll do it.

Tagged. Cool. Thank you. Thank you for letting me know. Sorcerer. Uh, Mumi is saying, "I would write you to test with more manageable values for all the different ways ranges can overlap. These big numbers are maddening to look at." I completely agree. Yes, we need we should do that. We should create a sample input that um accounts for all of the cases of all of the different types of overlapping. Let me let me add that in my notes here. um create/v validate sample input with all possible overlapping ranges.

So like overlaps at the beginning, overlaps at the end, overlaps within, and then come up with a bunch of tests to make sure that we're getting the right values when we combine them. Uh it's not easy says you're merging the ranges that work for me. Yeah, we are. But we're potentially uh uh merging them wrong.

Yeah. And we found it. It's numbered up. Max safe ant. Um we should handle start and end being the same. Yeah. Just optimize your solution. Nice internet doggo. Glad to hear it. Okay. I think I think this is the path we need to go down, which is let's get it working for sample input that has all possible ranges. So, I'm going to copy this, call it sample input two, and let's think of all the possibilities. So, um, and we'll write it out in the sorted way because that's how we're going to be parsing it in.

So, let's come up with something that would overlap at the beginning. So when we come across 12 12 and 18 that overlaps on the end and then this overlaps on the end when we sort the value sorry when we sort their values they're always overlapping on the end though right um I think we also okay this This is my other thought. We need to sort if the start values are the same, then we need to look at the end values when we're sorting them.

So, let me let me account for that. Um, and then we'll also add add some tests. So, this shouldn't just look at the start values when it's sorting them. It needs to look at the end values too. Um so we have our result and if that result is equal to zero then we need to take into account the end value. So we'll do a minus b.end.

Um otherwise we just return the result because before if we had the ranges like I guess um let's say in here we had uh 10 to 50 like and and I guess it was before

or 10 to 20. Uh before when we sorted these, it would have just ended up like this. And that means we have we put this range into our reduced ranges. And then when we come across this, it's overlapping at the beginning. So we should get a new range that's 10 to 50. And then when we come across this, it's within. So it stays the same. This is within. This is within. So it all stays the same. Um but if we were to sort them by their end values as well then we would gradually overlap them in on the end. So it would be 10 to 14. This overlaps beginning and end. This overlaps beginning and end. And then everything else is within.

Um let's double check that this one change still works for the sample input.

And thank you, Phipe, for that follow on the Twitch side. Appreciate you. Yes. Yes. Okay. What if we run it for sample input two? We should get 10 to 50 as one of the ranges. We don't.

Um, that's that's bad. That's that's really [laughter] bad. Okay. Um, let's fix that. No, no, no. Yeah, yeah, yeah. Okay, okay, okay. This we need to fix because we completely got rid of 10 to 50 and it's only 10 to 20.

So, we're sorting it in the right way. Um, but when we merge, we're not merging it in the right way. So I'm also going to log out our uh reduce ranges on each iteration.

Yeah. So on this iteration when we have 10 and 14 and we come across 10 to 20 this new range that we're looking at has an end value greater than the previous end but the start is is the same. So this would be overlapping the end. Let's look at our code for overlapping the end.

So if the start is less than or equal to the end, it is. So, we're comparing 10 and 14. Great. And if the start is greater than or equal to the start wait, I want to rename these variables because I'm just I keep getting confused. Um, I'm going to call this existing start.

No, no, no, no. Not that's not the existing one because that that is the sorted those are the sorted ones. Um that's the one that we're looking at. This R value here is the reduced one. So I'm going to rename this to reduced range. Okay. And the reduced one is the one that we're collapsing it into.

So in the case where we already have 10 and 14 and we come across 10 and 12, 10 and 14 is the reduced range and 10 and 12 is the start and end. So if 10 is less than or equal to 14, which it is, and 10 is greater than or equal to 10, which it is, we should now end up with a range where the start is 10 and the end is 20. So the start gets that value and then we do the maximum value of end and reduce range.in. So this should give us um 10 and 20.

And it's not hitting it's not hitting this Okay, I'm gonna I'm going to run the debugger again. I know I said I was going to set up unit tests, but it's just not in my nature to [laughter] do that. It's just not It probably would be more efficient, but [snorts] [clears throat] okay, first pass reduce ranges um will have nothing. Now it has the first value which is three and five. Okay, [snorts] then we're going to put in uh 10 and 14.

So great. So now we have 3 and 5 and 10 and 14. Now we have just come across 10 and 20. We need to collapse that because it overlaps on the end. So let's let's double check all of our logic. So we're going to look at those reduced ranges.

so first we're looking at three and five. It's not going to match with any of those. So we should come back around. And then we're going to look at 10 and 14. And it is going to match with those. So is that start greater than or equal to 10 and 14? Yes. And is that end 14 less than or equal to that end?

Oh, I'm checking this in the wrong direction because this skips it. This doesn't collapse them. I need to check um the opposite because I'm checking is that was the issue. I'm checking does the reduced range overlap and if it does skip it. But but I want to check does I want to I basically want to flip this. I think I'm not checking that anywhere else am I? Yeah. I need I need to flip this. This needs to be is the start greater than or equal to the reduced range start and is the end less than or equal to the reduced range end. So this says if the sorted range we're looking at is within then we skip it but it's but we're looking at the sorted one. Now that I've swapped those this should actually make it in here and then reduce them in the right way. That's that's

another bug that we have found. Okay this might be it. That that might have been the major bug because now we have collapsed that in the right way. I know this is messy. I know I should have written unit tests, but we're just going to go for it. We have a different answer, so we're going to run it on the the main input so I can be done with this. That number is larger.

So, we're going to go for it and never look at this problem again if we get it right. Yes. Yes. [laughter] Okay. Don't be like me. Write unit tests. um be more methodical. I I think the thing is like debugging is good too, but I basically I'm like getting ahead of myself because I in in the debugging process I literally find the bug and so like okay, I want to test this bug when in the real world it would make sense to write a test that captures that specific use case. So that way in in the future you don't run into that same bug again. But I'm never going to run this code ever again. [laughter] Um, but that was the issue and I think my variable names are basically what confused me as well. I was so it was so hard for me to differentiate like what are we actually comparing here and this was the issue. We were skipping the wrong one and comparing it in the wrong direction.

Okay, day five done. [laughter] And uh thank thank you thank you for the claps. Dynamic Voyage. Um and Zary, good to see you. And Phipe, I think I said thank you, but thank you for the follow. and it's a track. Thank you for the follow as well. What's up, I Rossom? Good to see you. We did it. All right. Um, at this point, we're going to do two Clash of Codes.

And we'll do the first one in any language you want. We're going to do fastest mode. So, first one to solve the problem wins. And then after this, we're going to spin the wheel. The spin the wheel of languages. and whatever it lands on, that's what we all have to use to solve the problem. Thank you, internet doggo.

Gold star. Gold star. Okay, if you want to join the clash, uh, head to this link and it'll drop you into this room. You can log in with GitHub. That's probably the easiest way. But basically, what's going to happen is once we get everybody in here, um, we'll get dropped into a room that has a problem description and then, uh, a place to write our code, and the first one to solve it wins. But really, this is a battle with yourself.

Um, if you if if you're especially if you're just starting this stuff, it's okay if you do it slower. Just try to solve it within the 15-minute time limit. That's that's the main thing. Um, and we will take a look at all solutions that are in varying programming langu programming languages once everyone submits. And that's one of the funnest parts of this is we get exposed to uh things like C or Okamel or Python or um Ruby and we get to see this same problem implemented in in multiple ways. Yeah, if you take more than 25 seconds, you're a failure as a programmer and a person.

You would think that especially because this is a race, but no, that's that is absolutely not the case. It's it's a battle with yourself. I think if you can solve it at all, great. Good job. Okay. Um I'm going to take a quick two-minute break. I'll let everybody trickle into the room. Um I'm going to update my title as well and then uh we'll do this.

We we'll get into it. So see you soon. [music]

[music] Heat. [music]

[music]

Heat. [music]

[music]

Down. [music]

[music]

Green. [music]

[music]

[music]

[music] down. [music] Down.

[music]

[music] Baby.

[music]

[music] Hey.

[music]

All right, my friends. We're back. We're ready to play Clash of Code. So, if you're just joining us, click the link in chat. It's pinned in uh YouTube chat and Twitch chat. And is that the latest one? Yeah, that's the latest one. Um, click that link, join us. We're all going to be dropped into a room. First one to solve it wins. But we're going to look at everybody's solutions. Let's go.

Yeah. And uh welcome in uh Kashad. Good to see you. Yeah, it's just me today. [laughter] Um I've been going live on the the Syntax channel. I was live last Friday. I'm going to try to go live on the syntax channel every Friday. And maybe once in a while, maybe in the new year, we'll we'll get Scott and and Wes to drop in as well. But for now, it's just me. Okay. Uh left-hand side has the text, right hand side is your problem.

Let's get into it. You're given a string that contains Japanese characters. Separate the string by the separator that and then calculate the sum of the unic code values of each character in the resulting substring. Finally, output the minimum value from all sums. Amazing. Okay, so we read the line in and then we split it on that and then each character inside of there we want to grab the unic code values for. Um, so I'm going to do an array from um, oh, actually, I guess it's already an array after we've split it. We could run into an issue where the characters have do a similar thing as like emoji characters that are combined, but maybe they don't. So, we split it and then we can map over it cuz that's going to give us each individual character.

Um and from there we want to get the unic code values. So um I think we can do char code at zero. So that will give us the unic code value for that given character. And then we want to output the minimum value from all the wait what are the sums?

Calculate the sums of the unic code values of each character in the resulting substrings. Oh, so it could be it could be more this split could be longer than length one. So we actually want to again split this on spaces. I think I'm going to do an array from to be safe here. So we do an array from on each individual character in that. We'll call this sub because this is this is a substring and then we have each individual character in that substring.

And uh for each character, we want to get the character code at zero for that character.

I guess we could do this in a weird way as well. We could have the sum start off as zero and then this iterates but then we just increase the sum and then we return the sum. So we're going to get an array of sums and then we want to find the minimum value. So from there, if we just do uh math.min of all of the results or the sums,

does that do it? No. Okay. Character.charcode at is not a function. Um, let's see what sub is.

So that gives us this part up until that string. [snorts] Great. Then if we do array from on it, that should give us each individual character. Um, oh well, I guess we're doing a this this needs to just do this.

I think charcode at is not a function. Can we see what chart is?

Oh, is that the index? Oh, is it character and then index? That's what we need. There we go. Okay, [snorts] that's the solution. Okay, we got there. It just took us a second.

Cool. Um, and uh, NECA, thank you for the follow over on Twitch. Yeah, like to see me try. Okay, well, that would probably take me a second. Okay. Um, I'm going to go check in on something. Uh, stick around. We're going to look at everyone's solutions, everyone that completes this. So, I will see you all very soon.

All right, we got a few more solutions. Uh, let's start taking a look. And we've got Haskell, Russ, JavaScript, and TypeScript to take a look at. So, um, Andrea did it with Haskell. And I say it every time, but this this this doesn't look like programming, but here we go. Split on apparently is uh built in or at least we we've imported that method. So we can take the input string and split it on that given character. Great. Um we're then going to sum that substring.

And I think from enum potentially gives us the unic code value. And then we're going to take the min of that list of sums and print it out. Amazing. Somebody said it before, but Haskell Haskell is like Yoda. It's like you you talk in it's like things are shifted around then from what you're used to and you kind of have to read it from the right to the left. Fascinating.

Um, but yeah, let's see what uh Mumi says. Lyftm promotes a function to a monad. Basically, a map, but only for monads. So, lift m promotes a function to a mo a monad. So, this becomes a monad. I'm not going to pretend like I know what a monad [laughter] is. Like, I've come across them, but I couldn't explain to you what a monad is. [snorts] Um, and then we apply the min function. We fold that into the min function.

Fascinating. Okay, we saw my solution. Um, it took me a second to get there. I was doing this weird array from stuff, but basically split it on that character. That's going to give us each substring. I want to sum up all the unic code values in the substring. So, I use array.fr. That gives us each character. JavaScript has charco, which will give us the unic code value for that character. That gives us the sum for that given substring. This results array will be an array of all the sums. And then we want to find the minimum sum. So we just spread that array into math.mmin.

Okay. Capton did it with rust. Um, and here we go. This almost looks like JavaScript. So split it on that character and then for each group get all of those characters and then convert them into unic code. So or no this this here when you when you use fold charact the characters themselves I think chars in rust actually gives us back their unic code values. Let's see because that that just gives us the unic code values as um int 32s and then we can just sum them all up and fold is kind of like a reduce.

How to get a char unic code value? Um, and this is doing group. Group I'm guessing is a string. I just need to see what this chars method does. An iterator over the chars of a string slice.

Yeah, I guess I'm just curious and and let me know in the chat if anybody knows Rust. Um, does this actually give us the unic code values or is it the fact that we are casting them as unicode? Oh, are we doing the casting here? This must be the casting like when you concatenate characters, you can cast them to to integers. Is that what's happening? [snorts] Um, it gives the characters. That's why you need asu U32. Okay. Um and they're saying chars returns a list of U8. I'm casting to U32 since some may be bigger than 8 bits. Gotcha. Okay. So this the casting piece is what actually turns it into the unic code value.

Amazing. Um and then there's just a min built into lists of values or arrays of values in Rust and we get the total. Amazing. This is actually like very approachable for being a lower level language. Rust is pretty nice. Okay, itakito did it with Typescript.

Nice. Just a a straight up uh for loop. So we have our list of sums. We split it for each one. We calculate the inner sum. We use char code at Great. Put it into the sums. And then we find the minimum of the sums. Great job. Uh Djonas did it with JavaScript.

Nice. Everything's in line. So, um, split it, find all of the sum, the subsums. So, get the substring, do a reduce to get the sum. That's going to give us an array of sums, and then we pass all of that into math.mmin. Great job. All right, we're going to do one more, but for this, we're going to spin the wheel of of languages.

Um, I need to find a I need to find a wheel spinner. Give me a second.

Okay, this should work. But uh throw it in throw it in the chat. What languages should I get to choose from or should we should we choose from? So I think Rust will be one. I've only written a little bit of Rust. Um I'm going to put Go on the list because I only again I've only written a little bit of Go. We did Go last time. Uh C could be fun. I think Ruby could be fun. What other languages should we throw in this list?

Haskell. We're going to put Haskell in. I don't I don't know if I can learn Haskell and solve a problem in 15 minutes, but we'll [clears throat] see. We'll see. Any other suggestions? PHP. Why the heck not? All right, last chance and then we're just going to do it.

Going once. Going twice. This is it. Spin the wheel.

[laughter] Come on. Come on. Oh, wow. Wow. We almost did Haskell. Um, [laughter] we're going to do PHP instead. Yeah. Um, Mumi was like, "No." Um, this should this should still be fun. If this one I'll say this, if this goes by quickly, we'll do one with Haskell straight up.

But here we go. We're going to do another one, but you can only use PHP. And I don't want to go through and un uncheck all of these manually. So, we're going to do a mini code challenge where we use JavaScript in the console to select all these checkboxes um and then manually check them with JavaScript.

Um it's using Angular though. [laughter] I wonder if we're going to be able to uh to do it. But basically, I want to find all the elements. So, we're going to do a document.query selector all for all of the elements that have the CG checkbox class. And then we want to find the input inside of there.

And then for each of those, we're going to get each checkbox. And um I mean I think we can try to click it. Did that work? Yeah, it worked. [laughter] Nice. Um and then we're only going to select PHP.

Cool. And we will do fastest mode. Nice. Okay. So, you're only allowed to use PHP for this one.

Yeah. Thank you, DJ Jonas. It's It's like magic when when you [laughter] uh when you bring out the Yeah, we're we're hacking the the dev tools. Um just so I don't have to click 50 times. All right, I'll give you about a minute to to jump into the room. And uh if you don't know PHP, I encourage you to spend the next 15 minutes trying to learn a little bit of it to uh to solve this problem. Um and a nice site to look at is learn x in y minutes.

This will show you at a high level all the stuff in PHP like how do you define variables? How do you do loops? So there's this is this is usually what I go to when I'm trying to learn something really fast just like at a high level. Um we might also just search the web if we need to look up like how do you split a string or or whatever. But I do think it's explode. I know that there's like a built-in PHP function called explode that splits a string. I'm pretty sure.

I'm pretty sure. All right, let's get into it.

Am I going to regret this? Here we go. I'm going to regret this. Look what This is too much. Okay. Jack is doing geometry and has just learned how to get the radius R of an inscribed circle within a triangle. Now he's curious how much extra perimeter the three vertices add to the perimeter of the circle.

In other words, he wants to find the perimeter of the triangle minus the perimeter of the circle. The end radius of a triangle is given by r= k / s where k is the area of the triangle and s is the semi-p perimeter. The area of an arbitrary triangle can be found by a * b * the sign of the angle divided by two where we have two side lengths and the angle between them.

[laughter] Uh well I don't know I don't know much PHP either. Uh the realistic um sorry how do you say your name? Um the realistice. Yeah that's the that's the fun part is we're all going to have to figure out PHP as well as solve this weird problem. Okay. Where um also my neighbor is doing something really loud. I don't know if you can hear it. I have noise cancellation, but you might hear a weird noise and I apologize about that. Um so the perimeter of a circle is 2 pi r. The perimeter of the triangle is a plus b plus c. Don't forget about degree conversion. Radians degrees * p<unk> / [laughter] ridiculous. Okay, we have the three three side lengths A, B, and C. We have theta in degrees between sides A and B.

We want to output the difference of the triangle perimeter and the inscribed circle perimeter rounded to two decimal places. Okay. Um

if we look at the code that they've written for us um that gives us a bc and theta. So they already write the code to read those numbers in. Um, and I think basically so A, B, and C gives us the triangle. We have all three all three sides of the triangle.

[laughter] Uh, the real realist says, "Call me French cuz I concede." We're we're going to figure this out. So we have a triangle. We've got sides A, B, and C. I I think we we can figure out what circle surrounds that triangle with some formula. We need to do that. Once we figure that out, then we can get its perimeter. Then we can just do that minus a plus b plus c. What's the difference? I think is what we're looking for.

oh no no no not the circle outside the circle inside. Okay. How much exper? Okay. So we need to find the circle inside of the triangle. And the in radius of a triangle is given by r= k / s where k is the area of the triangle and s is the semip perimeter. So this formula will give us s.

So let's get s. And I believe in PHP we use dollar signs. um to reference our variables and create new variables. So this gives us s and then k no and then r is the area of the triangle. So no k is the area of the triangle. So we'll do k uh the area of a triangle is a square plus b square plus c^2 right? [laughter] Do I remember that? Um, or no, is it 1/2? No, it's 1/2 the base times the height.

Base time height divided by two.

Okay. How do I know what the base and the height or which one's the base and which one's?

Let's see. Um

did it give us the uh area of a triangle? The area of any arbitrary angle can be found by a * b * where okay but in order to get r which is the radius to get the radius to get the the radius of the circle we need to first divide k by s. So to find K, we get the area of the triangle. Um, and I guess to get the area of the triangle, we just two of the sides of the triangle are always going to be the same, right? Or no, the base is the longest one. How do you find I just I don't know what to do with A, B, and C. Like, how do we know which of those to plug into um 1/2 the base times the height?

Given three sides of triangle, how to calculate area? That's what that's what we're looking for, right? We want the area of the triangle.

Three side lengths. Five, five, five. Calculate. Okay, what's the formula? Let A, B, and C be the lengths of the sides of a triangle. The area is given by the square root of that where P is the half perimeter or A + B + C / 2.

Um, we're going to we're going to just do this to get the area. Oh, and then we have the perimeter already. A plus B plus C divided by 2.

P is the half perimeter. Okay. So um the area is actually going to be s * s - a.

So we do s - a time s - b

times s - c and then all of that time s and then we take the square root of that and that gives us the area. So let how do we find the square root uh in PHP square

PHP square root

square root is it just built in I don't have to import anything we can just use square root okay so we find the square root of this whole thing. That will give us the area K. And then R, which is the radius, is going to be uh K / S.

Um, and then now that we have R, we can do 2 pi R to find the perimeter of the circle. So the uh perimeter is going to be 2 * pi time that radius that we calculated. Now how do we uh get pi in PHP? It is a function.

There's also a constant m underscore pi. We'll use that. We'll use the constant. So 2 *<unk> * r is going to give us the perimeter. Um oh I see the area of an arbitrary triangle can be found using this [laughter] um using this calculation. We found it a different way and that's fine. Um that's why they gave us the angle but we we're not even going to use that.

uh that way we don't have to do any like weird conversions between radians and um degrees. But now that we have the uh the the perimeter of a circle, that's the circumference, right? Perimeter is circumference. Circumerance of a circle, that's the whole thing. The distance around it, that's the perimeter. Okay.

So, yeah, that's the circumference. And we are trying to find um how much extra perimeter the three vertices add to the perimeter of the circle. The perimeter of the triangle minus the perimeter of the circle. So our answer is going to be [snorts] a + b + c.

Um I'm going to store that in a variable. Uh the this is going to be the triangle uh perimeter

and then the triangle perimeter subracted from the perimeter of the circle should give us our value. And if we did everything right, all we have to do at this point is round to two decimal places. Yes, that's it. Okay, so now how do we round or uh rounding might not be what we want. I guess we can do precision.

So in PHP you can say round give it a number and then a precision maybe of two. So let's let's try round with a pre precision of of two. So we do round that and a precision of two.

That solves it. Amazing. Now this was very lame. I did not like this challenge. I think the main things that we had to learn about PHP were uh how to define variables and then we had to look up a bunch of built-ins. So we looked up things like math.py, square root, round. It's good to know that those exist, but this isn't exactly a it's not exactly a PHP [laughter] thing. We're just we're just doing maths at this point. Okay, let's see how uh Andrea did it.

Yeah, people who are better at reading than me. I I used a completely different formula to find the uh area of the triangle that didn't need to use the uh angle, which is fun, which is great. Uh, it looks like they did use the pi function. So, you could use e either use the constant pi or the or the pi function. That's great. Uh, Capitan did it. And yep, same thing. Same thing.

They also use the pi function. D. Jonas, same thing. Yeah. Am I the only one that that didn't read the problem to see that you could find the area given the angle? Um, that's so fun. Oh, and then this is fun. They used a number format. I guess I didn't look. Did Did they use round here? No, they used a print f. Okay, so I use the round function, but apparently you can do a print f. This is like C style uh printing and that gives you that allows you to do decimal precision.

So print this number with only two decimal places. And then uh Capitan did the rounding function. Um and then DJ Jonas did number format. So there's a lot of ways to do it. You could use uh C style string formatting, number format, round, uh apparently number format is a built-in function.

You can say how many decimal places and I guess the separator, this would make sense like internationalization if you want your separator to be maybe be like a comma or something. Um and then we saw how I did it. [laughter] I went the roundabout way to find the area of the triangle and then use the round function.

Okay, I think I'm done for today. Uh, why no dollar sign post? The way this code is running, it actually is not uh it's not on a server. It would be like running this file directly from the command line with the PHP interpreter and so it's being get given uh values from standard in. So yeah, [snorts] um, in the real world, in the real world, uh, we would be getting those values from like a post or something.

Yeah, easy win. Even though I've written maybe 10 lines of PHP in my life. Yeah, I I think you did. You won it, you mimi, didn't you? [laughter] [snorts] Numberat uses float separator, thousand separator. Fascinating. Yeah. And this was too much math. I have AB and theta. Yeah, that was the issue is I didn't I didn't read that part. Okay, I'm done for now. Thank you everybody for hanging out. This was super fun. Um, thank you for watching.

This was great. I I will remind you if you haven't go check out Debug December because you have until the end of today to uh solve up to day 12 and then you will be entered to win some swag. And today is uh Yeti Blankets. Uh, if you check out the Sentry X account, you can see this is the blanket that you could win, which is pretty slick. It comes with like a little uh pouch to put it in as well.

Might be good for taking it camping. Um, but they're they're going to be giving away 20 of them. So, if you complete all of the Debug December challenges, you'll be entered to win. So, definitely go check that out. That's all I got for you today. Uh, thank you, Seth. Thank you for tuning in. Thank you everybody else for tuning in as well and happy Friday to you. I Rossom. Hope you enjoy the rest of your day and and have a good weekend everybody. Um I'll see you again on Friday. The plan is stream every Friday. What is what is this upcoming Friday? I'm not going to see you on Friday cuz [laughter] maybe I'll see you on Thursday. Maybe Thursday.

Cool. It's it's the holidays, you know, stuff happens. All right, that's it. That's all. Wherever you are in the world. I'm not going to say that because that's the coding garden thing. See you in the next one. Peace, everybody.

Quote it with credit and a link. Quoting Syntax