Closest Match algorithm using Strings..

Hi all,
I am wondering if there is any built in mechanism, or if not, any thought on how to get find a "close" match in a list of Strings, given a String and a set number of characters to match from the start of the String. Basically I have a combo box of items, and the user selects a file with "source" items. I try to display the "closest" match, if possible, if not an exact match, by looping through the x number of characters and so forth. With this being a JDK 1.4 application, I am curious to know if it is possible to do this using Regular Expressions, and if so, how would it be done? I haven't figured out Reg Expressions at this point. My immediate need is up to 3 characters matching, so in a name list of Jody, John, and Johnson, with a String of Joh, the John item would be returned as the closest match. If the String is ABC given the same list, then nothing is returned. It must be at least the first character matching, otherwise null is returned.
Thanks for any help.

Thanks. I'll look it up. I actually got it somewhat working. I basically have a list of items. I pass that list with the specific character and position of that character to match. It returns a List of all items that have the passed in character at the specific position. I then do it again for the next character, in a loop. In my case, I am only looking for the first 3 characters to be a match. That gets us a "close enough" situation where the user can then try to pick from there.
Thanks for your input.

Similar Messages

  • Use of edge detection in pattern matching algorithm?

    Hello all,
                    I work for a group at Texas A&M University researching two-phase flow in reactors.  We have been using IMAQ Vision and had a question regarding the use of edge detection in the pattern matching algorithm.  I had seen the webcast entitled “Algorithms that Learn: The Sum and Substance of Pattern Matching and OCR” (http://zone.ni.com/wv/app/doc/p/id/wv-705) and in the webcast it was mentioned that the pattern matching algorithm uses edge detection to, (as best I can tell), reduce the candidate list further and to perform subpixel location calculations.  However, I was wondering if this edge detection process is still performed if we do not use the subpixel location calculation (i.e. if we uncheck the “Subpixel Accuracy” check box)?  Also, if edge detection is performed in the pattern matching algorithm is it consistent with the method described in Chapter 13 of the Vison Concepts Manual (“Geometric Matching”)?  Finally, if edge detection is performed in a manner consistent with Chapter 13 of the manual, how does the geometric matching correlation number affect the correlation calculation that was performed in the previous steps?  Are they simply multiplied together?
    Many thanks!
      -Aaron

    Jeff,
    We are using Imaq Vision Builder 4, with the included pattern matching that can be accessed via the menus (i.e. we haven't created a custom VI or anything.)  We are using the software to locate bubbles during boiling experiments and want a deeper understanding of what is going on "behind the scenes" of the algorithm, as we may have to explain how it works later.  We have been able to determine most of what we need from the webcast I had previously mentioned, except for the use of edge detection in the pattern matching algorithm.
    At the scales involved in our experiments, subpixel accuracy is really not needed and therefore we do not use it.  If edge detection is used in the pattern matching algorithm only to determine location with subpixel accuracy, then we do not really need to know how it works because we do not use that calculation.  Inversely, of course, if edge detection is used during pattern matching even without enabling subpixel accuracy, then we would like to have a fairly good understanding of the process.
    I've read most of the section on geometric matching in the Vision Concepts Manual and wondered if the process described there for edge detection (or feature matching) was also used in the basic pattern matching algorithm?
    To summarize, if edge detection is not used in the basic pattern matching algorithm without subpixel accuracy, then that is all I need to know.  If edge detection is used for pattern matching even without using the subpixel accuracy calculation, then we would like to learn more about how exactly it is used in the pattern matching algorithm.
    We would really appreciate any help you could give us... we've been digging around on the NI website for a couple of weeks now trying to fit together all the pieces of the pattern matching puzzle.
    Many thanks!
        Aaron

  • How to get the closest match strings

    Hello All,
    I am looking for a select statement that will compare the alphanumeric value of my input string and return the closest matching alphanumeric value from my Cache table.
    The Cache table has 2 columns.
    CREATE TABLE Cache (
    ID int identity primary key,
    SearchWord char(10)
    INSERT INTO Cache
    VALUES ('20');
    INSERT INTO Cache
    VALUES ('20A')
    INSERT INTO Cache
    VALUES ('20B')
    INSERT INTO Cache
    VALUES ('20A-1')
    INSERT INTO Cache
    VALUES ('20AB-223')
    INSERT INTO Cache
    VALUES ('20" Mainline')
    INSERT INTO Cache
    VALUES ('WEP3-SEG-1')
    INSERT INTO Cache
    VALUES ('WEP3-SEG-1A')
    INSERT INTO Cache
    VALUES ('WEP3-SEG-1B')
    INSERT INTO Cache
    VALUES ('WEP3')
    I am trying to use Difference function, but it is not working properly.
    select c.*,Difference(SearchWord, '20') from Cache c
    where SearchWord like '%20%' ORDER BY Difference(SearchWord, '20') DESC
    When I search for 20 in this table, I have to get all the closest matches i.e., 20, 20A,20B BUT NOT 20a-1,  20AB-223 and 20" MAINLINE and when I am searching for WEP3-SEG-1, I have to get WEP3-SEG-1, WEP3-SEG-1A but not WEP3 in the resultset.
    How can I achieve this?.
    Thanks for your assistance.

    Develop your own user-defined scalar difference function. You can name it udfDifference.
    BOL: Create User-defined Functions (Database Engine)
    UDF blog:
    http://www.sqlusa.com/bestpractices/training/scripts/userdefinedfunction/
    Kalman Toth Database & OLAP Architect
    SQL Server 2014 Database Design
    New Book / Kindle: Beginner Database Design & SQL Programming Using Microsoft SQL Server 2014

  • How to retrieve IndividualStrings from a txt file using String Tokenizer.

    hello can any one help me to retrieve the individual strings from a txt file using string tokenizer or some thing like that.
    the data in my txt file looks like this way.
    Data1;
    abc; cder; efu; frg;
    abc1; cder2; efu3; frg4;
    Data2
    sdfabc; sdfcder; hvhefu; fgfrg;
    uhfhabc; gffjcder; yugefu; hhfufrg;
    Data3
    val1; val2; val3; val4; val5; val6;
    val1; val2; val3; val4; val5; val6;
    val1; val2; val3; val4; val5; val6;
    val1; val2; val3; val4; val5; val6;
    i need to read the data as an individual strings and i need to pass those values to diffarent labels,the dat in Data3 i have to read those values and add to an table datamodel as 6 columns and rows depends on the data.
    i try to retrieve data using buffered reader and inputstream reader,but only the way i am retrieving data as an big string of entire line ,i tried with stringtokenizer but some how i was failed to retrive the data in a way i want,any help would be appreciated.
    Regards,

    Hmmm... looks like the file format isn't even very consistent... why the semicolon after Data1 but not after Data2 or Data3??
    Your algorithm is reading character-by-character, and most of the time it's easier to let a StringTokenizer or StreamTokenizer do the work of lexical analysis and let you focus on the parsing.
    I am also going to assume your format is very rigid. E.g. section Data1 will ALWAYS come before section Data2, which will come before section Data3, etc... and you might even make the assumption there can never be a Data4, 5, 6, etc... (this is why its nice to have some exact specification, like a grammar, so you know exactly what is and is not allowed.) I will also assume that the section names will always be the same, namely "DataX" where X is a decimal digit.
    I tend to like to use StreamTokenizer for this sort of thing, but the additional power and flexibility it gives comes at the price of a steeper learning curve (and it's a little buggy too). So I will ignore this class and focus on StringTokenizer.
    I would suggest something like this general framework:
    //make a BufferedReader up here...
    do
      String line = myBufferedReader.readLine();
      if (line!=null && line.trim().length()>0)
        line = line.trim();
        //do some processing on the line
    while (line!=null);So what processing to do inside the if statement?
    Well, you can recognize the DataX lines easily enough - just do something like a line.startsWith("Data") and check that the last char is a digit... you can even ignore the digit if you know the sections come in a certain order (simplifying assumptions can simplify the code).
    Once you figure out which section you're in, you can parse the succeeding lines appropriately. You might instantiate a StringTokenizer, i.e. StringTokenizer strtok = new StringTokenizer(line, ";, "); and then read out the tokens into some Collection, based on the section #. E.g.
    strtok = new StringTokenizer(line, ";, ");
    if (sectionNo==0)
      //read the tokens into the Labels1 collection
    else if (sectionNo==1)
      //read the tokens into the Labels2 collection
    else //sectionNo must be 2
      //create a new line in your table model and populate it with the token values...
    }I don't think the delimiters are necessary if you are using end-of-line's as delimiters (which is implicit in the fact that you are reading the text out line-by-line). So the original file format you listed looks fine (except you might want to get rid of that rogue semicolon).
    Good luck.

  • Error: Sequence does not match type xs:string

    I am using BDB XML 2.5.16 to store and query my XML  documents in Java. The documents are IMDB xml documents containing actors information
    obtained from INEX website https://inex.mmci.uni-saarland.de/login.jsp.  One of  the document I stored in the database is the following
        <?xml version="1.0" encoding="UTF-8"?>
         <persons>
          <person>
              <name>jason angeles
              </name>
              <filmography>
                 <act>
                    <movie>
                       <title>prison planet 3 the revenge 1998
                        </title>
                      <year>1998
                      </year>
                     <character>evil ninja
                      </character>
                   </movie>
                 </act>
              </filmography>
             </person>
             </persons>
    I want to  search using XQuery  for filmography element whose title element contains ANY of the following keywords ('planet', 'revenge', '1998'). Below is the query I used
                  // declaring function functx:contains-any-of
                String qryRk = "declare namespace functx = 'http://www.functx.com'; " 
                      + "declare function functx:contains-any-of "
                     + "( $arg as xs:string?" + " , "  + " $searchStrings as xs:string* )  as xs:boolean { "
                     + "some $searchString in $searchStrings "
                    +  " satisfies contains($arg,$searchString)} ; ";
                 String myQuery101 = qryRk + "for $entity in collection('simpleExampleData2.dbxml')//filmography "
                      + "where functx:contains-any-of ( $entity/act/movie/title ,  ('planet', 'revenge', '1998'))"
                      + "return $entity";
    When I  execute the query  i  expect to get at least get the following element as mu output
                           Document : person_31000.xml:
                        <filmography>
                               <act>
                                     <movie>
                                     <title>prison planet 3 the revenge 1998
                                    </title>
                                    <year>1998
                                    </year>
                                   <character>evil ninja
                                   </character>
                                  </movie>
                               </act>
                             </filmography>
    However instead of the above element i got the  following Error
                                 Exception in thread "main" com.sleepycat.dbxml.XmlException: Error: Sequence does not match type xs:string? - the sequence contains more than one item [err:XPTY0004], <query>:1:343, errcode =               
                                  QUERY_EVALUATION_ERROR
                                      at com.sleepycat.dbxml.dbxml_javaJNI.XmlManager_query__SWIG_0(Native Method)
                                      at com.sleepycat.dbxml.XmlManager.query(XmlManager.java:544)
                                     at com.sleepycat.dbxml.XmlManager.query(XmlManager.java:320)
                                     at xmlirsystemstruxplus.XQueryEngine.queryEngine(XQueryEngine.java:269)
                                     at xmlirsystemstruxplus.XMLIRSystemStruXplus.main(XMLIRSystemStruXplus.java:109)
                                     Java Result: 1
        Note that i used  contains-any-of() function because the contains () function does not work with  'planet revenge 1998' string may be because the keywords do not appear in the order they appear in the element content.
       Please  can any body help me to find out  (1) why i have the  above error ? and solution  (2)  why  the condition contains  ( $entity/act/movie/title ,  'planet revenge 1998') is not working ? how do i use contains() function w.r.t this
    Thank you in advance
    Message was edited by: RokoA 19/01/2015  by RokoA

    Using the shell dbxml in both 2.5 and 6.0 I created a container and put the document example you gave into it.  Then I executed the following query:
    [code]
    declare namespace functx = 'http://www.functx.com';
    declare function functx:contains-any-of ( $arg as xs:string?, $searchStrings as xs:string* )  as xs:boolean {
    some $searchString in $searchStrings
    satisfies contains($arg,$searchString)
    for $entity in collection('simpleExampleData2.dbxml')//filmography
    where functx:contains-any-of ( $entity/act/movie/title ,  ('planet', 'revenge', '1998'))
    return $entity
    [/code]
    And got the results you expected instead of an error.
    Since you are using the Java API it is possible the problem is in how you configured and executed the query, instead of in the query itself.  If you could post an example program or code section that produces the error, then I can continue you help you with this.
    Lauren Foutz

  • Regex fails to match, so it reports closest match

    Hi Guru's,
    I am using the regex API to match 2 lines of a message. If the match fails the 2 lines are reported to the user so they can see what has failed. Unfortunately the lines I am comparing are very long. (1000+ chars) So the user needs an indication of exactly what has failed.
    I was wondering if it is possible to use get a regex's closest match. So if whilst parsing, the regex managed to match 250/1000 characters I could tell user to start looking around character 250 for differences in the message.
    I have had a good google and can't find out how to do this, I have also quickly looked at the ORO perl5 api documentation, but cant find any code that implements this.
    Any help would be appreciated. thanks.

    I don't know of a way to do this, you could look into ParsePosition, but I don't know if you'll get usefull output if it doesn't match (it's worth a try, 'though).
    Otherwise you'd probably need a "real" parser. They can usually give very accurate positions for the errors (usually off-by-one token/line).

  • Using string password

    Hi
    Can someone give me a sample code about how to use string password when encrypting and decrypting data?
    I have made an application that encrypts and decrypts data and it can even save password. Password is not created from string see code:
    KeyGenerator kgen = KeyGenerator.getInstance("Blowfish");
    SecretKey skey = kgen.generateKey();
    byte[] raw = skey.getEncoded();
    SecretKeySpec skeySpec = new SecretKeySpec(raw, "Blowfish");
    Now I want that client can give a password and application use that while encrypting and decrypting.
    I'm using CipherOutputStream and CipherInputStream to save and open data. I'm using Blowfish algorithm.
    Regards
    Juha

    Hi Juha,
    Here is the sample code for encrypting and decrypting a string.
    import java.io.*;
    import java.security.*;
    import javax.crypto.*;
    import sun.misc.*;
    public class SecretWriting{
    public static void main(String args[]) throws Exception{
    if(args.length<2)
    System.out.println("Usage : SecretWriting -e|-d text");
    return;
    Security.addProvider(new com.sun.crypto.provider.SunJCE());
    Key key;
    try{
    ObjectInputStream in=new ObjectInputStream(new FileInputStream("des.key"));
    key=(Key)in.readObject();
    in.close();
    catch(FileNotFoundException fnfe)
    KeyGenerator generator= KeyGenerator.getInstance("DES");
    generator.init(new SecureRandom() );
    key=generator.generateKey();
    ObjectOutputStream out=new ObjectOutputStream(new FileOutputStream("des.key"));
    out.writeObject(key);
    out.close();
    Cipher cipher=Cipher.getInstance("DES/ECB/PKCS5Padding");
    if(args[0].indexOf("e") !=-1)
    cipher.init(Cipher.ENCRYPT_MODE,key);
    String amalgam=args[1];
    for(int i=2;i<args.length;i++)
    amalgam+=" "+args;
    byte[] stringBytes=amalgam.getBytes("UTF8");
    byte[] raw=cipher.doFinal(stringBytes);
    BASE64Encoder encoder = new BASE64Encoder();
    String base64 = encoder.encode(raw);
    System.out.println(base64);
    else if(args[0].indexOf("d")!=-1)
    cipher.init(Cipher.DECRYPT_MODE,key);
    BASE64Decoder decoder = new BASE64Decoder();
    byte[] raw = decoder.decodeBuffer(args[1]);
    byte[] stringBytes = cipher.doFinal(raw);
    String result = new String(stringBytes,"UTF8");
    System.out.println(result);
    I hope this will help you out.
    Thanks
    Bakrudeen
    Technical Support Engineer
    Sun MicroSystems Inc, India

  • Matcher vs. String.replaceAll

    I have been experiencing a problem attempting to use an expression such as:
    s = s.replaceAll("PATTERN","REPLACEMENT");
    to replace certain regular expressions in a document. When using the Matcher to replace Strings as follows there is no problem, but using the same pattern with String.replaceAll doesn't seem to perform the replacement.
    Pattern pattern = Pattern.compile("PATTERN",Pattern.DOTALL);
    Matcher matcher = pattern.matcher(s);
    s = matcher.replaceAll("REPLACEMENT");
    The only thing I can think of is that the Pattern.DOTALL options allows the match to take succeed, where it wouldn't otherwise. Therefore I was wondering if there an equivalent for the String.replaceAll method perhaps? Any ideas?
    Thanks very much,
    Ross Butler

    I'm having trouble believing that PATTERN and REPLACEMENT are the real string you're using, but it's probably not important, since it sounds like you probably diagnosed the problem yourself.
    According to the Javadocs, replaceAll gives the same result as Pattern.compile(regex).matcher(str).replaceAll(repl), but obviously that wouldn't necessarily be true if you add extra parameters somewhere in there, so I would say that replaceAll is more of a convenience method that you use when you don't need any extra parameters.
    However, if you need to use DOTALL or something else similar, you'll need the longer way using Matcher.
    That shouldn't stop you from writing your own convenience method, though. :)

  • Matcher replaceAll vs String replaceAll and + plus sign anomaly?

    I have code that is to highlight search terms found within a given string.
    I searched within a given string "Java, C++, C, etc." for the term "C++" and have really strange results.
    Below is a snippet.
    // Now the highlighting portion              
                /** The temporary start tag, just some uncommon Unicode character. */
                final String START_TAG = Character.toString( (char)0x0141 );
                /** The temporary end tag. */
                final String END_TAG = Character.toString( (char)0x0142 );
                String highlighted = result.toString();
                for (int m = 0; m < foundPhrases.size(); m++) {
                    String phrase = foundPhrases.get(m);
                    String pattern = "[^" + START_TAG + "](" + phrase + ")";
                    Pattern firstMatchedPattern = Pattern.compile( pattern, Pattern.CASE_INSENSITIVE );
                    Matcher matcher = firstMatchedPattern.matcher( highlighted );
                    while( matcher.find( ) ) {
                        String foundPhrase = matcher.group( 1 );
                        StringBuffer hilitebuffer = new StringBuffer( START_TAG );
                        hilitebuffer.append( foundPhrase ).append( END_TAG );
                        System.out.println("hilitebuffer = " + hilitebuffer.toString());
                        //highlighted = matcher.replaceAll(hilitebuffer.toString());
                        highlighted = highlighted.replaceAll( foundPhrase, Matcher.quoteReplacement(hilitebuffer.toString( ))); also cannot handle +
                        System.out.println("highlighted= " + highlighted);
                    highlighted = highlighted.replaceAll( START_TAG,
                          CoreServices.highlightTagStart );
                    highlighted = highlighted.replaceAll( END_TAG, CoreServices.highlightTagEnd );
                System.out.println( "highlightMatchingPhrases.return: " + highlighted );
                return highlighted;Using String's replaceAll to assign highlighted, I get:
    hilitebuffer = ?C++?
    highlighted= Java, ?C++?++, ?C++?, etc.
    highlightMatchingPhrases.return: Java, <b style="color:black;background-color:#ffff66">C++</b>++, <b style="color:black;background-color:#ffff66">C++</b>, etc. Note the extra ++ and C++
    Using Matcher's replaceAll, I get:
    hilitebuffer = ?C++?
    highlighted= Java,?C++?, C, etc.
    highlightMatchingPhrases.return: Java,<b style="color:black;background-color:#ffff66">C++</b>, C, etc.
    Problem here is very subtle, the space preceeding the text C++ has been replaced as well. So, if the text string was "rollerblading" and the search term was "blading" the resulting highlighted text would be rolleblading, missing the r. Not good.
    Reproducible every time.
    Ideas?
    Thanks!
    Ginni

    First, ginnibobinni, you can't use HTML to format text in these forums. To get text in bold, you can use one of these approaches: text or *text* I prefer the square-bracket form; the asterisks are just too finicky.
    sabre150 wrote:
    I'm not inclined to go though that convoluted program in any detail but I will say that you should quote using \Q and \E the phrase in String pattern = "[^" + START_TAG + "](" + phrase + ")"
    I started to point out all of the errors in that code, but the task was just too daunting. ;)
    Instead, here's a bit of code that seems to do what you want: import java.util.*;
    import java.util.regex.*;
    public class Test
      static final String START_TAG = "\u0141";
      static final String END_TAG = "\u0142";
      public static void main(String[] args) throws Exception
        List<String> phrases = Arrays.asList("Java", "C++");
        String input = "Java, C++, C";
        String output = input;
        for (String phrase : phrases)
          String regex = "(?<=^| )\\Q" + phrase + "\\E(?=,|$)";
          Pattern p = Pattern.compile(regex, Pattern.CASE_INSENSITIVE);
          Matcher m = p.matcher(output);
          StringBuffer sb = new StringBuffer();
          while (m.find())
            m.appendReplacement(sb, "");
            sb.append(START_TAG).append(m.group()).append(END_TAG);
          m.appendTail(sb);
          output = sb.toString();
        System.out.println(output);
    } Any questions? :D

  • Improving Performen when using String

    Hi all,
    Well, I am developing an application and I use Strings a lot... using the Profile I could see the String class are more than 50% of all memory usage on it. I will try to explain how I am using the String and I hope someone can reply me some tips on how to improve this usage.
    Basically I have Message Exchanger application, this application receives some text messages and forward them (or reply them) by replacing some special string by another ones.
    For example:
    The application receive a message like "This is a sample message ${parameter}."
    And forward "This is a sample message Hello."
    Of course, it is more complicated than that, and has more parameters than just a simple one. The example above is just an swatch
    My source code use a lot of
    String msg =  msg.replace(regex1, text1);
              msg = msg.replace(regex2, text2);The JVM creates a new String for each return of msg replace and I believe this is the main place where I can improve the memory usage. The GC is collecting all resources properly, the problem is that I have hundred of messages like that running what cause thousand of String being created and the GC takes some time to release them.
    Well, that is all. Thanks and Regards

    When doing a bunch of variable substitutions it's better to use a regexp Matcher with the output being sent to a String buffer. If all the variable tokens have the same structure you can do the whole job in one pass. Something like:
    Pattern tokenPatterns = Pattern.compile("\\$\\{(\w+)\\}");
    Matcher m = tokenPattern.matcher(inputString);
    StringBuffer outb = new StringBuffer(inputString.length());
    while(m.find()) {
        String insertText = subsMap.get(m.match(1));
        m.appendReplacement(outb, insertText);
    m.appendTail(outb);

  • Switch stmt using String?

    Ok, haven't used the switch statement in some time and don't remember how to get it to recognize a String as the case value. Can I do that or must the case value be a number or char? Thanks.

    ...why don't you use hashcodes!?!It's a hack, and it isn't guaranteed to work because:
    1. Different Strings are not guaranteed to generate different hashcodes.
    2. The algorithm used to generate the hashcode is not guaranteed to be the same on different platforms.
    3. The algorithm used to generate the hashcode is not guaranteed to be the same between different java versions.
    For example compare the hashcodes of "Aa" and "BB" or "Bb" and "CC" etc ...

  • How to Use String Patterns?

    Hai all,
    I need help, In my project i am using String patterns.
    i need to search a string which contains special characters.
    Ex:
    1.Abstract{meaning}
    I have to search Abstract in this case.
    Another case is:
    2.Moon
    in this i Have to search Moon and
    so on.
    For this Source Code I had written is:
    string input = args[0];
    String pattern = "[0-9].*+\\{*\\}";
    String pattern1 = "[0-9].*";
    string line = "1.Abstract{meaning}";
    string line1 = "1.Moon";
    if( (Pattern.matches(pattern, line))||(Pattern.matches(pattern1, line1)) )
    Pattern p = pattern.compile("\\.");
    Pattern p1 = pattern.compile("\\{");
    String[] tokens = p.split();
    String[] tokens1 = p1.split();
    for(int i = 0; i < tokens.length ; i++)
    for(int j = 0; j < tokens1.length ; j++)
    if((tokens.equals(input))||(tokens[j].equals(input)))
    System.out.println(tokens[i]);
    System.out.println(tokens[j]);
    in this code it matching the 2nd case. it is not matchinf the 1st case.
    please help me.
    Thanks

    look up for "Using formatters" in the FB help.
    Essentially you'll instantiate a format, NumberFormatter for
    numbers for example, and set it's properties like e.g. showing a
    thousand separator and then one some event of the TextInput --
    valueCommit for example -- you'll do something like:
    ti.text = nf.format(ti.text)
    this is would also give you opportunity to validate user
    input using the same formatter and valid event.
    ATTA

  • Best Match Algorithm

    Who will explain me best match algorithm for finding an attribute value in a table

    From what you wrote I would say:
    SELECT <WhateverYouWant> FROM <WhereverItIs>
    WHERE <TheAttribute> = <TheCriterion>
    So: '=' seems to be the best match 'algorithm' you can use.
    If I misunderstood your requirement, please elaborate.

  • On i-pad, when try to enable itunes match, it says, "you are not currently subscribed to iTunes Match. Use iTunes on your computer to subscribe." I am subscribed though! Then it says no my request and item not available in the U.S. store. WWJD?

    On i-pad, when I try to enable itunes match, it says, "you are not currently subscribed to iTunes Match. Use iTunes on your computer to subscribe." I am subscribed though! Then it says no to my request and, "item not available in the U.S. store." My Mac will not use update iTunes to any later version than the one I have because my os is also out of date, but when I try to update that i cant, so what do I have to do?  Please don't tell me I have to buy a new Mac to be up to date.

    On the iOS device you must be logged into the store with the exact same Apple ID you used to originally purchase the service. Go to Setting > iTunes &amp; App Stores and if necessary sign out/in and then enable iTM.

  • Special characters in XML structure when prepared using String

    Hi,
       I am preparing an XML structure using 'String'. I print the prepared XML structure in the server log. Issue is that I am seeing extra characters([[ and ]]) that I am not printing.
    Please let me know how to get rid of those.
    Code Excerpt
            String xmlHeader = "<?xml version=\"1.0\" encoding=\"utf-8\" ?>";
            String lsb_xmlcon = xmlHeader;
            logger.info("ReqXMLString Process  1  --->" + lsb_xmlcon);
            lsb_xmlcon = lsb_xmlcon +("\n");
            logger.info("ReqXMLString Process  1.1  --->" + lsb_xmlcon);
            lsb_xmlcon = lsb_xmlcon +("<REQUEST>");
            lsb_xmlcon = lsb_xmlcon +("\n");
            logger.info("ReqXMLString Process  1.2  --->" + lsb_xmlcon);
    Log
    ReqXMLString Process  1  ---><?xml version="1.0" encoding="utf-8" ?>
    ReqXMLString Process  1.1  ---><?xml version="1.0" encoding="utf-8" ?>[[
    ReqXMLString Process  1.2  ---><?xml version="1.0" encoding="utf-8" ?>[[
    <REQUEST>
    Thanks,
    Message was edited by: 996913
    This issue is observed only while running the code in server, not from Jdev.
    When we append the additional tags without new line character, "\n", there are no extra characters being added. Also, in other case also. where we used "Marshaller" to prepare the XML, we have seen this issue.
    After we set the below property to false, we got rid of the extra characters.
                            jaxbMarshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, false);
    Apparently the insertion of new line when the code runs on server(Weblogic 10.3.6.0) is creating the issue.
    Please let me know if anyone has come across a similar scenario.
    Thanks,

    I am building this XML in a servlet so ,right, DOM does process XML (even though a valid HTML file can be loaded into a DOM object) but if you build XML using DOM then write the XML out using PrintWriter and Transformer objects this will cause the XML to print out in your browser. If you view source on this XML you will see that the DOM object has translated all special characters to there &xxxx; equivalent. For a example: when the string (I know "cool" java) gets loaded into a attribute using the DOM object then wrote back out it looks like (I know &xxx;cool&xxx; java) if you view the source in your browser. This is what it should do, but the DOM object is not change the � to the "&xxxxx;". This servlet is acting as a gateway between a Java API and a windows asp. The asp will call the servlet expecting to get XML back and load it directly into a DOM object. When the windows DOM object gets the xml that I am returning in this servlet is throws a exception "invalid character" because the � was not translated to &xxxx; like the other characters were. According to the book HTML 4 in 24 hours (and other references) the eacute; or #233; are how you say "�" in HTML or XML. How do you say it?

Maybe you are looking for

  • How can I open all the application

    I dont know what happen in my ipod ..  I can't open all the applications..  what can I do for this problem?

  • RequestCenter emails not rendering correctly in Outlook 2007

    RequestCenter emails not rendering correctly in Outlook 2007 I'm having an problem where the RequestCenter automated emails are losing most of their HTML formatting when viewed in Outlook 2007.  When I look at the same email in Outlook 2003, the HTML

  • [SOLVED] How do I get systemd to stop handling core dumps itself?

    Based on advice in other threads, I did this: # ln -s /dev/null /etc/sysctl.d/coredump.conf # /lib/systemd/systemd-sysctl but it didn't work; /proc/sys/kernel/core_pattern still contains "systemd-coredump ...".  Furthermore, the processes that I have

  • Program that generates idoc in ale/edi

    friends can  you please tell  which  program creates an idoc or  how  are idocs generated  while  customizing ale and edi ., in which step?

  • Alert Prioritizing in ALRTCATDEF

    Hi experts, Is there any way to get the alerts based on for high priority interfaces? As of now I am getting alerts to all the interfaces when any common errors occurs. I am in need of grouping the high priority alerts. We are using solution manager