ordering

iphone UITableView remove and sort row

Hi all, I have a uitableview that show my array of things, I wish add the possibility to remove some row sliding from right to left (like the mails) and the reordering moving the rows up or down.. what's the best way to do this? thanks ...

Reorder the results of a mySQL query using PHP without performing another query

I don't know if this is possible. I display a table of results and want to be able to order the table by any of the columns. I don't need help making such a table; I just need information about reordering the results of a query without repeating it with a different ORDER BY instruction. ...

Showing posts with a "featured" tag at the top using PHP in Wordpress

Hi all, I have a page in Wordpress that displays posts with a category of "newspaper" only. Now, The posts are ordered by descending order (I think, if that is the default), such that the newest is at the top. This is the code that I have: <?php $my_query = new WP_Query('category_name=newspaper&posts_per_page=-1'); ?> <?php if (have_...

jQuery ordering list items up and down not with drag and drop

Hi, I want a user to be able to reorder a list on a click event. I have set up a very basic jsFiddle here: http://jsfiddle.net/8vWXZ/2/ So in this example i would like to move the clicked li item and its contents to the position above in the DOM. I suppose strictly speaking it is being moved down in the index of li items. This is g...

Are there any resources on the correct ordering of Apache .htaccess directives?

I was tweaking my .htaccess file for the first time, and ran into the problem where my custom 404 page would not load because I placed the Options -Indexes directive after the ErrorDocument 404 directive. Seeing as ordering directives willy-nilly can easily break the intended behavior, is there any online resource that details what the c...

Problem sorting a list inside a databound object.

I have a List<ColumnList> ColumnListLists which has a binding source (bsLists) attached to it. ColumnList has a List<Column> inside of it. I have a binding source attached to the current of bsLists pointing at that inner list. Confused yet? here is some code that may help. public class ColumnList { ... public string Name { ge...

How do I order a sql datasource of uniqueidentifiers in Linq by an array of uniqueindentifiers

I have a string list(A) of individualProfileId's (GUID) that can be in any order(used for displaying personal profiles in a specific order based on user input) which is stored as a string due to it being part of the cms functionality. I also have an asp c# Repeater that uses a LinqDataSource to query against the individual table. This r...

MySQL row number

Hi, say I have a MySQL query, for example SELECT id, name, surname FROM employees ORDER BY id the result woud be id name surname 1 Peter Smith 2 John Banjo ... 1384 Will Levenstein While this is an ordered query, I can always assume (as long as I don't change the table) that John Banjo will come out second...

Python: How to custom order a list?

Obs: I know lists in python are not order-fixed, but think that this one will be. And I'm using Python 2.4 I have a list, like (for example) this one: mylist = [ ( u'Article', {"...some_data..."} ) , ( u'Report' , {"...some_data..."} ) , ( u'Book' , {"...another_data..."} ) , ...#continue ] This variable...

Adaptive Maps in Scala (or Java) Preserving Insertion Order

I would like to find and reuse (if possible) a map implementation which has the following attributes: While the number of entries is small, say < 32, underlying storage should be done in an array like this [key0, val0, key1, val1, ...] This storage scheme avoids many small Entry objects and provides for extremely fast look ups (even th...

MySQL order by question

I got items rated by both ratings, and use an ORDER BY key to order them by positive, but with an example table: //(item)-(pos)-(neg): item 1 - 50 - 200 item 2 - 24 - 0 item 3 - 15 - 12 But item 1 is really less rating than the others, how would I fix this? ...

Diacritics alphabetical ordering in C#

Hello! I want to know how do you perform a reliable alphabetical ordering (for a listbox) of people's full names with the diacritics of the language in C sharp? Thanks in advance. Q: So you just want to treat diacritics as the "original" letter? (eg: João is the same as Joao)? – NullUserException A: I want to treat them as they should...

Trouble sorting JSON object

I have a JSON object collection: var Gallery = [ { "Order": 1, "Page": 1, "LargeImage": "large.jpg", "ThumbImage": "thumb.jpg" }, { "Order": 2, "Page": 1, "LargeImage": "large2.jpg", "ThumbImage": "thumb2.jpg" }]; I want to each over this object but after the collection is sorted on "Order". What is the best way to do this? ...

Jquery Ordering img position

I am trying to order my images on page like an hexagon.I found solution for this on java and now I am trying to implement it on Jquery. Firstly I crated my photo list div element <div class="photoList"> <?php $categories = find_category(); foreach($categories as $category): ?> <div id="userList"> <img id="<?Php echo $category['cat...

MySQL retireive rows in sorted order on a very large table

Hi, I have a MyISAM table T with the following schema: f1 (integer unsigned not null) f2 (integer unsigned not null) This table has an index on f2 and it currently contains 320 million rows, and is expected to grow at the rate of about 200,000 rows once a week. I perform the following query on this table: SELECT DISTINCT T.f1 FROM T ...

Netflix like ordering logic

I'm trying to devise ordering logic for a service similar to Netflix. There are two methods to create an order; there are two major factors that determine if an order should be placed. It's impossible to write this question without considerable explanation, so bare with me. The first way in which an order can execute is when someone ret...

Oracle SQL returns rows in arbitrary fashion when no "order by" clause is used.

Maybe someone can explain this to me, but when querying a data table from Oracle, where multiple records exist for a key (say a customer ID), the record that appears first for that customer can vary if there is no implicit "order by" statement enforcing the order by say an alternate field such as a transaction type. So running the same ...

in C#, how do I order items in a list where the "largest" values are in the middle of the list

I have been stumped on this one for a while. I want to take a List and order the list such that the Products with the largest Price end up in the middle of the list. And I also want to do the opposite, i.e. make sure that the items with the largest price end up on the outer boundaries of the list. Imagine a data structure like this.. ...

Reversing order of items in DOMNodeList

Hello I'm making RSS reader and I'm using DOM. Now I stuck, trying to reverse the order of the items in the DOMNodeList. I can make it with 2 cycles - one to make it as array and one for rsort(). Is there any way to reverse the order in the DOMNodeList or must be done with "the array way"? ...

possible problems when re-locating ad banner in dom by javascript?

Hello :) I am designing a layout that looks like: == header == == ad banner == == content == == footer == however the source code order is: == content == == header == == footer == == ad banner == the idea and goal of all that is load ad code in the very end so that the page doesnt get slowed down by external loaded javascripts ...