Browsing 7239 questions and answers with Jon Skeet
Assuming you've got quite a lot of instances, it's likely to be much faster to find the item in the dictionary. Basically a Dictionary<,> is a hash table, with O(1) lookup other than due to collisions. Now if the collection is... more 7/24/2015 11:25:29 AM
No, that method isn't supported on Windows Phone 8.1, apparently. The key is to look at the "Requirements (Windows 8.x and Windows Phone 8.x)" section at the bottom of the docs, which shows: Minimum supported client Windows... more 7/24/2015 11:16:53 AM
Just use the append method instead of setText. Everything's behaving exactly as I'd expect it to - I would have been really surprised if setText had appended. If you don't want to use append for some reason, you can call getText and... more 7/24/2015 8:04:09 AM
You'll want to parse the time string to a LocalTime first, then you can adjust a ZonedDateTime from the Instant with the zone, and then apply the time. For example: DateTimeFormatter formatter = DateTimeFormatter.ofPattern("HH:mm",... more 7/23/2015 4:54:51 PM
List<T>.GetEnumerator() returns a mutable value type (List<T>.Enumerator). You're storing that value in the anonymous type. Now, let's have a look at what this does: while (x.TempList.MoveNext()) { // Ignore... more 7/23/2015 3:08:28 PM
It sounds like you want SkipWhile: var orders = purchaseOrders.SkipWhile(x => !x.OurRef.Equals(...)); Once the iterator has stopped skipping, it doesn't evaluate the predicate for later entries. Note that that code will include the... more 7/23/2015 2:45:21 PM
There are two problems I can see at the moment... Servlet init parameters You currently have: //defining param1 param1 value1 That's not how you define the parameter. You should specify a param-name element containing the... more 7/23/2015 8:03:37 AM
In this particular case, I'd say it's reasonable to use a string representation. After all, the count you're finding is less inherently about its numeric value than its decimal string representation - you'd get a different value if you... more 7/23/2015 6:15:40 AM
You don't get a builder for the repeated field itself - you call Builder.addRepeatedField(field, value) etc. To get a builder for the type of the repeated field, you can use: Builder builder = bld.newBuilderForField(field) If you want... more 7/22/2015 10:06:18 PM
That's because HttpApplication.BeginRequest is just of type EventHandler... so your second parameter should be of type EventArgs, not WindowsAuthenticationEventArgs. more 7/22/2015 7:50:35 PM