Browsing 7239 questions and answers with Jon Skeet
It looks like you've tried to define a resource with an ID of 512. You can't do that - it's not a valid identifier. Look at the piece of your XML where you've defined ic_launcher and mr_excuse, and look for 512 near that... then give it a... more 2/23/2014 6:52:56 PM
If your actual requirement is "the previous 24 months" then it's much simpler. Just start off with the current month, and get the 1st day of it - then iterate and add 1 month 24 times. Personally I'd return an IEnumerable<DateTime>... more 2/23/2014 5:08:53 PM
Having looked at your PHP code, I suspect this is actually the cause of the speed problem: do{ $buf .= fread($con, 1); if(strlen($buf) == 0) break 2; } while(substr($buf, -4) != "DONE"); Assuming that PHP works the same way as... more 2/23/2014 5:02:42 PM
Rather than using StreamReader directly, use File.ReadLines which returns an IEnumerable<string>. You can then use LINQ: var first10Lines = File.ReadLines(path).Take(10).ToList(); The benefit of using File.ReadLines instead of... more 2/23/2014 9:46:34 AM
It sounds like you probably want a union type for CarriableItem or something similar. For example: public sealed class CarriableItem { public Fruit? Fruit { get; private set; } public Misc? Misc { get; private set; } // Only... more 2/23/2014 9:22:58 AM
This is the problem: if (arr[Arraylength] > tmp) Valid array indexes go from 0 to length-1 inclusive. array[array.length] is always invalid, and on the initial call, ArrayLength is equal to arr.length. It's not clear why you're... more 2/22/2014 9:34:46 PM
No, absolutely not. What would you expect the values of any fields declared in B but not in A to be? For example, what would you expect this to do: Object x = new Object(); String text = (String) x; System.out.println(text); An Object... more 2/22/2014 5:19:17 PM
I think that the overloading in code below of the == is unnecessary in the manner shown since == already compares references if not overloaded. Yes, but the point is that because the operator has overloaded, you can compare for value... more 2/22/2014 4:07:10 PM
No, if you want to have both a parameterless constructor and a constructor with parameters, you need to declare them both. It's very easy to declare the parameterless constructor though: public YourClassName() { } The super(); is... more 2/22/2014 3:54:44 PM
Sure - that's the breadcrumb view. You can toggle it on or off with this button: (I'm struggling to find a menu option to toggle it at the moment, but I'm sure there's one somewhere.) Alternatively, you can hide it in the context menu... more 2/22/2014 3:35:50 PM