order

Sorting lists by date and then order by latest

Hi, I have a list and would like to sort by date then order by latest date first. The code below sorts by date: allFeeds.Sort(delegate(SimplifiedFeedItem p1, SimplifiedFeedItem p2) { return p1.PublishDate.CompareTo(p2.PublishDate); }); allFeeds.ForEach(delegate(SimplifiedFeedItem p) ...

SQL Order Alphabetically without preceding zeros for numbers less than 10

Is it possible to order alphabetically in mySQL in the following fashion: A1 A2 A3 A5 A10 A11 A20 A23 A24 Unfortunately the order that I am getting is ordered as seen below here. Notice how any number before A10 aren't grouped together? A1 A10 A11 A12 A2 < A2 A20 A23 A24 A3 < A3 A5 < A5 Note: These alphanumeric strings are a...

First 6 from a foreach .net 2.0

Hi I need to sort a list then take the first 6 in .net 2.0 for example the code below sorts but does not take the first 6 how can i do this? allFeeds.Sort(delegate(SimplifiedFeedItem p1, SimplifiedFeedItem p2) { return -p1.PublishDate.CompareTo(p2.PublishDate); }); allFeeds.ForEach(delegate(SimplifiedF...

File compilation order in VS2008

I would like to explicitly set the order of compilation of C# files in VS2008. Order in the project file, file naming seems to have no effect. Situation: I have dozens of partial classes, each split over two files: 1) The file containing the auto-generated parts and 2) the file containing the manually written parts. The code generator ...

WordPress: PHP: How to perform a nested sort within a category for the desired results.

There is a plugin that I am trying to adapt for my meta_tags for use with WordPress. It is called Categories by Title by http://www.mikesmullin.com. What I am trying to achieve is a nested sort. I have three meta_keys. A selection-no, release-month, and release-year. I would like to sort posts within their category by release-year (as...

MySQL negative limit?

I am doing easy web based chat so I need to get (for example) 30 latest messages from a MySQL database. That doesn't make any problem but how can I take the data in up side down order? I mean, the oldest message is the first. I have to take latest 30 records by added time. EDIT: Thanks for the answers, but... ORDER BY added DESC LIM...

How to compare data in session with PHP?

The $_SESSION has the following data array. Array ( [totalprice] => 954 [cart] => Array ( [115] => Array ( [name] => MÅNESKINN [price] => 268.00 [count] => 1 ) [80] => Array ( [name] => DELFINLEK [price] => 268.00 [count] => 1 ) [68] => Array ( [name] => OPPDAGELSEN [price] => 418....

mysql - Order by relevance and views

I have seen there are a lot of 'order by relevance' posts on here... I have worked that part out... What I would like to achieve is search results that are first ordered by relevance and then by views. For example if I searched for 'dog' and my results both had the same level of relevance to 'dog' then I would like it to order them by ...

How to order properties in a declaration block?

I know there's no real right or wrong answer. I'd just like to hear from CSS developers how you like to order your properties and what is your reasoning behind your preference. Thank you very much. ...

C++ expression evaluation order

i ran into a curious problem regarding evaluation of expressions: reference operator()(size_type i, size_type j) { return by_index(i, j, index)(i, j); // return matrix index reference with changed i, j } matrix& by_index(size_type &i, size_type &j, index_vector &index) { size_type a = position(i, index); // find position of i using...

as3, doing tasks in certain order

Hey, I have a simple function going here. import fl.transitions.Tween; import fl.transitions.easing.*; function goBack (e:MouseEvent):void{ var backAlpha:Tween = new Tween(MovieClip(parent).blueOverlay, "alpha", Strong.easeOut, 1, 0, 2, true); MovieClip(parent).gotoAndStop("home"); } btnBack.addEventListener(MouseEvent.CLICK, goBack)...

Order of values retrieved from a HashMap

Hi all, I am trying figure out the order in which the values in a HashMap are/can be retrieved. Heres the code snippet for the same. import java.util.HashMap; public class HashMapExample { public static void main(String[] args) { HashMap<Integer, String> hashmap = new HashMap<Integer, String>(); hashmap.put(1, "appl...

Magento: After ordering configurable product, its canceled because its out of stock

Hello, my problem is: i have a product with simple products as childs. (maybe tshirts whith size S-XL and some colors) Now if i order one of this, it is canceled with the order-confirmation email. I think its a problem with the stock but i dont know. There are 99 items in stock of every kind and all are activated and ready to deliver....

Python order of execution

I was wondering if Python has similar issues as C regarding the order of execution of certain elements of code. For example, I know in C there are times say when it's not guaranteed that some variable is initialized before another. Or just because one line of code is above another it's not guaranteed that it is implemented before all th...

How to get the order of files/dirs in the Explorer?

I am programming in C++, Windows I wonder if I can get the order of files in a certain folder. the order of FileFind seems by alphabetic order. For example. I can drag folders/files in a folder. and if I open it again, the order will remain. I wish I can get this order. Many Thanks! Sorry for not stating my question clear enough. I tho...

Ordering and limit

In a table containing cities I want to get the five biggest cities and order them by name: SELECT * FROM cities ORDER BY population DESC LIMIT 5 That gets me the biggest cities ordered by population, but I want the same cities ordered by name. Is there an easy way to do this (without turning to a subquery or sorting the cities afterwar...

Core Data Ordered Join Table Efficiencies

I have a complex core data mapping in my app, simplified to the relevant pats to this question here in this image: My question is how to get sorted Foo's efficiently. Let's say that in one of my views, I have a sectioned table with every foo in it. The sections are the categories. Each section of foo (in a category) has an ordering...

How to retrieve ordering information from IQueryable object?

Let's say, I have an instance of IQueryable. How can I found out by which parameters it was ordered? Here is how OrderBy() method looks like (as a reference): public static IOrderedQueryable<T> OrderBy<T, TKey>( this IQueryable<T> source, Expression<Func<T, TKey>> keySelector) { return (IOrderedQueryable<T>)source.Provider.Crea...

LINQ context SubmitChanges

Regarding the SubmitChanges order (Insert, Update, Delete), is there a way to change that order? I need to have the Deletes executed first, any updates, then any new inserts. I have a datagrid where the user can do all add, changes and updates and submit. Since each grod row must have a unique item chosen in it (via a dropdown), it's pos...

Sorting SQL row output per an arbitrary order?

So, in my database, I store musical instrument names (and various other attributes). Let's say id is the primary key, and name is a unique key. In a PHP script, I select items by their instrument class, like so: $name = mysql_real_escape_string($_POST['name']); $row = mysql_fetch_row(mysql_query("SELECT * FROM `instruments` WHERE name ...