77,937 questions
1
vote
1
answer
59
views
Angular Material: Programmatically setting MatSort does not update UI sort arrow
I'm working with an Angular Material table (mat-table) that has sorting enabled via matSort. Sorting works perfectly when I click on the column headers (mat-sort-header).
Now, I want to trigger the ...
-3
votes
0
answers
78
views
Tournament Sort Correction [closed]
Im making a presentation as homework about it, there's barely any information of it, i been working with chatgpt and some youtube video, my question is, whenever i write same numbers, for example, ...
Advice
1
vote
8
replies
133
views
Making a palindrome out of a string of random letters (or any given value type inputs)
Found this code exercise on W3R. Been trying to figure out the relationship between the outer and inner loop (i and j), but can't seem to wrap my head around it. If anyone could walk me through this ...
3
votes
3
answers
199
views
How to sort a dictionary of word counts by value while preserving the original key order? [duplicate]
I am trying to count word frequencies in a text and then sort them in descending order of frequency. So if two words have the same frequency, they should remain in the same order they first appeared ...
-4
votes
0
answers
140
views
How do you make an algorithm that'll find the shortest way to sort a sequence of numbers by applying function that converts to closest lower prime? [closed]
Imagine you get sequence of integers:
[a1 a2 a3 ... an]
where:
1 <= a <= 10^6
1 <= n <= 10^6
You are given a function f(x) that can change a number to the closest lower prime number, or ...
Best practices
0
votes
0
replies
30
views
How to effectively implement sorting in universe basic programming language
The current version of universe programming language I working on does not cater for SORT function. For certain application , there a need read from a record file which contains over 100 items ...
0
votes
2
answers
76
views
(Shell Sorting) Applying Ciura's gap sequence (or some other optimal sequence formula)
I've been trying to teach myself various sort methods just for the sake of being able to use them in the future and right now I've been teaching myself about shell sorts. I understand the way shell ...
Tooling
0
votes
4
replies
109
views
Compare unordered lists / objects javascript
I would like to compare unordered lists / objects with an indeterminate depth in javascript like:
const t = {
key: [
{
subKey: [
{
subSubKeyOne: 1,
subSubKeyTwo:...
1
vote
0
answers
143
views
Quadratic behaviour examples generating of libc++ sort implementation
I'm studying sorting algorithms at the moment and I have one question that is actually quite well-known but still I can't find a full answer that is comprehensive enough for me. So, the topic is libc++...
Advice
0
votes
3
replies
100
views
Java : getting sorted order of Objects
I have an List of Objects that implements the Comparable Interface that I want to sort. I do not want the original List returned sorted, nor do I want an new List returned in sorted order. What I ...
Advice
0
votes
0
replies
39
views
How to show the H3 indexes order?
I would like to generate H3 grid with labels into its hexagons, following the index order and drawing its curve.
____
Note. This illustration is from another grid system, but I would like similar ...
0
votes
2
answers
174
views
Cannot get TList<>.Sort() to work in Delphi 11 FMX
I have been trying to sort a collection of objects. While I have seen many promising solutions, my compiler simply won’t accept them (error message in procedure GenReorderSpeciesList). I am using ...
0
votes
1
answer
69
views
How to filter data into another spreadsheet based on two values in the same column in google sheets
I'm making a book spreadsheet where I'd like formats to filter into a spreadsheet for physical books (Hardcover and paperback) and another for Digital books (ebooks and audiobooks). I can only seem ...
3
votes
3
answers
187
views
How do I cluster/group duplicate customer objects in my list based on email OR mobile in C#
For my current project in C#, I am tasked with fetching customer details from a data source, 'cleansing' said customers (making sure the name is capitalised correctly, mobile formatted correctly, etc.)...
1
vote
1
answer
46
views
Prisma - Sorting by function applied on a column
I want to use a function in my orderBy clause. To my great surprise I can't find a way in the official documentation to do this without executing raw SQL in Prisma. This is similar to what Python or ...