Browsing 7239 questions and answers with Jon Skeet
I suspect the problem is that you've got a very incomplete date format there. Usually, DateTime.TryParseExact will use the current time and date for any fields that aren't specified. Here, you're specifying the day of the week, which isn't... more 7/1/2015 10:09:11 AM
This line is the problem: var generic = methodInfo.MakeGenericMethod(toProp.GetType()); You're calling GetType() on toProp - that will return some type derived from PropertyInfo. You actually want the property type, so just change it... more 7/1/2015 9:06:26 AM
I'd start off with a data structure for the list you have. (This is assuming C# 6, by the way - for earlier versions of C# you wouldn't be able to use an auto-implemented readonly property, but that's about the only difference.) public... more 7/1/2015 7:47:06 AM
It's worth bearing in mind that nullable types (both nullable value types and reference types) behave differently to non-nullable value types in general when it comes to Min: a null value is treated as "missing" in general, so it's not... more 7/1/2015 7:19:15 AM
If you provide just the type name, Type.GetType will look in the currently-executing assembly, and mscorlib - but that's all. If you need to access a type in a different assembly, then either you need to get the assembly name in the type... more 7/1/2015 7:03:45 AM
Basically, don't use FileReader. It always uses the platform-default encoding, which may well not be appropriate for this file. If you're using a modern version of Java, it's better to use: Path path =... more 6/30/2015 8:46:31 PM
Each element in the result of a GroupBy is a group - which itself then contains the elements, as well as a key. So you can do something like this: foreach (var group in sponsorRedemptions) { Console.WriteLine("Group: {0}",... more 6/30/2015 8:14:30 PM
While == can be performed between two references (and is, when both sides are Integer), <= can't - so the compiler unboxes. So, your code is equivalent to: while (i.intValue() <= j.intValue() && j.intValue() <=... more 6/30/2015 5:48:25 PM
You pressed s and then return. That "return" generated two more characters - \r and \n (I assume you're on Windows). Those are then returned by System.in.read(). Here's an example which makes that clearer: class ForTest { public... more 6/30/2015 5:45:17 PM
You're encountering integer overflow. factorial(17) is 3.5568743e+14, which is well beyond the bounds of int. When an integer operation overflows, it can end up negative. For example: int x =... more 6/30/2015 5:37:58 PM