Parse a string that uses nested string delimiters

I’m looking for a way to parse a string that uses double quotes as the delimiter that contains a nested string with double quotes.  I want to keep the double quotes in the nested string.  Is there a function in Labview that I can use to easily do this?  Does Labview have a command line parser / interpreter?
The string example is: While match "Send Test "Sleep 5" ">""
The result string would be:  Send Test "Sleep 5" ">"

Here is another solution which is slightly faster.  Speed won't be
an issue unless you are running millions at a time, as in my test the
difference was only 1-2 ms in 10000 iterations.  In this image the
Match Pattern function retrieves the desired string, including the
outside quotes, so the String Length and String Subset functions are
used to remove the first and last characters of the result.
Message Edited by tuba on 04-11-2006 10:35 PM
Attachments:
parse.gif ‏3 KB

Similar Messages

  • Archiving Projects that use Nested Sequences

    I'm looking for some help using Project Manager to archive projects that use nested sequences. 
    I work at the University of Michigan, we are wrapping up a study that is based on files from many Premiere Pro projects.  Each project started with 150 to 160 min of video footage from two cameras.
    Of this we have edited down to a 10 – 20min finished sequence containing footage from both cameras as a two-camera shoot.  I want to archive eachproject (to save HDD space) retaining only the used sections of footage in thePPro archived project, allowing us to make minor edits to the projects.
    My workflow has been to rely heavily on nested sequences throughout each project.  From two sequences containing all of the footage from Camera1 and Camera2 all the way to the final cut sequence everything is dependent on a series of interim nested sequences. So the last sequence “Final” is based/linked on the very first sequences.  When I attempt toarchive this using Project Manager the nested sequence edits are not recognized as individual clips.  I either end up with all of the original footage or no footage.  I’m not sure how (if?) I can archive these projects in a way to eliminate all but the final file footage segments with 30 frame handles.
    Can anyone point me in the right direction or offer some advice?

    figure for $1000/terabyte drive
    Alot less than that, you can get a good Dual HD enclosure for $100 and probably less than that, and 500 Gig Drives for about $250 a piece, so assume about $600 without shopping too hard.
    I find it is alot easier to use HDs, and have a couple of copies for important projects. You can use the other items as another backup (never can have too many) and going to be easier than having to recapture, especially if there was dropped framess or timecode issues. Guess it comes down too how often do you have to go back annd re-edit a wedding DVD once it is done, and what will make your like easier when it is said and done, but if it happens, on the HD just open it up, otherwise you have to recapture the tapes which is a couple of hours at least it sounds like.
    As to archieve DVDs, who knows. There have been claims that the original CDs were to last 100 years, some of the ones I bought when they first came out started to go a few years ago. Same for some other media.

  • Find the length of a String, without using any String API

    Hi All,
    I need to write an method which will accept String obj as an argument and will return its length, but method should not have any String API.
    Please help

    Simratpal wrote:
    Hi All,
    I need to write an method which will accept String obj as an argument and will return its length, but method should not have any String API.
    Please helpWell I have strongly argued against doing this, (it seems like a pointless exercise), and I have even stated that it cannot be done, even Reflection at some level will use a String method. I have not bothered to dissect wether the same is true with JNI. However, if we take the statement of the original problem exactly as stated, particularly the
    but method should not have any String API.i.e. we don't care if a String API is used 'under the covers', just so long as there is no direct usage in the new method that is written, then the answer is trivially easy:
    public class Main
        public static void main(String args[])
            Main worker = new Main();
            String str = "123456789";
            int len = worker.strLenUsingNoExplicitStringClassMethod(str);
            System.out.println("Length of string \""+str+"\""+" is "+len);
        public int strLenUsingNoExplicitStringClassMethod(String string)
            StringBuilder sb = new StringBuilder(string);
            return sb.length();
    }

  • How do I convert a string, and use a string as a property?

    I have an array in the following format:
    {ownsCar: 'true', ownsBike: 'true', ownsHouse: 'true'}
    {ownsCar: 'false', ownsBike: 'true', ownsHouse: 'true'}
    {ownsCar: 'true', ownsBike: 'false', ownsHouse: 'true'}
    etc ............
    And I need to test against each item e.g.
    if...
    myDataGrid[myItem].ownsCar == Object(myCheckbox).label
    ... then
    if...
    myDataGrid[myItem].ownsBike == Object(myCheckbox).label
    ... then
    if...
    myDataGrid[myItem].ownsHouse == Object(myCheckbox).label
    ... then
    But I need to build my application where the property (e.g. "ownsCar", "ownsBike", "ownsHouse") is a variable such as:
    if...
    myDataGrid[myItem].myProperty == Object(myCheckbox).label
    ... then
    I would like to loop through my Array, counting the number of items, and then use each item as a property.
    How would I convert the string (e.g. "ownsCar") into a property "myProperty" ???
    Many thanks in advance
    Chris

    Thanks, but my problem is that I won't know what my property will be.
    E.g. they could be...
    {svnsdkvnsdklvnsdklv: 'true', seuAfnwfnw: 'true', asfwseionf: 'true', etc.................}
    and there could be lots of them.
    I need to have myObject[N], where N is a variable property for each of the items taken from a variable length array
    so...
    ownsCar is represented by myObject.[N]
    ownsHouse is represented by myObject.[N+1]
    ownsBike is represented by myObject.[N+2]
    etc
    (sorry, this is so difficult to explain when I dont know what the answer is)

  • Recommended steps to generate a web service using nested complex types

    Hello,
    I need to generate a web service that uses nested complex types with built in types on the bottom layer. I hve posted an attempt at a WSDL. Please give advice on if I am doing it correctly.
    I have the suspicion that I should nest the complex types into the final complex type VendorStockingInterface. Please confirm.
    <?xml version="1.0" encoding="utf-8"?>
    <definitions xmlns="http://schemas.xmlsoap.org/wsdl/"
    xmlns:conv="http://www.openuri.org/2002/04/soap/conversation/"
    xmlns:cw="http://www.openuri.org/2002/04/wsdl/conversation/"
    xmlns:http="http://schemas.xmlsoap.org/wsdl/http/"
    xmlns:jms="http://www.openuri.org/2002/04/wsdl/jms/"
    xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/"
    xmlns:s="http://www.w3.org/2001/XMLSchema"
    xmlns:s0="http://www.openuri.org/"
    xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
    xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
    targetNamespace="http://www.openuri.org/">
    <types>
    <s:schema targetNamespace="http://www.openuri.org/"
    xmlns:s="http://www.w3.org/2001/XMLSchema">
    <s:element name="RegisterServiceRequest">
    <s:complexType>
    <s:sequence>
    <s:element name="DeviceCapabilities">
    <s:complexType>
    <s:sequence>
    <s:element name="OSName" type="s:string" nillable="true"/>
         <s:element name="OSVersion" type="s:string" nillable="true"/>
         <s:element name="BRType" type="s:string" nillable="true"/>
         <s:element name="DisplayColors" type="s:string" nillable="true"/>
         <s:element name="DisplayTechnology" type="s:string" nillable="true"/>
         <s:element name="NetworkAccess" type="s:boolean" nillable="true"/>
         <s:element name="DownloadMethod" type="s:string" nillable="true"/>
         <s:element name="DownloadVersion" type="s:string" nillable="true"/>
         <s:element name="Protocols" type="s:string" nillable="true"/>
         </s:sequence>
    </s:complexType>
    </s:element>
         <s:element name="LicenseType">
    <s:complexType>
    <s:sequence>
         <s:element name="Licences" type="s:string" nillable="false"/>
    </s:sequence>
    </s:complexType>
    </s:element>
         <s:element name="PriceValue">
    <s:complexType>
    <s:sequence>
         <s:element name="Value" type="s:float" nillable="false"/>
         <s:element name="CurrencyType" type="s:string" nillable="false"/>
    </s:sequence>
    </s:complexType>
    </s:element>
         <s:element name="RevenueModelType">
    <s:complexType>
    <s:sequence>
         <s:element name="VSRP" type="RegisterServiceRequest:PriceValue" nillable="true"/>
         <s:element name="WholesalePrice" type="RegisterServiceRequest:PriceValue" nillable="true"/>
         <s:element name="VendorSplitPercentage" type="s:float" nillable="true"/>
         <s:element name="VendorPurchasePrice" type="RegisterServiceRequest:PriceValue" nillable="true"/>
         <s:element name="License" type="RegisterServiceRequest:LicenseType" nillable="false"/>
    </s:sequence>
    </s:complexType>
    </s:element>
         <s:element name="VendorItemIdentifierType">
    <s:complexType>
    <s:sequence>
         <s:element name="VendorProductDisplay" type="s:string" nillable="false"/>
         <s:element name="VendorProductVersion" type="s:string" nillable="false"/>
         <s:element name="VendorProductCode" type="s:string" nillable="false"/>
    </s:sequence>
    </s:complexType>
    </s:element>     
         <s:element name="VendorBriefType">
    <s:complexType>
    <s:sequence>
         <s:element name="VendorID" type="s:string" nillable="false"/>
    </s:sequence>
    </s:complexType>
    </s:element>     
         <s:element name="VendorItemBriefType">
    <s:complexType>
    <s:sequence>
         <s:element name="VendorProductID" type="RegisterServiceRequest:VendorItemIdentifierType" nillable="false"/>
         <s:element name="VendorID" type="RegisterServiceRequest:VendorBriefType" nillable="false"/>
         <s:element name="VendorDescription" type="s:string" nillable="true"/>
         <s:element name="VendorPricing" type="RegisterServiceRequest:RevenueModelType" nillable="false"/>
         <s:element name="DownloadURL" type="s:string" nillable="true"/>
         <s:element name="ShortCode" type="s:string" nillable="true"/>
         <s:element name="ApplicationCode" type="s:string" nillable="true"/>
         <s:element name="DRMMethod" type="s:string" nillable="true"/>
    </s:sequence>
    </s:complexType>
    </s:element>     
         <s:element name="ContentType">
    <s:complexType>
    <s:sequence>
         <s:element name="Categorization" type="s:string" nillable="false"/>
         <s:element name="MIMEType" type="s:string" nillable="true"/>
    </s:sequence>
    </s:complexType>
    </s:element>     
         <s:element name="VendorStockingInterface">
    <s:complexType>
    <s:sequence>
         <s:element name="VendorItemInfo" type="RegisterServiceRequest:VendorItemBriefType" nillable="false"/>
         <s:element name="ProductType" type="RegisterServiceRequest:ContentType" nillable="false"/>
         <s:element name="DeviceRequirements" type="RegisterServiceRequest:DeviceCapabilitiesType" nillable="true"/>
         <s:element name="VendorPricing" type="RegisterServiceRequest:RevenueModelType" nillable="false"/>
         <s:element name="ProgramMemory" type="s:int" nillable="true"/>
         <s:element name="DataMemory" type="s:int" nillable="true"/>
         <s:element name="Author" type="s:string" nillable="true"/>
         <s:element name="Language" type="s:string" nillable="true"/>
    </s:sequence>
    </s:complexType>
    </s:element>          
    <s:element name="RegisterServiceResponse">
    <s:complexType>
    <s:sequence>
    <s:element name="Message" type="s:string"/>
    </s:sequence>
    </s:complexType>
    </s:element>
    </s:sequence>
    </s:complexType>
    </s:element>
    </s:schema>
    </types>
    <message name="RegisterServiceSoapIn">
    <part name="parameters" element="s0:RegisterServiceRequest"/>
    </message>
    <message name="RegisterServiceSoapOut">
    <part name="parameters" element="s0:RegisterServiceResponse"/>
    </message>
    <portType name="RegisterServiceSoap">
    <operation name="RegisterService">
    <input message="s0:RegisterServiceSoapIn"/>
    <output message="s0:RegisterServiceSoapOut"/>
    </operation>
    </portType>
    <binding name="RegisterServiceSoap" type="s0:RegisterServiceSoap">
    <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"/>
    <operation name="RegisterService">
    <soap:operation soapAction="http://www.openuri.org/RegisterService" style="document"/>
    <input>
    <soap:body use="literal"/>
    </input>
    <output>
    <soap:body use="literal"/>
    </output>
    </operation>
    </binding>
    <service name="RegisterService">
    <port name="RegisterServiceSoap" binding="s0:RegisterServiceSoap">
    <soap:address location="http://localhost:7001/RegisterService.jws"/>
    </port>
    </service>
    </definitions>
    I'd like the the consumer of the web service to send it a document with the fields formatted to the VendorInterface complextype which contains the other complextypes. In return the consumer will get another document with some acknowledgement messages.
    To make this happen I'd like to generate the web service, creating the complex type classes and XMLBeans. I'd like advice on the steps to take once I get a good WSDL.
    There is also the option to go from the other direction. Is it better to attempt to create a schema XSD document instead and use that to work towards the web service and WSDL? If so, could someone give an example of how to format an XSD using my example needs.

    I think I have got it all in place, though I have not tested it as of yet. For others who are looking at this, here is my XSD file from which all my complextypes were generated and lastly here is the actual web service file.
    ?xml version="1.0"?>
    <xs:schema targetNamespace="http://openuri.org/RegisterService"
    xmlns:rs="http://openuri.org/RegisterService"
    xmlns:xs="http://www.w3.org/2001/XMLSchema"
    elementFormDefault="qualified"
    xmlns:tns="http://temp.openuri.org/VerizonBOBO/RegisterServiceRequestDocument.xsd">
    <xs:element name="RegisterServiceRequest" type="rs:VendorStockingInterface"/>
    <xs:complexType name="DeviceCapabilitiesType">
    <xs:sequence>
    <xs:element name="OSName" type="xs:string" nillable="true"/>
    <xs:element name="OSVersion" type="xs:string" nillable="true"/>
    <xs:element name="BRType" type="xs:string" nillable="true"/>
    <xs:element name="DisplayColors" type="xs:string" nillable="true"/>
    <xs:element name="DisplayTechnology" type="xs:string" nillable="true"/>
    <xs:element name="NetworkAccess" type="xs:boolean" nillable="true"/>
    <xs:element name="DownloadMethod" type="xs:string" nillable="true"/>
    <xs:element name="DownloadVersion" type="xs:string" nillable="true"/>
    <xs:element name="Protocols" type="xs:string" nillable="true"/>
    </xs:sequence>
    </xs:complexType>
    <xs:complexType name="LicenseType">
    <xs:sequence>     
    <xs:element name="Licences" type="xs:string" nillable="false"/>
    </xs:sequence>
    </xs:complexType>
    <xs:complexType name="PriceValue">
    <xs:sequence>
    <xs:element name="Value" type="xs:float" nillable="false"/>
    <xs:element name="CurrencyType" type="xs:string" nillable="false"/>
    </xs:sequence>
    </xs:complexType>
    <xs:complexType name="RevenueModelType">
    <xs:sequence>
    <xs:element name="VSRP" type="rs:PriceValue" nillable="true"/>
    <xs:element name="WholesalePrice" type="rs:PriceValue" nillable="true"/>
    <xs:element name="VendorSplitPercentage" type="xs:float" nillable="true"/>
    <xs:element name="VendorPurchasePrice" type="rs:PriceValue" nillable="true"/>
    <xs:element name="License" type="rs:LicenseType" nillable="false"/>
    </xs:sequence>
    </xs:complexType>
    <xs:complexType name="VendorItemIdentifierType">
    <xs:sequence>
    <xs:element name="VendorProductDisplay" type="xs:string" nillable="false"/>
    <xs:element name="VendorProductVersion" type="xs:string" nillable="false"/>
    <xs:element name="VendorProductCode" type="xs:string" nillable="false"/>
         </xs:sequence>
    </xs:complexType>
    <xs:complexType name="VendorBriefType">
    <xs:sequence>
    <xs:element name="VendorID" type="xs:string" nillable="false"/>
         </xs:sequence>
    </xs:complexType>
    <xs:complexType name="VendorItemBriefType">
    <xs:sequence>
    <xs:element name="VendorProductID" type="rs:VendorItemIdentifierType" nillable="false"/>
    <xs:element name="VendorID" type="rs:VendorBriefType" nillable="false"/>
    <xs:element name="VendorDescription" type="xs:string" nillable="true"/>
    <xs:element name="VendorPricing" type="rs:RevenueModelType" nillable="false"/>
    <xs:element name="DownloadURL" type="xs:string" nillable="true"/>
    <xs:element name="ShortCode" type="xs:string" nillable="true"/>
    <xs:element name="ApplicationCode" type="xs:string" nillable="true"/>
    <xs:element name="DRMMethod" type="xs:string" nillable="true"/>
    </xs:sequence>
    </xs:complexType>
    <xs:complexType name="ContentType">
    <xs:sequence>
    <xs:element name="Categorization" type="xs:string"/>
    <xs:element name="MIMEType" type="xs:string"/>
    </xs:sequence>
    </xs:complexType>
    <xs:complexType name="VendorStockingInterface">
    <xs:sequence>
    <xs:element name="VendorItemInfo" type="rs:VendorItemBriefType"/>
    <xs:element name="ProductType" type="rs:ContentType"/>
    <xs:element name="DeviceRequirements" type="rs:DeviceCapabilitiesType"/>
    <xs:element name="VendorPricing" type="rs:RevenueModelType"/>
    <xs:element name="ProgramMemory" type="xs:int"/>
    <xs:element name="DataMemory" type="xs:int"/>
    <xs:element name="Author" type="xs:string"/>
    <xs:element name="Language" type="xs:string"/>
    </xs:sequence>
    </xs:complexType>
    <xs:complexType name="RegisterServiceResponse">
    <xs:sequence>
    <xs:element name="Message" type="xs:string"/>
    </xs:sequence>
    </xs:complexType>
    </xs:schema>
    The Web Service File:
    import org.openuri.registerService.RegisterServiceResponse;
    import org.openuri.registerService.RegisterServiceRequestDocument;
    import com.verizon.hp.registerservice.*;
    public class RegisterService implements com.bea.jws.WebService
    static final long serialVersionUID = 1L;
    * @common:operation
    * @jws:protocol form-post="false" form-get="false"
    public org.openuri.registerService.RegisterServiceResponse RegisterService(org.openuri.registerService.RegisterServiceRequestDocument RegisterServiceDoc)
    VendorStockingInterface vsInterface = (VendorStockingInterface)RegisterServiceDoc.getRegisterServiceRequest();
    System.out.println(vsInterface.toString());
    com.verizon.hp.registerservice.RegisterServiceResponse serviceResponse = new com.verizon.hp.registerservice.RegisterServiceResponse();
    serviceResponse.setMessage("Register New Service Message has been received successfully");
    org.openuri.registerService.RegisterServiceResponse response = (org.openuri.registerService.RegisterServiceResponse)serviceResponse;
    return response;
    }

  • .SWF that used to work on Captivate 4 not working on 5!

    Hi,
    I have two .sfw files that used to work fine on Captivate 4 but won't work on Captivate 5.
    One is a pause button, and the other is a video.
    I only have the .swf files for both.
    Please help!
    Andressa

    Captivate 5 does handle certain SWF files differently to Captivate 4.  These SWF files are usually ones that use nested symbols rather than having all animation on the main timeline.  The only way to fix the issue (that I know of) is to have access to the original source files used to create the SWFs and make changes there.  Sorry.

  • String length excluding input string/character

    Long story short, I want to replicate the String Length function but to not include an input string in the character count. For example:
    The input (search) string is "the".
    My first string to test is "The big red dog."
    This would return a string length of 13.
    My second string is "Jumps over the lazy fox."
    This would return a length of 21.
    "Hello World!" would return 12.
    "The Lion The Witch And The Wardrobe" would return 26.
    Hopefully you can see what I'm trying to achieve. How is this possble?
    - James
    (I am runnnig Labview 8.5)
    Never say "Oops." Always say "Ah, interesting!"
    Solved!
    Go to Solution.

    Use the Search and Replace String to replace your "exclusion string" with an empty string.  Use the String Length on the resulting string.  Make sure the Relace All is set to TRUE.
    There are only two ways to tell somebody thanks: Kudos and Marked Solutions
    Unofficial Forum Rules and Guidelines
    Attachments:
    String Length.png ‏11 KB

  • Parse  a XML that is inside  a String Object???

    Hi,
    Will I be able to parse a XML that is stored as a String object rather than using a .XML file.Or is there any other way I would be able to access a XML that comes as a parameter to a method call??
    ~~~~~~~~~~~~~~~~~~~~~
    Java Code:
    public void notify(org.oasisOpen.docs.wsn.x2004.x06.wsnWSBaseNotification12Draft01.NotifyDocument notifyDocument){
    //notifyDocument is a XML Response
              System.out.println("I am from notify" );
              System.out.println(notifyDocument.toString() );
              String notifyString = notifyDocument.toString();
              String s2="<?xml version=\"1.0\" encoding=\"UTF-8\"?>";
              String s3=s2+' '+notifyString;//Want to parse this XML
              System.out.println("******************notifyString"+notifyString);
              System.out.println("******************s2"+s2);
              System.out.println("******************notifyString+S2"+s3);
              //Parse the String S3 which contains a well formed XML(I Checked it)
    try{
              DocumentBuilderFactory dbf =    DocumentBuilderFactory.newInstance();
              DocumentBuilder db = dbf.newDocumentBuilder();
              Document document = db.parse(s3);
    System.out.println("************** After Parsing **********");
            NodeList count = document.getElementsByTagName("wsrf:NewValue");
              int number= count.getLength();
              System.out.println("**********"+number);
              Element f=(Element)count.item(0);
            //NodeList count1= f.getChildNodes();
            NodeList comment=f.getElementsByTagName("safe:Comment");
            int num=comment.getLength();
            System.out.println("******** Len 2********"+num);
            Element f1=(Element)comment.item(0);
              Node n=f1.getFirstChild();
              if(n != null)
              System.out.println("***********8HEllo**********8");
              String s = n.getNodeValue();
              System.out.println("***********"+ s);
              catch(Exception e){
                   System.out.println("*****Exception**********"+e);
       }~~~~~~~~~~~~~~~~~~~~~~~~~`
    Result::
    *****Exception**********java.net.MalformedURLException: no protocol <?xml versi
    on="1.0" encoding="UTF-8"?> <wsn:Notify xmlns:wsn="http://docs.oasis-open.org/ws
    n/2004/06/wsn-WS-BaseNotification-1.2-draft-01.xsd" xmlns:soapenv="http://schema
    s.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns
    :xsi="http://www.w3.org/2001/XMLSchema-instance">
    <wsn:NotificationMessage>
    <wsn:Topic Dialect="http://docs.oasis-open.org/wsn/2004/06/TopicExpression/S
    imple" xmlns:safe="http://ws.apache.org/resource/serena/safe">safe:Comment</wsn:
    Topic>
    <wsn:ProducerReference>
    <add:Address xmlns:add="http://schemas.xmlsoap.org/ws/2003/03/addressing">
    http://10.236.23.86:8080/pubscribe/services/serenasafe</add:Address>
    <add:ReferenceProperties xmlns:add="http://schemas.xmlsoap.org/ws/2003/03/
    addressing">
    <safe:ResourceIdentifier xmlns:safe="http://ws.apache.org/resource/seren
    a/safe">ALF1</safe:ResourceIdentifier>
    </add:ReferenceProperties>
    <add:PortType xmlns:safe="http://ws.apache.org/resource/serena/safe" xmlns
    :add="http://schemas.xmlsoap.org/ws/2003/03/addressing">safe:MySerenaSafePortTyp
    e</add:PortType>
    <add:ServiceName PortName="serenasafe" xmlns:add="http://schemas.xmlsoap.o
    rg/ws/2003/03/addressing"/>
    </wsn:ProducerReference>
    <wsn:Message>
    <wsrf:ResourcePropertyValueChangeNotification xmlns:wsrf="http://docs.oasi
    s-open.org/wsrf/2004/06/wsrf-WS-ResourceProperties-1.2-draft-01.xsd">
    <wsrf:OldValue>
    <safe:Comment xmlns:safe="http://ws.apache.org/resource/serena/safe">c
    omment</safe:Comment>
    </wsrf:OldValue>
    <wsrf:NewValue>
    <safe:Comment xmlns:safe="http://ws.apache.org/resource/serena/safe">Q
    uick test!</safe:Comment>
    </wsrf:NewValue>
    </wsrf:ResourcePropertyValueChangeNotification>
    </wsn:Message>
    </wsn:NotificationMessage>
    </wsn:Notify>

    Submitting a string is the equivalent of telling the document builder to fetch the XML from a given URI. If you already have the string in memory:
    DocumentBuilder db = null;  // initialize in a spiffy way
    Document document = db.parse(new StreamSource(new ByteArrayInputStream(xml.getBytes()));- Saish

  • Function that returns N values, without using a string

    Hi, how can i make a function that returns several valures (that hasn't a exact number of returned values, it could return 3 values, or 7) without using a string?
    When i need to return several values from a function, i put the values inside a varchar like thus 'XXX,YYY,ZZZ' and so on. Don't know if this has a poor performance.
    If you can supply simple examples for what im asking, i would be nice.
    (without using a string)

    Can i create the type objects inside a package? If i
    can, they will be local to the package, right?Yes, you're right.
    Pipeline returns a row or several?You can use pipelined function in the same way you use table:
    SELECT * FROM TABLE(pipelined_funct(agr1, agr2));
    It returns results as separate rows.

  • I never used LabView but need to generate a RS-233 serial output string that contains an IRIG timestamp based on a contact closure. Is LabView an appropriate tool to do this? How much does it cost to get started with the product?

    I never used LabView but need to generate a RS-233 serial output string that contains an IRIG timestamp based on a contact closure. Is LabView an appropriate tool to do this? How much does it cost to get started with the product?

    Labview isn't cheap, but it would certainly allow you to build a program (set of vi's - virtual instruments) that would do what you describe. Where would the timecode information come from? Your vi, or program, would: Start up, initialize the serial port, loop until a trigger happened, read the timecode (from where?), output that timecode out the serial port in a loop until you pressed the stop button. There is a free evaluation of Labview software available from NI - the base product itself runs about $995.
    - Dave

  • Drag UserControl that uses Linq To Entities onto Windows Form, No Connection String named '' could be found in application config file

    I have created a Visual Studio 2013 Solution with two projects: A Windows Forms project and a Class Library project. In the Class Library project I have added an entity framework, resulting in an .edmx file and an app.config file. I have copied the app.config
    file to the Windows Forms project and added a reference to EntityFramework.dll and a reference to the Class Library.
    When there is no code in the user control, I can drag the user control onto the main windows form with no error. However, if I use Linq to Entities in my user control and then try to drag it onto my form, I get an error. 
    Code in User Control that causes error:
    adminentities = new ClassLibrary1.AdminEntities();
    var res = from pay in adminentities.PayrollSchedules.Where(x=>x.FiscalYear == 2015) select pay;
    The error is:
    Failed to create component 'NavigationUserControl'...'No connection string named 'AdminEntities' could be found in the application config file.'
    There IS an app.config file in the windows form project with a connection string named 'AdminEntities'. I have also tried a few suggestions I found: 1) Changed * in the connection string to use the namespace of the class library and 2) replaced &quot;
    with a single quote. Neither of these changes fixed the issue.
    How can I resolve this? Thank you.

    Hi RLuther,
    >> Failed to create component 'NavigationUserControl'...'No connection string named 'AdminEntities' could be found in the application config file.'
    Based on the error message, this issue would be related to the data platform, I suggest you post this issue to the
    ADO.NET Entity Framework and LINQ to Entities forum for dedicated support.
    The forum link:
    https://social.msdn.microsoft.com/Forums/en-US/home?forum=adodotnetentityframework
    Best Regards,
    Jack
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Problem with web service that returns an object with a String that have som

    Hi everybody:
    I have a problem with a web service I am doing, I have made a web service that returns a collection of objects, the objects have a set of properties, there is one property that is a String,this property consists in a text fragment that could have some characters that are considered special in XML like &, <, >, " and that's why when I execute the service from a client an exception is thrown:
    {code}
    Exception in thread "main" org.codehaus.xfire.XFireRuntimeException: Could not invoke service.. Nested exception is org.codehaus.xfire.fault.XFireFault: Could not read XML stream.. Nested exception is com.ctc.wstx.exc.WstxParsingException: Expected a text token, got START_ELEMENT.
    at [row,col {unknown-source}]: [9,646]
    org.codehaus.xfire.fault.XFireFault: Could not read XML stream.. Nested exception is com.ctc.wstx.exc.WstxParsingException: Expected a text token, got START_ELEMENT.
    at [row,col {unknown-source}]: [9,646]
    at org.codehaus.xfire.fault.XFireFault.createFault(XFireFault.java:89)
    at org.codehaus.xfire.client.Client.onReceive(Client.java:410)
    at org.codehaus.xfire.transport.http.HttpChannel.sendViaClient(HttpChannel.java:139)
    at org.codehaus.xfire.transport.http.HttpChannel.send(HttpChannel.java:48)
    at org.codehaus.xfire.handler.OutMessageSender.invoke(OutMessageSender.java:26)
    at org.codehaus.xfire.handler.HandlerPipeline.invoke(HandlerPipeline.java:131)
    at org.codehaus.xfire.client.Invocation.invoke(Invocation.java:79)
    at org.codehaus.xfire.client.Invocation.invoke(Invocation.java:114)
    at org.codehaus.xfire.client.Client.invoke(Client.java:336)
    at org.codehaus.xfire.client.XFireProxy.handleRequest(XFireProxy.java:77)
    at org.codehaus.xfire.client.XFireProxy.invoke(XFireProxy.java:57)
    at $Proxy0.search(Unknown Source)
    at cu.co.cenatav.webservices.client.Client.main(Client.java:26)
    {code}
    I know that this is happening because special characters are sent by the soap message but I don't know how to solve this problem.
    How could I avoid this exception ?
    I hope you can help me.
    Regards.
    Ariel

    Hi,
    BPEL and BPEL PM do not have a good support for SOAPENC-Array: it would be very difficult to create such an array in BPEL or to receive it and manipulate it.
    The (unfortunately very intrusive) work around is to change the WSDL of the service to use a XML type defined using XML schema. This is all the more painful that JDev 9.0.4 does not have strong support for complex types.
    In general though, I would highly recommend this best practice:
    1) Start by define the WSDL contract first
    2) Then generate the server side skeleton to implement it
    3) Use BPEL as the client to this contract.
    By starting with the contract first, you make sure that 1) your interfaces are clean and coarse grained.
    2) things like java objects, sessions, etc to not leak through the interface (which would be the worst thing that could happen because it would closely link the client and the server.
    Sorry for not being more helpful. This will get radically cleaner in Oracle AS 10.1.3.
    Edwin

  • Best way to look for next char in String that is NOT "-" or " " or ","?

    I have a long String that is sent to me and needs to be parsed. Normally I can figure the end of the line by a line break, but sometimes the line break is lost only after the second line. This second line contains the characters:
    These characters can all appear any number of times. I will know I'm at the end of the line when I hit a character that is not one of those three. What is the best way to look for this? Is there an already set method in the Java API?
    Thanks for all the help!

    There are solutions using regular expression, eg; you can split string once a time using minus char, whitespace or comma:
    String tokens[] = anyString.split("\\-|\\x20|,");
    More sophisticated expressions could be done to achieve results:
    String re = "^(.+)(\\-|\\x20|,)(.)(.*)$";
    Matcher m = Pattern.compile(re).matcher(anyString);
    if (m.matches()) {
    String
    before = m.group(1),
    delimiter = m.group(2),
    firstCharAfterDelimiter = m.group(3),
    suffix = m.group(4);
    Regards.

  • Error accesing/using a String object.......

    Hi again folks!
    Well now I have other problem, I don?t know what's happening, but I have simple C++ program as shared object which retrieves information from a Database, with the query results it makes a single string with all the data retrieved.
    This C++ program is called by a Java program using JNI, but when my Java program receives the string and tries to parse it with the StringTokenizer object I get an error like this:
    SIGSEGV 11* segmentation violation
    si_signo [11]: SIGSEGV 11* segmentation violation
    si_errno [0]: Error 0
    si_code [1]: SEGV_ACCERR [addr: 0x45cb2448]
    stackbase=DFFFF0A0, stackpointer=DFFFD0CC
    Full thread dump:
    "SIGQUIT handler" (TID:0xdd300190, sys_thread_t:0x42020, state:R, thread_t:
    t@5, sp:0x0 threadID:0xdeaf0dd8, stack_base:0xdeaf0d6c, stack_size:0x20000) prio
    =0
    "Finalizer thread" (TID:0xdd3000d0, sys_thread_t:0x41fb8, state:CW, thread_t
    : t@4, sp:0x0 threadID:0xdebb0dd8, stack_base:0xdebb0d6c, stack_size:0x20000) pr
    io=1
    "main" (TID:0xdd3000a8, sys_thread_t:0x42908, state:R, thread_t: t@1, sp:0x0
    threadID:0x20a18, stack_base:0xdffff0a0, stack_size:0x800000) prio=5 *current t
    hread*
    ObjectFactory.createObject(Compiled Code)
    Test.main(Compiled Code)
    Registered Monitor Dump:
    PCMap lock: <unowned>
    Thread queue lock: <unowned>
    Name and type hash table lock: <unowned>
    String intern lock: <unowned>
    JNI pinning lock: <unowned>
    JNI global reference lock: <unowned>
    BinClass lock: <unowned>
    Class loading lock: owner "main" (0x42908, 1 entry)
    Java stack lock: <unowned>
    Code rewrite lock: <unowned>
    Heap lock: <unowned>
    Has finalization queue lock: <unowned>
    Finalize me queue lock: <unowned>
    Waiting to be notified:
    "Finalizer thread"
    Monitor cache expansion lock: <unowned>
    Monitor registry: owner "main" (0x42908, 1 entry)
    Abort (core dumped)
    I dont know if I have to do something special before use the String, what's happening?
    Any comment will be welcome.
    Thanks in advance.

    I hope this could help to clarify the scenario
    In a previous query I get the number of rows returned by the next query
    this number is stored at SQL_NUM_SEGS.arr variable. When I have the number of rows I reserve memory for the char array that I'm going to return with all the information.
    AC01_TRAMA=(char *)malloc(atol(SQL_NUM_SEGS.arr) * INT02_TAM_SEG);
    /*embedded PL/SQL code*/
    EXEC SQL DECLARE CUR_EMISORA CURSOR FOR
    SELECT rtrim(to_char(NUM_EMISORA)) || '|' || rtrim(SERIE) || '|' || EMISORA || '|' || STATUS FROM NUCL_EMISORA WHERE STATUS NOT LIKE 'BAJA';
    EXEC SQL OPEN CUR_EMISORA;
    The next lines of code generate a string like this:
    "UTIL0000|366|239|93-1|FINASA |VIGE|243|3-90|BONSER |VIGE|248|2-94|BONSER |VIGE|287|970403|GOBFED |VIGE|362|93-4|BANOBRA |VIGE|404|2-90|BONSER |VIGE|407|2-95|FINASA |VIGE|633|95|BANMEXI |VIGE|641|2-94|PROMEX |VIGE|645|1-95|FINASA |VIGE|647|1-96|FINASA |VIGE|660|92|BANORTE |VIGE|677|93-3|BANOBRA |VIGE|678|1-90|BIATLAN |VIGE|736|2-95|BONSER |VIGE|786|1-94|BNCI |VIGE|1007|021024|GOBFED |VIGE|1008|021121|GOBFED |VIGE|"
    this string is assigned to AC01_TRAMA(char pointer)and then I return this string in the next way:
    return ( (env)->NewStringUTF(AC01_TRAMA) );
    My java program is this:
    public class Monitor
    public native String consultaGeneral();
    static
    System.load("/afs/invermexico.com.mx/usr2/salponce/gustavo/jni/src_db/Monitor.so");
    public String getTrama()
         String strTrama=consultaGeneral();
    return strTrama;
    public static void main(String []args)
    String strEmisora, strNumEmisora, strStatus,strSerie;
    Monitor m=new Monitor();
    System.out.println(m.getTrama());
    /*java.util.StringTokenizer STk = new java.util.StringTokenizer(m.getTrama(),"|");
    while(objSTk.hasMoreTokens())     
    strEmisora = objSTk.nextToken();
    strNumEmisora = objSTk.nextToken();
    strStatus = objSTk.nextToken();
    strSerie = objSTk.nextToken();
    System.out.println("\n<------>\n"+ strEmisora+"\n"+strNumEmisora+"\n"+strStatus+"\n"+strSerie);
    }//while
    Well, this java program works fine but if I try to create an String tokenizer with it the program crashes, even if I assign the result into a new String object.
    I'm going to put all the code rigth here
    C++ program
    #include "ast_bd.h"
    #include "Monitor.h"
    #include <stdlib.h>
    #include <stdio.h>
    #include <strings.h>
    #include <jni.h>
    #define CHA01_NOMBRE_APP "UTIL0000"
    #define CHA02_FIN_DE_SEG "|"
    #define INT01_TAM_LONG 20
    #define INT02_TAM_SEG 52 /*52 BYTES; Tama�o de los 4 datos en conjunto*/
    Prop�sito :-Determinar cuales son las emisoras con estado de vigente
    o bloqueado.
    -Obtener los datos de una emisora espec�fica.
    -Actualizar los datos de una emisora espec�fica.
    JNIEXPORT jstring JNICALL Java_Monitor_consultaGeneral
    (JNIEnv *env, jobject obj)
    long LO01_STATUS=1;
    char CH01_NUM_SEGS[INT01_TAM_LONG];
    char AC01_TRAMA, AC02_SEG;
    EXEC SQL BEGIN DECLARE SECTION;
    VARCHAR SQL_NUM_SEGS[INT01_TAM_LONG],
    SQL_RESULT[INT02_TAM_SEG];
    EXEC SQL END DECLARE SECTION;
    EXEC SQL WHENEVER SQLERROR CONTINUE;
    open_db();
    EXEC SQL SELECT to_char(COUNT(1)) INTO:SQL_NUM_SEGS FROM NUCL_EMISORA WHERE STATUS NOT LIKE 'BAJA';
    LO01_STATUS = sqlca.sqlcode;
    if( !LO01_STATUS ) /*si todo sali� bien*/
    strcpy(CH01_NUM_SEGS,SQL_NUM_SEGS.arr);
    CH01_NUM_SEGS[SQL_NUM_SEGS.len]='\0';
    AC01_TRAMA=(char *)malloc(atol(SQL_NUM_SEGS.arr) * INT02_TAM_SEG);
    sprintf(AC01_TRAMA,"%s|%s|\0", CHA01_NOMBRE_APP, CH01_NUM_SEGS);
    EXEC SQL DECLARE CUR_EMISORA CURSOR FOR
    SELECT rtrim(to_char(NUM_EMISORA)) || '|' || rtrim(SERIE) || '|' || EMISORA || '|' || STATUS FROM NUCL_EMISORA WHERE STATUS NOT LIKE 'BAJA';
    EXEC SQL OPEN CUR_EMISORA;
    LO01_STATUS = sqlca.sqlcode;
    if( !LO01_STATUS ) /*si todo sali� bien*/
    do
    EXEC SQL FETCH CUR_EMISORA INTO :SQL_RESULT;
    LO01_STATUS = sqlca.sqlcode;/*Recuperamos el estado de la operacion fetch*/
    if( !LO01_STATUS )
    AC02_SEG=(char *)malloc(SQL_RESULT.len);
    strcpy(AC02_SEG,SQL_RESULT.arr);
    AC02_SEG[SQL_RESULT.len]='\0';
    strcat(AC01_TRAMA,AC02_SEG);
    strcat(AC01_TRAMA,CHA02_FIN_DE_SEG);
    }/*if fetch correcto*/
    else
    LO01_STATUS=1;
    }while(!LO01_STATUS);
    EXEC SQL CLOSE CUR_EMISORA;/*Cerramos el cursor*/
    Si no se recuperaron registros, se indicara en el numero de segmentos
    al inicio de la trama.
    }/*if open cursor*/
    }/*if conteo*/
    puts(AC01_TRAMA);
    return ( (env)->NewStringUTF(AC01_TRAMA) );
    }/*consulta_general*/
    Java programs
    public class Monitor
    public native String consultaGeneral();
    static
    System.load("/afs/invermexico.com.mx/usr2/salponce/gustavo/jni/src_db/Monitor.so");
    public String getTrama()
         String strTrama=consultaGeneral();
    return strTrama;
    public static void main(String []args)
    String strEmisora, strNumEmisora, strStatus,strSerie;
    Monitor m=new Monitor();
    System.out.println(m.getTrama());
    /*java.util.StringTokenizer STk = new java.util.StringTokenizer(m.getTrama(),"|");
    while(objSTk.hasMoreTokens())     
    strEmisora = objSTk.nextToken();
    strNumEmisora = objSTk.nextToken();
    strStatus = objSTk.nextToken();
    strSerie = objSTk.nextToken();
    System.out.println("\n<------>\n"+ strEmisora+"\n"+strNumEmisora+"\n"+strStatus+"\n"+strSerie);
    }//while
    Thank's

  • Using Colored Strings

    Well, we want to use colored strings for our network application (client-server).
    Now, the server should send colored strings to the client, which should display them onto the screen.
    The old way we have been doing this is using "color codes" and parsing the strings when printing them.
    For example, a colored string could look something like:
    &x100100100This is a colored string!&n
    the &x100100100 means that the text after it should use RGB value of 100,100,100. &n meant that the colors should stop and return to default.
    Well... this makes the client need to parse strings and set colors etc, the color codes are also fairly long, and used alot, making strings very long if they have much color.
    What im wondering about is if we should use something like AttributedString to represent the colored strings? And let the server send the attributed string over the net instead of just a normal string. The client could just print it out then, without any parsing...
    Also, would it take more bandwidth to send an attributed string with same colors, as a string using these color codes?
    Thanks for answers.

    We are currently using AtrributedStrings and TextLayout to produce the colored text.
    The text uses the color codes in normal strings and is sent to the client, where it parses the string and creates an AttributedString from it, and prints it to the screen.
    My original question was wether it perhaps would be better to send an AttributedString directly over the net, instead of the normal string, and skip all the parsing on the client side and directly print out the received AttributedString.
    However, i tried writing two strings to a file using ObjectOutputStream that would represent the exact same string and colors. One with our usual color codes (which took up 1 kb) and one using AttributedString (which took up 62 kb).
    I guess sending attributed strings rather than normal strings containg color codes to be parsed, would eat up way more bandwith...
    We will probobly use our old system, and let the client parse the string, which is fast compared to sending extra data over the Internet.

Maybe you are looking for

  • Assignment of Target Cube Currency Field to ?

    All, I have a new datasource with an amount field and I am trying to create a transformation to the cube.  However the cube requires a mapping for the amount field with a currency key.  Problem is I don't have a currency key field to map to. I have t

  • Mail usability issue -- message list positioning

    I'm loving the iPad, but noticed a slight usability issue while reading my email today. Would be great if Apple would consider changing it in future updates. Whenever I open the mail app, the right pane shows the most recent message I had open last t

  • Files creation time on digital camera's SD is now offset with timezone

    Been checking out the photos I've took with a digital camera by taking the SD card and mounting it in current (all up to date) Arch. It was weird to see that the latest photos are shown as being in the future. Basically the camera don't know about ti

  • Project Plan - BO installation and migration

    Hi We currently have BO XI R2 running on a server as our "Dev" environment. We are planning to install BO XI R2 on another machine and make that as the "Production" Server. After the machine setup and installation, we will migrate the current reposit

  • Sony HVR-V1U

    Does anyone know how to adjust for shooting in poorly lit rooms with this camera? Thanks.