Sort by shared variable

My report group displays the net cost of the top 10 clients. {@NetCost} is a shared variable for calculate sales cost - all taxes and all discounts: if travelType="OW" then salesCost-Tax1-Tax2-Tax3-Discount1-Discount2 else (salesCost-Tax1-Tax2-...
more »

2017-08-15 17:08 (1) Answers

Sort list of methods

I have a list which contains all setters of my POJO class. public static void main(String[] args) throws Exception { Method[] publicMethods = SampleClass.class.getMethods(); List<Method> setters = new ArrayList<>(); for (Me...
more »

2017-08-15 15:08 (2) Answers

How to sort characters in a string diagonally

im splitting a string by the square number of his length.. String alphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"; int a = alphabet.length(); int b = (int)Math.round(Math.sqrt(a)); System.out.println(java.util.Arrays.toString(splitter(key, b))); // prints...
more »

2017-08-15 03:08 (2) Answers

merge sort not sorting array

I have written the Java code below after reading up on merge sort. There are no errors when running the code but the merge sort does not sort the array. It just returns the original unsorted array. I can't for the life of me figure out where the prob...
more »

2017-08-14 20:08 (1) Answers

External Sort GC Overhead

I am writing an external sort to sort a large 2 gig file on disk I first split the file into chunks that fit into memory and sort each one individually, and rewrite them back to disk. However, during this process I am getting GC Memory overhead exce...
more »

2017-08-14 20:08 (2) Answers

I am new to python and using list of dictionary

I have dictionary data like this, student_data = [{'id':1, 'Hacker' : 'DOSHI', 'Rank' : 43}, {'id':2, 'Hacker' : 'JOSHI', 'Rank' : 45}, {'id':3, 'Hacker' : 'MOSHI', 'Rank' : 41}, {'id':4, 'Hacker' : 'LOSHI', 'Rank' : 98}, {'id':5, 'Hacker' : 'A...
more »

2017-08-14 18:08 (2) Answers

sorting columns of html table in angular 2

I have a requirement where I need to sort each column of table every time it is clicked in ascending order. The logic applied is a general logic for sorting in Javascript. It works fine in all the scenarios except when the data comes up with differen...
more »

2017-08-14 16:08 (2) Answers

Array.sort safari issue

I have the array: var arr = [ {id: "d", sequence: 3}, {id: "c", sequence: 4}, {id: "b", sequence: 2}, {id: "a", sequence: 1}, {id: "e"} ]; and want to sort it with follow logic: element without sequence should be first other ...
more »

2017-08-14 15:08 (2) Answers

Sort object by key values

I am stuck with an object structure (for now) that I would like to see if I can try to sort. My object looks like this right now - { "type1" : { "position": 3 }, "type2" : { "position": 1 } } And what I am trying to figure out ...
more »

2017-08-14 15:08 (1) Answers

Sort out some entries from result of a query

I can not explain what exactly I want in words that's why I prefer to show a small example. I am using SQL Server, and have this table: col1 | col2 | col3 --------+----------+------------ john | conner | 01.01.1980 sarah | conner | ...
more »

2017-08-14 15:08 (2) Answers

Sort NSArray custom object on multiple properties

I have a custom object with multiple properties. One property is a Type, for example an enum: A, B, C etc These all have a Date too. @property (assign) CustomType customType; @property (nonatomic, strong) NSDate *startDate; ... typedef NS_ENUM(NS...
more »

2017-08-14 14:08 (1) Answers

How to sort a data base Table swift 3?

I have data base table Name "calculationAxisAll" and I have 40 rows in that and I have a column name "AxisType" I want to sort "calculationAxisAll" Table Data that If my 'AxisType' is Not Same. calculationAxisAll = CoreDataHelper.sharedInstance.fet...
more »

2017-08-14 13:08 (1) Answers

Javascript sort table with several heads

I have this table structure: Fiddle: https://jsfiddle.net/ac9damzk/2/ I am now trying to sort the table by the header "Example Timestamp" in such a way, that the headers are getting sorted as well as the content below the headers. When the sorting ...
more »

2017-08-14 13:08 (0) Answers

mysql sorting string according to number first

I don't know is it possible or not I have subject code stings like this Math 451 Math 451a Math 452 Math 452a Math 452b I want query that would sort these string like this Math 451 Math 452 Math 451a Math 452a Math 452b I tried CAST(SUBSTR(sub...
more »

2017-08-13 18:08 (1) Answers

Sort points in counter-clockwise in javascript

I have a set of points introduced into a canvas: My canvas with set of points I have to apply this algorithm on: Algo NoObtuse and example of graph produced by this algo My problem is to find, starting from the rightmost point, the following point ...
more »

2017-08-13 15:08 (1) Answers

Why is my xAxis not sorting in d3?

Yesterday I posted a question about a bar graph that I didn't know how to sort in alphabetical order. @Mark_M very kindly answered and provided me whith a good solution that normally should perfectly work. Here is the snippet: var xAxis = d3.axisBo...
more »

2017-08-13 13:08 (1) Answers