قناة اكثر من رائعة ...بل اقوى قناة برمجية في الواطن العربي ... تستحق الكثييييير من الدعم ... نرجو من جميع المبرمجين والمتابعين الدعم لاستمر هذه الامكانيات العالية ....صدقوني لم ارى مثل هذه الامكانيات على اليوتيوب ولا حتى على الكورسات المدفوعة... هذا الشخص يشرح من كل كلبه الله يجزيه عنه خير الجزاء ويجعلها في ميزان حسناته.... اللهم وفقة ...اللهم وفقة ... اللهم وفقة .....اللهم امين يا رب العالمين.
تحية خالصة من القلب لك مهندس عصام، كل الحلقات التي قمت بمشاهدتها على القناة حتى الآن أضافت لي الكثير والكثير على الرغم من عملي بالمجال منذ حوالي 9 سنوات، بارك الله لك ومتعك بالصحة والعافية ووفقك دائماً وأبداً ❤❤❤
استاذي أنا جعلت الكلاس FiveIntagere generic class طبقت مفوم generic ة بالتالي صارت المصفوفة generic و ما احتجت لتكرار الكود عنجد شكرا كتير لك لأنو ساعدتنا نفكر بلأسلوب و الطريقة الصح
ممكن كمان يا بشمهندش نزود شرطين واحنا بنovverride equals الاول نشوف ال gettype وارد يكون في علاقه inhertince بين ال employee واحد ابنائه والشرط الثاني نشوف ال reference equal لو اشتركوا في نفس ال reference equal يبقي اكيد نفس ال object state تحياتي ليك بشكرك علي شرحك الاكثر من رائع انا طالب في تانيه حاسبات ومعلومات اسكندريه من مصر قناتك كنز ❤
Can I implement an enumerable class without having a list inside it? for example let's say I've a finger class (doesn't contain any lists or arrays, just normal properties), and I created an array or a list of FingerClass in Main(), is it possible to implement IEnumerator for it? وشكرًا على الشرح الرهيب
Thx First for your compliment To answer your question, Enumerable class is static, therefore it can not be implemented (inherited) if you mean implement interface IEnumerable without having inner data structure (like array , list , collection) you can but you need to override GetEnumerator() method without empty body or NotImplementedException, and in this case it doesn't make sense since you are going in the future to iterate over the Fingers list and the iteration is depending on the GetEnumerator() method which is in your Question does not provide any value because you are missing the inner data structure and in that case follow the rule "doesn't mean you can you should"
السلام عليكم ورحمة الله وبركاته I've been diving into object equality and hash codes . I have a few questions and would appreciate your input. So, if I override GetHashCode() along with Equals(), and then put 10 objects with the same values into a dictionary, that could lead to a collision chain, right? But my concern is, if I end up with 'n' equal objects causing this, the search complexity becomes O(n). Can you explain the real benefits of overriding GetHashCode()? Is it worth it given the potential complexity? Also, say I change the value of one object in the dictionary after placing them. Does the hash code change too? How does this affect retrieving data? How does it work?
Great questions! Understanding object equality and hash codes is crucial when you're dealing with collections that rely on these concepts, such as dictionaries or hash sets. Let me try to address your questions one by one. Benefits of Overriding GetHashCode() Efficiency: When you're using a hash-based collection like a dictionary, the main benefit of having a well-designed hash code is efficiency. Normally, inserting, deleting, or finding an element in a hash-based collection is O(1) on average. However, this is true only if the hash code function distributes items well across the hash table. Poor hash codes can lead to "collision chains," as you pointed out, where multiple items end up in the same slot, degrading the operation's time complexity to O(n). Correctness: If you're overriding Equals(), you must also override GetHashCode(). The reason is that hash-based collections assume that if Equals(a, b) is true, then GetHashCode(a) == GetHashCode(b). If you don't ensure this, you'll get incorrect behavior. Is it worth it given the potential complexity? Absolutely, it is worth it. The goal is to make GetHashCode() produce well-distributed hash codes so that you don't have to worry about high collision rates. If done correctly, the benefits in terms of time complexity (O(1) operations) far outweigh the risks of occasional collisions. Changing the value of an object in the dictionary Hash Code Change: If you change the object in such a way that modifies the values used to compute the hash code, then yes, the hash code will change. However, this is problematic because the dictionary uses the original hash code for storage. Retrieving Data: If the object's hash code changes while it's in the dictionary, you might not be able to retrieve it correctly. In fact, doing this is generally considered bad practice. You should remove the item from the collection first, change it, and then add it back if you need to modify an object that serves as a key. I hope this answers your questions. Feel free to ask for further clarifications!
thanks for your answer i have a question in this part " Is it worth it given the potential complexity? Absolutely, it is worth it. The goal is to make GetHashCode() produce well-distributed hash codes so that you don't have to worry about high collision rates. If done correctly, the benefits in terms of time complexity (O(1) operations) far outweigh the risks of occasional collisions." Does this mean that we prioritize accuracy over time complexity?
سلام عليكم يا أستاذ أنا لحد gitHashcode فاهم بس ما بعده حسيت أن الدنيا متلخبطة فهل أعيد المحاضرة مرة تانية ولا أستني لو أروح علي linq وأعيد الفيديو تاني ؟؟ + في hash code لما حضرتك عملت تعديل method ال gethashcode ده قانون ثابت ولا ده بيختلف علي حسب الشركة اللي في دقيقة 17:00 وجزاك الله خيرا 🥰🥰
عيدها بتركيز والمنطق بعيطيك توزيع يبعدك عن المشاكل ممكن تستخدم كمان اسلوب جديد public override int GetHashCode() { return HashCode.Combine(field1, field2, field3); }
السلام عليكم ورحمة اله وبركاته مشكور مجهودك يا باشمهندس جزاك الله خيرا فى العادى بفهم منك كويس الحمد لله بس المحاضرة دى كررت سماعها بحيث افهم شرح الEnumerators بدون استخدام yield وللاسف مفهمتش ثانى حاجه اللى فهمته من مثال الyield هى القدرة على التعامل مع الكائن من خلال انديكس -فاذا كان فهمى صح- ايه الفرق بينها وبين الindexer
هي من المواضيع الصعبة فعلا لكن انصحك تشوف اول 3 حلقات من سلسلة ال LINQ حلقة الفرق بين ال IEmunerable / IQueryable ruclips.net/video/DKr16qsi4RA/видео.html وحلقة foreach Deep Dive ruclips.net/video/z6eBV2iPEC8/видео.html
شكرا اخي . LINQ هي مكتبة وفرتها دوت نت علشان استعلم عن البيانات وهي مبنية بالاعتماد على هذا المبدأ وغيرها من المبادئ التى تعزز مبدأ كود عالي الجودة clean code
دعمنا بالتعليقات والإشتراك يعني الكثير ويعني أننا سنستمر في تقديم الأفضل
للامانه انا قاعد اراجع معك C# ولكن شرحك قوي جدا وتذكر اغلب النقاط على عكس مصادر تعلم كثيرة انا ممتن اني لقيت قناتك , شكرا من القلب
قناة اكثر من رائعة ...بل اقوى قناة برمجية في الواطن العربي ... تستحق الكثييييير من الدعم ... نرجو من جميع المبرمجين والمتابعين الدعم لاستمر هذه الامكانيات العالية ....صدقوني لم ارى مثل هذه الامكانيات على اليوتيوب ولا حتى على الكورسات المدفوعة... هذا الشخص يشرح من كل كلبه الله يجزيه عنه خير الجزاء ويجعلها في ميزان حسناته.... اللهم وفقة ...اللهم وفقة ... اللهم وفقة .....اللهم امين يا رب العالمين.
أسأل الله العظيم ان يرزقكم بفضلِ من عنده بما تقدمون وان يجعل عملكم خالصاً ومخلصاً لوجهه الكريم يا رب العالمين
تحية خالصة من القلب لك مهندس عصام، كل الحلقات التي قمت بمشاهدتها على القناة حتى الآن أضافت لي الكثير والكثير على الرغم من عملي بالمجال منذ حوالي 9 سنوات، بارك الله لك ومتعك بالصحة والعافية ووفقك دائماً وأبداً ❤❤❤
نعم فعلا انا معلومات الان بالبرمجة تغييرت كثير ونظرتى تغير منذ بداية هذا الكورس مع انى درست معظم هذا فى الكلية زمان .... انت خطير فى توصيل المعلومة
شكرا على الثقة اخي الكريم
الله يعطيك الف عافية شرح ممتاز
مشكور مهندس عصام ، بارك الله فيك وزادك من علمه ، كل حلقة فيها معلومات قيمة وبضيف خبرة تدريجيا.
استاذي أنا جعلت الكلاس FiveIntagere
generic class
طبقت مفوم generic ة بالتالي صارت المصفوفة generic و ما احتجت لتكرار الكود
عنجد شكرا كتير لك لأنو ساعدتنا نفكر بلأسلوب و الطريقة الصح
شرح سلس وممتع بارك الله فيك بشمهندس عصام
جزاك الله كل خير🥰🥰
قمة الروعة
ماشاءالله تبارك الله..
كل يوم والخبره تزيد عندنا..
الله يزيدك علم ومعرفة ويديم عليك العافيه.
الله يجزيك الخير
محاضرة دسمة ومعلومات قيمة ومهمة جداً, لازم التركيز عليها والاستفادة منها, شرح مميز كالعادة , جزاك الله خيراً
جازانا واياك كل الخير
ترابط المعلومات و بعضها و ترتيبها الجيد اهم ما في الكورس ده.
جزاك الله خيرا
وجدة صعوبة في متابعتك في هذه المرحلة لكن اجمل خبر هو وجود ال YIELD .... هم وانزاح ههههه😁 ٠ شكرا اخي عصام ٠
ممكن كمان يا بشمهندش نزود شرطين واحنا بنovverride equals الاول نشوف ال gettype وارد يكون في علاقه inhertince بين ال employee واحد ابنائه والشرط الثاني نشوف ال reference equal لو اشتركوا في نفس ال reference equal يبقي اكيد نفس ال object state
تحياتي ليك بشكرك علي شرحك الاكثر من رائع انا طالب في تانيه حاسبات ومعلومات اسكندريه من مصر قناتك كنز ❤
معلومات قيمه ومفيده لكل المستويات
ربنا يبارك فى عملك ويجازيك عنه خيرا❤️
جزاك الله خيراً و بارك الله فيك و جعله في ميزان حسناتك ❤❤❤
عظيم غظيم شكرا لك مهندسنا الغالي
الله يجزيك الخير كفو والله💙💙... عم تعطي من قلب ورب💙
ُThank you Mr.Issam
جزاكم الله خير الجزاء ❤🎉
عظيم، كنت اعمل بلغة دارت وكنت أستعمل باكدج خاصة لعمل مساوة بين محتوى كائنين والآن فهمت كيف أبنيها وحدي، جزاك الله خيرا
جميل جدا استمر، عذرا عالتأخير الباقة كانت خلصانة بس حملت الفيديوهات و شوفتهم اوفلاين و أجلت التعليق اما الباقة رجعت
بارك الله فيك استمر
شكرأ أخي احمد
مجهود رائع وشرح ممتاز جزاك الله خير
ربنا يكرمك يبشمهندس ويزيك من علمه
مواضيع مهمه و متقدمه
لو تسمحلى هقول لحضرتك ملحوظه على طريقه الشرح فى رساله على الفيس بوك
اكيد عزيزي اقتراحك محل احترام
بسم الله ما شاء الله
متألق كالعادة، جزاك الله خيرا أستاذ عصام
الله يجزيك كل خير
Thanks you Issam for this wonderful Explanation !!
الله يجزيك الخير
الله يسعدك يا بشمهندس
يسعد قلبك
ربنا يسعدك يا بشمهندس
تسلم صديقي ويجعل التوقيق حليفك
شرح رائع جدا ومستوي عالمي , إذا حضرتك اهتميت بسرعة الكتابة بدون النظر rapid typing
ستكون إضافة جيدة جدا ان شاء الله
يعطيك العافية موفق بأذن الله
جزاك الله خيراً❤
جزاك الله خيراً و بارك الله فيك و جعله في ميزان حسناتك , اللهم آمين و صل اللهم وسلم و بارك علي سيدنا محمد
تسلم صديقي
شكرا على مجهودك
عفوا اخي الكريم
جزاك الله عنا خير الجزاء
جزاك الله خير يابش مهندس
جزاكم الله خيرا
جزاك الله خير
شكرا لك على المعلومات القيمة
الله يباركلك يابشمهندس :)
شكرا
فييديو صعب لكن مفيد جدا، جزاك الله كل خير يا بشمهندس بالمصري 😅
لايك من قبل ما اشوف الفيديو
جزاك الله ألف خير ❤
Thank you ❤
You're welcome 😊
اسد 💪💪
Thank you so much
Good job Thnxx
مبدع
يعطيك الف عافية مهندسنا الكبير والرائع عالشرح
بس سؤال شو الفرق بين Inumerable و Inumerator و numerator ؟
شوف حلقة
Enumerable Vs. IQueryable
على القناة
يزم والله انك اسد
انت رائع
can we use indexer to solve the problem without using ienumerable ?
جزاك الله خير
Can I implement an enumerable class without having a list inside it? for example let's say I've a finger class (doesn't contain any lists or arrays, just normal properties), and I created an array or a list of FingerClass in Main(), is it possible to implement IEnumerator for it?
وشكرًا على الشرح الرهيب
Thx First for your compliment
To answer your question,
Enumerable class is static, therefore it can not be implemented (inherited)
if you mean implement interface IEnumerable without having inner data structure (like array , list , collection) you can but you need to override GetEnumerator() method without empty body or NotImplementedException, and in this case it doesn't make sense since you are going in the future to iterate over the Fingers list and the iteration is depending on the GetEnumerator() method which is in your Question does not provide any value because you are missing the inner data structure
and in that case follow the rule
"doesn't mean you can you should"
🌱
وتستمر رحلة التعلم الممتع مع ال Metigator👍
good
استاذ عصام من الحلقه كم تبدا Data structure
حلقات منفصلة مش متصلة
السلام عليكم ورحمة الله وبركاته
I've been diving into object equality and hash codes . I have a few questions and would appreciate your input.
So, if I override GetHashCode() along with Equals(), and then put 10 objects with the same values into a dictionary, that could lead to a collision chain, right? But my concern is, if I end up with 'n' equal objects causing this, the search complexity becomes O(n). Can you explain the real benefits of overriding GetHashCode()? Is it worth it given the potential complexity?
Also, say I change the value of one object in the dictionary after placing them. Does the hash code change too? How does this affect retrieving data?
How does it work?
Great questions! Understanding object equality and hash codes is crucial when you're dealing with collections that rely on these concepts, such as dictionaries or hash sets. Let me try to address your questions one by one.
Benefits of Overriding GetHashCode()
Efficiency: When you're using a hash-based collection like a dictionary, the main benefit of having a well-designed hash code is efficiency. Normally, inserting, deleting, or finding an element in a hash-based collection is O(1) on average. However, this is true only if the hash code function distributes items well across the hash table. Poor hash codes can lead to "collision chains," as you pointed out, where multiple items end up in the same slot, degrading the operation's time complexity to O(n).
Correctness: If you're overriding Equals(), you must also override GetHashCode(). The reason is that hash-based collections assume that if Equals(a, b) is true, then GetHashCode(a) == GetHashCode(b). If you don't ensure this, you'll get incorrect behavior.
Is it worth it given the potential complexity?
Absolutely, it is worth it. The goal is to make GetHashCode() produce well-distributed hash codes so that you don't have to worry about high collision rates. If done correctly, the benefits in terms of time complexity (O(1) operations) far outweigh the risks of occasional collisions.
Changing the value of an object in the dictionary
Hash Code Change: If you change the object in such a way that modifies the values used to compute the hash code, then yes, the hash code will change. However, this is problematic because the dictionary uses the original hash code for storage.
Retrieving Data: If the object's hash code changes while it's in the dictionary, you might not be able to retrieve it correctly. In fact, doing this is generally considered bad practice. You should remove the item from the collection first, change it, and then add it back if you need to modify an object that serves as a key.
I hope this answers your questions. Feel free to ask for further clarifications!
thanks for your answer
i have a question in this part
"
Is it worth it given the potential complexity?
Absolutely, it is worth it. The goal is to make GetHashCode() produce well-distributed hash codes so that you don't have to worry about high collision rates. If done correctly, the benefits in terms of time complexity (O(1) operations) far outweigh the risks of occasional collisions."
Does this mean that we prioritize accuracy over time complexity?
سلام عليكم يا أستاذ
أنا لحد gitHashcode فاهم بس ما بعده حسيت أن الدنيا متلخبطة فهل أعيد المحاضرة مرة تانية ولا أستني لو أروح علي linq وأعيد الفيديو تاني ؟؟
+
في hash code لما حضرتك عملت تعديل method ال gethashcode ده قانون ثابت ولا ده بيختلف علي حسب الشركة اللي في دقيقة 17:00
وجزاك الله خيرا 🥰🥰
عيدها بتركيز
والمنطق بعيطيك توزيع يبعدك عن المشاكل
ممكن تستخدم كمان اسلوب جديد
public override int GetHashCode()
{
return HashCode.Combine(field1, field2, field3);
}
بشمهندس من فضلك استفسار..هل اللى انا كاتبه هنا صح؟
val1.CompareTo(val2)
if val1>val2 then it returns 1
if val1
بشمهندس عصام شكرا جدا ل شرحك الوافي
ممكن اعرف شرح ال MVC هينزل ولا لا وكمان
asp.net وشكرا ثانيا 💟
ASP core api نعم
ASP MVC حسب التفاعل
0:16
حبيبي انت الأسد
❤❤
اني أسد
why?
💟💟💟
❤
لماذا تتكرر الارقام هل بسبب كلاس راندم ؟
الفنكشن compareTo تستدعي نفسها... هذا recursion
الشرح غير مترابط
ربنا يسعد ايامك كما دعيت للمصريين ولكن احس ان الموضوع صعب الفهم شويه هل ده طبيعي وايه الحل لكي يسهل فهمه
نعم هو صعب ولكن فهمه يحتاج للاعادة اكثر من مرة ومع الوقت الامور تكون تمام
السلام عليكم ورحمة اله وبركاته
مشكور مجهودك يا باشمهندس جزاك الله خيرا
فى العادى بفهم منك كويس الحمد لله بس المحاضرة دى كررت سماعها بحيث افهم شرح الEnumerators بدون استخدام yield وللاسف مفهمتش
ثانى حاجه اللى فهمته من مثال الyield هى القدرة على التعامل مع الكائن من خلال انديكس -فاذا كان فهمى صح- ايه الفرق بينها وبين الindexer
هي من المواضيع الصعبة فعلا
لكن انصحك تشوف اول 3 حلقات من سلسلة ال
LINQ حلقة الفرق بين ال
IEmunerable / IQueryable
ruclips.net/video/DKr16qsi4RA/видео.html
وحلقة foreach Deep Dive
ruclips.net/video/z6eBV2iPEC8/видео.html
يا هندسة حضرتك لما بعمل inheritance بيحصل Error
ايه ال Error ?
توب
ممتازة جداََ الحلقة بس هل linq بيوفر علينا تعلم التفاصيل دي؟؟
شكرا اخي .
LINQ هي مكتبة وفرتها دوت نت علشان استعلم عن البيانات
وهي مبنية بالاعتماد على هذا المبدأ وغيرها من المبادئ التى تعزز
مبدأ كود عالي الجودة
clean code
تسلم على الشرح بس الكلمه الانجليزي حاول تترجمها عربي
شكرا لمرورك اخي الكريم وان شاء الله فدر الاستطاعة سأقوم بذلك
what is the problem in writing Get.Enumerator() function in this way?
IEnumerator IEnumerable.GetEnumerator()
{
return _values.GetEnumerator();
}
I used expression bodied method you can stick go the regular way of doing so
جزاك الله خيرا
الله يعطيك ألف عافية
جزاك الله خيرا
الله يجزيك الخير
جزاك الله كل الخير
جزاكم الله خير
الله يعطيك ألف عافيه
جزاك الله خيرا
جزاك الله خير