Need to sort two vectors at the same time! please help!

I have
vectorA: 2 4 9 1 7 6 8
vectorB: two four nine one seven six eight
i want to sort these two vectors in parallel
what is the best way?
i could just do Collection.sort(vectorA) and get
1 2 4 6 7 8 9
but i want the vectorB to have a corresponding order
please help!!
thanks

public class Pair implements Comparable {
private int value;
private String name;
public int getValue() {
return this.value;
public void setValue(int value) {
this.value = value;
public String getName() {
return this.name;
public void setName(String name) {
this.name = name;
public int compareTo(Object o) {
Pair that = (Pair) o;
return this.value - that.value;
place both in a Collection (vector is a bad choice if you are going to do sorting LinkedList is better) the Collections.sort method will sort
according to the compareTo method.

Similar Messages

  • "Newbie" Unable to run two actions at the same time please help

    Hello
    I'm a newbie (2 weeks) on Labview, so I hope my problem will sound easy for some of you.
    I want to read a file and at the same time get the reading from my sensors (4 sensors).
    My program is working when I do each thing in a different program but when I add them the program only read the text file and stop reading the sensor signals...I attach the program file.
    The goal is with the text file to add an exact time for each sensor signal I record.
    Is there any other possibilities to include a time with the sensors signals recorded ? I need to do this to synchronize the sensors values with CAM program.
    Thanks
    /Xavier
    Ps I used a scan rate of 12000/s but I try 1000/s
    and the sensor acquisition is still not working
    Attachments:
    test3Rdif2802.vi ‏493 KB
    readfile.txt ‏195 KB
    sensoracquisition30s.txt ‏210 KB

    from a glance at your code, it appears that you have nested a loop to read your file, inside a loop to read your sensors. this means the nested loop to read your file must finish before the outside loop to read your sensors can run through another iteration. what you want to do is separate the two loops to run independently of each other (in parallel). use a global variable to know when to stop the loop (if they need to stop at the same time) and if you need to pass data between the loops use a queue (easiest) or you can also use globals with semaphores.

  • Debug 2 servlets at the same time please help!!!!

    I am using JDeveloper 3.1 and trying to Debug 2 servlets at the same time. I can debug either servlet individually, but I cannot seem to call Servlet 2 from Servlet1 while debugging. I keep getting Web-to-go cannot find URL. What am I doing wrong.
    Whenever I run a servlet in the debugger, the url shows: http://<myserver>/servlets/servlet regardless of the name of the servlet.
    How do I debug 2 servlets at the same time.

    Hi,
    It depends on how you call the second servlet from the first. You want to make sure to use a relative URL.
    For example, if both of your compiled servlet classes are in JDEV_HOME\myclasses\ServletProject, then make sure to call servlet2 from servlet1 directly. If servlet2 is in JDEV_HOME\myclasses\OtherServlets, then you want to use '..\OtherServlets\servlet2'
    I'm not sure why it resolves the url to servlets\servlet for everything.

  • Need to Open Two Windows at the same time

    Hi All ,
    I have a requirement wherein I am opening a new page when the user presses a link . The information displayed to the user in the new page is Read-Only.To display the reqd info on the new page I pass some parameters encoded in the page call URL.
    Besides , displaying the info in the new page , it is imperative that i allow the user to continue performing some transactions in the current page (calling page).
    However , i am not able to achieve the same . If I use 'retainAM=Y' in the URL then i pass the Session Control from the calling page to the called page . So that option is out.
    Can u suggest something wherein i am able to pop-up a new page to the user , but still not loose the session control from the current page.
    It is necessary that the user has both windows open to perform the transactions.
    Thanks
    Chirag

    Senthil
    I need to clarify some things . I cannot create an OA Function as you have earlier advised . Lets say its a constraint i have. My scenario is that i have to prepare a HyperLink Declaratively . In that i am currently giving _Blank as the target .
    Now i want to open the new page and still allow the user to perform some transactions in the original page while the new page is still open . How should i go abt maintaining my AM from original page.
    Following are the scenarios i have already tried out.
    1) I have opened the the new page and released my application module in that page . This didnt work .
    2) I have tried doing retainAM=N . This also does not work.
    3) Using PopUp is not an option since i cant create OAFunction .
    Are their any other way . When i open a new window thru a current window , my AM gets transferred to the new window . Hence i am not able to perform any transactions on that the original page . How can u release the AM On click of a link ?
    Pls Suggest
    Thanks
    Chirag

  • Sorting two Jtables at the same time

    Hello
    I have a problem and I don't know how to solve it.
    I have two Jtables because I need to have some colums fixed and the others can be in a scrollpane. The problem is when I want to sort them. If I sort one the other is not sorted. I use TableSorter from Sun. Let's see a piece of my code:
                TableSorter sorterFixed = new TableSorter(modelFixed);
                fixedTable = new JTable(sorterFixed);           
                sorterFixed.setTableHeader(fixedTable.getTableHeader());
                TableSorter sorter = new TableSorter(model);
                table = new JTable(sorter);
                sorter.setTableHeader(table.getTableHeader());
                jScrollPane = new JScrollPane(table);Anyone knows how can I do it?
    Thanks !!!

    I haven't tested this.. try and let us know
    I guess, TableSorter will fire "fireTableDataChanged()". You can listen for this and update the next table.

  • Drag two items at the same time

    I need to drag two items at the same time using the jqueryUI draggable widget; as in I'll drag one of the items, and the other one should stick to it.
    Is this possible ?

    Thanks for your reply. I fond a way to do this although this is not copy/paste.
    1. Open "iMovie Projects" folder and find the project that contains voiceover file
    2. Right click and select "Show Package Contents"
    3. Drag and drop "Voiceover Recording.aiff" file to a project I want to copy/paste
    In this way you don't need to use iTunes or other software to move around audio files.

  • Write a progarm to test two parts at the same time

    Hi:
    I need to write a program in LabView that is capable of testing two parts at the same time.
    Explanation:
    I star the test on a unit, once all the electrical test is done move that unit to the pressure test without loosing the current test information and continue the test of the unit thewn generate a serial number only if it passes all the test. Then while the previous unit is going thru the pressure test star testing another unit for the elecrical test and so on.
    I am using LabView 2012

    From what you have described, I agree with what has been answered above. TestStand is specifically designed for. If you would like to provide more information about your application we could give you a more detailed response. For more information about TestStand follow this link
    www.ni.com/teststand
    Ryan
    Ryan
    Applications Engineer
    National Instruments

  • One again, "can I use CC on two computers at the same time?" - in practice.

    I know this has been asked before and all those threads are locked. Many asked the question, but I haven't found a satisfying answer yet.
    Can I multi task with CC?
    I want to have my laptop next to my desktop. And while I render, export or whatever my newly shot documentary on the laptop I want to work with a music video project on my desktop. Then when the render is finished I render the music video and go back to the laptop and continue on the documentary. Or maybe I just work 5 minutes on the desktop music video, then come up with something brilliant for the project on the laptop and switch. Back and forth. Will that kind of activity result in any kind of limitation, usage-wise?
    So, working on Premiere on my two computers at the same time.. is it possible? Technically? I know the EULA says "only one person". But will it let one person mutli task?
    I need to know this before I buy. sorry for asking this again, please bless me with a clear answer

    Hi Jimmy Crim,
    Yes in case of Creative cloud subscription you are allowed to install and use the cc apps in any two machines.
    Even if you want you care allowed to use these apps together in both the machines.
    Thanks
    Kapil

  • Can I access two websites at the same time?

    Does Dreamweaver have the ability to open two websites at the same time?
    I basically have a CMS hosted on one server, that connects to my clients sites on other servers. I want to be able to open files on one server and edit them and also edit files on another server at the same time.
    If this isn't available in Dreamweaver, then I think it should be. I often need to copy code from one page in a site to another page in different site. To have the ability to have two windows open, each connected to a different website server would be invaluable to me. By having separate windows, each can have its own server connection. I don't know how easy that would be, but I'd love it!
    Cheers
    Glynn

    You can only connect to one site at a time.  And you need to edit files locally, save & then upload to the remote server.   AFAIK, no single FTP app is capable of connecting to more than one server at a time.  You might be able to do what you want with DW open and an additional 3rd party FTP client like Filezilla, each connecting to different servers.
    Nancy O.

  • How can I open two libraries at the same time on itunes?

    Hey i need help on opening two libraries at the same time on itunes. I don't know if that is possible but need some advice if its possible. I already have several libaries but I need to compare labaries at times due to various users on my computer. Please help .

    Not that I'm aware of. What exactly is that you want to achieve? There are tools for scanning media folders and adding any files not listed in the library, or deleting those that no longer exist. There are also ways to use one library for multiple users so that any tag update gets applied for everyone.
    tt2

  • How to make this two things at the same time ?

    Hello
    When my mouse is on a area, I need :
        -  to show a object (a rectangle inserted with the toolbar)
        -  to show a caption
    I think it's not possible to do this two things at the same time when I use the rollover functions (Rollover caption or Rollover Image).
    I would like to use a button, but the button works only if I click it, and not when I just pass my mouse on it.
    Someone have an Idea?
    I can't use Javascript.
    Thanks

    Rick is correct.  You can use the Rollover Slidelet's rollover area to trigger an Advanced Action.  You'll need to create this Advanced Action with two clauses.  One to SHOW the caption, and the other to SHOW the rectangle.
    Your alternative to the rollover slidelet is to use an Event Handler widget attached to the object that the mouse should roll over.
    The Event Handler will detect when the mouse is over the object and trigger its own Success criteria.  You can then use the widget's ON Success event to trigger the Advanced Action as mentioned above.
    More information about using the Event Handler here: http://www.infosemantics.com.au/adobe-captivate-widgets/download-free-trial-widgets
    An example of using it to do two different things on the same object can be found at this web page: http://www.infosemantics.com.au/adobe-captivate-advanced-elearning-tutorials/beat-adobe-ca ptivate-interactive-catch22
    Trial versions of the widget can be downloaded from here:  http://www.infosemantics.com.au/adobe-captivate-widgets/download-free-trial-widgets

  • Re: if weblogic can serve two ports at the same time?

    That's not true. WebLogic supports a non-secure and secure listener port at the
    same time. That was one of the selling points for my organization.
    Michael Girdley wrote:
    If, you mean the same port on two different IP addresses, then the answer is
    yes.
    If, you mean two different ports on the same IP address, then the answer is
    no.
    Thanks,
    Michael
    Michael Girdley
    Product Manager, WebLogic Server & Express
    BEA Systems Inc
    fxy <[email protected]> wrote in message
    news:8fdk99$t9$[email protected]..
    <URGENT QUESTION>
    I'd like to know if weblogic can support two ports at the same time.
    thank you in advance.
    <URGENT QUESTION>

    Well, the question was really meant to see if any change was made to WL to support
    this, not because I didn't believe Michael Girdley.
    P.S., this is something Websphere 4.0 let's you do...In case this encourages someone
    to add this support.
    "Mike Reiche" <[email protected]> wrote:
    >
    If you don't believe Michael Girdley, then I don't know why you would
    believe anyone
    else. I believe the answer is still 'no'.
    Why do they 'have to be on different ports'? We block requests by URI
    - so just
    block all requests to /youradminapp/* at the firewall. Or you can block
    them at
    your Web Server. Or restrict them by user in WL.
    Mike
    you"Anil Arora" <[email protected]> wrote:
    Is it still true that WL 6.0 cannot host multiple (non-secure) HTTPports
    on one
    server? We need this capability within one JVM to allow one web application
    to
    be accessed from one port while another through a second port. Forexample,
    we
    have a application to be exposed through the firewall at port 7001.
    Then we have
    another admin application to only be accessed within the firewall. But
    they need
    to be deployed within the same JVM since they may have shared statebetween
    them.
    Thanks,
    Anil
    "Michael Girdley" <[email protected]> wrote:
    I'm sorry, to clarify my statement: I was speaking about nonsecure
    communications. Weblogic can only support one listener port at a time.
    Thanks,
    Michael
    Michael Girdley
    Product Manager, WebLogic Server & Express
    BEA Systems Inc
    Allen Akers <[email protected]> wrote in message
    news:[email protected]...
    That's not true. WebLogic supports a non-secure and secure listenerport
    at the
    same time. That was one of the selling points for my organization.
    Michael Girdley wrote:
    If, you mean the same port on two different IP addresses, then
    the
    answer is
    yes.
    If, you mean two different ports on the same IP address, then theanswer
    is
    no.
    Thanks,
    Michael
    Michael Girdley
    Product Manager, WebLogic Server & Express
    BEA Systems Inc
    fxy <[email protected]> wrote in message
    news:[email protected]...
    <URGENT QUESTION>
    I'd like to know if weblogic can support two ports at the same
    time.
    thank you in advance.
    <URGENT QUESTION>

  • Can I shuffle two playlists at the same time?

    How can I shuffle two playlists at the same time?  Thank you.

    You can only connect to one site at a time.  And you need to edit files locally, save & then upload to the remote server.   AFAIK, no single FTP app is capable of connecting to more than one server at a time.  You might be able to do what you want with DW open and an additional 3rd party FTP client like Filezilla, each connecting to different servers.
    Nancy O.

  • Can i run two widgets at the same time on the same page?

    Can i run two widgets at the same time on the same page?
    Hi
    I have created and published 4 free ibooks and i would to run two widgets
    - a countdown clock
    - a review test
    at the same time on the page. Can i do that?
    Thanks in advance
    Haris

    thanks for your answer. Yes indeed HTML widgets run only full screen (snif snif). I consider this as a "distinguishing treatment".
    One solution  i read !!!!! was to create through keynote a countdown clock, to export to quicktime move and to imported at iBA predefined widgets. of course this is not the solution i need.
    So, in order to have at the same widget and run together a count down clock and a preview test (20 questions)  i must
    1)"hack" the preview widget and insert a countdown clock
    2) create a preview test using iAD.....
    thanks again
    haris

  • Can I call two numbers at the same time on facebook?

    Can I call two numbers at the same time on facebook?

    thanks for your answer. Yes indeed HTML widgets run only full screen (snif snif). I consider this as a "distinguishing treatment".
    One solution  i read !!!!! was to create through keynote a countdown clock, to export to quicktime move and to imported at iBA predefined widgets. of course this is not the solution i need.
    So, in order to have at the same widget and run together a count down clock and a preview test (20 questions)  i must
    1)"hack" the preview widget and insert a countdown clock
    2) create a preview test using iAD.....
    thanks again
    haris

Maybe you are looking for

  • Burn avi to dvd using idvd

    i dont have idvd, i dont even have a mac so this may be a really stupid question, but is it possible to convert an avi file and then burn it to dvd using idvd? for example if a had a film in avi could i put it on a dvd to watch on a dvd player?

  • What's the best way for reading this binary file?

    I've written a program that acquires data from a DAQmx card and writes it on a binary file (attached file and picture). The data that I'm acquiring comes from 8 channels, at 2.5MS/s for, at least, 5 seconds. What's the best way of reading this binary

  • In combobox 'g' is getting cut off, 'g' is not fully visible

    Hi Flex people, I am facing problem in combobox, I have the items : 'moon' , 'manager' , 'marketing' in the combobox. The text 'moon' is fully visible, but the in text 'manager' , 'g' is cut off, means character 'g' is not fully visible. Please give

  • Is passing prompts with opendocument possible

    Hi, I want to open a Design Studio file over the web. I use the opendocument link out of Infoview. My goal is to pass Parameters to the opendocument link. I want to be able to call Design Studio Files from an BO document or to include Design Studio i

  • Show Item Info doesn't work for folders in Spotlight privacy list?

    Hi. I have many images in many folders, and since upgrading to Leopard, none of them show the image dimensions when the "Show Item Info" is checked. As far as I can tell, the only thing difference about this group of files and folders is that it has