Browsing 7239 questions and answers with Jon Skeet
Firstly, it sounds like you really want an Instant rather than a ZonedDateTime - that takes the time zone part out of the picture entirely. But either way, just use a DateTimeFormatter to format the value however you want. It sounds like... more 6/16/2016 5:54:42 AM
I think you're asking whether from thread T1 that calls join on T2, code in T1 reading data after the join() will definitely see changes written by T2. If that's the case, then the answer is yes, due to JLS 17.4.4: The final action in... more 6/15/2016 3:04:12 PM
Just use any LINQ operation, e.g. Where: [Test] public void GetSafeCount_NonICollectionObject_ReturnCount() { IEnumerable<string> enumerable = new string[0].Where(x => x.Length == 0); Assert.AreEqual(0,... more 6/15/2016 11:26:14 AM
You're missing an hour because there are two UTC instants which both correspond to the same local time, due to the clock going back. The only way of avoiding "missing hours" is to emit two entries for the ambiguous local time. Let's look... more 6/14/2016 3:40:36 PM
Concat doesn't modify anything - it returns a new sequence, which you're currently ignoring. However, rather than using Concat, you should just use SelectMany to flatten the sequence: string[] values = Acode.Split(','); return... more 6/14/2016 3:20:54 PM
You're creating a single list for innerList, and adding that reference to outerList on each iteration... so your outerList ends up containing lots of references to the same list, which ends up empty because you clear it. You should create... more 6/14/2016 2:59:23 PM
It's entirely possible that a different object which had a reference to the instance of Foo is being finalized at the same time - and may resurrect the Foo object, allowing it to be used after finalization. This is kinda rude, but can... more 6/13/2016 6:40:07 PM
Basically, WPF isn't supported by Mono (or .NET running on any platform other than Windows). You'll need to find a Windows-based CI service such as AppVeyor instead. more 6/13/2016 8:10:57 AM
The 2. awaitbale task was executed with option "continue on captured context" so I would expect that it runs on the same thread as the code that called it. That assumes that "context == thread", but it doesn't. The synchronization... more 6/12/2016 11:59:58 AM
You're declaring new variables inside the loop: int fightOneHpLoss = fighterOneHealth - fTwoRandomHit; int fightTwoHpLoss = fighterTwoHealth - fOneRandomHit; ... but you're never modifying the variables which are meant to represent the... more 6/11/2016 6:48:28 AM