order

Sort Order in SQL Server

Can I change the default sort order in a SQL server database so that nulls and zero length strings are displayed last. Its SQL Server 2000 I stress, I want to change the default order for all queries, if possible ...

How to order a query by a translated field using globalize

I'm trying to order a query using a field which is translated with globalize2. The problem is that since stored in database and in an association I'm having lot of problems. Doing an include of the translations and ordering by category_translations.name doesn't work. I tried a default_scope but since it doesn't allow to use lambda or a...

MySQL Custom Order

Hello! I have a table that I select data from with a column called parent that's of unsigned integer type. It has numbers from 0 to 12. I want to select * from table order by parent asc, but with one exception: place the 0 at the end of the select so it would be like 1,2,3,4,5,6,7,8,9,0. Is this possible with a single select in MySQL...

How to make for loop in windows batch file run in name order

I have a windows batch file that does this: for %%s in (*.sql) do call It loops through all the sql script in a folder. In the folder the file names are like: s4.06.01.sql s4.07.01.sql s4.08.01.sql s4.10.01.sql s5.01.sql But the for loop goes through the files randomly (not in the name order), it first run s5.01, then s4.06, then s4...

Mysql: Order by like?

assume that we are performing search using keywords: keyword1, keyword2, keyword3 there are records in database with column "name": 1: John Doe 2: Samuel Doe 3: John Smith 4: Anna Smith now Query: SELECT * FROM users WHERE (name LIKE "%John%" OR name LIKE "%Doe%") it will select records: 1,2,3 (in this order) but i want to order ...

Is there an easy way to drag items around in a ListView to change their order?

Let's say I have a ListView of items: Cat Dog Mouse And these are bound to the ListView via an adapter to a database. What I want to be able to do is to be able to re-order the list view,. For example I want to somehow drag "Mouse" up to the top of the list above "Cat". Once I have an order set, I then want to "save" the list and i...

Kiln Projects, repositories and repository groups best practices?

I'm very new to Kiln and FogBugz (just started today). I'm currently using SVN + ScrewTurnWiki + BugNet to do all this things (... yes I know, frustrating ehh?). My question goes around the lines of best practices for organizing products into Projects/Repositories/RepositoryGroups. My products have multiple VS projects and assets. In m...

Importing .sql file into my database inputs them out of order

I am using phpadmin and I exported a .sql file to backup my database. When I went to import the .sql file it imports the rows in the wrong order. Is their anyway to remedy this problem? ...

Plone: How to sort the navtree portlet using another list as base order?

I have a navtree on a plone site, already using this configuration: navigation = mapping['navigation'] navigation.includeTop = True navigation.currentFolderOnly = False navigation.topLevel = 0 navigation.setProperty('metaTypesNotToList', ['ATBooleanCriterion', ...(another types go here) ..., MemberDataContainer']) navigation.setProperty...

Plone: How to sort folder items

I have a folder called myfolder, that has some items inside, like: item1, item2, item3, and etc. When I added the portlet Navigation to the left column of the page, and entered on the folder myfolder, it showed me the links on the portlet like this: item1 item2 item3 I want that the Navigation portlet shows me links on this exact so...

Is the order of static class initialization in C# deterministic?

I've done some searching and I think the following code is guaranteed to produce output: B.X = 7 B.X = 0 A.X = 1 A = 1, B = 0 static class B { public static int X = 7; static B() { Console.WriteLine("B.X = " + X); X = A.X; Console.WriteLine("B.X = " + X); } } static class A { public static in...

How do I change this function to add the child nodes into the //root/Product/Genres node instead of adding to the end of the file (i.e. after </root>

It works properly in the way that it breaks up the comma-separated values into an array (with explode), but when it adds the child nodes, they show up after the closing root tag. What I'm trying to do here is replace the <Genres>Adventure,Crime,Action</Genres> with <Genre>Adventure</Genre> <Genre>Crime</Genre> <Genre>Action</Genre> A ...

Drupal 6, and drupal_add_js() loading order

Hi there. I need to override some function from a contributed module. I used drupal_add_js() to load my javascript but it loads after the contrib module, so I cannot override. My module is empty with only hook_init() to do the job. Also tried it in hook_footer() no success. Any ideas are hugely appreciated. ...

Rotate li items with jquery...

Hi all, I have a UL list like: <ul> <li>menu1</li> <li>menu2</li> <li>menu3</li> <li>menu4</li> <li>menu5</li> </ul> I want to use this list as a animated JQuery menu. Setup in such a way that if a user clicks menu3 it becomes the first item in the list as menu1 and menu2 get appended to the end. So after clicking on menu3...

Algorithm: Find index of 2nd smallest element from an unknown array

I have been pondering about my homework question for a while. I welcome (and prefer) any suggestions or approach on how to attack this problem. Basically, I have an array A of size N. We do not know the elements but we know they are distinct. The only thing that I have is a person who will take two indices (i,j) in N. This person will t...

Does the order of expression to check in boolean statement affect performance

If I have a Boolean expression to check (A && B) If A is found to be false will the language bother to check B? Does this vary from language to language? The reason I ask is that I'm wondering if it's the case that B is checked even if A is false then wouldn't if (A) { if(B) { } else { // code x } } else { // code x }...

.Net Charting - switching display order of bar charts

Using System.Web.UI.DataVisualization.Charting, I've got data I want to represent as a Bar chart with the first item at the series displaying at the top of the chart, rather than the bottom. E.g. for a series with labels {"A", "B", "C"}, the bar for C will display at the top, while I would want A to be the top bar. This ordering makes se...

show the posts category order by month in wordpress

hi guys, today i solve the problem, how to show posts categories by month like as following url: http://www.onlinescratchcards.me.uk/blog/ ...

latex enumerate custom numerical order

are there any simple: almost a single liner latex commands to make enumerate count in a weird order for instance that of a homework assignment? Ex. 1, 5, 6, 9, 10, 13, 16 ...

Sorting terms of custom taxonomy

How to set up special sorting for the terms of custom taxonomy? Thank you! ...