Browsing 7239 questions and answers with Jon Skeet
Look at your if statement: if (N < 0) break; You're breaking out of the loop if the user enters a negative number - but you want to break out if they enter a positive number: if (N > 0) break; (I haven't looked at the... more 12/28/2013 8:22:19 AM
Use IDateTimeZoneProvider.GetSystemDefault for the time zone provider you're interested in. For example: var systemZone = DateTimeZoneProviders.Tzdb.GetSystemDefault(); var zonedDateTime = instant.InZone(systemZone); Or use... more 12/27/2013 9:05:45 PM
You're using mm, which is minutes, not months - and you're trying to print the time using DateTime.Today, which always returns midnight at the start of the day. It's not clear why you're adding 0 days, either. I'd use: DateTime now =... more 12/27/2013 8:27:52 PM
For accessing part of an array, you could use Arrays.asList to obtain a List<E>, and then use the subList method to obtain a slice: import java.util.*; public class Test { public static void main(String[] args) { ... more 12/27/2013 12:16:42 PM
Since I can't cast to Action I'm assuming that Action is not covariant? Action<T> is contravariant - which makes sense, because an Action<object> can be treated as an Action<string> (both can accept a string... more 12/27/2013 11:42:44 AM
Well you'd normally use constructor injection using the annotation: @Inject public SomeType(@MasterDatabase String databaseName) Or you could explicitly request it from the injector: String databaseName =... more 12/27/2013 11:34:01 AM
Well this is the root cause: Caused by: java.lang.ClassNotFoundException: com.google.common.base.Function ... so it looks like you're probably missing a dependency jar file (Guava, by the looks of it) from the classpath of the relevant... more 12/27/2013 9:00:03 AM
There are declarations in XSD to limit the number of child elements, but I don't think that's relevant in your particular case. When it comes to parsing and then modifying the XML, you'll just need to perform the limiting by hand. In... more 12/27/2013 8:58:14 AM
I suspect that line 167 is within an anonymous class within MyActivity, and that access$47 is simply a trampoline method to allow onCameraChange to call a private method within MyActivity. (The JVM wouldn't allow that, so the Java compiler... more 12/26/2013 9:23:36 PM
so it means, the when 31 bits are turned on, I do not get the additive sum of the powers of 2. Yes you do - you get 20 + 21 + 22 + 23 + ... + 230... which is 231 - 1, exactly as you're seeing. You're not adding 231 because that would... more 12/26/2013 8:36:16 PM