Please Suggest best way to pass Strings in a pipeline

I'm working in a project in which a line passes in a pipeline kind of situation.
The String is passed between different modules and each module adds some more data to it (or may even remove some of it).
Which is the best way to pass the String? I think java.lang.String might not be an efficient method because the String i'll be passing will be modified many times.
Thanx

Yes. StringBuffer or StringBuilder you can use.
String string = "test";
StringBuffer sb = new StringBuffer(string);later you will add some more strings to the StringBuffer
sb.append("Hello World");No additiional String object will be created.

Similar Messages

  • Can anybody please suggest the way i can get all the indexes on a cache

    Can anybody please suggest the way i can get all the indexes on a cache?

    Hi,
    If you want to just see what there is at the moment, the StorageManager mbean IndexInfo attribute shows the toString() representation of the extractor of each index.
    If you want to get it programmatically, you can get hold of it by sending an entry-processor to a key, then casting the entry to BinaryEntry, and calling BinaryEntry.getBackingMapContext().getIndexMap() to get the same Map<ValueExtractor,MapIndex> of indexes which the index aware filters get.
    Best regards,
    Rob

  • Best way to pass data sets to another program

    Hey
    I want to connect another (maths) program with my java application. Therefore I need to paste data (some kind of tab separated table) to this program.
    I try now to save these data in a separate newly generated file and to pass a command with Java's Runtime.exec() method to this program to read these data. Is this a good idea or might there be better ways?
    If I do so, is there a way in Java to generate some kind of a "temporary" file which will be deleted automatically after usage or is this nothing else than to save it in a common file and delete it afterwards. What's the best way to pass data generally?

    Well, the connection will not be over a network, so I'd rather think it's not a Socket or RMI problem (unless someone convinces me).
    Yes it's very external, it's a C or C++ written program, I don't have any source codes. So far I generated a file for Input command and data, I passed that on to the maths program and returned the output into another file.
    Now I would like to separate the output and like to obtain some tables and graphical things like charts at the output. Do I have to generate three different types of outputfiles? How to store some graphics e.g. some distributions. I thought even of generating a database. I never thought about XML, I don't know if this works for that kind of problem?!

  • I just Synced My iPhone 6 which had close to 2000 photos to a new computer (windows PC) and synced with iTunes.Now all my previous photos have been deleted which were there on my phone. Please suggest a way to recover those Photos . Thanks

    I just Synced My iPhone 6 which had close to 2000 photos to a new computer (windows PC) and synced with iTunes.Now all my previous photos have been deleted which were there on my phone. Please suggest a way to recover those Photos . Thanks
    P.S -I have not taken any backup of those photos. So please suggest any software or any other method.

    If those photos were part of the camera roll, they were part of the backup as well and you can restore from the latest backup you made on the old computer. After that transfer the photos to the new PC, follow this article: iOS: Importing personal photos and videos from iOS devices to your computer
    Then sync again to the new one, which will erase the phone again.
    You can also try to copy the backup folder from the old computer to the new one and see if the old backups get recognized, check this article to find the location on your PC:
    Create and delete iPhone, iPad, and iPod touch backups in iTunes
    If the photos were not taken with the phone, your data is gone, photos you sync from iTunes to the phone are not included in the backup.

  • Please suggest best GUI client for Linux setup?

    HI,
    I need to setup OBIEE 11g on Linux. Please suggest best GUI client to connect to linux and setup OBIEE.
    appreacite for your help.
    Thanks
    Jay.

    Hi Jay,
    You can use Xming server for linux. I have downloaded Xming server 6.9.0.31. It worked well with Windows XP(32 bit) as well as Windows 7(32 bit). I have used it for Oracle HTTP Server installation and OBIEE 11g installation
    After installing, to start Xming go to command prompt and start. This invokes the Xming application properly when compared to double click starting.Go to cmd. Go to location C:\Program Files\Xming Enter this
    Xming.exe :0 -clipboard -multiwindow -ac.
    Note: colon zero ended up in a smiley!
    You will see Xming popup in your right side. Go to putty session and export your display with this command.
    export DISPLAY=172.45.62.143:0.0
    Replace the ip address with your system ip address. The above one is example.
    Note: If your putty session is in client network, use the ip address that is in Ethernet: client server.
    Test if display is exported properly with this clock command which gives a GUI popup of clock.
    xclock &
    Hope this helps.
    Regards,
    Amrutha.
    Edited by: Amrutha Kalidindi on Jul 29, 2012 2:48 PM

  • Best way to pass large amounts of data to subroutines?

    I'm writing a program with a large amount of data, around 900 variables.  What is the best way for me to pass parts of this data to different subroutines?  I have a main loop on a PXI RT Controller that is controlling hydraulic cylinders and the loop needs to be 1ms or better.  How on earth should I pass 900 variables through a loop and keep it at 1ms?  One large cluster??  Several smaller clusters??  Local Variables?  Global Variables??  Help me please!!!

    My suggestion, similar to Altenbach and Matt above, is to use a Functional Global Variable (FGV) and use a 1D array of 900 values to store the data in the FGV. You can retrieve individual data items from the FGV by passing in the index of the desired variable and the FGV returns the value from the array. Instead of passing in an index you could also use a TypeDef'd Enum with all of your variables as element of the Enum, which will allow you to place the Enum constant on the diagram and make selecting variables, as well as reading the diagram, simpler.
    My group is developing a LabVIEW component/example code with this functionality that we plan to publish on DevZone in a month or two.
    The attached RTF file shows the core piece of this implementation. This VI off course is non-reentrant. The Init case could be changed to allocate the internal 1D array as part of this VI rather than passing it from another VI.
    Message Edited by Christian L on 01-31-2007 12:00 PM
    Christian Loew, CLA
    Principal Systems Engineer, National Instruments
    Please tip your answer providers with kudos.
    Any attached Code is provided As Is. It has not been tested or validated as a product, for use in a deployed application or system,
    or for use in hazardous environments. You assume all risks for use of the Code and use of the Code is subject
    to the Sample Code License Terms which can be found at: http://ni.com/samplecodelicense
    Attachments:
    CVT_Double_MemBlock.rtf ‏309 KB

  • Best way to pass an array of waveforms inbetween VIs

    In my VI I am developing I have multiple data sources that output a single waveform. I group these waveforms togeather to make a wave form array. The user selects which waveform they would like to display and they are displayed on a graph on a different form. Right now I have each different graph VI generating the whole array and displaying the selected element.
    My question is, this seems to be not efficent because I am generating data in 3 spots. I would think it would be better to generate it in one spot and then pass only the need data to the three graph VIs. What is the best way todo this? A global variable? Queue? Any suggestions?

    You're probably tired of hearing me say this, but the global function idea is the best.
    A global variable makes a COPY of the data each time you read it. That takes time, and memory. If each of 3 window reads the global, and picks out a channel, then you've made 3 copies of the original data. Depending on your data size, that may or may not be a problem.
    A queue means that once you read the data, it's lost from the queue. If window A reads from the queue, that data chunk is not in the queue any longer, so Window B can't read that same data.
    If the main window generates the data and deposits it in a global function, then each window can ask the global function for a specific channel to display.
    DATA STORAGE.vi:
    Inputs:
    WRITE/read (bool
    ean)
    DATA IN (2-D array of DBL, for example)
    Channel Index (I32)
    Outputs:
    DATA OUT: 1-D array of DBL (or waveform, maybe).
    Code:
    WHILE
    If WRITE/read
    Store DATA IN in a shift reg.
    else
    Pass Shift reg IN to Shift reg Out.
    Pick out channel via CHANNEL INDEX
    Pass selected data to DATA OUT.
    Loop NEVER.
    The purpose of the loop is just to have a shift reg. It doesn't really loop - it executes once per call.
    Steve Bird
    Culverson Software - Elegant software that is a pleasure to use.
    Culverson.com
    Blog for (mostly LabVIEW) programmers: Tips And Tricks

  • Best approach to pass string to table

    What is the best approach or way to pass a colon delimited string back to a table from a procedure?
    I know when using a multiselect item you can pass a string back and forth using
    HTMLDB_UTIL.STRING_TO_TABLE or
    HTMLDB_UTIL.TABLE_TO_STRING
    but I'm unsure how to pass a colon separated string from a procedure to insert into a table?
    Unfortunately using the approach below yields me an error
    PLS-00306: wrong number or types of arguments in call to 'TABLE_TO_STRING"
    create or replace PROCEDURE "123_ABC" (
    g_abc IN number,
    g_123 IN varchar2)
    AS
    r_one varchar2(15);
    r_two varchar2(17);
    t_selected HTMLDB_APPLICATION_GLOBAL.VC_ARR2;
    CURSOR 123_cur IS
    select ID, NAME
    from table
    where abc=g_abc
    and 123=g_123;
    BEGIN
    delete from TABLE_STAGE;
    COMMIT;
    t_selected := HTMLDB_UTIL.TABLE_TO_STRING(r_one);
    FOR a_rec IN 123_cur
    LOOP
    INSERT INTO table_stage
    VALUES (r_one, r_two);
    COMMIT;
    END LOOP;
    END 123_ABC;

    In my opinion, unless you embark on O/R mapping frameworks, your JDBC implementation is probably the most efficient but not neccessarly the most elegant aproach. I described an alternative approach which ships serialized Java objects by value across tiers in my book http://www.amazon.com/gp/product/1555583296/
    page 803 chapter 12.
    A second option is to publish the SQL statements (Insert, Delete, Update) as Web services (see Database Web Services in the book).
    Another option also described in the book, is to use the rowset APi (webrowset, joinrowset).
    Kuassi

  • What is the best way to pass a constant to a cin expecting a pointer to a value?

    I have a cin which has a leg that is expecting a pointer to a value. On the diagram, what is the best way to connect a constant widget to this leg of the cin? Connecting it directly crashes labview as it treats the constant as a pointer to memory.
    Thanks

    I am not sure that I understand your issue. CIN variables can be Input-Output or Output only. Either way, they are being passed in as a pointer to a value. You can see this very easily by placing down a CIN and wiring a constant integer to it. Next, right-click on the CIN and create the C file. You will see that the parameter list has an int* in it.
    If you are still having problems, do you have to create a CIN or can you create a DLL instead? The DLL will give you a few more ways to pass the data than a CIN does with no real performance decrease.
    Also, have you read the "Using External Code in LabVIEW" manual? This hsould answer some questions as well.
    Randy Hoskin
    Applications Engineer
    National Instruments
    http://www.ni.com/ask

  • How to colorize and old black and white video? please suggest easy ways :)

    1- please tell me more than a way of how to colorize the black and white movie ..!
    what is the best way to do that in less time as possible (actually i found it a hard work ).  please tell me there's a way to make it
    2- also i want to know if there is a palette of color value numbers . let me make it more understandable
    when i applied the color balance effect on an adjustment layer (using AE)  to have a try to color a frame,  i got the RGB values to control by which the color i want. so i found it a little hard to get far a way from the orange , purple , green , pink , red , gray and blue colors via combining the values .. so i am asking if there is a palette that could help me to mix color values and get more colors!!!
    3- what programs could do this? i have an idea that after effects could do it but what else?

    Here's a step by step and a few other ideas. To add color to a black and white film it is best to use the Color blend mode. AE CC 2014 has very powerful mask tracking which can be used to isolate things like faces and clothing. A bit of hand work may also be required. For some scenes, you'll need to use RotoBrush to isolate the elements you want to colorize. You cannot effectively colorize just by manipulating channels unless you want very subtle colors because black and white images may have exactly the same color channel values for a man's shirt that you want to turn blue, the leaves on a tree that you want to turn green or the car he is driving that you want to turn red. You can, however, create a mask that tracks the car and then add a red layer or fill effect using the color blend mode to turn the gray car red and maintain all of the highlights and shadow values.
    Really powerful color correction software has the power to isolate and track areas based on edges (much the same way rotobrush works) so this kind of color correction can be done on the fly but it still requires a separate mask for every color you want to add.

  • Best way to store string resources for localization?

    My midlet has alot of string resources that I want to be able to easily customize, and I wonder what is the best way to do this using J2ME? To make the code easy to localize I would like all strings to reside in a single file (either a class file or a file system file). It doesnt seem that there is an easy way to do this (eg a "resource file" or some such). Do I just need to create a class that defines a bunch of static final String objects?
    Thx,
    Fred

    [HypnosFred],
    My midlet has alot of string resources that I want to
    be able to easily customize, and I wonder what is the
    best way to do this using J2ME? To make the code easy
    to localize I would like all strings to reside in a
    single file (either a class file or a file system
    file). It doesnt seem that there is an easy way to do
    this (eg a "resource file" or some such).Perhaps you might want to utilise the MIDP RMS record store feature i.e. javax.microedition.rms.* classes instead to store the string objects.
    Do I just need to create a class that defines a bunch of static
    final String objects?Declaring the String object variables as static final String objects upfront may help too but cannot be shared between MIDlets in a MIDlet suite though.
    Thx,
    FredHTH.
    Allen Lai
    Developer Technical Support
    SUN Microsystems
    http://www.sun.com/developers/support/

  • Best way to Pass a Date with Time to a Page

    Has anyone come up with a simple and reliable way to pass a Date with Time "06/13/1992 10:50 PM" to a page.

    Hi Scott:
    On Page 1:
    Summary Report
    LINK  Window   Item Count      Start Date                   End Date
      X       1            7         8/2/2007 03:15:20   8/2/2007 03:18:22
      X       2          12         8/2/2007 04:01:01   8/2/2007 04:07:42When the LINK is clicked
    On Page 2:
    [:P2_S_DATE] 8/2/2007 03:15:20 [:P2_E_DATE] 8/2/2007 03:18:23 [:P2_GO]
    Detail Report
    Window   Item Number      Item Date
        1                1                8/2/2007 03:15:24
        1                2                8/2/2007 03:17:04
       ...              ...                        ...I then need to allow the users to adjust the dates and click the P2_GO and have it return the new result set.

  • Best way to pass vars from html into flash?

    I've read a variety of pages that describe how to pass a variable into a flash movie (AS3, player = v9) from the html in which it is embedded.  This page describes AS3 but neglects to mention what to do with the object and embed tags in the noscript section. Furthermore, I'm not sure the javascript I see generated in my page looks like the example there (the js in my page doesn't check AC_FL_RunContenta against zero).  This page is quite long and appears to deal mostly with AS1 and AS2 approaches which I have used before and neglects entirely the newish javascript approach which appears to be used to embed flash these days (i.e., the javascript function AC_FL_RunContent).
    I was wondering if someone could spell out the proper way to pass in a variable from HTML so that flash can see it in such a way that works even if javascript is disabled, in all browsers, etc., etc.
    I've attached the HTML generated by the Flash IDE to this topic.  Any help would be much appreciated.

    You'll have to search for that concise and thorough list of steps or figure it out using the information you now have, which is sufficient to get it done.  It's not that hard--add the FlashVars in the embedding code in the three places and use the various examples you have links to to add the code in the Flash file to access and use the FlashVars.
    Your Flash will be embedded in a web page depending on the visitors settings... if they allow javascript then the javascript portion will be used.  If they don't, then either the object or embed sections will be used depending on their browser.
    As far as javascript changes go, don't sweat 'em until you have a problem... use whatever code your Flash-created html page creates to embed the file in the page.

  • Best way to pass back data from hierarchical table view?

    Hi,
    I have a view hierarchy using a navigation controller that's working pretty well. One of the bottom level views is a table view where the user selects an item from the list. This bottom view checks the list item, saves the selected item in a property, and then pops the view off the stack.
    What's the best way to alert the parent view that the child view has been popped off so it can retrieve the value in the property? The calling push returns immediately, so it doesn't appear to be a modal call. I want to be able to use the same controller from other parent forms, so I need to be able to do this without referencing the parent in the child form ideally.
    Thanks
    Ray

    Hi, well let me try to explain it a bit more
    - Add a "delegate" property to your child-viewcontroller-class
    - Define a protocoll within each chil-viewController-class
    In this example let us name it "didSelectValue:(NSString *)value"
    - In the parent-viewcontroller before pushing a child-viewcontroller set it's delegate property to "self" (parent-viewcontroller)
    - In the parent-viewcontroller implement to protocoll-method "didSelectValue:(NSTring *)value"
    - In the child view-controller in (assuming it is a tableViewcontroller) add some code in didSelectRowAtIndexPath that checks if the delegate is set and check if it responds to selector "didSelectValue:(NSString *)value". If so, call it with the selected value.

  • Best way to pass data to and from a fieldpoint unit

    Hello,
    I am just starting to play with a fieldpoint unit and I was wondering the best way to send and receive data with it.  We are setting up a pumping station and need to send the FP a setpoint and be able to read other sensor connected to it.  I know there are at least a few options such as data socket, publish data, shared variables and maybe tcp/ip.  But I was wondering as to the best/easiest option.
    Thanks

    For case #1, you wouldn't have to do anything special.  The setpoint would just remain at whatever value was last written to it by the host system (the one where you are at the controles).
    For something like #2, you would probably want an extra routine, such as read the timestamp of the shared variable, if the cFP sees that it is too old (whether that would be a minute, an hour, a day ....) then the code goes into a pump down routine.  Another possibility would be a watchdog type of shared variable.  The host system periodically increments a counter and sends it to a shared variable on the cFP.  If the cFP sees that the counter hasn't incremented in a given period of time, then it can assume a connection was lost and do the shutdown routine.
    Going with shared variables will definitely get you started quicker.  Good luck with your application.

Maybe you are looking for

  • How to have multiple preference files for Mail on one computer

    I would like to have multiple preference files for Mail on one computer, one copy for each person in the organization. I want everybody to log in as the same user. Is this possible? Thanks, John Link Cube, 450 MHz, 640 MB   Mac OS X (10.3.9)  

  • Email of Purchase Order coming with Standard Form

    Hi, I have configured NACE. I am able to generate the PO through email. But, the problem is, system always picking of standard form instead of "customized form", (though I have configured customized form for emailing). Whereas, in case of printing, t

  • Thunderbolt ports not working properly on new MBPwR?

    So I went to go transfer 130GB to my new computer with a thunderbolt cable and it says it was going to take 53 hours? What's the deal?

  • Websites read my macbook pro as a mobile device. How do I fix this?

    This has been going on for as long as I've had my Macbook Pro (May 2011)--AND since before I recently updated my operating system to Mavericks from Snow Leopard. It's getting really annoying. It used to be that just the MGM Resorts properties in Las

  • Title vs Version Name

    Hi!! I have iPhoto and Aperture libraries combined. I use aperture library as a main one and aperture as a edit and work with photos and iPhoto to see it. In Aperture we have to fields to name a photo. Version Name and Title. I think that in aperture