Simple way to subset SpatialPolygonsDataFrame (i.e. delete polygons) by attribute in R

looks like you’re overwriting the data, but not removing the polygons. If you want to cut down the dataset including both data and polygons, try e.g. world.map <- world.map[world.map$AREA > 30000,] plot(world.map) [[Edit 19 April, 2016]] That solution used to work, but @Bonnie reports otherwise for a newer R version (though perhaps the data has … Read more

What is the meaning of a at the end of some vim mappings?

:help key-notation says: notation meaning equivalent decimal value(s) ———————————————————————– <CR> carriage return CTRL-M 13 *carriage-return* <Return> same as <CR> *<Return>* <Enter> same as <CR> *<Enter>* Mappings often involve Ex commands and you must press <CR> to execute them so it’s included in the mapping.

Class Mapping Error: ‘T’ must be a non-abstract type with a public parameterless constructor

The problem is that you’re trying to use the T from SqlReaderBase as the type argument for MapperBase – but you don’t have any constraints on that T. Try changing your SqlReaderBase declaration to this: public abstract class SqlReaderBase<T> : ConnectionProvider where T : new() Here’s a shorter example which demonstrates the same issue: class … Read more

Elasticsearch : Root mapping definition has unsupported parameters index : not_analyzed

You’re almost here, you’re just missing a few things: PUT /test { “mappings”: { “type_name”: { <— add the type name “properties”: { <— enclose all field definitions in “properties” “field1”: { “type”: “integer” }, “field2”: { “type”: “integer” }, “field3”: { “type”: “string”, “index”: “not_analyzed” }, “field4,”: { “type”: “string”, “analyzer”: “autocomplete”, “search_analyzer”: “standard” … Read more

Deserialize JSON to ArrayList using Jackson

You can deserialize directly to a list by using the TypeReference wrapper. An example method: public static <T> T fromJSON(final TypeReference<T> type, final String jsonPacket) { T data = null; try { data = new ObjectMapper().readValue(jsonPacket, type); } catch (Exception e) { // Handle the problem } return data; } And is used thus: final … Read more