Browsing 7239 questions and answers with Jon Skeet
Is there anyway to avoid this problem? You just need to provide different names for the methods - it's as simple as that. Aside from anything else, that removes the obvious problem if you implement IKid<Object, String, String>... more 6/4/2014 10:48:54 AM
But i couldn't able to sort the date in descending order. Two easy options: You could just reverse your comparison yourself, using secondDate.compareTo(firstDate). (I assume that in your real code you're actually returning retVal;... more 6/4/2014 9:56:25 AM
Either create a "normal" dictionary first and call ToImmutableDictionary (as per your own answer), or use ImmutableDictionary<,>.Builder: var builder = ImmutableDictionary.CreateBuilder<string, int>(); builder.Add("a",... more 6/4/2014 9:29:15 AM
I need to find the ids from selectedBookings that are not in availableBookings. That's easy - it's all the IDs in selected bookings except those that are in available bookings: var ids = selectedBookings.Select(x =>... more 6/4/2014 9:15:53 AM
Does the -jar option of the java command also compile the sources before running the main method? No, absolutely not. It just specifies the jar file in which to find the manifest specifying the main class, and (usually) the class file... more 6/4/2014 9:05:57 AM
You're specifically asking to sort the portion from p[5] to p[9] exclusive of the upper bound... so 4 elements, which are already in order (1, 4, 5, 6). If you want to sort to p[9] inclusive, you should call Arrays.sort(p, 5, 10); From... more 6/4/2014 8:41:13 AM
You need to think of it as: int tmp = mockObj.doSthElse(); mockObj.doSth(arg1, arg2, tmp, arg3); So you set up the expectation (and return value) for doSthElse, then you expect that value as the argument for doSth. I can't explain why... more 6/4/2014 8:17:38 AM
It looks like you're trying to parse a value starting "android.widget.EditText" - which suggests you may have code like this: int x = Integer.parseInt(editText.toString()); That's not going to get the text of the EditText - for that,... more 6/4/2014 6:07:08 AM
Why does the following not work? Because instanceof requires a type name as the second operand at compile-time, basically. You won't be able to use the instanceof operator. The production for the instanceof operator is: ... more 6/3/2014 8:19:06 PM
Well, you can use Zip to pair them up: var pairs = x.Zip(y, (a, b) => new { a, b }) .Where(pair => !pair.b.IsOkay) .ToArray(); You can change the delegate passed to Zip to compose the two values... more 6/3/2014 7:09:55 PM