Category "sorting"

Natural ORDER in Laravel Eloquent ORM

How can i get 'natural order' in 'Eloquent ORM'? In table I have column 'text' (string). Normal order: Model::orderBy('text') 'value 1' 'value 12' 'value 23'

PHP-Sort array based on another array?

OK, I already got this question in stackoverflow but sadly it's in javascript - Javascript - sort array based on another array and I want it in PHP $data = ar

kattis problem ABC with python3. Works fine in local compiler, but when on submission getting partially right

I am trying the kattis problem ABC (https://open.kattis.com/problems/abc). It works fine on my local compiler, but when I submit, I can't pass all the cases. Ca

C++ sorting an array in ascending order Printing

Im trying to sort an array in ascending order and print it out and Im having trouble of where to put my cout in my code. for (int k=0; k<ARRAY_SIZE; k++) {

how do i sort data from a csv file numerically in python

I am writing a program that takes students scores from a csv file and needs to sort then highest to lowest score. the csv file looks like this: josh 12 john

How to improve Merge Sort speed in python

Yes, it is homework, but I ended up doing it in Java just to get it done, but now the python implementation is bothering me. I'm pretty sure I've implemented it

how do i sort data from a csv file numerically in python

I am writing a program that takes students scores from a csv file and needs to sort then highest to lowest score. the csv file looks like this: josh 12 john

how do you insert the value in a sorted vector?

ALL, This question is a continuation of this one. I think that STL misses this functionality, but it just my IMHO. Now, to the question. Consider following c

Sorting an array of integers in descending order and relating it to its corresponding string array

I am trying to output the names and corresponding scores in descending order. Having an array of strings and another array of integers, I am trying to relate th

Adding new data in excel and cannot be sorted or filtered

I have a column with 595 rows. Then I proceeded to add 20. (Note this excel sheet with the 595 entries was already in place before I started working on it. The

PHP usort() order in case of equality

In the PHP manual for usort(), it states: If two members compare as equal, their relative order in the sorted array is undefined. Also, A new sort al

python, sort descending dataframe with pandas

I'm trying to sort a dataframe by descending. I put 'False' in the ascending argument, but my order is still ascending. My code is: from pandas import DataFra

Return one newest instance of the mail, based on subject, from multiple subfolders

I have a search for items, in subfolders of the Inbox, based on subject line. I am trying to return the most recent mail and have been using the code: Items.Sor

comparator for sorting a vector contatining pointers to objects of custom class

By this question I am also trying to understand fundamentals of C++, as I am very new to C++. There are many good answers to problem of sorting a vector/list of

how to disable header clicks sort in ag-grid

As the ag-Grid sorting, setting the opt.enablesorting true, this will allow header clicks and show sort icons and sort within the grid. However, I prefer to s

Excel formula to take string value from cell and sort its characters in alphabetical order

Can you please help me to make Excel formula that takes string value from cell and sorts its characters in alphabetical order? Ex. original cell value: 'BACR'

array_map triple dimensional array [duplicate]

How do I run a array_map on a triple dimensional array? Where I want to "clear" the innermost array? It looks like this: Array ( [1] =&g

How to sort sheets within a spreadsheet in chronological order by date in google apps script

I am attempting to sort the sheets within my spreadsheet in chronological order. They are all dates in the same format (MM-dd-yyyy), but I am unsure of how to t

How to merge 3 sorted arrays into 1 sorted array in Big-O(N) time?

Trying to merge 3 arrays into one so that the final array is in order. Given int[] a = {1,3}; int[] b = {2,4}; int[] c = {1,5}; Merge the arrays so that t

How to sort a list with two keys but one in reverse order?

I was wondering what would be a Pythonic way of sorting a list of tuples by two keys whereby sorting with one (and only one) key would be in a reverse order and