Browsing 7239 questions and answers with Jon Skeet
That looks very much like you could do with an array or a list: List<MapView> mapViews = new ArrayList<>(); for (int i = 1; i <= 6; i++) { MapView mapView = new MapView(getActivity(), i); initialMapView(mapView); ... more 1/21/2014 8:46:24 PM
Now that we know that ScaleGroup isn't a class, but an enum, it's simple: int num = (int) ld.ScaleGroup; int secondDigit = num % 10; ld.ScaleGroup = (ScaleGroup) secondDigit; (It's not clear to me that that's actually what you want,... more 1/21/2014 7:17:55 PM
Well you're not specifying "the current date" anywhere - you haven't assigned a value to your dt variable, which is what the compiler's complaining about. You can use: DateTime dt = DateTime.Today; Note that that will use the system... more 1/21/2014 7:03:58 PM
It will fail to compile, the way you've written it. Only nested classes can be protected - and they're accessible to any classes derived from the outer class, just like other protected members. class Outer { protected class Nested ... more 1/21/2014 5:12:32 PM
I would suggest you just try to parse each specific format, catching ParseException and just moving onto the next format: private static final String[] patterns = { "yyyy-MM-dd HH:mm", "yyyy-MM-dd'T'HH:mm", "yyyy-MM-dd... more 1/21/2014 5:00:27 PM
My guess is that the type of m_LocationSqrMtr is int, in which case this expression: 700 / m_LocationSqrMtr ... will be computed using integer arithmetic, and the result converted to float. I suspect you want: if (m_LocationCosts >... more 1/21/2014 3:15:44 PM
Here's one option: private static readonly Dictionary<Type, string> DestinationsByType = new Dictionary<Type, string> { { typeof(Manager), @"\ManagerHome" }, { typeof(Accountant), @"\AccountantHome" }, //... more 1/21/2014 3:02:09 PM
Your question is tricky to understand, but I suspect you just need to use r (the row in the current iteration) instead of Row1. The name Row1 only has any meaning within the query expression itself. So try this: Dim req2 = From Row2 In... more 1/21/2014 2:30:36 PM
Your terminology is a bit confused.... the value of i3 isn't an address (or reference) at all, it's just the integer value. But no, the example you've given won't create any Integer objects. more 1/21/2014 2:19:24 PM
You can use DateTimeFormatterBuilder to achieve this with an optional part: import org.joda.time.format.*; class Test { private static final DateTimeFormatter formatter = new DateTimeFormatterBuilder() ... more 1/21/2014 1:32:09 PM