I have data coming from the database in the form of a DataSet. I then set it as the DataSource of a grid control before doing a DataBind(). I want to sort the DataSet/DataTable on one column. The column is to complex to sort in the database but I was hoping I could sort it like I would sort a generic list i.e. using a deligate.
Is this ...
I have a two-dimensional array (of Strings) which make up my data table (of rows and columns). I want to sort this array by any column. I tried to find an algorithm for doing this in C#, but have not been successful.
Any help is appreciated.
...
I have a data set whose elements are displayed as rows in a DataGrid. The sort order for the rows changes in response to external events.
My initial thought was to store the rows as an ObservableCollection and resort the collection after updates. However I ran into two problems:
1) the ObservableCollection does not have a Sort() meth...
Which algorithm does the JavaScript Array.sort() function use? I understand that it can take all manner of arguments and functions to perform different kinds of sorts, I'm simply interested in which algorithm the vanilla sort uses.
...
I have several std::vector, all of the same length. I want to sort one of these vectors, and apply the same transformation to all of the other vectors. Is there a neat way of doing this? (preferably using the STL or Boost)? Some of the vectors hold ints and some of them std::strings.
Pseudo code:
std::vector<int> Index = { 3, 1, 2 ...
Sorting has been studied for decades, so surely the sorting algorithms provide by any programming platform (java, .NET, etc.) must be good by now, right? Is there any reason to override something like System.Collections.SortedList?
...
I have a few questions about whether or not it would be best to not use indexing.
BACKGROUND:
My records have a timestamp attribute, and the records will be inserted in order of their timestamps (i.e., inserted chronologically).
QUESTIONS:
If I DON'T use indexing is it typical for the database to insert the records in the order that ...
Four 2D points in an array. I need to sort them in clockwise order. I think it can be done with just one swap operation but I have not been able to put this down formally.
Edit: The four points are a convex polygon in my case.
Edit: The four points are the vertices of a convex polygon. They need not be in order.
...
In c# (3.0 or 3.5, so we can use lambdas), is there an elegant way of sorting a list of dates in descending order? I know I can do a straight sort and then reverse the whole thing,
docs.Sort((x, y) => x.StoredDate.CompareTo(y.StoredDate));
docs.Reverse();
but is there a lambda expression to do it one step?
In the above example, Stor...
I've been looking (without great luck) for the perfect reference card with all the basic sorting algos in C (or maybe in pseudo code). Wikipedia is a terrific source of info but this time I'm looking for something definitely more portable (pocket size if possible) and of course printable. Any suggestion would be much appreciated!
...
Is there a built-in way to sort a CArray in C++?
...
Exception: Failed to compare two elements in the array.
private void assignNames(DropDownList ddl, Hashtable names)
{
List<ListItem> nameList = new List<ListItem>();
if (ddl != null)
{
ddl.ClearSelection();
ddl.Items.Add(new ListItem("Select Author"));
foreach (string key in names.Keys)
{
...
Anyone have a good resource or provide a sample of a natural order sort in C# for an FileInfo array? I am implementing the IComparer interface in my sorts.
...
Hi!
Has anyone tested sorting with Selenium? I'd like to verify that sorting a table in different ways work (a-z, z-a, state, date etc.). Any help would be very much appreciated.
/Göran
...
Hi,
I am writing a Jython script to sort a list of URLs.
I have a list that looks like this:
http://www.domain.com/folder1/folder2/|,1
http://www.domain.com/folder1/|,1
http://www.domain.com/folder1/folder2/folder3/|,1
http://www.domain.com/folder1/|,1
http://www.domain.com/folder1/folder2/|,1
http://www.domain.com/folder1/folder2/|,1...
Hi Folks
I'm using a BindingList<T> in my Windows Forms that contains a list of "IComparable<Contact>" Contact-objects. Now I'd like the user to be able to sort by any column displayed in the grid.
There is a way described on MSDN online which shows how to implement a custom collection based on BindingList<T> which allows sorting. But ...
Does a comparison sort have to compare the A[i] largest and A[i+1] largest values? I think any comparison sort must, but I'm not sure. I've checked out mergesort, insertion sort, and quicksort and in each of them the A[i] largest and A[i+1] largest values have to be compared.
...
Using .Net how do I use the Sort method to sort an Array in reverse i.e. Z to A?
...
Specifically, I have a model that has a field like this
pub_date = models.DateField("date published")
I want to be able to easily grab the object with the most recent pub_date. What is the easiest/best way to do this?
Would something like the following do what I want?
Edition.objects.order_by('pub_date')[:-1]
...
I was using an XSL style sheet to do the sorting but it seems to be very slow. Is there a more efficient way?
It is a flat list of nodes, if I convert the nodes to an object and sort in a GenericList would it help?
EDIT I don't need the end result to be XML.
...