Array that is dynamic and multidimensional

I have a 2 dimisional string array that I'd like to remove records from.
It seems a simple thing but I'm haveing trouble finding a solution.
I see things on sets and arrylist etc but all examples are a single dimision.
There are resultsets that are related to SQL statement that is close but I already have and array that did not come from a SQL statement.
Is there a java class that can help me with this?

Using your suggestion and some help from other post in this forum I was able to build this sample code.
Using this, it is relitivly simple to get data in but it is more difficult to update or get data out of.
I will likely continue to build on this till it is a class that I can use simular to a 2 diminsional string array.
The following would be helpful.
1. A java class or other developed class that does this.
This seems like it would be common.
2. An easier way to update and read data from the array within anouther array.
String [] array1 = new String [2];
                String [] array2 = new String [2];
                array1[0]= "jrm1a";
                array1[1]= "jrm1b";
                array2[0]= "jrm2a";
                array2[1]= "jrm2b";
                ArrayList tad = new ArrayList();
                tad.add(array1);
                tad.add(array2);
                System.out.println("arraylist: " + tad);
                String [] str2 = (String [])tad.get(1);
                String str3 = str2[1];
                System.out.println("str3: " + str3);

Similar Messages

  • How do I create a 1d array that takes a single calculation and insert the result into the first row and then the next calculation the next time the loop passes that point and puts the results in thsecond row and so on until the loop is exited.

    The attached file is work inprogress, with some dummy data sp that I can test it out without having to connect to equipment.
    The second tab is the one that I am having the problem with. the output array from the replace element appears to be starting at the index position of 1 rather than 0 but that is ok it is still show that the new data is placed in incrementing element locations. However the main array that I am trying to build that is suppose to take each new calculation and place it in the next index(row) does not ap
    pear to be working or at least I am not getting any indication on the inidcator.
    Basically what I am attempting to do is is gather some pulses from adevice for a minute, place the results for a calculation, so that it displays then do the same again the next minute, but put these result in the next row and so on until the specifiied time has expired and the loop exits. I need to have all results displayed and keep building the array(display until, the end of the test)Eventually I will have to include a min max section that displays the min and max values calculated, but that should be easy with the min max function.Actually I thought this should have been easy but, I gues I can not see the forest through the trees. Can any one help to slear this up for me.
    Attachments:
    regulation_tester_7_loops.vi ‏244 KB

    I didn't really have time to dig in and understand your program in depth,
    but I have a few tips for you that might things a bit easier:
    - You use local variables excessively which really complicates things. Try
    not to use them and it will make your life easier.
    - If you flowchart the design (very similar to a dataflow diagram, keep in
    mind!) you want to gather data, calculate a value from that data, store the
    calculation in an array, and loop while the time is in a certain range. So
    theres really not much need for a sequence as long as you get rid of the
    local variables (sequences also complicate things)
    - You loop again if timepassed+1 is still less than some constant. Rather
    than messing with locals it seems so much easier to use a shiftregister (if
    absolutely necessary) or in this case base it upon the number of iterations
    of the loop. In this case it looks like "time passed" is the same thing as
    the number of loop iterations, but I didn't check closely. There's an i
    terminal in your whileloop to read for the number of iterations.
    - After having simplified your design by eliminating unnecessary sequence
    and local variables, you should be able to draw out the labview diagram.
    Don't try to use the "insert into array" vis since theres no need. Each
    iteration of your loop calculates a number which goes into the next position
    of the array right? Pass your result outside the loop, and enable indexing
    on the terminal so Labview automatically generates the array for you. If
    your calculation is a function of previous data, then use a shift register
    to keep previous values around.
    I wish you luck. Post again if you have any questions. Without a more
    detailed understanding of your task at hand it's kind of hard to post actual
    code suggestions for you.
    -joey
    "nelsons" wrote in message
    news:[email protected]...
    > how do I create a 1d array that takes a single calculation and insert
    > the result into the first row and then the next calculation the next
    > time the loop passes that point and puts the results in thsecond row
    > and so on until the loop is exited.
    >
    > The attached file is work inprogress, with some dummy data sp that I
    > can test it out without having to connect to equipment.
    > The second tab is the one that I am having the problem with. the
    > output array from the replace element appears to be starting at the
    > index position of 1 rather than 0 but that is ok it is still show that
    > the new data is placed in incrementing element locations. However the
    > main array that I am trying to build that is suppose to take each new
    > calculation and place it in the next index(row) does not appear to be
    > working or at least I am not getting any indication on the inidcator.
    >
    > Basically what I am attempting to do is is gather some pulses from
    > adevice for a minute, place the results for a calculation, so that it
    > displays then do the same again the next minute, but put these result
    > in the next row and so on until the specifiied time has expired and
    > the loop exits. I need to have all results displayed and keep building
    > the array(display until, the end of the test)Eventually I will have to
    > include a min max section that displays the min and max values
    > calculated, but that should be easy with the min max function.Actually
    > I thought this should have been easy but, I gues I can not see the
    > forest through the trees. Can any one help to slear this up for me.

  • I want to create an array that goes into a case structure where each element in the array is an individual case and gets done in order

    I want to create an array that goes into a case structure where each element in the array is an individual case and gets done in order. Any ideas, I've been playing with the idea but have had no luck, is this even possible?

    Hi,
    Please check it out the attached Vi.. Is this you need?
    Sasi.
    Certified LabVIEW Associate Developer
    If you can DREAM it, You can DO it - Walt Disney
    Attachments:
    Event.vi ‏11 KB

  • How to create an array in one field and have another field display certain elements from that array?

    I am making a form in Acrobat XI pro.
    In one text field, I created an array of several elements. I want other text fields to display certain elements from that array. For instance, one field should display the 3rd element, another field should display the 13th element, etc.
    The Javascript for making the array is very long, and so I don't want to have to re-calculate the array every single time (in order to reduce rendering time when I open the form on an iPad). This is why I'd like to only have to create the array once, and simply refer to it throughout the form.

    What code are you using to update the array currently? Are you completely rebuiding it when an element changes, or just changing specific elements for certain fields? I'm still not sure what exactly you are trying to do, but something like this in a document level script will create your array:
    var myArray;
    // Call 'updateArray' to initialize array
    updateArray();
    function updateArray() {
         // Code here to create/update array
         myArray = new Array();
         myArray[0] = "Value 1";
         myArray[1] = "Value 2";
         myArray[2] = "Value 3";
    Then, for each field that needs to update this array, you can add a call to 'updateArray()' in the appropriate event. This will rebuild the array completely; if you just want to update specific elements, then you can access them directly.

  • Random selection of rows from a 2D array then subset both the rows that were selected and those that were not. Please see message below.

    For example, I have a 2D array with 46 rows and 400 columns. I would like to randomly select 46 data rows from the 2D array. By doing the random selection it means that not all individual 46 rows will be selected some rows may appear more than once as there may be some duplicates or triplicates in the random selection. The importan thing is that we will have randomly selected 46 rows of data (no matter that some rows appear more than once). Then I would like to subset these randomly selected 46 data rows (some which will be duplicated, or triplicated, etc.) and then also find and subset the rows that were not selected. Does this make sense? Then i would like to do this say 10 times for this data set. So that then I will have 2 by 10 data sets: the first 10 each with 46 rows and the other 10 with n rows depending on how many WERE NOT randomly selected. i hope that my explanation is clear. I am relatively new to Labview. It is really great so I am getting better! If anyone can help me with this problems it will be great. RVR

    Start by generating randon #s between 0 and 45. Run a for loop X times and in it use the random function, multiply the result by X and round down (-infinity). You can make this into a subVI, which you can reuse later. In the same loop, or in a different one, use Index Array to extract the rows which were selected (wiring the result out of the loop with auto indexing causes it to be rebuilt into a 2D array).
    One possible solution for the second part would be to go over the array of randomly generated numbers in a for loop and use Search 1D Array to find each of the numbers (i). If you get -1, it means the row wasn't selected and you can extract it.
    I hope this puts you on the right path. If not, don't be afraid to ask more.
    To learn more about LV, I suggest you read the LabVIEW user manual. Also, try searching this site and google for LabVIEW tutorials. Here and here are a couple you can start with. You can also contact your local NI office and join one of their courses.
    In addition, I suggest you read the LabVIEW style guide.
    Try to take over the world!

  • Creating VO Dynamically and Copying Attributes

    Hi anyone,
    I've developed a SimpleSearch with LOVs that result in a multi-selection list.
    Once the rows are selected, I want to carry them over and display on the next page.
    I'm trying to keep it very simple, using OAFramework wizards an such but I'm struggling to get this accomplished, mostly due to lack of JAVA experience.
    I was trying to follow the advice from "How to show selected rows only in tablebean" but I don't know how to create a VO dynamically and am new to JAVA (which is why I tried to keep it simple).
    What I need help with desperately is:
    1) The correct syntax/code for creating a simple VO dynamically - examples in the OA Dev guide are hard to follow.
    2) Correct syntax/code for copying attributes using setAttribute().
    3) Does this new VO appear under the BC4J Components directory? If not, how do I attach it to the table's columns?
    4) Anything else I should include or watch out for?
    Thanks very much.

    Hi Ramkumar,
    I did create a VO declaratively before but am stuck on syntax again in the AMImpl.
    I'm getting the error: oracle.jbo.TooManyObjectsException: JBO-25013: Too many objects match the primary key oracle.jbo.Key[10006 ].
    Could you look at my code and see what is missing?
    public void SelectItemInstance( )
    CustibSummaryVOImpl vo = getCustibSummaryVO1();
    CustibChangeVOImpl dvo = getCustibChangeVO1();
    Row[] sourceRows = vo.getFilteredRows("SelectFlag", "Y");
    // getFilteredRows returns a zero-length array if it finds no matches.
    if (sourceRows != null && sourceRows.length > 0)
    int numRows = sourceRows.length;
    for (int i = 0; i < numRows; i++)
    // For every row with a selected checkbox, we want call
    // the create( ) and insert()wrapper.
    Row newRow = dvo.createRow();
    newRow.setAttribute("ItemInstance", sourceRows.getAttribute("ItemInstance"));
    newRow.setAttribute("Item",sourceRows[i].getAttribute("Item"));
    newRow.setAttribute("TagNumber",sourceRows[i].getAttribute("TagNumber"));
    newRow.setAttribute("Client",sourceRows[i].getAttribute("Client"));
    newRow.setAttribute("Resp",sourceRows[i].getAttribute("Resp"));
    newRow.setAttribute("Service",sourceRows[i].getAttribute("Service"));
    newRow.setAttribute("Project",sourceRows[i].getAttribute("Project"));
    newRow.setAttribute("TCAAccount",sourceRows[i].getAttribute("TCAAccount"));
    newRow.setAttribute("OrderId",sourceRows[i].getAttribute("OrderId"));
    newRow.setAttribute("PartyId",sourceRows[i].getAttribute("PartyId"));
    newRow.setAttribute("AccountId",sourceRows[i].getAttribute("AccountId"));
    dvo.insertRow(newRow);
    } // end selectItemInstance()
    Thanks ever so much.

  • Array data between Flash and PHP

    As the title suggests, I'm trying to find a good way of
    getting an ActionScript/Flash dynamic array into PHP, so I can
    serialize it and store it in a DB, then simply give back that same
    array when it's called. Are there any popular techniques? The array
    will always be a different size, containing different values -
    which is why I'd like to keep the array in tact, to minimise the
    amount of parameter transfers. If there's no good solution, I
    suppose I could pass in parameters and read them in, create an
    array and serialize that... but I'd much rather find a way of
    having my flasher serialize his own array and pass me the
    byte-code. Is this possible?
    PHP doesn't need to read the contents of the array, simply
    store it in a DB, so if there's some kind of flash method for
    serializing an array into bytecode that it can unserialize and read
    back later, that would be awesome.
    Thanks. =]
    [edit]
    I found this:
    http://sourceforge.net/projects/serializerclass/
    a serializer class. Is this the best method?

    Sorry, I should have explained, we already use XML for data
    transfers (though I personally find JSON much nicer with less
    overhead). So, in this project, we use XML for data transfer
    between flash and PHP/Database. The reason I wanted this
    functionality, is because the flash array, in this one case, will
    be completely dynamic and the PHP doesn't need to know the contents
    of the array at all. In fact, in this instance, PHP is just the
    mechanism used for storing the data. Becuase of the nature of the
    data, I wanted to serialize the flash array, store it in the
    database as Bytecode, then when the flash needs that information
    again, I can pass back the same bytecode, which can then be
    unserialized back into the original array.
    I think I've found the solution, the one I linked in the
    original post. I should know if it's as effective as I want it to
    be in the next couple of days when my flasher gives it a try. =]
    Thanks for the responses. If anyone has any other ideas,
    please throw them in here.

  • The difference between "ipsec-isakmp dynamic" and "ipsec-isakmp profile" cyrpto map configs

    The IOS documentation for the crypto map command gives the syntax as
    crypto map [ipv6] map-name seq-num [ ipsec-isakmp [ dynamic dynamic-map-name | discover | profile profile-name ] ]
    I have a 881w ISR. In what different situations do we use the ipsec-isakmp dynamic form as opposed to the ipsec-isakmp profile form?
    I understand that ipsec-isakmp profile is applied directly to the vpdn-group. Does this substitute for applying the crypto map directing to the WAN interface? Why would I want to do that?

    Hello, thomasmcleod.
    The main difference between dynamic and profile in conditions to establish VPN connection. You can look at the difference if you compare EzVPN (dynamic profiles) technology with Lan-2-Lan (manual profile) technology.
    And why you should put crypto map to the interface. After puting this command to interface Cisco is starting to check traffic for encryption rules. In fact it can be any interface (not only WAN) when you want use encrypted VPN channel.
    Best Regards.

  • How to create a condition based on a select that retrieve dynamically a LOV

    Hi all, I need to create a condition based on a select that retrieve dynamically a LOV.
    So, the condition have to be:
    inventory_item_id NOT IN (SELECT inventory_item_id FROM apps.mtl_system_items_kfv WHERE concatenated_segments = 'GENERAL_FAULTS_IPTV')
    I need to create a LOV based on this select without making any join with the folder which contains the field inventory_item_id, because otherwise I have the contradiction:
    and o124757.INVENTORY_ITEM_ID = o118741.INVENTORY_ITEM_ID -- join between the main custom folder (o118741) and the LOV custom folder (o124757)
    and o118741.INVENTORY_ITEM_ID NOT IN (o124757.INVENTORY_ITEM_ID) -- condition
    These two condition together don't show any data, obviously....This means also, that I can't use a calculated field, because if I want to see this field, I have to create a join, another time, with the main custom folder.
    I tried to create a LOV on the Administrator, but when I create the condition I have to check manually the values....and if in the future this LOV will increase I need every time to re-check all the values.....instead I need that the inventory_item_id have to be NOT IN dinamically in the list of values retrieved by the select.
    Anybody has inplemented something similar ??
    Thanks in advance
    Alex

    Hi alex,
    SELECT incidents.INVENTORY_ITEM_ID,
    pcodes.PROBLEM_NAME
    FROM apps.cs_incidents_all_b incidents,apps.jtf_rs_problem_codes_v pcodes
    WHERE incidents.category_id IN (SELECT category_id
    FROM mtl_categories_kfv
    WHERE concatenated_segments = 'IPTV')
    AND incidents.PROBLEM_CODE = pcodes.PROBLEM_CODE
    where incidents.INVENTORY_ITEM_ID NOT IN SELECT inventory_item_id
    FROM apps.mtl_system_items_kfv
    WHERE concatenated_segments = 'GENERAL_FAULTS_IPTV'
    You want to add this condition to the first query it holds good for this scenerio.All the items which are NOT IN will be retrieved.Here you are selecting other than "General_faults_iptv"
    But again your trying to select in the second query where you want "General_faults_iptv"
    SELECT inventory_item_id
    FROM apps.mtl_system_items_kfv
    WHERE concatenated_segments = 'GENERAL_FAULTS_IPTV'
    If you carefully go through what your doing,you will understand.In the above explantion ,there will be no records generated.First query your saying NOT IN and again your saying for the same IN,how will records retrieve its meaningless.
    I dont know what you want to get from second query.I would suggest you to do is dont use the second query and just use the first query and you will get.Here is the query and this will give you result.
    SELECT incidents.INVENTORY_ITEM_ID,
    pcodes.PROBLEM_NAME
    FROM apps.cs_incidents_all_b incidents,apps.jtf_rs_problem_codes_v pcodes
    WHERE incidents.category_id IN (SELECT category_id
    FROM mtl_categories_kfv
    WHERE concatenated_segments = 'IPTV')
    AND incidents.PROBLEM_CODE = pcodes.PROBLEM_CODE
    AND incidents.INVENTORY_ITEM_ID NOT IN SELECT inventory_item_id
    FROM apps.mtl_system_items_kfv
    WHERE concatenated_segments = 'GENERAL_FAULTS_IPTV'
    Regards,
    Kranthi.

  • How do I find out the exact path of each and every file that LabVIEW finds and loads into memory for a given top level vi?

    How do I find out the exact path of each and every file that LabVIEW finds and loads into memory for a given top level vi? There is probably a trivial, easy way to get this info, but I have not yet found it!  Thanks..

    Or if you want to grab all the paths programatically, try the attached VI.
    Open the top level that you want all the paths from and close all others, then open the
    attached and run it. It will return an array of all the VIs that the VI
    in question uses, including vi.lib VIs. You can filter these as well if
    you like.
    Ed
    Message Edited by Ed Dickens on 08-01-2005 07:01 PM
    Ed Dickens - Certified LabVIEW Architect - DISTek Integration, Inc. - NI Certified Alliance Partner
    Using the Abort button to stop your VI is like using a tree to stop your car. It works, but there may be consequences.
    Attachments:
    Get all paths.vi ‏29 KB

  • Is It Possible to Clone RAID Array in a Safe and Easy Way?

    Why do computer users need to clone RAID array, especially Windows Server users need to do RAID cloning? Generally speaking, they need to clone RAID array regularly in order to upgrade disk or migrate data from small disk to a larger one. A typical
    example is that when the partitions on the hardware RAID runs out of space, you may prefer to rebuild the hardware RAID with larger hard disks. Then, you need to backup the data to another place, rebuild the hardware RAID and restore data again.
    What a time-consuming task!
    Is it possible to clone RAID array in a safe and easy way? The answer is yes and this article will introduce a RAID cloning software.

    Hi jiangchunli,
    Were you looking to post this question in some other forum? This looks like related to RAID and Disk upgrades.
    This forum is meant for
    http://www.windowsazure.com/en-us/services/recovery-manager/
    Please let us know if this is indeed Hyper-V Recovery Manager related so we can help better.
    Thanks
    Praveen
    Praveen/ www.PraveenKumar.in

  • Set Busy cursor does not work for a VI that is dynamically run

    The cursor functions (Set busy and unset busy) usually work well when they are used in a VI that is statically run (either a top VI or a VI called from within a VI).
    However, when they are used in a VI that is openned and run dynamically (using the VI server) I get an error message:
    LabVIEW:  Null window.
    =========================
    NI-488:  Wait in progress on specified input handle.
    How can I solve this problem?

    Bruno Paillard wrote:
    I have just talked to the support people. This is a recognized bug and will be corrected in the next release. They said there is no workaround at this time.
    G Toolbox ($) can set cursor style, long before NI implemented this feature in LabVIEW.
    George Zou
    http://webspace.webring.com/people/og/gtoolbox

  • I've had this 2D array problem for ages and would apprecoate any help :)

    I've posted a few times about this in the past and with your guys help I have gradually advanced.
    Basically, all I want to do at the moment is fill the lowest position a counter can go in in a game of Connect Four.
    The first counter goes to the bottom, then if you place another counter in the same column it goes above the previous counter you put in that same column and so on...
    I have set up my 2D array and initialised integers for each player so when a counter is red the player = 1 and when yellow player = 2.
    Here is my code...
    CircleGrid [][] cArray = new CircleGrid[col][row]; //Declare array
    static final int row = 6;
    static final int col = 7;
    for (int i = 0; i < col; i++)
                        for (int h = 0; h < row; h++)
                             cArray[i][h] = new CircleGrid();
                             gameCenter.add(new CircleGrid());
                   JOptionPane.showConfirmDialog(game, "Welcome to Frenzy Fours. Press 'OK to begin or 'Cancel' to go back.", "Game", JOptionPane.OK_CANCEL_OPTION);
                   /*if (cArray[col-1][row] && cArray[col-2][row] == 1) //This doesn't work at all...array out of bounds !?
                        System.out.println("testing");
    public class CircleGrid extends JPanel implements MouseListener, MouseMotionListener
             int ifRed;
             int notIfRed;
                 boolean ifEmpty;
              String currentColour = "White";
              final int empty = 0;
              final int competitorOne = 1;
              final int competitorTwo = 2;
                 public CircleGrid()
                   ifRed = 1;
                   notIfRed = 0;
                   int redCircles = 0;
                   int yellowCircles = 0;
                   ifEmpty = true;
                   addMouseListener(this);
                 public void alternateColour()
                   ifEmpty = !ifEmpty;
                   repaint(); //Repaint upon changes
                 public void paintComponent(Graphics g)
                 if (ifEmpty)
                   g.setColor(Color.WHITE); //Set all of the ovals to white
             else if (ifRed == clicks)
                   position--;
                   addMouseListener(this);
                    g.setColor(Color.RED); //Paint red
                    currentColour = "Red";
                    System.out.println(getColour());
                    System.out.println(playerOneMove());
              else if (notIfRed == clicks)
                   addMouseListener(this);
                   g.setColor(Color.YELLOW); //Paint yellow
                   currentColour = "Yellow";
                   System.out.println(getColour());
                   System.out.println(playerTwoMove());
                   g.fillOval(5, 10, 42, 42); //Draw and fill oval
                 public String getColour()
                   return currentColour;
              public int playerOneMove()
                   return competitorOne;
              public int playerTwoMove()
                   return competitorTwo;
                 public void mousePressed(MouseEvent ev)
                   alternateColour(); //Use commands from this method
                   if (clicks == 0)
                        clicks = 1;
                        repaint(); //Paint oval red
                        number--; //Decrement number of counters left by 1
                         counterNo1.setText(number + " counters left.");
                         move++;
                         moveCount1.setText(move + " moves.");
                   else if (clicks > 0)
                        clicks = 0;
                        repaint(); //Paint oval yellow
                        number2--;
                         counterNo2.setText(number2 + " counters left.");
                        move2++;
                         moveCount2.setText(move2 + " moves.");
                 }I think that is all of the code which matters for this!
    I didn't choose to do this project and it is really stressing me out! If anybody could give me a nudge in the right direction (in really simple steps) that would be awesome. I appreciate you guys do this voluntarily (and for some even work) so I would be deeply grateful for any assistance in this matter.
    Thank you. :)
    - Jay
    Edited by: Aurora88 on Mar 5, 2008 7:18 AM

    public class CircleGrid extends JPanel implements MouseListener, MouseMotionListener
             int ifRed;
             int notIfRed;
                 boolean ifEmpty;
              String currentColour = "White";
              final int empty = 0;
              final int competitorOne = 1;
              final int competitorTwo = 2;
              static final int row = 6;
              static final int col = 7;
              Circle [][] cArray = new Circle[col][row]; //Declare array
              Circle circle = new Circle(0,0);
                 public CircleGrid()
                   ifRed = 1;
                   notIfRed = 0;
                   int redCircles = 0;
                   int yellowCircles = 0;
                   ifEmpty = true;
                   addMouseListener(this);
                 public void alternateColour()
                   ifEmpty = !ifEmpty;
                   repaint(); //Repaint upon changes
                 public void paintComponent(Graphics g)
                 if (ifEmpty)
                   g.setColor(Color.WHITE); //Set all of the ovals to white
             else if (ifRed == clicks)
                   position--;
                   addMouseListener(this);
                    g.setColor(Color.RED); //Paint red
                    currentColour = "Red";
                    System.out.println(getColour());
                    System.out.println(playerOneMove());
              else if (notIfRed == clicks)
                   addMouseListener(this);
                   g.setColor(Color.YELLOW); //Paint yellow
                   currentColour = "Yellow";
                   System.out.println(getColour());
                   System.out.println(playerTwoMove());
                   g.fillOval(5, 10, 42, 42); //Draw and fill oval
                 public String getColour()
                   return currentColour;
              public int playerOneMove()
                   return competitorOne;
              public int playerTwoMove()
                   return competitorTwo;
                 public void mousePressed(MouseEvent ev)
                   alternateColour(); //Use commands from this method
                   if (clicks == 0)
                        clicks = 1;
                        repaint(); //Paint oval red
                        number--; //Decrement number of counters left by 1
                         counterNo1.setText(number + " counters left.");
                         move++;
                         moveCount1.setText(move + " moves.");
                   else if (clicks > 0)
                        clicks = 0;
                        repaint(); //Paint oval yellow
                        number2--;
                         counterNo2.setText(number2 + " counters left.");
                        move2++;
                         moveCount2.setText(move2 + " moves.");
                   for (int i = 0; i < col; i++)
                        for (int h = 0; h < row; h++)
                             cArray[i][h] = new Circle();
                             gameCenter.add(cArray[i][h]);
                   System.out.println("LOCATION");
                   System.out.println("Row: " + circle.getRow());
                   System.out.println("Col: " + circle.getCol());
                 public void mouseClicked(MouseEvent ev)
                 public void mouseReleased(MouseEvent ev)
                   if (number < 0)
                        JOptionPane.showMessageDialog(game, "Error! You have no counters left.", "Error 001", JOptionPane.ERROR_MESSAGE);
                        System.out.println(countersGone()); //Display error when all counters are used
                        number = 22; move = 0; number2 = 22; move2 = 0;
                        counterNo1.setText(number + " counters left.");
                        moveCount1.setText(move + " moves.");
                        counterNo2.setText(number2 + " counters left.");
                        moveCount2.setText(move2 + " moves.");
                        clicks = 0;
                        game.dispose();
                 public void mouseEntered(MouseEvent ev)
                 public void mouseExited(MouseEvent ev)
                 public void mouseMoved(MouseEvent ev)
                 public void mouseDragged(MouseEvent ev)
                 public int getClickCount()
                   return clicks; //Record number of mouse clicks
                 public int getCounterNumber(int numberP1)
                      numberP1 = number; //Assigned number to numberP1
                      return number;
              public int getCounterNumber2(int numberP2)
                   numberP2 = number;
                   return number2;
              public int moveCounter1(int counterOne)
                   counterOne = move;
                   return move;
              public int moveCounter2(int counterTwo)
                   counterTwo = move2;
                   return move2;
                 public String countersGone()
                   return "You have used up all of your counters!";
         class Circle
             int rowNum, colNum;
             boolean occupied;
             String color;
        public Circle(int r, int c)
              rowNum = r;
              colNum = c;
              occupied = false;
        public int getRow()
              return rowNum;
        public int getCol()
              return colNum;
    }new Circle - cannot find symbol
    gameCenter.add - cannot find symbol
    Circle has been declared so I don't know why this is happening. :S

  • Grabbing numbers from an array of type double and outputting them into a text file

    In a program im creating i need to save some coordinates of a micropositioner i have into a text file,
    I have the coordinates saved into an array that has 6 digits of precision (6 places after the decimal point).
    I use the number to string conversion and wire that into the write to text file function in labview.  When i open the file
    the numbers that are only displayed are the ones to the left of the decimal point.  I know the number to decimal string function
    rounds the values so if i were to input 3.111111 it would only output the string "3" instead of "3.111111" . 
    So to get all the digits onto the file without rounding i multiplied the number by 10^6 but the decimal point will be lost at that point.
    Is there anyway i can convert numbers into strings without labview rounding to the nearest whole number also without having to multiply by 10^6 and without having to expect the user to know that the coordinates saved in a file are multiplied by an order of magnitude of a million ? 

    ed oh i guess i just missed that function on the pallete after i saw that the function went from number to hex, octal, etc. i assumed that the rest on that row would be some sort of conversion to a different base number, haha thanks.

  • How to control the maximum time that a dynamic sql can execute

    Hi,
    I want to restrict the maximum time that a dynamic sql can execute in a plsql block.
    If the execution is not completed, the execution should be terminated and a exception should be raised.
    Please let me know, if there is any provision for the same in Oracle 10g.
    I was reading about Oracle Resource Database Resource Manager, which talks about restricting the maximum time of execution for Oracle session for a user.
    However I am not sure, if this can be used to control the execution of dynamic sql in a plsql block.
    Please provide some pointers.
    Thank you,
    Warm Regards,
    Navin Srivastava

    navsriva wrote:
    We are building a messaging framework, which is used to send time sensitive messages to boundary system.I assume this means across application/database/server boundaries? Or is the message processing fully localised in the Oracle database instance?
    Every message has a time to live. if the processing of message does not occurs within the specified time, we have to rollback this processing and mark the message in error state.This is a problematic requirement.. Time is not consistent ito data processing on any platform (except real-time ones). For example, messageFoo1 has a TTL (time to live) of 1 sec. It needs to read a number of rows from a table. The mere factor of whether those rows are cached in the database buffer cache, or still residing on disk, will play a major role in execution time. Physical I/O is significantly slower that logical I/O.
    As a result, with the rows on disk, messageFoo1 exceeds the 1s TTL and fails. messageFoo2 is an identical message. It now finds most of the rows that were read by messageFoo1 in the buffer cache, enabling it to complete its processing under 1s.
    What is the business logic behind the fact that given this approach, messageFoo1 failed, and the identical messageFoo2 succeeded? The only difference was physical versus logical I/O. How can that influence the business validation/requirement model?
    If it does, then you need to look instead at a real-time operating system and server platform. Not Windows/Linux/Unix/etc. Not Oracle/SQL-Server/DB2/etc.
    TTL is also not time based in other s/w layers and processing. Take for example the traceroute and ping commands for the Internet Protocol (IP) stack. These commands send an ICMP (Internet Control Message Protocol) packet.
    This packet is constructed with a TTL value too. When TTL is exceeded, the packet expires and the sender receives a notification packet to that regard.
    However, this TTL is not time based, but "+hop+" based. Each server's IP stack that receives an ICMP packet as it is routed through the network, subtracts 1 from the TTL and the forwards the packet (with the new TTL value). When a server's IP stack sees that TTL is zero, it does not forward the packet (with a -1 TTL), but instead responds back to the sender with an ICMP packet informing the sender that the packet's TTL has expired.
    As you can see, this is a very sensible and practical implementation of TTL. Imagine now that this is time based.. and the complexities that will be involved for the IP stack s/w to deal with it in that format.
    Making exact response/execution times part of the actual functional business requirements need to be carefully considered.. as this is very unusual and typically only found in solutions implemented in real-time systems.

Maybe you are looking for