Browsing 7239 questions and answers with Jon Skeet
Now what is the difference between i and j? i has 6 decimal places of precision; j only has 2. Sure, the difference doesn't change the magnitude of the number at all - and i == j will still return true - but decimal retains the... more 3/12/2014 1:28:11 PM
The assignment is atomic in that any reading thread will either see 123 or the previous value - not some intermediate value. However, there's no guarantee that a thread will see the new value until there have been two memory barriers: a... more 3/12/2014 11:37:07 AM
I haven't used the HTML Agility pack myself, but I suspect it's just that your XPath expression is wrong. Try: doc.DocumentNode.SelectNodes("//a[@class='op-to-b-2']/@href") That will get name/value pairs. To get just the values, you can... more 3/12/2014 11:25:47 AM
I suspect the immediate problem is that your pair[1] value still starts and ends with a double quote - so if you print it out you'll see "Value" rather than Value You could just trim them from the start manually, but I would strongly... more 3/12/2014 7:02:52 AM
There are several things wrong here: Your enum is private, but your methods are public. Therefore you can't make your methods return type be the enum type, or have parameters with that type Your SetDifficulty method has a parameter of... more 3/11/2014 7:50:07 PM
Not in general, no. However, you can use strictfp expressions: Within an FP-strict expression, all intermediate values must be elements of the float value set or the double value set, implying that the results of all FP-strict... more 3/11/2014 7:46:41 PM
There are various things wrong with your code. Firstly, Java is case-sensitive. Here's your variable declaration: public JPanel AniPanel; And here's where you're trying to use it: aniPanel = new AniPanel(); Note the capital A in the... more 3/11/2014 6:36:16 PM
If a class only has a private constructor, you simply can't derive from it except as a nested type. Basically it sounds like the type you want to use is not amenable to being used in tests :( When you say the type "is coming from an... more 3/11/2014 5:38:26 PM
Currently there are two problems: Your method expects a Func<T, bool> and I suspect g => g.Id fails that because your Id property isn't a bool You're currently specifying List<DTO> as the type argument, when I suspect you... more 3/11/2014 5:12:09 PM
It means that a synchronized instance method is broadly equivalent to: public class FooClass { public void foo() { synchronized(this) { ... } } } Whereas a synchronized static method is broadly... more 3/11/2014 1:48:12 PM