Best way to store and check a NodeList

Hi,
I hope that this makes sense. In my code below, I have to, and ignoring the first one, check if the XPATH expressions are equal in first and second TSTs and second and third and so on & if they are not equal - I issue the ticket. But I don't know a way of storing the previous TSTs before it goes into the next iteration of the loop.
However I'm wondering if I'm going about it the correct manner.
    public boolean isFsiRequired(String xml) throws SITAFrameworkException, XPathExpressionException {
         boolean returnValue = false;
        // need to check that the Airline, Flight, Dep date and From/To City values,
         NodeList airLineExp = XMLUtils.queryXML(xml, "//MarketingAirline/Code");
         NodeList flightExp = XMLUtils.queryXML(xml, "//FlightNumber");
         NodeList departDateExp = XMLUtils.queryXML(xml, "//DepartureDateTime");
         NodeList fromCityExp = XMLUtils.queryXML(xml, "//DepartureAirport");
         NodeList toCityExp = XMLUtils.queryXML(xml, "//ArrivalAirport");
         System.err.println("returning returnValue == "+returnValue);
         return returnValue;
    // method is called from here
    for ( int i=0; i< totalTstCount; i++){
       if ( i == 0) {
            System.err.println("Issuing first FSI.....");
            response = sitaIssue.issueFsi(response);
       else if ( (i > 0) && (sitaIssue.isFsiRequired(command))) {                                    
                   System.err.println("Issuing another FSI.....");
               response = sitaIssue.issueFsi(response);
       else {
                   System.err.println("TSTs are equal, won't be issuing another FSI.....");
     }

I agree with Frank - for just 5 lines, simple text is probably sufficient.
However, if the point is just to pass data between two AppleScripts you could even use native AppleScript objects - for example, you could write the list (array) to the file and then read it back in directly, e.g:
Write the data:
-- create a list of any types:
set myList to {"a string", 3.14159, "foo", {name:"Joe", age:21}}
-- create a file
set f to open for access (choose file name) with write permission
-- write your (binary) data to it
write myList to f
-- and close the file
close access f
Now, separately, you can read it back:
set x to read (choose file) as list

Similar Messages

  • What is the best way to store and search 2D data

    Hi,
    There is a set of data (~10k records ) in 2D dimension.
    like this :
    Col 1, Col 2, Col3....
    What is the best way to store and search those records ?
    Thanks in advance
    Wilson

    Hi,
    Either userObjet[][] if you know how much data you have, and the data size is fixed, or use a list of lists. E.g. A Vector of Vectors (some will probably say that you should use an ArrayList instead, and that could be the case, but it sounds like you would want to display the data later on, and a DefaultTableModel (for JTables) uses a Vector as data holder).
    Kaj

  • Can you suggest a best way to store and read arabic from oracle database?

    Hi ,
    can you suggest a best way to store and read arabic from oracle database?
    My oracle database is Oracle Database 10g Release 10.1.0.5.0 - 64bit Production on unix HP-UX ia64.
    NLS_NCHAR_CHARACTERSET AL16UTF16
    NLS_LANGUAGE AMERICAN
    NLS_TERRITORY AMERICA
    NLS_CHARACTERSET WE8ISO8859P1
    I have presently stored the data in nvarchar2 field. But i am not able to display it correctly.

    Using the national characterset should work but there are other factors that you have to consider when working with NCHAR/NVARCHAR2/NCLOB.
    If possible, changing the characterset is usually the best solution if it's a possiblity for you.
    For more info:
    Dear Gurus: Can u pls explain the difference between VARCHAR2 & NVARCHAR2??

  • Best way to store and access all my media over network?

    With nearly 500GBs of music, movies and TV in my iTunes library, my G5's hard drive is just about full. And since I tend to watch everything on my significantly faster Macbook Pro via Front Row, it means I have to keep my G5 up and running all the time. Which feels like a huge waste of energy.
    So... what's the most efficient way to store and access my media? Here are some ideas off the top of my head. If anyone has any better ideas, please share...
    IDEA 1: BUY A TERABYTE EXTERNAL DRIVE AND CONNECT TO MY AIRPORT EXTREME'S USB PORT.
    Pros...
    1.) No need to keep my G5 up and running all the time, just the router and the external drive connected to it.
    2.) All media stored in one iTunes library which can be accessed by any wireless Mac on my network.
    Cons...
    1.) I have no idea if this would even work.
    2.) Would the USB connection be fast enough to play HD content?
    3.) Would the Extreme's b/g signal be fast enough?
    4.) Would my Macs even recognize an iTunes Library on a USB hard drive connected to my Airport Extreme with no OS of its own?
    5.) Even if it were fast enough, could two separate Macs share the same iTunes library?
    6.) I'd have to lose my wireless printer, which currently occupies the single USB port in my Airport.
    IDEA 2: BUY AN APPLE TIME CAPSULE AND USE ITS INTERNAL DRIVE AS MY ITUNES LIBRARY
    Pros...
    1.) The internal SATA drive will certainly be faster than any external USB drive.
    2.) Get to keep my USB port for wireless printing.
    Cons...
    1.) Still don't know if it would work.
    2.) Would not be able to take advantage of faster 802.11(n) speed, as my G5 tower is b/g only.
    3.) Pricey. $500 for a Time Capsule seems excessive not being able to take advantage of n speed boost.
    IDEA 3: BUY AN APPLE TV
    Pros...
    1.) I could watch HD content on my beautiful 30 inch Apple Cinema Display!
    2.) I could access all my content wirelessly through my network.
    3.) I get to keep my wireless printer wireless.
    Cons...
    1.) I don't own a TV.
    2.) I don't know if Apple TV will even play on my 30 inch Apple Cinema Display.
    3.) I don't know if my Macbook Pro will play files from Apple TV.
    4.) Apple TV doesn't come with a Terabyte hard drive.
    5.) I'm not sure I really understand what Apple TV is. (With a 30 inch Cinema Display, doesn't buying a TV seem redundant?)
    IDEA 4: SELL MY G5, BUY A TIME CAPSULE, AND HOPE NO ONE EVER STEALS MY MACBOOK PRO.
    Pros...
    1.) Can take advantage of that speedy wireless (n) network.
    Cons...
    1.) Still don't know if a wireless iTunes library stored on a router would work.
    2.) What will I do with my 30 inch Apple cinema display?
    3.) No backup computer if something ever goes wrong.

    Perfectly possible:
    Make sure the drive is formatted Mac OS Extended (Journaled)
    1. Quit iPhoto
    2. Copy the iPhoto Library from your Pictures Folder to the External Disk.
    3. Hold down the option (or alt) key while launching iPhoto. From the resulting menu select 'Choose Library' and navigate to the new location. From that point on this will be the default location of your library.
    4. Test the library and when you're sure all is well, trash the one on your internal HD to free up space.
    Back up to the 2TB drie:
    Most Simple Back Up:
    Drag the iPhoto Library from your Pictures Folder to another Disk. This will make a copy on that disk.
    Slightly more complex: Use an app that will do incremental back ups. This is a very good way to work. The first time you run the back up the app will make a complete copy of the Library. Thereafter it will update the back up with the changes you have made. That makes subsequent back ups much faster. Many of these apps also have scheduling capabilities: So set it up and it will do the back up automatically.
    Example of such apps: Chronosync - but there are many others. Search on MacUpdate or the App Store
    Regards
    TD

  • What is the best way to store and iterate over lists of words?

    Hi,
    Im trying to create a naive bayesian classifier to attribute aurthorship to some texts. I have three text files in the form of a list of words (listA, listB and listC, where listA is a disputed text and listB, listC are those of known authors). I need to feed these into my program, than compare listA to listB (to check if listA has the same words as listB), perform the classification and do the same for listA and listC.
    Im new to java and would like to know the best way of comparing the text files....could i store listA in an array....listB in a hashmap, iterate over the hashmap to check which words are also contained in listA and store the similar words in a seperate arraylist?
    plz help.

    If you just want to check if one set of words contains another set of words then something implementing java.util.Set might be sufficient. Read the API docs, you don't need to write much code yourself. Maps are for looking up values based on keys; your problem statement doesn't mention that so you don't need them. Lists are for when the order of entries matters. Read this for more information:
    http://java.sun.com/docs/books/tutorial/collections/index.html

  • Best way to store and back up data on Mac (retina)?

    Ok so I bought the 13 inch retina macbook pro (This is my very first mac btw, so I am still trying to get used to basic functions though it's getting there..) and I've researched it a bit but I have some issues on figuring out how I best should store my data.
    1. Is Time Machine not the best way to back up data? As it will delete the oldest data once the hardrive used is full?
    but on the other hand, backing things up manually will take a lot of pain and effort (Choosing the new files that haven't been transferred, accidentally copying a file you actually already put in your back up disk thus taking additional unnecessary space,etc) ...right?
    or is there a better way to do this?
    2. I want to have all media (music, photos, videos, anything except apps) on an external hard drive but I don't want to have to keep transferring it from iphotos or anything else to my external hard drive...
    Is there a way to do this a smarter way? It would be best if I could put everything directly to my harddrive instead of having to import thru iphotos (thus taking up space on my internal SSD first) THEN deleting it from iphotos :/
    As of now I am trying do configure this network storage system (called SeaGate GoFlex Home if anyone is interested) but I am wondering if this is really a reliable way to keep my stuff... I plan on putting music, photos and videos on there..along with word documents
    Is there a way to configure the mac to automatically download stuff to my external network drive instead of saving it on my SSD?
    Thanks in advance for any help /opinions

    kj8P wrote:
    Is Time Machine not the best way to back up data? As it will delete the oldest data once the hardrive used is full?
    Although Time Machine does delete oldest data when full, it doesn't back everything up every time - only the files that have changed since the last backup.  Storage is cheap these days so if you get a good sized drive (seems daft to get less than 1Tb and 2 or 3Tb cost not a great deal more), then unless you have a really large SSD on your MBP and fill it with stuff, it will be a long time before Time Machine starts deleting old stuff. Aim for a minimum of double your SSD capacity.
    This article gives a very detailed explanation of Time Machine and how it works - bear in mind that even when TM has to delete the oldest backups, it will not delete something that does not have a newer version.
    http://icanhelpyourmac.com/tip_archive/understanding_apples_time_machine/index.h tml

  • Plsql best way to store and run generated sql

    Oracle 11g
    I found a script on a web site that generates a bunch of sql to do basic data profiling on a set of tables (I've include 1 step in the script below that profile date columns ..see below). I'm currently having trouble with buffer overflows when I process a more than 5-10 tables. I'm looking for a better way to temporarily store the result set and execute the resulting sql. I don't have access to the server so using utl_file is not an option. Can I some how append the sql to a temporary clob varable? Any suggestions would be very helpful.
    declare
    t varchar2(2000);
    cursor c1 is select distinct owner,table_name from all_tab_columns
    where table_name in ('PS_F_BEGIN_BAL','PS_F_KK_ACTIVITY','PS_F_KK_ACT_FS','PS_F_KK_JOURNAL'
    ,'PS_F_KK_BUD_ASSOC','PS_F_KK_BALANCES','PS_F_KK_ENCUMRANCES','PS_F_KK_EXCEPTION'
    ,'PS_F_KK_FS_ALLOC','PS_F_KK_FS_RCVD','PS_F_KK_OVERRIDES','PS_F_KK_TRANS_LOG','PS_F_CLEDGER'
    ,'PS_F_FLOWS','PS_F_JOUNRAL','PS_F_LEDGER'
    begin
    t := 'INSERT INTO DATA_PROFILE_COL_SUM ';
    for i in c1 loop
    DBMS_OUTPUT.PUT_LINE(T);
    ----date
    FOR MYSQLTEXT IN (SELECT
    'select '
    || '''' || C.table_name || '''' || ' as tname, '
    || '''' || C.column_name || '''' || ' as cname, '
    || '''' || C.data_type || '''' || ' as data_type, '
    || '''' || nvl(c.data_length, 0) || '''' || ' as data_length, '
    || '''' || nvl(c.data_precision, 0) || '''' || ' as data_precision, '
    || '''' || nvl(c.data_scale, 0) || '''' || ' as data_scale, '
    || '''' || c.nullable || '''' || ' as nullable, '
    || '''' || nvl(c.num_distinct,0) || '''' || ' as num_distinct, '
    || '''' || nvl(c.density,0.0) || '''' || ' as density, '
    || '''' || nvl(c.num_nulls,0) || '''' || ' as num_nulls, '
    || '''' || nvl(c.char_col_decl_length,0) || '''' || ' as col_length, '
    || '''' || nvl(c.avg_col_len,0) || '''' || ' as avg_col_length, '
    || '''' || nvl(c.char_length,0) || '''' || ' as char_length, '
    || '''' || nvl(tblc.comments, 'NONE') || '''' || ' as table_comments, '
    || '''' || nvl(colc.comments, 'NONE') || '''' || ' as column_comments, '
    || ' count(*) as rcount, min('
    || c.column_name || ') as min_date, max('
    || c.column_name || ') as max_date, '
    || ' null as min_integer, null as max_integer, '
    || ' null as min_number, null as max_number, '
    || ' null as min_varchar2, null as max_varchar2, min(length('
    || c.column_name || ')) as min_len, max(length('
    || c.column_name || ')) as max_len, sysdate'
    || ' from '
    || C.owner || '.' || C.table_name
    || ' ' || CHR(13) || chr(10) || ' UNION ALL ' || chr(13) || chr(10) AS MYSQL
    from sys.all_tab_columns c
    inner join sys.all_tables t
    on c.table_name = t.table_name
    and c.owner = t.owner
    left outer join sys.all_tab_comments tblc
    on t.owner = tblc.owner
    and t.table_name = tblc.table_name
    left outer join sys.all_col_comments colc
    on c.owner = colc.owner
    and c.table_name = colc.table_name
    and c.column_name = colc.column_name
    where c.owner = I.OWNER
    and c.data_type = 'DATE'
    and c.table_name = I.TABLE_NAME
    LOOP
    -- utl_file.put_line(f,MYSQLTEXT.MYSQL);
    DBMS_OUTPUT.PUT_LINE(MYSQLTEXT.MYSQL);
    END LOOP;

    The buffer overflow id beacause of dbms_output. the max limit of the string is 255.
    It will not stop you from inserting or executing the sql dynamically.
    you can run dynamic sql by
    execute immediate 'your sql statement';if you want dbms_output to display allof it you have to use a loop. Look at the followinmg example
    DECLARE
       loopcntr       NUMBER := 1;
       vextend        NUMBER := 255;
       l_sql          VARCHAR2 (32767) := RPAD ( 'ORACLE', 1000, 'AB');
    BEGIN
       WHILE loopcntr < LENGTH (l_sql)
       LOOP
          DBMS_OUTPUT.PUT_LINE (SUBSTR ( l_sql, loopcntr, vextend));
          loopcntr    := loopcntr + vextend;
          vextend     := LEAST ( 255, LENGTH (l_sql) - vextend);
       END LOOP;
    END;G.

  • Best way to store and retrieve data in a text file

    I want to write to a text file and then in another Applescript read the same data into an array
    I'll have 5 lines of text data
    What would be the best format?
    CSV?
    XML maybe?
    Just a plain file with each line of data separated by pressing enter?
    Thanks
    Omar

    I agree with Frank - for just 5 lines, simple text is probably sufficient.
    However, if the point is just to pass data between two AppleScripts you could even use native AppleScript objects - for example, you could write the list (array) to the file and then read it back in directly, e.g:
    Write the data:
    -- create a list of any types:
    set myList to {"a string", 3.14159, "foo", {name:"Joe", age:21}}
    -- create a file
    set f to open for access (choose file name) with write permission
    -- write your (binary) data to it
    write myList to f
    -- and close the file
    close access f
    Now, separately, you can read it back:
    set x to read (choose file) as list

  • Best way to sync and view other videos formats

    hi all,
    me and my wife both have iphones and  have recenly bought a ipad and apple tv. I am getting a bit frustrated as i cant work out the best way to store and easily view my old pics and video files.
    the shops salesman convinced me to by knowhow cloud which seemed brilliant but it wont back up al photos so ill go back to the shops. its just app on the phone that shows all pics stored on my windows pc
    i also want to know what way is best to store and view some .mod files or moi files. I have air video which works great for divx files but not the ones i want ex my video camera
    any help greatly received
    main reason for the ipad is to create a central hub for viewing pics and videos on and streaming to tv in background when we have parties or just remenicising
    alistair

    Unfortunately, the playback of non-iOS-native video formats (everything except mov / mp4 / m4v) is horrible through Apple TV and it, because of the inherent speed restrictions of Wi-Fi, can't be helped other than:
    - pre-converting your video files to mov / mp4 / m4v before playing them. (THis is the best solution.) For this, you will want to use the absolutely best and fastest video converter, the free(!!!) HandBrake. Don't ever think of paying any money for any video converter - most other titles are way inferior to HandBrake. (See http://www.iphonelife.com/blog/87/benchmark-excellent-multimedia-converter-handb rake-vs-commercial-apps for more info on this q.)
    - using a VGA or HDMI adapter and connecting your TV directly to the iPad.
    In the thread at https://discussions.apple.com/message/18697551?ac_cid=sa123456#18697551 , we've also discussed this problem (AirPlay vs. cabled playback)

  • Best way to store documents and images in a web application

    All,
    Which is the best way to store the documents, is it Oracle DB or file system or Virtual Directory Mapping in weblogic.
    We are working on a Internet based application into CRM domain, there is a requirement where user can upload and download the documents (.pdf, .xls, .doc etc). Right now we are storing images in the DB. Is it advisable to store all the docs in database and will it scale up in future.
    PS: There is no scope for using content server because of business constraints.
    Please let me know, thanks in advance.
    Regards
    Girish

    Best way to store depends entirely on requirements.
    Why store it in the database when it for example is purely static images (e.g. used as part of the web GUI)? Instead that can be served up directly by a web server - which is specifically designed for this.
    If it is more than just an image, but include tags (non spatial data attributes), requires transaction control (e.g. updating an old passport/id photo with a newer one), auditing, filtering/searching and ordering, requires backup, needs security and access controls, and so on - than that is most definitely a database function.
    So the issue is not what the binary file is or contains - an image or pdf or something else. It depends entirely on how it is to be used and what the business requirements are in this respect.

  • Best way to store movies from iTunes

    I have several movies I purchased from iTunes on my computer. Now I want to free up some space on my hard drive. What is the best way to store them off my computer so I can access them again in the future?

    I believe you can do Back up to Disc and burn them as Data Discs. (Be sure to check your burning preferences first.) You won't be able to view them from the burned discs, but you can use them to restore to your library. Burning the movie itself....I doubt you can get it to fit on one CD. Another option would be to invest in an external drive. I hear they're pretty affordable.

  • What's the best way to store my info externally

    I have recently bought my first Macbook Pro 13" with 2.4 Ghz. I am currently using it for my own business and do tend to get a lot of files together. I went to look at "About this Mac" and have already got 369 Gb used up in storage... I have no idea how I have done that as I have hardly downloaded any apps on this computer besides the ones that were on here. I did download Vware Fusion 4 as I have a reservation system which I used to run on my pc and need to have this on here too so perhaps that software takes a lot of space.
    Could anyone advise on which is the best way to store my info externally, will any external harddrive do, or do you need a special one for Apple or Macbook pro. I am just asking as I have no idea and prefer to buy the right one straight away.
    Any help would be much appreciated !
    Thanks, Sara***

    Sara,
    The most reliable method is to use an external hard drive.  Some are better than others, but most will work.
    For the least amount of setup pain, I prefer to deal with the Mac specialists at OWC, http://www.macsales.com as they stand behind their products with great warranty and support.  I have one of their Mercury Elite Pro 2 TB drives that has multiple interface capability so you can get a fast interface for data transfer.
    Take a look at what they offer and see what fits your needs.  If you have more questions about doing thin, just ask on here.
    Ralph

  • How is the best way to backup and organize Adobe layered .PSD files on iMac OSX maverick?

    How is the best way to organize and backup Adobe layered PSD files on iMac desktop OSX maverick?
    I lost all my Adobe Photoshop files + everything else on my IMAC when it crashed. They reinstalled Operating System.  But now i must install programs such as MS Word & Adobe indesign suite.
    Please help me determine what is the bestway to backup Adobe layered  PSD files? I believe these are my choices to be assured this doesn't ever hapen again. Please comment.
    Buy Apple Airport Time capsule $280.  But I am not sure if it can store PSD layers. Can it or do you have to have Apple Apperture  software to act be sure layers are saved
    I had had trouble getting Adobe Cloud to sync to save files and so just trusted my computer to not ever crash.  Any hints on this procedure
    Are there any hints on PhotoShop image organization for a current IMac usser ?
    Please help.
    Teann  ucreateit

    My backup plan is to use Time Machine to make a backup to an external disk drive plus I also do a clone of my system disk. So far between the bootable clone and the Time Machine backup this plan has covered all of my needs.
    Allan

  • Best way to store data from a plot on hard drive

    I have a DAQ set-up that will be on 24/7 for several days, and the whole time it's streaming data to an XY-Graph with a limited buffer.  My question is, what's the best way to store my plot data in such a way that I can empty out my plot every few hours but if I want to pull up data from a few hours ago I would just have an option on my initial VI to view any old saved plot data.
    Basically, I'm trying to not overload my RAM with all my plot data so I'd like to save it to the hard drive while my VI is running, and only display, for example the last 8 hours worth of data... I've been looking at TDMS, but I'm not sure if that's the right solution.  
    much thanks!

    Hi,
    You could save your data using TDMS as well as ASCII to simply load it in another application later.
    Attached VI shows you how to save your data to a File after a certain amount of iterations, you can combine this then with your code and a timestamp.
    Christian
    Attachments:
    Save to new file every N samples.vi ‏20 KB

  • Best way in LabVIEW to check if TS execution is complete

    I was wondering if anyone had some thoughts on this.
    What is the best way in LabVIEW to check if a TestStand Execution is complete.  I am currently starting a New Execution in a previous state using the 'Engine->New Execution' method.  Then in my state shown in the attachment, I simply wait in a loop until the execution is Stopped using Execution->Get States.
    I have also noticed the function called 'Execution->WaitForEndEx' but the help documentation indicates:
    " This method is not meant to be used by a user interface or sequence editor, as it does not process UIMessages. Instead, use this method from a step to synchronize with another execution."
    Is WaitForEndEx a better method or should I stay with the current implementation?
    Thanks,
    Paul Holzrichter
    Attachments:
    Execution Complete.JPG ‏63 KB

    Hi Paul.
    You could also use the Application Manager's "EndExecution" event.
    This would prevent you from staying in a loop and waiting for the execution to complete.
    Regards, Guenter

Maybe you are looking for

  • Adapter Module for SOAP Sender

    Hi, Any alternative way to create adapter module for soap sender? Regards, Farooq

  • Mac Mini DVR?

    Looking to get rid of my Cox Cable DVR box and possibly replacing it with a Mac Mini. I don't necessarily want to get the brand new Mac Mini but was wondering what the bare minimum Mac Mini I would need to purchase in order to record HDTV with EyeTV?

  • ODI Hyperion Planning Integration

    I have one question on ODI. If my application has 3 database and all of them have different accounts and entity dimension. How will i tell the ODI to update a particular database dimension and not all. Example below If I have application called : Sam

  • Best Practice for KMC

    Hi All Can some one help me in getting the Best Practice  followed in the Search Technologies of SAP EP. As such TREX is in-built. But i would like to know the possible best practice followed from SAP EP view point. Thanks in Advance Jayanthi

  • Earphones with Remote and Mic (for Voice Recorder??)

    Hello, today I find this Earphones with Remote and Mic on Apple store: http://store.apple.com/us/product/MB770 It will work on iPod touch (2nd generation), so does it mean the voice recorder app (bought from App Store) is going to work on the iPod to