How to test if a day string is valid

A day in given month of a given year is valid if it meets the following conditions:
1)dayString >0
2)dayString < days in a given month of a given year
3)dayString.matches("^[0-9]{1,2}$")
i.e., the day must be a positive, number like, and must not be greater than a the number of days in a given month.
How to calculate the days in a given month of a given year?
Thanks to help.
Scott
P.S.:
In javascript it can be calculated by:
32 - new Date(year, mon-1, 32).getDate()
An option could be using SimpleDateFormat function, but unfortunately, it can only tell if a date is valid, not the specific day string. What I want to know is if the day string is valid for a given month and year.

scottjsn wrote:
How to calculate the days in a given month of a given year?The java.util.Calendar class has a getActualMaximum() method.
An option could be using SimpleDateFormat function, but unfortunately, it can only tell if a date is valid, not the specific day string. That doesn't make any sense to me. If the "day string" isn't valid, the date isn't valid.
~

Similar Messages

  • Simple Java Question - How to test if a given string is numeric or not

    Hi Experts,
    I have written one Java program. It fetches user ID from UME. The code is as below:
    Iterator itr = role.getUserMembers(true);
    while (itr.hasNext()) {
    String uniqId = (String) itr.next();
    IUser thisUser = myUserFactory.getUser(uniqId);
    wdComponentAPI.getMessageManager().reportSuccess("here "+thisUser.getUid() );
    Used ID is thisUser.getUid() . I have to find out all user IDs which are numeric.
    Do we have any standard Java program (API) to find out whether thisUser.getUid()  is numeric or not.
    Regards,
    Gary

    Hi
    Just try to parse this string to integer or long number and catch the NumberFormatException.
    Somthing like:
    try
       Integer.parseInt(userIdString);
    catch(NumberFormatException e)
      //do sume thing when user id is not number
    good luck

  • How to test a class with array which is being declared?

    Dear All
    I am doing a question which involved the day of the week.
    I had written a class which is name WeekDay and here is the code :
    public class WeekDay
    private int index;
    private static String[]dayStrings = {"Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"};
    public WeekDay(int idx)
    index = idx;
    public int getIndex()
    return index;
    public static String nextDay(int index)
    index+=1;
    return dayStrings[index];
    The above compile well with no issue.
    Here is the problem which i need to seek your help, I had created a program to test the above program.
    But I am not sure how to test it.
    Here is what I had written :
    public class TestWD
    public static void main(String[]args)
    System.out.println("Please key in a digit to get the day of the week\n");
    System.out.println("Sun, Mon, Tue.....Sat is represented by 0,1,2,3...6");
    int idx = Integer.parseInt(args[0]);
    WeekDay wd = new WeekDay(dayStrings[]); // I can't seem to declare this line.
    My question how can I test the above program ?? I can't seem to be able to declare a "wd" from WeekDay. The dayStrings wich i had declared in the WeekDay class is a String array. But how can I declare a suitable line in my test program in order for me to test my program?
    What I wanted to do is to get the above line running and than I will proceed on to code it to display the day after a day...for example, if today is Wednesday and when I run the wd.nextDay(index). It will return me Thursday!
    But I am not sure how to declare the above...please enlighten me.
    Thank you.

    Hi
    Thank you for helping but when I compile my program. It seem fine but when I execute it, it prompt me with an error message :
    code}public class TestWD
    public static void main(String[]args)
    System.out.println("Please key in a digit to get the day of the week\n");
    System.out.println("Sun, Mon, Tue.....Sat is represented by 0,1,2,3...6");
    * int idx = Integer.parseInt(args[0]);*
    WeekDay wd = new WeekDay(idx);
    System.out.println(wd.nextDay(idx));
    }{java.lang.ArrayIndexOutOfBoundsException: 0
         at TestWD.main(TestWD.java:8)
    Edited by: SummerCool on Nov 1, 2007 2:53 AM                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • How to evaluate the dynamic condition string in PL/SQL ?

    Hello, I am solving the issue of checking and validating the event table.
    For Example, the event table namely "Contract_validated" contains some atts about a contract as follow:
    CONTRACT_VALIDATED (SEQ_ID, CO_ID, VALID_T, CHANGE_KEY, ATT1, ATT1_FROM, ATT2, ATT2_FROM, REASON, CHANGE_KEY_ORIG, ATT1_ORIG, ATT2_ORIG)
    In this table, the pairs (ATT1 and ATT1_FROM), (ATT2 and ATT2_FROM) must be compared to check whether the values are changed or not in the update event (change_key = U). If some records have change_key = U but the values does not change, I need to protocol and correct such records.
    The table name and attributes list could be dynamic, and will be provided as parameters. Therefore, I use Dynamic PL/SQL to generate the code to test the conditions between the values between the pairs columns for detecting the invalid event. However, I am stucking in testing the condition phrases because I can not evaluate the condition string in the SELECT statement. I can not use IF because parts of this condition string take the value from a record and collection type. Anyone has the idea how to evaluate the condition in such case, please give me instructions or recommendations (it could be other alternatives to solve the problems)
    Here is the code which generated from my Dynamic PL/SQL string, however, Oracle raise exception error at the EXECUTE IMMEDIATE v_sql command
    SELECT 'x' FROM DUAL WHERE (NVL(v_rec.ATT1, NULL) <> NVL(v_rec.ATT1_FROM , NULL) OR (NVL(v_rec.ATT2, NULL) <> NVL(v_rec.ATT2_FROM , NULL))
    E-0008: Unkown Exception raised in Loop. ORACLE:ORA-00904: "V_REC"."ATT2_FROM": invalid identifier
    vo_traced_list has type Table of VARCHAR2(2000), storing the atts list of table (CONTRACT_VALIDATED), it has value already from other procedure invocation.
    Here is the dynmic PL/SQL code generated dynamically depends on the table name, and attr list:
    DECLARE v_rec CONTRACT_VALIDATED%ROWTYPE;
    TYPE cv_type IS REF CURSOR;
    v_rec_cv CV_TYPE;
    v_cond VARCHAR2(4000);
    cond BOOLEAN := FALSE;
    v_exec VARCHAR2(1000);
    v_default VARCHAR2(10):= 'NULL';
    tk_val CONTRACT_VALIDATED.VALID_T%TYPE;
    pk_val CONTRACT_VALIDATED.CO_ID%TYPE;
    v_cnt NUMBER;
    BEGIN
    OPEN v_rec_cv FOR SELECT /*+ parallel(x,4) */ x.* FROM CONTRACT_VALIDATED x WHERE CHANGE_KEY = 'U' ORDER BY VALID_T;
    FETCH v_rec_cv INTO v_rec;
    IF v_rec_cv%NOTFOUND THEN
    Add_Log('Event_Validating',v_user,v_event_validated,'INFO','I-0001: No-Procession needed');
    ELSE
    BEGIN
    LOOP
    pk_val := v_rec.co_id;
    tk_val := v_rec.valid_t;
    v_cnt := vo_traced_atts_list.COUNT;
    v_cond := '(NVL(v_rec.'|| vo_traced_atts_list(1)||', ' || v_default || ') <> NVL(v_rec.' || vo_traced_atts_list(1)||'_FROM'
    ||' , ' || v_default || '))';
    cond := (BOOLEAN) v_cond;
    FOR v_i IN 2..v_cnt LOOP
    BEGIN
    v_cond := v_cond ||CHR(13)||CHR(10)||'OR (NVL(v_rec.'||vo_traced_atts_list(v_i)||', ' || v_default || ') <> NVL(v_rec.'||vo_traced_atts_list(v_i)||'_FROM'
    ||' , ' || v_default || '))';
    END;
    END LOOP;
    v_exec := 'SELECT ''x'' FROM DUAL WHERE '||v_cond;
    Add_Log('Event_Validating',v_user,v_event_validated,'INFO',v_exec);
    EXECUTE IMMEDIATE v_exec;
    /* Exception raised from here
    E-0008: Unkown Exception raised in Loop. ORACLE:ORA-00904: "V_REC"."ATT2_FROM": invalid identifier
    It seems that Oracle does not understand the dynamic reference v_rec.ATT2_FROM, v_rec.ATT2,... to test the condtion
    IF SQL%ROWCOUNT = 0     THEN -- condition is false ==> traced attributes does not changed
    -- update the REASON = 4 - not interested event
    v_exec := 'UPDATE CONTRACT_VALIDATED SET REASON = 4 WHERE CO_ID = '||pk_val||' AND VALID_T = '||tk_val;
    EXECUTE IMMEDIATE v_exec;
    END IF;
    FETCH v_rec_cv INTO v_rec;
    EXIT WHEN v_rec_cv%NOTFOUND;
    END LOOP;
    EXCEPTION
    WHEN OTHERS THEN
    Add_Log('SCD_VALIDATION',v_user,v_event_validated,'ERROR','E-0008: Unkown Exception raised in Loop. ORACLE:'||SQLERRM);
    RAISE ge_raise_error;
    END;
    END IF;
    CLOSE v_rec_cv;
    EXCEPTION
    WHEN OTHERS THEN
    Add_Log('SCD_VALIDATION',v_user,v_event_validated,'ERROR','E-0008: Unkown Exception raised in Loop. ORACLE:'||SQLERRM);
    RAISE ge_raise_error;
    END;

    Dear Andrew,
    Thank you so much for your suggestions, however, I think it will be better to let me explain more about the situation.
    I am working at Data Warehousing and Analysis part. The event tables are provided by other applications such as Customer OTLP system, Sales Management, etc. We therefore just have the results stored in the event tables (which could be wrong or inconsistency) and no way to force them to be valid by constraints. Before further processing the events , their records should be checked and overridden if possible, and that is the point I am trying to solve now.
    The Event table names, their attributes list, data types, primary key, timestamp columns etc are dynamic and are provided via parameters. I would like to write a procedure which can check the invalid events (not only update, but also insert, delete), protocol them, and override them if possible before processing further. Because the table name, attribute lists, data type, etc are not known in advanced, to my best knowledge, the only choice is generating dynamic PL/SQL code although it could suck the performance. The code you have seen in my first question is the output from the follwoing procedure, where the i_att_list provides the atts list has been parsed from other procedure invocation, i_pk is the primary key, i_tk is the time key, i_table_name is the table name (which is Event_Validation in previous example). The stucking point I have met now is that I do not know how to test the condition to detect the different between column pairs (ATT1 and ATT1_FROM, ...). Using Select from dual is just a dummy select for testing the where condition which must be formed as a string by that way.
    Thank you very much for your answer and looking forward to seeing your further recommendations or suggestions.
    Regards,
    Tho.
    CREATE OR REPLACE PROCEDURE Update_Validation
    ( i_att_list enum_string, -- list of attributes
    i_pk IN VARCHAR2, -- primary key column
    i_tk IN VARCHAR2, -- time key column
    i_table_name IN VARCHAR2 -- table_name - the columns format be checked
    ) AUTHID Current_User IS
    TYPE LoopCurType           IS REF CURSOR;
    ln_parallel NUMBER := 4;
    ge_raise_error EXCEPTION;
    v_user VARCHAR2(100);
    v_sql VARCHAR2(4000);
    v_string VARCHAR2(4000);
    v_crlf VARCHAR2(2) := CHR(13)||CHR(10);
    BEGIN
    SELECT sys_context('USERENV','current_schema') INTO v_user FROM DUAL;
    v_sql:= 'SELECT /*+ parallel(x,'||ln_parallel||') */ x.* FROM ' ||i_table_name|| ' x '||
              'WHERE CHANGE_KEY = ''U'''||
    ' order by '||i_tk;
    v_string := 'DECLARE v_rec '||i_table_name||'%ROWTYPE;' ||v_crlf||
              ' TYPE cv_type IS REF CURSOR; ' ||v_crlf||
    ' v_rec_cv CV_TYPE; ' ||v_crlf||
              ' v_cond VARCHAR2(4000); ' ||v_crlf||
         ' v_exec VARCHAR2(100);' ||v_crlf||
              ' v_default VARCHAR2(10):= ''~~''; ' ||v_crlf||
    ' tk_val '||i_table_name||'.'||i_tk||'.%TYPE;'||v_crlf||
    ' pk_val '||i_table_name||'.'||i_pk||'.%TYPE;'||v_crlf||
              ' v_cnt NUMBER;' ||v_crlf||
              'BEGIN ' ||v_crlf||
                        'OPEN v_rec_cv FOR ' ||v_sql ||';' ||v_crlf||
                        'FETCH v_rec_cv INTO v_rec;' ||v_crlf||
                             ' IF v_rec_cv%NOTFOUND THEN ' ||v_crlf||
                                  'Add_Log(''Event_Validating'',v_user,i_table_name,''INFO'',''I-0001: No-Procession needed'');'||v_crlf||
                             ' ELSE ' ||v_crlf||
                                  ' BEGIN '||v_crlf||
                                  ' LOOP '||v_crlf||
                                  'pk_val := v_rec.'||i_pk||';'||v_crlf||
    'tk_val := v_rec.'||i_tk||';'||v_crlf||
    'v_cnt := i_att_list.COUNT;' ||v_crlf||
                                            'v_cond := ''NVL(v_rec.''|| i_att_list(1)||'', '' || v_default || '') <> NVL(v_rec.'' || i_att_list(1)||''_FROM'''||v_crlf||
                             '||'' , '' || v_default || '')'';'||v_crlf||
                                            'FOR v_i IN 2..v_cnt LOOP'||v_crlf||
                                                 'BEGIN'||v_crlf||
                                                 'v_cond := v_cond ||CHR(13)||CHR(10)||''OR NVL(v_rec.''||i_att_list(v_i)||''), <> NVL(v_rec.''||i_att_list(v_i)||''_FROM'''||v_crlf||
                                                 '||'' , '' || v_default || '')'';'||v_crlf||
                                                 'END;'||v_crlf||
                                            'END LOOP;'||v_crlf||
                                            'v_exec := ''SELECT ''x'' FROM DUAL WHERE ''||v_cond;'||v_crlf||
                                            'EXECUTE IMMEDIATE v_exec;'||v_crlf||
                                            'IF SQL%ROWCOUNT = 0     THEN -- condition is false ==> traced attributes does not changed'||v_crlf||
                                            '-- update the REASON = 4 - not interested event'||v_crlf||
                                            'UPDATE '||i_table_name||' SET REASON = 4 WHERE '||i_pk||' = '||v_tk||' AND '||i_tk||' = '||tk_val||';'||v_crlf||
                                            'END IF;'||v_crlf||
                                       'FETCH v_rec_cv INTO v_rec;' ||v_crlf||
                                       'EXIT WHEN v_rec_cv%NOTFOUND;'||v_crlf||
                        ' END LOOP;'||v_crlf||
                                  'EXCEPTION' ||v_crlf||
                             'WHEN OTHERS THEN'||v_crlf||
                        'Add_Log(''SCD_VALIDATION'',v_user,i_table_name,''ERROR'',''E-0008: Unkown Exception raised in Loop. ORACLE:''||SQLERRM);'||v_crlf||
                        'RAISE ge_raise_error;'||v_crlf||
                                  'END;'||v_crlf||
                                  'END IF;'|| v_crlf||
                        'Close v_rec_cv;'||v_crlf||
                        'EXCEPTION' ||v_crlf||
                   'WHEN OTHERS THEN'||v_crlf||
              'Add_Log(''SCD_VALIDATION'',v_user,i_table_name,''ERROR'',''E-0008: Unkown Exception raised in Loop. ORACLE:''||SQLERRM);'||v_crlf||
              'RAISE ge_raise_error;'||v_crlf||
                   'END;';               
         Add_Log('SCD_UPDATE_VALIDATION',v_user,i_table_name,'INFO','I-0006: Update Validation : '||v_string);     
         EXECUTE IMMEDIATE v_string;
    EXCEPTION
    WHEN OTHERS THEN
    Add_Log('SCD_VALIDATION',v_user,i_table_name,'ERROR','E-0008: Unkown Exception raised in Loop. ORACLE:'||SQLERRM);
    END Update_Validation;

  • How to test the rule if multiline container is passing to the task?

    Hi Experts,
                      I am working on leave workflow. I have to get the approvers based on no of days of leave and leave type. I am getting these details in ITEMS_TAB internal table. I am passing this table to a rule. Now my problem is when I tried to simulate the rule I am not getting any input screen to enter the data.
    ITEMS_TAB is an internal table type of   "PTREQ_ITEMS_WF_TAB_FLAT".
    In the rule I have created a container by selecting the radiobutton "ABAP Dict. Data Type" and entered the above reference parameter is it right way?
    Is it possible to test the rule independently if I use multiline container as import parameter in my rule?  If so can anybody please tell me how to test the rule?
    Thank You.
    Srija.

    Hi Pavan,
                     Thank you.
                     To copy the values I am not getting any input screen to input the values. I observed one thing that the type that I am referring in the Rule is a deep structure. Is this is the reason that I am not getting the input screen to enter the values?
    I tested by creating aother rule by taking a field for that rule I am getting the input screen to simulate the Rule.
    Can you please suggest if the rule will not work then what I have to do? without the rule how can I get the agents?
    Thank you.
    Srija

  • How  to  get the FIRST DAY OF THE CURRENT MONTH

    how to get the FIRST DAY OF THE CURRENT MONTH in oracle 9i.
    plzzzzz send immedaily.advance thanks

    TEST@test SQL> select trunc(sysdate,'MON') from dual;
    TRUNC(SYS
    01-OCT-06
    TEST@test SQL>                                  

  • How to test the OID IT Resource connection

    Hi,
    I am trying to test the connectivity of the OID IT Resource in OIM. Could somebody help me in knowing how to test the connectivity of the resource.
    Regards,
    Nitin

    Hi Suren,
    I am not using any Ldap browser. I am using Oracle Directory Manager.
    I tried giving the following value in my searchfilter (objectclass=top)(cn=HPOONIA).
    But I am getting the following errors :
    Parameter Variables passed into com.thortech.xl.integration.OID.util.tcUtilLDAPOperations:tcUtilLDAPOperations(): Login Variables are:: are sServerName = 129.146.14.92, sPortNo = 389, sPrincipalDN = cn=orcladmin,cn=Users,dc=csc,dc=com, sProviderURL = ldap://129.146.14.92:389,
    INFO,09 Apr 2010 04:40:09,317,[XL_INTG.OID], Parameter Variables passed into com.thortech.xl.integration.OID.util.tcUtilLDAPOperations:tcUtilLDAPOperations(): Login Variables are:: are sServerName = 129.146.14.92, sPortNo = 389, sPrincipalDN = cn=orcladmin,cn=Users,dc=csc,dc=com, sProviderURL = ldap://129.146.14.92:389,
    DEBUG,09 Apr 2010 04:40:09,318,[XL_INTG.OID], Parameter Variables passed into com.thortech.xl.integration.OID.util.tcUtilLDAPOperations:tcUtilLDAPOperations(): Login Variables are:: for isSSLEnabled = false
    DEBUG,09 Apr 2010 04:40:09,318,[XL_INTG.OID],com.thortech.xl.integration.OID.util.tcUtilLDAPOperations : tcUtilLDAPOperations():: FINISHED
    DEBUG,09 Apr 2010 04:40:09,322,[XL_INTG.OID],com.thortech.xl.integration.OID.schedule.tasks.tcTskOIDUserReconciliation : processChange():: STARTED
    DEBUG,09 Apr 2010 04:40:09,322,[XL_INTG.OID],com.thortech.xl.integration.OID.schedule.tasks.tcTskOIDUserReconciliation : checkEmpty():: STARTED
    DEBUG,09 Apr 2010 04:40:09,322,[XL_INTG.OID],com.thortech.xl.integration.OID.schedule.tasks.tcTskOIDUserReconciliation : checkEmpty():: FINISHED
    DEBUG,09 Apr 2010 04:40:09,322,[XL_INTG.OID],com.thortech.xl.integration.OID.schedule.tasks.tcTskOIDUserReconciliation : checkEmpty():: STARTED
    DEBUG,09 Apr 2010 04:40:09,322,[XL_INTG.OID],com.thortech.xl.integration.OID.schedule.tasks.tcTskOIDUserReconciliation : checkEmpty():: FINISHED
    DEBUG,09 Apr 2010 04:40:09,322,[XL_INTG.OID],com.thortech.xl.integration.OID.schedule.tasks.tcTskOIDUserReconciliation : getSearchAttributes():: STARTED
    DEBUG,09 Apr 2010 04:40:09,323,[XL_INTG.OID],com.thortech.xl.integration.OID.schedule.tasks.tcTskOIDUserReconciliation : getFieldMappings():: STARTED
    DEBUG,09 Apr 2010 04:40:09,323,[XL_INTG.OID],com.thortech.xl.integration.OID.schedule.tasks.tcTskOIDUserReconciliation : getSearchAttributes():: FINISHED
    DEBUG,09 Apr 2010 04:40:09,323,[XL_INTG.OID],com.thortech.xl.integration.OID.util.tcUtilLDAPOperations : connectToAvailableOID():: STARTED
    DEBUG,09 Apr 2010 04:40:09,323,[XL_INTG.OID],com.thortech.xl.integration.OID.util.tcUtilLDAPOperations : hashTableEnv():: STARTED
    DEBUG,09 Apr 2010 04:40:09,335,[XL_INTG.OID],com.thortech.xl.integration.OID.util.tcUtilLDAPOperations : hashTableEnv():: FINISHED
    INFO,09 Apr 2010 04:40:09,335,[XL_INTG.OID],com.thortech.xl.integration.OID.util.tcUtilLDAPOperations : connectToAvailableOID() : SSL option is not selected in ITResource
    DEBUG,09 Apr 2010 04:40:09,348,[XL_INTG.OID],com.thortech.xl.integration.OID.util.tcUtilLDAPOperations : connectToAvailableOID():: FINISHED
    DEBUG,09 Apr 2010 04:40:09,348,[XL_INTG.OID],com.thortech.xl.integration.OID.schedule.tasks.tcTskOIDUserReconciliation : doReconSearch():: STARTED
    DEBUG,09 Apr 2010 04:40:09,349,[XL_INTG.OID],com.thortech.xl.integration.OID.util.tcUtilLDAPOperations : isPagingSupport():: STARTED
    DEBUG,09 Apr 2010 04:40:09,353,[XL_INTG.OID],com.thortech.xl.integration.OID.util.tcUtilLDAPOperations : isPagingSupport():: FINISHED
    DEBUG,09 Apr 2010 04:40:09,353,[XL_INTG.OID],com.thortech.xl.integration.OID.util.tcUtilLDAPOperations : pagingReconSearch():: STARTED
    DEBUG,09 Apr 2010 04:40:09,354,[XL_INTG.OID],com.thortech.xl.integration.OID.util.tcUtilLDAPOperations : pagingReconSearch() : Parameter Variables passed are: pSearchBase = [cn=Users,dc=csc,dc=com], pFilterExpression = [(&(objectclass=top)(cn=HPOONIA)(modifyTimestamp>=19000101010001Z))], pIsRelative = [true], pAttrNames = [[Ljava.lang.String;@3250b1]
    INFO,09 Apr 2010 04:40:09,354,[XL_INTG.OID],com.thortech.xl.integration.OID.util.tcUtilLDAPOperations : pagingReconSearch() : Parameter Variables passed are: pSearchBase = [cn=Users,dc=csc,dc=com], pFilterExpression = [(&(objectclass=top)(cn=HPOONIA)(modifyTimestamp>=19000101010001Z))], pIsRelative = [true], pAttrNames = [[Ljava.lang.String;@3250b1]
    DEBUG,09 Apr 2010 04:40:09,354,[XL_INTG.OID],com.thortech.xl.integration.OID.util.tcUtilLDAPOperations : pagingReconSearch() : javax.naming.directory.SearchControls@14fa707search controls**********************
    DEBUG,09 Apr 2010 04:40:09,354,[XL_INTG.OID],com.thortech.xl.integration.OID.util.tcUtilLDAPOperations : pagingReconSearch() : count limit**********************
    DEBUG,09 Apr 2010 04:40:09,354,[XL_INTG.OID],com.thortech.xl.integration.OID.util.tcUtilLDAPOperations : pagingReconSearch() : subtree scope**********************
    DEBUG,09 Apr 2010 04:40:09,354,[XL_INTG.OID],com.thortech.xl.integration.OID.util.tcUtilLDAPOperations : pagingReconSearch() : setting returning attributes if NOT NULL**********************
    DEBUG,09 Apr 2010 04:40:09,370,[XL_INTG.OID],com.thortech.xl.integration.OID.util.tcUtilLDAPOperations : pagingReconSearch() : DID NOT FIND ANY RECORDS after Modified Time Stamp
    DEBUG,09 Apr 2010 04:40:09,370,[XL_INTG.OID],com.thortech.xl.integration.OID.util.tcUtilLDAPOperations : parseControls():: STARTED
    DEBUG,09 Apr 2010 04:40:09,370,[XL_INTG.OID],com.thortech.xl.integration.OID.util.tcUtilLDAPOperations : getControlInstance():: STARTED
    DEBUG,09 Apr 2010 04:40:09,376,[XL_INTG.OID],com.thortech.xl.integration.OID.util.tcUtilLDAPOperations : getControlInstance():: FINISHED
    INFO,09 Apr 2010 04:40:09,376,[XL_INTG.OID],com.thortech.xl.integration.OID.util.tcUtilLDAPOperations : parseControls() : >>Next Page
    DEBUG,09 Apr 2010 04:40:09,376,[XL_INTG.OID],com.thortech.xl.integration.OID.util.tcUtilLDAPOperations : parseControls():: FINISHED
    DEBUG,09 Apr 2010 04:40:09,376,[XL_INTG.OID],com.thortech.xl.integration.OID.util.tcUtilLDAPOperations : pagingReconSearch() : cookie: [B@5eef81
    DEBUG,09 Apr 2010 04:40:09,376,[XL_INTG.OID],com.thortech.xl.integration.OID.util.tcUtilLDAPOperations : pagingReconSearch() : cookie length : 0
    DEBUG,09 Apr 2010 04:40:09,376,[XL_INTG.OID],com.thortech.xl.integration.OID.util.tcUtilLDAPOperations : pagingReconSearch() : Total No Of Records are reconciled are = 0
    DEBUG,09 Apr 2010 04:40:09,376,[XL_INTG.OID],com.thortech.xl.integration.OID.util.tcUtilLDAPOperations : disconnectFromLDAP():: STARTED
    DEBUG,09 Apr 2010 04:40:09,376,[XL_INTG.OID],com.thortech.xl.integration.OID.util.tcUtilLDAPOperations : disconnectFromLDAP() : Closing initial directory context
    DEBUG,09 Apr 2010 04:40:09,380,[XL_INTG.OID],com.thortech.xl.integration.OID.util.tcUtilLDAPOperations : disconnectFromLDAP():: FINISHED
    DEBUG,09 Apr 2010 04:40:09,381,[XL_INTG.OID],com.thortech.xl.integration.OID.util.tcUtilLDAPOperations : pagingReconSearch():: FINISHED
    DEBUG,09 Apr 2010 04:40:09,381,[XL_INTG.OID],com.thortech.xl.integration.OID.schedule.tasks.tcTskOIDUserReconciliation : doReconSearch():: FINISHED
    DEBUG,09 Apr 2010 04:40:09,381,[XL_INTG.OID],com.thortech.xl.integration.OID.util.tcUtilLDAPOperations : disconnectFromLDAP():: STARTED
    DEBUG,09 Apr 2010 04:40:09,381,[XL_INTG.OID],com.thortech.xl.integration.OID.util.tcUtilLDAPOperations : disconnectFromLDAP() : Closing initial directory context
    DEBUG,09 Apr 2010 04:40:09,381,[XL_INTG.OID],com.thortech.xl.integration.OID.util.tcUtilLDAPOperations : disconnectFromLDAP():: FINISHED
    DEBUG,09 Apr 2010 04:40:09,381,[XL_INTG.OID],com.thortech.xl.integration.OID.schedule.tasks.tcTskOIDUserReconciliation : processChange():: FINISHED
    DEBUG,09 Apr 2010 04:40:09,381,[XL_INTG.OID],com.thortech.xl.integration.OID.schedule.tasks.tcTskOIDUserReconciliation : execute():: FINISHED
    Please help.
    Regards,
    Nitin

  • How to test if a number is prime?

    Hi, I'm doing an exercise. I'm iterating through numbers from 2 to 100 (since 1 is not a prime number) and I need to test if the current number is a prime, if it is print it out. But I can't figure out the condition, how to test if a number is prime? So far I got this, but it prints all subsequent numbers, which is now obvious to me, but how to test for primes?
    public class Main {
        public static void main(String[] args) {
            for (int i = 2; i <= 100; i++) {
                //Test if a number is a prime, if it is print it
                // The (i + 1) is because I want to divide i by any other number, so I thought i + 1
                if (((i % i) == 0) && ((i % 1) == 0) && ((i % (i + 1)) > 0)) {
                    System.out.println(i);
    }

    Aardenon wrote:
    I understand your point. But it seems unsafe to assume a number from which the checks are unnecessary. That could lead to an error. I'm sure it is mathematically provable somehow, but I'm not that good in Math. I mean to write a safe (and optimized) version of the code, I would still have to go through all uneven numbers and 2.Nope. In fact, for an optimized version, definitely not; however, I wouldn't worry too much about optimization at the moment.
    One little tip I remember from school, back in the dark ages, is that all prime numbers other than 2 and 3 have the form 6k &plusmn; 1. That is NOT to say that all such numbers are prime, but it does eliminate a lot of the ones you need to check.
    You might also want to check out the [url http://en.wikipedia.org/wiki/Prime_number#Verifying_primality]Wikipedia page on prime numbers; it's very good.
    Winston

  • How to set date +120 daye to one date field

    Hi,
    I have 2 fields one is Close date(Item style is Message Layout) and Quote Valid Until(Item Style is Date Field).After opening the page Close date will come automatically. Now My requirement is need to put Close date+120 days to Quote Valid unti field. Pls let me how to do this one and pls provide Sample code....
    Thanks in advance,
    Hanimi....

    Hanimi,
    Use Below Code
    //Convert the fetched date to calendar date and use the below method.
    import java.util.Calendar;
    public class CalendarAddExample {
        public static void main(String[] args) {
            Calendar cal = Calendar.getInstance();
            System.out.println("Today : " + cal.getTime());
            // Subtract 30 days from the calendar
            cal.add(Calendar.DATE, -30);
            System.out.println("30 days ago: " + cal.getTime());
    }Regards,
    Gyan

  • How to test whether XI is sending file or not?

    Hi all!
    My scenario is like this:File(File sender Adapter)->XI->(HTTP receiver adapter)J2EE appl.
    I placed the xml file in D:\somedir on my PC. It is picking up the file, after picking it should post the same xml file to my j2ee appl. My servlet receives the xml file and display it on browser. But nothing is displayed. How to test whether XI is sending XML file to J2EE appl or not? All helpful answers are highly appreciated.
    Thanks!

    Hi
    In the file adapter i set processing mode as delete, it is picking up well from my d:\somedir.
    I got success flag in SXMB_MONI and successful status in RWB->message monitoring?
    Why my servlet is not able to display?
    All helpful answers are rewarded.
    public class DisplayRes extends HttpServlet {
         public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
                        doPost(request,response);
         public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
         BufferedReader brin =new BufferedReader(new InputStreamReader(request.getInputStream()));
         String inputLine;
         StringBuffer sBuf = new StringBuffer();
         while ((inputLine = brin.readLine()) != null)
             sBuf.append(inputLine);
             brin.close();
             PrintWriter out = response.getWriter();
             response.setContentType("text/xml");
             //out.setContentType("text/xml");
             //out.println(sBuf.toString());
             out.write(sBuf.toString());
             out.flush();
    Thanks

  • How to create a working day/holiday attribute in Time Dimension with OWB ?

    Hello everybody,
    I am trying with no success to create a Time Dimension (with the wizard it would be easier...) with a working day or holiday attribute (0 or 1) to be able to calculate measures only on working time !!! I am totally sure it's possible, obviously, but I found nothing on forums... Could you help me ??
    I use OWB 11g, I need all fiscal year/quarter/month/week and all calendar year/quarter/month/week attributes so without any wizard it would be quite impossible... thank you for your help !
    NB: of course I know how to define if a day is a working one or not, but I currently can't add any columns in Time dim created with wizard...
    Francois
    Edited by: [email protected] on Jun 15, 2009 8:24 AM

    Hi,
    First of all, thanks everyone for your help.
    I did several tests this morning.
    First of all, i've tried with time_from = 000000 and time_to = 235959 (23:59:59 CET) and the activity has been created with Time From = 04:00:00 and Time To = 03:59:59
    Strange no ??
    I've also tried with 230000 for time from and time to but the activity has been created with Time From = 03:00:00 and Time to = 03:00:00
    I cannot understand the logic behind....
    Thanks,
    Johnny Baillargeaux

  • How do you iterate through a string?

    Hi! How do I loop through a string of characters. My program needs to iterate through a string in order to do some calculations. Here is an example:
    <item>1</item>
    <description>This is an example.</description>
    How I iterate through description one character at a time.
    Thanks for your help!

    <?xml version="1.0" encoding="UTF-8"?>
    <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format" version="1.0">
    <xsl:template name="add-X">
    <xsl:param name="string" select="." />
    <xsl:if test="$string">
    <xsl:text>X</xsl:text>
    <xsl:value-of select="substring($string, 1,1)"/>
    <xsl:call-template name="add-X">
    <xsl:with-param name="string"
    select="substring($string, 2)" />
    </xsl:call-template>
    </xsl:if>
    </xsl:template>
    </xsl:stylesheet>
    Create an file named TEST.xsl with the above code.
    <aaaa>ABCDE</aaaa>
    Create an file named TEST.XML with the above code.
    Create an RTF template with form field valus as
    <?import: file:///C:\Desktop\Sample RTF\TEST.xsl?>
    Note : here you have to point the xsl path where your TEST.xsl is located.
    Then create another form field with value
    <xsl:call-template name="add-X"> <xsl:value-of select="." /> </xsl:call-template>
    When you merge the xml and RTF , you will find the no of "X" equivalent to length of the string in <aaaa> tag in xml

  • How long charactors can stored in 'STRING' type?

    HI
    I'm just curious how long charactors can stored in 'string' type.
    and if there is limit number to store what kind of type is unlimited length type?
    and is it possible send a parameter page to page with 'form'  'post' way unlimited length of string?
    and is there any type of DB field which is save last number of records  automatically when one record is inserted like MANDT?
    MANDT is client number though.
    Regards.

    Here is what ABAP key word documentation says about string
    The elementary data type STRING is similar to data type C and refers to a variable-length string. Accordingly, the elementary data type XSTRING is similar to data type X and refers to a variable-length byte sequence.
    In contrast to a C or X field, the length of a string is not static but variable and adjusts itself to the current field content at runtime. Dynamic memory management is used internally. Strings can have any length.
    The initial value of a string is an empty string with length 0. A structure containing a string is seen as deep. A deep structure cannot be used like a C field. Strings can be displayed in the ABAP Debugger and used in the ABAP Dictionary.
    It is not yet possible to use strings in screens or database tables. However, strings can be stored in database tables as clusters using EXPORT and transferred using IMPORT.
    As far as I know the limit is 4 Giga Byte which equals more or less no limit. I donnot expect that you will meet this limit in practice. Its very likely that will run out of memory before you reach this limit.
    In short there is no limit to the data stored in STRING var but the system memory has a limit....
    This can be proved with the below program:
    For the program system dumps with mess.
    "Unable to fulfil request for 127683972 bytes of memory space. "
    here's the test prog.:
    TABLES ekko.
    DATA testmax TYPE string.
    DATA z(16) TYPE i.
    SELECT * FROM ekko.
      CONCATENATE testmax ekko INTO testmax.
      z = strlen( testmax ).
      IF  z = 63841496.
        BREAK-POINT.
      ENDIF.
    ENDSELECT.

  • How to  Test HTTP EVENT generators

    Hi I have created a HTTP EventGenerator
    with url "/TEST/getDataServlet". This eg is then configured for an XML Channel.
    Now while testing the EG by giving the posting an xml from java program or by invoking
    http://<ipaddress>:<portnumber>/TEST/getDataServlet
    I get the error
    java.security.PrivilegedActionException: com.bea.wli.broker.MessageBrokerException: [WLI-Core:481031]The message-type for channel "/TESTOM/Samples/TestHTTPChannel" is defined as "xml", which is not type-compatible with the message being published.
         at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:373)
    My query is how to post the xml data to this EG. Docs says HTTPEg creates a servlet.
    need to know how to test this.
    thx
    siva

    Hi Stefan, I configured the way you have put it, but I get the error "no receiver could be determined"
    Here are my settings:
    Sender service - HTTP_SEND
    sender o/b interface - PROD_MSG_INT_OB_ASYNC
    receiver service - FILE_RECEIVE
    receiver i/b interface - PROD_MSG_INT_IB_ASYNC
    receiver communication channel - FILE adapter
    JAVA script:
    String Party       = "MFC";
    String Service     = "HTTP_SEND";
    String XINameSpace = "mfc%3Anamespace1";
    String Interface   = "PROD_MSG_INT_OB_ASYNC";
    String Url   = "http://nemo:8000/sap/xi/adapter_plain?";
    XML DATA File:
    <?xml version="1.0" encoding="UTF-8"?>
    <ns0:PRODUCT xmlns:ns0="mfc:namespace1">
    <ID>E</ID>
    <NAME>thank god</NAME>
    <BRAND>SOME BRAND</BRAND>
    </ns0:PRODUCT>
    Stefan Am I missing anything?
    XML error message:
    <?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
    - <!--  Receiver Identification
      -->
    - <SAP:Error xmlns:SAP="http://sap.com/xi/XI/Message/30" xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/" SOAP:mustUnderstand="1">
      <SAP:Category>XIServer</SAP:Category>
      <SAP:Code area="RCVR_DETERMINATION">NO_RECEIVER_CASE_BE</SAP:Code>
      <SAP:P1 />
      <SAP:P2 />
      <SAP:P3 />
      <SAP:P4 />
      <SAP:AdditionalText />
      <SAP:ApplicationFaultMessage namespace="" />
      <SAP:Stack>No receiver could be determined</SAP:Stack>
      <SAP:Retry>N</SAP:Retry>
      </SAP:Error>
    It would be great if you have solution for this.
    Regards
    felix

  • How to test this code ???

    Hi All,
    One quick question:
    ..>>>>How do you test below InterfaceImpl classes in a simple program to test the code ???
    //below is the sample of the example I am running .
    Thanks
    Jack
    //interface 1
    same package;
    interface someInterfaceName1 {
    public void setLastName();
    public String getLastName();
    //inerface 2
    same package;
    interface someInterfaceName2{
    public void setBillingAddress(somename1 billing){
    public void setShippingAddress(somename1 shipping){
    // implementation class1
    samepackage;
    public class someInterfaceName1Impl implements someInterfaceName1 {
    private String lastName="";
    someInterfaceName1Impl();
    public void setLastName(String lastName){
    this.lastName=lastName;
    public String getLastName(){
    return LastName;
    //implementatio class2 for interface 2
    samepackage;
    class someInterfaceName2Impl implements someInterfaceName2
    public void setBillingAddress(interface1 billto){
    billto.setlastName(someValue); --?????
    public void setShippingAddress(interface1 shipto) {
    shipto.setFirstName(someValue); --- ?????
    //How to test the code ??
    package samepackage;
    class testMyCode {
    public static void main(String args[]){
    // how do you get the interfaces implementation here to test with dummy values ????

    Something along these lines (but departing from your code a bit...) public static void test() {
        Interface1 ifc1 = new Impl1();
        String tmpStr;
        int tmpInt;
        ifc1.setName("joe");
        tmpStr = ifc1.getName();
        if (!("joe".equals(tmpStr))) {
            System.err.println("set/getName failed. Put in joe but got out " + tmpStr);
        ifc1.setBirthdate("May 1 1980");
        tmpInt = ifc1.getAge();
        if (tmpInt != 24) {
            System.err.println("setBirthdate/getAge failed. Put in May 1 1980, expected 24 but got " + tmpInt);
        try {
            tmpStr = "Booger 99, 19seventy-beer";
            ifc1.setBirthdate(tmpStr);
            //shouldn't get here
           System.err.println("setBirthdate accepted invalid date: " + tmpStr);
        catch (InvalidBirthdateException exc) {
            // we want this, since it means our code properly rejected a bad date
    } Or, when you start writing serious code, look into junit
    &#12472;

Maybe you are looking for

  • 3rd display not working with Yosemite.  Was fine with Mountain Lion.  Any suggestions?

    I use my Imac as a digital aidio workstation with 3 displays.  Never updated to Yosemite due to issues with the DAW manufacturer software.  Now that the issues were resolved, I said what the **** and I updated to Yosemite.  Now my 3rd display does no

  • OpticControlException when shutting down SOA suite

    When I try shutting down the SOA suite, I invariably get this error: oracle.ias.opmn.optic.OpticControlException: Error from opmn during process control operation      at oracle.ias.opmn.optic.AbstractOpmnEntity.runCommand(AbstractOpmnEntity.java:174

  • SD MM linkage for services

    I have a sales invoice (F2) against which there are some pricing conditions of service. I now want to link it to a service order entry against a purchase order, so that a invoice verification can be done against that purchase order (and the accountin

  • CAll VB 6 DLL wilth labview 8.2

    I have VB 6.0  DLL  I want to call it in my Labview 8.2 program .  as per the link http://digital.ni.com/public.nsf/allkb/F2CD7758CD3C847F86256C01006C0E48 i am using Automation Refnum but iam unsuccessful . i am getting following error Automation Ope

  • How we will display the header data and item data seperately in lists

    how we will display the header data and item data seperately in lists