Complicated Sort help

I am try to sort a table of 3 columns and many rows. each row's data have to be in tact. But I would like to sort the first column's data (assuming strings) in ascending order. Then given that, sort the second column with decending order. Then sort the third column with acsending again. or any combinations. How to accomplish this in Java? what is the best logic or tool i should use? arrary of array? or collection? etc...
any help is appricated!!!
example:
(before sort)
apple 5 red
watermelon 2 green
pear 10 yellow
(after sort first iteration)
apple 5 red
pear 10 yellow
watermelon 2 green
(after sort 2nd iteration)
watermelon 2 green
apple 5 red
pear 10 yellow
(third and final result)
watermelon 2 green
apple 5 red
pear 10 yellow
thanks

I am doing something similar in my application. I am using a JTable.
On mouse click on a column header i do the following:
<code>
-----Method inside the class having the JTable
protected void sortAllRowsBy(DefaultTableModel model, int colIndex, boolean ascending)
data = model.getDataVector();
Collections.sort(data, new ColumnSorter(colIndex, ascending));
model.fireTableStructureChanged();
          data=null;
------ColumnSorter.java
import java.util.Vector;
import java.util.Comparator;
public class ColumnSorter implements Comparator
int colIndex;
boolean ascending;
ColumnSorter(int colIndex, boolean ascending)
this.colIndex = colIndex;
this.ascending = ascending;
public int compare(Object a, Object b)
Vector v1 = (Vector)a;
Vector v2 = (Vector)b;
Object o1 = v1.get(colIndex);
Object o2 = v2.get(colIndex);
// Treat empty strains like nulls
if (o1 instanceof String && ((String)o1).length() == 0)
o1 = null;
if (o2 instanceof String && ((String)o2).length() == 0)
o2 = null;
// Sort nulls so they appear last, regardless
// of sort order
if (o1 == null && o2 == null)
return 0;
               else if (o1 == null)
return 1;
               else if (o2 == null)
return -1;
               else if (o1 instanceof Comparable)
if (ascending)
                         try
                              Double d1=Double.valueOf(o1.toString());
                              Double d2= Double.valueOf(o2.toString());
                              return d1.compareTo(d2);
                         catch(Exception e)
                              // LogFileWriter.writeTextInFile("Exception occured in ColumnSorter: "+ e.toString());
                              return ((Comparable)o1).compareTo(o2);
                    else
                         try
                              Double d1=Double.valueOf(o1.toString());
                              Double d2= Double.valueOf(o2.toString());
                              return d2.compareTo(d1);
                         catch(Exception e)
                              // LogFileWriter.writeTextInFile("Exception occured in ColumnSorter: "+ e.toString());
                              return ((Comparable)o2).compareTo(o1);
               else
                    System.out.println("not comparable");
if (ascending)
return o1.toString().compareTo(o2.toString());
                    else
return o2.toString().compareTo(o1.toString());
</code>

Similar Messages

  • Movie Library, sorting HELP!!!

    I recently converted home movies and imported them to itunes. One thing that I notice is I can't sort them alphabetically. There is no rhyme or reason to the way that itunes sorts the movie titles. I am familiar with sorting by genre, name, time, etc. etc. but even then itunes does not sort them properly.
    I.e. Genre, then alphabetically.
    In addition I can't add a description, or movie rating to the file.
    Now the purchased movies from itunes seem to organize properly, which might have something to do with the files it self. Who knows? Can anyone help me figure this out?
    Thanks for your help
    CaSandra

    Figured it out..
    Thanks anyway

  • Radix sort help needed

    Can someone please help me with this radix sort on a dictionary (linkedList from the java utils). I am trying to pass the linkedList into an array which the java apis say that you can do with the to.Array() method but I am getting the noninformative cannot resolve symbol. Like the theory here is that one I should be able to pass a linkedList into an array and two, that I should be able to sort the list by calling the substrings(1,MAX_LENGTH) and then do a minus one on the length for the recursive call. However, this is giving me fits at this point and I don't know if I am totally off track and this will never work or if I am just not thinking it through clearly.
    Any help at all would be appreciated greatly...
    import java.util.*;
    public class radixSort
      //  radix sort using linked lists, where radixSort is not
      //  a method of the LinkeList class.
       public void radixSort(LinkedList listA)
       //*******************this is the line that's giving me fits***********************/
       java.util.LinkedList[] objArray = listA.toArray();
       final int MAX_LENGTH  =  8;    //  Strings are no more than 8 characters
       final int RADIX_SIZE = 26;    //  Alphabet has 26 letters
       // Use an array of 26 ArrayLists to groups the elements of the array
       createQueue[] groups = new createQueue[RADIX_SIZE];
       for (int x = 0; x < MAX_LENGTH; x++)
                 for (int i; i < MAX_LENGTH; i++)
                 groups = new createQueue();
              for (int position=MAX_LENGTH; position < 0; position--)
    for (int scan=0; scan < MAX_LENGTH; scan++)
    //ListIterator iter1 = listA.listIterator();
    String temp = String.valueOf (listA[scan]);
    String letter = temp.substring(0, position);
    groups[letter].enqueue ((listA[scan]));
    // gather numbers back into list
    int num = 0;
    for(int d=0; d<MAX_LENGTH; d++)
    while (!(groups[d].isEmpty()))
    numObj = groups[d].dequeue();
    listA[num] = numObj.intValue();
    num++;
    //****************************Here is the createQueue class...***********************/
    public class createQueue
    * Construct the queue.
    public createQueue( )
    front = back = null;
    * Test if the queue is logically empty.
    * @return true if empty, false otherwise.
    public boolean isEmpty( )
    return front == null;
    * Insert a new item into the queue.
    * @param x the item to insert.
    public void enqueue( Object x )
    if( isEmpty( ) ) // Make queue of one element
    back = front = new ListNode( x );
    else // Regular case
    back = back.next = new ListNode( x );
    * Return and remove the least recently inserted item
    * from the queue.
    public Object dequeue( )
    if( isEmpty( ) )
    //throw new UnderflowException( "ListQueue dequeue" );
              System.out.println("No elements");
    else;
    Object returnValue = front;
    front = front.next;
    return returnValue;
    * Get the least recently inserted item in the queue.
    * Does not alter the queue.
    public Object getFront( )
    if( isEmpty( ) )
    System.out.println("No elements");
    else;
    return front;
    * Make the queue logically empty.
    public void makeEmpty( )
    front = null;
    back = null;
    private ListNode front;
    private ListNode back;
    private void printans()
         if (isEmpty())
         System.out.println("No elements");
         else
         while (back != front)
         System.out.println (front);
         //front++;

    java.util.LinkedList[] objArray = listA.toArray();Impossible! You are going to convert a LinkedList to an array of LinkedList. It's impossible! Or, sheer nonsense, if ever possible.

  • Radix sort help again

    I created a linked list and are now trying to pass a word into a radix sort (which works outside of this particular program) so that it will sort the words and place them back into the appropriate places in the list. Just for the record, I haven't rewritten the part where it adds the sorted words back into the list so I know that part won't work right at the moment. I just need a work around for this error...
    java:197: non-static variable head cannot be referenced from a static context
    Here is the code...(does not include main cause main is long and complicated but it does work G)
    import java.util.Vector;
    public class neverishDictionary
        private Node head;
        public neverishDictionary()
             head = null;
        //begin inner node class
        private class Node
             private String word, pos, def, date, org;
             private Node next;
             public Node(String word1, String pos1, String def1, String date1, String org1)
             //1st constructor
                word = word1;
                pos = pos1;
                def = def1;
                date = date1;
                org = org1;
                next = null;
            public Node(String word1, String pos1, String def1, String date1, String org1, Node nextNode)
            //2nd constructor
                word = word1;
                pos = pos1;
                def = def1;
                date = date1;
                org = org1;
                next = nextNode;
            public String getWord()
                return word;
            public String getPos()
                return pos;
            public String getDef()
                return def;
            public String getDate()
                return date;
            public String getOrg()
                return org;
            public void setNext(Node nextNode)
                next = nextNode;
            public Node getNext()
                return next;
       }//ends the inner class
       public boolean isEmpty()
            return head == null;
       public void add(String newWord, String newPos, String newDef, String newDate, String newOrg)
            Node curr;
            Node prev;
            Node newNode = new Node (newWord, newPos, newDef, newDate, newOrg);
            if(isEmpty())
                newNode.setNext(head);
                head=newNode;
            else if(newWord.compareTo(head.getWord())<0)
                newNode.setNext(head);
                head=newNode;
            else
                prev = head;
                curr = head;
                while (curr != null)
                  if (newWord.compareTo(curr.getWord())<0)
                      prev.setNext(newNode);
                      newNode.setNext(curr);
                      break;
                   else
                       prev = curr;
                       curr = curr.getNext();
                       if (curr == null)
                           prev.setNext(newNode);
      public static Vector radixSort(Vector str1, Node prev, Node curr)
       Vector result = (Vector) str1.clone();
       final int MAX_LENGTH  =  8;    //  Strings are no more than 8 characters
       final int RADIX_SIZE = 26;    //  Alphabet has 26 letters
       int position = RADIX_SIZE;
       // Use an array of 26 ArrayLists to groups the elements of the array
        prev = null;
        curr = head;  // This is the line giving me fits and I'm not quite sure how to get around it.
        String str = curr.getWord();
       Vector[] buckets = new Vector[RADIX_SIZE];
        for (int i = 0; i < RADIX_SIZE; i++)
          buckets[i] = new Vector();
        int length = MAX_LENGTH;
        // Step through the positions from right to left, shoving into
        // buckets and then reading out again
        for (int pos = length-1; pos >=0; pos--) {
          // Put each string into the appropriate bucket
          for (int i = 0; i < MAX_LENGTH; i++) {
            str = (String) result.get(i);
            int bucketnum;
            // If the string is too short, shove it at the beginning
            if (str.length() <= pos)
              bucketnum = 0;
            else
              bucketnum = str.charAt(pos);
            buckets[bucketnum].add(str);
          // Read it back out again, clearing the buckets as we go.
          result.clear();
          for (int i = 0; i < MAX_LENGTH; i++) {
            result.addAll(buckets);
    buckets[i].clear();
    } // for(i)
    } // for(pos)
    // That's it, we're done.
    return result;
    } // sort

    Hello.
    As the error says, you are referencing a non-static member within a static function. Do a little reading on static functions. Basically you are assigning head to curr, but head has not been created yet, so the compiler is telling you it is a problem.

  • Vector sorting help

    hi, im trying to figure out how to sort the vector objects below in alphabetical order. But i can't figure out how to fix this code
    any help is greatly appreciated. THANKS!!!
    import java.lang.String.*;
    import java.util.Vector;
    public class Test2
    public void hi()
    Vector v = new Vector();
    v.add("Donkey");
    v.add("Dog");
    v.add("Parakeet");
    v.add("Cat");
    v.add("Mule");
    v.add("Horse");
    v.add("Zebra");
    v.add("Lion");
    v.add("Frog");
    v.add("Catepillar");
    v.add("Butterfly");
    v.add("Ostrich");
    for(int i = 0; i < v.size(); i++)
    int o = i;
    int j = i - 1;
    while(j>=0 && j > o)
    v.get(j + 1) = v.get(i);
    j--;
    j + 1 = o;
    //substring(s.indexOf(",") + 2, s.indexOf("[") - 1)
    }

    hi, im trying to figure out how to sort the vector
    objects below in alphabetical order. But i can't
    figure out how to fix this code
    any help is greatly appreciated. THANKS!!!
    import java.lang.String.*;
    import java.util.Vector;
    public class Test2
    public void hi()
    Vector v = new Vector();
    v.add("Donkey");
    v.add("Dog");
    v.add("Parakeet");
    v.add("Cat");
    v.add("Mule");
    v.add("Horse");
    v.add("Zebra");
    v.add("Lion");
    v.add("Frog");
    v.add("Catepillar");
    v.add("Butterfly");
    v.add("Ostrich");
    for(int i = 0; i < v.size(); i++)
    int o = i;
    int j = i - 1;
    while(j>=0 && j > o)
    v.get(j + 1) = v.get(i);
    j--;
    j + 1 = o;
    //substring(s.indexOf(",") + 2, s.indexOf("[") -
    ) - 1)
    }Hi!
    You can't do:
    v.get(j + 1) = v.get(i);
    I think what you want to do is:
    v.set(j+1,v.get(i));
    Read this:
    "set
    public Object set(int�index,Object�element)
    Replaces the element at the specified position in this Vector with the specified element."
    If you have other questions, just say!
    Hope it helps!!!
    Regards,
    ACN

  • URGENT SORT HELP NEEDED

    Hey everyone...
    This is VERY time critical....
    Could someone give me a method that uses an Insertion Sort to sort an array of Strings??
    Please help!!!
    Thanks!!
    Lardiop

    Object[] arr = new Object[size];
    Object temp1;
    for(int i=2; i <= arr.length; i++) {
      for(int j=i-1; j > 0; j--) {
        if(arr[j].compareTo(arr[j - 1]) < 0) {
          temp1 = arr[j];
          arr[j] = arr[j - 1];
          arr[j - 1] = temp1;
    }

  • Finder sorting help?

    Hi, I want my finder Organized by 'Type' and sorted by 'Name', but every time I open a new folder I have to manually reset the sorting option, how can I set it by default so that every new windows I open is sorted that way?

    Hi Filippo1,
    If you are interested in setting a preferred Finder view, you may find the following article helpful:
    Mac OS X: How to Save a Finder View (Column, Icon, or List) for a Specific Folder or Disk
    http://support.apple.com/kb/TA20803
    Regards,
    - Brenden

  • Automator Sorting Help

    I'm trying to automate a particular function using Automator. I am hoping to take the entire contents of one folder and sort them to seperate folders of no more then 500MB each in total size. Each folder can be generically named as it is generated, but that max  total size of the folder is what's important. In looking at the selection list within Automator, I can't seem to figure out how to make this particular sort happen?
    Any help with this would be super appreciative.
    Thanks again.

    j. patrick wrote:
    I cannot get the subject line part to work. I drag the variable to the subject line and it adds a whole new process undernieth.
    Can you post a screen shot of the workflow?

  • Firefox not resonding.. your answer to this is so complicated ! help ! i hate to go elsewhere, but i'm being forced to :(

    it took me for ever to find what i'm looking for.. the problem is that i keep getting a " firefox is not responding " ! it happens all the time ! my computer has gotten so slow and with all these " not responding " .. if i can't fix it myself, i have to leave :( ... your answers that i found were so complicated for a mom that i'm being forced away from firefox and it truly upsets me.. please help ! i un-installed already and re-installed..

    Hello @sjancuski, 
    Welcome to the HP forums.
    I am sorry to hear that printing from an Android device to the Brother HL-2270DW is so complicated.
    I have found it easy to print from my phone to my HP printer.
    Perhaps if you post on Brothers forums you can get some assistance with the setup.
    Aardvark1
    I work on behalf of HP
    Please click “Accept as Solution ” if you feel my post solved your issue, it will help others find the solution.
    Click the “Kudos Thumbs Up" on the right to say “Thanks” for helping!

  • Complicated Code HELP!

    <br><br>
    Hi Below is my code that works out the start date - the end date * the lpa_amount divided by 7,
    If the is more than one ent_seqno it will do the same for the 2nd, 3rd etc ent_seqno and total them up.
    claim_no     Ent_seqno    Start_date    End_date        lpa_amt
    1000052847     1     01/04/2008     18/05/2008     0.762     
    1000052847     2     19/05/2008     31/03/2009     0.71     But my problem is if i try to choose the start and end dates, i thought simply by inputing
    SUM ((:p_end_date - :p_start_date +1 )
    instead of
    SUM ((lpa_history.p_end_date - lpa_history.START_DATE +1)
    It would work but it doesnt, it only works out calculations for just the first ent_seqno and ignors any others.
    Please Please help!!!
    SELECT DISTINCT
      LPA_INPUT.CLAIM_NO,
         LPA_INPUT.INPUT_SURNAME,
         LPA_INPUT.INPUT_FORENAME,
          LPA_INPUT.INPUT_TITLE,
          LPA_INPUT.INPUT_HOUSE_NO||' '||LPA_INPUT.INPUT_ADDRESS_LINE1||', '||      LPA_INPUT.INPUT_ADDRESS_LINE2||', '||LPA_INPUT.INPUT_ADDRESS_LINE3||', '||
    LPA_INPUT.INPUT_POST_CODE,
          LPA_INPUT.INPUT_START_DATE,
          LPA_INPUT.INPUT_END_DATE,
          TO_CHAR(hist.total,9999990.909999) AS TOTAL
    FROM   LPA_CLAIM,
           LPA_INPUT,
            LPA_HISTORY,
           (SELECT lpa_history.claim_no,
            SUM ((lpa_history.p_end_date - lpa_history.START_DATE +1 ) * (ROUND(LPA_HISTORY.LPA_AMT,2))/7) total
    FROM LPA_HISTORY, LPA_CLAIM, LPA_INPUT
    where lpa_history.claim_no = LPA_CLAIM.claim_no
    and lpa_history.claim_no = LPA_INPUT.claim_no
    and ((ent_seqno = (select max(ent_seqno) from lpa_history where lpa_claim.claim_no = claim_no and start_date
    = (select min(start_date) from lpa_history where lpa_claim.claim_no = claim_no)))
    or
    (ent_seqno > (select max(ent_seqno) from lpa_history where lpa_claim.claim_no = claim_no and start_date
    = (select min(start_date) from lpa_history where lpa_claim.claim_no = claim_no))))
    group by lpa_history.claim_no) hist
    WHERE  LPA_CLAIM.CLAIM_NO = LPA_INPUT.CLAIM_NO
    AND    LPA_CLAIM.CLAIM_NO = LPA_HISTORY.CLAIM_NO
    AND    LPA_CLAIM.CLAIM_NO = hist.CLAIM_NO
    AND    LPA_CLAIM.TENANCY_TYPE = 'PTEN'
    AND    LPA_CLAIM.TENURE_TYPE = 'HA'
    and LPA_HISTORY.DATE_CREATED >= :p_start_date
    and LPA_HISTORY.DATE_CREATED < :p_end_date + 1
    AND    (LPA_INPUT.INPUT_DECISION = 'Eligible'
            OR
            LPA_INPUT.INPUT_DECISION IS NULL)
    ORDER BY LPA_INPUT.INPUT_SURNAME;

    Hello, sorry people it is quite, complicated and i will try to explain in more dept!!!
    claim_no     Ent_seqno    Start_date    End_date        lpa_amt
    1000052847     1     01/04/2008     18/05/2008     0.762     
    1000052847     2     19/05/2008     31/03/2009     0.71
    [pre]
    Basicly my code picks up claims, that are PTEN, HA, and ELIGIBLE, from the CLAIM table,
    once it has a claim, it then has to work out they payment from the history table,
    an example of a claim from the history show above.
    it subtracts the start date from the end date +1 and multiplies it by the amount and then divides by 7,
    so the answer for the above would be:
    01/04 - 18/05  +1 = 48 * 0.762 = 5.21
    19/05 - 31/03 + 1 = 317 * 0.71 = 32.15
                                                      37.36 TOTAL
    My code does this fine, but i want to be able to choose the end date in my code i.e work out the payment to,
    i.e todays date:
    01/04 - 18/05  +1 = 48 * 0.762 = 5.21
    19/05 - *09/12* + 1 = 205 * 0.71 = 20.79
                                                         26.00 TOTAL
    An important feature is that it that the code know to work out the multiple entries in the history table (shown above)
    and ((ent_seqno = (select max(ent_seqno) from lpa_history where lpa_claim.claim_no = claim_no and start_date
    = (select min(start_date) from lpa_history where lpa_claim.claim_no = claim_no)))
    or
    (ent_seqno > (select max(ent_seqno) from lpa_history where lpa_claim.claim_no = claim_no and start_date
    = (select min(start_date) from lpa_history where lpa_claim.claim_no = claim_no))))
    group by lpa_history.claim_no) histHope this helps?!
    Edited by: Sq....what? on 09-Dec-2008 02:08                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • Hierarchical Query Sort help needed in 9i (9.2.0.6)

    Hello all, hope you guys are far away from IKE (it hit us pretty bad last weekend), anyway come to point
    My requirement is data sorted by name is such a way after parent show its childs (if exists) i.e first sort parents and then by childs within parants
    I am expecting this
    1     BBQU-1
    2     BBQU-1 Sub event 1
    3     BBQU-1 Sub event 2
    10     BBQU-1 Sub event 3
    6     BBQU-1 Birthday
    5     BBQU-1 Advance
    7     BBQU-2
    4     BBQU-2 Sub event
    from
    1     BBQU-1     
    5     BBQU-1 Advance     
    2     BBQU-1 Sub event 1     1
    3     BBQU-1 Sub event 2     1
    10     BBQU-1 Sub event 3     1
    6     BBQU-1 Birthday     
    7     BBQU-2     
    4     BBQU-2 Sub event     7
    Here is the script for table and data.
    create table no_more_ike (event_id number, event_name varchar2(30), subevent_id number);
    insert into no_more_ike values (1, 'BBQU-1', null);
    insert into no_more_ike values (5, 'BBQU-1 Advance', null);
    insert into no_more_ike values (2, 'BBQU-1 Sub event 1', 1);
    insert into no_more_ike values (3, 'BBQU-1 Sub event 2', 1);
    insert into no_more_ike values (10, 'BBQU-1 Sub event 3', 1);
    insert into no_more_ike values (6, 'BBQU-1 Birthday', null);
    insert into no_more_ike values (7, 'BBQU-2', null);
    insert into no_more_ike values (4, 'BBQU-2 Sub event', 7);
    commit;
    Thanks a lot

    Is this OK?
    select
       event_id,
       event_name,
       subevent_id
    from no_more_ike
    start with SUBEVENT_ID is null
    connect by prior EVENT_ID = SUBEVENT_ID
    order by decode(subevent_id, null, event_id, subevent_id) asc;

  • Ive been trying to export or share my imovie video and every time the i movie crashes and its just pulls up a report. I need to export this movie now and it is fairly complicated please help me. It  even crashes when ever i try to play it on full screen

    My i movie keeps on crashing when ever i try to share it or play it in fullscreen . How do i save it and not loose the movie!

    Hi
    This is bit of a Nightmare situation - and there can be a zillion reasons for why it goes wrong. See if You might find help in my list.
    When iMovie doesn't work as intended this can be due to a lot of reasons
    • iMovie Pref files got corrupted - trash it/they and iMovie makes new and error free one's
    • Creating a new User-Account and log into this - forces iMovie to create all pref. files new and error free
    • Event or Project got corrupted - try to make a copy and repair
    • a codec is used that doesn't work
    • problem in iMovie Cache folder - trash Cache.mov and Cache.plist
    • version miss match of QuickTime Player / iMovie / iDVD
    • preferences are wrong - Repair Preferences
    • other hard disk problem - Repair Hard Disk (Disk Util tool - but start Mac from ext HD or DVD)
    • External hard disks - MUST BE - Mac OS Extended (hfs) formatted to work with Video
    ( UNIX/DOS/FAT32/Mac OS Exchange - works for most other things - but not for Video )
    • USB-flash-memories do not work
    • Net-work connected hard disks - do not work
    • iPhoto Library got problems - let iPhoto select another one or repair it. Re-build this first then try to re-start iMovie.
    This You do by
    _ close iPhoto
    _ on start up of iPhoto - Keep {cmd and alt-keys down}
    _ now select all five options presented
    _ WAIT a long long time
    • free space on Start-Up (Mac OS) hard disk to low (<1Gb) - I never go under 25Gb free space for SD-Video (4-5 times more for HD)
    • external devices interferes - turn off Mac - disconnect all of them and - Start up again and re-try
    • GarageBand fix - start GB - play a few notes - Close it again and now try iMovie
    • Screen must be set to million-colors
    • Third-party plug-ins doesn't work OK
    • Run "Cache Out X", clear out all caches and restarts the Mac
    • Let Your Mac be turned on during one night. At about midnight there is a set of maintenance programs that runs and tidying up. This might help
    • Turn off Your Mac - and disconnect Mains - for about 20-30 minutes - at least this resets the FireWire port.
    • In QuickTime - DivX, 3ivx codec, Flip4Mac, Perian etc - might be problematic - temporarily move them out and re-try
    (I deleted the file "3ivxVideoCodec.component" located in Mac HD/Library/Quicktime and this resolved my issue.)
    buenrodri wrote
    I solved the problem by removing the file: 3ivxVideoCodec.component. after that, up-dated iMovie runs ok.
    Last resort: Trash all of iMovie and re-install it
    Yours Bengt W

  • Dynamic sort help needed

    I am trying to implement a dynamic sort using pl/sql procedure
    with two IN params, which tell what column to sort by
    and wich direction. smth. like this
    procedure getEmployees (p_dept_no in employee.dept_no%type,
    p_sortBy in varchar2,
    p_sortDir in varchar2
    p_empl_cur in out emplCur
    ) is
    begin
    OPEN p_empl_cur
    FOR
    SELECT EMP_ID, F_NAME, L_NAME
    FROM EMPLOYEE
    WHERE DEPT_NO=p_dept_no
    ORDER BY p_sortBy p_sortDir ; --> this is the part that does not work
    -- I make sure that the params values are correct
    -- possible p_sortBy values: EMP_ID, F_NAME, L_NAME
    -- and p_sortDir: 'ASC' or 'DESC'
    end getEmployees;
    Thank you in advance.

    Try execute immediate.
    Some thing like this:
    PROCEDURE GETEMPLOYEES (P_DEPT_NO IN EMPLOYEE.DEPT_NO%TYPE,
    P_SORTBY IN VARCHAR2,
    P_SORTDIR IN VARCHAR2
    P_EMPL_CUR IN OUT EMPLCUR
    ) IS
    BEGIN
    OPEN P_EMPL_CUR
    FOR
    SORT_SQL := NULL;
    SORT_SQL := 'SELECT EMP_ID, F_NAME, L_NAME FROM EMPLOYEE'||
    ' WHERE DEPT_NO=P_DEPT_NO '||
    ' ORDER BY '||P_SORTBY||' '||P_SORTDIR||';'
    EXECUTE IMMEDIATE SORT_SQL INTO P_EMPL_CUR;
    Thanks
    Vasu
    I am trying to implement a dynamic sort using pl/sql procedure
    with two IN params, which tell what column to sort by
    and wich direction. smth. like this
    procedure getEmployees (p_dept_no in employee.dept_no%type,
    p_sortBy in varchar2,
    p_sortDir in varchar2
    p_empl_cur in out emplCur
    ) is
    begin
    OPEN p_empl_cur
    FOR
    SELECT EMP_ID, F_NAME, L_NAME
    FROM EMPLOYEE
    WHERE DEPT_NO=p_dept_no
    ORDER BY p_sortBy p_sortDir ; --> this is the part that does not work
    -- I make sure that the params values are correct
    -- possible p_sortBy values: EMP_ID, F_NAME, L_NAME
    -- and p_sortDir: 'ASC' or 'DESC'
    end getEmployees;
    Thank you in advance.

  • HT1414 HElP i got my iprhone 4 stuck in recovery mode  trying to update to I0s 7.  I have watched youtube videos but nothing works i have only 8g i dont know if that has something to do with it.  I dont want to download any complicated files Help me!!

    I got my phone stuck in recovery mode while  trying to update I0S 7.  I have watched countless youtube videos and read multiple articles to try and resolve this issue.  I have done everything but, When i try to take it out of recovery mode as shown it puts it right back in recovery mode.  This is a very annoying.  Please Help Me

    When your phone is in recovery mode, it's like it crashed.  The only way that you can get it out of recovery mode is by restoring, and this erases all your data as well.   
    You can believe what you wish by "reading all over the internet".  This is Apple's technical support forum.  We do know what we're talking about.
    since you have very important photos on your phone, why haven't you been importing them to your computer as soon as possible after taking them?  This is how the phone is meant to be used.  Keeping critical data on only a device which can be easily stolen, dropped and broken is just plain foolish.  Also, did you not back up your phone (as you should be doing with any computer) before attempting any operating system update?  As you've now just painfully learned, updates do not always go as planned.
    I'm sorry for your data loss, but let this be a very important lesson.  BTW, when was the last time you backed up your computer?  I'm sure you have important data on your computer.  Hard drives WILL fail.

  • Sort me out! Sorting help

    I am working on a project for class that simulates a card game. I need to group the cards by suit and arrange the cards in decreasing order within that suit. I am going to put all of the hearts in one array, clubs in another, and so on. However, I can not figure out how to sort the array (lets say hearts for this example) so that the numbers appear in decreasing order. The code below is my most recent snippet and it gives me an out of bounds error. FYI, the array is an array of card objects. The getValue method pulls an integer value from 1 to 13 depending on the card. PLEASE SAVE ME!!!
    //Arrange the hearts in decreasing order
    for(int i=0; i < hearts.length; i++){
    for(int j=0; j < hearts.length; j++){
    if(hearts[j].getValue() > hearts[j+1].getValue()){
    temp [0]=hearts[j];
    hearts[j] = hearts[j+1];
    hearts[j+1] = temp [0];
    }

    if(hearts[j].getValue() > hearts[j+1].getValue()){
    temp [0]=hearts[j];
    hearts[j] = hearts[j+1];
    hearts[j+1] = temp [0];
    } What happens when getValue() returns 13? Figure that out and you will find the reason for your ArrayOutOfBoundsException. [Hint: walk through your code with the j=13).
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

Maybe you are looking for

  • Enhancement for tax line items to post Business area level

    Hi Gurus, My Client has Business area at state wise. he wants to state wise Tax reports. Can any one help me how to post tax line items at Business area level. Please help me if any one know how to do Enhancement on this. Appreaciate your great help.

  • How to synchronize analog input and output from two different USB daq boards

    Hi all, I have two very differnt USB boards the NI USB 6008, which I am using to acquire the data (Analog Input) and a NI USB 9263, it is an Analog Output only board that I am using to deliver a signal (in this case a square pulse). The reason why I

  • IDVD opened and shut down

    I clicked iDVD to open and it s opening and shut down again and again. Any solution for that? Jerome

  • Derive project file from compiled chm file

    Hello. I have CHM file which I wish to edit. I can de-compile using HTML Help Workshop, but I do not get the Project file, which I need to import back into Robohelp. Can anyone tell me how to do this derivation? I need to use Robohelp for this action

  • Setting a default servlet

              i need to do considerable pre-processing of requests and would like           to isolate all the pre-processing logic to one servlet. the default           servlet ( as far as I understand ) is served when a resource cannot           be fou