groovy sort with comparator syntax

When the Closure used by sort has two parameters, it acts like a traditional Comparator. That is, for each comparison that is done during the sort, between two elements a and b, it returns a negative integer, zero, or a positive integer as the first argument is less than, equal to, or greater than the … Read more

Elasticsearch list indices sorted by name

You can ask ES to sort the results via the s (sort) searchParameter using s=i or s=index curl “localhost:9200/_cat/indices?pretty&s=i” curl “localhost:9200/_cat/aliases?pretty&s=index” To see the column’s headers, add “&v” : curl “localhost:9200/_cat/indices?pretty&v&s=index”`. You can find some explanations in the cat/indices documentation

Kotlin sorting nulls last

You can use these functions from the kotlin.comparisons package: fun <T: Comparable<T>> nullsLast(): Comparator<T?>, which constructs a comparator of something comparable that just puts nulls after all not-null values; fun <T, K> compareBy(comparator: Comparator<in K>, selector: (T) -> K): Comparator<T>, which accepts a comparator and a function that provides values for the comparator, combining them … Read more

Sorting CouchDB Views By Value

It is true that there is no dead-simple answer. There are several patterns however. http://wiki.apache.org/couchdb/View_Snippets#Retrieve_the_top_N_tags. I do not personally like this because they acknowledge that it is a brittle solution, and the code is not relaxing-looking. Avi’s answer, which is to sort in-memory in your application. couchdb-lucene which it seems everybody finds themselves needing eventually! … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)