Browsing 7239 questions and answers with Jon Skeet
Your question is somewhat unclear, but I suspect I see the pattern - the value of threaded_extended is effectively a Dictionary<int, List<Post>> or similar. So that's how you should represent it: public class Root { ... more 5/12/2017 6:03:43 AM
I think you just want: var orderedByIndexList = myIndexList.Select(index => myValuesList[index]); If you need it as a List<T>, put .ToList() at the end. Note that this doesn't modify myValuesList - it just creates a new... more 5/11/2017 2:48:07 PM
You're calling the JSONObject(Object) constructor, passing in a JSONObject (the element in the array). That constructor is documented as: Construct a JSONObject from an Object using bean getters. It reflects on all of the public... more 5/11/2017 6:01:36 AM
Answering the specific question Does that mean that my byte still contains negative values despite converting it to UTF-8? Yes, absolutely. That's because byte is signed in Java. A byte value of -61 would be 195 as an unsigned value.... more 5/10/2017 8:34:29 AM
You're calling Thread.Join from the UI thread. That means the UI thread is blocked until all the other threads complete. That's a bad idea in general as it means your UI is blocked while all the other threads do work. In this case it's... more 5/10/2017 7:14:39 AM
A combination of the null-conditional and null-coalescing operators should work here: bool pass = (bool) (d?["k"] ?? false); To clarify: If d is null, d?["k"] is null If d?["k"] is null, d?["k"] ?? false is false (boxed as object) The... more 5/9/2017 7:02:45 AM
You're calling the DateTime constructor without specifying a Kind, then you're calling ConvertTimeToUtc. That's going to assume that dateTime is actually local, and convert it to UTC. Given that you're already constructing it with UTC... more 5/8/2017 6:01:15 PM
Currently you're trying to fetch a price element directly under book, so that's not going to work to start with. Next you want to only select the price element with the right country sub-element Finally, you don't want the value of the... more 5/8/2017 8:51:02 AM
I suspect you want options.encoding = 'UTF-8' That would fit with the javadoc help text of: -encoding <name> Source file encoding name ... whereas charSet appears to affect the output. (I'd hope it would default... more 5/8/2017 8:37:35 AM
Method A is basically executing everything in a separate task, which will probably end up in a new thread. When you await the resulting task, you won't block anything. Method B starts by calling GetAllDirectoriesWithImageAsync, and awaits... more 5/8/2017 7:02:11 AM