The most compact and best video for masking. Thanks for the great explanation. Now I'm subscribed to your channel.
@Matlus4 жыл бұрын
Thank you for your kind words Jesse! Thank you also for subscribing.
@Phcodesign6 жыл бұрын
When it is clear to yourself then it is pretty easy your words and explanations to be clear to the audience. Thank you for this excellent video!
@Matlus6 жыл бұрын
@Fikret, thank you! I appreciate your comments
@ioannisstefanou91405 жыл бұрын
Amazing explanation. Really enjoyed the pace and progression. Excellent tutorial, thank you!
@Matlus5 жыл бұрын
Glad you enjoyed it
@vishnupv20084 жыл бұрын
I used this today. Your video was great help!
@Matlus4 жыл бұрын
That's great Punnoor! Good to hear this video helped you.
@sudheernani24702 жыл бұрын
Here I am trying to find what the concept of flags with enum, and this explanation of yours is crystal clear.. Thank you
@SridharSathya10 жыл бұрын
Thanks but I'd check your explanation around 17:55 and after. Specifically how we'd turn off a bit; most of us get it wrong often. If I want to remove Tuesday XOR will not remove Tuesday if it is not set - in fact it will turn it on. If I want to remove Tuesday if it turned on or off days = days & ~Weekdays.Tuesday//i.e. and with not Weekdays.Tuesday will ensure Tuesday is turned off irrespective if it is on or off.
@Matlus10 жыл бұрын
Right you are Sridhar.
@zzzamo4 жыл бұрын
Really easy to understand. Thanks man!
@Matlus4 жыл бұрын
Thank you Eduardo!
@bomo64533 жыл бұрын
You sir, just saved my life. Thank you so much
@Matlus3 жыл бұрын
Thank you Bo! Happy to be of help.
@ijeanpierrebp Жыл бұрын
Great explanation ⭐⭐⭐⭐⭐
@autofires10 жыл бұрын
Another brilliant video. Very well prepared with clear explanations and professionally delivery. I hope you continue with these lessons. Many Thanks Mr Kumar, धन्यवाद
@starman90007 жыл бұрын
Oh Shiv, you are super star, your simple explanation is made me understand clearly, i will be frequent visitor to your blog. Thank you
@vladgheorghiu22156 жыл бұрын
This is explained so genius. Very nice!
@Matlus6 жыл бұрын
Thank you @Vlad
@ontherogs10 жыл бұрын
Really useful, well explained shift left logic
@mahdimollaeian88402 жыл бұрын
Thanks for the great explanation
@vkg.codefactory6 жыл бұрын
Excellent video, great coverage on enums!
@aske160210 жыл бұрын
Thanks, best tutorial so far on flags. I have some very specific logic that flags will work well with.
@LearnWithVarun2 жыл бұрын
Awesome, helped alot😄😄
@rickmemmer56256 жыл бұрын
Exceptional! A model of excellence in instruction. Much appreciated!! :o)
@tan3ryigit10 жыл бұрын
thats great u r back :)
@gajarubanjeyakumar72264 жыл бұрын
Thankyou
@jpegacai1048 жыл бұрын
Great tutorial!
@adrianlara62669 жыл бұрын
gracias muy util tu video, segui asi.
@billhefner80347 ай бұрын
awesome!
@jayashreereddy56437 жыл бұрын
Excellent !!
@borisevraev81907 жыл бұрын
Thank you!
@dmitryisaevski77657 жыл бұрын
#simply the best)
@Matlus7 жыл бұрын
Thank you!
@matejzajacik84962 жыл бұрын
If you just want to know if the bit is set or not, you can also just test against zero; you don't have to test against the bit itself. So instead of: var tuesdayIsInSet = (days & Weekdays.Tuesday) == Weekdays.Tuesday; You can just write: var tuesdayIsInSet = (days & Weekdays.Tuesday) > 0; Or if you need to test for the absence of the bit: var tuesdayIsNotInSet = (days & Weekdays.Tuesday) == 0; This way, you don't need to update the right-hand side every time you change the left-hand side, and it's less typing.
@ijeanpierrebp Жыл бұрын
great!
@ontherogs10 жыл бұрын
Real
@adrianiordache43914 жыл бұрын
I don't think you will ever use such thing in your career as a developer.
@Matlus4 жыл бұрын
Hi Adrian, I'm afraid, I' don't understand your comment. I've read it several times but I don't get it.
@Matlus4 жыл бұрын
I beg to differ Adrian. I use this a lot and have been using this feature even before C# (that is other languages).
@adrianiordache43914 жыл бұрын
@@Matlus Which problems does this solves exactly that other data structures or statements could not? Is this more efficient?
@Matlus4 жыл бұрын
@@adrianiordache4391 It's not about what problem flags enums solve that you can't do any other way. It's about using the correct solution for the job. These are flags enums, that is a combination of bits can be turned on/off. And you want to know with a single conditional statement which bits are off and which bits are on. Or you want to flip a bit (that is no matter what the state of the bit is, you want to flip it. Or set a bit if it's off or turn off a bit if it is set So for example, is a user in a certain role? A user could be in multiple security roles but are they in this role? Suppose you want to perform certain "set"actions. Suppose these actions will fail but you need to keep trying till all actions are complete. Each action is a bit turned off. Keep trying till all bits are off. They key thing to keep in mind is there for 32 bits (things) these is exactly on variable. and not 32 variables (or a structs that has 32 properties). Just one variable but with sets of possible states.