Browsing 7239 questions and answers with Jon Skeet
DateTime.AddMonths doesn't change the value you call it on - it returns a new value. This is true of all the DateTime methods. There's nothing which changes the value in place, which is a good job as it's a value type and changes would be... more 2/19/2014 5:52:22 PM
It's because the default StringComparer is culture-sensitive. As far as I can tell, Comparer<string>.Default delegates to string.CompareTo(string) which uses the current culture: This method performs a word (case-sensitive and... more 2/19/2014 4:38:54 PM
I wouldn't subclass the implementation classes. I'd just use the adapter pattern and delegate to the implementation classes: public final class ActionFirstImplAdapter implements Action { private final ActionFirstImpl delegate; ... more 2/19/2014 3:10:15 PM
I have an ASCII-extended txt file and i need to convert it to a byte array. Then don't go via text at all. If you just want to grab the bytes within a file, that's really easy: byte[] data = File.ReadAllBytes(filePath); Any time... more 2/19/2014 12:53:39 PM
When this object goes out of scope and is eventually garbage collected, are these two resources then released, or do they remain in memory? Usually some type - often somewhat hidden from the public API - has a handle on a native... more 2/19/2014 12:42:32 PM
You can nearly use SkipWhile and TakeWhile, but you want the last item as well - you want the functionality of TakeUntil from MoreLINQ. You can then use: var query = source.SkipWhile(x => x != begin) .TakeUntil(x... more 2/19/2014 10:21:51 AM
The problem is that you've ignored the namespace which is defaulted in Config. All of the Group elements are in that namespace, but you're looking for descendantse without a namespace. You want: XNamespace ns = "urn:Configuration"; var... more 2/19/2014 10:08:13 AM
Has VS already signed this DLL? Yes, unless you specifically request delay signing. Note that this means that a configuration which specifies signing requires the key to be present, which doesn't mesh well with the key being a... more 2/19/2014 9:44:32 AM
Why not throw just a single InvalidConfigurationException (I wouldn't use ParsingError - aside from anything else, I wouldn't expect this to be an Error subclass) which contains information about the specific problems? That information... more 2/19/2014 9:24:26 AM
I strongly suspect you're getting exceptions logged - you should improve your exception handling anyway, but if you're going to log exceptions, you really need to look in the logs when things don't work! This is almost certainly the... more 2/18/2014 7:20:14 PM