Sorting 50+-digit numbers in array

I have array of strings containing 50+-digit numbers. I need to convert them to real-world integers and order them in asceding. It works when I have numbers with different size number of digits, but in this case where all numbers having same size num...
more »

2017-02-21 22:02 (3) Answers

exclude enumeration of each field in PHP array

This is how the object look like ! I want to exclude the enumeration of fields from array and keep only the specific key and value.Also, the final array must to be json type. $query="SELECT * FROM articles"; $rs=$connectLink->query($query); wh...
more »

2017-02-21 19:02 (0) Answers

Wpf DataGrid (German) Date Sort

I am looking for a (preferably XAML only) solution to Auto-Sort a WPF DataGrid by a column which displays date values in dd.MM.yyyy format. The DataGrids ItemSource is a DataTable, which is read from a XML string. The Code that I already have does n...
more »

2017-02-21 16:02 (2) Answers

usort of session array not outputting as expected

I have a grid of img squares that can be dragged into any order using the sortable library. Each img is a visual representation of a result from a mySQL db query that selects any image that shares an 'imageparent' identifier. The order they're presen...
more »

2017-02-21 12:02 (1) Answers

Algorithm to create subgroups of people

we are looking for an algorithm that could help us creating subgroups of people. I'll explain it better with an example: We have a group of 5 students, let's call them A, B, C, D, E. Given a number (call it n) smaller than the number of students (&l...
more »

2017-02-21 07:02 (1) Answers

Sort List of Lists of Lists Python

I have a List of Lists of Lists in python. I need to sort the highest level of lists based on one of the values in the lowest levels. For a toy model, my list is created first with list small, which is a list containing lists with three items each:...
more »

2017-02-20 21:02 (1) Answers

PHP / MySQL - syntax to sort array results?

Using a custom template (Journal 2) for a PHP-based E-commerce system. In the control panel, there's a section that loads custom modules. Problem is, the modules are presented in the order of creation, which makes it hard to find the right module. I ...
more »

2017-02-20 17:02 (3) Answers

Search in array, not only unique values

I have a simple array containing Dutch city names: var cities = ['Amsterdam', 'Den Haag', 'Den Helder', 'Rotterdam', 'Utrecht', 'Groningen', 'Zoetermeer', 'Zwolle', 'Delft']; My code to search through this array looks like this: elems.searchFiel...
more »

2017-02-20 12:02 (4) Answers

Sorting by selection in an array c++

so my program should be able to take several numbers from the user until the last number is "999". Then, it should be able to print out an array having all the numbers entered sorted. I have to use sorting by selection (by comparing values in each in...
more »

2017-02-20 11:02 (0) Answers

Is it really a array sorting bug of chrome and ie?

I create a very simple array sorting script, it works on Firefox, but chrome and ie are giving me an unordered array. var arr = ["2017-02-17", "2017-02-17", "2017-02-16", "2017-02-15", "2017-02-16", "2017-02-15", "2017-02-14", "2017-02-16", "2017-02...
more »

2017-02-20 08:02 (3) Answers

Sorting based on number of conditions

I want to filter out data from a table using multiple conditions, so I'm using the following query. SELECT * FROM `usersposts` WHERE (LOWER(`content`) LIKE LOWER('%{$keywords}%') OR LOWER(`fname`) = LOWER('{$keywords}') OR LOWER(`title`) = LOWER('{...
more »

2017-02-20 08:02 (3) Answers

D3 bar chart sorting not working

I created a bar chart with a simple .csv data. The first column is "Team", which contains team names as text; The second column is "Goals", which contains number of goals scored. But then I want to sort the bars so that Teams with more goals comes f...
more »

2017-02-20 07:02 (1) Answers

Counting the number of inversions in merge sort

I have implemented a merge sort and, as well as sorting, I would like it to compute the number of inversions in the original array. Below is my attempt at implementing it, which for some reason doesn't compute the number of inversions correctly. F...
more »

2017-02-19 16:02 (2) Answers

Bubblesort algorithm with Function Pointers in C

I need a code that sorts an array of structs in ascending order by name or age using the bubblesort algorithm. I read all the elements and I understand the part of sorting. The problem is that I should only declare one bubblesort algorithm to be abl...
more »

2017-02-19 11:02 (3) Answers

sort Y according to sorted X

X = [2.3 4.1 1.9 5.8 6.7 7.5 9.3 15.0 1.6 3.1] Y = [1 1 1 1 2 2 2 3 3 3] length of both vectors is equal. I want to sort X by value, but then sort Y according to the same rearrangement that sort did to X. What's the easiest way to do this in Mat...
more »

2017-02-18 20:02 (2) Answers