Browsing 7239 questions and answers with Jon Skeet
This isn't a particularly unusual structure in JSON. That should be deserialized to a Dictionary<string, User>: public class Root { [JsonProperty("user_data")] public Dictionary<string, User> Users { get; set;... more 9/13/2015 6:02:15 PM
This constructor is the problem: public ObservableDictionary(IDictionary<TKey, TValue> dictionary) { dictionary = new Dictionary<TKey, TValue>(dictionary); } That's assigning a new value to the parameter, rather than to... more 9/12/2015 12:23:40 PM
It's behaving exactly as documented: Returns a string that represents the BigDecimal as described in the toString() method, except that if exponential notation is used, the power of ten is adjusted to be a multiple of three... more 9/11/2015 2:42:13 PM
Your call to StaticClass.Equals is actually just a call to Object.Equals(Object, Object), as StaticClass doesn't provide an applicable overload for Equals. If you look in the IL, you'll see that the compiler has resolved the call to just... more 9/11/2015 2:24:06 PM
I have a problem whereby I need to be able to detect whether a byte array contains characters which comply with ISO-8859-1 encoding. Well every stream of binary data can be viewed as "valid" in ISO-8859-1, as it's simply a... more 9/11/2015 9:52:49 AM
This is the issue: NumberFormat df = NumberFormat.getNumberInstance(); That's getting the format for your machine's default locale, which presumably uses a comma as the decimal point. Just use the US locale: NumberFormat df =... more 9/11/2015 6:20:17 AM
I suspect the problem is that you're setting the content type - including the encoding - after calling HttpServletResponse.getWriter(), assuming that's where out comes from. From the documentation of ServletResponse.setContentType: ... more 9/11/2015 6:11:23 AM
You're confused between the key of the entry and the index of the entry. Your MoveItem method just changes the key associated with a value (by removing the old entry and creating a new entry). After these lines: Items.Add(0,... more 9/10/2015 9:13:53 PM
If you just want to be able to iterate over objects map, you can just call values() on that and then create an iterator from that value set: public abstract class MapObjects<MapleMapObject> implements Iterable<MapleMapObject>... more 9/10/2015 7:23:09 PM
HashSet should be viewed as an unordered set. If you want a sorted set, just use a TreeSet: Set<AItem> sortedItems = new TreeSet<>(new Comparator<AItem>() { ... }); sortedItems.addAll(aItems); (Don't use the raw type... more 9/10/2015 9:19:58 AM