Browsing 7239 questions and answers with Jon Skeet
You're only setting it within that shell. This is perfectly normal behaviour for environment variables - not just on Windows, but on other OSes too. I don't know about Windows 7, but on Windows 8 if I press the Windows key and start... more 8/7/2014 9:52:52 PM
You're using Select incorrectly, basically. It's lazy, remember? So every time you iterate over it (once for Count() and once in WhenAll)... it's going to call your delegate again. The fix is simple: just materialize the query, e.g. with... more 8/7/2014 8:15:21 PM
If there are different classloaders involved, then they will be completely separate classes, with separate static fields etc - and each will be initialized separately. (The simplest way to diagnose this is just to log when you get... more 8/7/2014 4:24:27 PM
Don't believe the Watch window, basically. It can play silly games with string representations of values. The two values are equal (expected == actual will be true), but they're not identical - the trailing zeroes are preserved. Here, the... more 8/7/2014 4:02:19 PM
This seems perfectly legal to me Well it's not - a method call is never a constant expression. See JLS 15.28 for what constitutes a constant expression. And a case value always has to be a constant expression. The simplest fix would... more 8/7/2014 1:27:29 PM
I suspect you just want: DateTime today = DateTime.Today; // Just fetch the date part. var query = context.vehicles.Where(v => v.InsertionDate == today); Avoid string conversions if you possibly can. If your InsertionDate includes... more 8/7/2014 11:36:27 AM
This makes me wonder, if lambda expression (with a body) is not explicitly a delegate nor an expression, what is its type? It doesn't have a type in the normal sense of the word (i.e. a CLR type), just like null doesn't have a type.... more 8/7/2014 10:14:41 AM
You're not multiplying two numbers using BigDecimal. You're multiplying them using double arithmetic, and passing the result to the BigDecimal constructor. You want: new BigDecimal("0.06").multiply(new BigDecimal("3")).toString() Note... more 8/7/2014 9:39:53 AM
NewAlertCount is a property in a class - but we can't tell what that class is. (Maybe it's ProjectHeaderControl - your description is somewhat hard to understand.) Intelligence_Gathering_System.Pages.Project.Controls is a namespace. A... more 8/7/2014 9:05:23 AM
Just use DateTimeOffset: TimeSpan utcOffset = TimeSpan.FromHours(timeZone); DateTimeOffset result = new DateTimeOffset(dateTime, utcOffset); DateTime utc = result.UtcDateTime; or string utc = result.ToString("yyyy-MM-dd'T'HH:mm:ssK",... more 8/6/2014 7:53:53 PM