Filter cfquery by word length & given list values

I have a cfquery,that cfquery call up a column with text,
that text i need to filter on word length and also need a filter to
fitler some words like : and, or etc out. I tried and tried and
searched, but i'm stuck... Can anyone give me a direction ?
Thanks
Best regards,
Marco van den Oever

hi thx again, but it's more then one word :)
So i'll give a more clear vision:
I have a text in one column,i need to filter true that whole
text to not select words that are bigger then 6 characters, that's
one
Then i need to filter on specific words like: (and, or,this)
i know about the find and replace functions, but how do i give
filter criteria in one list, so filter with find and replace
function all the given words in a list, i dont want a whole page of
find and replace rules...
Thx again

Similar Messages

  • Filter column on word length

    How hard can it be??
    I just need to filter out a column, that column has text
    inside, i need to filter the words in that text out, on length and
    description...
    Who got a example code?

    how about this:
    <cfset mylist = queryname.textcolumn>
    <cfloop
    list="#mylist#"
    index="listItem"
    delimiters=" ,.!?#chr(10)##chr(13)#()">
    <cfif len(trim(listItem)) gt 5>
    <cfset temp = listFind(mylist, listItem, "
    ,.!?#chr(10)##chr(13)#()")>
    <cfset mylist = listDeleteAt(mylist, temp, "
    ,.!?#chr(10)##chr(13)#()")>
    </cfif>
    </cfloop>
    <cfoutput>
    #listChangeDelims(mylist, " ", " ,.!?#chr(10)##chr(13)#()")#
    </cfoutput>
    the above code:
    - sets a list
    - loops through the list
    - if current list element's length is gt 5, removes that
    elements from
    the list
    - outputs original list with only words of less than 5 chars
    long, with
    all delimiters replaced by space
    Azadi Saryev
    Sabai-dee.com
    http://www.sabai-dee.com

  • Build text-index based on a given list of words or phrases.

    I'm somewhat of a beginner to this text-indexing. I've been able to build and query a simple text-index and even implement my own list of stop-words. However, I'd like to be able to control the set of words that are indexed.
    For example, If I have a table that contains a CLOB field filled with text documents and I also have a list of 200 words:
    "TUBERCULOSIS"
    "DIABETES"
    "CHEMOTHERAPY"
    Can I generate an index that only indexes the words on that list and ignores all the other words? (the reverse of using a stop-list)
    Also, could it be done with a list of phrases instead of single words:
    "CARDIAC ABLATION"
    "ATRIOVENTRICULAR NODE"
    "PULMONARY ABSCESS"
    Thanks.

    Please see if you can use any of the pieces of the following example.
    SCOTT@orcl_11gR2> -- table containing list of phrases:
    SCOTT@orcl_11gR2> create table phrases
      2    (phrase        varchar2 (21))
      3  /
    Table created.
    SCOTT@orcl_11gR2> insert all
      2  into phrases values ('TUBERCULOSIS')
      3  into phrases values ('DIABETES')
      4  into phrases values ('CHEMOTHERAPY')
      5  into phrases values ('CARDIAC ABLATION')
      6  into phrases values ('ATRIOVENTRICULAR NODE')
      7  into phrases values ('PULMONARY ABSCESS')
      8  select * from dual
      9  /
    6 rows created.
    SCOTT@orcl_11gR2> -- ctxrule index on list of phrases:
    SCOTT@orcl_11gR2> create index phrases_idx on phrases (phrase)
      2  indextype is ctxsys.ctxrule
      3  /
    Index created.
    SCOTT@orcl_11gR2> -- table to hold combination of documents and matching phrases:
    SCOTT@orcl_11gR2> create table classifications
      2    (document  clob,
      3       phrase       varchar2 (60))
      4  /
    Table created.
    SCOTT@orcl_11gR2> -- context index on classifications table:
    SCOTT@orcl_11gR2> create index class_phrase_idx
      2  on classifications (phrase)
      3  indextype is ctxsys.context
      4  parameters ('sync (on commit)')
      5  /
    Index created.
    SCOTT@orcl_11gR2> -- regular index on classifications table:
    SCOTT@orcl_11gR2> create index class_phrase_idx2
      2  on classifications (phrase)
      3  /
    Index created.
    SCOTT@orcl_11gR2> -- table for documents:
    SCOTT@orcl_11gR2> create table documents
      2    (document     clob)
      3  /
    Table created.
    SCOTT@orcl_11gR2> -- trigger to populate classifications table from documents table:
    SCOTT@orcl_11gR2> create or replace trigger documents_bir
      2    before insert on documents
      3    for each row
      4  begin
      5    for r in
      6        (select phrase
      7         from      phrases
      8         where  matches (phrase, :new.document) > 0)
      9    loop
    10        insert into classifications (document, phrase) values
    11          (:new.document, r.phrase);
    12    end loop;
    13  end documents_bir;
    14  /
    Trigger created.
    SCOTT@orcl_11gR2> -- inserts into documents table:
    SCOTT@orcl_11gR2> insert all
      2  into documents values ('word1 tuberculosis word2')
      3  into documents values ('word3 diabetes word4')
      4  into documents values ('word5 chemotherapy word6')
      5  into documents values ('word7 cardiac ablation word8')
      6  into documents values ('word9 atrioventricular node word10')
      7  into documents values ('word11 pulmonary abscess word12')
      8  into documents values ('word13 word14 word15')
      9  select * from dual
    10  /
    7 rows created.
    SCOTT@orcl_11gR2> commit
      2  /
    Commit complete.
    SCOTT@orcl_11gR2> -- resulting population of classifications table:
    SCOTT@orcl_11gR2> column phrase   format a21
    SCOTT@orcl_11gR2> column document format a34
    SCOTT@orcl_11gR2> select phrase, document from classifications
      2  /
    PHRASE                DOCUMENT
    TUBERCULOSIS          word1 tuberculosis word2
    DIABETES              word3 diabetes word4
    CHEMOTHERAPY          word5 chemotherapy word6
    CARDIAC ABLATION      word7 cardiac ablation word8
    ATRIOVENTRICULAR NODE word9 atrioventricular node word10
    PULMONARY ABSCESS     word11 pulmonary abscess word12
    6 rows selected.
    SCOTT@orcl_11gR2> -- tokens that are indexed:
    SCOTT@orcl_11gR2> select token_text from dr$class_phrase_idx$i
      2  /
    TOKEN_TEXT
    ABLATION
    ABSCESS
    ATRIOVENTRICULAR
    CARDIAC
    CHEMOTHERAPY
    DIABETES
    NODE
    PULMONARY
    TUBERCULOSIS
    9 rows selected.
    SCOTT@orcl_11gR2> -- searches using text index:
    SCOTT@orcl_11gR2> set autotrace on explain
    SCOTT@orcl_11gR2> select phrase, document
      2  from   classifications
      3  where  contains (phrase, 'tuberculosis') > 0
      4  /
    PHRASE                DOCUMENT
    TUBERCULOSIS          word1 tuberculosis word2
    1 row selected.
    Execution Plan
    Plan hash value: 2513347404
    | Id  | Operation                   | Name             | Rows  | Bytes | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT            |                  |     1 |  2046 |     4   (0)| 00:00:01 |
    |   1 |  TABLE ACCESS BY INDEX ROWID| CLASSIFICATIONS  |     1 |  2046 |     4   (0)| 00:00:01 |
    |*  2 |   DOMAIN INDEX              | CLASS_PHRASE_IDX |       |       |     4   (0)| 00:00:01 |
    Predicate Information (identified by operation id):
       2 - access("CTXSYS"."CONTAINS"("PHRASE",'tuberculosis')>0)
    Note
       - dynamic sampling used for this statement (level=2)
    SCOTT@orcl_11gR2> select phrase, document
      2  from   classifications
      3  where  contains (phrase, 'cardiac ablation') > 0
      4  /
    PHRASE                DOCUMENT
    CARDIAC ABLATION      word7 cardiac ablation word8
    1 row selected.
    Execution Plan
    Plan hash value: 2513347404
    | Id  | Operation                   | Name             | Rows  | Bytes | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT            |                  |     1 |  2046 |     4   (0)| 00:00:01 |
    |   1 |  TABLE ACCESS BY INDEX ROWID| CLASSIFICATIONS  |     1 |  2046 |     4   (0)| 00:00:01 |
    |*  2 |   DOMAIN INDEX              | CLASS_PHRASE_IDX |       |       |     4   (0)| 00:00:01 |
    Predicate Information (identified by operation id):
       2 - access("CTXSYS"."CONTAINS"("PHRASE",'cardiac ablation')>0)
    Note
       - dynamic sampling used for this statement (level=2)
    SCOTT@orcl_11gR2> select phrase, document
      2  from   classifications
      3  where  contains (phrase, '%ab%') > 0
      4  /
    PHRASE                DOCUMENT
    DIABETES              word3 diabetes word4
    CARDIAC ABLATION      word7 cardiac ablation word8
    PULMONARY ABSCESS     word11 pulmonary abscess word12
    3 rows selected.
    Execution Plan
    Plan hash value: 2513347404
    | Id  | Operation                   | Name             | Rows  | Bytes | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT            |                  |     1 |  2046 |     4   (0)| 00:00:01 |
    |   1 |  TABLE ACCESS BY INDEX ROWID| CLASSIFICATIONS  |     1 |  2046 |     4   (0)| 00:00:01 |
    |*  2 |   DOMAIN INDEX              | CLASS_PHRASE_IDX |       |       |     4   (0)| 00:00:01 |
    Predicate Information (identified by operation id):
       2 - access("CTXSYS"."CONTAINS"("PHRASE",'%ab%')>0)
    Note
       - dynamic sampling used for this statement (level=2)
    SCOTT@orcl_11gR2> -- searches using non-text index:
    SCOTT@orcl_11gR2> select phrase, document
      2  from   classifications
      3  where  phrase = 'PULMONARY ABSCESS'
      4  /
    PHRASE                DOCUMENT
    PULMONARY ABSCESS     word11 pulmonary abscess word12
    1 row selected.
    Execution Plan
    Plan hash value: 4202264836
    | Id  | Operation                   | Name              | Rows  | Bytes | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT            |                   |     1 |  2034 |     1   (0)| 00:00:01 |
    |   1 |  TABLE ACCESS BY INDEX ROWID| CLASSIFICATIONS   |     1 |  2034 |     1   (0)| 00:00:01 |
    |*  2 |   INDEX RANGE SCAN          | CLASS_PHRASE_IDX2 |     1 |       |     1   (0)| 00:00:01 |
    Predicate Information (identified by operation id):
       2 - access("PHRASE"='PULMONARY ABSCESS')
    Note
       - dynamic sampling used for this statement (level=2)
    SCOTT@orcl_11gR2> select phrase, document
      2  from   classifications
      3  where  phrase = 'PULMONARY ABSCESS'
      4  /
    PHRASE                DOCUMENT
    PULMONARY ABSCESS     word11 pulmonary abscess word12
    1 row selected.
    Execution Plan
    Plan hash value: 4202264836
    | Id  | Operation                   | Name              | Rows  | Bytes | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT            |                   |     1 |  2034 |     1   (0)| 00:00:01 |
    |   1 |  TABLE ACCESS BY INDEX ROWID| CLASSIFICATIONS   |     1 |  2034 |     1   (0)| 00:00:01 |
    |*  2 |   INDEX RANGE SCAN          | CLASS_PHRASE_IDX2 |     1 |       |     1   (0)| 00:00:01 |
    Predicate Information (identified by operation id):
       2 - access("PHRASE"='PULMONARY ABSCESS')
    Note
       - dynamic sampling used for this statement (level=2)
    SCOTT@orcl_11gR2> select phrase, document
      2  from   classifications
      3  where  phrase like '%AB%'
      4  /
    PHRASE                DOCUMENT
    CARDIAC ABLATION      word7 cardiac ablation word8
    DIABETES              word3 diabetes word4
    PULMONARY ABSCESS     word11 pulmonary abscess word12
    3 rows selected.
    Execution Plan
    Plan hash value: 723026238
    | Id  | Operation                   | Name              | Rows  | Bytes | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT            |                   |     3 |  6102 |     0   (0)| 00:00:01 |
    |   1 |  TABLE ACCESS BY INDEX ROWID| CLASSIFICATIONS   |     3 |  6102 |     0   (0)| 00:00:01 |
    |*  2 |   INDEX FULL SCAN           | CLASS_PHRASE_IDX2 |     1 |       |     0   (0)| 00:00:01 |
    Predicate Information (identified by operation id):
       2 - filter("PHRASE" IS NOT NULL AND "PHRASE" LIKE '%AB%')
    Note
       - dynamic sampling used for this statement (level=2)
    SCOTT@orcl_11gR2>

  • Dynamic Parameter List questions: Length and Custom Values

    I've got a Crystal Report that I want to use Dynamic Values for.
    Right now... this report is simply a "SELECT stuff  FROM table" SQL query... with a parameter that the report uses to filter.
    I use a "Select DISTINCT value from table" to generate a list of values. I put those values into a txt. I then import the text into a static list. This creates a parameter list that is 11 "pages" long on the parameter screen. I also have "custom" values allowed. This is to allow for "new" values and also allow not needing to browse 11 pages for one or two known values.
    If I turn the parameter into a Dynamic List based on the same Select statement it stops at 5 pages, obviously cutting off half of the possible values.
    Dynamic List also removes the ability to do Custom Values. The filter option wouldn't be a bad alternative BUT it don't work for pages 6+ that aren't there.
    How can I remove the 5 page limit (or whatever it is) for Dynamic values?
    Thanks
    Chris
    Edited by: WernerCD on Aug 4, 2010 4:14 PM

    There is a limit of 1000 records in dynamic parameters. You can change this by adding a registry value:
    registry key : HKEY_CURRENT_USER\SOFTWARE\Business Objects\Suite 11.0\Crystal Reports\DatabaseOptions\LOV
    and then add a key called MaxRowsetRecords and give it a value.
    if you have Crystal 2008 then the above registry folder will say Suite 12.0.

  • Max length of Dropdown list value

    Hello,
    I wanted to know the maximum length that a dropdown list value can have in an offline Adobe form. Any help would be appreciated.
    Thanks,
    Rohini.

    Hi,
    Its always better to keep the no: of values in the drop down to hundreds.
    If you are running to 1000's, go for some other options like asking the user to enter the value and then do the check for that specific value. Also, usability of the drop down will be worse, if it has more values (just think of you selecting a value from a list of 10000 values - sorted or not).
    It may also result in the scroll bar growing so thin that it disappears, do try it out yourselves by increasing the values to about 130000 [:)].
    Thanks and Best Regards,
    Anto.

  • How to get metadata option list values derived from a table/view using SOAP

    I am writing an ASP.NET application that replicates some of the features of the SCS search interface. I have looked at the GET_DOC_METADATA_INFO service and its SOAP output. It has a few missing pieces of information, like the option list values for a field if that fields values are derived from a separate table/view. Some of the fields I am dealing with also make use of Dynamic Control Lists (DCL). Is there a way to get the DCL info using SOAP? I did notice that the dOptionListKey element contains the name of the view from which the option list values will be derived. However, I cannot find a service that takes the view name as a parameter to return the option list values. I have looked in the services reference manual, but I have not had any luck finding what I am looking for.
    TIA
    - Tyson
    Message was edited by: Add the word 'get' to the subject.
    Tyson

    Hello,
    What error you are getting? You code seems to be ok. I have tested below code and working fine
    XPathNavigator rTable = MainDataSource.CreateNavigator();
    String ddlSectionSelectedValue = Convert.ToString(rTable.SelectSingleNode("/my:myFields/my:ddlSection", NamespaceManager).Value);
    One think you can check that keep dropdown value display name and id same.
    Hemendra:Yesterday is just a memory,Tomorrow we may never see<br/> Please remember to mark the replies as answers if they help and unmark them if they provide no help

  • WHERE ... IN ... SELECT records for a given list of PKs (or FKs)

    Hello folks,
    Many times we need to retrieve records for given lists of PKs (or FKs), as:
    p_pk_list := '11,22,33';
    We work in 10g
    A co-worker of mine had a good idea (I thought) to "help" the optimizer and build a recordset in the FROM clause and use it later in WHERE
    SELECT ...
    FROM tableName a,
    (SELECT REGEXP_SUBSTR(p_pk_list, '[^,]+',1,ROWNUM) p_pk_id
    FROM dual
    CONNECT BY ROWNUM <= LENGTH(p_pk_list ) - LENGTH(REPLACE(p_pk_list ,','))) d_pk
    WHERE
    a.ID=d_pk.p_pk_id; -- (1)
    The tragedy is that it takes 4 seconds to retrieve 5 records from the table (no other joins). The table has about 40 columns though and there are about 51000 records. With the SELECT REGEXP_SUBSTR in the WHERE clause, it's a bit worse.
    If (1) is replaced by:
    a.ID IN (11,22,33,44,55);
    the execution takes 0.04 seconds.
    My questions are:
    1. Is this a bad idea to select records for a given list of PKs or FKs? Should one just go for one PK/FK instead?
    2. Why the stiff performance penalty?
    3. Ideally, it would be nice if this would work:
    a.ID IN (p_array);
    where p_array would be an array of integers
    Any elegant sollutions?
    Thanks a lot.
    Dan

    Check the explain plan for both statements.
    I would wager that the overhead you experience is due to the fact that you are comparing apples to oranges here.
    (SELECT REGEXP_SUBSTR(p_pk_list, '[^,]+',1,ROWNUM) p_pk_id
    FROM dual
    CONNECT BY ROWNUM <= LENGTH(p_pk_list ) - LENGTH(REPLACE(p_pk_list ,','))) d_pkreturns a string.
    a.ID IN (11,22,33,44,55);Is a list of numbers.
    If you check the explain plan for the regexp version, you should see an implicit conversion being done for you (converting the number column into a string for comparison) which means you can't use any indexes defined on a.id.
    If you want to use an array of numbers here's an approach using a built in array of numbers.
    declare
       v_number_list  sys.odcinumberlist   default sys.odcinumberlist();
    begin
       v_number_list.extend;
       v_number_list(v_number_list.count) := 100;
       v_number_list.extend;
       v_number_list(v_number_list.count) := 200;
       for vals in
          select *
          from all_objects
          where object_id in
             select column_value
             from table(cast(v_number_list as sys.odcinumberlist))
       loop
          dbms_output.put_line(vals.object_name);
       end loop;
    end;
    25  /
    I_TYPED_VIEW1
    I_NTAB2
    PL/SQL procedure successfully completed.
    ME_XE?Otherwise do an explicit TO_NUMBER on the regexp query so that you can use any indexes defined on the table in question.

  • Calendar Year variable is not showing listed values

    Hi,
    I have a query which I am running based on the standard variable ( 0CALYEAR ) input. When I run first time it shows the list of values in the selection editor and displays the result. But after executing when I am trying to change filter values in the output, it doesn't show list values as well if I enter manually, I am not getting the result. I am getting out put no data available....
    I created new variables on 0CALYEAR info object, but same problem. My query structure is
    In rows I just defined Calendar Year / Month ( so that I can get all months for that user entered Year ).
    In Columns I defined one Key Figure.
    Thanks
    Ganesh Reddy.
    Edited by: Ganesh Reddy on Mar 8, 2012 8:39 AM

    Problem is resolved my self. Removed 0CALYEAR from Char Restrictions to Default.
    Thanks
    Ganesh Reddy.

  • Re-Rendering the entire panel with components based on list value selection

    Hi,
    I am new to swing.Wondering how to refresh the panel with modified data on selection from list.
    Here's the code I am trying .
    the function below is called withdifferent set of value s being passed in based on add,remove conditions.
    public void initGroupPanelComponents(Vector GroupListData,Object[] sourceItemsArray,Object[] sinkItemsArray)
    groupsPanel = new JPanel();
    groupsPanel.setLayout(null);
    botPanel = new JPanel(new BorderLayout());
    botPanel.setSize(500,600);
    if(sourceItemsArray.length!=0){
    sourceLabel = "New Members:";
    sinkLabel = "New Available";
    System.out.print("color change now!");
    groupsPanel.setBackground(Color.YELLOW);
    botPanel.setBackground(Color.GRAY);
    //revalidate();
    else{
    groupsPanel.setBackground(Color.BLUE);
    botPanel.setBackground(Color.WHITE);
    groupsPanel.setSize( 500, 300 );
    groupsList = new JList(groupNameListData);
    groupsList.setBorder(BorderFactory.createLineBorder(Color.gray));
    groupsList.setBounds(10,10,350,230);
    groupsPanel.add(groupsList);
    groupsList.addListSelectionListener(new groupNameListAction());
    groupsList.setListData(groupNameListData);
    addButton = new JButton("Add");
    addButton.setBounds(385,35,80, 20);
    addButton.addActionListener(new addNewGroupAction());
    removeButton = new JButton("Remove");
    removeButton.setBounds(385, 70, 80, 20);
    groupsPanel.add(addButton);
    groupsPanel.add(removeButton);
    duellist= new DualListPanel(sourceItemsArray, sinkItemsArray, sourceLabel,sinkLabel);
    botPanel.add(duellist);
    botPanel.setBounds(0, 270, 500,600);
    botPanel.setOpaque(true);
    getContentPane().add(groupsPanel);
    groupsPanel.add(botPanel,BorderLayout.SOUTH);
    getContentPane().invalidate();
    getContentPane().validate();
    setResizable(false);
    setVisible(true);
    Relevant suggestions are most welcome.
    Thanks in Advance!

    Thanks much our help.
    But,apperars to me that I have added the groupsList to the panel in the method.
    What I am trying to acheive here is, when a value is selected from the groupsList, accrodingly,in the ListActionListener, Iam trying to repaint the whole Panel with the list component above and duellist panel (a panel with 2 list components by side and buttons at the centre)obtained from dualListPanel Class .
    Appears to work fine the first time when DualListPanel is nstantiated with certain data passed in.But when a particular list value on top is selected, i would require this dualListPanel to be instantiated with a new set of data passed in.This,for some reasons fails to come up.
    Would Appreciate if you could suggest accordingly for this.
    Thanks much again!

  • Multiple Filter on same field in sharepoint list

    Hi All,
    I had a SharePoint list with Product Code(single line), Product Name(single line), Phase(single line).
    Product Code
    Product Name
    Phase
    101
    abc
    P-I
    102
    def
    P-II
    103
    ghi
    P-III
    104
    jkl
    P-I
    105
    mno
    P-II
    106
    pqr
    P-III
    107
    stu
    P-I
    108
    vwx
    P-II
    109
    yz
    P-III
    110
    aab
    P-I
    Generally we can filter single value(P-I r P-II r P-III) on view with single value.
    i need an filter on "Phase" column by Two valuse on "P-II" and "P-III"
    Product Code
    Product Name
    Phase
    102
    def
    P-II
    103
    ghi
    P-III
    105
    mno
    P-II
    106
    pqr
    P-III
    108
    vwx
    P-II
    109
    yz
    P-III
    Filtering with Multiple Values on same field.
    Default, its supports up to ten values for filtering on one field, but i need more than 10 values..
    How can i achieve this..
    Advance Thanks..
    NS

    Hi NS,
    The "Filter" function could only filter 10 columns by default in list view page ViewNew.aspx and ViewEdit.aspx, the value 10 is hard-coded in these two pages which are located at  C:\Program Files\Common Files\microsoft shared\Web Server Extensions\14\TEMPLATE\LAYOUTS,
    you can look at and increase all the value 10 realted to Filter function, this will make viewnew.aspx and viewedit.aspx show more than 10 filters.
    Please firstly back up the orginial files viewNew.aspx and viewEdit.aspx page for a recovery if the file is corrupted by modifying, and do this test in a testing SharePoint environment before touching the production, this modification will affect to all
    the SharePoint lists viewNew and ViewEdit page.
    Also note that these modifications in the original file may be removed by the SharePoint CU or Service Pack. 
    Thanks
    Daniel Yang
    TechNet Community Support

  • Get a Hashtable key given a value

    hi,
    can anyone tell me how I get a the key of Hashtable value given the value. I cant see anything in the api, and having been trying to figure this out for hours.
    Hashtable numbers = new Hashtable();
    numbers.put("one", new Integer(1));
    numbers.put("two", new Integer(2));
    numbers.put("three", new Integer(3));
    if say I had value Integer 2, how can I find the key of this if I didn't know the key.

    I prefer HashMaps. You have to look for it yourself.import java.util.*;
    public class Test3 {
      public static void main(String[] args) {
        String[] data = {"Zero","One","Two","Three","Four","Five","Six"};
        HashMap hm = new HashMap();
        for (int i=0; i<data.length; i++) hm.put(data, new Integer(i));
    Random rand = new Random();
    Set keys = hm.keySet();
    for (int i=0; i<10; i++) {
    Integer value = new Integer(rand.nextInt(data.length));
    System.out.println("Looking for "+value);
    for (Iterator iter=keys.iterator(); iter.hasNext();) {
    Object key = iter.next();
    if (value.equals(hm.get(key))) {
    System.out.println(" Found key '"+key+"' with value '"+value+"'");
    }You might think about a reverse hashmap or else letting us know what you are trying to do.

  • Given List of Dictionaries

    When defining words, I love the fact that I can add a dictionary from the given list of Dictionaries in IOS 8. Unfortunately the exact dictionary I'd love to have (German - English) is not available. Is it possible to download a dictionary from a third party and add it to the list of available dictionaries in IOS 8?  Thanks in advance!

    Hi,
    Let me suggest a different way by which you can get a list of user with information from the LDAP which you can use :
    Here is one rule which gives you the list of user from LDAP where every user record is stored in form of a map :
    *<Rule name='xxxxxxxx'>*
    *<invoke name='getResourceObjects'>*
    *<ref>context</ref> --- pass this*
    User
    LDAP
    *<map>*
    searchContext
    xxxxx  --- your search context
    searchAttrsToGet
    *<list>*
    *.... *------ List of attributes you want to get for a user from LDAP**+
    *</ref>*
    searchScope
    one-level
    searchFilter
    *<ref>searchFilter</ref> ---- Your criteria to retrieve user*
    +*</map>*+
    *</invoke>*
    *</Rule>*
    Now store this List in a list in WF and access it in form. Now iterate through each user in the list in form :
    *<FieldLoop for='userObj' in='userInfoList'>  ---- userInfoList is the list of user got in the WF.*
    *<Field name='xxx'>*
    <Display class='Label'>*
    * <Property name='title' xxxx/>*
    * <Expansion>*
    * *<get>**
    **          <ref>userObj</ref>*   --- You can get the attribute for the Map*
    **          <s>cn</s>**
    **        </get>**
    ** </Expansion>**
    ** </Display>**
    ** </Field>**
    ** </FieldLoop>**
    Hope this will help.
    Regards,
    Surinder
    Edited by: Surinder_Singh_Bora on Apr 2, 2008 11:21 AM

  • List value retaining in Share point hosted app 2013

    I'm creating a Share point hosted app.
    I have a list inside Share point 2013 app. We are inserting records into the list through some other forms in app.
    But when we deploy the app, it is getting retracted & deployed again. So the list values are getting deleted.
    Is there any way to retain the Share point app list values during deployment?
    I tried the following things as suggested by some experts in internet.
    • Setting up the app catalog for app in Central admin and increment the version for every deployment.
    • I set the “deployment conflict resolution” property of list instance to “none”.
    But both the things not working.
    Please help me on this issue.

    Hi,
    According to your post, my understanding is that you wanted to keep the list data while redeploy the app project.
    As you had known, to keep the data in the app, we should first set up the  app catalog.
    Then we should upload your app with version 1.0.0.0. Install app to the desired web.
    After some code modification increment your version to 1.0.0.1 and upload again your app to catalog.
    Upgrade your installed app. More details about updating            
    http://sharepoint.stackexchange.com/questions/83021/app-deployment-keep-the-existing-data-in-internal-list-of-an-sharepoint-app
    Thanks & Regards,
    Jason
    Jason Guo
    TechNet Community Support

  • I purchased a album and only the first part of each song plays, even though the entire length is listed  in the file properities. Any Ideas?

    I purchased a album and only the first part of each song plays, even though the entire length is listed  in the file properities. Any Ideas?

    Assuming you are in a region where you are allowed to redownload your past purchases, delete the current copies from your iTunes library and then download again from your purchased history. If the problem persists, or that facility is not available in your region, contact the iTunes Store support staff through the report a problem links in your account history.
    tt2

  • Problem in sending drop down list value to jsp page showing  null value

    i am trying to send a drop down list value from client side to a jsp page but getting null value
    this is first page where i have accessed data from database and putted it in a drop down list
    <select name="sub">
         <%
         while(rs2.next())
         cat=rs2.getString(1);
         %><option value="<%=cat%>"><%=cat%></option><%
         }%></select>
    <input type="submit" value="Go"></input>
    now on submit i am going to another page
    where i want the selected value from drop down list to be printed
    i have used there
    <%
    String subject= request.getParameter( "sub.value" );
    out.println(subject);
    %>
    but it is printing null here what is the problem that i m facing
    thanx & reagrds
    sweety

    how to generate dynamically names for text boxes
    i am generating text boxes in while loop when selecting data from database
    while(rs1.next())
    name=rs1.getString(1);%>
    <tr>
    <td>1</td>
    <td><%out.println(name);
    //i am printing here stud_id a unique key and want to update records from following text boxes to particular stud_id
    %></td>
    <td><input type="text" name="????"></input></td>
    <td><input type="text" name="????"></input></td>
    <td><input type="text" name="????"></input></td>
    <td><input type="text" name="????"></input></td>
    </tr><%
    the structure is like
    stud_id | attended theory | conducted theory | ateended practical | conducted practical
    where attended theory, conducted theory............. are to be inputed manually for all students and then update in database
    so i am facing problem in generating names for textboxes how to do that
    so that those can be updated in database for particular student
    Thanx & Regards
    sweety

Maybe you are looking for