Skip to main content
Filter by
Sorted by
Tagged with
-8 votes
0 answers
75 views

How can I sort a dictionary that has string as its key and an int as its value by its values? I want to have a dictionary that counts how many times a word appears in a string, and I want to have the ...
IdoSC's user avatar
  • 11
1 vote
1 answer
59 views

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 ...
Dung Tran's user avatar
-3 votes
0 answers
78 views

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, ...
AV_Dev's user avatar
  • 1
Advice
1 vote
8 replies
131 views

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 ...
Stanislav Matveyevich's user avatar
3 votes
3 answers
199 views

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 ...
Rishabh Kumar's user avatar
-4 votes
0 answers
140 views

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 ...
ToridFartFart's user avatar
Best practices
0 votes
0 replies
30 views

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 ...
chuackt's user avatar
  • 175
0 votes
2 answers
75 views

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 ...
Neptunium-Eater's user avatar
Tooling
0 votes
4 replies
109 views

I would like to compare unordered lists / objects with an indeterminate depth in javascript like: const t = { key: [ { subKey: [ { subSubKeyOne: 1, subSubKeyTwo:...
Ratinax's user avatar
  • 41
1 vote
0 answers
143 views

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++...
nastyAA's user avatar
  • 11
Advice
0 votes
3 replies
100 views

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 ...
bauerjlb's user avatar
Advice
0 votes
0 replies
39 views

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 ...
Peter Krauss's user avatar
  • 14.1k
0 votes
2 answers
174 views

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 ...
Bennie Coetzer's user avatar
0 votes
1 answer
69 views

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 ...
Stephanie Gillis NipponQ's user avatar
3 votes
3 answers
187 views

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.)...
chickentaco's user avatar
1 vote
1 answer
46 views

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 ...
Petr 's user avatar
  • 23
1 vote
2 answers
106 views

I have tuples in the form (Status and priority) [State,prio] States are defined so: enum State { A = "A", B = "B", C = "C" ... } Now i want to sort an ...
stot's user avatar
  • 1,137
3 votes
0 answers
129 views

I implemented a few lazy sort & merge functions that are used heavily in my ReBAC authorization library, EACL, to lazily "merge" & deduplicate ~1M datoms emitted from Datomic's d/...
Petrus Theron's user avatar
2 votes
2 answers
142 views

Wikipedia and other textbooks reference binary selection sort's asymptotic worst-case time complexity to be O(n^2), usually justifying this with any extra computation caused by swaps. I don't ...
PostalCat's user avatar
0 votes
1 answer
115 views

I added a new column of completed date in the woocommerce order list page using the code here. The new column shows sorting buttons (up/down arrows) properly but when clicked, seems like it sorts on ...
FUFY's user avatar
  • 19
0 votes
0 answers
51 views

I have a Pinia store defined like this: export type Era = { id: number name: string start_year: number end_year: number item_count: number } const settingStore = { eras: ref([] as Era[])...
Steve Bennett's user avatar
1 vote
1 answer
136 views

I am trying to sort this list of pairs so they are ordered by y decreasing as the primary factor and x increasing as a tie breaker. [['0', '0'], ['0', '1'], ['1','1'], ['2','1'], ['0', '2'], ['1','2'],...
Grayson Howard's user avatar
0 votes
1 answer
70 views

I have a file that includes a variety of reference sheets and sheets that are only used at the end of the academic year plus a tab/sheet for individual students. Students come and go so I need the ...
Charity's user avatar
  • 17
1 vote
2 answers
147 views

This is what I am currently using for my code. Private Sub CommandButton1_Click() ' Sort button and save a backup copy Range("B1").Sort Key1:=Range("b3"), Order1:=xlAscending, Key2:...
ham fam's user avatar
  • 95
-2 votes
1 answer
130 views

I’m experimenting with sorting large arrays of unique integers in JavaScript and came up with a simple approach. I’m curious if it’s a recognized pattern or if there are potential pitfalls I might be ...
Aaron's user avatar
  • 1
0 votes
2 answers
98 views

How would I be able to make this function work for two separate tables within the same sheet? var ss = SpreadsheetApp.getActiveSpreadsheet(); var sheet = ss.getSheetByName("Leaderboard"); ...
Daniel Ostrosky's user avatar
2 votes
1 answer
95 views

CONTEXT Let's say I have df, which consists of a column of delimited strings that I would like to sort. import pandas as pd df = pd.DataFrame({'sort_me':['foo; bar','foo; bar','bar; foo']}) df ...
bismo's user avatar
  • 1,645
1 vote
2 answers
148 views

I have a RecyclerView list of CardViews for tasks, etc. Some of the CardViews have a due date attached to them, others have no due date. I want to show the CardViews with due dates on top of the ...
AJW's user avatar
  • 1,587
-2 votes
1 answer
129 views

I have a complex SQL query that is not sorting the results properly. It is supposed to sort the list of questions in order of the ORDERS column of the Questions table, but instead, it is always ...
user1066074's user avatar
3 votes
0 answers
153 views

I am an inexperienced coder, and took up the challenge to make a sorting algorithm to sort lists. I see people using the mod operator, and didn't like it, so I am using strings to make it a little ...
easterman's user avatar
1 vote
2 answers
101 views

This is a simple class (Person) with a shared list (Persons). My question concerns the possibility of improving the code in the method SortByPropertyName. It works as it is but, it would more handy if ...
Polis Rabotas's user avatar
-2 votes
1 answer
119 views

I was tasked to write up a C program to sort an array using quicksort, without using recursion. Original array: -25, 87, 12, -6, 91, 3, -48, 70, 19, -33, 55, 2, -18, 99, 41, -72, 63, 15, -90, 27, 8, -...
Thunder's user avatar
  • 21
-2 votes
1 answer
137 views

I have a list of pathnames (dirname+filename), sorted by filenames. How to use bisect if I want to find a filename in this list ? Example : import os, bisect lst=[] for (dp, dn, fn) in os.walk(rep): ...
Eric H.'s user avatar
  • 2,279
0 votes
1 answer
41 views

Ive got this conceptual problem I've been looking at. Have a collection of objects I need to sort by one or the other field but theres should in ordering also be taken account that objects are chained ...
Jens-Konrad Preem's user avatar
7 votes
3 answers
441 views

I am trying to do a somewhat complicated group and sort operation in pandas. I want to sort the groups by their values in ascending order, using successive values for tiebreaks as needed. I have read ...
Jessica's user avatar
  • 1,813
0 votes
2 answers
73 views

I am rendering the table using angular primeNg based on a condition. All the headers and values are coming dynamically. The table data is getting displayed properly. However the sorting is not working....
Raghavi's user avatar
  • 325
1 vote
1 answer
133 views

I'm a beginner at R and tidyverse. I'm looking for a fast solution using mutate(across(c(col1, col2, ...), ~ create factors with levels sorted by alphabetical order))) the base function factor() ...
jerome langlois's user avatar
4 votes
2 answers
155 views

I have a table in Postgres (14) that is used like a queue with FOR UPDATE SKIP LOCKED queries. It was missing an index, but since any rows are usually processed quickly that never became a problem. ...
Tamas Kozma's user avatar
0 votes
0 answers
41 views

I have an InvoiceTable component and a custom editable invoice field. I am using Formik, and I am calculating an initialSortedData before Formik is initialized. Once Formik is initialized, all data, ...
Usman Khalid Mian's user avatar
0 votes
0 answers
30 views

I have an index of documents that consist of some data that may exist differently in the so-called draft or release versions of the document. In my example mapping, I have only the docType as a value ...
Karsten Gabriel's user avatar
3 votes
0 answers
173 views

Given an array already sorted in Dutch flag, i.e., it meets following requirements: Each element within nums[:i] is smaller than mid. Each element within nums[i:j] equals mid. Each element in nums[j:]...
PkDrew's user avatar
  • 2,301
1 vote
1 answer
34 views

I'm trying to sort phrases such as the following: a12_b7 a12_b11 a5_b3 a5_b30 a12_b10 using the numbers following the letters, lexicographically. For the example above, I expect the result to be: ...
einpoklum's user avatar
  • 137k
-1 votes
1 answer
63 views

I want to sort lines with time format strings using shell command. Shell shall be a common linux shell. Example input: results/fn_a:# Generated on: Mon Jul 21 17:20:48 2025 results/fn_b:# ...
Gert Gottschalk's user avatar
0 votes
2 answers
128 views

I have a dictionary with lists of datetime as value: month_a = [8,9,10] day_a = [13,12,15] month_b = [8,9,10] day_b = [13,11,13] dt_a=[] for m,d in zip(month_a, day_a): dt_a.append(datetime....
Wenjie Yu's user avatar
  • 101
1 vote
1 answer
120 views

My DBGrid is connected to a Datasource / ClientDataset / Provider / ADOQuery I sort the grid with this code, which seems to work well procedure TDataModuleBase.SortClientDataSet(AscendingFields, ...
GuidoG's user avatar
  • 12.3k
1 vote
3 answers
80 views

I am trying to load images into an html document using the file reader API, and then sorting them alphabetically. The code I have written loads the images into the div just fine, however it doesn't ...
Bobby Jones's user avatar
1 vote
2 answers
102 views

I wanted to implement the Merge Sort algorithm, but I am having trouble with the borrow checker rules. The compiler gives me the hint: cannot borrow *lst as immutable because it is also borrowed as ...
Finn's user avatar
  • 105
0 votes
0 answers
42 views

I'm using MUI X's DataGrid in a React project and I want to sort a time column that contains either a date string (e.g., "24 September 2024, 10:48 am") or the literal string "untouched&...
Maulik Bhalani's user avatar
0 votes
1 answer
78 views

GitHub link: https://github.com/IgorArnaut/Django-ListView-Pagination-Search-Sorting-Issue I have an issue with the ListView. I have pagination, side form for filtering and a form with select for ...
IgorArnaut's user avatar
0 votes
0 answers
59 views

The code is as follows, using key function to count the number of times each element appears in the list: input_list = list('aaddccdc') input_list.sort(key=lambda i: (-input_list.count(i), ord(i))) ...
linyr's user avatar
  • 17

1
2 3 4 5
1559