Search Results

Search found 10131 results on 406 pages for 'natural sort'.

Page 23/406 | < Previous Page | 19 20 21 22 23 24 25 26 27 28 29 30  | Next Page >

  • Sort a Vector of custom objects

    - by user307818
    I'm trying to sort a Vector in java but my Vector is not a vector of int, it is a vector of objects the object is: public MyObject() { numObj = 0; price = new Price(); pax = new Pax(); } so I have a Vector of MyObject and I want to order it by numObject, how do i do it, I'm new in java? Thank you so much for all your help.

    Read the article

  • c read float from file and sort

    - by Franky
    Hi all I have a problem with a C application; i have on a .txt file some float numbers and I have to read them and sort in descending way. When i do the fscanf command and then the printf, i get on the screen strange numbers (memory location I suppose). How can i solve the problem? Thanks in advance

    Read the article

  • Extracting a given number of the highest values in a List

    - by James P.
    I'm seeking to display a fixed number of items on a web page according to their respective weight (represented by an Integer). The List where these items are found can be of virtually any size. The first solution that comes to mind is to do a Collections.sort() and to get the items one by one by going through the List. Is there a more elegant solution though that could be used to prepare, say, the top eight items?

    Read the article

  • Problem in sort by date in multi array?

    - by AB
    I want to sort array A based on values in Array B actually in Array A I have topics like keyboard Laptop Desktop mouse and in Array B i have dates associated with each value in Array A how i can achieve this....I was thinking of using multi array but i m not sure if there is any default method of sorting multi array ...or if there is any other method to achieve this?

    Read the article

  • Best way to Sort-n-Concatenate 5 columns

    - by SDReyes
    Having five columns containing numeric values A | B | C | D | E ------------------- 2 | 3 | 4 | 1 | 5 3 | 6 | 1 | 5 | 4 4 | 5 | 7 | 1 | 3 I want to obtain the concatenation of the values after sort them: ABCDE ----------- 1 2 3 4 5 1 3 4 5 6 1 3 4 5 7 What is the best way to do it?

    Read the article

  • php sort properties of object

    - by lannoo
    I want to sort the properties of an object so I can loop through them in a defined order. for example: I have an object 'book' with the following properties: 'id', 'title', 'author', 'date'. Now i want to loop through these properties like this: foreach($book as $prop=>$val) //do something now the order of the loop has to be 'title', then 'author', 'date' and 'id' How would one do this? (I can't change the order of the properties in the class of the object because there arent any properties defined there, I get the object from the database with 'MyActiveRecord')

    Read the article

  • sort date fields to obtain earliest date

    - by manu
    in my database , dates are stored in DD-mm-yyyy format , how can i sort this to obtain the earliest date ? Cursor c = myDb.query(TABLE, new String[]{"dob"}, null, null, null, null, "dob"); I have selected it to order by dob field but its not ordered ... This is the output for the above query 01-03 17:14:51.595: VERBOSE/ORDER DOB(1431): 01-11-1977 01-03 17:14:51.595: VERBOSE/ORDER DOB(1431): 01-12-1988 01-03 17:14:51.614: VERBOSE/ORDER DOB(1431): 15-01-1977 01-03 17:14:51.656: VERBOSE/ORDER DOB(1431): 31-01-1988

    Read the article

  • Remember (persist) the filter, sort order and current page of jqGrid

    - by Jimbo
    My application users asked if it were possible for pages that contain a jqGrid to remember the filter, sort order and current page of the grid (because when they click a grid item to carry out a task and then go back to it they'd like it to be "as they left it") Cookies seem to be the way forward, but how to get the page to load these and set them in the grid before it makes its first data request is a little beyond me at this stage. Does anyone have any experience with this kind of thing with jqGrid? Thanks!

    Read the article

  • Sort Order With End Year and Start Year

    - by Maletor
    I'm looking to write a comparator to sort my items in a list. For items without an end year they should be at the top. For items with an end year they should be next. For items with the same end year the one with the lowest start year should be next. Something I have so far [item.get('end_year'), item.get('start_year')] Test sceanrios first is end year second is start year ("" is present) "", "" "", 2012 "", 2011 2012, 2005 2012, 2008 2011, 2011 2010, 2005

    Read the article

  • sort a custum Vector of objects

    - by user307818
    I'm trying to sort a Vector in java but my Vector is not a vector of int, it is a vector of objects the object is : public MyObject() { numObj = 0; price = new Price(); pax = new Pax(); } so I have a Vector of MyObject and I want to order it by numObject, how do i do it, i'm new in java? thank you so much for all your help

    Read the article

  • Sorting a C# Dictionary

    - by SoulReaver
    I have a dictionary in C# like Dictionary<Person, int> and I want to sort that dictionary in place with respect to keys (a field in class Person). How can I do it? Every available help on the internet is that of lists with no particular example of in place sorting of Dictionary. Any help would be highly appreciated!

    Read the article

  • C++ sort array of strings

    - by user69514
    I am trying to sort an array of strings, but it's not sorting anything.... what am I doing wrong? string namesS[MAX_NAMES]; int compare (const void * a, const void * b){ return ( *(char*)a - *(char*)b ); } void sortNames(){ qsort(namesS, MAX_NAMES, sizeof(string), compare); }

    Read the article

  • MySQL Search (Sort by Relevance)

    - by atif089
    Hi guys, Can any one help me how to sort rows by relevance for the following criterion ? tbluser First Name Last Name tbleduc School College University On the search form the user has following fields Name School College University Where School College and University are Optional.. And Name is split into 2 words (other words in middle are omitted), first word is taken as first anme and last word as last name.. Now I would like to implement search based on relevance. Thanks for the help :)

    Read the article

  • C++ struct sorting

    - by Betamoo
    I have a vector of custom Struct that needs to be sorted on different criteria each time Implementing operator < will allow only one criteria But I want to be able to specify sorting criteria each time I call C++ standard sort. How to do that? Please note it is better to be efficient in running time.. Thanks

    Read the article

  • Sort a list with element still in first position

    - by Mercer
    I have a String list: List<String> listString = new ArrayList<String>(); listString.add("faq"); listString.add("general"); listString.add("contact"); I do some processing on the list and I want to sort this list but I want "general" still to be in first position. Thx ;)

    Read the article

  • TreeMap sort by value

    - by vito huang
    I'm new to java, i want to write an comparator to that will let me sort TreeMap by value instead of the default natural sorting. i tried something like this, but can't find out what went wrong: import java.util.*; class treeMap { public static void main(String[] args) { System.out.println("the main"); byValue cmp = new byValue(); Map<String, Integer> map = new TreeMap<String, Integer>(cmp); map.put("de",10); map.put("ab", 20); map.put("a",5); for (Map.Entry<String,Integer> pair: map.entrySet()) { System.out.println(pair.getKey()+":"+pair.getValue()); } } } class byValue implements Comparator<Map.Entry<String,Integer>> { public int compare(Map.Entry<String,Integer> e1, Map.Entry<String,Integer> e2) { if (e1.getValue() < e2.getValue()){ return 1; } else if (e1.getValue() == e2.getValue()) { return 0; } else { return -1; } } } I guess what am i asking is what controls what get pass to comparator function, can i get an Map.Entry pass to comparator?

    Read the article

  • is NATURAL JOIN any better than SELECT FROM WHERE in terms of performance ?

    - by ashy_32bit
    Today I got into a debate with my project manager about Cartesian products. He says a 'natural join' is somehow much better than using 'select from where' because the later cause the db engine to internally perform a Cartesian product but the former uses another approach that prevents this. As far as I know, the natural join syntax is not any different in anyway than 'select from where' in terms of performance or meaning, I mean you can use either based on your taste. SELECT * FROM table1,table2 WHERE table1.id=table2.id SELECT * FROM table1 NATURAL JOIN table2 please elaborate about the first query causing a Cartesian product but the second one being somehow more smart

    Read the article

< Previous Page | 19 20 21 22 23 24 25 26 27 28 29 30  | Next Page >