Browsing 7239 questions and answers with Jon Skeet
I'm 99% sure this is because of the behaviour of the conditional operator. I believe your code is equivalent to: double tmp = store != null ? store.getAvailablePieces() : 0.0; Double availablePieces = tmp; In other words, it's unboxing... more 1/23/2014 10:45:59 AM
1) Why am I getting Exception in thread "main" Because there's presumably no value for the given integer, so the get call returns null. You're then unboxing that, which throws an exception. Your code is effectively: public static... more 1/23/2014 10:31:24 AM
You've misunderstood how Date works. A Date doesn't have a time zone - if you use Date.toString() you'll always see the default time zone. The long value in a Date is purely the number of milliseconds since the Unix epoch: it doesn't have... more 1/23/2014 10:18:52 AM
This is the problem: public class config extends ApplicationWindow in conjunction with this in the ApplicationWindow constructor: cfg = new config(); So to create a new ApplicationWindow, you need to create a new config... but... more 1/23/2014 8:57:34 AM
Without seeing the actual code for GetFirstRequest and GetSecondRequest, we can't tell - but the fact that you've got an instance variable of type StringBuilder makes me skeptical. StringBuilder itself isn't thread-safe, and if you're... more 1/23/2014 8:53:54 AM
Am I doing something wrong? Well, you're not really doing anything asynchronously. Your ReportExcelAsync method is entirely synchronous, as it doesn't have any await expressions. So GenerateReportExcel will call ReportExcelAsync,... more 1/23/2014 8:41:25 AM
The JRE is more than just the libraries you're referring to - it's the whole JVM. Also, the JRE wouldn't be included in "external jars" anyway. It's generally assumed that the target of a Java application will already have Java installed -... more 1/23/2014 7:15:48 AM
I assume this code is meant to drain stdout/stderr from the process: int c1; while ((c1 = in1.read()) != -1) { System.out.print((char)c1); } int c; while ((c = in.read()) != -1) { System.out.print((char)c); } Unfortunately, it... more 1/23/2014 6:52:44 AM
I think the problem is that DD is "day of year" rather than "day of month" - and YYYY is a "week year" rather than just "year". (Week years are odd, basically. Best to just ignore them if possible :) So try formats of "yyyy-MM-dd" and... more 1/22/2014 8:08:07 PM
Currently you're never parsing the values as DateTime values - which means you can't format them as DateTime either. The only single-parameter ToString method on String is the one with IFormatProvider as the parameter type, which is why... more 1/22/2014 7:34:26 PM