I messed up. I'm sorry.

  Рет қаралды 58,123

Nick Chapsas

Nick Chapsas

Ай бұрын

Use code EASTER25 for 25% off any course, EASTER15 for 15% off any bundle or EASTER10 for 10 off your first year of Dometrain Pro on Dometrain: dometrain.com
Become a Patreon and get special perks: / nickchapsas
Hello, everybody, I'm Nick, and in this video I will address a mistake I did in my previous video regarding search values.
Workshops: bit.ly/nickworkshops
Don't forget to comment, like and subscribe :)
Social Media:
Follow me on GitHub: github.com/Elfocrash
Follow me on Twitter: / nickchapsas
Connect on LinkedIn: / nick-chapsas
Keep coding merch: keepcoding.shop
#csharp #dotnet

Пікірлер: 139
@IceQub3
@IceQub3 Ай бұрын
Bro was wrong and got a free video topic as a present. 10/10 business
@sammtanX
@sammtanX Ай бұрын
accurately pinned ahh comment
@allanhouston22
@allanhouston22 Ай бұрын
Not free, he placed the ad in the middle of the video
@antonioamaral400
@antonioamaral400 Ай бұрын
There are only 2 types of people that "don't make mistakes". Those that don't do anything and those that won't admit them. Viewers: "Come for the tech value, stay for the human value". Keep up the good work Nick
@CrazyHorseInvincible
@CrazyHorseInvincible Ай бұрын
I'm of the type that don't do anything. My record is spotless.
@margosdesarian
@margosdesarian Ай бұрын
Thats it Nick. I was going to introduce you to my beautiful daughter, but thats not happening now. Your loss.
@AdolfoFoliaco
@AdolfoFoliaco Ай бұрын
so true, I'm still reading last year's performance blog
@bogella2225
@bogella2225 Ай бұрын
A true cop would do a self review and find no wrong doing
@AnsisPlepis
@AnsisPlepis Ай бұрын
Well said comrade
@nickchapsas
@nickchapsas Ай бұрын
The Blizzard Entertainment way
@hasmich
@hasmich Ай бұрын
​@@AnsisPlepisdisco elysium vibes
@renatogolia211
@renatogolia211 Ай бұрын
@@nickchapsas horde or alliance?
@DevDunkStudio
@DevDunkStudio Ай бұрын
Mistakes are fine, it's how you respond which matters. And this is the best way to do it. Appreciate the transparency
@vitalydushkin
@vitalydushkin Ай бұрын
I don't think you have messed up. I'm going through MS docs now, and they don't make any sense, and have no examples. Went to see a couple of articles, they also fail to deliver. Your videos showed a few real world use cases. But thanks for the follow up. Also Nick, would it be possible for you to add to the title "SearchValues" so it would be easier to find this video in the future? I like to use your videos as a point of reference from time to time, and descriptive title or/and tags greatly improve searchability. Thanks!
@nebuleon
@nebuleon Ай бұрын
Seconding this. Maybe a name like "SearchValues on strings, part 2: IndexOfAny" when the "clickbait window" is closed?
@Placeholderhandle1
@Placeholderhandle1 Ай бұрын
I will always forgive you, brother Nick.
@hasmich
@hasmich Ай бұрын
Given a mistake has been admitted in the first place ;)
@ProfBits
@ProfBits Ай бұрын
Ok, nice to heare. However in this case you should the simplest but worst possible way to do the computation as a base line. Therfor how would a Boyer-Moore string-search algorithm implementation stack up against search values or is it simmilar? It would be simmillar if search values uses it in the backend, however I haven't checked that.
@gilroitto
@gilroitto Ай бұрын
Curious about the algorithm. My best guess as many here is a modified version of Boyer-Moore or Boyer-Moore-Hoorspool algorithm, where the pre-processing combines all the search words into combined table(s). Edge cases that would challenge the performance would be high Unicode characters, many search strings that cover the whole alphabet, and search in texts with few characters (e.g. DNA sequences).
@CalebJenkinsOnGoogle
@CalebJenkinsOnGoogle Ай бұрын
It's all good Nick! I love the transparency and opportunities that come with doing so much in public. Keep that excellent content coming our way!
@persehlin4379
@persehlin4379 Ай бұрын
Thanks! That's why I trust you and your videos. You are so eager to do things correctly that you even evaluate your own videos. Fantastic!
@99MrX99
@99MrX99 Ай бұрын
Is there also a method to return the found value so one can e.g. switch over it from the different values one searched for?
@IllidanS4
@IllidanS4 Ай бұрын
It's okay. At least you did not sing the apology. To be honest I did not give so much attention to the previous video but I immediately recalled memories of learning about Aho-Corasick and other text searching algorithms, so I already knew where this would have been going. I would love to know more about what this algorithm is or what the structure behind it looks like. Perhaps it is the hashing-based searching too.
@superpcstation
@superpcstation Ай бұрын
Hi nick, why did you reassign NeedleArray and Haystack to local variables inside the IndexOfFirstArray?
@bogdan.p
@bogdan.p Ай бұрын
We appreciate your transparency Nick. It's great you did a follow up on this. Nobody knows everything.
@Szwarcus15
@Szwarcus15 Ай бұрын
4:54 hahaha this makes me laugh 😂 Good job, really impressive that he reached you and that you shared this with us 🔥
@ChristofferLund
@ChristofferLund Ай бұрын
Same lol 😂
@LasseVagstherKarlsen
@LasseVagstherKarlsen Ай бұрын
I agree, this is a much better showcase for the benefits of that class, nice of you to come back with an update :) This suggests that what this class does is to create a DFA or similar for use with an algorithm similar to Boyer-Moore, that instead of just blindly iterating one character at a time over the text to search, actually uses the knowledge of what it is searching for to be able to skip faster through the text. I say "similar" because I have not kept myself updated on such algorithms and undoubtedly there are even better algorithms these days.
@_mihazupan
@_mihazupan Ай бұрын
For the example given (3 ASCII values), the implementation would currently use an algorithm called "Teddy" that lets us look for prefixes of multiple values in a vectorized manner
@paulecampbell
@paulecampbell Ай бұрын
Man, Stephen is legendary and I know that's where Nick is heading. I literally just watched a video with Stephen explaining how async/await works internally - epic! Thanks for sharing this with us Nick. I have even more confidence in you now that I know that you will not hesitate to call out yourself!
@genyalubin
@genyalubin Ай бұрын
How does IndexOfAny work behind the scene? Why is it so performant?
@leopoId
@leopoId Ай бұрын
So it is for finding strings in a long paragraphs, not in a string array. Good point but are there any mentions about it on Docs?
@DotNetCookbook
@DotNetCookbook Ай бұрын
Now this makes much more sense! Thank you! What’s still unclear to me is the use case scenario for search values on any type that is not a string/char.
@tedchirvasiu
@tedchirvasiu Ай бұрын
Damn, I was just reading Stephen Toub's "Building Async Coordination Primitives" blog posts from 2012 today and now he gets mentioned.
@jvquiles
@jvquiles Ай бұрын
Recognizing errors makes you a great person. This kind of things are really motivating to follow your videos 🙂
@fusedqyou
@fusedqyou Ай бұрын
That's it, I'm switching to Java now
@mikestiver9000
@mikestiver9000 Ай бұрын
"It hurt itself in its confusion".
@adambickford8720
@adambickford8720 Ай бұрын
Ironic because I'm a java dev that follows c# to see where we'll be in ~5 years
@alissoncandatem1896
@alissoncandatem1896 Ай бұрын
@@adambickford8720 the sneak eating it's on tale
@AnsisPlepis
@AnsisPlepis Ай бұрын
We mainly use dotnet where I work, and during a board session, we had to assign tasks. One of them was upgrading dependencies in a Java plugin. When no one offered to take the task, scrum master shyly said “Java? Anyone?” as if to convince someone. That was the funniest and most awkward silence on the job, and sometimes when I see Java I realise just how glad I am to have moved past it
@carlosalmeida2847
@carlosalmeida2847 Ай бұрын
I wouldn’t say you messed up, I’d say you came with a part 2 video with even more detailed, in-depth and thorough information! Congrats!
@jcmorin2007
@jcmorin2007 Ай бұрын
It's a "messed" in a sense it didn't show anything. When I saw the original video I've immediately told myself, how is that better than a hashset with a case insensitive comparer. So happy how I get the answer.
@vekzdran
@vekzdran Ай бұрын
A major lesson in public communication and audience control. Kudos Nick.
@TonoNamnum
@TonoNamnum Ай бұрын
How long it takes to cast it to a searchValues?
@acedonk
@acedonk Ай бұрын
I am proud of you. Very few mere mortals gets humbled by Stephen Toub, you took it like a boss. Keep coding.
@C00l-Game-Dev
@C00l-Game-Dev Ай бұрын
Do you have any reosurces that explain how this works behind the scenes?
@tanglesites
@tanglesites Ай бұрын
Nobody is perfect Nick. The fact you deem an omission a mistake regardless the reason for the omission only makes me like this channel more. I’m sure most of us didn’t even notice. Thanks for the “update”.
@d347hm4n
@d347hm4n Ай бұрын
Transparency and integrity, nice to see. :)
@mrcarlpaton
@mrcarlpaton Ай бұрын
You still smarter than I'll ever be and I'm a better engineer because of all your other content and courses. Keep coding brother ❤
@krccmsitp2884
@krccmsitp2884 Ай бұрын
Thanks foe clarification.
@RamonSmits
@RamonSmits Ай бұрын
FrozenSet might be even more efficient
@muhamedkarajic
@muhamedkarajic Ай бұрын
I was worried when I saw the title. You had me there worried for a couple of seconds Nick.
@GiovanniCostagliola
@GiovanniCostagliola Ай бұрын
Press F to pay respect
@utubekade
@utubekade Ай бұрын
Now this makes much more sense. Great feature!
@vitalmarc
@vitalmarc Ай бұрын
How does this compare with old school Regex?
@jongeduard
@jongeduard Ай бұрын
Depends on your regex implementation. There are quite a lot. The Dotnet regex engine is quite a fast one, but also quite large in features, while in Rust you get basically the fastest implementation on the planet I believe, but with more limited features. But still things like SearchValues may still win over all of these, since you dedicate it to very specific things to search for and not a whole regex engine has to sit behind it. However, this is all my thoughts. the real way to know is just to benchmark it. Very simple.
@C00l-Game-Dev
@C00l-Game-Dev Ай бұрын
Thank you for being honest and owning up. As long as you admit it, your cool.👍
@SlackwareNVM
@SlackwareNVM Ай бұрын
Title sounds like one for an influencer apology video. Thanks for the correction, tho. The feature looks pretty amazing.
@hasmich
@hasmich Ай бұрын
It's great you made this video and did it so fast. Everyone makes mistakes, but it takes guts to admit it.
@JRyomaru
@JRyomaru Ай бұрын
Nick title should include info about what it is. We search (lol) for these in the future,
@reikooters
@reikooters Ай бұрын
Good follow up. On the last video I assumed this was the actual use case just because this is essentially what the previous characters one was doing (needless in a haystack type thing). But nice to see an actual benchmark showing the feature.
@peterk4694
@peterk4694 Ай бұрын
That was nothing. You should see the mistake I made. Much respect Nick
@Bennevisie
@Bennevisie Ай бұрын
Integrity move, brother
@CharlesBurnsPrime
@CharlesBurnsPrime Ай бұрын
Were it possible for me to respect you more than I already do, sincerely apologizing for a legitimate mistake would have increased that respect further still.
@cocoscacao6102
@cocoscacao6102 Ай бұрын
"I owe you an apology" ...and money I'd add... My billion dollar startup just failed due to bad information from YT.
@RandalGJunior
@RandalGJunior Ай бұрын
Could you talk about redis alternatives? please
@robl39
@robl39 Ай бұрын
I guess it still wasn’t clear to me why this is better than a hash set or hash map. What is the summary here? Why would you use this over the hash set or map?
@charlesaboujawdeh
@charlesaboujawdeh Ай бұрын
Hey Nick, I really find your videos useful and I wish I could afford your dometrain courses and support you. I'm from Lebanon but I find them too expensive for us since our income is so low specially because of the economic crisis we've been in for almost 5 years now :(
@hernanar3647
@hernanar3647 Ай бұрын
Yeah, a course price specific based on the country might be a good idea for people of countries with less resources
@comediehero
@comediehero Ай бұрын
Always nice to see someone admit mistakes and fix them. Mad respect!
@pavlindrom
@pavlindrom Ай бұрын
I thought you were going to reneg the episode where you trashed the byte backing field for enums, which I have done recently. I'll await your apology for that too.
@nickchapsas
@nickchapsas Ай бұрын
lolno
@promant6458
@promant6458 Ай бұрын
Apology? Why tho
@pavlindrom
@pavlindrom Ай бұрын
@@promant6458 tongue in cheek comment, since I used it before, it can't be bad, right? I do concede the video had good points.
@nikolayzdravkov1378
@nikolayzdravkov1378 Ай бұрын
Guess it should have been compared with FrozenSet not with HashSet? :D
@imavalverde
@imavalverde Ай бұрын
Very nice to admit your own mistakes, keep doing amazing work.
@TheBlackNathaniel
@TheBlackNathaniel Ай бұрын
Thank you for clearing that up! Keep up the good work, Nick. Thank you so much!
@o0ooCrossboneoo0o
@o0ooCrossboneoo0o Ай бұрын
awwwww Nick please dont cry...
@CarrigansGuitarClub
@CarrigansGuitarClub Ай бұрын
It's called due diligence!
@leknyzma
@leknyzma Ай бұрын
hi Stephen
@FroxerBBQ
@FroxerBBQ Ай бұрын
We all human, thanks for making videos!
@JeremyPyne
@JeremyPyne Ай бұрын
Sure. But how does this compare to regex.
@rouensk
@rouensk Ай бұрын
Nick, kudos for making fix video. But if you truly "hold yourself to the standards", stop with cheap clickbait titles and name it properly.
@queenstownswords
@queenstownswords Ай бұрын
A small video bug. All good mate! Fix verified.
@Pingouin583
@Pingouin583 Ай бұрын
I thought he was going to apologize for talking badly about stored procedures
@ichigoslayer84
@ichigoslayer84 Ай бұрын
One of the best keep it up!
@BlingPiece
@BlingPiece Ай бұрын
It’s just not good enough Nick
@nertsch77
@nertsch77 Ай бұрын
What, if you would use "haystack.AsSpan().IndexOf(needle, StringComparison.OrdinalIgnoreCase)" ? (of course move aystack.AsSpan() outside the loop and do a Math.Min() over the sucessfull needle hits)
@mintx1720
@mintx1720 Ай бұрын
Nick should learn to see sharp this time.
@theprantadutta
@theprantadutta Ай бұрын
Never knew you are a Marvel fan
@Fred-yq3fs
@Fred-yq3fs Ай бұрын
High standards, as always. Thanks.
@AnsisPlepis
@AnsisPlepis Ай бұрын
You have to be the most genuine and honest KZbinr I know. And your content is always amazing and informative. Keep it up
@cs96ai
@cs96ai Ай бұрын
Good job!
@Robert-yw5ms
@Robert-yw5ms Ай бұрын
Haven't watched yet no idea what this is about just wanted you to know I don't forgive you and never will.
@JamyRyals
@JamyRyals Ай бұрын
Good correction, we all make mistakes!
@pedrosilva1437
@pedrosilva1437 Ай бұрын
You should have Code Copped yourself... 😂
@Ristogod
@Ristogod Ай бұрын
Dang, now I don't have a valid use-case to use this feature.
@PedroPabloCalvoMorcillo
@PedroPabloCalvoMorcillo Ай бұрын
Phenomenal
@_Tangent_
@_Tangent_ Ай бұрын
thats it im switching to java
@bikeindustryshill
@bikeindustryshill Ай бұрын
Have fun with that 😂
@PankajNikam
@PankajNikam Ай бұрын
@@bikeindustryshill +1
@xelesarc1680
@xelesarc1680 Ай бұрын
Whats wrong with java? Its ok bro
@tedchirvasiu
@tedchirvasiu Ай бұрын
@@xelesarc1680 It's ok, not great
@ryan-heath
@ryan-heath Ай бұрын
Main take away: search values is insanely fast 😎
@dongler4589
@dongler4589 Ай бұрын
Im rarely this early, minute 1?
@cvelebele18
@cvelebele18 Ай бұрын
blazingly fast
@StefanoTempesta
@StefanoTempesta Ай бұрын
Ok we forgive you, but... what are you wearing??
@bloggrammer
@bloggrammer Ай бұрын
The thumbnail shouldn't used the cop cap😅 So you're not forgiven yet😂
@Leon-ph7br
@Leon-ph7br Ай бұрын
Yes, you ruined my entire career. Love your content btw.
@thefattysplace
@thefattysplace Ай бұрын
How exactly is that range operator working? Doesn't that load the whole remainder of the string each time? Wouldn't it be better to use contains in that case, or just use the range appropriate to the length of the needle? I.e [i..(i-needle.length)]? What am I missing here?
@TheAceInfinity
@TheAceInfinity Ай бұрын
The range operator on a span is NOT like Substring. It creates a Range which is like calling for a Slice. It's only a Substring if used on a string...
@thefattysplace
@thefattysplace Ай бұрын
@@TheAceInfinity but isn't that slice still huge at the start of this loop? instead of just getting a smaller slice limited to the same length as the needle?
@TheAceInfinity
@TheAceInfinity Ай бұрын
@@thefattysplace I'd say the size of the slice is irrelevant regardless because the entire point of span is to reduce memory allocations. Only the start and end indices are stored. You should learn about how spans work.
@thefattysplace
@thefattysplace Ай бұрын
@@TheAceInfinity sorry I wasn't referring to the memory optimisation, the size of the span wouldn't affect this as it's just a reference to the start and end points within a string. I was referring to the speed. I guess it depends on what operations are done in startswith, and if it is affected by length. But then that brings me back to using contains instead on the full string. Just for fun I might do my own benchmarks and see using the same source string.
@thefattysplace
@thefattysplace Ай бұрын
@@TheAceInfinity I ran the benchmarks with two new tests and the results show using a smaller slice gives a 0.89 ratio to using the full remaining span. Using contains was actually pretty close to using searchvalues. But using searchvaules still wins hands down. Results were: | IndexOfFirstArray | 7,934.59 us | 1.00 | 22 B | 1.00 | | BoolContainsArray | 164.78 us | 0.02 | 2 B | 0.09 | | IndexOfFirstSmallSliceArray | 6,982.63 us | 0.89 | 110 B | 5.00 | | IndexOfFirstSearchValues | 86.34 us | 0.01 | 2 B | 0.09 |
@Kangoo9
@Kangoo9 Ай бұрын
I hate clickbait, why don’t you just sum up your mistake in video title ?
@RainFerret
@RainFerret Ай бұрын
Don't watch Nick if you dislike clickbait
@nickchapsas
@nickchapsas Ай бұрын
You must be new
@RainFerret
@RainFerret Ай бұрын
@@nickchapsas I've watched all your videos for about 6 months. The content is wonderful, and the titles and thumbnails are complete clickbait style. Just what I like.
@VakkaHUN
@VakkaHUN Ай бұрын
You should apologize for the clickbait title and thumbnail.
@thedjtko
@thedjtko Ай бұрын
That’s it, I’m unsubscribing
@Knuckles2761
@Knuckles2761 Ай бұрын
Shame! Shame! Shame!
@throwaway6288
@throwaway6288 Ай бұрын
Sorry nick but this time you went too far. It’s too late to apologize 😔
@user-yb8ck6cf2m
@user-yb8ck6cf2m Ай бұрын
This happens when you try to release video quickly just for the self promo...
@johan_za
@johan_za Ай бұрын
Get a life!
@MayronDev
@MayronDev Ай бұрын
I memorised that code (dQw4w9WgXcQ) so I know exactly what it is every time I see it online or spray painted around town lol
@bloggrammer
@bloggrammer Ай бұрын
The thumbnail shouldn't used the cop cap😅 So you're not forgiven yet😂
Getting Started with Event Sourcing in .NET
37:07
Nick Chapsas
Рет қаралды 23 М.
"Stop Using Singletons in .NET!" | Code Cop #009
13:52
Nick Chapsas
Рет қаралды 74 М.
Buy Feastables, Win Unlimited Money
00:51
MrBeast 2
Рет қаралды 97 МЛН
didn't want to let me in #tiktok
00:20
Анастасия Тарасова
Рет қаралды 12 МЛН
Can You Draw The PERFECT Circle?
00:57
Stokes Twins
Рет қаралды 73 МЛН
He Threw A Banana Peel At A Child🍌🙈😿
00:27
Giggle Jiggle
Рет қаралды 16 МЛН
The New Best Way To Search for Values in .NET 8
11:05
Nick Chapsas
Рет қаралды 68 М.
Anti-If Programming vs. Smelse
5:06
Mark Jivko
Рет қаралды 3,5 М.
Await Async Tasks Are Getting Awesome in .NET 9!
9:24
Nick Chapsas
Рет қаралды 82 М.
"Stop Using Async Await in .NET to Save Threads" | Code Cop #018
14:05
The Magic of Breaking Down Your Types in C#
8:59
Nick Chapsas
Рет қаралды 62 М.
What Is .NET Aspire? The Insane Future of .NET!
18:35
Nick Chapsas
Рет қаралды 255 М.
ChatGPT Can Now Talk Like a Human [Latest Updates]
22:21
ColdFusion
Рет қаралды 347 М.
Why Does Scrum Make Programmers HATE Coding?
16:14
Thriving Technologist
Рет қаралды 484 М.
Buy Feastables, Win Unlimited Money
00:51
MrBeast 2
Рет қаралды 97 МЛН