Use ArrayList vs Vector

I'm writing an application that accept multiple connections.
To check the connections I have a thread that check these connections if they are in use, i iterate over these connections and if they are not used for a periode of time, i close this connection and remove them from my list and iterate further.
If i use a Vector to collect the connections, everything goes fine, but if i use a Arraylist, i get a concurrentmodificationexception, i now, this is normal, because the failfast of the iterator, so, i used the synchronize method of collections, but i got the same exception,
any suggestions to make ik work with an ArrayList.

If i can make it work with a list i'me happy, i will try it with a linked list, thx
Heres the code of the methode
public void run() {
while (true) {
try {
     Enumeration enum = null;
     sleep(frequency);
     long currTime = System.currentTimeMillis();
     enum = TimeoutInputStream.instanceList.elements();
     while (enum.hasMoreElements()) {
TimeoutInputStream stream =
     (TimeoutInputStream) (enum.nextElement());
//ITERATOR FAILS HERE
     long lastActive = stream.getLastActive();                    System.out.println(".");
     if (lastActive == 0) {
          stream.setLastActive(currTime);
     } else if ((currTime - lastActive) > timeout) {
          stream.abort();
//HERE DO I REMOVE THE CONNECTION OUT OF THE LIST
          System.out.println("Timeout: input stream aborted");
     } catch (InterruptedException e) {
          System.out.println(e);

Similar Messages

  • Should we use ArrayList or Vector?

    Should we use ArrayList or Vector in web programming environment?
    thanks,

    I used to use ArrayList everywhere since it was a newer class and recommended in books, but use Vector now because it is used in several key environments: Java 1 (Web browsers), Swing and J2ME. In Java2, Vector was retrofitted to use the Collections framework, so Vector implements List.
    Anyway, you should probably deal with only the List interface anyway so whichever you decide will be localized. That way, if Sun suddenly stops supporting Vector, you will only need to make a change in one place.
    List mylist = new Vector();

  • Reading Individual Lines of Text Into An ArrayList or Vector From A File

    I am trying to read each individual line of text of a .txt file into an ArrayList or Vector. I seem to get the same results no matter which Object I am using (ArrayList or Vector). The text file is a comma-delimited text file to be used as a database. I want to separate each line as an individual record then dump it into an ArrayList or Vector and have them loop through a StringTokenizer() class so that I can be sure each line has the correct number of fields before I commit it to a serialization file. Currently, the proper amount of records seems to be forming in the initial part of the program, I am just remiss at properly placing them in the Vector, or StringTokenizer classes so I can further manipulate them. I'm using the LineNumberReader class to get line numbers to use as record numbers and for loop indexes. I'm not sure (obviously) if this is a correct way to do it or not.
    Any help is greatly appreciated in advance.
    Thanks for all your time.
    int n = 0;
              try {
                    * read each individual line and count it as a separate record. 
                    * place each record into an array or may be a string if it has 9 tokens
                    * if a record hasn't got 9 tokens, it isn't a record
                    * place each array or string into a Vector
                   in = new LineNumberReader(new FileReader(filename));
                             while ((record = in.readLine()) != null) {
                             n = in.getLineNumber();
                             rawData = new Vector();     
                             for (int i = 0; i < n; i++) {
                                  rawData.add(record);     
                             if (record == null)
                             break;
    *The following System.out.println() statement shows that all lines are correctly retrieved from the text file
    *as separate records
                        System.out.println("Record No. " + n +  "= " + record);     
                   //Debug
    /** When these print lines execute it reveals that only the last record has been inserted into the Vector as
    *    many times as I have records in the text file.
                        System.out.println("Number of Records = " + n);
                        System.out.println("VectorSize = " + rawData.size());
                        System.out.println("First rawDataElement = " + rawData.firstElement());
                        System.out.println("Second rawDataElement = " + rawData.get(1));
                        System.out.println("Third rawDataElement = " + rawData.get(2));
                        System.out.println("Fourth rawDataElement = " + rawData.lastElement());
    *  Next run each record through a StringTokenizer to be sure that there the correct number of fields present
    *  If it contains the correct number of fields, dump it into an alternate ArrayList or Vector.
    *  As it is now, the StringTokenizer gives a NullPointerException
                        for (int i = 0; i < n; i++) {
                             StringTokenizer recordSet = new StringTokenizer((String) table.get(n), ",");
                                 while (recordSet.hasMoreTokens()) {
                                     if (recordSet.countTokens() == 9) {
                                           data = new Vector();
                                           data.add((Object) recordSet.nextToken(","));
                                           System.out.println("Vector data size = " + data.size());
                                           System.out.println("Second dataElement = " + data.get(0));
                            System.out.println("String Tok recordSet = " + recordSet.countTokens());                                  System.out.println("Number of Records = " + n);
                        System.out.println("First dataElement = " + data.firstElement());
                        System.out.println("Second dataElement = " + data.get(0));
                        System.out.println("Third dataElement = " + data.get(2));
                        System.out.println("Fourth dataElement = " + data.lastElement());
                   } catch (FileNotFoundException e) {
                        System.out.println(e);
                   } catch (IOException e) {
                        System.out.println(e);
         }

    I think your logic is broken.
    rawData = new Vector();
    creates a new instance of Vector for every record.
    Your add() within a for loop adds the same record to the Vector n times. I think what you really want is something like this:in = new LineNumberReader(new FileReader(filename));
    rawData = new Vector();
    while ((record = in.readLine()) != null) {
        n = in.getLineNumber();
        rawData.add(record);     Mark

  • Reading & writing to file using ArrayList String incorrectly (2)

    I have been able to store two strings (M44110|T33010, M92603|T10350) using ArrayList<String>, which represent the result of some patient tests. Nevertheless, the order of these results have been stored correctly.
    E.g. currently stored in file Snomed-Codes as -
    [M44110|T33010, M92603|T10350][M44110|T33010, M92603|T10350]
    Should be stored and printed out as -
    M44110|T33010
    M92603|T10350
    Below is the detail of the source code of this program:
    import java.io.*;
    import java.io.IOException;
    import java.lang.String;
    import java.util.regex.*;
    import java.util.ArrayList;
    public class FindSnomedCode {
        static ArrayList<String> allRecords = new ArrayList<String>();
        static public ArrayList<String> getContents(File existingFile) {
            StringBuffer contents = new StringBuffer();
            BufferedReader input = null;
            int line_number = 0;
            int number_of_records = 0;
            String snomedCodes = null;
            ArrayList<String> complete_records = new ArrayList<String>();
            try {
                input = new BufferedReader( new FileReader(existingFile) );
                String current_line = null;
                while (( current_line = input.readLine()) != null) {
                    // Create a pattern to match for the "\"
                    Pattern p = Pattern.compile("\\\\");
                    // Create a matcher with an input string
                    Matcher m = p.matcher(current_line);
                    boolean beginning_of_record = m.find();
                    if (beginning_of_record) {
                        line_number = 0;
                        number_of_records++;
                    } else {
                        line_number++;
                    if ( (line_number == 2) && (current_line.length() != 0) ) {
                        snomedCodes = current_line;
                        System.out.println(snomedCodes);
                        complete_records.add(current_line);
            catch (FileNotFoundException ex) {
                ex.printStackTrace();
            catch (IOException ex){
                ex.printStackTrace();
            finally {
                try {
                    if (input!= null) {
                        input.close();
                catch (IOException ex) {
                    ex.printStackTrace();
            return complete_records;
        static public void setContents(File reformatFile, ArrayList<String> snomedCodes)
                                     throws FileNotFoundException, IOException {
           Writer output = null;
            try {
                output = new BufferedWriter( new FileWriter(reformatFile) );
                  for (String index : snomedCodes) {
                      output.write( snomedCodes.toString() );
            finally {
                if (output != null) output.close();
        static public void printContents(File existingFile) {
            StringBuffer contents = new StringBuffer();
            BufferedReader input = null;
            int line_number = 0;
            int number_of_records = 0;
            String snomedCodes = null;
            try {
                input = new BufferedReader( new FileReader(existingFile) );
                String current_line = null;
                while (( current_line = input.readLine()) != null)
                    System.out.println(current_line);
            catch (FileNotFoundException ex) {
                ex.printStackTrace();
            catch (IOException ex){
                ex.printStackTrace();
            finally {
                try {
                    if (input!= null) {
                        input.close();
                catch (IOException ex) {
                    ex.printStackTrace();
        public static void main (String args[]) throws IOException {
            File currentFile = new File("D:\\dummy_patient.txt");
            allRecords = getContents(currentFile);
            File snomedFile = new File( "D:\\Snomed-Codes.txt");
            setContents(snomedFile, allRecords);
            printContents(snomedFile);
    }There are 4 patient records in the dummy_patient.txt file but only the 1st (M44110|T33010) & 3rd (M92603|T10350) records have results in them. The 2nd & 4th records have blank results.
    Lastly, could someone explain to me the difference between java.util.List & java.util.ArrayList?
    I am running Netbeans 5.0, jdk1.5.0_09 on Windows XP, SP2.
    Many thanks,
    Netbeans Fan.

    while (snomedCodes.iterator().hasNext())
      output.write( snomedCodes.toString() );
    }Here you have some kind of a list or something (I couldn't stand to read all that unformatted code but I suppose you can find out). It has an iterator which gives you the entries of the list one at a time. You keep asking if it has more entries -- which it does -- but you never get those entries by calling the next() method, so it always has all the entries still available.
    And your code inside the loop is independent of the iterator, so it's rather pointless to iterate over the entries and output exactly the same data for each entry. Even if you were iterating correctly.

  • Exporting to PDF - How Can I Get A Small File Size When Using Lots of Vector Art?

    I am trying to create a small PDF file for e-book distribution purposes. My Indesign pages contain a variety of photographs, vector icons and vector maps.
    A publisher in Britain who does similar books on a Mac using Creative Suite was able to create a 22-page document very similar to mine (similar icons, graphics, density, etc) that is only 2.84 mb, a small fraction of the file size that I'm getting! I've included a sample page of his below, which is a low-res jpeg, but on the original PDF all of the text and images (except the jpeg cliff background) are super sharp - they look like vectors when you zoom in. I've also included screenshots of his PDF export settings.
    I don't know if he's exporting directly out of Indesign, but my best guess is that he is.
    My vector-based icons, numbers and maps are bloating my PDFs considerably. When I remove them, the Indesign and exported PDF file sizes drop dramatically. For the life of me, I can't figure out how he got such small PDF files sizes using so much vector art! The PDF graphic compression settings don't seem to include any options for vector art.
    My vector art graphics (numbering, icons, maps) are all saved as Illustrator AI files and then placed in Indesign as linked graphics. My best guess as to why I can't achieve smaller PDF files is I'm either doing something wrong with the vector graphics themselves or handling/exporting them improperly out of Indesign.
    I am using CS4 for PC and am on a Dell Machine running Windows 7.

    I am trying to create a small PDF file for e-book distribution purposes. My Indesign pages contain a variety of photographs, vector icons and vector maps.
    A publisher in Britain who does similar books on a Mac using Creative Suite was able to create a 22-page document very similar to mine (similar icons, graphics, density, etc) that is only 2.84 mb, a small fraction of the file size that I'm getting! I've included a sample page of his below, which is a low-res jpeg, but on the original PDF all of the text and images (except the jpeg cliff background) are super sharp - they look like vectors when you zoom in. I've also included screenshots of his PDF export settings.
    I don't know if he's exporting directly out of Indesign, but my best guess is that he is.
    My vector-based icons, numbers and maps are bloating my PDFs considerably. When I remove them, the Indesign and exported PDF file sizes drop dramatically. For the life of me, I can't figure out how he got such small PDF files sizes using so much vector art! The PDF graphic compression settings don't seem to include any options for vector art.
    My vector art graphics (numbering, icons, maps) are all saved as Illustrator AI files and then placed in Indesign as linked graphics. My best guess as to why I can't achieve smaller PDF files is I'm either doing something wrong with the vector graphics themselves or handling/exporting them improperly out of Indesign.
    I am using CS4 for PC and am on a Dell Machine running Windows 7.

  • FETCHING DATA FROM A TABLE USING ARRAYLIST

    how can we fetch data from database using arraylist????

    Hi ,
    This is the way to fetch data into 2d array , you can customize to fetch in array list .
    we will assume that we have stm as Statement and rs as ResultSet
    rs = stm.executeQuery("select * from emp");
    int noOfColumns = rs.getMetaData.getColumnCount();
    rs.last();
    int noOfRows = rs.getRow;
    rs.befpreFirst();
    String [][] result = new String[noOfRows][noOfColumns];
    for(int i = 0 ; i<noOfColumns;i++){
    rs.next();
    for(int y = 0;y<noOfColumns;y++){
    result[i][y]=rs.getString(y+1);
    rs.close;

  • Method to return ArrayList or Vector doesn't work, why?

    Hi, I try to return a ArrayList or Vector from a method but it does not work.. wondering why and how to fix it? Thanks:)
    class Class1{
          public static main(...){
              Class2 test = new Class2();
              ArrayList<String> resp = test.class2method(...);
              if(resp.get(4).equals(...)) {        
    class Class2{
        public ArrayList class2method(int NumInt1, int NumInt2, ...) {
           ArrayList<String> arrayTesting = new ArrayList<String>(13);
           responses.set(2, Integer.toString(NumInt1));
           responses.set(3, Integer.toString(NumInt2));
           responses.set(4, Integer.toString(NumInt3));
           responses.set(5, Integer.toString(NumInt4));
           responses.set(6, Integer.toString(NumInt5));
           return responses;
    }

    what is responses? don't you want to return
    arrayTesting?yes, responses is arrayTesting, sorry did notmention
    that.what do you mean? is the code you posted a typo or
    what you actually have in your code?It's more than 1000 lines codes so I decided not to posted them but here is part of them. My point is that i tried to return a ArrayList or Vector even with a simple code, it does not work. Thanks for your help.
    public class DemoScript {
        public DemoScript() throws IOException {
            // register the shutdown hook
            Runtime.getRuntime().addShutdownHook(new Thread() {
                public void run() {
                    System.out.println("close prog");
                     endApp();
        public void endApp() {
            System.out.println("done!");
            System.exit(0);
         public static void main(String[] args) {
              Parameters p = new Parameters();
              VMF vm = null;
                   //Elements: [0]time, [1]MsgType, [2]NumInt1, [3]NumInt2, [4]NumInt3, [5]NumInt4, [6]NumInt5, [7]NumLong,
                   //               [8]String1, [9]String2, [10]String3, [11]String4, [12]String5
    //               ArrayList<String> responses = new ArrayList<String>(13);
              try {
                   MyScript my = new MyScript();
                   if(args.length == 5) {
                       p.vmHost = args[1]; p.vmPort = Integer.parseInt(args[2]);
                       p.guiHost = args[3]; p.guiPort = Integer.parseInt(args[4]);
                  } else if(args.length == 4) {
                       p.vmHost = args[1]; p.vmPort = Integer.parseInt(args[2]); p.guiHost = args[3];
                  } else if(args.length == 3){
                       p.vmHost = args[1]; p.vmPort = Integer.parseInt(args[2]);
                  } else if(args.length == 2){
                       p.vmHost = args[1];
                  } else {
                       System.out.println("Usage: java MyScript [port #] [voice mail hostname] <voice mail socket #> <GUI hostname> <GUI socket #>");
                       System.out.println("Default: <voice mail socket #> = "+p.vmPort+", <GUI hostname> = "+p.guiHost+", <GUI socket #> = "+p.guiPort);
                       System.exit(-1);
    //               String hostname;
                   //int port;
                   /* Check for input arguments */
                   //if(args[0] != null){
                   //     port = Integer.parseInt(args[0]);
                   //     hostname = args[1];
                   //} else {
                   //     port = 2000;
                   //     hostname = "10.0.0.228";
                   //System.out.println("tews");
                   vm = new VMF(p.vmHost, p.vmPort, p.guiHost, p.guiPort);
                   vm.logon();
                   //vm.portAbort(4);/*
                   vm.portCapture(3, 0);
                   //vm.portAbort(4);/*
                   //vm.portOnhook();
                   //vm.portOffhook();
                   ////vm.portStop(3);  //to stop a port current operation
                   //vm.portWaitring(); //vm will not resp until port detects ring
                   //vm.portOffhook();
                   //vm.portGetdigits(5, 7);
                   //vm.portDialdigits("201");
                   //for(int i=0;i<100000000;i++);
                   //vm.portCallprogress(3, 0, 10);
                   //System.out.println("d");
                   //for(int i=0;i<1000000;i++);
                   //vm.portGetdigits(5, 7);
                   //vm.portRecordfile(30, 1, "\\\\kanapak.ctlinc.local\\VMfiles\\test.wmv");
                   //vm.portClearDTMF();
                   //vm.portPlayfile("\\\\kanapak.ctlinc.local\\VMfiles\\test.wmv");
                   //vm.portPlayprompt(2);
                   //vm.portSpeaknumber(3845);
                   //vm.portSpeakdigits("1639123478866478909");//75655656566657867867*");
                   //vm.portExternalcall(4, "933");
                   ArrayList<String> response = vm.portInternalcall(2, "201");
                   System.out.println(response.get(4));
                   if(response.get(4).equals("DONE")) {
                        vm.portPlayprompt(1); vm.portPlayprompt(2);
                   } else if(response.get(4).equals("GONE")) {
                   vm.portSpeakttsstring("hello. This will create ");//a project with all of the proper SWT and JFace imports. Version 4.1.1 latest build released (SWT visual inheritance, enhanced SWT GridLayout support, non-visual beans, custom !!!SWT widgets, code generation enhancements, expose property, etc.)");
                   vm.portRelease();
                   vm.logoff();
                   vm = new VMF(p.vmHost, p.vmPort, p.guiHost, p.guiPort);
                   vm.logon();
                   vm.portCapture(Integer.parseInt(args[0]), 0);
                   vm.portOnhook();
                   vm.portOffhook();
                   //          vm.portGetdigits(5, 7);
                   //vm.portRecordfile(30, 1, "\\\\kanapak.ctlinc.local\\VMfiles\\test.wmv");
                   //vm.portClearDTMF();
                   //vm.portPlayfile("\\\\kanapak.ctlinc.local\\VMfiles\\test.wmv");
                   vm.portPlayprompt(86);
                   //          vm.portSpeaknumber(3845);
                   //vm.portSpeakdigits("1639123478866478909");//75655656566657867867*");
                   //vm.portExternalcall(4, "933");
                   //vm.portInternalcall(9, "82045");
                   //vm.portSpeakttsstring("hello. This will create");// a project with all of the proper SWT and JFace imports. Version 4.1.1 latest build released (SWT visual inheritance, enhanced SWT GridLayout support, non-visual beans, custom !!!SWT widgets, code generation enhancements, expose property, etc.)");
                   vm.portRelease();
                   vm.logoff();
              } catch (IOException e) {
                   e.printStackTrace();
              } catch (InterruptedException e) {
                   //catch "STOP PORT"
                   vm.logoff();
    class VMF {
        public ArrayList<String> portInternalcall(int rings, String dial_string) {
             if (logon_status == 0) {
                   System.err.println("Error: logon required");
                   logoff();closeAndExit();
              } else if (capture_status == 0) {
                   System.err.println("Warning: portCapture required");logoff();closeAndExit();
              } else if (rings <1 || rings >999 || !checkDigits(dial_string)) {
                   System.err.println("Warning: portInternalcall( [1-999] , \"[0-9,A-D,F,P,a-d,f,p,*,#]\" )");
             breakString(dial_string);
             ostruct.write("", "IVR", "123", 188, captured_port, rings, 0, 0, 0, 0, str1, str2, str3, str4, str5);
             sendToGUI("s", "", "IVR", "123", "188", Integer.toString(captured_port),
                       Integer.toString(rings), "0", "0", "0", "0", str1, str2, str3, str4, str5);
             readStream();
             recToGUI("r", Integer.toString(MsgType),Integer.toString(NumInt1),Integer.toString(NumInt2),
                        Integer.toString(NumInt3),Integer.toString(NumInt4),Integer.toString(NumInt5),
                        Integer.toString(NumLong),String1,String2,String3,String4,String5);
              responses.set(2, Integer.toString(NumInt1)); responses.set(3, Integer.toString(NumInt2));
              responses.set(4, Integer.toString(NumInt3)); responses.set(5, Integer.toString(NumInt4));
              responses.set(6, Integer.toString(NumInt5));
              return responses;
    }

  • How to Use the Scalable Vector Graphics API (JSR 226)

    im doin an Application with Maps and locations...
    i need 2 use the Scalable Vector Graphics API (JSR 226)..
    can anyone plz guide me to get it and use the API.. Im using netBeans 5.0
    it will be great help :)
    Regards
    Muhammedh aka MNM

    Thanks Rohan :)
    i did read some stuff from the URLs u gav me :)
    and I manage 2 solve the prob i had :) (Thank God)
    1. downloaded latest version of netBeans (5.5)
    2. Java SDK 6 :D...
    3. the key thing: Wireless tool kit for CLDC 2.5 Beta
    now when u create a project make sure u set the above given tool kit :)
    when u set it.. u get an option 2 select the APIs frm a List.. Check on SVG API :)...
    Other APIs Such as,
    * wireless Messaging API
    * Location API
    and many more...
    Cheers 2 Every1 :)
    regards
    Muhammedh

  • Cannot pass parameters from action class to jsp using arraylist

    hi all,
    Im using datasource for jdbc connection.now i want to pass the selected values in action class from database to a jsp page.I want to use arraylist.But im not familar with arraylist.can anybody help .plzzzzzzzzzzz

    You can use plain javabeans to transfer the data. Check out the jsp:usebean tag. If you don't know how to do, check out the Java EE tutorial: http://java.sun.com/javaee/5/docs/tutorial/doc/ Using javabeans in JSP pages starts halfway chapter 4.

  • How to create ADF selectManyChoice dynamically using arrayList?

    Hi,
    I am using JDEVADF_11.1.1.3.PS2_GENERIC_100408.2356.5660. I want to dynamically create selectManyChoice through my backing using and populating the same using ArrayList. Can anyone provide me sample code for the same?
    Thanks,
    Vikas

    Duplicate

  • Error while using Enumeration and Vectors

    Hi all,
    I am new bee in java i am using enumeration and vectors in my JSP page,
    i want to get the values from JSP page using enumeration and store then in Vector, below is the code, its giving errors saying ArrayIndexoutofException
    pls help, thanx in advance.
              while ( enum.hasMoreElements() )
              String enumString = (String)enum.nextElement();
              String[] enumValue =request.getParameterValues(enumString);
              for(int n=0;n<=enumValue.length;n++)
              tempbean.dbRows.add(enumValue[n]);     //tempbean.dbRows is a vector,
    if I seperate the For block out of While loop then im getting cannot resolve enum variable, bcoz its declared in while loop, I cannot declare it out side of while loop because I dont know the perfect size of the array and it will change dynamically.
    pls help

    Thankyou ,
    It worked out,
    Thank you very much.

  • How to use ArrayList?

    i'm not quite sure how to use ArrayList, i read the api documentation but it would be better if someone could explain it to me
    i have a helper method that returns a random number within a given range that picks an index at random but it won't work, here is my code:
         public String getIndex ()
              a1.get(getRandomIndex(int));
         private static int getRandomIndex (int range)
              return ((int) (Math.random () * range));
         }

    You are calling he method incorrectly. You do not use the variable type declaration when calling a method. Do this
    import java.util.*;
    public class TestClass{
         ArrayList<String> words = new ArrayList<String>();
         Random rand = new Random();
         public TestClass(){
              words.add("hello");
              words.add("world");
         public String randomSelection(){
              int index = rand.nextInt(words.size());
              return words.get(index); //notice that I am calling the method with a variable that is an integer, but I don't use "int" when I call it
         public static void main(String args[]) {
              TestClass myTest = new TestClass();
              for(int i=0;i<30;i++){
                   System.out.println(myTest.randomSelection());
    }The API documentation will list the variable type but that is only for you information. It is there so that you know what type of variable top use when calling a particular method.

  • Need right value to Load/Read Velocity Using Input/Return Vectors

    I have a servo motor with a encoder feedback of ( 4,000 counts per revolution ), maximum velocity of 6,000 rpm ( 100 rps ). I need to create 3 moving profiles with stroke time of 0.25 mm/sec, 1.0 mm/sec, and 25 mm/sec. I would like to use either Load Velocity VI or Load Velocity in RPM VI whichever is easy to set velocity, distance, and read position of my axis. More, I would like to be able to use onboard variables to set distance, velocity, and read position of the axis using input/return vectors, but I don't know how to set the right values. Do I need a conversion or multiplier number to get the right value?
    Any help would be greatly appreciated.
    Carlos D' Garcia.

    Carols –
    There is a simple vi on how to do vector moves at the following link (I also attached the file below):
    http://sine.ni.com/apps/we/niepd_web_display.display_epd4?p_guid=B45EACE3DF9956A4E034080020E74861&p_node=DZ52480&p_source=External
    To have your axes move at different rates, you will have to replace the single ‘Load Velocity in RPM.vi’ that is wired to the Configure Vector Space.flx with three separate Load Velocity RPM.vi’s each with an axis constant (or control) wired to their axis input and the max velocity you want. This way, you will set the maximum velocity for each axis rather than all three at once.
    Best of luck with your project! Let me know if you have further questions with this.
    Marc C
    National Instruments
    Applications Engineer
    Attachments:
    Three-Axis_Vector_Move_with_Position_Monitor.zip ‏29 KB

  • Is it possible to use ArrayList with TopLink?

    Hi all,
    I got used to using Arraylist as the class to perform relationships between classes. Now i'm starting to work with jDeveloper and TopLink.
    All my mappings were done automatically using Collection. I can see that in "Container Policy" i can choose between Collection and Map. Is it impossible to work with other type of List/Collection/Set/whatever?
    If it is possible? How?
    Thanks a lot
    Eduardo

    Hi Eduardo,
    To do this you need to specify the "Collection Class" on the "Container Policy" for the mapping. In this case you will specify that the collection class is java.util.ArrayList. In JDeveloper this can be found on the "Collection Options" panel for the mapping.
    TopLink specific questions can also be posted on the TopLink forum:
    TopLink/JPA
    -Blaise

  • How to display ArrayList of Vectors using Expression Language in a JSP

    I have added all my values in a vector and this vector is then added to a List. How can I loop through this List, Vector and values in Vector using EL on JSP side. If you have any idea, pl. help with sample code.

    Hi Kavita,
    Well to display each employee information on jsp, you can use following code sceanarion.
    <%
    Iterator it= list.iterator();
    while(it.hasnext()){
       Employee emp=(Employee) it.next();
    %>
    <tr>
    <td><%= emp.getName()%></td>// In the similar fashion you can display other attributes of employee in other td's.
    </tr>
    <%
    }%>Hope this would be helpful to you.
    Regards,
    Gaurav Daga

Maybe you are looking for