Browsing 7239 questions and answers with Jon Skeet
If it makes a difference, the code I've shown above is running in a separate thread. And that's the problem. You're relying on a value set by one thread to be visible in another - and there's no such guarantee without memory barriers... more 7/11/2015 10:28:45 AM
With a simple nested class, it would be fine. However, you're creating an inner class of B, which means you're implicitly passing a reference to an instance of B - which would be this in this case, and you can't use this before super(...)... more 7/10/2015 3:29:58 PM
Math.round(double) is documented as: Returns the closest long to the argument, with ties rounding to positive infinity. So -0.5 is rounding up (towards positive infinite) instead of down towards negative infinity. It's behaving... more 7/10/2015 3:27:39 PM
MyEnumerator does not has the required public methods Yes it does - or rather, it would if Current were public. All that's required is that it has: A public, readable Current property A public MoveNext() method with no type... more 7/10/2015 2:10:54 PM
This: (byte)1 ^ (byte)1 is a constant expression (JLS 15.28), which is known to be in the range of byte. You can therefore implicitly convert it to byte in an assignment context (JLS 5.2): In addition, if the expression is a... more 7/10/2015 2:05:21 PM
There are two problems: The time zone support looks like it was introduced post-1.2.26 The time zone support doesn't take an arbitrary TZDB ID. From the docs for v1.4.1: Timezone to be used for formatting. It understands UTC/GMT and... more 7/10/2015 1:55:01 PM
Both Count and Item[] changes are notified. Here's a sample (using C# 6 just for the string interpolation): using System; using System.ComponentModel; using System.Collections.ObjectModel; class Test { static void Main(string[]... more 7/10/2015 1:47:56 PM
It would be exactly the same. Query expressions are basically converted to the non-query-expression equivalent. You'd need to use select new { tableA, tableB } or something similar anyway, so that you could use both variables after... more 7/10/2015 1:41:58 PM
Well, there are four repositories involved here: Your github one Your local clone of your github project Your brother's github fork Your brother's local clone of his fork I haven't used GfW myself for a little while, but I suspect that... more 7/10/2015 10:53:59 AM
It sounds like you could use something like: var dictionary = doc .SelectMany(array => array) .Distinct() .ToDictionary(word => word, word => doc.Select(array => array.Count(x => x == word)) ... more 7/10/2015 10:14:10 AM