Search a String Vector for String

I can't figure out why this won't work. It is supposed to search the id vector for stringValue. It does not return any compilation errors, it just simply won't match stringValue with the id.get(i) method.
        for ( int i = 0; i < id.size(); i++ )
          if ( stringValue == id.get(i) )
            JOptionPane.showMessageDialog( null, "Item already exist.", "Error", JOptionPane.ERROR_MESSAGE );
            stringValue = null;
        }

"==" tests for object equality (i.e., that two variables contain the exact same object)
"equals()" tests for object equivalence (i.e., that two objects have the same value, whether or not they are the same object)
For strings, it's possible to have two different strings to contain the same sequence of characters. In this case, "==" returns false, while "equals()" returns true.

Similar Messages

  • ABAP String code for String.IndexOf("str")

    Hi,
    I'm totally new to abap. How can I determine iif one string is in another?
    Thanks,
    Doug

    Hi Doug,
    we have the comparison operator CS (contains string).
    IF 'My brother loves it' CS 'other'.
    evaluates TRUE.
    System variable SY-FDPOS will carry the offset where the string starts, here 5.
    Although we have ABAP objects now for some time, we are far away from languages like JAVA where all data objects are classes with predefined methods.
    But you are welcome to implement something comparable.
    Regards,
    Clemens

  • String[] args fights String... args

    Hi,
    I thought this error message was a joke at first, but it's for real:
    Arrayz.java:15: cannot declare both in(java.lang.String,java.lang.String[]) and in(java.lang.String,java.lang.String...) in krc.utilz.ArrayzPlease, would anyone care to offer an opinion as to WHY the compiler does not differentiate between String[] args and String... args. Obviously String... args is implemented internally as String[] args, but that really shouldn't effect the interface... and if they are internally equivalent then wny not allow a syntax that effectively declares both in one... It's just that I would have thought it was possible (and desirable) for the compiler & JVM to do the required parameter matching for both definitions... in my mind the calling parameter list of (String, String, String) is distinct from (String, String[]) ... Or does java (like C/C++) internally not differentiate between the types reference-to-String and reference-to-array-of-Strings and reference-to-array-of-array-of-Strings ????
    I'm just a tad miffed about this... I mean, it's easy to work around in at least a dozen simple ways, it's just that the compiler didn't do what I expected it to do, so it should just pull it's socks up, and, well, you know, Work!
    Here's the code... complete with compiler error.
    package krc.utilz.stringz;
    public class Arrayz
        * returns true if the given value is in the args list, else false.
        * @param value - the value to seek
        * @param args... - variable number of String arguments to look in
      public static boolean in(String value, String... args) {
        for(String a : args) if(value.equals(a)) return true;
        return false;
      //Arrayz.java:15: cannot declare both in(java.lang.String,java.lang.String[]) and in(java.lang.String,java.lang.String...) in krc.utilz.Arrayz
      public static boolean in(String value, String[] array) {
        for(String s : array) if(value.equals(s)) return true;
        return false;
    }Thanx all. Keith.

    I didn't know that. Cool!
    package forums;
    class VarArgsTester
      public static String join(String FS, String... args) {
        if (args==null) return null;
        if (args.length==0) return "";
        StringBuffer sb = new StringBuffer(args[0]);
        for (int i=1; i<args.length; i++) {
          sb.append(FS+args);
    return sb.toString();
    public static void main(String[] args) {
    System.out.println(join(" ", "Your", "momma", "wears", "army", "boots"));
    String[] words = {"But", "she", "looks", "very", "nice", "in", "them"};
    System.out.println(join(" ", words));
    I was expecting a compiler error from the line[
    pre]System.out.println(join(" ", words));
    Thanks ~Puce.

  • Urgent + Search a delimited file for more then one string

    Hi All
    Urgent please help I am trying to search a file for 2 different strings.
    This is how the command prompt will look like
    java match "-t|" -4 -f Harvey -10 -f Atlanta callbook.txtPlease help me with identifying how many search criterias have been entered on command prompt.
    "-t|" - denotes a delimiter
    -4 - denotes the field number
    -f - case sensitive
    Thanks

    Hi
    Thanks for your quick response and I apologise I will never put urgent on my posting again.
    C:\>java match "-t|" -4 -f Harvey -10 -f Atlanta callbook.txt
    This example lists records for Atlanta with first name Harvey.
    I am able to get one search criteria but when I have 2 as above (Harvey and Atlanta) I get lost I do not know how to get these arguments from the commandline and still do a search correctly. My code at the moment is doint a hard coded search so I was trying to extract the arguments that's where I got stuck.
    The main aim of my app is to search a delimited file for a search criteria passed through a command prompt.
    This is what I have done so far.
    import  java.io.*;
    import java.util.*;
    public class assess1
        static public void main(String args[])
            int[] totals = new int[10];
            try
                BufferedReader inFile = new BufferedReader(new FileReader(args[0]) );
                try
                    String line;
              String StrSearch = "HARVEY";
              int counter = 0;
                    boolean foundIt = false;
                    while((line = inFile.readLine()) != null)
                     // search for the string
                      String[] values = line.split("\\|");
                       for (String str : values) {
                   if (str.equals("HARVEY")) {
                               System.out.println(line);
                             System.out.println();
                        counter++;
              if (counter == 0) {
                   System.out.println("String not found");
              inFile.close();
                catch(IOException e)
                    System.err.println("IO exception");
                    System.exit(1);
                catch(NumberFormatException e)
                    System.err.println("Value " + e.getMessage() + "not numeric");
            catch(FileNotFoundException e)
                System.err.println( "Couldn't open " + e.getMessage() );
                System.exit(1);
    }

  • Searching for strings in a txt file

    I am writing a program based on the six degrees of seperation theory.
    Basically I have been given a (very large) txt file from the imdb with a list of all the films written in it.
    The text in the document is written like this:
    'Tis Autumn: The Search for Jackie Paris (2006)/Paris, Jackie/Moody, James (IV)/Bogdanovich, Peter/Vera, Billy/Ellison, Harlan/Newman, Barry/Whaley, Frank/Murphy, Mark (X)/Tosches, Nick (I)/Moss, Anne Marie
    (Desire) (2006)/Ruggieri, Elio/Micijevic, Irena
    .45 (2006)/Dorff, Stephen/Laresca, Vincent/Eddis, Tim/Bergschneider, Conrad/Campbell, Shawn (II)/Macfadyen, Angus/John, Suresh/Munch, Tony/Tyler, Aisha/Augustson, Nola/Greenhalgh, Dawn/Strange, Sarah/Jovovich, Milla/Hawtrey, Kay
    10 Items or Less (2006)/Ruiz, Hector Atreyu/Torres, Emiliano (II)/Parsons, Jim (II)/Freeman, Morgan (I)/Pallana, Kumar/Cannavale, Bobby/Nam, Leonardo/Hill, Jonah/Vega, Paz/Echols, Jennifer/Dudek, Anne/Berardi, Alexandra
    10 MPH (2006)/Weeks, Hunter/Armstrong, Pat (II)/Caldwell, Josh/Waisman, Alon/Keough, Johnathan F./Weeks, Gannon
    10 Tricks (2006)/Cruz, Raymond/Swetland, Paul/Selznick, Albie/Hennings, Sam/Gleason, Richard/Leake, Damien/Skipp, Beth/Ishibashi, Brittany/Thompson, Lea (I)/Jinaro, Jossara/Brink, Molly
    1001 Nights (2006)/Wright, Jeffrey (I)
    10th & Wolf (2006)/Lee, Tommy (VI)/Renfro, Brad/Ligato, Johnny/De Laurentiis, Igor/Luke Jr., Tony/Mihok, Dash/Garito, Ken/Capodice, John/Dennehy, Brian/Gullion, Jesse/Salvi, Francesco (I)/Cordek, Frank/Marsden, James (I)/Bernard, Aaron/Brennan, Patrick (VII)/O'Rourke, Ben/Gallo, Billy/Heaphy, James/Stragand, Dave/Vellozzi, Sonny/Pistone, Joe (I)/Morse, David (III)/Landis, Pete/Cain, Atticus/Trevelino, Dan/Demme, Larry/Sisto, Frank/Rosenbaum, Paul/Grimaldi, James (I)/Ribisi, Giovanni/Hopper, Dennis/Devon, Tony/Sigismondi, Barry/Kilmer, Val/Marinelli, Sonny/Cacia, Joseph/Rossi, Leo (II)/Tott, Jeffrey/Wawrzyniak, Aaron/Boombotze, Joey/Marie, Corina/Arvie, Michilline/Warren, Lesley Ann/De Laurentiis, Veronica/Moresco, Amanda/Boecker, Margot/Rossi, Rose/Latimore, Meritt/Dunlap, Doreen/Perabo, Piper/Horrell, Nickole/Sonnichsen, Ingrid
    11 Minutes Ago (2006)/Irving, Len/Welzbacher, Craig/Michaels, Ian/Dahl, Evan Lee/Gebert, Bob/Juuso, Jeremy/Hope, Trip/Green-Gaber, Renata/Dawn, Turiya/Reneau, Taryn/M
    Thats just 2 lines!
    what the program will do is take in a name (from a gui) of an actor/actress and find the smallest connection to a famous actor.
    So first things first, my idea of thinking is to search the file for K.E.V.I.N. B.A.C.O.N and all his films, and safe them into an array. Then do another search for films from the actor that the user entered at the gui. then find the shortest possible connection to both stars.
    my code for the search part of the program
    import java.io.FileInputStream;
    import java.io.IOException;
    import java.io.File;
    import java.io.FileNotFoundException;
    public class FileSearch {
         File aFile = new File("cast.06.txt");     
         FileInputStream inFile = null;
         String actor = "surname, forename"; // the person who will be the centre point e.g. kevin.bacon.
           //get the result of the actor from the gui will go here.
         public void openFilm()
              try
                  inFile = new FileInputStream(aFile);     
              catch(FileNotFoundException e)
                   System.out.println("Error");
    }The problem I have is that I can't work out how to search the txt file for a specific string/s and save them into an array. (I'm not sure if this is the best way to go about it or not at this stage).
    So whats the best way to search for an actor from that file and save the film title and the year of release?
    Hope this makes sense? what I hope the final program will be like is like this http://oracleofbacon.org/

    I went away and looked at regular expressions and this is what I came up with
    public class NameSearch{
         public static void main(String[] args)
              NameSearch ns = new NameSearch();
              ns.runIt();
         public void runIt()
              java.util.Scanner fileScan = null;
              try{
                   fileScan = new java.util.Scanner(new java.io.File("imdb.txt"));
              }catch(java.io.FileNotFoundException e)
                   e.printStackTrace();
                   System.exit(0);
              String token = null;
              String actor = "Surname, Forename";
    //real name will go in actor, left it like that for example
              while(fileScan.hasNext()){
                   token = fileScan.next();
                   Pattern pattern = Pattern.compile(actor);
                   Matcher m = pattern.matcher(token);
                   while(m.find())
                        System.out.println(m.start() + m.end());
    }This by any means not finished, I'm just trying to get to grips with regualr expressions. But when I run the program it doesn't return anything, from what I've tried to work out is it should return actor x amount of times they appear in the file. But when I run it nothing comes back (the actors name is in the text file) so I'm not too sure what I'm doing wrong, any suggestion please

  • How can I search a pages document for any of a string of words?

    I am a teacher and would like to search some short stories for vocabulary that I think will help my students get ready for the SATs one day. I have a long list of SAT vocabulary, close to 1,000 words, and I'm wondering if there's any quick way to just put those words into the Find menu and have it search for ANY of those individual words, rather than the whole string. Is that possible?
    Also, info on the arrival of the next version of iWork ('13?) would be awesome.
    Thanks.

    Locating and Searching Comment annotations.
    From the open Comments List you can sort and filter comments.
    This is discussed in Acrobat X Pro's online Help:
    http://help.adobe.com/en_US/acrobat/pro/using/WS58a04a822e3e50102bd615109794195ff-7e42.w.h tml 
    A sorted / filtered list can be used to generate a PDF comment summary report.
    http://help.adobe.com/en_US/acrobat/pro/using/WS75E00763-F15A-43a1-85B7-51B920B1181A.w.htm l
    You could then use Find on the output summary report.
    Using Acrobat X Pro you can embed an index in the PDF.
    http://help.adobe.com/en_US/acrobat/pro/using/WSC28D4DBB-6A78-4027-9E04-F50FE411CFB9.w.htm l
    Then use the Search tool. With the Search pane open tick "Include Comments".
    Search returns have an icon at the left of each instance.
    This portion of Acrobat X Pro's online Help shows and describes these.
    The third up from the list's bottom is the Comments icon.
    http://help.adobe.com/en_US/acrobat/pro/using/WSC28D4DBB-6A78-4027-9E04-F50FE411CFB9.w.htm l 
    One of these or combinations may met your needs. 
    Be well...

  • Is it possible to search for strings containing spaces and special characters?

    In our RoboHelp project, there are figures with text labels such as Figure 1, Figure 3-2, etc.
    When I search for "Figure 3" I get all pages containing "Figure" and "3", even if I surround it in quotes.  Similarly, searching for "3-2" treats the '-' character as a space and searches for all pages containing '3' or '2'.
    Is there a way to search for strings containing spaces and special characters?

    In that case I think the answer is no if you are using the standard search engine. However I believe that Zoom Search does allow this type of searching. Check out this link for further information.
    http://www.grainge.org/pages/authoring/zoomsearch/zoomsearch.htm
      The RoboColum(n)
      @robocolumn
      Colum McAndrew

  • I need to search in a line a string but...

    Hi there!, I hope you can help me with my problem...
    I have a line from an html file like this:
    String lineToSearch = "<b>This is a line with a different font<b>"
    Well, I have a method that searchs a word or a character in the variable lineToSearch, and it works fine, but it doesn't know to differentiate between a normal character and the tags of an html file, if I want to search the word "font" in the variable lineToSearch, works good, but if the variable have a different line like this:
    lineToSearch = "<font color = yellow>This is a line with a different font</font>"
    find three time the word, how can I avoid the tags???

    Ok the logic is to try to indentify in your string the <bla bla > statements and process only the value...one way (prob my implementation is not very nice but works ok for now
    in a string like that :
    "<font color = yellow>This is a line with a different font</font>"
    we can identify 2 <bla bla> substrings and the value substring
    The thing we want is the string between the > and the < right?
    This is a line with a different font<So the logic of the code is convert string to char[] array .search the indexes of the < and > characters
    in a string like that < blabla > adfasdfasdf </blabla> searching for < and > will give as 4 indexes
    so using the indexes of the first > and the second < as they appear in the string we give as the value only...after that you can call your method to process the string
    public String giveSubString(String s) {
    s="<font color = yellow>This is a line with a different font</font>";
    char[]r=s.toCharArray();
    Vector indexes= new Vector();
    for(int x=0;x<r.length;x++)
    if(r[x]=='<'||r[x]=='>')
    indexes.add(new Integer(x));
    String s1 = s.substring(((Integer)(indexes.get(1))).intValue()+1,((Integer)(indexes.get(2))).intValue());
    System.out.println(s1);
    return s1;
    This logic wont work for a string like that <bla><c>sadfsadfasdf</c></bla> but you can easily modify the logic with the indexes
    I hope it helped...if your need further assistance dont hesitate to email me ..because I cant visit the forum so often
    [email protected]

  • How to search special characters in a string

    Hi all,
    I want to search special characters in all string columns and all rows in the table.
    The table has about 5 string columns and about 5.000.000 rows. For each row and column, I have to search entries, which included special characters like ", !, ? or something else (f.ex. "Mama?Mia" or "!!!Hotel out of order!!!"). The problem, the character could stand at each position in the string.
    What's the best and most performance possibility to search such entries?? Is it possibility only by SQL; is there a special function for this?? Or must I use PL/SQL.
    Thanks for helping
    Dana

    HTH
    Laurent Schneider
    OCM DBA
    SQL> select * from z;
    S
    Mama?Mia
    a b c
    123
    SQL> select * from z where translate(s,'~ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz1234567890','~') is not null;
    S
    Mama?Mia
    SQL> select * from z where regexp_like(s, '[^[:alnum:][:space:]]');
    S
    Mama?Mia

  • Search set of Characters in String in mapping

    Hello All,
    I want to search for a set of characters in a string and I want to do this in mapping.
    Can anyone help me in resolving this?
    Example:-
    String = "SAP PI is an Integration Tool"
    Search = "an Integ"
    OR
    just search for "an Integ" in the String.
    The String length can always change and the position of "an Integ" can also change.
    Please help!
    Thanks for your help and time,
    Abhi
    Edited by: Abhi_1516 on Nov 19, 2009 7:08 PM

    Thanks Sunil, for your quick response.
    I tried using that, but it's returning the index of the first occurrance of the Sub String and not "-1" as you have described.
    I am trying to write an UDF and I am getting syntax error ... where I am doing wrong?
    +int ind = (param2 + 7);+
    String str1 = param1.substring(param2,ind);
    String flag;
    if ( (str1.equals("an Integ")) )
    +     flag = "a";+
    else
    +     flag = "b";+
    return (flag);
    param1 and param2 are input parameter in the UDF.
    THanks for your help,
    Abhi
    Edited by: Abhi_1516 on Nov 19, 2009 7:35 PM

  • ORA-13223: duplicate entry for string in SDO_GEOM_METADATA table and

    I got the above error while trying to insert a record into the table SDO_GEOM_METADATA. However, when querying this table I did find any duplicate table_name, column_name pair that match with the error.
    Here are the steps that I worked on:
    1. Add a geometry column into an existing table.
    ALTER TABLE GEO_MAP ADD (ORG_GEOM mdsys.sdo_geometry);
    2. Register the new column into mdsys
    insert into USER_SDO_GEOM_METADATA
    values ('GEO_MAP','ORG_GEOM',
    mdsys.sdo_dim_array(
    mdsys.sdo_dim_element('LONG',-180,180,0.00005),
    mdsys.sdo_dim_element('LAT',-90,90,0.00005)
    8307)
    I got the error ORA-13223: duplicate entry for string in SDO_GEOM_METADATA table even there was no such record in there.
    3. I inserted values in the column ORG_GEOM fine.
    4. However, when I tried to create the index for this column I got the error:
    ORA-29855: error occurred in the execution of ODCIINDEXCREATE routine
    ORA-13203: failed to read USER_SDO_GEOM_METADATA view
    ORA-13203: failed to read
    Please help.
    Thanks.

    SQL> select * from mdsys.sdo_geom_metadata_table;
    SDO_OWNER SDO_TABLE_NAME
    SDO_COLUMN_NAME
    SDO_DIMINFO(SDO_DIMNAME, SDO_LB, SDO_UB, SDO_TOLERANCE)
    SDO_SRID
    QW_USER1 GEO_REF
    LOC_GEOM
    SDO_DIM_ARRAY(SDO_DIM_ELEMENT('LONG', -180, 180, .00005), SDO_DIM_ELEMENT('LAT',
    -90, 90, .00005))
    SDO_OWNER SDO_TABLE_NAME
    SDO_COLUMN_NAME
    SDO_DIMINFO(SDO_DIMNAME, SDO_LB, SDO_UB, SDO_TOLERANCE)
    SDO_SRID
    8307
    MDSYS SDO_CMT_CBK_RTREE_TAB
    GEOM
    SDO_DIM_ARRAY(SDO_DIM_ELEMENT('X', -180, 180, .000000005), SDO_DIM_ELEMENT('Y',
    SDO_OWNER SDO_TABLE_NAME
    SDO_COLUMN_NAME
    SDO_DIMINFO(SDO_DIMNAME, SDO_LB, SDO_UB, SDO_TOLERANCE)
    SDO_SRID
    -90, 90, .000000005))
    The situation is we have 2 tables (GEO_MAP, and GEO_REF) that have spatial columns. Everything worked fine until when one of the queries that searched through the table GEO_MAP ran so slow, we decided to rebuild the related spatial index by dropping and recreating it. However, after I dropped it I could not recreated. Keep getting the error:
    ORA-29855: error occurred in the execution of ODCIINDEXCREATE routine
    ORA-13203: failed to read USER_SDO_GEOM_METADATA view
    ORA-13203: failed to read
    Any help is very much appreciated.

  • Core dump when clearing vector of std::string/creating std:string

    Hi,
    I am seeing a couple of core dump which point to std::strings like the ones below. The application is a multi-threaded application and compiled on sun4u 5.8 sparc with Sun Studio 11 C++ compiler 5.8 Patch 121017-16. The stack trace is being shown from a shared library which we built and is being used by our daemon service. I stack traces points to code where simple operation like clearing of vector<std::string> or creating or erasing std::string. The runtime environment is Solaris 5.10 sun4u sparc with SUNWlibC patches of 119963-19 and 119963-10.
    We had an issue with clearing of vectors earlier whcih we solved by applying some compiler patches. This issue coming even after we have built the binaries with compiler patches. I have made sure that both the daemon and the shared library are all built with same compiler version. I would appreciate if any possible direction can be given for this.
    ======================1=================================
    $clibc.so.1`t_splay+0x10(82d828, 38, 753d736f, ff324c28, fe0b03a8, 732c6f3d)
    libc.so.1`realfree+0x8c(82d7e8, 39, d995c, fe7153a4, 0, 0)
    libc.so.1`_free_unlocked+0xb0(fe0b9224, 0, d9188, fe0b92a4, fe0b03a8, 555810)
    libc.so.1`free+0x24(555810, 555810, d91c8, fe041ebc, fe0b03a8, 555831)
    libCrun.so.1`void operator delete+4(555810, 0, 0, ffffffff, 59, 0)
    libCstd_isa.so.1`std::basic_string<char,std::char_traits<char>,std::allocator<char> >::~basic_string #Nvariant 1+0x84(0, 555838, 2160c,
    555838, 38, 754b3c)
    ======================2=================================
    $clibc.so.1`t_splay+0xf4(590e78, 3b0, 6934c8, fdfd6eb0, fe0b03a8, 0)
    libc.so.1`realfree+0xb8(590e78, 5b, d995c, 0, 0, 5912b8)
    libc.so.1`cleanfree+0x5c(0, 19, d90ac, fe042230, fe0b03a8, fe0b92a4)
    libc.so.1`_malloc_unlocked+0xf4(8, 0, 0, fe29c734, fe0b3910, fe29c734)
    libc.so.1`malloc+0x4c(8, 1, da058, fe85eb20, fe0b03a8, fe0ba518)
    libCrun.so.1`void*operator new+0x28(8, 66c918, 7, fed6bf10, 14e98, 3afc38)
    ======================3=================================
    C [libc.so.1+0x57204] free+0x2c
    C [libCrun.so.1+0x665c] void operator delete(void*)+0xc
    C [libCstd_isa.so.1+0xd9ac]
    cDstdMbasic_string4Ccn0ALchar_traits4Cc__n0AJallocator4Cc___Hreplace6MIIpkc
    III_pc_+0x120
    C [libCstd_isa.so.1+0x1a488]
    std::string &std::string::erase(unsigned,unsigned)+
    0x5c
    ======================4=================================
    C [libCstd_isa.so.1+0x119c8]
    cDstdMbasic_string4Ccn0ALchar_traits4Cc__n0AJallocator4Cc___M__sun_append6M
    rk1_r1_+0x10
    ======================5=================================
    C [libc.so.1+0x5639c] malloc+0x54
    C [libCrun.so.1+0x70a4] void*operator new(unsigned)+0x30
    C [libCstd_isa.so.1+0xc69c]
    cDstdMbasic_string4Ccn0ALchar_traits4Cc__n0AJallocator4Cc___I__getRep6MII_p
    nH__rwstdM__string_ref4Ccn0B_n0C____+0x60
    C [libCstd_isa.so.1+0xdad0]
    cDstdMbasic_string4Ccn0ALchar_traits4Cc__n0AJallocator4Cc___Hreplace6MIIpkc
    III_pc_+0x1c0
    C [libCstd_isa.so.1+0xf5b4]
    std::string &std::string::operator=(const char*)+0x1
    08
    Edited by: bekz007 on Feb 24, 2010 1:55 PM

    Hi Clamage,
    The the application in question is built using various third party libraries and we will not be able to compile it with SunStudio 12. Even if we do that we may have to test for functionality which can be a major task now.
    Is there any other way in which I can proceed to verify this in client's env?
    Running the app in DBX didn't work as when the process was started it said
    dbx: internal warning: rtc: ld/st instruction user %r6 at 0xaca16840 in /opt/oracle/client102_1/lib32/libnnz10.so`SHATransform_SOL
    dbx: system error: cannont recover; Access checking disabledBelow give are the few stack traces we got recently and most of them are coming malloc
    -------------------------- Run3----------------------------------------------------
    fdfd710c t_splay  (590e78, 3b0, 6934c8, fdfd6eb0, fe0b03a8, 0) + f4
    fdfd6af0 realfree (590e78, 5b, d995c, 0, 0, 5912b8) + b8
    fdfd734c cleanfree (0, 19, d90ac, fe042230, fe0b03a8, fe0b92a4) + 5c
    fdfd64a4 _malloc_unlocked (8, 0, 0, fe29c734, fe0b3910, fe29c734) + f4
    fdfd6394 malloc   (8, 1, da058, fe85eb20, fe0b03a8, fe0ba518) + 4c
    fed5709c void*operator new(unsigned) (8, 66c918, 7, fed6bf10, 14e98, 3afc38) + 28
    fe713c78 bool Safe::Session::addAttr(const char*,const char*) (5f6478, fe831127, 7d0d50, fe856bd4, 0, fe831127) + 60
    fe69ac5c void Safe::Context::populateSession(Safe::Session*,Safe::GlobalUser*,Safe::User*,bool) (378400, 5f6478, 3afc38, fe8310ac, 1, fe831232) + e34
    fe699c58 void Safe::Context::populateSessionQs(std::deque<Safe::Session*>&,std::deque<Safe::Session*>&) (378400, 0, 378830, 2, fe856bd4, 0) + 15e0
    fe77cd64 void Safe::Cache::threadLoop() (3787e8, 378898, 378830, 0, 0, 0) + 54a4
    fe7762f4 ???????? (3787d0, 0, 0, fe856bd4, fdea5a00, 16800)
    fe7455d4 void*ithread_func(void*) (37a960, fe7762d8, fe856bd4, 0, 37a960, 1) + 48
    fe048968 _lwp_start (0, 0, 0, 0, 0, 0)
    -------------------------- Run4----------------------------------------------------
    fdf5710c t_splay  (659620, 58, 891658, fdfc0a2c, fe0303a8, 601200) + f4
    fdf56ac4 realfree (6595c0, 59, d995c, 0, 0, 71ad08) + 8c
    fdf5734c cleanfree (0, 7, d90ac, fed5631c, fe0303a8, fe0392a4) + 5c
    fdf564a4 _malloc_unlocked (798, 418, 4a52a8, 4a52b0, fffffffc, fd66d060) + f4
    fdf56394 malloc   (794, 1, da058, fe75d8b0, fe0303a8, fe03a518) + 4c
    fed5709c void*operator new(unsigned) (794, 6014a8, 6014a4, fed6bf10, 14e98, fe86ce2c) + 28
    fe68e650 bool Safe::Context::privSearchGlobalUsers(std::deque<Safe::Filter*>&,std::deque<Safe::GlobalUser*>&,Safe::Error&,bool) (193088, 9d7af8, fbb7a77c, fbb7a614, fbb7a4f4, 1) + 1e8
    fe6a5370 void Safe::Context::populateSessionQs(std::deque<Safe::Session*>&,std::deque<Safe::Session*>&) (193088, 19348c, 1934b8, 7858c4, fe86321c, 0) + 868
    fe7891f4 void Safe::Cache::threadLoop() (193470, 193520, 1934b8, 0, 0, 0) + 54a4
    fe782784 void*pollthreadfunc(void*) (193458, 0, 0, fe86321c, fde92a00, 16800) + 1c
    fe751a64 void*ithread_func(void*) (4525b0, fe782768, fe86321c, 0, 4525b0, 1) + 48
    fdfc8968 _lwp_start (0, 0, 0, 0, 0, 0)
    -------------------------- Run5----------------------------------------------------
    libc.so.1`malloc+0x4c(a, 1, da058, fd88c710, fe0303a8, fe03a518)
    libCrun.so.1`void*operator new+0x28(a, fb878177, 0, fec6bf10, 14e98, 3)
    libxerces-c.so.26`void*xercesc_2_6::MemoryManagerImpl::allocate+0x14(1c3e88, a, 55, fd9cea50, fda366e8, 1)
    libxerces-c.so.26`xercesc_2_6::XMLTranscoder::XMLTranscoder #Nvariant 1+0x60(fb877d20, fe874e52, 5, 1c3e88, 0, fffc00)
    libxerces-c.so.26`xercesc_2_6::XMLUTF8Transcoder::XMLUTF8Transcoder #Nvariant 1+0x20(fb877d20, fe874e52, 5, 1c3e88, 0, 0)
    libassafe_api.so`char*ispUtil::XMLChtoUTF8+0x4c(606c338, 67c, 400, fe86321c, 5, 1)
    libassafe_api.so`istring::istring #Nvariant 1+0x30(fb877f7c, fe86b470, fe86b448, fe86321c, 7a0, 400)
    libassafe_api.so`void ParseUtil::endElement+0xa0(c1f888, 693288, 606c338, fe86321c, 2, 2d4a160)
    libxerces-c.so.26`void xercesc_2_6::SAX2XMLReaderImpl::endElement+0x10c(876788, ece8e0, 1, fe875c80, 6043eb8, fe76d448)
    libxerces-c.so.26`void xercesc_2_6::IGXMLScanner::scanEndTag+0x644(5cb4628, fb878177, 0, fd9cea50, fd864978, 3)
    libxerces-c.so.26`bool xercesc_2_6::IGXMLScanner::scanContent+0x160(5cb4628, 0, 0, fd9fdb24, fd869d60, 1)
    libxerces-c.so.26`void xercesc_2_6::IGXMLScanner::scanDocument+0x78(5cb4628, 0, fd85dfb0, fd87214c, 1c3e88, 2800)
    libxerces-c.so.26`void xercesc_2_6::SAX2XMLReaderImpl::parse+0x8c(876788, fbf8d0, 4a, fe84a145, 0, 1c3e88)
    libassafe_api.so`bool ParseUtil::Parse+0x1c0(c1f888, 67c, fb878914, 16c82d0, fe86321c, fda348dc)
    libassafe_api.so`bool ispUtil::Parse+0x34(7fd350, fb878914, fe76ffc0, fe86321c, f320c, f3000)
    libassafe_api.so`void PozObject::poMapInterface+0xb08(49a40a8, 2, fb8787b8, fb878914, fe86321c, 0)
    libassafe_api.so`void PortableObject::poParseCallback+0x314(49a40a8, 7, fb8788d4, fb878954, fb878914, fb8787b8)
    0xfe76e828(49a40a8, 0, fb8788d4, fb878954, fb878994, fb8789c0)
    libassafe_api.so`void ParseUtil::endElement+0x224(3954508, 17d45a0, 1af1320, fe86321c, 395453c, a2f4f8)
    libxerces-c.so.26`void xercesc_2_6::SAX2XMLReaderImpl::endElement+0x10c(96ed20, 8686b0, 1, fe875c80, 60786c0, fe76d448)
    libxerces-c.so.26`void xercesc_2_6::IGXMLScanner::scanEndTag+0x644(4a533e0, fb878b4f, 0, fd9cea50, fd864978, 3)
    libxerces-c.so.26`bool xercesc_2_6::IGXMLScanner::scanContent+0x160(4a533e0, 0, 0, fd9fdb24, fd869d60, 1)
    libxerces-c.so.26`void xercesc_2_6::IGXMLScanner::scanDocument+0x78(4a533e0, 0, fd85dfb0, fd87214c, 1c3e88, 2800)
    libxerces-c.so.26`void xercesc_2_6::SAX2XMLReaderImpl::parse+0x8c(96ed20, 10fd780, 17eb0, fe84a145, 0, 1c3e88)
    libassafe_api.so`bool ParseUtil::Parse+0x1c0(3954508, 67c, fb878ed0, 6023ac8, fe86321c, fda348dc)
    libassafe_api.so`bool ispUtil::Parse+0x34(49a40a8, fb878ed0, fe76e800, fe86321c, cd0840, fe86321c)
    libassafe_api.so`void PortableObject::poImportObject+0x18c(49a40a8, fb878ed0, fff0b5e4, f4800, fe86321c, 3)
    libassafe_api.so`void Safe::StoredObject::soExport+0x2e4(5bb7250, 49a40a8, 320, 318, ffffffff, 5bb725c)
    libassafe_api.so`PozObject*Safe::StoredObject::getPozObject+0x38(5bb7250, 0, 0, 49a40a8, fe23e01c, 0)
    libassafe_api.so`bool Safe::GlobalUserGroup::soMap+0x2c(5bb7250, 1, 0, 0, fb879428, 400)
    libassafe_api.so`PozObject*Safe::StoredObject::soExport+0x30(5bb7250, 1, 5d916c0, fe6cec54, fe86cf4c, fe724618)
    libassafe_api.so`Safe::GlobalUserGroup*Safe::Context::getCachedGlobalUserGroup+0x1f4(1dfc00, 10a2538, 2153918, 0, 0, 0)
    libassafe_api.so`bool Safe::Context::expandGlobalUserGroup+0x20(1dfc00, 6e, 3541cd4, fb87a3f8, 7a0, 10a2538)
    libassafe_api.so`void Safe::Context::populateSession+0x195c(1dfc00, 3541c78, 0, 59b5544, 52935d0, ffffffff)
    libassafe_api.so`void Safe::Context::populateSessionQs+0x15e0(1dfc00, 0, 1e0030, 1, fe86321c, 0)
    libassafe_api.so`void Safe::Cache::threadLoop+0x54a4(1dffe8, 1e0098, 1e0030, 0, 0, 0)
    0xfe782784(1dffd0, 0, 0, fe86321c, fde23a00, 16800)
    libassafe_api.so`void*ithread_func+0x48(4cef10, fe782768, fe86321c, 0, 4cef10, 1)Edited by: bekz007 on Mar 17, 2010 12:23 PM

  • Search muliptle tag in a String

    Hi,
       I want to search some muliptle tag in a String and their index .  i can get serach() but it gives only first occurence of a word,not for all. so do u  have any idea how to fix this Problem,please Help .
       I am working in cs5.

    Check this
    http://www.baconandgames.com/2011/11/29/find-all-strings-within-a-string-with-as3/

  • Search string-1 in string-2 gives wrong results.

    Hi,
    I am searching for the string 'COM' in the sentence
    below.
    I am getting the string positons of string "COM"
    as 1 and 16.
    It Should be 1 and 19.
    thanks
    sharath
    SET SERVEROUTPUT ON
    DECLARE
    str VARCHAR2(200):='COM-1 Hello world COM-1 speaking';
    pos NUMBER ;
    ps NUMBER :=0 ;
    srch VARCHAR2(20) :='COM' ;
    BEGIN
    While( ps <= length(str))
    Loop
    pos := instr(str,srch);
    If pos > 0 then -- found string COM
    str := substr(str,pos + length(srch));
    dbms_output.put_line('COM found in pos ==> ' || pos );
    End If;
    ps := ps + 1;
    END LOOP;
    END;

    I believe the problem is that you are redefining the variable str within your loop. Once you find the first occurrence of "COM" in the string, you modify the string to remove that occurrence and then search again. The logic of your stored procedure is
    Loop 1:
    str = "COM-1 Hello world COM-1 speaking"
    - first occurrence of COM is at position 1
    Loop 2:
    str = "-1 Hello world COM-1 speaking"
    - first occurrence of COM is at position 16 in this new string
    Since you are removing the first three characters of the string when you call substr at the beginning of the second loop, you're looking for the position of "COM" in a slightly different string the second time around, hence the confusion.
    If you want to find the position in the original string, you'd want something like
    CREATE OR REPLACE PROCEDURE findOccurrence( string IN varchar2, search IN varchar2, offset IN number)
    AS
      currentPosition NUMBER;
    BEGIN
      currentPosition := INSTR( string, search );
      IF( currentPosition > 0 )
      THEN
        dbms_output.put_line( 'Search string found at position ==> ' || to_char(currentPosition+offset));
        findOccurrence( substr( string, currentPosition+length(search) ),
                        search,
                        currentPosition+length(search)+offset-1 );
      END IF;
    END;
    scott@jcave > exec findOccurrence( 'COM COM COM', 'COM', 0 );
    Search string found at position ==> 1
    Search string found at position ==> 5
    Search string found at position ==> 9
    PL/SQL procedure successfully completed.Justin
    Distributed Database Consulting, Inc.
    http://www.ddbcinc.com/askDDBC

  • Strings, vector output? HELPP!!!

    Hi!
    How would I Store strings thats entered from the command prompt into a vector and print them out?
    I've been trying to do this for 2 days.....I have erased my code and burnt my sorry java book that really sucks! If anyone could help me I would really appreciate it. Thanx.

    I'm assuming this is a J2SE 1.5.0 question, so I'll
    use as many of the new language features as I can.
    import java.util.*;
    public class Vec {
    public static void main(String... args) {
    Vector<String> vec = new Vector<String>();
    for (String s : args) vec.add(s);
    System.out.printf("%s%n", vec);
    What about using import static java.lang.System.*; and hence out.printf("%s%n", vec); Isn't this a new language features that you are able to use?

Maybe you are looking for