Browsing 7239 questions and answers with Jon Skeet
The problem is that the type of 0xFFE00000 is uint (because it's greater than 0x7fffffff), and there's no &(int, uint) operator, so both sides are promoted to long. The fix is simple: just shift and then mask: value = (lineIntData... more 5/7/2014 8:36:29 AM
The problem is that your extension method has two type parameters, but only one of them can be used in type inference by the compiler - TKey isn't mentioned at all in the normal parameter list, which is what's used in type inference. I... more 5/7/2014 3:59:34 AM
You should really do as much filtering as possible at the database side rather than client-side: string query = "SELECT XMLConfig FROM TableCfg WHERE Enable = True"; Notice how now you don't even need to fetch Enable, as you already... more 5/6/2014 3:46:21 PM
I'm interpreting this: So I'm testing my json validator and have json in my propertis file like: jsonSource = {"kind": "Listing\""} As meaning you have a straight Java properties file which you're loading in a normal way. In that... more 5/6/2014 11:51:09 AM
It depends on what you're going to use the POJO for. In general, it's certainly not required. toString() is not used in default Java binary serialization, although it may be used by some serialization frameworks. (I'm not aware of any that... more 5/5/2014 10:25:08 AM
There's no significant difference at all. The latter is slightly more longwinded, but does allow you to easily inspect the value in the debugger before it's returned - that's about the only difference. There's certainly no difference in... more 5/5/2014 8:48:13 AM
You're using "#.##" as your format string, and # means "show a digit if it's significant". If you always want to show two digits, you should use "0.00" as your pattern. See the documentation for custom numeric format strings for more... more 5/5/2014 8:34:59 AM
The first problem even before you get to line breaks is that you're reading bytes and then treating those as characters. You're effectively assuming an encoding of ISO-8859-1 which may well not be correct. You should be using an... more 5/5/2014 8:25:13 AM
Arrays don't override equals, so you get reference equality - that's why your System.out.println call is printing false. However, JUnit's method is asserting that the arrays are logically equal, i.e. that they're the same size, and each... more 5/5/2014 8:16:52 AM
If you want it to find those files automatically without having to specify them, you'll need to be in the package root, so run this from within src: javac server/*.java That would then work. However, personally I would always specify... more 5/4/2014 7:20:00 PM