Loading Array?

I have found a script that allows me to create a scrolling
photo gallery for my site. The actionscript code that you modify
yourself has an array and you can just change the names of the
pictures to match your own to pull pictures into the movie. The
array is the picture names enclosed in quotation marks and
separated by commas.
I would love to load this info dynamically. I have a php page
that pulls all the pictures in a directory and publishes those.
http://www.stacybuckley.com/vars/pics.php
There are various ways (maybe not the best) that I can import
this data into flash but the quotation marks come out encoded and I
can't seem to "un*escape" them.
I could leave the quotation marks out of my php page, but
then when I reference the array position it doesn't see it as a
string and the script doesn't work.

i don't see the loading method for the php doc in this code -
however you should be able to leave out the quotes and they should
come in as a string. If you are trying to pass this as an array,
that may also be part of the problem. you'd need to pass it as a
concatenated string and then use split at the commas on loading and
push them into the array, then they should come in as
strings.

Similar Messages

  • Load array of images

    Looking for a little direction. I'm trying to load array of
    images into flash and eventually make the image draggable.
    Can anyone point me to a tutorial that can help?
    Thanks

    Looking for a little direction. I'm trying to load array of
    images into flash and eventually make the image draggable.
    Can anyone point me to a tutorial that can help?
    Thanks

  • Load array variable from external xls file

    I want to initialize an array variable using an external xls file.
    I am trying with property loader step but I have to insert manuallly all the elements of the array.
    Is there any other way to do this?
    Thanks
    Valter

    Hi FiloP
    When i open and close your example in my Teststand (Engine and Editor 4.0.0.326) Teststand asked me to save
    some NI-Tpyes.ini !!!
    That means my TS NI Types from release date: 2007-April-05 differes from yours.
    There could be to two reasons: your files are conterminated or NI have relased a new update with newer step-types.
    So until this not clear everbody should be carefully. Never acept savings to NI-Types when closing.
    To get more information about this please visit this thread:
    http://forums.ni.com/ni/board/message?board.id=330&message.id=17427#M17427
    greetings from the lake of Constance, Germany
    and get never affected by a type virus
    juergen
    HI Valter1,
    tomorrow evening i will post a C# example.
    greetings
    juergen
    =s=i=g=n=a=t=u=r=e= Click on the Star and see what happens :-) =s=i=g=n=a=t=u=r=e=

  • Loading Arrays to XML Object

    Could you please let me know, what would be the best approach in loading a String array of data(about 300 elements) to XML object's Setter method's.

    Thanks for your response...
    Do I have to write 300 setter methods to load the individual element in the array ?
    I have 300 elements in a String array and I have about 300 XML elements too.
    Here is what I want to do.
    Take the first String element in the array and set the value to the first XML element. (i.e.) setElement1(arrayOfData[1]), and the second String element to the second XML element, setElement2(arrayOfData[2]) and so on... (upto 300 elements).

  • Speeding Up Load Array From Excel subVI

    Hi there,
    I've got a subVI that loads a 2D double array from an Excel file. Currently, it needs about 500ms between runs to not cause a variant error, something to do with getting everything opened and closed. I was wondering if anybody could see anything obvious that's slowing it down. If you could help me optimise this a little that would be great. Even if I could shave it down to 200ms.
    Solved!
    Go to Solution.

    Here is a quick example of what I'm talking about.  Placing the App reference open/close outside the loop gets you down to around 300 ms.
    "There is a God shaped vacuum in the heart of every man which cannot be filled by any created thing, but only by God, the Creator, made known through Jesus." - Blaise Pascal
    Attachments:
    Excel Read 2DArray_loop.vi ‏28 KB

  • Can URLClassLoader() load arrays ?

    Hi all,
    I can use URLClassLoader() to load a class such as "Classes.Person". How can I use a URLClassLoader() to load an array of the same class such as "[LClasses.Person;"?
    Thank you

    r035198x wrote:
    Arrays are a language feature and are dynamically created so you only need the component type of the array to be available and the language will do the rest.
    http://docs.oracle.com/javase/specs/jls/se7/html/jls-10.html
    Thank you

  • Can the Property Loader load arrays of variable size?

    I need to run a series of tests on the same UUT, changing only one parameter at a time (for example, a frequency response test). The hardware developers would like to be able to change the values of parameters of the test at will, without making changes to the sequence. That's easy - just change the value of the parameter in the Properties file. The hard part is changing the number of iterations of the test, by ONLY adding or deleting the number of parameters from the text file. In other words, all I know during sequence editing is the types of parameters, not the values or how many. I want the test to loop as many times as there are sets of parameters in the text file.
    I would like to do this by loading the paramet
    ers as an array. But the Property Loader wants me to specify each variable while I am editing the sequence, including each individual member of the array (e.g. "Locals.Array[0].Value"). I want to do somthing like "Locals.Array[*].Value", where "*" means "all elements".
    Am I forced to write external code to load each parameter, or does TS have a native way to do this? Even better, has anybody done this already, and will you explain how? Thanks

    Hi,
    there's a couple of options here, and I've included what I think is the simplest below (using TestStand 2.0.1).
    It's not exactly elegant though. What I've done is to put in a step that finds out the number of steps to load (based on an earlier decision - in this case a message popup step). I read a number from the limits file, and use this in the looping options of the property loader step that's loading the values into the array. I've done it with a fixed size array target here, big enough to take any incoming data. (Otherwise, knowing how many items you're going to load from the limits file, you could start with an empty array and re-size it prior to loading).
    I've cheated slightly by using the pre-expression on the property loader step to specify where th
    e data is coming from and where it's going to in the sequence on each iteration of the loop based on the Runstate.Loopindex.
    Another option is to go straight into the property loader step, and keep loading properties until the Step.Result.NumPropertiesRead = 0 (remember we're only doing this one at a time)
    Another idea would be to load in a value, and check it isn't a "flag" value (i.e. you'd never use say 999 in your array, so set the last element in your limits file to this, and drop out of the loop when this happens.
    Further still, you've got the source code for the property loader step, so you could re-write it to make a custom step that loads an array until it fails all on its own (no looping in TestStand).
    Hope this gets you going
    S.
    // it takes almost no time to rate an answer
    Attachments:
    DynamicPropertyLoader.seq ‏32 KB

  • OLT - multiple user load - Array Index Out of Bound error

    Hi,
    I am executing a load test with 12 users.
    All the 6 script scenarios are written in OpenScript editor. They all have databanks associated with them.
    When I run the test in OLT with 2 users per script scenario making that a total of 12 users, I see the following exceptions that have the wording as:
    + An unexpected exception occured in the script. Script section: Run. Caused by : ArrayIndexOutOfBoundsException occured. 71>=71
    + An unexpected exception occured in the script. Script section: Run. Caused by : ArrayIndexOutOfBoundsException occured. 206>=206
    + An unexpected exception occured in the script. Script section: Run. Caused by : ArrayIndexOutOfBoundsException occured. 206>=86
    Has anyone seen this error before, It is sporadic and does not always occur on the same scrip
    The version I am using is OLT 9.30.
    Thanks,
    Kranti.

    Thank You for your response.
    When I run with a single user using databank, I don't see this error.
    It apparently happens only when I use multiple users and it is quiet random so I cannot narrow down on a particular script to figure out the error.
    In one run scenario A shows this error in another run scenario A runs perfectly fine and some other scenarios shows this error.
    Also, I have around 100 values in the data bank and I see this error early on by around the 10th or 20th value in the data bank.
    Where can I check the resultIndex number?
    This is how I make my calls to the databank in the OpenScript script.
    getDatabank("ReinstatePolicyNumbers").getNextDatabankRecord();          
              getVariables().set("polNumber", "{{db.ReinstatePolicyNumbers.Var1}}");
              reinstatePolicy(userid, getVariables().get("polNumber"));
    Thanks,
    Kranti.

  • Problem With Referenced Array Loading

    Hi. I'm working on the final lab for my java class at the moment, and I'm to create a program which reads a file containing transaction records, stores each record as an array element, and then prints various types of reports using the array of transactions. I've created a class called Transaction which stores all the data for each transaction, and the array used in my program is of type Transaction.
    I'm not having any problems in writing the program, except there's something going wrong with my attempt to write a method to load the array. The method declaration is:
    *  Method to accept a file from the user and load its data into an array.
    *  Returns the number of elements added to the array.
    public static int loadArray(Transaction[] transactionArray, int size) throws ExceptionNow, I'm under the impression (and my teacher confirmed this) that arrays are passed by reference. So I'm assuming that by creating an array in my main method, passing it into loadArray(), and changing the values within the method, all the data will be present in the array within main without having to explicitly return the loaded array.
    However, as soon as I try to do anything with the loaded array, I get a NullPointerException. I opened up the debug mode, set a breakpoint in my main right after loadArray() is called, and it shows that every element in my array is null. I am at a loss as to why. If anyone can help me figure out why my reference array isn't staying updated as it's edited elsewhere, it would be greatly appreciated.
    Here is my loadArray() code in case it would help, but there is no error in it's execution, as the same code directly in my main method works fine.
         public static int loadArray(Transaction[] transactionArray, int size) throws Exception
              int logicalSize = 0; // the number of transactions loaded into the array
              int itemID; // the item ID involved in the transaction
              int units; // the number of units in the transaction
              double unitCost; // the cost of each unit in the transaction
              char type; // the type of the transaction
              String date; // the date of the transaction
              String fileName; // the name of the user selected file
              String record; // the current record in the file
              Scanner file; // reads input from a user selected file
              Scanner parse; // reads input from the file's current record
              transactionArray = new Transaction[size]; // creates a new array for the new data
              System.out.print("Please enter a file name: ");
              fileName = input.nextLine();
              file = new Scanner(new File(fileName));
              record = file.nextLine(); // discards the initial line of headers
              while(file.hasNext())
                   // grab the next record and parse all its data
                   record = file.nextLine();
                   parse = new Scanner(record).useDelimiter(",");
                   date = parse.next();
                   itemID = parse.nextInt();
                   type = parse.next().toUpperCase().charAt(0);
                   units = parse.nextInt();
                   unitCost = parse.nextDouble();
                   transactionArray[logicalSize] = new Transaction(date, itemID, type, units, unitCost); // loads the current transaction into the array
                   logicalSize++;
              return logicalSize;
         }Thanks!
    Oh, I guess I should also add that the variable input is a global variable of type Scanner.
    static Scanner input = new Scanner(System.in); // reads input from keyboardMessage was edited by:
    Kristofer.Ward

    Now, I'm under the impression (and my teacher confirmed this) that arrays are
    passed by reference.Java passes references to arrays by value.
    So I'm assuming that by creating an array in my main method, passing it into
    loadArray(), and changing the values within the method, all the data will be present
    in the array within main without having to explicitly return the loaded array.Bearing in mind my statement above, what really happens is that a reference to
    the array you created is passed to loadArray() by value. What I mean by that
    last bit is that your loadArray() is free to assign a reference to a completely
    different array to its argument variable and the caller will not notice the change.
    That's what's happening here:public static int loadArray(Transaction[] transactionArray, int size) throws Exception
        // declarations of local variables
             * The argument variable is now assigned a reference to a completely
             * new array.  When this function returns the variable the caller used to
             * invoke this method will have exactly the same value it did before this
             * method was invoked.  Ie it will *still* refer to an array of nulls.
        transactionArray = new Transaction[size];
        // more stuff - that involves changing the contents of
        // the newly created array, not the one the caller has
        // a reference to.
        return logicalSize;
    }

  • JTextArea, Printing more then one Array item

    I have a run time problem. I am loading arrays to be printed out in a JTextArea. I'm using netbeans to create the application.
    I want to be able to print out the array items into the text field. Is there anyway I can do this. At the moment it is just printing out the last item of each array into the Text Area. Can someone please explain the problem with the text area, or how to get multiple items from an array printed in an application.
    public void ArrayPrinter(String[] AirlineName, String[] Destination, int[] SeatsOpen, double[] TicketCost){
             for (int i = 0; i < AirlineName.length; i++){
                jTextArea1.setText(AirlineName[i] + ", " + Destination[i] + ", " + SeatsOpen[i]+ ", " + TicketCost);

    Call append() rather than setText().
    While you're at it, get your data out of parallel arrays and into a proper class.
    [The Java� Tutorial - Lesson: Classes and Objects|http://java.sun.com/docs/books/tutorial/java/javaOO/index.html]
    ~

  • Problem with .unload from an array

    hello guys,
    i'm really are clueless here pless do help me with this..,
    so i load external swf and store the loader inside an array some of the loaded swf is mine and have method called destroy which used for optimazitation of Garbage COllection and someother are unknown swf (really unknown can be created from as1 or 2 or even 3 i just don;t know anything bout them) the loading and storing does work well.
    Problem came when i tried to unload the the loaded swf,
    so i tried to use SWFArray[i].unload() and all it gives me is :
    Error #2025: The supplied DisplayObject must be a child of the caller
    here is the code i used :
    private function OnSWFLoadComplete(evt:Event):void
         evt.target.removeEventListener(Event.COMPLETE , OnSWFLoadComplete);
         //adding the loaded swf to it's container movieclip and then adding it to the mainContainer
         SWFContainer = new MovieClip();
         SWFContainer.addChild(SWFLoader.content);
         mainContainer.addChild(SWFContainer);
         if(myCounter < (totalSWF-1))
         myCounter++;
         loadSWF();
    the code to load :
    private function loadSWF():void
                   SWFLoader = new Loader();
                   SWFArray.push(SWFLoader);
                   SWFLoader.contentLoaderInfo.addEventListener(Event.COMPLETE , OnSWFLoadComplete);
                   SWFLoader.load(new URLRequest(SWFList[myCounter].@source));
    the code onLoadComplete:
    and after some point i wnat to clear the screen and remove this external swf especially the unknown swf  from the memory not only from the stage
    here is the code i use :
    //removing external SWF that has been loaded
    for(var i:Number = 0; i < totalSWF; i++)
         //some of the loaded swf is created by myself and have method/function called "destroy"
         //and the rest are totally unknown
         if (SWFArray[i].content.destroy)
              SWFArray[i].content.destroy();
         mainContainer.removeChildAt(0);
         SWFArray[i].unload();
    this.stage.removeChild(mainContainer);
    the line that is italized,bold, underlined are the one that i suspect cause the error..,
    so can anyone help me solve this..,
    or even tell me how to unload this dynamicly loaded external swf??
    thanks in advanced guys

    Andrei1 wrote:
    I missed the fact that you do remove listeners.
    The main point of my code sample is that it removes only children that exist on display list (while loop). Based on your original post it seems like the reason for the error is that you attempt to remove objects that are not on display list at the time you call removeChild().
    nope the problem is definetly has connection with the loader, array and way to acces the .unload() from an array..,
    why i so persistent about this??
    because if i simply don't use the line "SWFArray[i].unload()"
    and i did change the code into  :
    private function loadSWF():void
                   var SWFLoader = new Loader();
                   SWFArray.push(SWFLoader);
                   SWFLoader.contentLoaderInfo.addEventListener(Event.COMPLETE , OnSWFLoadComplete);
                   SWFLoader.load(new URLRequest(SWFList[myCounter].@source));
    and still having the same problem..,

  • Loading data from a JavaScript file

    I am writing a Java application that will run client-side, and will essentially allow the user to download, update, and then reupload a JavaScript file. The data I'm needing to parse / build to the JS file consists of staticlly-defined string arrays, and one associative array.
    The file looks like this.
    var array1 = new Array();
    array1[0] = "String1";
    array1[1] = "String 2";
    array1[2] = "String 3";I'm wondering if there is a more simple/eleoquent way of loading arrays from a JavaScript file than simply reading them and writing parse code by hand to extract the data I want... I can write the parsing code without any problem, but, I'm wondering if there's something built-in that I just don't know about...
    Thanks

    You can use the ScriptEngine provided in Java 6. Takes a little hacking, but here's how you'd do it:
    a simple javascript file:
    //test.js
    var myArray = [];
    myArray[0] = 'Something';
    myArray[1] = 'To';
    myArray[2] = 'look';
    myArray[3] = 'at';
    //ScriptTest.java
    import javax.script.*;
    import sun.org.mozilla.javascript.internal.NativeArray;
    import java.io.FileReader;
    class ScriptTest {
      public static void main(String[] argv) throws Exception {
        ScriptEngine js = new ScriptEngineManager().getEngineByName("javascript");
        FileReader script = new FileReader("test.js");
        js.eval(script);
        NativeArray array = (NativeArray)js.get("myArray");
        for(int i = 0; i < array.getLength(); i++)
          System.out.printf("Object: %s\n", array.get(i, array));
    }Now, since NativeArray is an internal class, you'll need to add rt.jar to your bootclasspath:
    javac -bootclasspath JAVA_HOME/lib/rt.jar ScriptTest.javaSee. Told you it was a hack. :-)

  • Controlling the load

    How I can (in which event) to control the loading of page elements (divs and elements created in design time) to display messages in the charge as "Loading section1", "Loading section 2", "Loading array of elements", "Loading section 3", "Loading images", etc.?
    Now, with animated .gif in preloader I can't show information about loading process.
    Is it possible to load or unload divs to free up memory and optimize loading and only load them when needed?
    Tx.

    You can use yepnope.
    tutorial #1.
    tutorial #2.
    You can try this ugly code:
    yepnope.addPrefix('preload', function(resource){
      resource.noexec = true;
      return resource;
    yepnope({
      load: [
      "preload!images/p2.jpg",
      "preload!images/p3.jpg",
      "preload!images/p4.jpg",
      "preload!images/p5.jpg",
      "preload!images/p6.jpg"
      complete: function() {
      var message = sym.$("message"), loaded = 2, news="Loading 5 images: <br>";
      $('img').each( function(i){
      if (i>1){
      $(this).hide();
      $(this).attr('src', 'images/p'+i+'.jpg')
      .load(function(){
      if (this.complete) {
      news += '>> image #'+i+' loaded.<br>';
      loaded++;
      if (loaded == $('img').length){news += "Loading completed."};
      message.html(news);
      $(this).fadeIn(3000);
      }; //if complete
      })//load
      };//if i>0
      });//each img
      }//complete
    });//yepnope
    1) Old school:
    $('img').each( function(i){
      if (i>1){
      $(this).hide();
      $(this).attr('src', 'images/p'+i+'.jpg')
      .load(function(){
      if (this.complete) {
      news += '>> image #'+i+' loaded.<br>';
      loaded++;
      if (loaded == $('img').length){news += "Loading completed."};
      message.html(news);
      $(this).fadeIn(3000);
      }; //if complete
      })//load
      };//if i>0
      });//each img
    2) one yepnope:
    yepnope.addPrefix('preload', function(resource){
      resource.noexec = true;
      return resource;
    yepnope({
      load: [
      "preload!images/p2.jpg",
      "preload!images/p3.jpg",
      "preload!images/p4.jpg",
      "preload!images/p5.jpg",
      "preload!images/p6.jpg"
      complete: function() {
      $('img').each( function(i){ if (i>1){ $(this).attr('src', 'images/p'+i+'.jpg’) }; });//each img
      }//complete
    });//yepnope

  • Refreshing an array

    i have chess program which has newgame() method inside it
    with local array
    now i implemented loading postion of my game form file and when i load game it display board [with new array(array in updateloaded from file)] but still use [arrays in (defualt)new game] as its calculation array how can i reset value(in new game) [it correct itself after the first move) i think it construct progame with old value and it refresh them when it through it once.it work properly after other player make its move
    how can i tell loadgame with load arrays rather arrays in newgame.
    does anything to do with how i initial the array.
    tanx
    [code]
    Class Board{
    int loadboard[]= new int [120];
    int loadboardcolor[]= new int [120];
    public void drawloadBoard(){  
    updateload();
    repaint();
    }public void updateload()
    {     for (int i=21;i<99 ;i++ )           
    { board<i>=loadboard<i>;
    boardcolor<i> = loadboardcolor<i>;
    }public void newgame ()
    {     //generate original position 
         int [] openningpostion = {     7,Pawn,Pawn,Pawn,Pawn,Pawn,Pawn,Pawn,Pawn,7,          7,FreshRook,Knight,Bisshop,Queen,Freshking,Bisshop,
    Knight,FreshR };     
    int [] Coloropenning=     {     7,White,White,White,White,White,White,White,White,7,          7,White,White,White,White,White,White,White,White,7,            };}          
    // here it method which should update my board     
    for (int i=0; i < 120; i++)          
    { board <i> = openningpostion <i>;
         boardcolor<i> = Coloropenning<i>;      }}
    tanx

    I tried your code and it did work. I implemented your suggestion but in my application it keeps adding the new data as an additional curve. I cannot append the new data, even if the shift register feeds the data into the build array. I can't see at the moment what I did wrong...
    Attachments:
    waveform_graph_udate_2.PNG ‏50 KB
    waveform_graph_udate_2_front_panel.PNG ‏32 KB

  • File wont read,  and I'm ready to tear my hair out!!!

    Good Morning
    I wrote a short program to read a .txt file and assign values into an array. My program works, woo hoo (or so I thought...)
    But when I took the same code, and pasted into a function of a larger program, the file doesnt get read! In my larger program, I need the function to return the value of the array so I can use the array elsewhere. II originally thought the file didn't read because the .txt file and program were not stored in the same folder, which is not the case. So now I am wondering if I needed to pass a value to the function, or to call the function from inside the larger file, or basically what the heck I am missing! I am just not seeing it and am totally lost and dreaming of this, when I sleep of course!
    Code that works on its own -
    import java.io.*;
    import java.io.FileReader;
    import java.io.IOException;
    import java.util.Scanner;
    public class readInput {
       public static void main(String args[])throws FileNotFoundException, IOException  {
                //declaration of variables
                int i; // close the term.dat file
                int counter = 0; // counter for loop, also the index of the array for terms
                   int [] termInfo  = new int[3];
                  int test =0;
               try {
                FileReader termInput = new FileReader("terms.txt"); // creates file reader for rates file
                Scanner scan1 = new Scanner(termInput); // scanner searches the file for what is requested
                while (scan1.hasNext()) {
                    if (scan1.hasNextInt()) {
                        // if found, assign to an array value
                        i = scan1.nextInt();
                        termInfo[counter] = i;
                        System.out.println("Value " + test + " in term array is " + termInfo[counter]);
                        counter++;
                        test++;
                    } //close of if
                } //close of while
              termInput.close(); // close the term.dat file
             } // CLOSE TRY
              catch (FileNotFoundException e) {
              System.out.println("ERROR!!! FILE NOT FOUND");
               }  // close catch
         } //close of readInput
    }//close of mainCode from function that compiles but doesnt read (this is a rather long program, so I am only giving the function itself) --
        //function to read the files and load arrays
        public int[] readInput() throws FileNotFoundException, IOException  {
              int i; // term variable to hold content of file
               int counter = 0; // counter for loop, also the index of the array for terms
               int test =0;
               try {
                FileReader termInput = new FileReader("terms.txt"); // creates file reader for rates file
                Scanner scan1 = new Scanner(termInput); // scanner searches the file for what is requested
                while (scan1.hasNext()) {
                    if (scan1.hasNextInt()) {
                        // if found, assign to an array value
                        i = scan1.nextInt();
                        termInfo[counter] = i;
                        System.out.println("Value " + test + " in term array is " + termInfo[counter]);
                        counter++;
                        test++;
                    } //close of if
                } //close of while
              termInput.close(); // close the term.dat file
             } // CLOSE TRY
              catch (FileNotFoundException e) {
              System.out.println("ERROR!!! FILE NOT FOUND");
               }  // close catch
              return termInfo;
    } //close of readInput

    Here's how I'd do that... with a "generic" (i.e. reusable) helper class...
    package krc.utilz;
    import java.util.Arrays;
    import java.util.Collection;
    import java.util.Iterator;
    import java.util.List;
    import java.util.ArrayList;
    import java.util.LinkedList;
    import java.util.Set;
    import java.util.HashSet;
    import java.util.Map;
    import java.util.HashMap;
    import java.util.Scanner;
    import java.io.File;
    import java.io.FileReader;
    import java.io.FileNotFoundException;
    import java.io.IOException;
    * A bunch of Helper methods for int and Integer arrays.
    public abstract class IntArrayz
       * Converts a List<Integer> to an array of int's.
       * If list is null then null is returned
       * If list is empty then an empty int array is returned.
       * @param list List<Integer> the List of Integers to convert
       * @return int[] - list as an array of ints.
      public static int[] toIntArray(Collection<Integer> list) {
        if (list==null) return null;
        if (list.isEmpty()) return new int[0];
        int[] a = new int[list.size()];
        int i=0;
        for (Iterator<Integer> it=list.iterator(); it.hasNext(); ) {
          a[i++] = it.next();
        return a;
       * Reads and returns an array of int's from the given File.
       * @param File file - The file to read. Format must be as required by
       *  http://java.sun.com/javase/6/docs/api/java/util/Scanner.html#nextInt()
       * @return int[] - Array of integers populate with the contents of the file.
      public static int[] read(File file) throws FileNotFoundException, IOException  {
        List<Integer> result = new LinkedList<Integer>();
        FileReader reader = null;
        try {
          reader = new FileReader(file);
          Scanner scanner = new Scanner(reader);
          while ( scanner.hasNext() ) {
            if (scanner.hasNextInt()) {
              result.add(scanner.nextInt());
            } else {
              scanner.next(); // skip the next token.
        } finally {
          if(reader!=null)reader.close();
        return IntArrayz.toIntArray(result);
    }(many methods removed to make it < 5000 characters)
    usage
    package krc.utilz.test;
    import krc.utilz.IntArrayz;
    import java.io.File;
    import java.util.Arrays;
    class IntArrayzTest
      public static void main(String args[] ) {
        try {
          System.out.println(Arrays.toString(IntArrayz.read(new File("integers.dat"))));
        } catch(Exception e) {
          e.printStackTrace();
    }Cheers. Keith.

Maybe you are looking for

  • Can We send data from SAP to non SAP using ALE !

    In this case what will be the receiver side configuaration ! What will be our receiver client !

  • IPod (3G) reboots when turned on (often)

    wondering if anyone has had a similiar issue and if they have any advice (either to fix or to send back to Apple to be fixed): if i let the iPod sit for a day or so without being used or charged, when i turn it on it will reboot. the iPod still works

  • Dynamic parameter selection from infoview not storing the sql password

    We are having the problem of dynamic parameter selection from infoview not storing the sql password as it does for the actual report. We are using Crystal Reports XI Release 2 version 11.5.3.438 (Not sure of SP level, asked in separate thread). To be

  • Satellite P100-238 freezes after an svchost.exe program error message:

    PC: Satellite P100-238 from December 2006. approx. a minute after startup i get an error message: Danish: svchost.exe - programfejl Instruktionen ved "0x745f278o" refererede hukommelse ved "0x00000000". Hukommelsen kunne ikke "read". Klik p OK for at

  • Does this Flash issue affect OS X?

    I read this New Flash Attack Has No Real 'Fix' Researchers show how Adobe Flash can be exploited in browsers when victim visits sites that accept user-generated content Nov 12, 2009 | 08:52 PM By Kelly Jackson Higgins DarkReading Researchers have dis