Browsing 7239 questions and answers with Jon Skeet
The bitwise inverse operator is entirely separate from the shift here. You've started with input of 10 (binary) - which has a full 32-bit representation of 00000000_00000000_00000000_00000010 The bitwise inverse is... more 6/12/2017 1:56:40 PM
If that is the case shouldn't my example have printed 10 & 11? No, because you've only got a single variable - fn1 captures the variable, not its current value. So a method like this: static void Foo() { int i = 10; ... more 6/12/2017 9:44:09 AM
The "member" here isn't your variable - it's a member of the namespace (or assembly, or module if you want). (It's unfortunate that the documentation is inherited from MemberInfo - if it said "the name of the type" it would be... more 6/10/2017 11:18:24 AM
Basically, why is the version of thisMethod() defined in the subclass being invoked through the Superclass object obj? Because that's basically the point of inheritance - it allows an implementation to override, without the calling... more 6/10/2017 10:38:17 AM
Yes, it would, for two reasons: You're creating a copy of the original array as a List<int>, and then trying to modify the List<int>. That wouldn't modify the array. Your lambda expression changes the value of the parameter,... more 6/10/2017 8:54:02 AM
Your CreateAccount method does this: Creates a new list Populates the list Does nothing with the list Your ReadList method does this: Creates a new (empty) list Prints the contents of the list The list created in CreateAccount() is... more 6/9/2017 7:57:43 PM
I would parse the value as OffsetDateTimePattern as that most closely represents the information you actually have in the text. My experience is that it's best to parse in a form that retains all the information you need, then use the Noda... more 6/9/2017 5:54:47 AM
The conditional operator evaluates one expression or other to compute a value. It doesn't execute void-returning methods. You can use the conditional operator here though, to decide which list to add to: (number >= 0 ? positives :... more 6/8/2017 9:44:20 PM
int.Parse is a method group - what you're seeing is a method group conversion to a delegate. To see it without LINQ: Func<string, int> parser = int.Parse; int x = parser("10"); // x=10 It's mostly equivalent to: Func<string,... more 6/8/2017 11:40:20 AM
To make this code cleaner, I'd suggest: Renaming Lastmonth etc to follow .NET naming conventions Not bothering with any separate variables (but if you do, make them follow .NET naming conventions too) Renaming DateRanges to DateRange (as... more 6/8/2017 10:15:33 AM