ordering

C++ destructor & function call order.

Suppose I have the following snipplet: Foo foo; .... return bar(); Now, does the C++ standard guarantees me that bar() will be called before foo::~Foo() ? Or is this the compiler/implementation's choice? Thanks! ...

Project Order in Visual Studio Solution

In Visual Studio 2008, what determines the order in which projects appear within a solution folder? It's not alphabetical order, nor is it build order. I cannot find any way of altering the order in which projects are being listed. I've tried removing my .suo file, as well as moving things about in the .sln file. Neither had any effect....

Ordering data results in columns instead of rows

Hello, I have a MySQL table ordered like this : | user_id | day | time | job | |--------------------------------| | 1 | 2455251 | 08 | T23 | | 1 | 2455252 | 14 | T14 | | 1 | 2455253 | 22 | T27 | | 2 | 2455251 | 06 | T16 | | 2 | 2455252 | 12 | T64 | | 2 | 2455253 | 20 |...

Scala Enumeration values not ordered?

The scala docs say that Enumeration.Val is ordered, however I get inconsistent behavior when when I try to enforce type restrictions on enumeration values requiring them to support ordering: object Dogs extends Enumeration { val Sam, Tom, Rover = Value } def doSomething[A <% Ordered[A]](a : List[A]) : Unit = { println(a.sortWit...

Remove dinamically an ordering to the result set in org.hibernate.Criteria

I have a Criteria with: Criteria criteria= session.createCriteria(Libro.class).addOrder( Order.asc("ID") ); However, when I want to get the rowcount fail: criteria.setProjection(Projections.rowCount()); because there is an order by in the query. How to remove dinamically the ordering in the Criteria? I mean, I am looking for like c...

Arrange UIView subviews in relation to outside UIViews

How do I arrange (in terms of depth) a view's subview to be in front of another view? The hierarchy looks like this: A-- -C -D B-- -E -F (A and B are views with C & D, and E & F, as subviews, respectively.) B is layered above A, so every subview in B (E and F) is above every subview in A (C and D). How can I make C displ...

Reorder a multidimensional array?

I have the following array, I need to reorder it by average rating descending. Here is a snippet. Any idea how I would go about doing this? Thanks Array ( [0] => Array ( [id] => 3 [name] => [rating] => 0 ) [1] => Array ( [id] => 2 [name] => ...

Send parameters in order in HTTPService

I am trying to work with a simple HTTPService. The problem is that my webservice is conscious of the order of arguments it gets. I will tell the problem with an example: var service:HTTPService = new HTTPService(); var params:Object = new Object(); params.rows = 0; params.facet = "true"; service.send(params); Note that in the abov...

[Haskell] Set of an Unordered Data Type with a given ordering

I'm trying to put this data type in a Haskell Set, but I don't want to give it a general instance of Ord. So I want to give the set an ordering on y-coördinate but without instance Ord Vector. Is this possible? data Vector = V { x :: Double , y :: Double } deriving (Eq) ...

What is the best way to add and order to Doctrine Nested Set Trees?

What is the best way to add a sense of order in Doctrine Nested Sets? The documention contains several examples of how to get al the childeren of a specific node $category->getNode()->getSiblings() But how can I for example: change the position of the fourth sibling to the second position get only the second sibling add a sibling b...

Simplest distributed persistent key/value store that supports primary key range queries

I am looking for a properly distributed (i.e. not just sharded) and persisted (not bounded by available memory on single node, or cluster of nodes) key/value ("nosql") store that does support range queries by primary key. So far closest such system is Cassandra, which does above. However, it adds support for other features that are not ...

Maintain order of messages via proxies to app servers

Hi, I am receiving messages from a 3rd party via a http post, and it is important that the order the messages hit our infrastructure is maintained through the load balancers and proxies until it hits our application server. Quick Diagram. (proxies in place due to security requirements.) [ACE load balancer] -> [2 proxies] -> [Applicati...

Reordering Lists like playlists in the media player

Hi, I have a list of items that are displayed using a ListView from a SQLCursor. The SQL table includes(as well as other things) a _id field and an order field. I use the order field to sort the list before it gets to the ListView. What I need is a widget like the MediaPlayer has in its playlist view. It allows you to click the icon...

Java Memory Model: reordering and concurrent locks

Hi The java meomry model mandates that synchronize blocks that synchronize on the same monitor enforce a before-after-realtion on the variables modified within those blocks. Example: // in thread A synchronized( lock ) { x = true; } // in thread B synchronized( lock ) { System.out.println( x ); } In this case it is garanteed tha...

Data table columns become out of order after changing data source.

This is kind of a oddball problem so I will try to describe the best that I can. I have a DataGridView that shows a list of contracts and various pieces of information about them. There are three view modes: Contract Approval, Pre-Production, and Production. Each mode has it's own set of columns that need to be displayed. What I have be...

How do I get the position of a result in the list after an order_by?

I'm trying to find an efficient way to find the rank of an object in the database related to it's score. My naive solution looks like this: rank = 0 for q in Model.objects.all().order_by('score'): if q.name == 'searching_for_this' return rank rank += 1 It should be possible to get the database to do the filtering, using order_...

How can I restore the order of an (incomplete) select list to its original order?

I have two Select lists, between which you can move selected options. You can also move options up and down in the right list. When I move options back over to the left list, I would like them to retain their original position in the list order, even if the list is missing some original options. This is solely for the purpose of making ...

Scala 2.8 TreeMap and custom Ordering

I'm switching from scala 2.7 and ordered to scala 2.8 and using ordering. It looks quite straight forward but I was wondering could I make it a little less verbose. For example: scala> case class A(i: Int) defined class A scala> object A extends Ordering[A] { def compare(o1: A, o2: A) = o1.i - o2.i} defined module A If I then try to c...

jQuery arrange li order base on #ID

Hi, I have the following code: <ul> <li id="project_25">Proj Something</li> <li id="project_26">Proj Blah</li> <li id="project_27">Proj Else</li> <li id="project_31">Proj More</li> ... </ul> Is there a way to arrange these LIs, reverse their order, based on the LI ID? Something like: <ul> <li id="project_31">Proj More</li> <li id="p...

F# currying efficiency?

I have a function that looks as follows: let isInSet setElems normalize p = normalize p |> (Set.ofList setElems).Contains This function can be used to quickly check whether an element is semantically part of some set; for example, to check if a file path belongs to an html file: let getLowerExtension p = (Path.GetExtension p...