String (int_myInt) & int_myInt.toString)

Are they the same?

String (int_myInt);

and

int_myInt.ToString ();

Which one should I use to optimize the coding?

-Zainuu

they do the same thing but casting a string is much faster:

String (Integer)

Tags: Adobe Animate

Similar Questions

  • Fill out the strings of QSettings to ArrayDataModel

    Hello

    I want to read several QSettings strings and then fill in an ArrayDataModel.

    So with this code, I've saved several channels in QSettings:

    void ApplicationUI::saveDataInQSettings(QList filepath) {    QSettings settings;
        settings.beginWriteArray("filepaths");
        for (int i = 0; i < filepath.size(); ++i) {
            settings.setArrayIndex(i);
            settings.setValue("filepath", filepath.at(i));
        }
        settings.endArray();
    }
    

    Now, I want to recover the QSettings channels as follows. I have a C++ function that fills the QSettings strings in a QList:

    QList ApplicationUI::fillQSettingsInQList() {
        QList filepaths;
    
        QSettings settings;
        int size = settings.beginReadArray("filepaths");
        for (int i = 0; i < size; ++i) {
            settings.setArrayIndex(i);
            QString filepath;
            filepath = settings.value("filepath").toString();
            filepaths.append(filepath);
        }
        settings.endArray();
        return filepaths;
    }
    

    In my main.qml, I have a NavigationPane containing a container in which the ArrayDataModel is displayed.

    I put the fillQSettingsInQList () - method in onCreationCompleted then I have the TI in QML when the application is open:

    [...]NavigationPane {
        id: navigationPane
    
        onCreationCompleted: {
            Qt.app = app;
    
            var filepaths = app.fillQSettingsInQList();
        }
    

    But how can I now fill this strings in the ArrayDataModel?

    Thanks for the replies. I have not used the track with a list of the QStrings. It is now much simpler.

    I saved the ArrayDataModel strings in the QSettings in this way. First of all, I saved the channels how I'll put in the QSettings and different channels:

    void ApplicationUI::saveDataModelInQSettings(bb::cascades::ArrayDataModel* model) {
        QSettings settings;
        settings.setValue("size", model->size());
        for (int i = 0; i < model->size(); i++) {
            QVariantMap map = model->value(i).toMap();
            settings.setValue("string_" + QString::number(i), map.value("string"));
        }
    }
    

    And completely action to get the information back to the ArrayDataModel of the QSettings:

    void ApplicationUI::fillQSettingsInDataModel(bb::cascades::ArrayDataModel* model) {
        QSettings settings;
        int size = settings.value("size", 0).toInt();
        for (int i = 0; i < size; i++) {
            QString filepath = settings.value("string_" + QString::number(i), "String not found").toString();
            model->append(filepath);
        }
    }
    
  • Get date friendly String

    Hi all

    I try to get Sunday, August 15, 2010-08 - 15. I divided the date and everything works without error when I call myDate.toString (); It does not give the desired result.

    Calendar calendar = Calendar.GetInstance ();
    Calendar.Set (Calendar.DAY_OF_MONTH, Integer.parseInt(second[2]));
    Calendar.Set (Calendar.MONTH, Integer.parseInt(second[1]));
    Calendar.Set (Calendar.YEAR, Integer.parseInt(second[0]));

    Date myDate = calendar.getTime ();

    Can someone tell me what I need to do next to get Sunday, August 15?

    Thank you

    Alex

    Try this,

    This code gives u what you want

            Date date = new Date();
            date.setTime(System.currentTimeMillis());
            String str=date.toString());
    

    -------------------------------------------------------------------------------------------------------

    Press Button Kudoes to say thanks to your help, if got the answer and the press also accept as a Solution button.

  • How to create an XML Document and convert it into a string? (send through wireless network)

    Hello

    I am now able to post data to a web server by using Blackberry JDE (medical use).

    Now, instead of display the plain text, I would like to send an XML file.

    I am able to do it using this code on a 'normal ': Java application

    import java. IO;
    Org.w3c.dom import. *;
    Import javax.xml.parsers. *;
    Javax.xml.transform import. *;
    Javax.xml.transform.dom import. *;
    Javax.xml.transform.stream import. *;

    public class {XML
    Public Shared Sub main (String [] args) {}
    try {}
    DocumentBuilderFactory plant = DocumentBuilderFactory.newInstance ();
    DocumentBuilder builder = factory.newDocumentBuilder ();
    Doc document = builder.newDocument ();
               
    Root element = doc.createElement ("root");
    doc.appendChild (root);
               
    Child element = doc.createElement ("child");
    child.setAttribute ("name", "value");
    root.appendChild (child);

    Add a text element to the child
    Text = doc.createTextNode ("text");
    child.appendChild (text);

    implement a transformer
    TRANSFAC TransformerFactory = TransformerFactory.newInstance ();
    Transformer trans = transfac.newTransformer ();
    trans.setOutputProperty (OutputKeys.OMIT_XML_DECLARATION, 'yes');
    trans.setOutputProperty (OutputKeys.INDENT, 'yes');

    create the string of the xml tree
    StringWriter sw = new StringWriter();
    StreamResult result = new StreamResult (sw);
    DOMSource source = new DOMSource (doc);
    TRANS. Transform (source, result);
    String xmlString = sw.toString ();
    System.out.println (xmlString);
    } catch (Exception e) {}
    make error management
    }
    }
    }

    However, on the Blackberry JDE, many functions is not recognized.

    I saw the class DocumentBuilderFactory (net.rim.device.api.xml.parsers.DocumentBuilderFactory), the DocumentBuilder (net.rim.device.api.xml.parsers.DocumentBuilder) class and the interface of Document in the docs of Blackberry Java (4.2.1).

    So, I'm able to create an XML Document... but I don't know how to convert to a string?

    How can I do this? The TransformerFactory class doesn't seem to exist... and I did not find an alternative yet.

    At the present time, here is the code I use to publish data:

    String coord = lat + ";" + LNG; post data
    con = (HttpConnection) Connector.open (url); Open the connection URL
    con.setRequestMethod (HttpConnection.POST); POST method
    con.setRequestProperty ("Content-Type", "application/x-www-formulaires-urlencoded");
    out = con.openOutputStream (); display the results in a stream
    out. Write (Coord.GetBytes ());

    responseCode = con.getResponseCode (); Send data and receive the response code
    If (responseCode! = HttpConnection.HTTP_OK) {}
    System.out.println ("HTTP STATUS CODE: 404"); error
    } else {}
    System.out.println ("HTTP STATUS CODE: 200"); successful
    }
    If (con! = null) con. Close; close the connection to the URL

    As mentioned, rather than display a string with a delimiter between each value (there will be a lot more than two values finally), I would like to publish an XML.  It will be more "elegant" and easier to parse by my code on the web server.

    Maybe I don't have to convert it to a string?

    In other words, how can I convert my XML Document to send it via the wireless network?

    Thanks for your help!

    TransformerFactory does not exist in the BlackBerry API.  As far as I can tell, you need to implement yourself.  You can do this by walking the DOM and the output of channels.  They have an example of the market of the DOM in the XMLDemo, but they view as fields, you just need to write strings.

  • How can I get the contents of an object of Document (XMLDOM) in a string variable?

    Hello

    I created an XML document by using the Document and XMLElement classes and now I need to get the XML object and a string variable, so I can send by e-mail.

    I'm on 4.5 JDE

    Help!

    Hello

    Unlike some other posts, there is a solution.

    Document myDocument = pdocXMLDocument;  / * This is the document that you created that you want to convert to a string

    ByteArrayOutputStream OS = new ByteArrayOutputStream(); / * where you want the XML to go * /;
    XMLWriter writer = new XMLWriter (os);

    configure as you want using one or more of:
    writer.setPrettyPrint (); or setPrintCompressedOutput();
    writer.setPrintCompressedOutput ();
    writer.setPreserveSpacing ();
    writer.setExpandingEntities (boolean);
    writer.setEntityResolver (EntityResolver);
    try {}
    DOMInternalRepresentation.parse (pdocXMLDocument, writer);
    String myXML = os.toString ();        THIS IS THE STRING
    }
    catch (Exception ex) {}
    }

  • How do I convert JAXBElement &lt; byte [] &gt; string or readable format

    Hi Experts,

    I work on the web service proxy and I want to retrieve data from JAXBElement < byte [] > data type and add data to the table. I have tried with...

    Note_c1 JAXBElement < byte [] > = ((RequestEntryC) optyBind) .getNoteC ();

    String Note_c = Arrays.toString (Note_c1.getValue ());

    But it returns [115, 117, 105, 116, 101, 32, 118, 105] , and [B@27e80064 if I try with Note_c1.getValue () ]


    I'm on Jdeveloper 11.1.1.7.1



    User, you bet a byte of the Note_c1 array. You can convert this string as

    String s = new String (Note_c1.getValue ());

    However it is not guaranteed that you can read the string. Only if the bytes represent characters ASCII or UTF-8 you can read.

    Timo

  • How to convert string input streams

    Can someone tell me how to convert string input streams...

    There are multiple ways. I will list down few of them.

    With the help of the old solution and standard java.

    publicstaticString fromStream(InputStream in)throwsIOException

    {

       BufferedReader reader =newBufferedReader(newInputStreamReader(in));

       StringBuilder out =newStringBuilder();

       String line;

       while((line = reader.readLine()) !=null) {

           out.append(line);

       }

       returnout.toString();

    }

    returnsb.toString();

    If you use Google-Collections/guava-

    InputStream stream = ...

    String content = CharStreams.toString(newInputStreamReader(stream, Charsets.UTF_8));

    Closeables.closeQuietly(stream);

    If you use the common Apache library... then it is worthwhile.

    StringWriter writer =newStringWriter();

    IOUtils.copy(inputStream, writer, encoding);

    String theString = writer.toString();

    Quick way but only work during deserialization.

    String result = (String)newObjectInputStream( inputStream ).readObject();

    Note: ObjectInputStream is on deserialization and the flow of data must respect the Protocol of serialization to work, which may not always true in all cases.

    Ultimately, the most effective solution and only in two lines using java class Scanner.

    Tricky is to remember the \A regex that matches the beginning of the entry. It actually indicates Scanner to mark all of the flow, from start to beginning next (illogical).

    publicstaticString convertToString(InputStream in) {

       java.util.Scanner s =newjava.util.Scanner(in).useDelimiter("\\A"); 

           

       returns.hasNext() ? s.next() :"";

    }

    Read more: http://www.techartifact.com/blogs/2013/11/how-to-readconvert-an-inputstream-to-a-string.html#ixzz2lvy5muix

  • To print the new reading of the database string line

    Hi all

    I am facing a weired problem, when I write below the code that it is printing online new:
     StringBuffer sb = new StringBuffer(1024);
               sb.append("Hello, \n new line ");
               System.out.println(" The String is : "+sb.toString());
    If I'm reading the same data from database (database CharacterSet is ASCIITHAI) and by adding the string to the StringBuffer
    It is printing like below one:

    Hello, new line \n.

    you want to understand why it does not '\n' as a new line reading database string.

    Put a newline character in the database. A \n is not a newline character, except for the Java compiler (java.util.Properties).

  • How can I use the sequence of the string "\u00e5" in myfile.txt converted unic

    How can I use the sequence of the string "\u00e5" in myfile.txt converted to unicode in my application?

    I have a text file, MyFile.txt, with some sequences represented unicode:
    \u00e5
    \u00e4
    \u00f6
    etc.

    This is the file contains unicode, not the character it represents: a, a and o.
    I get the sequence of the file and save it to a vector. When I tried to use it on a JButton, I see the "\u00e5" string and not the character that I assumed.

     
            read file codes ...
            ...
         Vector<String> glyphVector = readGlyphIndex.getUnicodeFiles();     // to retrieve the vector with unicode sequence and save it to glyphVector
         String unicode = glyphVector.get(0);     //get the first unicode sequence
            System.out.println(unicode);    //displays \u00e5 and not å in the console.
         jButton.setText(unicode);   //jButton is a JButton and it shows the string \00e5 and not the character å
            ...
    The question is how to convert the sequence of string to be a unicode escape in the code?

    In order to make it clear:
    //from
    jButton.setText("\\u00e5");
    //to
    jButton.setText("\u00e5");
    Thanks in advance!

    Dragonfly
    String s = Character.toString((char) unicodeInInt);
    

    Strictly speaking, if unicodeInInt is a Unicode code point (for example, it can be greater than 0xFFFF) then the correct code would be this:

    String s = new String(Character.toChars(unicodeInInt));
    

    However, since the "\u" notation allows only 4 hexadecimal digits (and need to 0xFFFF code points > Unicode represented by their UTF-16 encoding), the code above is not enough for this particular case.

  • 1067: coercion of a value of type String to a type unrelated with

    Hello

    I created a Web service that is based on sql server 2005 with several methods with success.

    I have a headach now just trying to make a few simple tests with Flex :-(

    I used the "import Web service", he created some code "generated Web services."

    My test p_SEARCH_NAME_SOUNDEX method is based on a decision of wich procedure sql varchar (128) as a parameter = > NAL_NOM.

    I'm just trying to debug this function (error on line in red)

    service public searchEntry(name:String):void
    {
    Save the event listener for the findEntry operation.
    agenda.addfindEntryEventListener (handleSearchResult);
    myWS.addp_SEARCH_NAME_SOUNDEXEventListener (handleSearchResult);

    Call the operation if we have a valid name.
    If (name! = null & & name.length > 0)

    myWS.p_SEARCH_NAME_SOUNDEX (name);

    }

    I got this error message:

    067: constraint implied to a value of type String to type without generated report. Web services: NAL_NOM_type1.

    FLEX has creaetd a type called NAL_NOM_type1 for my class:

    /**
    * NAL_NOM_type1.as
    * This file was automatically generated from WSDL by the Apache Axis2 generator modified by Adobe
    * Any changes made to this file is overwritten when the code is regenerated.
    */


    package generated.webservices
    {
    Import mx.utils.ObjectProxy;
    import flash.utils.ByteArray;
    Mx.rpc.soap.types import. *;
    /**
    * Wrapper for a type of operation required class
    */

    public class NAL_NOM_type1
    {
    /**
    * Constructor, initializes the class type
    */
    public void NAL_NOM_type1() {}

    public var varchar:String; public function toString (): String
    {
    Return varchar.toString ();
    }

    }
    }

    I tried to do myWS.p_SEARCH_NAME_SOUNDEX (NAL_NOM_type1 (name());

    and also reported as NAL_NOM_type1 ' name'... but I still get this error.

    It's how he said my Web service method:

    public void p_SEARCH_NAME_SOUNDEX(nAL_NOM:NAL_NOM_type1):AsyncToken
    {
    var _internal_token:AsyncToken = _baseService.p_SEARCH_NAME_SOUNDEX (nAL_NOM);
    _internal_token.addEventListener ("result", _P_SEARCH_NAME_SOUNDEX_populate_results);
    _internal_token.addEventListener ("Fault", throwFault);
    Return _internal_token;
    }

    I'm not even on the level of trust the data on my grid... I just want to see how he gets the first data in the debugging.

    Thanks in advance for you help.

    KR,

    Meta

    Hi Meta,

    function p_SEARCH_NAME_SOUNDEX(nAL_NOM:NAL_NOM_type1) need of a parameter with the NAL_NOM_type1 type.

    you call

    myWS.p_SEARCH_NAME_SOUNDEX (name); where name is a string

    You can change constuctor for the string parameter

    public void NAL_NOM_type1 (str:String = "") {}

    varchar = str;

    }

    After this call myWS.p_SEARCH_NAME_SOUNDEX (new NAL_NOM_type1 (name));

    The second alternative is to create NAL_NOM_type1 variables, register name varchar.

    var t = new NAL_NOM_type1 ();

    t.varchar = name;

    myWS.p_SEARCH_NAME_SOUNDEX(t);

  • invokeMethod (java.lang.String, org.w3c.dom.Element) method not found

    Calling a Web Service that returns an XML file. The XML file must be passed to a method that puts the XML in a table in my database.

    I'll download the 3 files that are used for this.

    When I rebuild my files I get the following error in CustomerCO.java:
    Error (78,38): invokeMethod (java.lang.String, org.w3c.dom.Element) method is not not in the interface oracle.apps.fnd.framework.OAApplicationModule

    Line 78 reads as follows:
    String status = (String) am.invokeMethod ("initSaveXml", wsXml);

    Any suggestions?

    PS: I am a newbie in java and framework :-(


    Here are my files:

    _______________________________________________________________________________________________________________________________
    CustomerCO.java:

    /*===========================================================================+
    | Copyright (c) 2001, 2005 Oracle Corporation, Redwood Shores, California.
    | All rights reserved. |
    +===========================================================================+
    | HISTORY |
    +===========================================================================*/
    package xxcu.oracle.apps.ar.customer.server.webui;

    import java.io.Serializable;

    import java.lang.Exception;

    Import oracle.apps.fnd.common.VersionInfo;
    Import oracle.apps.fnd.framework.OAApplicationModule;
    Import oracle.apps.fnd.framework.webui.OAControllerImpl;
    Import oracle.apps.fnd.framework.webui.OAPageContext;
    Import oracle.apps.fnd.framework.webui.beans.OAWebBean;

    Import org.w3c.dom.Element;

    Import xxcu.oracle.apps.ar.customer.ws.LindorffWS;




    /**
    * Controller for...
    */
    SerializableAttribute public class ClientCo extends OAControllerImpl implements Serializable
    {
    public static final String RCS_ID = "$Header$";
    public static final boolean RCS_ID_RECORDED =
    VersionInfo.recordClassVersion (RCS_ID, "packagename %");

    /**
    * Layout and logical configuration for a region page.
    @param pageContext OA page context
    @param webBean the grain of web for the region
    */
    ' Public Sub processRequest (pageContext OAPageContext, OAWebBean webBean)
    {
    super.processRequest (pageContext, webBean);
    }

    /**
    * How to manage remittances form for form elements in
    * a region.
    @param pageContext OA page context
    @param webBean the grain of web for the region
    */
    ' Public Sub processFormRequest (pageContext OAPageContext, OAWebBean webBean)
    {
    super.processFormRequest (pageContext, webBean);
    /**
    * 2009.07.09, Roy Feirud, lagt til for a utfore sporring
    */

    If (pageContext.getParameter ("Search")! = null)
    {
    OAApplicationModule am = pageContext.getApplicationModule (webBean);
    Bomber sokekriteriene til LindorffWS
    String Name = pageContext.getParameter ("SearchName");
    Address of string = pageContext.getParameter ("SearchAddress");
    String Zip = pageContext.getParameter ("SearchZipCode");
    String city = pageContext.getParameter ("SearchCity");
    Born string = pageContext.getParameter ("SearchBorn");
    Phone chain = pageContext.getParameter ("SearchPhoneNo");
    [Serializable] param = {Zip, name, address, city, born, phone};
    Bygger sokestrengen
    String SearchString = (String) am.invokeMethod ("initBuildString", param);
    Initialiserer LindorffWS
    LindorffWS WsConnection = new LindorffWS();
    Try
    {
    Kaller Web Sevice fra Lindorff
    Element wsXml = (Element) WsConnection.XmlFulltextOperator (SearchString).

    String status = (String) am.invokeMethod ("initSaveXml", wsXml);
    }
    catch (Exception WsExp)
    {
    WsConnection = new LindorffWS();
    System.out.println ("Kall til LindorffWS feilet!");
    }

    am.invokeMethod ("initQueryCustomer");
    }
    }

    }

    _______________________________________________________________________________________________________________________________


    CustomerAMImpl.java:

    package xxcu.oracle.apps.ar.customer.server;
    import java.io.Serializable;

    to import java.sql.CallableStatement;
    import java.sql.SQLException;
    import java.sql.Types;

    Import oracle.apps.fnd.common.MessageToken;
    Import oracle.apps.fnd.framework.OAException;
    Import oracle.apps.fnd.framework.server.OAApplicationModuleImpl;
    Import oracle.apps.fnd.framework.server.OADBTransaction;
    Import oracle.apps.fnd.framework.server.OAExceptionUtils;

    Import org.w3c.dom.Element;

    // ---------------------------------------------------------------
    -File generated by Oracle Business Components for Java.
    // ---------------------------------------------------------------

    SerializableAttribute public class CustomerAMImpl extends OAApplicationModuleImpl implements Serializable
    {
    /**
    *
    * This is the default constructor (do not remove)
    */
    public CustomerAMImpl()
    {
    }

    /**
    *
    * Main sample for debugging code of business using the tester components.
    */
    Public Shared Sub main (String [] args)
    {
    launchTester ("xxcu.oracle.apps.ar.customer.server", "CustomerAMLocal");
    }

    /**
    *
    Getter of the container for CustomerVO1
    */
    public CustomerVOImpl getCustomerVO1()
    {
    return (CustomerVOImpl) findViewObject ("CustomerVO1");
    }
    /**
    * 2009.07.09, Roy Feirud, Lagt til for a utfore sporring.
    */
    Public Sub initQueryCustomer()
    {
    CustomerVOImpl vo = getCustomerVO1();
    If (vo! = null)
    {
    vo.initQuery ();
    }
    }
    /**
    * 2009.08.31, Roy Feirud, Lagt til a bygge entered opp til WebService hos Lindorff.
    */
    public String initBuildString (String Name
    Address of the string
    String Zip
    City of string
    String born
    String phone)
    {
    String ws_string = null;
    CallableStatement cs = null;
    Try
    {
    String sql = "BEGIN ISS_WS_LINDORFF_PKG. BUILD_STRING (?,?,?,?,?,?,?); END; « ;
    TXN OADBTransaction = getOADBTransaction();
    CS = txn.createCallableStatement(sql,1);
    cs.setString(1,Name);
    cs.setString(2,Address);
    cs.setString(3,Zip);
    cs.setString(4,City);
    cs.setString(5,Born);
    cs.setString(6,Phone);
    cs.registerOutParameter(7,Types.VARCHAR);
    CS. Execute();
    OAExceptionUtils.checkErrors (txn);
    WS_STRING = cs.getString (7);
    CS. Close();
    }
    catch (SQLException sqle)
    {
    String Prosedyre = 'ISS_WS_LINDORFF_PKG. BUILD_STRING ';
    String Errmsg = sqle.toString ();
    Tokens [] MessageToken = {new MessageToken ("PROSEDYRE", Prosedyre), new MessageToken ("Message of ERROR", Errmsg)};
    throw new OAException ("ISS", "ISS_PLSQL_ERROR", tokens, OAException.ERROR, null);
    }
    Return ws_string;
    }
    public String initSaveXml (item WsXml)
    {
    String status = "error";
    CallableStatement cs = null;
    Try
    {
    String sql = "BEGIN ISS_XML2TABLE_PKG. ISS_AR_CUSTOMERS_TMP (?,?); END; « ;
    TXN OADBTransaction = getOADBTransaction();
    CS = txn.createCallableStatement(sql,1);
    cs.setObject(1,WsXml);
    cs.registerOutParameter(2,Types.VARCHAR);
    CS. Execute();
    OAExceptionUtils.checkErrors (txn);
    Status = cs.getString (2);
    CS. Close();
    }
    catch (SQLException sqle)
    {
    String Prosedyre = 'ISS_XML2TABLE_PKG. ISS_AR_CUSTOMERS_TMP ';
    String Errmsg = sqle.toString ();
    Tokens [] MessageToken = {new MessageToken ("PROSEDYRE", Prosedyre), new MessageToken ("Message of ERROR", Errmsg)};
    throw new OAException ("ISS", "ISS_PLSQL_ERROR", tokens, OAException.ERROR, null);
    }
    Back to Status;
    }
    }

    _______________________________________________________________________________________________________________________________

    LindorffWS.java:

    package xxcu.oracle.apps.ar.customer.ws;
    Import oracle.soap.transport.http.OracleSOAPHTTPConnection.
    Import org.apache.soap.encoding.soapenc.BeanSerializer.
    Import org.apache.soap.encoding.SOAPMappingRegistry;
    Import org.apache.soap.util.xml.QName.
    import java.util.Vector;
    Import org.w3c.dom.Element;
    import java.net.URL;
    Import org.apache.soap.Body;
    Import org.apache.soap.Envelope.
    Import org.apache.soap.messaging.Message.
    Import oracle.jdeveloper.webservices.runtime.WrappedDocLiteralStub;
    /**
    * Generated by the generator of Stub/Skeleton Oracle9i JDeveloper Web Services.
    * Date of creation: kills Jul 10 10:37:21 2009 CEST
    * WSDL URL: http://services.lindorffmatch.com/Search/Search.asmx?WSDL
    */

    SerializableAttribute public class LindorffWS extends WrappedDocLiteralStub
    {
    public LindorffWS()
    {
    m_httpConnection = new OracleSOAPHTTPConnection();
    }

    public endpoint point String = "http://services.lindorffmatch.com/Search/Search.asmx";
    private OracleSOAPHTTPConnection m_httpConnection = null;
    private SOAPMappingRegistry m_smr = null;

    public XmlFulltextOperator (String xmlString) element throws Exception
    {
    EndpointURL URL = new URL (endpoint);

    Envelope requestEnv = new Envelope();
    Body requestBody = new Body();
    Vector requestBodyEntries = new Vector();

    String wrappingName = "XmlFulltextOperator";
    String targetNamespace = "http://services.lindorffmatch.com/search";
    Vector requestData = new Vector();
    requestData.add (new Object() {"xmlString", xmlString});

    requestBodyEntries.addElement ((wrappingName, targetNamespace, requestData) toElement);
    requestBody.setBodyEntries (requestBodyEntries);
    requestEnv.setBody (requestBody);

    Message msg = new Message();
    msg.setSOAPTransport (m_httpConnection);
    Msg. Send (endpointURL, "http://services.lindorffmatch.com/search/XmlFulltextOperator", requestEnv);

    Envelope responseEnv = msg.receiveEnvelope ();
    Body responseBody = responseEnv.getBody ();
    Vector responseData = responseBody.getBodyEntries ();

    return (Element) fromElement ((Element) responseData.elementAt (0), org.w3c.dom.Element.class);
    }
    }


    _______________________________________________________________________________________________________________________________

    Hello

    Create an Interface to your application Module then the interface of your method call,

    see http://www.oraclearea51.com/oracle-technical-articles/oa-framework/oa-framework-beginners-guide/213-how-to-call-am-methods-from-controller-without-using-invokemethod.html for creation of Interface for AM and call it to the controller.

    Kind regards
    Out Sharma

  • Scatter chart: get the value of the label XYcursor

    Measurement Studio Visual Studio Professional 2012 2013 using,.

    On a scatter chart, it is possible to get the value of the actual label for a xycursor?

    For example, my label displays a date-time on the X axis format, it looks like: [04: 35:49; 0,27101]

    It is possible to get this value? For example, if I want to display in a TextBox?

    I am able to get the xycursor. Which and xycursorYposition but not what I want.

    Thanks for any help!

    Here is a solution to my question:

    {

    Get xy cursor index of the point in plot
    int index = xyCursor1.GetCurrentIndex ();

    Get values at that time (in the plot)
    Double x;
    Double y;
    scatterGraph.Plots [0]. GetDataPoint (index, ByRef x, y);

    X value to the DateTime format & convert to the format of the time
    DateTime t = (DateTime) NationalInstruments.DataConverter.Convert (x, typeof (DateTime));

    string time = t.ToString("hh:mm:ss");

    }

    It is also possible for which xycursor and convert it in the same way.

  • OID need to run SNMP queries for the CPU usage, etc. in Win XP

    Hello

    I am unable to get the details (CPU Util, Util Swap) of windows using SNMP (SNMP4j.jar) machine. The SNMP service is running on the Windows XP system target. Where can I find the correct OID for windows XP to retrieve these settings?

    Join the code below:

    Import org.snmp4j.CommunityTarget;
    Import org.snmp4j.PDU;
    Import org.snmp4j.Snmp;
    Import org.snmp4j.event.ResponseEvent;
    Import org.snmp4j.mp.SnmpConstants;
    Import org.snmp4j.smi.OID;
    Import org.snmp4j.smi.OctetString;
    Import org.snmp4j.smi.UdpAddress;
    Import org.snmp4j.smi.VariableBinding;
    Import org.snmp4j.transport.DefaultUdpTransportMapping;

    Configure the Snmp object
    private Snmp snmp = null;
    private UdpAddress targetAddress = null;
    private CommunityTarget target = null;
    ResponseEvent responseEvent = null;

    targetAddress = new UdpAddress (10.101.210.127 + ' /' + 161);

    target = new CommunityTarget();
    target.setCommunity (new OctetString ("public"));
    target.setAddress (targetAddress);
    target.setRetries (2);
    target.setTimeout (60000);
    target.setVersion (SnmpConstants.version2c);
           
    SNMP = Snmp new (new DefaultUdpTransportMapping());
                
           
    SNMP. Listen();

    CPU usage code
       
    Command PDU = new PDU();
    command.setType (PDU. (GET);
    Command.Add (new VariableBinding (new OID(".1.3.6.1.2.1.25.2.3.1.4"))); / / percentage of CPU Idle time//.1.3.6.1.4.1.311.1.7.3.1.6.0
    try {}
    responseEvent = snmp.send (command, target);//.1.3.6.1.4.1.2021.11.11.0
    } catch (Exception e) {}
    System.out.println ("Exception:" + e); e.printStackTrace ();
    }
    If (responseEvent.getResponse () == null) {}
    request timed out
    Returns a null value.
    } else {}
    Response PDU dump
    PDU pdu = (responseEvent.getResponse ());
    Output vector = new Vector();
    Output = pdu.getVariableBindings ();
    int val1 = 0;
    Double CPUMemUtil = 0;
    Dim str As String = null;
    Str = Output.get (0) m:System.NET.SocketAddress.ToString ();
    String [] Spstr = str.split("=");
    Spstr [1] = Spstr [1] .trim ();
    try {}
    val1 = Integer.parseInt(Spstr[1]);
    } catch (Exception e) {}
    System.out.println ("An Exception occurred" + e); e.printStackTrace ();
    }
    CPUMemUtil = (100 - val1);
    String OutputMemUtil = Double.toString (CPUMemUtil);
    System.out.println ("CPU usage" + OutputMemUtil);

    Thanks in advance,

    Souto

    Hello

    Questions like these are much better handled in the TechNet IT Pro Forums.

    My moderator tools cannot transfer messages on Windows forums, please re - ask you question there.

    http://social.technet.Microsoft.com/forums/en/itproxpsp/threads

    Jack-MVP Windows Networking. WWW.EZLAN.NET

  • first application

    I'm working on my first app, and I'm doing a button that pulls a .jpg from the internet and displays file in my application, then if I hit the new button shoots an another .jpg to replace the one currently being displayed.

    I don't want to launch the browser, I want to just download and display the image

    If you want to download an image, you can use this:

    (I do not write this code, I found it in this forum but works!)

    public Bitmap Download Image(){
     InputStream inputStream = null;
     HttpConnection connection = null;
     EncodedImage bitmap;
     Bitmap _bmap;
     byte[] dataArray = null;
     String url = "";
    
    try {
    
     url="www.myserver/myimage.jpg"
    connection = (HttpConnection) Connector.open(url,Connector.READ_WRITE, true);
    inputStream = connection.openInputStream();
    byte[] responseData = new byte[10000];
    int length = 0;
    StringBuffer rawResponse = new StringBuffer();
    while (-1 != (length = inputStream.read(responseData))) {
        rawResponse.append(new String(responseData, 0, length));
                    }
    int responseCode = connection.getResponseCode();
    if (responseCode != HttpConnection.HTTP_OK) {
                        throw new Exception("HTTP response code: " + responseCode);
                    }
    
    final String result = rawResponse.toString();
    dataArray = result.getBytes();
        }
        catch (final Exception ex) {
                }
        finally {
    
            try {
            inputStream.close();
            inputStream = null;
            connection.close();
    
                    } catch (Exception e) {
                    }
                }
    
    bitmap = EncodedImage.createEncodedImage(dataArray, 0,  dataArray.length);
    Bitmap imageDownloaded=bitmap.getBitmap();
    return imageDownloaded;
    
        }
    

    That, you get the bitmap, then you can put him in the place you need.

    PS: Sorry for my English.

  • Push and Midlets

    I am trying to add push, via the Service of Blackberry Push notifications to my application already developed and productive with the midlets. As I can not instantiate a UIApplication on a moped, I thought to leave my "wake app" app on every push, using PushRegistry AMS software.

    Its posible to register to use the Blackberry Push Notification Service, at a very low level, using PushRegistry on a MIDlet application?

    Thank you

    Nico.

    Solved by some here at work, by adding this code. Post here if anyone can help.

    package test.javax.microedition.midlet;

    Javax.microedition.lcdui import. *;
    Javax.microedition.io import. *;
    Javax.microedition.midlet import. *;
    Import Java.util;
    import java. IO;
    Import net.rim.device.api.applicationcontrol.ApplicationPermissions;
    Import net.rim.device.api.applicationcontrol.ApplicationPermissionsManager;

    / public final class DynamicPushRegistry extends MIDlet
    {
    Data, we expect to receive.
    private static final String TEST_DATA = "this is just a test."
    private final static ApplicationPermissionsManager apm is ApplicationPermissionsManager.getInstance ();.

    public DynamicPushRegistry()
    {
    setPermission (ApplicationPermissions.PERMISSION_CROSS_APPLICATION_COMMUNICATION);
    setPermission (ApplicationPermissions.PERMISSION_BROWSER_FILTER);
    setPermission (ApplicationPermissions.PERMISSION_INTERNET);
    setPermission (ApplicationPermissions.PERMISSION_SERVER_NETWORK);
    setPermission (ApplicationPermissions.PERMISSION_APPLICATION_MANAGEMENT);
    }

    Signals of the MIDlet that he is entered in the active state.
    public void startApp()
    {
    Get the display for this MIDlet object.
    Display d = Display.getDisplay (this);

    Create and start a new WorkerThread.
    Thread t = new WorkerThread();
    t.Start ();

    Create a new alert.
    Alert alert = new alert ("start DynamicPushRegisry");

    Display the alert for 2 seconds.
    alert.setTimeout (2000);

    d.setCurrent (alert);
    }

    private class WorkerThread extends thread
    {
    public void run()
    {

    Get all the connections that have been registered with the PushRegistry
    for the current MIDlet suite.
    String [] connections = PushRegistry.listConnections (true);

    If (connections.length == 0)
    {
    Nothing is recorded, sign up for a connection.
    Try
    {
    Dynamically register a socket connection
    on port 50000.
    PushRegistry.registerConnection ("' socket: / /: 50000", ")
    "test.javax.microedition.midlet.DynamicPushRegistry,"
    "*");
    } catch (ConnectionNotFoundException e)
    {
    message (try ());
    } catch (ClassNotFoundException e)
    {
    message (try ());
    } catch (IOException e)
    {
    message (try ());
    }
    }
    on the other
    {
    A connection is already registered and data arrives.
    Extract the incoming data.
    fetchData (connections [0]);

    Stop to wait for data.
    message ("Done");
    }
    notifyDestroyed();
    }
    }

    Retrieves incoming data.
    Private Sub fetchData (connection String)
    {
    Try
    {
    Open the connection.
    Connection c = Connector.open (connection);

    If (ch. instanceof StreamConnectionNotifier)
    {
    Open an InputStream.
    StreamConnectionNotifier (StreamConnectionNotifier) SNA = c;
    StreamConnection sc = scn.acceptAndOpen ();
    InputStream input = sc.openInputStream ();

    Extract the data from the InputStream.
    StringBuffer sb = new StringBuffer();
    data from Byte [] = new ubyte [256];
    piece of int = 0;
    While (-1! = (chunk = input.read (data)))
    {
    SB. Append (new String (data, 0, chunk));
    }

    Close the InputStream and StreamConnection.
    Input.Close ();
    TCI Close();

    String s = sb.toString ();

    Test the data for validity.
    If not valid, an exception is thrown.
    Assert.assertTrue (TEST_DATA.equals (s),
    "Do not have an appropriate string:"+ s); ".

    Display the received data.
    message ("Received:" + sb.toString ());
    }
    } catch (IOException e)
    {
    message (try ());
    }

    }

    Display a message string to the user.
    Private Sub message (String msg)
    {
    Create a new alert with the message.
    Alert alert = new Alert (msg);

    Display the alert for 5 seconds.
    alert.setTimeout (5000);

    Display.getDisplay (this) .setCurrent (alert);
    }

    Reports the MIDlet to stop and go to the Pause State.
    public void pauseApp()
    {
    }

    Reports the MIDlet to terminate and move to the State of destruction.
    Unconditional, when set to true. The MIDlet must cleaning and release
    all of the resources. Otherwise, the MIDlet can raise a
    MIDletStateChangeException to indicate that he does not want to be
    destroyed at this time.
    public void destroyApp (boolean unconditional)
    {
    }

    private Boolean setPermission (int permission) {}

    Boolean updatedPermissions = false;
    ApplicationPermissions ap = apm.getApplicationPermissions ();
    If (ap.containsPermissionKey (permission)) {}
    int eventInjectorPermission = ap.getPermission (permission);

    If (eventInjectorPermission! = ApplicationPermissions.VALUE_ALLOW) {}

    ap.addPermission (permission);
    updatedPermissions = apm.invokePermissionsRequest (ap);
    }
    } else {}
    ap.addPermission (permission);
    updatedPermissions = apm.invokePermissionsRequest (ap);
    }

    Return updatedPermissions;
    }
    }

    Throws IllegalStateException with the provided error message.
    last class Assert
    {
    Assert() private
    {
    }

    public static public Sub assertTrue (Boolean exp, String failmsg)
    {
    If (! exp)
    throw new IllegalStateException (failmsg);
    }
    }

Maybe you are looking for