Browsing 7239 questions and answers with Jon Skeet
The operator isn't evaluated first. The ordering is: Evaluate LHS (x++) - the result is the original value of x, then x is incremented Evaluate RHS (10) - the result is 10 Compare the results of the LHS and RHS Here's code to... more 7/11/2017 8:20:46 AM
Protected means it can be used from code in the derived classes - it doesn't mean it can be used "from the outside" when working with derived classes. The protected modifier can be somewhat tricky, because even a derived class can only... more 7/11/2017 5:46:28 AM
The situation is a fairly ugly one, given that two result rows could theoretically be compared which have the same PrintOrder but different AscOrDesc values. It's only the source of the data that's preventing that. I do have a horrible... more 7/10/2017 4:04:49 PM
Is this possible, or do I NEED to specify the T and U generic parameters? You need them, I'm afraid. You'll need to have class GenClass<T, TX, TY> where T : IFace<TX, TY> That's assuming you can't create a non-generic... more 7/10/2017 8:10:25 AM
typeof isn't a method - it's an operator. That's how it's resolved at compile time. They don't do the same thing, in that for typeof you need to know the actual type or type parameter1 you want at compile-time, whereas for GetType you... more 7/8/2017 8:50:42 PM
No, class libraries don't support initialization like this. Note that the library wouldn't even be loaded until it's first used anyway. You could write a type initializer for some appropriate type, and make that start the service - but... more 7/7/2017 7:48:56 AM
Your generic method will basically be performing a reference equality check - and the values of s1 and s2 refer to different but equal strings. You can show this more easily like this: string x = "test"; string y = new... more 7/7/2017 7:26:08 AM
Basically you should create new "inner" dictionaries. That's easy to do though: var replacedOuter = outerDictionary.ToDictionary( outerKey => outerKey, // Outer key stays the same outerValue => outerValue.ToDictionary( ... more 7/6/2017 7:01:12 AM
You're calling LayoutInflater.from as if you were calling a constructor: LayoutInflater inflater = new LayoutInflater.from(parent.getContext()); That's a mixture of constructor-call syntax (new) and method call syntax (.from). It would... more 7/6/2017 6:47:27 AM
It sounds like all you're missing is a SelectMany call. Currently you're creating all the appropriate groups and filtering down to groups with more than one entry - but if you want a single flat list, you need to flatten those groups back... more 7/6/2017 6:44:29 AM