Addition of 2 integer

Hi All,
I am very new to Oracle BPM 11g. I want to add two integers, and these two number should come as user input. for that I need one UI. can anybody please let me know what are the steps for that, or if is there any useful link please send me. Thnks..

thanks for reply,
I have a list having OOTB approval workflow,and  Infopath form to it. Here I have approve button created from CEWP. 
If user clicks on approve, it should take him to other URL where he can approve or reject that list item. (i.e. URL of the running workflow of that item)
So this URL is going to be dynamic i.e. as per the list item id.
now what I have in CEWP now is :
<head>
<body>
<button onclick=" javascript:window.location.href ='/sites/wpg/_layouts/Workflow.aspx?ID=
{@ID}&List={B2D9383C-60EA-41C5-AA16-903E19ECC233}&Source=https...FAllItems%2Easpx';return false;">Approve</button>
</body>
</head>
if we put ID=2 then it will go to workflow page of 2nd item in the list.
So i want it to be going to current list items workflow page to approve it..
thanks. 
 

Similar Messages

  • Byte - Integer Conversion

    I have four bytes that I want to store directly into an integer and then read back out again. I've spent forever trying bitshifts and division/modulo, but to no avail...with Java not supporting unsigned values, I can't figure it out...what I want is this:
    [00000000][00000000][00000000][00001111] (four individual bytes)
    STEP ONE: is converted to
    [00000000000000000000000000001111] (same sequence of bits in an int)
    and then some operation is performed (let's say adding one)
    [00000000000000000000000000010000] (addition on the integer)
    STEP TWO: and afterwards the integer is converted back
    [00000000][00000000][00000000][00010000] (four individual bytes)

    use parenthesis a lot until you know operator precedence
    and use 0xff & byte to get rid of sign extension
    public class ByteInt {
    public static void main(String[] args) {
      int i;
      byte b3, b2, b1, b0;  // b3 is highest order byte
      b3 = 0x12;
      b2 = 0x34;
      b1 = 0x56;
      b0 = 0x78;
      i = (0xff & b0) | ( (0xff & b1) << 8  )
                      | ( (0xff & b2) << 16 )
                      | ( (0xff & b3) << 24 );
      System.out.println(Integer.toHexString(i));
      System.out.println("");
      i = 0xf1827456;  // f1 82 74 56
      System.out.println(Integer.toHexString(i));
      System.out.println("");
      b0 = (byte)   (i & 0xff);
      b1 = (byte) ( (i & 0xff00)     >> 8  );
      b2 = (byte) ( (i & 0xff0000)   >> 16 );
      b3 = (byte) ( (i & 0xff000000) >> 24 );
      System.out.println(Integer.toHexString(b3));
      System.out.println(Integer.toHexString(b2));
      System.out.println(Integer.toHexString(b1));
      System.out.println(Integer.toHexString(b0));
      System.out.println("");
      System.out.println(Integer.toHexString(0xff & b3));
      System.out.println(Integer.toHexString(0xff & b2));
      System.out.println(Integer.toHexString(0xff & b1));
      System.out.println(Integer.toHexString(0xff & b0));
      System.out.println("");
    } // method
    } // class

  • Migrating Sybase "timestamp" data type to Oracle DB

    Hi,
    We are migrating huge Application currently running on Sybase database
    to Oracle 10.2.0.3 (500+ Tables and Stored Procedures).
    Have following questions regarding this Migration.
    1) Many of the Sybase Tables have column which is of Sybase data type "timestamp".
    Do you have any recommendation what is the data type to be used in Oracle for
    migrating "timestamp" data type in Sybase?
    2) How should we migrate existing data and business logic residing in Sybase for
    data columns of Sybase data type "timestamp" ?
    Given below are details on how we use Sybase timestamp Column in our Application
    and we are trying to arrive at the best Solution that is possible for migrating
    all those Tables and related business logic to Oracle.
    We have following Control Table in Sybase which has column of timestamp data type and
    some other Business keys.
    sp_help EQP_IES_CRE_TIMESTAMP (This is similar to desc <table> command in Oracle)
    EQP_IES_CRE_TIMESTAMP,dbo,user table
    default,Nov 14 2001 10:39AM
    CRE_TIMESTAMP ,timestamp,8,,,0,,,,0
    REF_NUM ,char,30,,,0,,,,0
    REC_UPD_DT ,datetime,8,,,1,,,,0
    EQP_IES_CRE_TIMESTAMPI1,clustered, unique located on default, CRE_TIMESTAMP, REF_NUM, REC_UPD_DT,0,0,0,
    Following is the overall logic used in Sybase
    -- Step 1: Based on Event, populate Control Table with new Row.
    -- CRE_TIMESTAMP timestamp Column gets auto-populated by Sybase
    insert EQP_IES_CRE_TIMESTAMP (REF_NUM, REC_UPD_DT)
    values (@uuid_ref_num, @event_cre_dt)
    Since CRE_TIMESTAMP is auto-populated, it does not appear in above INSERT statement.
    -- Step 2: Store timestamp value populated by Sybase in previous step,
    -- to variable @event_timestamp. This value would be referenced
    -- later in other SQL statements
    select @event_timestamp = CRE_TIMESTAMP
    from EQP_IES_CRE_TIMESTAMP
    where REF_NUM = @uuid_ref_num
    and REC_UPD_DT = @event_cre_dt
    -- Sample value for @event_timestamp could be '001c0000182f2089'
    -- It is not very readable or understandable
    -- Step 3: Delete Control Table entry made in Step 1
    delete EQP_IES_CRE_TIMESTAMP from EQP_IES_CRE_TIMESTAMP
    where CRE_TIMESTAMP = @event_timestamp
    -- Step 4: Make use of saved timestamp value from Step 2 to trigger queries
    -- against other Tables that have timestamp Columns
    -- Some sample queries are as shown below
    delete eqp_staging
    where event_timestamp > @event_timestamp;
    insert into eqp_movement values(@event_timestamp, ......other columns) ;
    Any idea how above Table and logic could be migrated to Oracle DB
    We would also like to know how data values that currently exist
    in Sybase Tables should be populated in Oracle .
    Any suggestions or tips would be greatly appreciated
    Thanks
    Auroprem

    Hi All,
    Thanks for your responses.
    We have decided on Solution to migrate "timestamp" Column from Sybase to Oracle, that is
    specific to our Application needs.
    Following is what we decided:
    1) Create RAW Column in Oracle which would contain data Replicated from Sybase "timestamp" Column as is.
    2) Create additional Column of INTEGER data type to store number equivalent of Sybase "timestamp" column
    which would be more usable and consummable in Oracle as compared to RAW datatype.
    3) Write Row-Level INSERT/UPDATE Trigger on migrated Oracle Table to populate INTEGER Column using
    SQL Function TO_NUMBER(<raw_column_value>, 'xxxxxxxx').
    4) Applications that access this Table, upon migration to Oracle, will now start referencing INTEGER Column
    newly defined, and populated via Trigger.
    Please let us know if you see any issues with this approach
    Thanks
    user641521

  • LCDS and paging

    Hello everybody,
    First, excuse me for the mistakes I may have made.
    I am a trainee and the enterprise I work for is planning to
    change the presentation layer (and maybe all the layers) of their
    software packages for Flex (at the present time they use the .NET
    platform). But in order to ensure that Flex can answer their needs,
    they have asked me to make a model using Flex together with Java,
    Hibernate, LCDS, SQL Server and Tomcat.
    I am currently using those versions :
    - jdk 1.5.0_12
    - Hibernate 3 (I use the jars provided with LCDS)
    - LCDS 2.5
    - SQL Server 2005
    - Tomcat 5.5
    As far as some of the tables from their databases are quite
    big (they can reach 2.000.000 rows) I need to implement paging. The
    table I currently use for my example is "only" 10.000 rows.
    I must confess that I am new to n-tiers architectures and
    that there are many concepts I misunderstand.
    What I want to do is make the user able to choose how many
    rows a page he wants to display (This could look a bit like
    this). And
    the server would only send this number of rows for each page (which
    is not the case for the page I linked).
    I have noticed that the implementation of the fill method for
    the HibernateAssembler had changed between FDS (
    public Collection fill(List fillArgs)) and LCDS (
    public Collection fill(List fillArgs, int startIndex, int
    numItems)).
    You are now able to specify a start index and the number of
    rows to display. This is the method I would like to use.
    To do so, I have tried to refer to
    LCDS
    documentation but I find it quite confusing. Here it is :
    Using on-demand paging
    There are two ways in which the Data Management Service
    implements on-demand paging of data by Flex clients. In the default
    approach, the fill method returns the entire collection of objects.
    The server sends the first page of items to the client as part of
    the initial fill request.
    As the client code tries to access ArrayCollection elements
    which are not resident, additional pages are retrieved from the
    server. If the cache-items property is set to true, these pages are
    sent directly by the Data Management Service. If the cache-items
    property is set to false, the Data Management Service calls the
    getItem() method for each item it needs to send to the client.
    When the original query is too large to be held in the
    server's memory, it is desirable for the Assembler to only return a
    single page of items at a time. In this mode, each time the client
    requests a page, the Assembler is asked for that page of items and
    they are sent directly to the client. Currently this mode is not
    supported when the autoSyncEnabled property is set to true for the
    paged collection. You must set the autoSyncEnabled property to
    false before executing the code. This configuration is not
    supported for the SQLAssembler. It is supported for the
    HibernateAssembler and you can implement it with your own Java
    Assembler implementation.
    To enable this second mode, you set the custom="true"
    attribute on the paging element in your network settings on the
    server and ensure paging is enabled with a reasonable pageSize
    value.
    If you are using the fill-method approach in your Assembler,
    you specify a fill method that matches the fill parameters used by
    your client with two additional parameters: the startIndex and the
    number of items requested. The Data Management Service calls this
    method once for each page requested by the client.
    If you are using the Assembler interface approach, you
    override the useFillPage() method for the appropriate fill method
    to return true for the fill parameters you want paged using custom
    paging. When the client requests a page, it calls the fill variant
    in the Assembler interface which takes the additional startIndex
    and number of items parameters. You return
    just those items and they are returned to the client.
    When you use custom paging in either the fill-method or
    Assembler approach, there are two ways that the client can
    determine the size of the collection. When you have enabled the
    custom paging mode, on the initial fill request made by the client,
    the Data Management Service invokes the count method with the
    parameters the client passed to fill. If the count
    method returns -1, a dynamic sizing algorithm is used for
    this filled collection. In this approach, the assembler's paged
    fill method is called with startIndex of 0 and number of items set
    to the pageSize + 1. If the assembler method returns less than the
    number requested, the size of the fill is known. If it returns the
    pageSize+1 items requested, pageSize items are
    returned to the client but the client sets the collection
    size to pageSize + 1 - with one empty slot at the end. When that
    empty item is requested by the client, the next pageSize+1 items
    are requested and the process repeats until the assembler returns
    less than pageSize+1 items.
    The HibernateAssembler implements this dynamic paging
    mechanism when you set the page-queries-from-database attribute to
    true in the destination's server properties. If you are using an
    HQL query sent from the client and the query is a simple query, the
    Hibernate assembler attempts to implement a count query by
    modifying the query sent from the client.
    If you are using a named query, the Hibernate assembler looks
    for a query named <original-query-name>.count. If that query
    exists, it uses it to compute the size of the paged collection.
    Otherwise, it uses the dynamic-sized approach.
    I guess I should change
    <params>java.util.List</params> for
    <params>java.util.List,int,int</params>.
    But I don't know which properties to add or modify.
    It also talks about the custom attribute of the paging
    element. Is it a new attribute that replaces "enabled" ? Or does it
    come in addition to it ?
    The following files are working and allow me to retrieve the
    datas I expect (but without paging).
    My data-management-config.xml looks like this :
    <?xml version="1.0" encoding="UTF-8"?>
    <service id="data-service" class="flex.data.DataService"
    messageTypes="flex.data.messages.DataMessage">
    <adapters>
    ....<adapter-definition id="java-adapter"
    class="flex.data.adapters.JavaAdapter" default="true"/>
    </adapters>
    <default-channels>
    ....<channel ref="my-rtmp"/>
    </default-channels>
    <destination id="refacteur.hibernate">
    ....<adapter ref="java-adapter" />
    ....<properties>
    ........<use-transactions>true</use-transactions>
    ........<source>flex.data.assemblers.HibernateAssembler</source>
    ........<scope>application</scope>
    ........<metadata>
    ............<identity property="cleacteur"/>
    ........</metadata>
    ........<network>
    ............<session-timeout>20</session-timeout>
    ............<paging enabled="false" pageSize="20"/>
    ............<throttle-inbound policy="ERROR"
    max-frequency="500"/>
    ............<throttle-outbound policy="REPLACE"
    max-frequency="500"/>
    ........</network>
    ........<server>
    ............<hibernate-entity>fr.phylum.referentiel.Refacteur</hibernate-entity>
    ............<fill-method>
    ................<name>fill</name>
    ................<params>java.util.List</params>
    ............</fill-method>
    ............<fill-configuration>
    ................<use-query-cache>true</use-query-cache>
    ................<allow-hql-queries>true</allow-hql-queries>
    ............</fill-configuration>
    ........</server>
    ....</properties>
    </destination>
    </service>
    This is the named query definition I use, found in
    Refacteur.hbm.xml :
    <query name="refacteur.where.ville.order.by.libacteur">
    ....<![CDATA[
    ........from Refacteur as refacteur
    ........where refacteur.villeActeur = ?
    ........order by libacteur
    ....]]>
    </query>
    And here is the call to the fill method, found in my mxml
    application file Acteurs.mxml :
    globalFilter.dataService.fill(globalFilter.arrayCollection,
    "refacteur.where.ville.order.by.libacteur", ["VANNES"]);
    I have tried to modify several things, but nothing works.
    I would be most grateful if someone could tell me what to
    change in my files in order to make the paging work.
    Nathalie.

    Have you seen the part of the example configs where it talks
    about what is required for data paging to work?
    <!--
    Indicates whether data paging is enabled for the destination
    and if you wish to override the
    pageSize set for the channel.
    Setting the custom flag to true indicates that the
    associated assembler has a paged-fill method
    corresponding to each method specified via the
    <fill-mathod> tag. The paged-fill method
    should have two additional java.lang.Integer params at the
    end of the parameters specified
    via the <params> tag. The first param specifes the
    index in the fill collection from which this
    method will start retrieving records. And the second param
    specifies the number of records to be
    retrieved by each paged-fill call.
    Default enabled value is false. Default pageSize value is
    10. Default custom value is false.
    <paging enabled="true" pageSize="5" custom="true"/>
    -->
    It seems to imply to me that you need the paged fill methods
    in your config in addition to the regular ones.
    I admit I have not got as far as getting a working paging
    setup yet, although this is something I will need to get working in
    the near future.

  • LCDS Caching and Paging

    How do we keep items in the LCDS data services cache independent between user sessions?  If I use session in the destination, I can still update an item in one users cache and have it change another users item (if the identity attribute is the same).
    Another way to look at this question is that we want to use the data management services to enable dynamic loading and paging of large sets of data.  We don't want to utilize it for data management between sessions.
    Thanks.
    tj

    Have you seen the part of the example configs where it talks
    about what is required for data paging to work?
    <!--
    Indicates whether data paging is enabled for the destination
    and if you wish to override the
    pageSize set for the channel.
    Setting the custom flag to true indicates that the
    associated assembler has a paged-fill method
    corresponding to each method specified via the
    <fill-mathod> tag. The paged-fill method
    should have two additional java.lang.Integer params at the
    end of the parameters specified
    via the <params> tag. The first param specifes the
    index in the fill collection from which this
    method will start retrieving records. And the second param
    specifies the number of records to be
    retrieved by each paged-fill call.
    Default enabled value is false. Default pageSize value is
    10. Default custom value is false.
    <paging enabled="true" pageSize="5" custom="true"/>
    -->
    It seems to imply to me that you need the paged fill methods
    in your config in addition to the regular ones.
    I admit I have not got as far as getting a working paging
    setup yet, although this is something I will need to get working in
    the near future.

  • Duplicate in material no

    Dear Experts,
    We have taken restart of MDM server. Now when we are trying to upload the repository for material it is giving error u201Ccannot set unique constrain on material no because duplicate record existu201D. We remove this condition from console temporarily to find out duplicate record in MDM. We checked duplicate by matching record u2018All vs Allu2019, it has not given any duplicate but still error remains the same.
    We only want to UP the repository with unique constrain on material no. Kindly help to find out duplicate in material no in  master data manager.
    Regards,
    Gaurang

    Hi Gaurang,
    I am detailing the steps from note below and also including my comments in bold:
    As the report mentions, Verify->Repair will automatically perform the following:
    1. Remove the Unique field so that repository can be loaded.
    2. Add a new integer field and populate numbers for the duplicate records only. All records with same number are duplicates for the same value.
    The addition of a integer field is automatic and it creates a duplicate label for duplicate records,it is populated for duplicated records,only for helping you delete those records with problem
    The user should perform the following:
    These are the steps you have to do:
    1. Load the repository (Update indices option).
    2. Inspect the duplicate values in the table with Data Manager with the help of new field
    3. Fix the duplicate problem by removing the duplicated records.
    4. Unload the repository
    5. Remove the new field and add back the unique constraint.This new field is the duplicate label field created automatically,delete that.
    6. Load the repository with Update Indices option.
    This sums it up,dont forget to take backup before you do a repair.
    Hope it helps.
    Thanks,
    Ravi

  • Dual core vs Quad core for a Filmmaker?

    Hi, I'm a 14 year-old filmmaker who really wants their next computer to be a mac mini. I am obviously on a tight budget being 14, so I was thinking just buying the standard dual-core processor. But for a filmmaker like myself, is it worth the extra $200 for my heavy-duty video-editing applications? I would use a mixture of Apple Motion 5, and the video-effects program Hitfilm Ultimate. I know quad is faster, but is it worth it for me?
    Thanks.

    "Hyperthreading" is the key. Hyper-threading enables each execution unit (or core, if you will) to process two threads (tasks) simultaneously.  It can do this because not every instruction takes only a single instruction cycle.  Sometimes instructions have to wait for a read from memory, which can take many clock cycles.  Sometimes multiple instructions can be performed at once -- for example, a floating point addition and an integer multiplication, as long as both instructions already have their operands in registers and store the results in different registers.  Hyper-threading enables each processor to handle multiple tasks by allowing one task to work while the other is waiting for a result, or allowing both instructions to be completed at the same time because they use non-conflicting resources.
    So, two "hyperthreaded" cores work as fast as four without hyperthreading, or the difference in speed is so negligible, you wouldn't notice it.  Since the Mac Mini Core i7 is also hyperthreaded, it works as well as dual quad cores, so if you need inudstry standard speed, then the Core i7 would be your best choice.
    As I said though, I can take 1080p video from my Canon Vixia, and edit it with OnLocation or Premiere Pro, and render it with barely a drain on my processor cores (2 or 4). So far, the biggest vid file I've done was about 250Mb, which was about a ten minute shoot. If you're going to work with 2Gb and up, then I'd definitely go with the Core i7 and max the RAM out to 16Gb.

  • Addition/Substraction of Binary. Converting Binary to Integer

    Hi,
    I wanted to know how you can add or substract from a binary
    value. Lets say xyz is binary now..... I want to convert 123 to
    binary form and add or substract with xyz. Is this possible?
    Finally I should be able to convert this new xyz i.e. after
    addition or substraction to a number... please let me know what
    should be done....
    I have already looked @ ToString, tobase64,CharsetEncode,
    BinaryEncode and dont think I would be able to use them before I
    know that add/subs thing..
    Thanks in advance...

    Do you know anything about powers of 2?
    first time through you get right most and multiply by 2^0
    recurse using the binary string - right most char and an iteration value...
    Here is a partial start for you:
    public int binaryStringToInt(String bs, int i){
      //bs is binary string you with to convert
      //i is your itration variable
      int intValue = 0;
      if(bs.length=1){
        //your code here
      }else{
        binaryString(......);
      return intValue;
    }

  • Assigning a binary value to an integer

    Hi, I am trying to assign a binary value in my program to an integer. In some assembly languages you would do the following:
    mov a, 00010101b
    for binary and for hex:
    mov a, 0E2h
    In java, you can assign a hex value with:
    int a=0x3F;
    What should I do to assign a binary value? Is it possible?
    Regards... Martin Schmiedel

    The static method parseInt in the java.lang.Integer class can be used to convert a String representing a binary number into its decimal integer value. In addition to the string representing the number, you also pass in an integer representing the radix, which for binary would be 2, hex would be 16, etc. So for example:
    int x = Integer.parseInt("00010110", 2);
    Is that what you're trying to do? Cheers,
    Chris

  • SelectManyListBox is not working for Integer Objects in Jsf

    hi,
    In JSF selectManyListBox is not working with Integer objects it is working only with String Objects. It is showing the error "value is invalid" can anybody please send me sample code snippet regarding this.

    The javadoc of UISelectMany.validateValue() says:
    In addition to the standard validation behavior inherited from UIInput, ensure
    that any specified values are equal to one of the available options.
    So, you should take care that the submitted values are equal to one of the
    options. Note that an Integer is never equal to a String.
    Show your codes to us.

  • How to do addition of two columns cells in Matrix.

    Hi All,
    I tried following code on LostFocus event of Mtrix. I want to do addition of two columns cells of matrix and addtion display in third column. I tried the following code but in this I am getting the column value and when i enterd any value in columns cells it disappear when i move to next column cells.
    Can anybody suggest me how to do it ?
    Dim i As Integer
                Dim v1, v2 As String
                matrix.Columns.Item("V_4").DataBind.SetBound(True, "", "matrixds")
                If pVal.ColUID = "V_4" Then
                    For i = 0 To matrix.RowCount - 1
                        v1 = matrix.Columns.Item("V_5").Cells.Item(i + 1).Specific.Value
                        v2 = matrix.Columns.Item("V_4").Cells.Item(i + 1).Specific.Value
                        Dim v3 As Integer = CInt(v1) + CInt(v2)
                        matrix.Columns.Item("V_3").Cells.Item(i + 1).Specific.Value = v3.ToString()
                    Next
                End If
    Thanks and Regards,

    Hi,
    u bind all the columns to the datasource in the matrix.then the value does not disappear.
    Change ur code as follows:
    Use the databind in formload
    matrix.Columns.Item("V_4").DataBind.SetBound(True, "", "matrixds1")
    matrix.Columns.Item("V_5").DataBind.SetBound(True, "", "matrixds2")
    matrix.Columns.Item("V_3").DataBind.SetBound(True, "", "matrixds3")
    Dim v1, v2 As sapbouicom.edittext
    If pVal.ColUID = "V_4" Then
    v1 = matrix.Columns.Item("V_5").Cells.Item(pVal.row).Specific
    v2 = matrix.Columns.Item("V_4").Cells.Item(pVal.row).Specific
    v3=  matrix.Columns.Item("V_3").Cells.Item(pVal.row).Specific
    v3.Value = v1 .Value + v2.Value
    End If
    Kind Regards
    Mohana

  • Binary addition,subtraction and modulus...plz help urgent

    plz help me on this query...
    i need to pass two 512 bit number as string,then convert them to binary and
    then perform binary addition,subtraction,modulus operations on those two numbers.finally convert result to integer.
    i designed a code which doesnt work correct.it is:
    * To change this template, choose Tools | Templates
    * and open the template in the editor.
    package bytearrayopeations;
    import java.math.BigInteger;   
    * @author sheetalb
    public class binaryadding {
        public static void main(String[] args) {
            BigInteger a = new BigInteger("123456");
            BigInteger b = new BigInteger("5121");
            String bb1 = a.toString(2);
            String bb2 = b.toString(2);
            String ss1 = null;
            String ss2 = null;
            String result = "";
            String carry="0";
            System.out.println("first value=" +bb1);
            System.out.println("second value=" +bb2);
            int k=bb1.length();
            int h=bb2.length();
            System.out.println("length 1="+ k);
            System.out.println("length 2=" +h);
            int p=h-k;
            //System.out.println("difference=" +p);
            int q=k-h;
            //System.out.println("difference 2=" +q);
            if(h==k)
           else if(h>k)
                for(int i=0;i<p;i++)
                    bb1="0"+bb1;
                System.out.println("new value of first=" +bb1);   
        else if(h<k)
            for(int i=0;i<q;i++)
                bb2="0"+bb2;
            System.out.println("new value of second=" +bb2);
            StringBuffer sb1=new StringBuffer(bb1);
         StringBuffer sb2=new StringBuffer(bb2);
            bb1=sb1.reverse().toString();
         bb2=sb2.reverse().toString();
            //System.out.println("rev. buffer1=" +bb1);
            //System.out.println("rev. buffer2=" +bb2);
            for(int i=0;i<bb1.length();i++)
                ss1=bb1.substring(i,i+1);
                ss2=bb2.substring(i,i+1);
              System.out.println("value1=" + ss1 + "    " + "value2=" + ss2);
              if (ss1.equals("0") && ss2.equals("0")) 
                 if (carry.equals("0")) 
                     result+="0";
                        else
                            result+="1";
               else if (ss1.equals("1") && ss2.equals("1"))
                if (carry.equals("0")) 
                    result+="0";
              carry="1";
              else
                   result+="1";
                   carry="1";
        else if (ss1.equals("0") && ss2.equals("1"))
                     if (carry.equals("0")) 
                         result+="1";
                   carry="0";
                        else
                          result+="0";
                                    carry="1";
               else if (ss1.equals("1") && ss2.equals("0"))
                     if (carry.equals("0")) 
                        result+="1";
                        carry="0";
                   else
                                result+="0";
                                carry="1";
           System.out.println("sum=" +result + "         " + "carry" + carry);
                        result+=carry;
                        StringBuffer sb3=new StringBuffer(result);
                        result=sb3.reverse().toString();
                    System.out.println("result is " +result); 
                  System.out.println("Binary = "+ result + ", Decimal = "+Integer.parseInt(result,2));
    }plz provide me or email me if possible java coding for all three operations as soon.
    [email protected]

    One thread is enough. Continue here:[http://forums.sun.com/thread.jspa?threadID=5373720&messageID=10643157#10643157]

  • I need a formula to convert a date into an integer (for use in Lookout)

    I have a DATA logger with the following:
    40001 = 4 (2004)
    40002 = 2 (February)
    40003 = 5 (5th)
    40004 = 13 (1:00pm)
    40005 = 12 (12 minutes)
    Lookout requires a date that it understands (eg. January 1, 1900).
    All I need is a basic formula to convert the date and time.
    This formula does not need to be specifically written for Lookout. Just a basic formula that I can do on paper or a calculator.
    I can integrate that formula into the Lookout software myself.

    Hello Smigman,
    First of all, I apologize in advance for not giving you "just the formula." And for the lengthy explanation (had to wait till after work hours), which you are very likely aware of already. I am writing this response in much detail so that it may benefit others.. hopefully And so that we understand the underlying principle involved, which will hopefully help us in building the formula the best way that suits us.
    As you have figured out, the data and time in Lookout is represented as a real number. This real number's integer portion represents days, and the decimal portion denotes time. The integer portion is basically the number of days since 01/01/1900. And the decimal portion is the number of seconds since midnight.
    So, for instance, if you insert the today() Expression in Lookout, you'll get a integer 38022 (which corresponds to today, Feb. 5th, 2004). In other words, today is the 38022nd day since 01/01/1900. Tomorrow, Feb. 6th 2004, will be 38023 and so on.
    The decimal part denotes time. A day has 24*60*60 = 86400 seconds, obviously. So, 1/86400 = 1.15741E-5 roughly represents one second. For instance, 38022.00001157 will give 02/05/2004 00:00:01.
    Coming to the formula now, for Time, first convert it to total seconds from midnight. E.g., 5:15:07pm would be (17*60*60) + (15*60) + 7 = 62107 seconds total since midnight. To get the Lookout's decimal part, divide this by 86400.
    62107/86400 = 0.71883102
    Therefore, 38022.71883102 would now give 02/05/2004 17:15:07. Computing Time is relatively easy.
    For the Date -- which is more complicated-- you could keep track of the total number of days either from 01/01/1900, or better still, a more recent day, like say 12/31/2003, which corresponds to 37986. To this reference you will keep adding 1 for each additional day to get the number for the current day. Note, you will have to accomodate leap years (Feb. 29th of this year, for instance).
    It's very helpful to have the reference day as the last day of the past year. That can be derived by counting the number of days since 01/01/1900 as follows:
    104 years * 365 days = 37960;
    + 1 day for each leap year
    A leap year is a year divisible by 4 (and 400 if the year ends with two zeros). There were 26 leap years from 1900 till 2003.
    So, 37960 + 26 = 37986. 12/31/2003 is thus represented by 37986.
    To get the integer for the Current Date we would first find what day of the year it is. Then add it to the reference day. Feb 5th, is the 36th day of the year. Adding this to 37986, gets us 38022.
    In your case you will have to come up with the correct day of the year using registers 40002 and 40003. Not sure if this helped or confused you more.
    I tried
    Khalid

  • Need help with method... wrote an addition program... have most of it

    Writing an addition program... have most of it below. Need help in getting the program to work.
    import javax.swing.*;
    import java.awt.*;
    import java.awt.event.*;
    public class Ch10program2 extends JFrame implements ActionListener
    private static final int FRAME_WIDTH = 750;
    private static final int FRAME_HEIGHT = 150;
    private static final int BUTTON_HEIGHT = 50;
    private static final int BUTTON_WIDTH = 50;
    private static final int BUTTON_Y_POSITION = 50;
    private static final String EMPTY_STRING = "";
    private int XbuttonPosition = 15;
    private JButton[] button;
    private String[] buttonLabels = {"0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "+", "=", "c"};
    private JTextField mytextfield;
    private int[] numberOne;
    private int[] numberTwo;
    private int[] sum;
    private int numberCounter = 0;
    private boolean adding = false;
    public static void main (String[] args)
    Ch10program2 frame = new Ch10program2 ();
    frame.setVisible (true);
    public Ch10program2 ()
    Container contentPane = getContentPane ();
    // set the frame properties
    setSize (FRAME_WIDTH, FRAME_HEIGHT);
    setLocation (200, 200);
    setTitle ("Big Integer Adder");
    setResizable (false);
    //set the content pane properties
    contentPane.setLayout (null);
    //creating each button
    button = new JButton [13];
    for (int i = 0 ; i < button.length ; i++)
    button = new JButton (buttonLabels [i]);
    button [i].setBounds (XbuttonPosition, BUTTON_Y_POSITION, BUTTON_WIDTH, BUTTON_HEIGHT);
    XbuttonPosition += 55;
    button [i].setForeground (Color.blue);
    if (i > 9)
    button [i].setForeground (Color.red);
    contentPane.add (button [i]);
    button [i].addActionListener (this);
    //set the arrays
    numberOne = new int [50];
    numberTwo = new int [50];
    //set the needed textfield
    mytextfield = new JTextField ("");
    mytextfield.setBounds (10, 10, 720, 25);
    mytextfield.setBorder (BorderFactory.createLoweredBevelBorder ());
    mytextfield.setHorizontalAlignment (JTextField.RIGHT);
    contentPane.add (mytextfield);
    setDefaultCloseOperation (EXIT_ON_CLOSE);
    public void actionPerformed (ActionEvent event)
    JButton clickedButton = (JButton) event.getSource ();
    String oldText = mytextfield.getText ();
    if ((event.getActionCommand ()).equals ("+"))
    mytextfield.setText (oldText + " + ");
    adding = true;
    numberCounter = 0;
    else if ((event.getActionCommand ()).equals ("="))
    mytextfield.setText (oldText + " = ");
    addArrays ();
    displayArray ();
    else if ((event.getActionCommand ()).equals ("c"))
    clearText ();
    else if (adding == false)
    mytextfield.setText (oldText + event.getActionCommand ());
    if (numberCounter == 0)
    numberOne [numberCounter] = Integer.parseInt (event.getActionCommand ());
    else
    for (int i = numberOne.length - 1 ; i > 0 ; i--)
    numberOne [i] = numberOne [i - 1];
    numberOne [0] = Integer.parseInt (event.getActionCommand ());
    numberCounter++;
    else
    mytextfield.setText (oldText + event.getActionCommand ());
    if (numberCounter == 0)
    numberTwo [numberCounter] = Integer.parseInt (event.getActionCommand ());
    else
    for (int i = numberTwo.length - 1 ; i > 0 ; i--)
    numberTwo [i] = numberTwo [i - 1];
    numberTwo [0] = Integer.parseInt (event.getActionCommand ());
    numberCounter++;
    oldText = mytextfield.getText ();
    public void addArrays ()
    int temp = 0;
    int carriedDigit = 0;
    for (int i = 0 ; i < 50 ; i++)
    temp = carriedDigit + numberOne [i] + numberTwo [i];
    if (temp > 10)
    sum [i] = (temp - 10);
    carriedDigit = 1;
    else
    sum [i] = temp;
    public void displayArray ()
    private void clearText ()
    mytextfield.setText (EMPTY_STRING);

    I don't know what you want to do
    but i have taken your program to get the GUI then the logic is your's
    You try solving it.
    import javax.swing.*;
    import java.awt.*;
    import java.awt.event.*;
    public class Ch10program2 extends JFrame implements ActionListener
    private static final int FRAME_WIDTH = 750;
    private static final int FRAME_HEIGHT = 150;
    private static final int BUTTON_HEIGHT = 50;
    private static final int BUTTON_WIDTH = 50;
    private static final int BUTTON_Y_POSITION = 50;
    private static final String EMPTY_STRING = "";
    private int XbuttonPosition = 15;
    private JButton[] button;
    private String[] buttonLabels = {"0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "+", "=", "c"};
    private JTextField mytextfield;
    private int[] numberOne;
    private int[] numberTwo;
    private int[] sum;
    private int numberCounter = 0;
    private boolean adding = false;
    public static void main (String[] args)
    Ch10program2 frame = new Ch10program2 ();
    frame.setVisible (true);
    public Ch10program2 ()
    Container contentPane = getContentPane ();
    // set the frame properties
    setSize (FRAME_WIDTH, FRAME_HEIGHT);
    setLocation (200, 200);
    setTitle ("Big Integer Adder");
    setResizable (false);
    //set the content pane properties
    contentPane.setLayout (null);
    //creating each button
    button = new JButton [13];
    for (int i = 0 ; i < button.length ; i++)
    button[i] = new JButton (buttonLabels);
    button[i].setBounds (XbuttonPosition, BUTTON_Y_POSITION, BUTTON_WIDTH, BUTTON_HEIGHT);
    XbuttonPosition += 55;
    button[i].setForeground (Color.blue);
    if (i > 9)
    button[i].setForeground (Color.red);
    contentPane.add (button[i]);
    button[i].addActionListener (this);
    //set the arrays
    numberOne = new int [50];
    numberTwo = new int [50];
    //set the needed textfield
    mytextfield = new JTextField ("");
    mytextfield.setBounds (10, 10, 720, 25);
    mytextfield.setBorder (BorderFactory.createLoweredBevelBorder ());
    mytextfield.setHorizontalAlignment (JTextField.RIGHT);
    contentPane.add (mytextfield);
    setDefaultCloseOperation (EXIT_ON_CLOSE);
    public void actionPerformed (ActionEvent event)
    JButton clickedButton = (JButton) event.getSource ();
    String oldText = mytextfield.getText ();
    if ((event.getActionCommand ()).equals ("+"))
    mytextfield.setText (oldText + " + ");
    adding = true;
    numberCounter = 0;
    else if ((event.getActionCommand ()).equals ("="))
    mytextfield.setText (oldText + " = ");
    addArrays ();
    displayArray ();
    else if ((event.getActionCommand ()).equals ("c"))
    clearText ();
    else if (adding == false)
    mytextfield.setText (oldText + event.getActionCommand ());
    if (numberCounter == 0)
    numberOne [numberCounter] = Integer.parseInt (event.getActionCommand ());
    else
    for (int i = numberOne.length - 1 ; i > 0 ; i--)
    numberOne[i] = numberOne [i - 1];
    numberOne [0] = Integer.parseInt (event.getActionCommand ());
    numberCounter++;
    else
    mytextfield.setText (oldText + event.getActionCommand ());
    if (numberCounter == 0)
    numberTwo [numberCounter] = Integer.parseInt (event.getActionCommand ());
    else
    for (int i = numberTwo.length - 1 ; i > 0 ; i--)
    numberTwo[i] = numberTwo [i - 1];
    numberTwo [0] = Integer.parseInt (event.getActionCommand ());
    numberCounter++;
    oldText = mytextfield.getText ();
    public void addArrays ()
    int temp = 0;
    int carriedDigit = 0;
    for (int i = 0 ; i < 50 ; i++)
    temp = carriedDigit + numberOne[i] + numberTwo[i] ;
    if (temp > 10)
    sum[i] = (temp - 10);
    carriedDigit = 1;
    else
    sum[i] = temp;
    public void displayArray ()
    private void clearText ()
    mytextfield.setText (EMPTY_STRING);
    All The Best

  • Value must be of type integer (between -2147483648 and 2147483647)

    Hi,
    Does anyone knows how to overcome this issue?
    NW7.01.05
    My Table in the View uses as dataSource a node called "DumpReport" - This has been created using a Structure type Zwd_S_Dumpage_Data.
    The structure has some elements, and my issue is in the Quantity element. This element is defined as:
    Element Name: Quantity
    Simple Type Package: [irrelevant]
    Simple Type: Zwd_E_Dumpqty
    Built-in Type: decimal
    Length: 13
    Decimals: 3
    I have one InputField, binding to this property. When I try to submit any decimal values, I get this error:
    " Value must be of type integer (between -2147483648 and 2147483647) " - related to that Context Property (Quantity).
    Regards,
    Daniel

    For future reference,
    External Length for this dataType was 17. We made it bigger in the R/3, since we compared to a Price field and it was 18 and working.
    Somehow this fixed our issue. I'm still looking for some additional information, since the Built-in type was a Decimal (WDP side) and it was being validated as an Integer?!!?
    Daniel

Maybe you are looking for

  • Hangs when calling report to be displayed in PDF format

    I am calling reports from a form using RUN_PRODUCT to be displayed in PDF format. Initially, there is no problem generating and displaying reports, but inevitably at some point when a report is run it just hangs. Rebooting the server temporarily fixe

  • Return key breaks dialog boxes

    I have illustrator cs5 on snow leopard. When I open up a dialog box I often try to push enter when I'm done typing stuff to close it.  The OK button is highlighted so you'd think this would work. But no, instead it just completely breaks the dialog. 

  • Java.util.date --- date calculation

    I need calculate between 2 dates. suppose d1=2008-12-06 d2 = 2008-12-29 i need to subtract d1 from d2 & that will return the day difference..that can be in integer form & here the result will be 23. How can i do this???? & How can i get current date

  • Transform

    Hi again, anyone knows if there is any universal-and-generic servlet, for any application server, that is able to translate an xml file using xsl templates? In fact, our problem is that we are trying to port our application (developed using XML and X

  • NEEDING HELP-curve 9300-photo uploading on bbm

    Hi everyone i am new to the forums and neding some help with my curve please!!! i got my contract with 3 mobile out in july, and got the curve, i have been able to upload 1 picture via bbm to a friend and now it wont let me everything is there to sen