Browsing 7239 questions and answers with Jon Skeet
Java is the standard way of writing Android apps, but it's not strictly necessary. For example, there's also Xamarin.Android which lets you write Android apps in C# - although it will still fire up a Dalvik VM behind the scenes, as the... more 1/3/2014 8:20:40 AM
This is what's tripping you up: xmlns="http://fantasysports.yahooapis.com/fantasy/v2/base.rng" You're asking for elements in the unnamed namespace - but the elements default to the namespace shown above. It's easy to fix that in LINQ... more 1/2/2014 4:13:36 PM
You can't, basically. The IL generated for these calls is exactly the same: ExampleMethod(10); ExampleMethod(10, "default string"); ExampleMethod(10, "default string", 10); The defaulting is performed at the call site, by the... more 1/2/2014 4:07:23 PM
I suspect the problem is that you're not reading to the end of the containing element - I suspect you want: public void ReadXml(XmlReader reader) { Name = reader.ReadElementContentAsString(); } The documentation for ReadXml states: ... more 1/2/2014 3:28:05 PM
Well you're not actually executing the prepared statement... you're just preparing it. You should call PreparedStatement.executeQuery and use the ResultSet it returns: // ...code as before... try (ResultSet results = ps.executeQuery()) { ... more 1/2/2014 2:30:09 PM
You're using b in the constructor of Otherclass - which will be executed before the Applet launcher gets to execute init. If you put this statement: b[0] = 4; into the constructor of Main, it will be executed before the constructor... more 1/2/2014 1:42:07 PM
The simplest approach is: public string GetLetter(int value) { char letter = (char) ('A' - 1 + value); return letter.ToString(); } I'd personally change the return type to char though: public char GetLetter(int value) { ... more 1/2/2014 12:11:06 PM
You're using mm, which is minutes, not months. You want yyyy-MM-dd as your format string. It's not clear why you're not returning a Calendar directly from your method, mind you: private static final TimeZone UTC =... more 1/2/2014 11:34:28 AM
Yes, .NET doesn't support this as far as I'm aware. My Noda Time project does, but only partially: it can parse the value, but the value is just parsed to midnight at the start of the next day, and is never formatted as 24:00. There's... more 1/2/2014 9:37:11 AM
Assuming the image data is already in the format you want, you don't need image ImageIO at all - you just need to write the data to the file: // Note preferred way of declaring an array variable byte[] data =... more 1/2/2014 9:18:07 AM