order

Django: how to override default ORDER field when using formsets with 'can_order' ?

As title says, how can I override it - specifically, how to change its widget from default TextInput to HiddenInput? And why isn't it hidden to begin with :S I tried passing custom callback function as formfield callback to modelformset_factory but it only changed the default fields originating from model. I also tried specifying anothe...

PHP MYSQL order by day and month...HELP please..

Hi i have my mysql $query = mysql_query('SELECT * from rbf_edades_news order by month DESC '.$limit.''); month and day are in different fields, any idea?" is this possible $query = mysql_query('SELECT * from rbf_edades_news order by month and DESC '.$limit.''); Thanks! ...

Grab Next Row in SQL

I am trying to grab a field from the next row of this database. I can use the logged on time to determine the logout time but I would like to also grab the next login time so I can determine the logout [logged off] time as well. Any suggestions? Thank you |-LogonDate---|-PersonID-|-LoggedOnTime---| |5/30 12:00pm |100 |3600 ...

Apache need to bypass .PDF files in here

Ok, I'm not fluent in Apache... I have a .htaccess file setup like so: <Files *> Order Deny,Allow Deny from all Allow from localhost </Files> RemoveHandler .php .php3 .phtml .cgi .fcgi .pl .fpl .shtml The Problem is I am needing to use .pdf files to link to a URL like so within this directory: <iframe name="FRAME2" src=...

Python base64 data decode and byte order convert

Hi, I am now using python base64 module to decode a base64 coded XML file, what I did was to find each of the data (there are thousands of them as for exmaple in "ABC....", the "ABC..." was the base64 encoded data) and add it to a string, lets say s, then I use base64.b64decode(s) to get the result, I am not sure of the result of the dec...

How do I select times from MySQL in order based on precedence?

I know that question doesn't make much sense, but here goes: Times Table Authority | Time ------------------------------------- animuson@forums | 45.6758 132075829385895 | 49.7869 qykumsoy@forums | 44.45 439854390263565 | 50.761 user@forums | 44.9 another@auth | 46.123 bingo@nameo | 47.4...

The order of data in memory

A few simple questions. const int gFirst; const int gSecond; struct Data { static int First; static int Second; int first; int second; }; Data data; Is it guaranteed that the following statements are true? 1) &gFirst < &gSecond 2) &Data::First < &Data::Second 3) &data.first < &data.second ...

Order of execution of jquery event handlers in respect to (inline) javascript event handlers

Correct me if I am wrong, but seems to me jQuery event handling is completely separate from the javascript event handling. I know that the order of executing jQuery and javascript event handlers themselves is undefined, but can the assumption be made that all javascript handlers will execute before jQuery ones? In the example given in a...

Implementation of java.util.Map using insertion order as order

The JDK documentation on java.util.Map states The order of a map is defined as the order in which the iterators on the map's collection views return their elements. Some map implementations, like the TreeMap class, make specific guarantees as to their order; others, like the HashMap class, do not. And the documentation...

Ordering FULLTEXT searches on relevance and other fields

I'm using FULLTEXT natural language search, and I notice that it automatically sorts my results by relevance. However, when I start to add things to ORDER, it seems to no longer sort by relevance. Is there a way to explicitly set the importance of relevance sorting? ...

Showing posts with a "featured" tag at the top using PHP in Wordpress

Hi all, I have a page in Wordpress that displays posts with a category of "newspaper" only. Now, The posts are ordered by descending order (I think, if that is the default), such that the newest is at the top. This is the code that I have: <?php $my_query = new WP_Query('category_name=newspaper&posts_per_page=-1'); ?> <?php if (have_...

C# Encounter a problem when convert byte[] to struct. The byte order is wrong.

I was trying to using struct to parse socket data when implement a UDP based protocol. And I searched and I can use these 2 functions to convert between byte[] and struct: byte[] StructToBytes(object structObj) { int size = Marshal.SizeOf(structObj); IntPtr buffer = Marshal.AllocHGlobal(size); try { ...

Make select list output in alphabetical order in Rails?

Hi Everyone, I have a select list in my model which lists a persons name with their employers name: <li>Case Handler Name<span><%= f.select :person_id, Person.all.collect { |x| [x.name_and_company, x.id] } %></span></li> def name_and_company return "#{personname} (#{company})" end Is it possible to force the select list to output ...

Generating Order Numbers - Keep unique across multiple machines - Unique string seed

I'm attempting to create an order number for customers to use. I will have multiple machines that do not have access to the same database (so can't use primary keys and generate a unique ID). I will have a unique string that I could use for a seed for some algorithm that will generate a unique looking alphanumeric ID # for the order ...

Ordering a list randomly

Hi all! I have a list of 55 (or any number but 55 at the moment) questions in my iPhone app. I have written it at the moment so it goes through the questions from 1 to 55 in number order. However, I would like to make this order random (or pseudo-random anyway). I can do it programatically by generating a random number to pick one of...

How to control glassfish module startup order

I have several web modules. There are dependency between them, say during startup, module B will use MBean exposed by module A. How to configure glassfish to enable it start them by specific order? Or is it possible to configure it to load them concurrently. I searched quite a lot via google, but not result. BTW, I'm using glassfish-2 ...

How do I change the Z-Order of sprites in Objective-C?

Sorry if this is answered somewhere else, but I couldn't find it. It's pretty simple, I want to set the Z-order of the sprites I create in Objective-C, specifically in Cocos2D. This is the error I get when trying to build the following code: CCSprite *mySprite = [CCSprite spriteWithFile:@"mySpriteImage.png" rect:CGRectMake(...

How can I order an array by the amount of times each object appears in a join table in RoR?

I'm doing a search on a model, like this: search_results = Note.description_like("test string") So I've got an array of notes. I want to order them by the frequency that the note_id appears in a join table I have, note_categories. How can I do this? ...

what is the execution order of a threaded and non-threaded function call?

hello, i have written a simple console application just to try boost::thread, i am a multithreading newbie by the way. here is the code #include <iostream> #include <boost/thread/thread.hpp> #include <windows.h> using namespace std; void Avg(double * Src, double *Dst, int Per, int Len, string& s ) { LARGE_INTEGER s1,s2,f; Que...

PHP: Add Unique ID + Order ID for each word what starts with @

I need to add an Order ID + Unique ID for each word what starts with @. For example I have a string like this: Just @do @it and @do @it. I want to preg_replace #(\@)+([^\s]+)#i to this: Just <div id="1+Unique ID">@do</div> <div id="2+Unique ID">@it</div> and <div id="3+Unique ID">@do</div> <div id="4+Unique ID">@it</div>. ...