I am working on converting a plain tableview to a sectioned tableview. I would like the section titles to be the first letter for the items in the section.
This is what I have so far in my titleForHeaderInSection method:
NSSortDescriptor *sortDescriptor;
sortDescriptor = [[[NSSortDescriptor alloc] initWithKey:@"Name"
asce...
Hi, can anyone help me with T-SQL to sort this table
ID Comment ParentId
-- ------- --------
3 t1 NULL
4 t2 NULL
5 t1_1 3
6 t2_1 4
7 t1_1_1 5
to look like this
ID Comment ParentId
-- ------- --------
3 t1 NULL
5 t1_1 3
7 t1_1_1 5
4 t2 NULL
6 t2_1 4
Kind regar...
Hi Friends,
test.xml
<ServiceHotel>
<AvailableRoom>
<HotelOccupancy>
<RoomCount>1</RoomCount>
<Occupancy>
<AdultCount>2</AdultCount>
<ChildCount>1</ChildCount>
</Occupancy>
</HotelOccupancy>
<HotelRoom>
<Board>AFULL BOARD</Board>
<RoomType>DOUBLE / TWIN STANDARD</RoomType>
...
I have a long list (1000+) of hex colors broken up in general color categories (Red, Orange, Blue, etc). When I show the list of colors in each category I need to show them in order of shade. i.e. light red first and dark red last.
What would the algorithm be to do this? (googling has failed me)
...
I am looking to do a nested sort with a matrix in MATLAB. Say my matrix looks like this:
[b a;
b c;
a c;
a a]
I would like to first sort by the first column and maintain that sort, then sort by the second column. The result would be:
[a a;
a c;
b a;
b c]
How would it be done?
...
I have two arrays which I'm trying to merge based on the date of them. Here is what the arrays look like:
$a[0][0] = '11/15/08';
$a[0][1] = '50';
$a[1][0] = '11/20/08';
$a[1][1] = '75';
$a[2][0] = '01/04/09';
$a[2][1] = '23';
$a[3][0] = '01/09/09';
$a[3][1] = '92';
and
$b[0][0] = '01/04/09';
$b[0][1] = '30';
$b[1][0] = '01/05/09';
$...
Related/possible duplicate: http://stackoverflow.com/questions/1263943/why-do-i-get-uninitialized-value-warnings-when-i-use-datemanips-sortbylength
This block of code:
my @sorted_models = sort {
UnixDate($a->{'year'}, "%o") <=>
UnixDate($b->{'year'}, "%o")
} values %{$args{car_models}};
kept generating the following err...
I have a Silverlight 2.0 DataGrid that contains a list of items that needs to be refreshed in an interval to display the up-to-the-minute information. There are items in this grid that may be added and may be removed while the screen is being displayed to the current user. For Example:
If grid looks like the following, then after a m...
I need to quickly save a re-ordered sequence back to my items' integer sortOrder columns.
The simple renumber-by-one approach can be slow - if last item moved to first, all N rows are modified. A multi-row update statement would let database do the work, but I'd like to explore smarter ways, like making sortOrder floating point except...
I have an object from my domain model that has a child object. How can I use a criteria query to order based on a property of the child?
For example:
class FooType
{
public int Id { get; set; }
public string Name { get; set; }
public BarType Bar { get; set; }
}
class BarType
{
public int Id { get; set; }
public st...
I have four arrays all containing related data,
Data Example:= (Array 1 | Array 2 | Array 3 | Array 4)
R.E.M.|In Time: The Best Of R.E.M. 1988-2003|album:6G5BGhEiLvck3kvKpSYw2y|Rock
Nick Drake|Family Tree|album:2euLAROPTmXDIDuU3qVMkf|Folk
Sonic Youth|Dirty|album:0QPkL6ap8riBoQ5xN8YDR3|Noise Rock
I would like to sort all arrays; filt...
I want to find the easiest way of finding the hash values
City {
city1 -> Street1 -> [ high_street , 2]
street2 -> [ low_street , 2]
city2 -> Street1 -> [ high_street1 , 2]
street2 -> [ low_street2 , 2]
city3 -> Street1 -> [ high_street1 , 1]
street2 -> [ low_street2 , 1]
}
This structure is sor...
UPDATE: I managed to re-work my code from scratch, and here is what I came up with. It works, but the only problem is speed. Is there any way that I can speed up my current set up using better memory management? If so, what would be the best approach?
#include <iostream>
#include <vector>
#include <math.h>
using namespace std;
void pri...
In a Flex webapp, is there an easy way to go about applying a sort to the children of an XML element, based on the children's attributes? Example follows below:
XMLListCollection:
<a anotherProp="ABCDE">
<e prop="AB">1</element>
<e prop="BC">2</element>
</a>
<a anotherProp="FGEH">
<e prop="HF">3</element>
...
How would I sort the following CSV file using PHP? I would like to sort by last name. Do I use regex somehow to get the first letter in the last name? Any help is appreciated
Here is an excerpt of my CSV file - with a ";" delimiter between names and addresses
John C. Buckley, M.D.;123 Main Street, Bethesda MD 20816
Steven P. Wood;34...
The common wisdom says that for small enough arrays insertion sort is the best. E.g., Timsort uses (binary) insertion sort for arrays up to 64 elements; from Wikipedia:
Some divide-and-conquer algorithms such as quicksort and mergesort sort by recursively dividing the list into smaller sublists which are then sorted. A useful optimi...
Hello everybody.
I'm referring to this old post:
http://stackoverflow.com/questions/344737/sorting-xml-nodes-based-on-datetime-attribute-c-xpath
I put my question today (it is visible in the bottom) but I'm afraid it won't be visible since the post is old... so I'm asking as new question...
I tryed a piece of code by Timothy Khouri bu...
I have Googled ASP Classic implementations of the natural sort algorithm to no avail. Best I was able to find was from Dave Koelle, which was from a question on SO. Issue is that since I need to implement this algorithm in ASP Classic, I don't have access to certain functions such as
Collections.sort(your list, new AlphanumComparator())...
I'd like to be able to sort a file but only at a certain line and below. From the manual sort isn't able to parse content so I'll need a second utility to do this. read? or awk possibly? Here's the file I'd like to be able to sort:
tar --exclude-from=$EXCLUDE_FILE --exclude=$BACKDEST/$PC-* \
-cvpzf $BACKDEST/$BACKUPNAME.tar.gz \
/etc...
Hi there,
Im using entity framework 1.0 and trying to feed out a Gridview with a objectdatasource that have access to my facade. The problem is, that it seems to be particulary difficult and haven't seen anything that realy do what i want it to do on the internet.
For those who know, a gridview feeded with an objectdatasource, it can'...