Extjs custom sorting

I'm having a problem in understanding how I can define my custom sorter function on Grid I'm using Extjs 6.2.0 (EDIT: see below, at the end of post) When I try to set up that on store like below: sorters: [{ { sorterFn: function() { ...
more »

2017-05-20 18:05 (1) Answers

Java how to sort a list of IP Address

I want to sort a list of IP address in ascending order, what is the easiest way to achieve that? For example I have these IP Address in a List: import java.util.ArrayList; import java.util.List; /** * * @author myu */ public class SortListProje...
more »

2017-05-19 23:05 (5) Answers

Sort other arrays based on one array (Obj-C)

I have three NSMutableArray's: NSMutableArray *dateArray; NSMutableArray *nameArray; NSMutableArray *imageArray I would like to sort the dateArray based on the closest date, and then have the nameArray and imageArray bases on this new sorted order...
more »

2017-05-19 19:05 (1) Answers

Excec, List data With values

In a Excelsheet: In column AL I have the names of the employees (1 961). I have their wages in Column AM. I want to sort this dynamically in an another column P from the highest wage to the lowest. The data comes from another woorkbook and changes so...
more »

2017-05-19 15:05 (1) Answers

Unix find and sort with wildcards

let's suppose i've a folder with some xml file: a-as-jdbc.xml z-as-jdbc.xml fa-jdbc.xml config.xml router.xml paster.xml cleardown.xml I would like to pipe the find with some kind of sort command using wildcards and my custom sorting logic. ...
more »

2017-05-19 15:05 (3) Answers

Sort elements based on specific classname

I'm trying to order the div based on the col-md-x. First col-md-4 and then col-md-8. I tried the sort function of jQuery in this variant: var divElement = $('.container').find('.row').sort(sortMe); function sortMe(a, b) { return a.classNam...
more »

2017-05-19 12:05 (4) Answers

Why is "sort" sorting ALL arrays?

I have this (in Javascript): function f(n){ var arr = (''+n).split(); var sortedArr = arr; sortedArr.sort(); } When I return arr and sortedArr, they are both sorted. Why is this? Shouldn't the .sort method only sort sortedArr here? ...
more »

2017-05-19 12:05 (2) Answers

Inconsistent output of quick sort

I want to experience worst case of quick sort. Therefore, I generate an array with descending order. After sorting with quick sort, array's first element sometimes becomes a garbage while sometimes becomes 0 as expected. When first element becomes a ...
more »

2017-05-19 00:05 (2) Answers

Powershell sort PSObject alphabetically

Given a custom powershell object (bar) that is created from json (foo.json) How would you sort the object alphabetically by key? foo.json { "bbb": {"zebras": "fast"}, "ccc": {}, "aaa": {"apples": "good"} } Desired output foo.json { "aaa"...
more »

2017-05-18 21:05 (1) Answers

java.lang.ArrayIndexOutOfBoundsException: 19

The code below is to visualize a printout of data generated in the rest of the program. It takes out the info from the wagens and locos who are inputted into a arraylist. My main concern here is how to combine them in the right order of this and to ...
more »

2017-05-18 15:05 (1) Answers

How to order classes by inheritence?

I'm using reflection to retrieve a list of available classes and I want to adapt the input object to the most specific class that matches; i.e. I want to do something like: RawData input = new RawData() { ... }; Type targetAdapter = AdapterSelector....
more »

2017-05-18 12:05 (2) Answers

Sorting with priority in jquery or js

var data = [{ "type": "local", "name": "Frank", "age": 89 }, { "type": "visitor", "name": "Mary", "age": 76 }, { "type": "local", "name": "John", "age": 36 }, { "type": "visitor", "name": "James", "age": 10 ...
more »

2017-05-18 10:05 (2) Answers

Sorting array with multiple values compared

I have the following array $postarray[] = array( 'total' => '6.5', 'points' => '300' ); $postarray[] = array( 'total' => '11.4', 'points' => '320' ); $postarray[] = array( 'total' => '6.5', 'points' => '340' ); $postarray[...
more »

2017-05-17 22:05 (2) Answers

How to match and relate data unique?

I'm having some difficulties figuring out how to return the best unique match, while assigning as many as possible. Scenario: Each kid has a list of favorite fruits with a personal score. We only have ONE of each fruit, so we want to give it to the ...
more »

2017-05-17 21:05 (1) Answers