order

Why are the arguments to atan2 Y,X rather than X,Y?

In C the atan2 function has the following signature: double atan2( double y, double x ); Other languages do this as well. This is the only function I know of that takes its arguments in Y,X order rather than X,Y order, and it screws me up regularly because when I think coordinates, I think (X,Y). Does anyone know why atan2's argumen...

c# datagridview order rows?!

Hello! I have a datagridview with a number of columns, one of these is a datetime column. I want to display the rows from most recent downwards. e.g. Today Yesterday The Day Before Yesterday etc. Is it possible to do this with the datagridview? The gridviews datasource is an xmldocument....... help appreciated greatly. Regards, ...

Drupal and Ubercart - Add order that customer can pay for online? Bill customer's order without having them manually put it in their cart?

I am configuring a rental website to manage real estate property using Drupal and Ubercart. This site will need to accept rental payments, and IN ADDITION, will need to allow the admin to add extra billing to certain people, for fees, and certain other kinds of things. If they for example, put a huge hole in a wall, and have to pay, or ...

Sorting certain values to the top

I have a MySQL table with the following data (simplified): INSERT INTO `stores` (`storeId`, `name`, `country`) VALUES (1, 'Foo', 'us'), (2, 'Bar', 'jp'), (3, 'Baz', 'us'), (4, 'Foo2', 'se'), (5, 'Baz2', 'jp'), (6, 'Bar3', 'jp'); Now, I want to be able to get a paginated list of stores that begins with the customers country. For examp...

Mysql - order by 2 ranks

Hi, I have a table of items. item has id, score 1, score 2 I want to select 12 known items (using WHERE id IN (....)) and order them by a score that is the sum of score1 and score2's ranks. rank is the location of the score if the 12 items were ordered by it. How can I do this in mysql? Edit: After 4 answers I see that the solution ...

Does the order of the elements in the jQuery wrapped set always match the order the elements appear in the markup?

Is the order of the elements in the jQuery wrapped set guaranteed to match the order the elements appear in the markup? I ask because I need to perform an operation on a set of nested elements, and I need to always do the operation in order of the nesting. Can I just run the operation using .each iterator on the matched set and I'll ...

winform: how to rearrange the menu?

based on .designer.cs, i infer that the menu's arrangement is based on the order you add them on menuStrip's AddRange method: this.menuStrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { this.windowsMenu, this.helpMenu}); is there a way i can change the order of menu? i put dynamically generated men...

Order by day_of_week in MySQL

How can I order the mysql result by varchar column that contains day of week name? Note that MONDAY should goes first, not SUNDAY. ...

Rails Active Record: find in conjunction with :order and :group

I have a structure something like this: class User has_many :dongles has_many :licences, :through => :dongles end class Dongle has_many :licences belongs_to :user end class Licence belongs_to :dongle end However, time passes and the user eventually gets multiple licences for each dongle. Reasonably, the app wants to summa...

How does one control the hook order when adding a PerlTransHandler hook?

In apache 2.2 / mod_perl2 I'd like to add a translation phase handler (PerlTransHandler) but have it run after mod_rewrite. In apache 1.3 this was done by controlling module load order. In apache 2.x the hook ordering is more flexible, however mod_perl2 seems to always insert itself first in that hook phase. Looking at the Request Hook...

How to determine if a list of polygon points are in clockwise order?

Having a list of points, how do I find if they are in clockwise order? For example: point[0] = (5,0) point[1] = (6,4) point[2] = (4,5) point[3] = (1,5) point[4] = (1,0) would say that it is anti-clockwise (counter-clockwise for some people). ...

Maintain WHERE Order In SQL Select

Is it possible to maintain the order of the WHERE clause when doing a SELECT for specific records? For instance, given the following SELECT statement: SELECT [RecSeq] FROM [MyData] WHERE [RecSeq]=3 OR [RecSeq]=2 OR [RecSeq]=1 OR [RecSeq]=21 OR [RecSeq]=20 OR [RecSeq]=19 OR [RecSeq]=110 OR [RecSeq]=109 OR [RecSeq]=108 OR [RecSeq]=53 O...

jQuery: sliding panels one after the other

Hi guys, I know this is a simple one for some of you, so please help me out! I have 3 panels (divs) which I want to slide one after the other from clicking a button. Sliding one panel is easy but how to slide multiple divs in order? Thanks. ...

Changing HTML content dynamically with JS before ActiveX component has finished loading

I have an HTML page, which performs the following actions (in order): Shows static HTML content Replaces some of the static content using JavaScript Loads an ActiveX component using JavaScript The problem is that step 2 is always executed after step 3, even though the code to display the ActiveX component is after step 2 (and loading...

Select Users with more Items

Each user HAS MANY photos and HAS MANY comments. I would like to order users by SUM(number_of_photos, number_of_comments) Can you suggest me the SQL query? ...

What defines the bindings update order in WPF?

Hi, I have a piece of WPF/C# code that uses several Bindings: A combobox is used to select an Account The itemssource property of a second combobox is bound to the selected Account. This second combobox is used to select a Contact The itemssource property of a grid is bound to the selected Account. This grid contains the selected Acco...

Preserve order of values with linq and ToLookup()

While I'm pretty certain that the keys are unordered when returned from linq's ToLookup method, Is the order of values preserved? I can't find any documentation that says one way or the other. ...

How to sort the result set of an UPDATE statement that uses the OUTPUT clause?

The title says it all. I'd like to sort the rows returned by an UPDATE statement, but there's no direct way to do this according to the msdn page for the OUTPUT Clause, which says: SQL Server does not guarantee the order in which rows are processed and returned by DML statements using the OUTPUT clause. Since I can't just tack "or...

Why C/C++ does not defined expression evaluation order?

As you may know C/C++ does not specified expression evaluation order. What are the reasons to left them undefined. ...

Wordpress order/sort problem

Hi, The Problem: I would like to sort my posts based on custom fields, when the user clicks on a link. I don't know if there is a parameter that can be passed via url to reorder posts. Comparison: I would like it to work similar to how you can sort songs in iTunes. The user simply clicks the "Artist" button and the songs are reorder al...