Saving and loading 1D array to/from file

Hi,
i have some problems with my NI application. for the first, i have case structure with two cases: true and false.
FALSE: in this case i have a for loop with 100 samples. i catch signal from my DAQ (now just Simulate Signal) and what i want is to save it in a 1D array and at the end of the loop the COMPLETE array into one text file. Problem in my vi: just the values from the last iteration are saved.
TRUE: now i have while loop. AT THE BEGINN of the loop i need to load my array from the file and not in the middle of the loop. Why? The data from the file are needed during the loop.
thanx in advance
Vedran Divkovic
RUB GERMANY
Attachments:
Regelsystem.vi ‏1494 KB

According to your code, what you are saving is an array of means (one from each iteration), and NOT the last iteration. If you want to keep the entire data, it would be a 2D array.
Why are you generating an entire waveform at each iteration? Shouldn't you just generate one point?
LabVIEW Champion . Do more with less code and in less time .

Similar Messages

  • Saving and Loading variables in a .txt file (Offline)

    I'm working a software we've done with Flash, but we'd want
    people to be able to save the variables they selected. We need them
    to be able to save the value of about 10 variables in a file on
    their desktop, and then be able to load that file again.
    Is it possible to do that without having to use php or stuff
    like that (that's why we want to make it an offline applications so
    we don't have to use php to be able to save files).
    I know Actionscript looks a lot like Javascript and with
    Javascript it's really easy to do, but all the saving functions are
    blocked in Flash for security reasons.
    If anyone knows how to do that, to simply save and load a
    .txt file, please let me know. If it would be possible also to
    change the .txt to whatever else it would be even better. The file
    can still be opened in Notepad but at least it looks a bit more
    professionnal to have our own extension. Again in Javascript or
    with a .bat file it's really easy to save variables to whatever
    type of file, even to non existing types, it simply creates a text
    file with an unknown ending.
    Thanks!

    I found a page that explains in a really easy way how to
    communicate with Javascript if the flash object is contained in an
    html page, but I couldn't find any page explaining how it works if
    it's not in an html page. On our side, before using the software
    we're creating we'll convert it to a .exe. How can we call a
    Javascript from that .exe since we can't incorporate the Javascript
    in the container since there isn't really a container... Is there a
    way to link to a Javascript (.js) that would be in the same folder
    as the .exe? Or would there be a way to incorporate the Javascript
    right into the .exe?
    Let me know if any of you have a solution for that.
    Thanks!
    http://livedocs.adobe.com/flash/9.0/main/wwhelp/wwhimpl/common/html/wwhelp.htm?context=Liv eDocs_Parts&file=00000342.html#wp126566

  • I just bought a new Macbook Pro and loaded all my info from My old Macbook...now i can't remember for the life of me my Admin Password 9which i created 3 years ago)...is there ANY WAY to bypass this on my new Macbook Pro and begin again...?

    i just bought a new Macbook Pro and loaded all my info from My old Macbook...now i can't remember for the life of me my Admin Password (which i created 3 years ago)...is there ANY WAY to bypass this on my new Macbook Pro and begin again...?

    I assume that you don't have the installation discs, so:
    1. Reboot
    2. Hold command + s key down after you hear the chime.
    3. When you get a text prompt enter in these terminal commands to create a brand new admin account (hitting return after each line):
    (Type these commands very carefully)
    mount -uw /
    rm /var/db/.AppleSetupDone
    shutdown -h now
    4. You will go through the setup process again, create a new admin account, login to it and then change your existing account password or whatever else you need to do. You can delete the account you made in this process, or not.

  • Saving and Loading specific properties of an Image

    Hey everyone. I'm currently in the process of developing a game which allows you to customize the color (hue) of your character via a slider. What I would like to happen is: Upon clicking either Accept or Play, it will save the current hue of the image, navigating back to that page will load what was previously saved (hue), as well as when starting the game, it will replace the standard graphic with the previously saved image.
    Below is the code I have right now that pertains to the image with a basic non-functioning properly saving and loading code:
    import flash.events.KeyboardEvent;
    // open a local shared object called "myStuff", if there is no such object - create a new one
    var savedstuff:SharedObject = SharedObject.getLocal("myStuff");
    Accept.addEventListener(MouseEvent.CLICK, SaveData);
    PlayBTN.addEventListener(MouseEvent.CLICK, LoadData);
    function SaveData(MouseEvent){
               savedstuff.data.username = Sliders.Dino.MovieClip // changes var username in sharedobject
               savedstuff.flush(); // saves data on hard drive
    function LoadData(event: MouseEvent)
               if(savedstuff.size>0){ // checks if there is something saved
               Sliders.Dino.MovieClip = savedstuff.data.username} // change field text to username variable
    // if something was saved before, show it on start
    if(savedstuff.size>0){
    Sliders.Dino.MovieClip = savedstuff.data.username}
    What I have above is only saving the actual image, which is inside a movie clip names Sliders.
    Below is the Class I am using that associates with the slider that changes the hue of "Dino".
    package
              import flash.display.Sprite;
              import fl.motion.AdjustColor;
              import flash.filters.ColorMatrixFilter;
              import fl.events.SliderEvent;
              public class Main extends Sprite
                        private var color:AdjustColor = new AdjustColor();
                        private var filter:ColorMatrixFilter;
                        public function Main():void
                                  /* Required to create initial Matrix */
                                  color.brightness = 0;
                                  color.contrast = 0;
                                  color.hue = 0;
                                  color.saturation = 0;
                                  /* Add Listeners function */
                                  addListeners();
                        private final function addListeners():void
                                  colorPanel.hueSL.addEventListener(SliderEvent.CHANGE, adjustHue);
                        private final function adjustHue(e:SliderEvent):void
                                  color.hue = e.target.value;
                                  update();
                        private final function update():void
                                  filter = new ColorMatrixFilter(color.CalculateFinalFlatArray());
                                  Dino.filters = [filter];
    Overall what I'm asking for is: How do I get it to save the current hue of an image by clicking a button, and then having that previously saved image be loaded upon reloading or clicking a button? To me, it doesn't seem like it should be too hard, but for some reason I can not grasp it.
    Thanks in advance for reading this and for any assistance you have to offer!

    This is the Class that you told me to use:
    package
              import flash.display.Sprite;
              import fl.motion.AdjustColor;
              import flash.filters.ColorMatrixFilter;
              import fl.events.SliderEvent;
              import flash.net.SharedObject;
              public class Main extends Sprite
                        private var color:AdjustColor = new AdjustColor();
                        private var filter:ColorMatrixFilter;
                        private var so:SharedObject;
                        public function Main():void
                                  color.brightness = 0;
                                  color.contrast = 0;
                                  color.saturation = 0;
                                  so = SharedObject.getLocal("myStuff");
                                  if (so.data.hue)
                                            color.hue = so.data.hue;
                                  else
                                            color.hue = 0;
                                  update();
                                  addListeners();
                        private final function addListeners():void
                                  colorPanel.hueSL.addEventListener(SliderEvent.CHANGE, adjustHue);
                        private final function adjustHue(e:SliderEvent):void
                                  color.hue = e.target.value;
                                  so.data.hue = color.hue;
                                  so.flush();
                                  update();
                        private final function update():void
                                  filter = new ColorMatrixFilter(color.CalculateFinalFlatArray());
                                  Dino.filters = [filter];
    And this is the FLA Code:
    import flash.events.KeyboardEvent;
    // open a local shared object called "myStuff", if there is no such object - create a new one
    var savedstuff:SharedObject = SharedObject.getLocal("myStuff");
    Accept.addEventListener(MouseEvent.CLICK, SaveData);
    PlayBTN.addEventListener(MouseEvent.CLICK, LoadData);
    function SaveData(MouseEvent)
              savedstuff.data.username = Sliders.Dino.MovieClip;// changes var username in sharedobject
              savedstuff.flush();
              // saves data on hard drive;
    function LoadData(event: MouseEvent)
              if (savedstuff.size > 0)
              {// checks if there is something saved
                        Sliders.Dino.MovieClip = savedstuff.data.username;
              }// change field text to username variable
    // if something was saved before, show it on start
    if (savedstuff.size > 0)
              Sliders.Dino.MovieClip = savedstuff.data.username;

  • How to speed up my saving and loading of a psd. file?

    Hi.
    My laptop's 1 TB hdd recently crashed and I replaced it with a 500 GB ssd and Photoshop loads now from 10-12 sec since i re installed Photoshop cc.
    Unfortunately, the time it takes to save and load psd files has increased dramatically (I'm comparing it to how it was with my normal hdd). It also, sometimes freezes a bit and then after about 10 sec it unfreezes.
    I have looked online for help, but have been unable to find anything that could really help me (or it just went over my head, as I am not very tech savvy).
    Any help would be greatly appreciated.
    If this has been discussed before, can someone please post the link for me.

    The rule of thumb I follow to figure out scratch space says to figure on 50 to 100 times the size of your largest file ever multiplied by the number of files you have open.  I have seen the scratch file exceed 800 GB once, an admittedly rare occurrence, but it often exceeds 200 GB when stitching large panoramas and the like.
    As an example—and stressing that I'm aware that others have even more scratch space than I do—I keep two dedicated, physically separate hard drives as my primary and secondary Photoshop scratch disks and a lot of GB free on my boot drive for the OS.  I also have 16 GB of RAM installed.
    Additionally, if you only have a single HD, i.e. your boot drive, you'd need it to be large enough to accommodate both the swap files of the OS as well as Photoshop's scratch.

  • Saving and loading images (png) on the iPhone / iPad locally

    Hi,
    you might find this helpful..
    Just tested how to save and load images, png in this case, locally on the i-Devices.
    In addition with a SharedObject it could be used as an image cache.
    Make sure you have the adobe.images.PNG encoder
    https://github.com/mikechambers/as3corelib/blob/master/src/com/adobe/images/PNGEncoder.as
    Not really tested, no error handling, just as a start.
    Let me know, what you think...
    Aaaaah and if somebody has any clue about this:
    http://forums.adobe.com/thread/793584?tstart=0
    would be great
    Cheers Peter
        import flash.display.Bitmap
         import flash.display.BitmapData
        import flash.display.Loader   
        import flash.display.LoaderInfo
        import flash.events.*
        import flash.filesystem.File
        import flash.filesystem.FileMode
        import flash.filesystem.FileStream
        import flash.utils.ByteArray;
        import com.adobe.images.PNGEncoder;
    private function savePic(){
        var bmp =  // Your Bitmap to save
        savePicToFile(bmp, "test.png")
    private function loadPic(){
         readPicFromFile("test.png")
    private function savePicToFile(bmp:Bitmap, fname:String){
           var ba:ByteArray = PNGEncoder.encode(bmp.bitmapData);
            var imagefile:File = File.applicationStorageDirectory;
            imagefile = imagefile.resolvePath(fname);
            var fileStream = new FileStream();
            fileStream.open(imagefile, FileMode.WRITE);
            fileStream.writeBytes(ba);
             trace("saved imagefile:"+imagefile.url)
    private function readPicFromFile(fname:String){
            var imagefile:File = File.applicationStorageDirectory;
            imagefile = imagefile.resolvePath(fname);
            trace("read imagefile:"+imagefile.url)
            var ba:ByteArray = new ByteArray();
            var fileStream = new FileStream();
            fileStream.open(imagefile, FileMode.READ);
            fileStream.readBytes(ba);
            var loader:Loader = new Loader();
            loader.contentLoaderInfo.addEventListener(Event.COMPLETE, onPicRead)
            loader.loadBytes(ba);   
    private function onPicRead(e:Event){
        trace("onPicRead")
         var bmp:Bitmap = Bitmap(e.target.content)
         // Do something with it

    Are the movies transferred to your iPhone via the iTunes sync/transfer process but don't play on your iPhone?
    Copied from this link.
    http://www.apple.com/iphone/specs.html
    Video formats supported: H.264 video, up to 1.5 Mbps, 640 by 480 pixels, 30 frames per second, Low-Complexity version of the H.264 Baseline Profile with AAC-LC audio up to 160 Kbps, 48kHz, stereo audio in .m4v, .mp4, and .mov file formats; H.264 video, up to 2.5 Mbps, 640 by 480 pixels, 30 frames per second, Baseline Profile up to Level 3.0 with AAC-LC audio up to 160 Kbps, 48kHz, stereo audio in .m4v, .mp4, and .mov file formats; MPEG-4 video, up to 2.5 Mbps, 640 by 480 pixels, 30 frames per second, Simple Profile with AAC-LC audio up to 160 Kbps, 48kHz, stereo audio in .m4v, .mp4, and .mov file formats.
    What are you using for the conversion? Does whatever you are using for the conversion include an iPod or iPhone compatible setting for the conversion?
    iTunes includes a create iPod or iPhone version for a video in your iTunes library. Select the video and at the menu bar, go to Advanced and select Create iPod or iPhone version. This will duplicate the video in your iTunes library. Select this version for transfer to your iPhone to see if this makes any difference.

  • Saving and reopening an iDVD project from a hard drive - HELP!

    Hello! I am a moderately experienced user of iLife and am starting to use it for a business(memorial videos, sports highlight videos, etc) My problem is this: After I finish a project and export it to iDVD I want to save it to my external hard drive and store it there(like a file cabinet for all my finished projects, so that I can come back to them later, if needed) and I am having difficulty when I do this and then go back to open it - iDVD can't find my files for the pictures and sometimes the audio and video. This said, this is my process: Create project in iMovie, export to Garage Band to create chapters, export to iDVD.(this is 08 BTW) At every step I save to the desktop. Then when I am finished burning my DVD, I create a folder(eg., Bob and Kate's Wedding) on my hard drive and put all the media from the desktop in that folder(eg, the iMovie file, the Garage Band file, the iDVD file and a folder of the pictures I used also.
    If anyone can shed some light on a better process, or maybe a reason why I cannot just go into my hard drive and double click the iDVD project and burn extra copies, that would be fantastic!
    I appreciate any insight. I love doing this work, but with 3 kids, I rarely get time to research the answers to my questions outside of this board!!!
    TIA - Lis

    Hi Mamalisa
    iDVD can't find my files for the pictures and sometimes the audio and video.
    And welcome to apple discussions. If you plan to do further modifications to your iDvd project then follow these steps. (btw, iDvd doesn't like it when you change the actual location of video / audio assets once encoded / burned to DVD-R unless it's saved or rather archived beforehand).
    On the other hand if you plan no further changes then you may wish to follow this instead of the above.
    By sdmacuser at 2009-09-03
    Hope this helps but if not just come on back.

  • Loading an external image (from file system) to fla library as MovieClip symbol.

    Hi everyone,
    I am new to actionscript and Flash.
    I have been working on code updation project wherein initially we had an image and text as movieclips in fla library. The image and the text are read by the actionscript program which then creates an animation.
    For Example:
    // Picture
    // _imageMC: Name of the Movie Clip in the libary which
    // contains the picture.
    var _imageMC:String = "polaroid";
    This is later on used by another actionscript class as follows to finally create the animation.
    var _mcPolaroid:MovieClip = this._mcBg.attachMovie(this._polaroid, "polaroid_mc", this._mcBg.getNextHighestDepth());
    Now the problem here is when one needs to update the image or text, one needs to go and open the fla file andmanually change the image attached to the movieClip (polaroid).
    I want to ease the updation process by giving the url of the image in an XML file. Read the image url from the xml and load this image in the library of the fla as movieclip. This, i think, will result in less code change and improve the updation of the final animation image.
    The problem i am facing is not been able to figure out how can i change the image (after fetching its URL) to a movieclip and then load it in the library?
    Thank you kindly in advance,
    Varun

    This is the AS3 forum and you are posting with regards to AS2 code.  Try posting in the AS2 forum...
    http://forums.adobe.com/community/flash/flash_actionscript
    As for the solution you seem to want.  You cannot dynamically add something to the library during runtime.  To add an image during runtime you would need to use the MovieClip.loadMovie() or MovieClipLoader.loadClip() methods.  You could have the movieclip pre-arranged in the library, but to add the image dynamically via xml information you need to load it into a movieclip, not the library.

  • Loading an external image (from file system) to fla library as MovieClip symbol using ActionScript.

    Hi everyone,
    I am new to actionscript and Flash.
    I have been working on code updation project wherein initially we had an image and text as movieclips in fla library. The image and the text are read by the actionscript program which then creates an animation.
    For Example:
    // Picture
    // _imageMC: Name of the Movie Clip in the libary which
    // contains the picture.
    var _imageMC:String = "polaroid";
    This is later on used by another actionscript class as follows to finally create the animation.
    var _mcPolaroid:MovieClip = this._mcBg.attachMovie(this._polaroid, "polaroid_mc", this._mcBg.getNextHighestDepth());
    Now the problem here is when one needs to update the image or text, one needs to go and open the fla file andmanually change the image attached to the movieClip (polaroid).
    I want to ease the updation process by giving the url of the image in an XML file. Read the image url from the xml and load this image in the library of the fla as movieclip. This, i think, will result in less code change and improve the updation of the final animation image.
    The problem i am facing is not been able to figure out how can i change the image (after fetching its URL) to a movieclip and then load it in the library?
    Thank you kindly in advance,
    Varun

    The following was my attempt: (i created a new MovieClip)
    this.createEmptyMovieClip("polaroidTest", this.getNextHighestDepth());
    loadMovie("imagefile.jpg", polaroidTest)
    var _imageMC:String = "polaroidTest";
    This mentioned variable _imageMC is read by a MovieClip class(self created as follows)
    /////////////////////////////// CODE STARTS //////////////////////////////////////
    class as.MovieClip.MovieClipPolaroid {
    private var _mcTarget:MovieClip;
    private var _polaroid:String;
    private var _mcBg:MovieClip;
    private var _rmcBg:MovieClip;
    private var _w:Number;
    private var _h:Number;
    private var _xPosition:Number;
    private var _yPosition:Number;
    private var _border:Number;
    * Constructor
        function MovieClipPolaroid(mcTarget:MovieClip, polaroid:String) {
    this._mcTarget = mcTarget;
    this._polaroid = polaroid;
    init();
    * initialise the polaroid movieclip and reflecting it
        private function init():Void {
    this._border = 10;
    this.initSize();
    this.setPosition(48,35);
    this.createBackground();
    var _mcPolaroid:MovieClip = this._mcBg.attachMovie(this._polaroid, "polaroid_mc", this._mcBg.getNextHighestDepth());
    _mcPolaroid._x = _border;
    _mcPolaroid._y = _border;
    var _rmcPolaroid:MovieClip=this._rmcBg.attachMovie(this._polaroid,"rpolaroid_mc", this._rmcBg.getNextHighestDepth());
    _rmcPolaroid._yscale *=-1;
    _rmcPolaroid._y = _rmcPolaroid._y + _h + _border ;
    _rmcPolaroid._x =_border;
    * create the background for the polaroid
    private function createBackground():Void {
    this._mcBg = _mcTarget.createEmptyMovieClip("target_mc",_mcTarget.getNextHighestDepth());
    this._rmcBg = _mcTarget.createEmptyMovieClip("rTarget_mc", _mcTarget.getNextHighestDepth());
    fill(_mcBg,_w+2*_border,_h+2*_border,100);
    fill(_rmcBg,_w+2*_border,_h+2*_border,10);
    placeBg(_mcBg,_w+2*_border,_yPosition);
    placeBg(_rmcBg,_w+2*_border,_h+2*_border+_yPosition);
    * position the background
    private function placeBg(mc:MovieClip,w:Number,h:Number) : Void {  
        mc._x = Stage.width - w - _xPosition;
    mc._y = h;
    * paint the backgound
    private function fill(mc:MovieClip,w:Number,h:Number, a:Number): Void {
    mc.beginFill(0xFFFFFF);
    mc.moveTo(0, 0);
    mc.lineTo(w, 0);
    mc.lineTo(w, h);
    mc.lineTo(0, h);
    mc.lineTo(0, 0);
    mc.endFill();
    mc._alpha=a;
    * init the size of the polaroid
    private function initSize():Void {
    var mc:MovieClip =_mcTarget.createEmptyMovieClip("mc",_mcTarget.getNextHighestDepth());
    mc.attachMovie(this._polaroid,"polaroid_mc", _mcTarget.getNextHighestDepth());
    this._h = mc._height;
    this._w = mc._width;
    removeMovieClip(mc);
    mc = null;
    * sets the position of the polaroid
    public function setPosition(xPos:Number,yPos:Number):Void {
    this._xPosition = xPos;
    this._yPosition = yPos;
    * moving in
    public function moveIn():Tween {
    var mc:MovieClip = this._mcTarget;
    mc._visible=true;
    var tween:Tween = new Tween(mc, "_x", Strong.easeOut, 0, 0, 1, true);
    var tween:Tween = new Tween(mc, "_y", Strong.easeOut, 200, 0, 1, true);
    var tween:Tween = new Tween(mc, "_xscale", Strong.easeOut, 30, 100, 1, true);
    var tween:Tween = new Tween(mc, "_yscale", Strong.easeOut, 30, 100, 1, true);
    var tween:Tween = new Tween(mc, "_alpha", Strong.easeOut, 0, 100, 1, true);
    return tween;
    * moving in
    public function moveOut():Tween {
    var mc:MovieClip = this._mcTarget;
    var tween:Tween = new Tween(mc, "_alpha", Strong.easeIn, 99, 0, 1, true);
    var tween:Tween = new Tween(mc, "_x", Strong.easeIn,0, 1000, 1, true);
    var tween:Tween = new Tween(mc, "_y", Strong.easeIn, 0, -50, 1, true);
    var tween:Tween = new Tween(mc, "_xscale", Strong.easeIn, 100, 50, 1, true);
    var tween:Tween = new Tween(mc, "_yscale", Strong.easeIn, 100, 50, 1, true);
    return tween;
    /////////////////////////////// CODE ENDS ///////////////////////////////////////
    As in the current case, the name of the movieclip which has the image (originally polaroid) is being read through the variable _imageMC which we hadd given the value "polaroidTest".
    The animation shows no image even when i have inserted the correct url (i m sure this step isn't wrong).
    Any clues?

  • Saving and loading

    is my coding correct, because i cant seem to save or load. well i dont know if it saves, but when its loading it returns null.
    public void saveAttributes(String filename){
    try{
    FileOutputStream outputFile = new FileOutputStream(filename);
    ObjectOutputStream outData = new ObjectOutputStream(outputFile);
    outData.writeObject(this);
    outData.flush();
    outputFile.close();}
    catch (Exception e){
    System.out.println("Error Saving: "+e.getMessage());}
    public static void loadAttributes(String filename){
    try {
    FileInputStream inputFile = new FileInputStream(filename);
    ObjectInputStream inData = new ObjectInputStream(inputFile);
    Attribute attribute = (Attribute)inData.readObject(); //not sure about this line. Attribute is the class where these and other methods are located. the load and save methods are called from another class.
    catch (Exception e) {
    System.out.println("Error Loading: "+e.getMessage()); }
    }

    this caught my eye are you trying to save a object then load it ?

  • Need help in JAXP - saving and loading of XML

    i am new to JAXP so dunno how to write the codes to save and load a hub project to and from an XML stream ...so can any one help by posting some codes to guide me alonr... will be grateful to u...this is wat i have done ,can anyone help to complete it ..thank...urgently
    import java.util.*;
    public class Testvector
         private Vector m_vProcess;
         String strProjectName;
         public static void main(String[] args)
              TestVector pThis = new TestVector();
              pThis->WriteToXML(m_vProcess);
         public TestVector
              strProjectName ="Project1";
              m_vProcess = new Vector();               
              m_vProcess.add("Process1");
              m_vProcess.add("Process2");
         public void WriteToXML(Vector vProcess)
              //JAXP
              //write project element with attribute name
              //iterate through all the elements in vector m_vProcess
              //write process elements with name.
    <?xml version='1.0' encoding='utf-8'?>
    <!-- project -->
    <project>
    <!-- process -->
    <process type="all">
    <name>1st</name>
    </process>
    </project>
    can any one help?

    Choose Xerces2.4 to serialize the DOM object is an option.
    javac XercesTest.java -classpath xmlParserAPIs.jar;xercesImpl.jar;.
    java -classpath xmlParserAPIs.jar;xercesImpl.jar;. XercesTest test.xml
    below is the source file: XercesTest.java
    //JAXP
    import javax.xml.parsers.*;
    import org.w3c.dom.*;
    //APACHE SERIALIZE FUNCTION
    import org.apache.xml.serialize.*;
    class XercesTest
    public static void main(String[] args) throws Exception
    DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
    DocumentBuilder builder = factory.newDocumentBuilder();
    Document doc = builder.parse( new File( args[0] ) );
    File f = new File( "copy_of_"+ args[0] );
    OutputFormat format = new OutputFormat("xml","UTF-8",true ) ;
    FileOutputStream fout = new FileOutputStream( f );
    XMLSerializer ser = new XMLSerializer(fout, format );
    ser.serialize( doc );
    maybe it's helpful
    land

  • How to Load 3D Array faster from a DataInputstream

    Hi,
    I have a task like reading a file using fileinputstream and loading the values into a 3Dimensional array. Before loading the array I need to convert each byte that i read into LittleEndian. I am attaching the code here
         public boolean loadIter(int iter) {
              try {
                   picArray = new float[NUMOFIMAGES][HEIGHT][WIDTH];
                   word = new byte[8];
                   file = new File(fileName);
    /*            long start = System.currentTimeMillis( );
    */               fileInput = new FileInputStream(file);
                   dataInputStream = new DataInputStream(fileInput);
                   dataInputStream.skipBytes(iter*NUMOFIMAGES*HEIGHT*WIDTH*4);
                        maxAll = 0;
                        for (int l = 0; l < NUMOFIMAGES; l++) {
                             for (int k = 0; k < HEIGHT; k++) {
                                  for (int j = 0; j < WIDTH; j++) {
                                       dataInputStream.readFully(word, 0, 4);
                                       float in = Float.intBitsToFloat((word[3]) << 24 | (word[2] & 0xff) << 16
                                             | (word[1] & 0xff) << 8 | (word[0] & 0xff));
                                       picArray[l][k][j] = in;
                                       if(in > maxAll)
                                            maxAll = in;                                   
                   fileInput.close();
    /*            System.out.println(" Elapsed time is "+(System.currentTimeMillis()-start)/ 1000F
                            + "Seconds.");
    */               return true;
              } catch (IOException ioe) {
                   System.err.println("initFile ioe " + ioe.getMessage());
                   return false;
         }The above process is taking abt 15sec for 126(NUMOFIMAGES) 212(HEIGHT) & 212(WIDTH) which are constants for me. How can I make this whole thing faster. Are there any other techniques to improve performance?
    Thanks

    Create your DataInputStream like this:
    dataInputStream = new DataInputStream(new BufferedInputStream(fileInput));
    Does that help?

  • SFE2000 saving and loading configuration

    I have a number of SFE2000 10/100 24 port POE switches.
    They are configured and running OK. I want to be able to save the configuration and be able to load that saved configuration into another new swich in the case of a failure.
    I have logged in and gone to Admin-File Management-Save Configuration. I then select the 'Backup' radio button and TFTP the configuration to my TFTP server. All works OK and I have a readable text file with the switch configuration on my TFTP server.
    Now, here comes the problem.
    I want to be able to restore that saved configuration on to a new switch.
    I have set the new switch back to factory defaults. I go to  Admin-File Management-Save Configuration. I then select the 'Upgrade' radio button and try and uploade the file into the switch.
    If load to 'Running Configuration' the switch shows a status of 'Copy Finished' but says 'Copy completed with errors'
    If load to 'Startup Configuration' the switch shows a status of 'Copy Failed' and says 'Copy completed with errors'
    Am I missing something here???
    I am guessing I should be able to load my saved Configuration back into a switch, shouldn't I??
    And yes the switches are running the same firmware 3.0.0.17
    Any help gratefully received. I am scratching my head here...
    Alan

    Hi Alan,
    Thank you so much for your feedback.
    When copying over TFTP, is there another error message following the described : %COPY-W-TRAP: The copy operation has failed ? I would suppose that at least a second message would be logged with the reason for the failure.
    As far as the transfer of configuration files is concerned, it is always safer to make sure the FW versions of both devices are the same. As far as upgrading is concerned. Switches that use the older fw version 1.0.0.x need to be upgraded to 3.0.0.17 first using the easy upgrade utility. Switches with HW version 2 and FW version 2.x should be upgraded using the regular TFTP or HTTP method (not the easy upgrade utility). All of this can be read in the release notes for fw 3.0.0.17 and 3.0.0.18
    As far as Xmodem is concerned, you make the connection to the switch using Hyperterminal, TeraTerm Pro or any other terminal emulator supporting Xmodem, when booting the switch, you can escape the boot sequence (given the switch does not boot up) by pressing Esc or Enter when this appears on the screen. You'll then have an option to "Download Software", select this option. Then on your terminal emulator, select to transfer file (send) using Xmodem. This should do the trick.
    Hope this helps,
    Best regards,
    Nico Muselle
    Sr. Network Engineer - CCNA

  • Liquify Cursor disappears when Saving and Loading Mesh (CC 2014.2.2)

    Hello.
    I'm using Photoshop CC 2014.2.2 for Mac on a perfectly built hackintosh (Yosemite, i7-4770K, GTX770, Intuos5 L, 32Gb RAM, 2 monitors).
    The arrow cursor disappears randomly when dragged over the Save Mesh or Load Mesh dialogues. It's not that the arrow cursor disappears completely. Actually, instead of switching from liquify cursor to arrow cursor as it should, it stays a circle and I can see it behind the save/load mesh window. In order to make the arrow appear in front of the save/load mesh, I have to move it out of it, and carefully move it back in. If I drag the save/load mesh window to an area of the screen clear of the liquify filter window or to my second screen, the problem goes away.
    Also, when liquifying, the cursor is a little laggy, like at a low frame rate and behind my pen. I can liquify with no problem, but I can't remember if this is the way the liquify cursor behaves now that the it is GPU accelerated.
    All these problems go away if I disable "use graphics processor", but that's a no go for me. I have tried both OS X Default Graphic Driver and NVIDIA Web Driver, but it makes no difference.
    Any ideas?
    THANKS!

    I've noticed it happens particularly when the arrow touches any of the text input fields, among other ways I haven't identified yet. The save mesh and load mesh are the only dialogs across Photoshop on which this problem happens.
    Notice that the blue cursor drawn by me is where the cursor should be, and note that the liquify cursor can be seen behind the open mesh dialogue. In this case I have to draw the cursor outside of the open window, and drag it back in making sure I don't touch the search field.

  • Saving and loading plugin's settings by using SDK APIs.

    Hi All.
    I am trying to save and load plugin's settings, ex. dialog setting values and strings.
    OS platform is windows XP.
    First I programmed the way of using *.ini file.
    But that not appropriate for Macintosh.
    So, I like to know common way by using SDK's APIs.
    Development env. is VS2008 and Ai CS5 SDK.
    Thanks.

    Use AIPreferenceSuite (AIPreference.h)

Maybe you are looking for

  • How do I get news stories I click from my Yahoo home page to open in a new tab?

    At one point, whenever I clicked on a news story on my Yahoo home page the story would open in a new tab, leaving the home page unchanged. When I updated Firefox, this feature was eliminated. Is there a way to turn it back on?

  • I can hear them but they can't hear me! -- Detailed

    Hey. My iPhone has been acting up lately. About 2 months ago Apple replaced my almost-1-year-old iPhone 4 because the circle button wasn't responding. So, now I have a new iPhone 4. I have a Speck case on it and with my old phone had no problems with

  • Satellite L20-182: fan doesn't work properly - one minute intervals

    When I turn on the computer about twenty minutes is quiet. Than fan starts like a hurricane, slows down and stops. It lasts few seconds. The fan works in this way regularly with one minute intervals. Is there any possibility to switch the fan on cont

  • MobileMe Sync Issue

    Anyone else having problems publishing events/albums to MobileMe I keep trying & its starting to really annoy me I have tried publishing an event with 230 photo's in there most of which are RAW format I have just become a dad & I want to publish all

  • How to make tomcat still running after reboot

    hi all, i want ask about how to make tomcat still running after our computer reboot. so our server still can serve the the request without we start manualy the tomcat. please replies thank's before