Category "sorting"

How to sort entity model by column name of display model in C# .NET Core using LINQ?

I have a page that displays all users in the table. The front end uses a class that is different from the database model. public class UserDetailsViewDto {

Sort object keys/entries in specific order

I have an object like this: const data = { val5: 1231, val3: 1232, val1: 1233, val2: 1234, val4: 1235, }; And its has to be sorted by it keys but in

JavaScript sorting of an RGB array

This is the task: Colors have to be ordered in such way: Higher Red value first; if the same then: Higher Green value first; if the same then: Higher Blue val

How do I sort a material table with favorites on top?

I wanted to sort a mat-table (or MatTable for the search engine) in Angular with the "favorite" items on top. I want the favorite items to always be the first i

Reverse EBCDIC sorts numbers before letters in ROW_NUMBER function

So I do have following SQL select SELECT FOO.*, ROW_NUMBER() OVER (ORDER BY KEY ASC) AS ROW_NUMBER FROM FOO Key is of the type VARCHAR(12). I wonder why the h

Why is Merge sort better for large arrays and Quick sort for small ones?

The only reason I see for using merge sort over quick sort is if the list was already (or mostly) sorted. Merge sort requires more space as it creates an extra

regex - Filter out year from a date string in an array of objects

I'm trying to filter out year out of this array of objects (in React) 2021-12-20, 2021-12-21, 2021-12-22, (...) 2022-01-28, 2022-01-31, 2022-02-01, It has 100

Minimum moves to transform a list so that each element equals its own frequency

Given a sorted array like [1,2,4,4,4]. Each element in the array should occur exactly same number of times as element. For Example 1 should occur 1 time, 2 shou

Best way to sort BOTH prefix and suffix with custom sorting

So I have a list of codes, something like: (I.-) (I.+) (I.0) (B.+) (B.0) (B.-) ... (No value) (N/A) I was able to sort them but we have a "custom requirement" t

Sort array of objects by string property value

I have an array of JavaScript objects: var objs = [ { first_nom: 'Lazslo', last_nom: 'Jamf' }, { first_nom: 'Pig', last_nom: 'Bodine' },

Elastic search script sort text as Number

I have an Elastic search field ID which is a Number but set in the index as a "text". I cannot change the index because of the huge volume of data to reload. I

All combination of 2 lists in ansible

I have 2 variables as a list in ansible host_list: - 1.1.1.1 - 2.2.2.2 port_list: - 443 - 80 and I want to get the 3rd variable as a list of l

Recycler View List Sort position saving notepad app

In my program I added code to move the list items around but for example if I move shopping list above Test 123 and fully close the app the positioning resets

What determines the item order when converting a set to a list?

I know there are several similar questions, but I haven't found one yet that talks about what I would like to know. If this is a duplicate, please point it out.

Double lexicographic sorting of binary (0-1) matrices

I want to sort a binary matrix so that its columns and rows are both in lexicographical order by switching rows and columns. In other words, I need a double-lex

Convert a Text File into an Array, without the '/n'

I am trying to code a sorting code, very basic, using the python "(sorted)" method. For this code, I am trying to import the words to be sorted by using a text

Shuffle nested arrays in Javascript

I'm trying to sort multiple arrays within an array (which also has to be shuffled). A simplified example is: let toShuffle = [ [1, 2, 3, 4, 5], [9, 8, 7, 6, 5],

Sort an array except one element in JavaScript

I have an array and I am sorting it but I need to sort everything except one element of my array. My array is: var Comparison = [ {key: "None", value: "No

TYPO3 10 Exbase bidirectional m:n relation sorting

In my extension I have two models team members (parent) and expertise (child). The bidirectional relationsship between the two models is stored in an intermedia

Grouping/Clustering Rectangles

I have a list of shapes (list of points) e.g. rectangles which I want to group/cluster together. This is what I have: And this is what I want to achieve. How