Browsing 7239 questions and answers with Jon Skeet
Assuming by "indexer" you mean "ordering", you just make your type implement IComparable<Foo>, and provide a CompareTo method which compares the date within this to the date within the other Foo. Or you could implement... more 1/21/2015 12:28:01 PM
Why does round off using string constructor give a different result than the others? Because it's the only time you're actually passing in a value of exactly 4.645. The rest of the time, you're passing in the double value closes to... more 1/21/2015 10:20:57 AM
You're basically saying "for each address within Addresses, evaluate this predicate, until the predicate returns true, at which point return that address." The predicate is the lambda expression, which uses the Person_Id property, so it... more 1/20/2015 7:37:42 PM
Basically you don't need to call Select at all - you're only performing a filtering operation, which is what Where gives you. You're not trying to transform the list. So just use: Return MasterListOfVersions.Where_ (Function(version)... more 1/20/2015 7:34:20 PM
It sounds like those test runners may be using reflection to check whether the method returning Task really is an async method. That doesn't mean the method would behave differently if they were run - but they're just not being run. It's... more 1/20/2015 7:16:00 PM
Please tell me why an object which is clearly not yet out of scope is being disposed. Objects don't have a concept of "scope" as such. At the end of your program, both the TcpClient and the instance of your class are eligible for... more 1/20/2015 4:46:51 PM
But it does, with LINQ, right? No, it doesn't. There's an extension method on IEnumerable<T> of First(), but extension methods can't be called on dynamic values in the "normal" way. However, you can use it as a normal static... more 1/20/2015 4:15:48 PM
I have executed below code and for 10,000 times response is returned in same ordered. That's just what happens to occur with the version you're using and the values you're inserting. There's no guarantee it will continue to occur, or... more 1/20/2015 2:22:59 PM
A boxed value can only be the boxed form of a single type - if you call o.GetType() you'll find out what that is. In general, you can only unbox to the exact same type, with a few wrinkles: You can unbox an enum value to its underlying... more 1/20/2015 2:18:31 PM
I suspect you want to change Map<String,InterfaceA> to Map<String, ? extends InterfaceA> in the ClassA constructor signature (and field). Otherwise a HashMap<String, ImplmntsInterfaceA> really isn't a valid argument for... more 1/20/2015 10:32:37 AM