Searching through arrays part 3

   *  The moveTile method
   *  After the grid has been read and stored, the moveTile method
   *  takes in a single integer value that indicates a tile to move,
   *  and moves that tile into the blank tile's position, if it is a
   *  legal move. A move is only legal if the specified number exists
   *  in the grid, and if the specified tile's position is adjacent to
   *  the blank tile's position. The method returns a boolean value to
   *  indicate whether the move was made.
   * @param tileToMove The tile that is to be moved.
   * @return moveTile The boolean value which represents whether
   *                     or not the move was made.
  public boolean moveTile(int tileToMove){
    //set default boolean value to false
    boolean moveTile = false;
   //scans through the rows of the puzzle
    for(int scanRow=0;scanRow<grid.length;scanRow++){
      //scans through the columns of the puzzle
      for(int scanColumn=0;scanColumn<grid[0].length;scanColumn++){
       //scans through and checks if the desired tile exists
       //if it does exist, check if the '*' tile is beside it
      if(grid[scanRow][scanColumn]==tileToMove){
        //scans the tiles to the right of the tile being moved
        for(int besideRow=scanRow;besideRow<grid.length;besideRow++){
          //scans the tiles above the tile being moved
          for(int besideColumn = scanColumn;
              besideColumn < grid[0].length;
              besideColumn++){
            //scans the tile to the left of the tile being moved
            for(int besideRow2 = scanRow;
                besideRow2 < grid.length && besideRow2 > 0;
                besideRow2--){
              //scans the tile under the tile being moved
              for(int besideColumn2 = scanColumn;
                  besideColumn2 < grid[0].length && besideColumn2 > 0;
                  besideColumn2--){
                //if the '*' tile is above or to the right of the tile
                //being moved, then swap the files
                if(grid[besideRow][besideColumn]== -1){
                  //create a temporary storage variable to store the
                  //value of the '*' tile
                  //if the '*' tile was above or to the right of the
                  //tile being moved
                  int temp;
                  //sets the value of the temporary storage variable
                  //to the value of the '*' tile
                  temp = grid[besideRow][besideColumn];
                  //sets the value of the '*' tile to the value of the
                  //tile being moved
                  grid[besideRow][besideColumn] = grid[scanRow][scanColumn];
                  //sets the value of the tile being moved to the value of
                  //the '*' tile
                  grid[scanRow][scanColumn] = temp;
                  //return the boolean value true since the tile was moved
                  moveTile = true;
                //if the '*' tile is above or to the right of the tile
                //being moved, then swap the files
                if(grid[besideRow2][besideColumn2]== -1){
                  //create a temporary storage variable to store the
                  //value of the '*' tile
                  //if the '*' tile was above or to the right of the
                  //tile being moved
                  int temp2;
                  //sets the value of the temporary storage variable
                  //to the value of the '*' tile
                  temp2 = grid[besideRow2][besideColumn2];
                  //sets the value of the '*' tile to the value of the
                  //tile being moved
                  grid[besideRow2][besideColumn2] = grid[scanRow][scanColumn];
                  //sets the value of the tile being moved to the value of
                  //the '*' tile
                  grid[scanRow][scanColumn] = temp2;
                  //return the boolean value true since the tile was moved
                  moveTile = true;
    //returns the boolean true if the tile was moved and false if the tile
    //was not moved.
    //the default value is false
    return moveTile;
  }This is my code.... it works when the reference point of [0][0] is at the bottom left but when i changed my to string method to set the reference point of [0][0] at the top left.... it stopped swapping the tiles... it did give the correct boolean however

This is my code.... ... and quite a lot of code I might say (nicely documented though). I
strongly (sic) suggest that you strengthen your preconditions a bit, i.e.
don't just fill your grid[][] but keep track of the blank position also (just two
member variables).
Since you're dealing with a two dimensional thing, both a row and
column index are more appropriate than a single index number, although
the latter can easily be converted to the former. Let's denote the index
pair of the blank cell as bx, by.
Here's a simple method that determines whether or not an (x,y) pair
denotes a valid index pair in the grid:boolean isValid(int x, int y, char v) {
   try {
      return grid[x][y] == v;
   } catch (ArrayIndexOutOfBoundsException aioobe) {  }
   return false;
}... this method not just tests the validity of the (x,y) index values: it also
checks whether or not the (x,y) cell contains a 'v', whatever 'v' may be.
Now suppose you want to move a tile at position (x,y) to the blank
position (xb, yb). Here's how you swap those two positions:boolean swap(int x, int y) {
   if (isValid(x, y, grid[xb][yb]) {
      char tmp= grid[xb][yb];
      grid[xb][yb]= grid[x][y];
      grid[x][y]= tmp;
      xb= x; yb= y; // update the blank cell position
      return true;
   return false;
}The four neighbours of a cell (x,y) are easily found and a bit of logic
operator hacking yields:boolean move(int x, int y) {
   return swap(x-1, y) || swap(x+1, y) || swap(x, y-1) || swap(x, y+1);
}Finally, if you want to move a cell (x,y) containing a star '*' to the blank
cell, all you have to do is this:public boolean moveTile(int x, int y) {
   return isValid(x, y, '*') && move(x, y);
}Note that this last method is just a bit of makeup. You could join it with
the (non-public) 'move' method if you want.
Also note that a bit of functional decomposition and factoring results in
a lot less code.
kind regards,
Jos

Similar Messages

  • Searching through arrays part 2

    lets say i have the following 2d array
    1 2 3 4 5
    6 7 8 9 10
    11 12 13 14 15
    how would i loop through all the elements and check to see if they are in order
    with my array being in the format [row][column] so [0][0] would be 11

    In your previous 2 threads regarding 2-dimensional arrays you have been given code for working with 2-d arrays, and references to the Java Tutorial's arrays section. What is it that isn't working? Post the problem code and someone will help, but I'm not willing to write the solution for you.

  • Searching through arrays part 4

    woohoo! thx to jos for helping me finish the first method
    now that i can swap the tiles
    1 2 3 4
    5 6 7 8
    9 10 11 -1
    how would i check to see if they are in sequential order with -1 being the last element

    package com.allmycode.first;
    public class Simple {
         public static void main(String[] args) {
              int[] array = new int[]{1,2,3,4,1,6,7,-1};
              int aux= Integer.MIN_VALUE;
              if ((array[array.length-1])!=(-1))
                   System.out.println("wrong last index");
              for (int i = 0; i < array.length-1; i++) {
                   if (array<aux){
                        System.out.print("Wrong inside loop" + "position: "+ i);
                        break;
                   aux=array[i];

  • How you search through arrays ?

    Hey, how is it that you search through an array of ojects to find a specific value?
    Eg
    class Buildings
    String name;
    building [ ] build;
    public Buildings ( String name, int max)
    name = nam
    maximum = max
    build = new building[max]
    in an abstract class i have an abstract public double getInsuredValue() as a method, so in the
    class Flat and House, they both have their own getInsuredValue() method and in another method in the Buildings class I have made a method called
    public Building createBuilding()
    int type = 0;
    for (int i = 0, i< maximum, i++)
    if (type = 1)
    build = new Flat(address, name, status and others- these are in the construct of the Flat extends Building class)
    if (type = 2)
    build = new House( address, name, money and others - these are in constuctor of House extends Build class)
    Now what I want to be able to do, is search for the highest getInsuredValue() for a particular type of building, eg I know to find it for say all the types were just one building type
    eg if it was just
    build = new Building() and not ( build = new Flat() aswell as build = new House() you would go
    --method name i have to use except ill take out parameter i have to use
    public Building findHighestInsuredProperty()
    Building highest = build[0]
    double highestValue = highest.getInsuredValue()
    for (int i = 0; i< maximum, i++)
    if(build.getInsuredValue() > highestValue
    highest = build[i]
    highestValue = highest.getInsuredValue()
    return highest;
    but the method has a parameter in it called (int buildtype)
    so for example if it was int = 1, i want it to just search through the array, look at the Flats and bring back highest, and if int = 2, i want it to look through the House ones and bring back value ? How do I do this? Thanks.

    well maybe ive done something wrong before hand
    the array is Building [ ] build;
    in the class i have a method that adds building to array
    public void addProperty (Property leftover)
               if (extra == null || numberofBuilids  > maximum)
                        return;
        build[numberOfBuilds] = extra;
        numberof Builds++
         }the next method i want to create a Building instance and return a reference to it
    public Building createBuilding()
          String name;
          double type;
          double insu;
          Building build;
             for (int i = 0; i < maximum; i ++)
                 name = Keyboard.readString ("Name: ")
                insu = Keyboard.readDouble("Insurance
                 type = Keyboard.readBuilding ("type")
        if (type == 1)
                   build = new House(name, type)
       if (type == 2)
                  buid = new Flat (name, type)
      return build;
    Is this right and does it add these instance to the array ?

  • Searching through an array of objects

    Hi, I am currently working on an assignment where I have to create a class called Persons with data fields of Name(String),age(int),income(int).
    All the values including the string values for name and values for income and age are all randomly generated and are stored in an array of objects of class "Persons".
    The array size is user specified.
    What I must attempt to implement now is to make a search feature that lets the user search through the array of objects for a particular name.
    I'm having some bad luck trying to implement this feature.
    If anyone can help me, I would greatly appreciate that!
    Cheers.

    Hi, Thank you for the prompt reply.
    I do not yet know HOW to start this,I mean I know how to search for individual characters in an element of an array, but to search for whole strings I am quite unsure.
    public class Persons
        //data fields
        private String name;
        private int age;
        private int income;
        //Constructor for Class Persons
        public Person(String[] name,int[] age,int[] income)
              String[] tempName = name;
              int[] tempAge = age;
              int[] itempIncome = income;
        //Instance method for returning some basic values about personal data
        public void toString(Persons ofChoice)
            System.out.println("Persons Data");
            System.out.println("Name: " + ofIntrest.name);
            System.out.println("Age: " + ofIntrest.age);
            System.out.println("Income: $" + ofIntrest.income);
    }This is my Persons class code, but I am quite stumped how to search for whole strings at the time being.

  • AppleScript (or Automator?): How to search through online сhеss games?

    Hello.
    I would like to search for specific online сhеss games. Each game has a single adress. We are talking about millions of games. Obviously, it's far too long to index all the games. So I will set a limit and use the script at night. Conditions should be something like this:
    For adress example.com/game=NumberA to example.com/game=NumberB
    Search every web page containing SpecificWord
    Store wanted web adresses somewhere (so I could see the games by myself during the day)
    As you can see, I know nothing about Applescript and I don't know how to start, nor how the script can pick up adresses. I think it's possible and not difficult to code, just time consuming for the program to search through thousands of games.
    Should I use AppleScript or Automator? Should the script open Safari (or Firefox if possible) or can it search without any browser? Is it possible to simultaneously search through multiple pages/adresses? Maybe I could write several scripts for different ranges of games? If so, how many pages can I open at once? For instance I could disable images in Firefox to load quicker. How much time does it need to search for one game? 1, 2, 3, 4, 5 seconds?
    Any easy tutorials, examples of similar codes, advices, hints or tips are appreciated.

    Thanks for answering. Sorry that I was so unclear. My main problem was how to get urls and games id as variables. But then I thought there already should be programs doing web crawling. I have found Scrapy which use Python language.
    (Maybe I should edit my question, add Scrapy and Python as tags instead of applescript and automator. Is it possible?)
    I have Mac OS 10.6.8, Python 2.6.1. Scrapy needs at least Python 2.7 so I have downloaded the last version of Python (3.3).  I think I can handle the programming in Scrapy thanks to their tutorial. The most difficult part should be... how to install Scrapy. Don't laugh at me.
    I have entered "sudo easy_install Scrapy" in the terminal. But the terminal still uses Python 2.6.1. Python 3.3 is installed but I don't know how to clean update Python. If anyone knows, feel free...
    When I write scrapy in the terminal, here is what I get:
    Traceback (most recent call last):
      File "/usr/local/bin/scrapy", line 4, in <module>
        import pkg_resources
      File "/System/Library/Frameworks/Python.framework/Versions/2.6/Extras/lib/python/pkg _resources.py", line 2556, in <module>
        working_set.require(__requires__)
      File "/System/Library/Frameworks/Python.framework/Versions/2.6/Extras/lib/python/pkg _resources.py", line 620, in require
        needed = self.resolve(parse_requirements(requirements))
      File "/System/Library/Frameworks/Python.framework/Versions/2.6/Extras/lib/python/pkg _resources.py", line 518, in resolve
        raise DistributionNotFound(req)  # XXX put more info here
    pkg_resources.DistributionNotFound: lxml
    It seems Scrapy also needs something called lxml. Right now I am trying to make Python 3.3 the default python version. Is there a web crawler GUI which already includes Python, Scrapy, lxml?
    By default I also have Python 2.4 and 2.5. Does the system need them? I prefer not to delete system files but together all Python versions weigh 500 MB.
    In regard to the real example URL: let's say instantchess.com. Here's a game URL: http://www.instantchess.com/?EXP=1&GPI=84094532
    84094532 is the game id. Let's say I want to search every Reti openings (thus the page must contain the word "Reti") from id 84000000 to 85000000 and store games id in my computer. If I have understood correctly, I need to search through the source code of the pages.
    Feel free to add any remarks, suggestions, ideas.

  • Searching through very large vectors

    I am working on a way to process two flat tab delimited files into a tree, assign a x and y coordinate to each node in the tree and output all the nodes (with their coordinates) to a new flat file.
    I currently have a program that works pretty well. It roughly uses the following flow.
    - Read both files into memory (by opening the file reading each line and load the appropriate data from each line into a Vector, making sure no duplicates are entered by comparing the currentline to the last line.
    - Using the first vector (which contains the strating nodes) search through the second vector (which contains parent child relationships between 2 nodes) to construct the tree. For this tree I use a XML DOM Document. In this logic I use a for loop to find all the children for the given node. I store the index of each found reference and when all children are found I loop through all the indexes and delete those records from the parent-child vector.
    - After the tree is created I walk through the tree and assign each node a x and y attribute.
    - When this is done I create a NodeList and use are for-loop to write each node (with x and y) to a StringBuffer which is then written to a file. In this process for each new node that is written I check (in the StringBuffer) if the node (name) is present. If not I write the new Node.
    - For debugging purposes I write all the references from the second Vector to a file and output the XML DOM tree to a XML file.
    This program works wel. It handles files with 10000 start nodes and 20000 parent-child references (30000 nodes in total) in under 2 minutes (using 1:20 for the generation of the output file).
    However when the volume of these file increase it starts to struggle.
    As the ultimate test I ran it with a file that contains 250000 start nodes and 500000 references. For it to run I need to use the -Xmx256m parameter to allocate extra memory. But I ran it for 2 hours and killed it because I didn't want to wait longer.
    What I would like to know is how I can approach this better. Right now I'm loading the data from the files into memory entirely. Maybe this isn't the best approach.
    Also I'm looping through a Vector with 500000 elements, how can this be done more efficiently? However the reference vector isn't sorted in any way.

    Hi,
    That's no problem.. Here's some sample code:
    package tests;
    import java.util.List;
    import java.util.Map;
    import java.util.HashMap;
    import java.util.LinkedList;
    import java.util.Iterator;
    class Example {
        private List roots;
        private Map elements;
        public Example() {
            roots = new LinkedList();
            elements = new HashMap();
        public void initRoots(String[] rows) {
            for (int i=0; i<rows.length; i++) {
                String[] parts = rows.split(" ");
    String name = parts[0];
    roots.add(name);
    elements.put(name, new Node(name));
    public void addChilds(String[] rows) {
    for (int i=0; i<rows.length; i++) {
    String[] parts = rows[i].split(" ");
    String parentId = parts[1];
    String name = parts[2];
    addNode(parentId, name);
    private void addNode(String parentId, String name) {
    Node current = (Node)elements.get(name);
    if (current == null) {
    current = new Node(name);
    elements.put(name, current);
    Node parent = (Node)elements.get(parentId);
    if (parent == null) {
    //Parent is missing, is that a problem?. Create it now.
    parent = new Node(parentId);
    elements.put(parentId, parent);
    return;
    parent.addChild(current);
    public void printTree() {
    for (Iterator it = roots.iterator(); it.hasNext(); ) {
    String id = (String)it.next();
    printChildren(id, 1);
    private void printChildren(String id, int depth) {
    Node node = (Node)elements.get(id);
    System.out.println(node);
    private static final class Node {
    private String name;
    private List children;
    private Node(String name) {
    this.name = name;
    children = new LinkedList();
    public void addChild(Node node) {
    children.add(node);
    public String toString() {
    return name + " " + children;
    public static void main(String[] args) throws Exception {
    Example test = new Example();
    test.initRoots(new String[] {
    "SU_1 1 1 1 0 0 0 0",
    "SU_2 1 1 1 0 0 0 0",
    "SU_3 1 1 1 0 0 0 0"
    test.addChilds(new String[] {
    "COM_1 SU_1 PR_1 0 0 0 0 0",
    "COM_1 PR_1 ST_1 0 0 0 0 0",
    "COM_2 SU_2 PR_2 0 0 0 0 0",
    "COM_2 PR_2 ST_2 0 0 0 0 0",
    "COM_3 SU_3 PR_3 0 0 0 0 0",
    "COM_3 PR_3 ST_3 0 0 0 0 0"
    test.printTree();
    The execution prints:
    SU_1 [PR_1 [ST_1 []]]
    SU_2 [PR_2 [ST_2 []]]
    SU_3 [PR_3 [ST_3 []]]
    /Kaj

  • Search Through Invoice option in Transaction tab in BOB webshop

    Hello Experts,
    We have the following requirment.
    -Search through Invoice option in transaction tab in BOB webshop.
    We understand that this would be through devlopment in ABAP/ Java.
    Isthere any otehrway to achieve this ?
    Pointers to this would be helpful.
    Thanks in advance.
    Regards
    Sanjib

    Hi Sanjib,
    Do you really need an enhancement for this?
    1. Can you see the invoices created for your order as a part of the document flow in BoB webshop order?
    2. Also, hope you have done the setting in TRANSACTION tab in SHOPADMIN Setting for your BoB Webshop
    If yes, you should be able to search the Transaction with the INVOICE option.
    Hope this will be useful
    Regards

  • Need code to search through folder and subfolders

    Hi.....
    Am trying to write a program to search for a file through folder and all of its sub folders.
    I tried my best but i was able to search through a folder but not through its sub folders.
    So, anyone could help me out with the code to do this operation?
    Regards
    codingquest

    codingquest wrote:
    Thank you very much for your reply.
    I tried to use the recursive call but i could not do it without any errors.
    So it would be helpful to me if you post the exact coding or the key part of the recursive call here.You'd get better response when you post your code and the error message(s). I'm sure someone will be able to point you in the right direction.

  • Looping through arrays

    Hello,
    I am developing a program which contains redundant code as it contains too many methods that loop through the same two dimensional array all the time.
    The reason why the code is redundant is because I need to perform a different action to different values in the array each time (depending on whether statement is true or false).
    What I want to try and do is create one single method which loops through the array and returns a boolean value.
    The method needs to take something like an if statement as a parameter so that I can stop searching through the array when the value of some element in array satisfies the if statement.
    How do I do this? How do I cut down the amount of code that searches through the same array all the time.
    Hope someone can understand
    Thanks

    Are you looking to do something like this?
    interface Predicate {
        boolean apply(int arg);
    class IsEven implements Predicate {
        public boolean apply(int arg) {
            return arg % 2 == 0;
    public class PredicateExample {
        public boolean searchMaxtrix(int[][] m, Predicate p) {
            for (int[] row : m)
                for(int x : row)
                    if (p.apply(x))
                        return true;
            return false;
    }

  • Search 1D array problem

    Hey guys,
    I'm trying to write (what I imagine) is a simple program to progressively step through a text file in array format, honing in on the maximum value, while comparing values along the way (the attached code will do a better job of explaining).  I am aware that I could simply use a maximum value find to obtain what I am looking for, but this is just a simple exercise to simulate something a bit more difficult I'll be doing down the road, thus I have real reasons for doing this all backwards.
    The problem I run across is when using the "search 1D array" command, it only works on certain elements.  For instance, if you load the code I have attached along with the input file, and input a crystal angle of "40" and a an angle offset of "0.01", then run in highlight mode, you'd see that as soon as it got to search for element 40.02, inside the for loop, it wouldn't find element 40.02 in the file and jump the result to "-1" and keep running, but yielding bogus results.  The problem is that 40.02 DOES exist in the array (search for element 198 in the output array to find it).  In addition, if you input 40.02 as the initial starting angle, with the same 0.01 offset, the first run works just fine (finding element 40.02 this time, when not executing in the loop) but bombing out on the search for 40.06, again yielding a value of -1 when the 40.06 actually exists. 
    This same type of behavior occurs throughout the array, with certain elements being "un-reachable" via the "Search 1D Array" command when used in the loop, but being reachable when searched for from the initial start, and consistency being shown in the "un-reachable" elements when the code is run over and over.  Again, running the code in highlight mode will clear up any questions about the problem statement, I believe. 
    Does anyone have an explanation as to why this is occurring and how to fix it?  I thought maybe it was in the string to number conversion, but that doesn't make sense since it can find the numbers outside the loop, but not in it. 
    I am running Labview version 7.0 for the record. 
    Thanks!
    ~Jack
    Attachments:
    normal 40.34 txt.txt ‏7 KB
    file io practice.vi ‏51 KB

    I put my and gabi's advice together:
    I first had issues in finding any value because my computer takes ',' as the decimal sign instead of '.'
    Ton
    Message Edited by TonP on 05-29-2007 10:51 PM
    Free Code Capture Tool! Version 2.1.3 with comments, web-upload, back-save and snippets!
    Nederlandse LabVIEW user groep www.lvug.nl
    My LabVIEW Ideas
    LabVIEW, programming like it should be!
    Attachments:
    file io practice_mod.png ‏18 KB
    file io practice_mod.vi ‏26 KB

  • How to Search and Array for multiple occurrences of a value

    Hi,
    I am trying to search an array of doubles for a number and report the index location(s) of a number. I.e. -allow for repetition. Search and report all index[i] where the number is contained in the array. For example I have
    double[] myInputArray = new double[5];
    double[] myInputArray = { 1, 2, 3, 3, 5 }I know how to search through the array ONCE and return the first occurrence of a number:
    public double GetIndexOf(double Number) {
        for (int i=0; i<myInputArray.length; i++) {
             if (myInputArray[i] == Number){
                  return(i);
        return(-1);
      }How do I expand this code to report multiple index[i] locations if the number reoccurs in the array like the number 3 does in my example array above?

    The way the Java libraries do this type of operation (String.indexOf(), etc) is to specify the starting index along with what you want to find.
    Changing your example slightly (notice how I fixed your naming and more importantly, your return type):
    public int indexOf(double num) {
       return indexOf(num, 0);
    public int indexOf(double num, int fromIndex) {
        for (int i=fromIndex; i<myInputArray.length; i++) {
             if (myInputArray[i] == num){
                  return(i);
        return(-1);
    //usage to get all indices:
    for ( int index = -1; (index = indexOf(num, index+1)) != -1; ) {
       System.out.println(index);
    }Note that due to how floating point numbers work, you may find doing this on doubles (or any other operation that uses == with double arguments) to give you unexpected results.

  • Searching 2D array for duplicates

    Hi There. I wonder if someone can help.
    I have a 2D array of strings (resulting from a database query) One col is a list of job numbers and the other is a list of dates. My SQL query produces results for distinct job numbers and distinct dates. So if there are entries in the database where a job number is split between two or more dates, there will be two (or more) entries.
    SELECT DISTINCT SONumber, DateEstimatedShip FROM JobDetails WHERE jobdetails.status <700
    What I am trying to do is search through the list of job numbers and list out in a separate array the numbers that are duplicated. I've tried to do this by passing the raw 2D array into a indexing tunnel in a for loop. Then check if there are any duplicates from the next position down in the array to the end. This works fine, but if there are any items that are duplicated more than once I get two entries in my list of duplicates - as in my example below job number 3466 is listed twice as it has three entries in the raw sql table.
    How can I turn this array into a list of just the numbers that are duplicated (with no duplicates within it)
    I hope I've explained this to a satisfactory level.
    Any thoughts will be greatly appreciated.

    You can perform a second search on your 'list of duplicates' array using the same input as your first search, then if the second search index is <0 you can insert into the 'list of duplicates' array.
    (Norbert beat me by a few seconds...)
    Message Edited by Phillip Brooks on 12-02-2009 07:58 AM
    Now is the right time to use %^<%Y-%m-%dT%H:%M:%S%3uZ>T
    If you don't hate time zones, you're not a real programmer.
    "You are what you don't automate"
    Inplaceness is synonymous with insidiousness

  • Searching through a table

    hello,
    what i have is a table with binary strings.  i am seaching through the table to find matching strings that the user inputs.  i use a for loop but i need a way to do a few options.
    1. i know there is a way to use the for loop without having to specify a "N" value but is the way i am doing it sufficient.
    2.  my program is not highlighting all the occurences, it is skipping some occurences
    3.  search for 1st occurence
    4  Go to next occurence
    5.  Find all occurences
    6.  an option to clear the table and the table selections.
    i attached a vi that does the searching but that's about it.  thank you in advance
    Attachments:
    table searching.vi ‏19 KB

    SInce you don't know how many elements will match, you must use a while loop, not a FOR loop.
    Simply reshape the array to a 1D, the use search 1D array until you run out of elements. Attached is a quick sketch (LAbVIEW 8.0), see if you can take it from there. It also shows a way to reset all table backgrounds to white.
    (There are many other ways to do this.)
    LabVIEW Champion . Do more with less code and in less time .
    Attachments:
    tableSearchingMOD.vi ‏16 KB

  • Will Aperture search through "off-line" media

    I've been looking through Apple's tutorials on project management and posting on another forum but still having difficulty getting an answer on this.
    Currently, I'm using ACR and iView. Typically I'll store my digital photos into batches (either by project, vacation, or a range of numbers) and burn onto a CD or DVD when they reach a certain size (ie. enough to comfortably fit on a disk). I then use iView to build my catalogs and add keywords.
    When I use iView to keyword search, it will search through all the catalogs (I have them stored in one folder). The catalogs don't have to be open. When the search is complete, it will open a new window with thumbnails of the images and the location (ie. "Digital Photos Disk 9").
    The impression I get with Aperture is that the images have to be accessible "live". That is, on your HD or an external HD. The website says "Aperture tracks backup status and location of all images" yet says nothing - at least that I can find - about storing your images on CD/DVD.
    My question is: Does Aperture work the same way as iView when it comes to cataloging (Project-ing) and keyword search?
    TIA

    Yikes. Having gigs of images available "live" just
    isn't an option for me. I would never let them sit on
    a magnetic HD that's prone to failure anyway. Too
    many eggs in one basket.
    Maybe v2 ...
    In the meantime I'll stick with iView (as much as I'm
    not pleased they're part of the MS family now).
    Thanks for the info.
    I understand your sentiment. But I'd throw a bit of caution your way. Optical media not reliable.
    True, hard drives fail--all of them will eventually fail. Several of mine have. Indeed, so have a good number of optical discs, from DVD RAM to DVD-R/RW.
    The key is to have your data backed up. I used to keep my images online on a hard drive, then back up to DVD...twice, just in case. But I never really had the time to verify the integrity of the disk. I've tried to read some a week or month later and it failed. This has happened on reputable brands, and off-brands with about equal frequency...and these were disks that verified after writing.
    For me it's MUCH faster to have a set of hard drives I back up to and rotate the backups. I don't keep the backups online, so they won't wear out as fast. I keep them in separate locations to avoid natural disasters or theft. I rotate them regularly. Backup to a hard drive is convenient, fast, and relatively worry-free. Aperture Vaults make the process even more effective.
    Even if Aperture offered to write to DVD's, I wouldn't...but that's just me. It's slow to write to, difficult/time-consuming to verify, slow to read to from, and I never know if it'll be around when I need it to. Archiving my DVD's was a big pain. Having transferred my older files from a portion of my previous DVD's to the "live" hard drive verified for me how tedious and time consuming it is.
    I suppose it would be nice to write an occasional project to DVD from Aperture. But it is pretty easy using the Finder.

Maybe you are looking for

  • ___How do I make this sign look real(er)??

    I'm trying to make this sign* look like an actual real sign (like a sign that would have neon type lettering, but turned off during the day), that would hang above a restaurant/bar in a cosmopolitan city. the client thinks it isn't 'real' lloking eno

  • Events in iCal doubled after use of iSync and Nokia 6300

    Hi, I've got a problem with the sync though iSync of the Nokia 6300 and iCal on my Mac – a problem which might be related to the imported phoneplugin – but I really don't think so, as other users doesn't seem to have any problems with this phoneplugi

  • How to get reports cumulated balances? need help please

    Dear all, I need your help please in this issue. I am creting a report using reports designer in oracle, well the fact is i don't know how to do the following: if i have for example in the report the following to be diplayed : Date Amount Balance 25/

  • Disaster recovery question

    Your forum was recommended for my question/issue We have two semi-annual disaster recovery tests annually. The pre-test process is composed of restoring the Disaster Recovery Client from the Production client, and allowing one set of users to perform

  • Stopping CD Import???

    Sometimes I'll load a music CD into my iMac, hit the wrong keys, and--whoops!--I'm importing a CD that I don't want to import into iTunes. How can I stop the importation process once it's started? So far I've looked everywhere but can't find a way. T