Browsing 7239 questions and answers with Jon Skeet
Without trying to work out exactly this fails, I would strongly recommend not using string representations for this sort of thing anyway. Just use DateTime comparisons instead - assuming that DateApproved is a DateTime column, of course.... more 3/13/2015 6:34:47 PM
That package only has aspnet50 and aspnetcore50 directories within the lib directory. This means it's only suitable for ASP.NET vNext projects. You can't use it within a regular .NET 4.5 project - yet, at least. If you're not using... more 3/13/2015 5:33:06 PM
Compile-time constants are checked differently to other code, basically. A cast of a compile-time constant into a type whose range doesn't include that value will always fail unless you explicitly have an unchecked expression. The cast is... more 3/13/2015 5:27:50 PM
Well yes, look at this code (reformatted from your question for readability): object key(int count, accidental ac) { return key(0, accidental.none); } That will just invoke the same method... which will invoke the same method...... more 3/13/2015 4:37:39 PM
The problem is the type of your expression tree - you're trying to represent a delegate of type Func<T, object>, and if the property returns an int, that means it would need to be converted. You just need to make the method generic... more 3/13/2015 1:48:19 PM
It's for use in character literals: char c = '\''; Without that, it would be painful to get a single apostrophe as a char. more 3/13/2015 1:42:21 PM
My understanding is that map will go through each item in the array and execute the Thread#join method on each one in turn... which is exactly what my first code example does. No, it isn't. The first code starts a thread, then joins... more 3/13/2015 1:38:58 PM
I already tried to (logically) bit-rightshift r[0] by 8, but then the upper bits get lost because they are stored in the first 8 bits of r[1]. Well they're not "lost" - they're just in r[1]. It may be simplest to break it down step... more 3/13/2015 1:33:58 PM
The simplest approach would be to parse it as if it were UTC - making it always valid, and without ever needing DST adjustments - and then format it in UTC as well. In other words, set the time zone of both the formatter and parser to UTC.... more 3/13/2015 11:14:44 AM
There are far more efficient ways of doing this for large numbers of days, but if your code is only ever going to deal with small values, you can just use: static DateTime AddDaysExcludingWeekends(DateTime start, int days) { // Do you... more 3/13/2015 10:52:23 AM