order

CakePHP: find neighbors, order on 'name' or 'order'

Hi, I have a list of ordered items, ordered according to the int field order. I'm creating a gallery in CakePHP 1.2 that has a prev and next button and those should link to the previous and next item according to their ordering, not according to their id. In order to get this result I've included the 'order' parameter to the find funct...

SQL select order by decimal precision desc

I'm interested in finding the most precise decimal values in a database field. I'd like to be able to sort results by descending precision. Is this possible? e.g. 10.1781253 12345.12435 89.763 1.1 2 ...

MySql query problem with prev/next selection and mutiple columns sorting

here's my table products_tb for products: --------------------------------------- | product_id | prod_name | cat_id | --------------------------------------- | 112 | Zumar | 3 | | 131 | Xerox | 2 | | 143 | Dan | 1 | | 145 | Alan | 1 | | 195 | ...

Get graphviz to draw nodes above edges.

Is there any way to force graphviz to always draw the nodes above edges even if the edge is drawn over (or preferably under) the node? So far I have tried ordering them and different layer options but not found a way that works. ...

How to persist in order

I have two entities: EXAM and EXAM_NORMAL. EXAM @Id @GeneratedValue(strategy=GenerationType.IDENTITY) private Long id; private String name; private String codeName; @Enumerated(EnumType.STRING) private ExamType examType; @ManyToOne private Category category; @OneToMany(mappedBy="id",cascade=CascadeTy...

Method to sort MYSQL results by an arbitriary letter (ie, show all rows starting with F first)

I have a column of states, and, depending on the query, I want to order by results by a particular state, then by id (Asc or Desc, depending). For instance, I might want to show all rows with state "HI", sorted by ID desc, and then all the other rows, sorted by id desc. I was hoping I could do this in one query, rather than getting all...

ORDER BY column_name help (via link in HTML table view) (PHP MySQL

My output for my table in HTML has several columns such as userid, name, age, dob. The table heading is simply the title of the column name, I want this to be a link, and when clicked, the selected column is sorted in order, ASC, and then DESC (on next click). I thought this was pretty straight forward but I'm having some difficulty. S...

Why differs floating-point precision in C# when separated by parantheses and when separated by statements?

I am aware of how floating point precision works in the regular cases, but I stumbled on an odd situation in my C# code. Why aren't result1 and result2 the exact same floating point value here? const float A; // Arbitrary value const float B; // Arbitrary value float result1 = (A*B)*dt; float result2 = (A*B); result2 *= dt; F...

How to switch position of two items in a Python list?

I haven’t been able to find a good solution for this problem on the net (probably because switch, position, list and Python are all such overloaded words). It’s rather simple – I have this list: ['title', 'email', 'password2', 'password1', 'first_name', 'last_name', 'next', 'newsletter'] I’d like to switch position of 'password2' and...

c++ std::map question about iterator order

Hi all, I am a C++ newbie trying to use a map so I can get constant time lookups for the find() method. The problem is that when I use an iterator to go over the elements in the map, elements do not appear in the same order that they were placed in the map. Without maintaining another data structure, is there a way to achieve in order...

A question about the order of pagination

Currently I'm deal with a history message page using Cakephp.And I got a problem about records' order.In the controller,codes about pagination as follows $this->paginate['Msg'] = array('order'=>'Msg.created desc'); $msgs = $this->paginate('Msg'); $this->set('historymsgs',$msgs); Then I got the first page which contains the latest mess...

MySQL Order By Symbol Preference

I was wondering if there was a way to make alphanumeric characters have a higher order of preference than symbols when doing an ORDER BY. I.E. 'a' to come before '(' There are many ways round this, but I'd prefer the most elegant db approach. ...

Complicated Order By Clause?

Hi. I need to do what to me is an advanced sort. I have this two tables: Table: Fruit fruitid | received | basketid 1 20100310 2 2 20091205 3 3 20100220 1 4 20091129 2 Table: Basket id | name 1 Big Discounts 2 Premium Fruit 3 Standard Produce I'm not even s...

XmlDocument SelectNodes(Xpath): Order of result

This is an example xml from MSDN <?xml version="1.0"?> <!-- A fragment of a book store inventory database --> <bookstore xmlns:bk="urn:samples"> <book genre="novel" publicationdate="1997" bk:ISBN="1-861001-57-8"> <title>Pride And Prejudice</title> </book> <book genre="novel" publicationdate="1992" bk:ISBN="1-861002-30-1"> ...

Return order of MySQL SHOW COLUMNS

Hey guys. Simple one this, but one I can't seem to find any information on so here goes. I need to find the columns in a specific table, which is no problem.... SHOW COLUMNS FROM tablename LIKE '%ColumnPrefix%'; But I need to know what order they will be returned, preferable by choosing to order the results ascending alphabetically. ...

GridView Events Clarification

Recently I have been asked an interview question "What are the events order in GridView?". I explained Init() Loading() DataBinding() DataBound() RowCreated .... User interaction events like RowCommand,RowDeleting,RowUpdating PreRender -executes every time when the GridView is modified unload() I would like to check whether my answe...

css direction rtl element order problem

I have this html: <body style="direction: rtl"> <div style="display:inline-block"> <span>x:</span> <span>1</span>, <span>y:</span> <span>2</span> | <a>link1</a> | </div> <a>link2</a> </body> With direction: ltr it displays: x: 1, y: 2 | link1 | link2 But when I change it to rtl is shows: ...

Javascript execution order

I want to give a static javascript block of code to a html template designer, which can be: either inline or external or both used once or more in the html template and each block can determine its position in the template relative to the other javascript code blocks. An example could be image banners served using javascript. I give...

Hibernate: ordering a Set

I have a class Person who has a set of Books. It is not meaningful in the particular case to have an ordered or sorted collection. Say now that I have a search page with a table showing the join of Person and Book. I want to be able to sort the results by fields from both Person AND Book, and then get a List from Hibernate, and iterate ...

MySQL: I need to get the offset of a item in a query.

Mysql: i need to get the offset of a item in a query. I have a image gallery: this show 6 image per stack, so when i request image 22 it shows images from 18 to 24. It should first get the offset of the image 22, then get the images from 18 to 24. Another example: i request the image number 62(and offset 62), it will select images with...