Correct way to read/write ASCII data

Hi,
I am trying to read in ASCII data, manipulate it and write out as ASCII, but am getting values greater than 256 appearing. SHould I be using an encoding when I read/write and what is it.
Any advice appreciated.
MArk

Smart quotes aren't part of the ASCII character set. If your character set includes them, it is possibly one of the so-called "extended ASCII" character sets that were created by various entities a few years ago. Java uses the Unicode character set, which includes ASCII as its first 128 characters. And the so-called smart quotes are mapped to the Unicode characters 201C ("LEFT DOUBLE QUOTATION MARK") and 201D. For more information about Unicode see http://www.unicode.org and for much more information on character sets in computing see for example http://www.czyborra.com.

Similar Messages

  • Is there a way to read/write original .xmp settings of a CR2 loaded as smart object onto a .psd layer?

    Hello all. This has been asked in varying degrees before, but many of the discussions I found relative to my question are from the period 2010 to 2013. Thought I would throw this out there again medio 2014 to see if anything new has developed that I'm somehow missing.
    Here's the situation:
    1. In the filesystem, a CR2 file and a sidecar .xmp file with ACR settings applied via Bridge (CS6).
    2. CR2 file is opened in Photoshop (CS6) as a smart object (.xmp sidecar settings are applied in the process).
    3. CR2 file and .xmp now exist on a .psd layer as a smart object...in some unknown form.
    4. File is saved as .psd
    My question is this:
    Is there ANY way at all via Bridge and/or Photoshop scripting to read/write/access/touch/poke/prod the original ACR "development" settings, originally stored in the .xmp sidecar file, that apparently now exist in some form on the smart object layer in the .psd? Via scripting in Bridge, one can alter the metadata on this saved .psd file, no problem, but this is not the same .xmp data that is being referenced by the image loaded as a smart object onto the .psd layer in that file. Where is this second set of data? Can it be accessed?
    Any info, enlightenment would be much appreciated. Thanks.

    No, not too late.
    InDesign is for layout for press in this case.
    Photoshop is for design, which is using the .jpg's.
    I'm half way there, but stuck at:
    Getting a file location reference when the .jpg is first brought into PS as a layer.
    Getting a script to write the location of the file into the medata for the PSD in some field
    Reading back the metadata file location for the .jpg and bringing it back into the PSD again.
    Any help would really be appreciated.
    I can make the completed script(s) available when its complete, as this has possibilities for other uses, batch process, and more.

  • Best way how to write FPGA data in rt cRIO system in tdms file

    Hej,
    I am struggling to write measured data from an analog input (NI 9215) sampled at up to 20 kHz to a tdms file in the rt system (crio-9022). I just need to save several periods of 4 arbitrary analog signals at frequencies between 5 Hz and 1KHz. So storing up to 50k values should already be enough.
    I use a high priority and a low priority loop. First I tried to adapt the example from the "Getting Started with CompactRIO - Logging Data to Disk" (http://zone.ni.com/devzone/cda/tut/p/id/11198). But when I used this in my high priority loop (running at 1ms), the loop runs out of time and the rt system becomes unresponsible. If I change the number of elements to write (the number of elements to wait for in the fifo read block) it becomes better, but still data is lost because the loop finishes late.
    So I was thinking to create a RT fifo and to store all the values from the measurement first in this memory inside the high priority loop and then write the values to the tdms file in the low priority loop. This time I used the read/write fpga block instead of the FPGA fifo block. It was already working better but writing the files to the tdms file took a lot of time since each value was read and written to the tdms file individually. Unfortunately I could not find a possibility how to write the whole rt fifo to the tdms file at once. Is there a block available or is it possible to create a big array first and then write the data to the tdms file at once? My code I tried is in this second picture.
    I hope someone can give me some tips which method should be better for my project and a hint what I did wrong or what I can optimize. I stucked for days now on how to save my measurements on the cRIO system.
    Thank you very much in advance. Have a nice weekend.
    Best regards
    Andy
    Solved!
    Go to Solution.

    HiXiebo and Christian,
    thank you very much for your answers. Actually, my high priority loop is much slower. I run it with a maximum loop time of 50us = 20kHz or slower, depending on my Signal I want to measure. So my data producing rate is maximum 4*8*20k=640 KB/s. My low priority loop runs at 2ms to 5 ms (much slower then the high priority loop), since I am doing just some simple math calculation there and control the front panel in this loop.
    I understand that it is much more efficient to write blocks of data (e.g. 1024*32KB instead of just 32KB) to a file with TDMS. But is it also the same for a queue or RT FIFO, i.e. does the block size of the data chunks also matter for the queue and RT FIFO?
    @Xiebo: I understand that caching the read data from the FPGA in the high priority loop first will improve my code. But I do not know how I can cache the data I read? I was thinking to do it with the FPGA FIFO, but the FPGA read/write blocks seem to be faster for me and I do not know why? Can you tell me a block/vi to cache the data I read from the FPGA or maybe even an example?
    @Christian: This NI_MinimumBufferSize property looks exactly what I was looking for. But my question is now if I should put the tdms write VI's in my high priority loop and read directly from the FPGA FIFO buffer to the file as it is done in the Disk logging example at http://zone.ni.com/devzone/cda/tut/p/id/11198? Or is it better to read the data from the FPGA via the FPGA read/write function, write the data to a RT FIFO in the high priority loop and then write the data with the  NI_MinimumBufferSize property option to the tdms file from the RT FIFO in the low priority loop?
    In summary, I am still unsure if the FPGA FIFO or the FPGA read/write function with a queue or RT FIFO is better for me and how I can create a cache to build chunks of data blocks to write.
    Thank you very much in advance for your help.
    Best regards
    Andy

  • What's the best way to read/write data from a file (preferabl​y a *.txt file)?

    As in the title.  l have revived a couple of old VIs to read and write three numbers and a 1D array of clusters to/from a *.txt file.  The functionality is not very user friendly, and it would also be useful if one could open the text files (manually - not through LabVIEW) and still be able to see/understand what was there.
    I was wondering if anyone would be able to come up with a more efficient and/or user friendly method (compatible with lv6.1) 
    James
    Never say "Oops." Always say "Ah, interesting!"
    Attachments:
    Read Spec.vi ‏110 KB
    Write Spec.vi ‏58 KB

    My primary goal is to have something that works and is easy and comprehensive to operate.  Generating a human-readable file is just a bonus but would be nice if it could be achieved.
    I enclose pictures of the initial file dialog (for both loading and saving the data - referred to as Spec(s) from hence forth), and of the front panel screen seen when  a) loading a spec and  b) saving a spec.  In the file dialog, you have to already know the exact string to input else you'll just be told the file doesn't exist (applies for both loading and saving).  When saving a spec, you cannot see any files previously saved, nor even any previous specs saved within the file.  This means that one can unwittingly overwrite specs without realising it.
    I'm not sure if I've explained this very well, but the current functionality means that far too much can go wrong.  Additionally, if you forget the file name, you'll have no way of knowing what it should be (the data files are stored on a 'locked' part of our network accessible only by Admin or through the LabVIEW executable
    Never say "Oops." Always say "Ah, interesting!"
    Attachments:
    File Dialog.JPG ‏23 KB
    Select The Required Test Spec.JPG ‏10 KB
    Name of specification.JPG ‏6 KB

  • Read/write xml data from/to adobe livecycle forms (pdf)

    Hello,
    I need some help reading xml data from pdfs created by Adobe LiveCycle and also writing xml data back to the form.
    The forms have been created using PROD LC 8.2 and in the future they will be created using PROD LC 9.5.
    I am using Visual Basic .NET to access the data programatically.
    Can anyone help me with some hints? A library, SDK? Any information would be very helpful.
    I am quite new with this Electronic Forms issue and I do not even know where to start.
    Thank you,
    Ionel

    Hi lonel,
    Do you want an online solution?
    I mean, it follows this workflow:
    1. The user will open the PDF by clicking a link, and a server-side program will generate the PDF and prepopulate it with data from some data sources, and render the PDF to the client (Browser),
    2. The user will fill the PDF.
    3. The user will click a Submit button and save the PDF and Data on the server.
    4. If the user wants to edit the Submitted Form, he will click a link to open the save PDF and possibly prepopulate some fields with data from other data sources, and complete the cycle of filling and saved the PDF and Data on the server.
    5. While the user is filling the PDF (inside a Browser), there might be a need to perform some lookup on the server, and update the form parts accordingly as a result of the lookup process.
    For 1-4 above, I have developed a complete base library using ASP.NET which helps you to perform the above.
    You can goto my Google Workspace and you will find a bunch of documents, sample PDFs, collections and VB Classes. To best view them, login using some Google Account.
    For point 4 above, one way to perform this effect, is to regenerate the required XML Data (which has the saved data before and the new lookup data), remerge the entire XML result with and empty PDF Form, and render the XFA (PDF Form) back to the client. But, if the PDF has one or more signatures, it will not work. So, in this case, you can update the Form Fields of a Saved PDF Form with new Data from the server, but the net effect is that you will have to loose all the signatures that were added on the PDF before.
    For 5 (above) there are 3 methods:
    1. Using a Web Service as a Data Connection. This is very easy if you have a traditional Web Service. I have used this method several times and will use it again if the need be. But, there is a problem. If the result of the Web Service is an Array of some Data, and you want to remerge the XFA to get the required effect after executing the web service ... and ... if there are some Drop-Down-List (DDL) fields, the bindings of the DDL Items of those fields will be lost. But, you can rebuild them (on enter event of the DDL Field)  if you have saved them in the embedded XML Data.
    2. You can update few (not many) fields while the PDF is opened (under the Browser via IFRAME) by passing the new field values using the URL Query String method. I have not done this, but I like this method, and I think it is cool. You need to write a server side code to ensure the the new filed values are passed back to the client using the correct URL with the Query String, and you need to write some javascript code inside the PDF to parse the URL and get the new field values and update them accordingly. See this as an example:
    http://www.halnesbitt.com/pages/pdfqs.php
    3. This method is very advanced and uses message communication ques between the Browser and the PDF (which is opened inside IFRAME element) using HostContainer object. This method will enable 2-way communication between the Browser and the PDF on the client side using javascript. I'd love to use this method one day. See example here:
    http://www.windjack.com/WindJack/Browser2PDF/brwsr2acroJS.htm
    I hope this will be of help to you.
    Tarek.

  • Correct way to read a COLOR_ID_YCbCrA JPEG

    I have a Jpeg which Java2D says is encoded with COLOR_ID_YCbCrA. I also have an ICC colorspace to go with it. I have been unable to load the image with the colours set correctly.
    I have tried :-
    //open and get raster
    in =new ByteArrayInputStream(data);
    decoder = JPEGCodec.createJPEGDecoder(in);
    image = decoder.decodeAsBufferedImage();
    in.close();
    //convert from ICC colorspace which goes with image to rgb
    ColorConvertOp op = new ColorConvertOp( cs, rgbCS,PdfColor.hints );
    Raster currentRaster=op(image.getData(),null);
    //put together new image     
    image =new BufferedImage(width,height,BufferedImage.TYPE_INT_RGB);          
    image.setData(currentRaster);
    Anyone have any ideas?
    Regards,
    MArk

    Are you using 1.4? Check out package javax.imageio:
    class ImageTypeSpecifier:
        //Its mainly a ColorModel + a SampleModel
    class ImageReader:
        ImageTypeSpecifier getRawImageType(int imageIndex)
        Iterator getImageTypes(int imageIndex) //iterates over ITSs
    class ImageReadParam:
        void setDestinationType(ImageTypeSpecifier destinationType)

  • Using Bridgeview with the IAK/IAS Server, I was able to read and write several registers using a string tag. In DSC using the Lookout Protocal Driver, I do not see a way to read/write string tags.

    In the tag configuration I can select for a string tag, but I do not see a way to set up the Lookout Protocal Driver for a string tag.

    That's right - The old IAK/IAS Servers from National Instruments were a tighten developement with BridgeVIEW together - so that they implement the string data type. Since NI recommends to use the LPD drivers instead of the IAK Servers there is no way to configure string tags in the Lookout protocol drivers. The LPDs or Lookout does not really handle arrays/strings at all - that's a limitation for the Lookout protocol drivers.
    Roland

  • Why I am unable to read/write thermocouple data using FIFO

    I like get data using 9213 module. I used example VI for this. And to get the data according to my desired samling rate, I used FIFO.
    The problem is, if I use FIFO, I do not get any data when run the real time VI.
    But, if I like to get data using cluster, then it is OK.
    Also, can you tell me why the error comes when I use FIFO and run the program?
    My sampling desired rate is 1200 sample/sec. I like to acquire data for 30 seconds after the trigger.
    Attachments:
    Error_50400.jpg ‏34 KB
    FPGA.jpg ‏201 KB
    realtime_temp.jpg ‏249 KB

    Good Afternoon,
    I would suggest lowering the number of elements into the invoke node in your real time VI.  You only need the number fo samples times the sampling rate for the number of elements input.  Hope this helps!
    -Cody C

  • Urgent!!! Need help in file read/write data to a serial port

    Hi,
    I really need someone's help in order for me to complete my project. I have attached a vi which I have taken from an example and integrate to my project. In the vi, I have managed to get the encoder counts using Ni 9411. I need to read/write that data from ni9411 to ni9870 without using any serial port as they are connected to a NI 9104 chasis. May I know whether I am correct in writing the data to my ni9870 port using the vi I have attached? Does anyone know how i can convert the number of counts to a 8-bit data/byte so that I can send the data through the RS232 port? I really need someone's help as I need to finished in 2 weeks time.
    I have also attached an vi on controlling the epos2 controller using instrument driver. Does anyone know how can i integrate this vi to the fpga vi (the one which I need to read/write data to 9870) as I need to send those data to control my epos2 controller.
    Please help me!!!
    Attachments:
    Encoder Position & Velocity (FPGA).vi ‏23 KB
    SINGLEMOTORMODIFIED.vi ‏17 KB

    Afai,
    As I allready suggested you here, call your local NI Office and ask for assistance!
    You really need assistence in a higher level that we can provide via the forums. Otherwise I don't see a chance for you to finish your project in time.
    1. Convert I32 to U8 to write it to the 9870 could be done like this:
    2. The vi to control the epos2.
    There is NO way ( absolutely NO way) to port this vi to FPGA. It's based on VISA calls, uses an event-structure, both are not available at the FPGA.
    The only thing you could do is to analyze the VI, the instruction set and design an FPGA vi which handles the specific instructions you would need.
    I have no experience with epos2 and I'm not 100% sure if this would work as you would like to use it. And doing this needs deep knowledge of LabVIEW, VISA, Instrument Drivers, the epos hardware, FPGA programming, and so on... 
    Christian

  • How can I read/write data files (text file) from PL/SQL Script

    I had an oracle forms pl/sql program to read/write a data file (text file). When this code is run on a command line as a PL/SQL script using the SQL*Plus I am getting an error:
    -- sample.sql
    DECLARE
      vLocation                 VARCHAR2(50)  := 'r:\';
      vFilename                 VARCHAR2(100) := 'sample.dat';
      vTio                   TEXT_IO.FILE_TYPE;
      vLinebuf               VARCHAR2(2000);
      vRownum               NUMBER        := 0;
      -- use array to store data FROM each line of the text file     
      TYPE           array_type IS VARRAY(15) OF VARCHAR2(100);
      vColumn      array_type := array_type('');
      PROCEDURE prc_open_file(p_filename IN VARCHAR, p_access IN VARCHAR2) is
      BEGIN
        vTio := TEXT_IO.FOPEN(vLocation||p_filename,p_access);
      EXCEPTION
        WHEN OTHERS then
          --  raise_application_error(-20000,'Unable to open '||p_filename);
          message(sqlerrm);pause;
      END;
      PROCEDURE prc_close_file is
      BEGIN
        IF TEXT_IO.IS_OPEN(vTio) then
           TEXT_IO.FCLOSE(vTio);
        END IF;
      END;
    BEGIN
      --extend AND initialize the array to 4 columns
      vColumn.EXTEND(4,1);
      prc_open_file(vFilename,'r');
      LOOP
          LTEXT_IO.GET_LINE(vTio,vLinebuf);
          vColumn(1)  := SUBSTR(vLineBuf, 1, 3);
          vColumn(2)  := SUBSTR(vLineBuf, 5, 8);
          vColumn(3)  := SUBSTR(vLineBuf,10,14);     
          Insert Into MySampleTable
          Values
            (vColumn(1), vColumn(2), vColumn(3));
          EXIT WHEN vLinebuf IS NULL;
       END LOOP;
       prc_close_file;
    END;
    SQL> @c:\myworkspace\sql\scripts\sample.sql;
    PLS-00201: identifier 'TEXT_IO.FILE_TYPE' must be declaredIt works on the oracle forms but not on the SQL*Plus. Is there an alternative method using a PL/SQL script? A simple sample would help. Thanks.

    Did you ever noticed the search box at the right side of the forum?
    A quick search (limited to this years entries) brought up this thread for example
    Re: UTL_FILE Examples

  • What's the best way to read JSON data?

    Hi all;
    What is the best way to read in JSON data? And is the best way to use it once read in to turn it into XML and apply XPath?
    thanks - dave

    jtahlborn wrote:
    without having a better understanding of what your definition of "use it" is, this question is essentially unanswerable. Jackson is a fairly popular library for translating json to/from java objects. the json website provides a very basic library for parsing to/from xml. which one is the "best" depends on what you want to do with it.Good point. We have a reporting product ([www.windward.net|http://www.windward.net]) and we've had a number of people ask us for JSON support. But how complex the data is and what they want to pull is all over the place. The one thing that's commin is they generally want to pull down the JSON data, and then put specific items from that in the report.
    XML/XPath struck me as a good way to do this for a couple of reasons. First it seems to map well to the JSON data layout. Second it provides a known query language. Third, we have a really good XPath wizard and we could then use it for JSON also.
    ??? - thanks - dave

  • Avi read write example : playback missing chunk of data at regular intervals

    Hi,
    I am writing a waveform data into avi write in order to read back (with has data input on) as in example avi read write with data shipping example but the graph played back is missing some amount of data at regular intervals and hence the waveform read back is choppy. 
    I am writing the same data into tdms also. when i read back it with tdms file viewer, it shows that it has entire data.
    note: i am writing the waveform data and avi in two seperate loops and using the porperty node value of the waveform data in the video loop in order to insert data into avi write (has data input on) and have the (wait ms multiple) input =10 in both loops
    i would like to post the video but it is 50 MB, is it possible to upload that much.
    can any one help me how/why this is happening..
    Thanks,

    Can you post a VI(s) as I have trouble understanding what you are doing
    Besides which, my opinion is that Express VIs Carthage must be destroyed deleted
    (Sorry no Labview "brag list" so far)

  • Different read/write VI's

    Hello,
    I notice that in labview, I can:
    read/write to a SPREADSHEET
    This requires FILE_PATH and FORMAT
    read/write to a FILE
    This requires a FILE_PATH and NO format
    (because it is binary data)
    I can read lines... BUT I CANNOT write lines
    First question: why can I not write lines?
    Continuing... there are other ways to read/write.
    I can OPEN a file
    And, then I can read/write
    So: how is THIS read/write different from the ones above.
    I can see that THIS read/write requires a refnum from the
    open... OK... one structural difference...
    This one does not allow for formatting... but yields a BROWN data.
    Now, what is this DATA... is it binary?
    What is the purpose of the OPEN/read/write/Close
    on the second lines of the FIL
    E/IO vi's
    Can someone describe these and how they relate to each other?
    Thanks,
    Tom
    Hello,

    Tom Impelluso wrote:
    > Hello,
    >
    > I notice that in labview, I can:
    >
    > read/write to a SPREADSHEET
    > This requires FILE_PATH and FORMAT
    >
    This is called a TAB delimited file that most spreadsheet applications
    can read
    there is a TAB between columns and and EOL between rows. Writes in ASCII
    (I should say ASCII printable since all chars are ASCII)
    >
    > read/write to a FILE
    > This requires a FILE_PATH and NO format
    > (because it is binary data)
    Yep
    >
    >
    > I can read lines... BUT I CANNOT write lines
    >
    > First question: why can I not write lines?
    >
    I found this strange also but, you can use the Write Char or generate
    your own VI from
    the lower level VIS. Which would be using the Write Char and adding EOL
    as the last character in the line
    There is a VI called Write + (String) that does not show up in the
    palette but is used in some of the other VIs.
    >
    > Continuing... there are other ways to read/write.
    >
    > I can OPEN a file
    >
    > And, then I can read/write
    >
    > So: how is THIS read/write different from the ones above.
    It is a byte stream which could be almost anything from ASCII to G
    datatypes
    >
    >
    > I can see that THIS read/write requires a refnum from the
    > open... OK... one structural difference...
    > This one does not allow for formatting... but yields a BROWN data.
    >
    > Now, what is this DATA... is it binary?
    Not always but it can be. If you open an Excel file in a text editor you
    will see
    what a complex byte stream file looks like. The data is interspersed
    with formatting bytes.
    >
    >
    > What is the purpose of the OPEN/read/write/Close
    > on the second lines of the FILE/IO vi's
    these are the primitives that are used in all of the other file
    functions.
    This is the most basic level of what file I/O does.
    >
    >
    > Can someone describe these and how they relate to each other?
    The Open/Read/Write/Close are the primitves. The others are built up
    from these
    for special file types (like spreadsheet). They use the primitives and
    add some formatting
    and other options.
    Dont reply to this e-mail address. My account is down and I am using
    someone elses.
    Kevin Kent

  • Best way to read DataInputStream

    Hi there,
    I have a socket server which reads in data sent over from the client in UTF format. So the client/server communication takes place in the form of readUTF/writeUTF.
    I am currently using the following lines of code at the server side.
    din=new DataInputStream(ClientSoc.getInputStream());
    dout=new DataOutputStream(ClientSoc.getOutputStream());It works awesomely when small files of upto 500kb are sent from the file to the server.
    But when I try to send a big file...somewhere around the size of 20MB or something...I noticed that it takes a loooong time for it to write the file.
    Sometimes a Socket write error also happens.
    Is there a better way to read / write UTF than the one I am using above?
    I guess I could wrap it around a bufferedInputStream to improve performance,.
    But the final say comes from all You Socket Gurus out there :)
    Please Help me out

    I have tried implementing this. It seems to read in the correct amount of bytes. When i convert the bytes to integres and print them out i find that the values at the start of the array are correct but after a random period the values turn to zero. Could it be that the bytes are not being read in correctly?. Here is the code i use to read the bytes into the byte array.
              } catch (IOException e2) {
                   e2.printStackTrace();
              //Read the bytes from the input stream to a byte array
              // Create the byte array to hold the data
              while (offset < bArr.length && (numRead=is.read(bArr, offset, bArr.length-offset)) >= 0) {
                        offset += numRead;
              } catch (IOException e) {
                   e.printStackTrace();
              //Close the input stream
              try {
                   is.close();
              } catch (IOException e4) {
                   e4.printStackTrace();
              }

  • How to read a byte data from maxdb data base

    Dear All,
    I have a issue in reading the data from database table.
    I have a column named as templateData which contains the byte data (biometric template data, which comes from fingerprint device) which is DataType of LONG and CODE of BYTE.
    I am not using the below to get the template data
    Connection con = null;
      Statement stmt = null;
      ResultSet resultSet = null;
    byte[] DbBioData = new byte[1024];
    InitialContext ctx = new InitialContext();
       if(ctx == null)
         throw new Exception("Boom - No Context");
       DataSource ds = (DataSource)ctx.lookup(db_drvstr);
       con = ds.getConnection();
       stmt = con.createStatement();
       resultSet  = stmt.executeQuery(db_query + " where SUBJECT_ID='"+ username +"'");
       if(resultSet.next())
        DbBioData = resultSet.getBytes(1);
        _loc.infoT("verify", "verify::Got BioData From MAXDB" +DbBioData );
        loc.infoT("verify", "verify::Query is: " +dbquery + " where SUBJECT_ID='"+ username +"'" );
    But I am not getting the proper data, could anyone please tell me the way to read the biometric data from data base table.

    Hi Kishore,
    is it me or is there no query definition in that code?
    I see that you concatenate a "db_query" with a string to make up a WHERE clause, but the db_query is nowhere defined before.
    So at least you should provide something like
    stmt = con.createStatement("SELECT templateDate FROM <tablename> ");
    before you do anything with the query.
    Besides this: have you ever heard of SQL injections? Try to use BIND-variables instead of concatenating strings. Otherwise your application will spend much time just with parsing your queries...
    Hmm... possibly the best thing you could do about this is to read the JAVA manual for MaxDB:
    <a href="http://maxdb.sap.com/currentdoc/ef/2de883d47a3840ac4ebb0b65a599e5/content.htm">Java Manual (SAP Library - Interfaces)</a>
    Best regards,
    Lars
    Edited by: Lars Breddemann on Dec 17, 2007 1:12 PM - corrected link

Maybe you are looking for