Shifting binary values

Hi ,
I was wondering if someone is still awake and can help me out here. I am trying to do Right Shift operation on the attached values. I need to shift the values by 2 places to the Right.
for example,  1110011011111  will become 0011100110111.
meaning add  two 0 at the front  and remove the last 2 digit.
Attachments:
shifting values.vi ‏9 KB
shifting values.vi ‏9 KB

Is that your actual data? A sequence of the characters "1" and "0" (not the actual numbers 0 and 1), with tabs in between? The Logical Shift function only works with numbers. So, if that's your actual data, you first need to convert it to an array of numbers, and then you can use the Logical Shift function. You can convert the string to an array using the Spreadsheet String to Array and then use Scan From String to convert the sequence of character to a number.
EDIT: Was creating my response while RF was posting his reply.
Attachments:
shifting values_BD.png ‏4 KB

Similar Messages

  • Assigning a hex value to a variable and getting binary value of a variable.

    I try to develop java programs and I need to do a conversion unicode to EBCDIC and vice versa.
    How can I assign hex values to variables to build UTF-EBCDIC and EBCDIC-UTF table and get hex or binary value of data to compare it to value of in the table?
    I did a conversion like this with PL/1 before. I do not know how can I do it with Java. Because I am new to Java.
    Thank you in advance.

    I will run java code in mainframe and java uses
    unicode for data in default and mainframe environment
    is EBCDIC. So I have to translate the data from
    unicode to ebcdic.I said I think String supports EBCDIC encoding...
    String ebcdic = new String(ebcdicBytes, "Cp500");
    http://java.sun.com/j2se/1.4.2/docs/guide/intl/encoding.doc.html

  • Need to convert a binary value into decimal

    Hi i need to convert a binary value which i would be getting as a string object to a decimal value......need code for the same

    Check Integer.parseInt
    http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Integer.html#parseInt(java.lang.String,%20int)

  • 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

  • Binary Values unreadable - Database corrupt?

    Hi,
    I'm experiencing a really weird problem here, I have a table with some varchar columns and two binary columns. What I do now, is to select data from it via Python with the following select statement:
    select * from torder where customerid=1624 order by torderid desc
    What happens is, that only for this customerid some binary data is missing, they contain an empty string. If I do the select like this:
    select * from torder where customerid=1624 order by torderid
    It does work, the data is there. With this, it works too:
    select * from torder order by torderid desc
    So it seems, the combination of "customerid=1624" and "desc" somehow corrupts the results.
    What's furthermore interesting is, that when I delete the last inserted row of the result, it works, and if I add a new one, it's broken again.
    I could not check if the error is Python-related or not, as I found no way to retrieve/display the binary data in sqlcli, as it displays only something like 0x8002637A6F70652E6931 , but I doubt that this has something to do with Python.
    Any clues of how to fix this?
    My database version is Kernel    7.6.06   Build 003-121-202-135 | X32/LINUX 7.6.06   Build 003-121-20
    2-135
    Previously, I had 7.6.03 and updated it to the above version, hoping that this would fix the problem, but it did not.
    Best Regards,
    Hermann Himmelbauer

    Ok, first many thanks for your quick reply. I did not answer at first as the problem magically went away. But unfortunately the problem is back today.
    <p/>
    The DDL statements look the following, there are no indexes on the table:
    <p/>
    <pre>
    CREATE TABLE torder (
            torderid INTEGER NOT NULL DEFAULT SERIAL,
            creation_date TIMESTAMP,
            transfer_date TIMESTAMP,
            signed_date TIMESTAMP,
            signed_with VARCHAR(3) CHECK (signed_with in ('TAN', 'BKU', 'MAN') OR signed_with IS NULL),
            revocation_date TIMESTAMP,
            done_date TIMESTAMP,
            formdata LONG BYTE NOT NULL,
            trans_function VARCHAR(30) NOT NULL CHECK (trans_function in ('do_bank_transfer', 'do_bank_collection',
                                    'do_cheque_transfer', 'do_cash', 'do_cashdraw')),
            trans_type VARCHAR(30) NOT NULL CHECK (trans_type in ('national','sepa','international')),
            applet_location VARCHAR(35),
            errors_text VARCHAR(100),
            errors LONG BYTE,
            customerid INTEGER,
            dbuserid INTEGER,
            torder_periodicid INTEGER,
            PRIMARY KEY (torderid),
             FOREIGN KEY(customerid) REFERENCES kunde (kundeid),
             FOREIGN KEY(dbuserid) REFERENCES dbuser (dbuserid),
             FOREIGN KEY(torder_periodicid) REFERENCES torder_periodic (torder_periodicid)
    </pre>
    <p/>
    The insert statements look the following (They are copied out of the SQLAlchemy SQL log), one can see that the binary values are inserted here:
    <p/>
    <pre>
    INFO:sqlalchemy.engine.base.Engine.0x...d110:INSERT INTO torder (creation_date, transfer_date, signed_date, si
    gned_with, revocation_date, done_date, formdata, trans_function, trans_type, applet_location, errors_text, err
    ors, customerid, dbuserid, torder_periodicid) VALUES (now(), ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
    INFO:sqlalchemy.engine.base.Engine.0x...d110:['20091027113506345604', None, None, None, None, '\x80\x02}q\x01(
    U\x0bcharges_forq\x02U\x04bothq\x03U\x05dcodeq\x04U\x0588888q\x05U\x0ccurrency_isoq\x06U\x03EURq\x07U\x06valut
    aq\x08K\x00U\x11foreign_acc_name1q\tU\x11Foreign Account 2q\nU\x0cacc_payer_noq\x0bX\t\x00\x00\x00999111110q\x
    0cU\ttextlinesq\r]q\x0e(U\x0c1st transferq\x0fU\tMultilineq\x10U\x0bFor testingq\x11eU\x06amountq\x12cdecimal\
    nDecimal\nq\x13U\x071000.00\x85Rq\x14U\x0cacc_benef_noq\x15X\t\x00\x00\x00888111110q\x16U\x11foreign_acc_name2
    q\x17U\x0bfor Testingq\x18u.', 'do_bank_transfer', 'national', 'url:test_transfer', None, None, None, None, No
    ne]
    </pre>
    <p/>
    All rows are inserted with binary data, so it's never NULL and it's also never set to an empty string ('').
    <p/>
    But when reading back the rows, some binary values are an empty string.
    <p/>
    The following Python code illustrates the problem:
    <pre>
    import sapdb.dbapi
    def true_false_result(result):
        if result:
            return 'Bug begins'
        else:
            return 'Bug ends'
    def check_bincols(bdb, sqlcmd):
        print "----
        print "QUERY: %s" % sqlcmd
        print "----
        bdbc = bdb.cursor()
        bdbe = bdbc.execute(sqlcmd)
        bug_occured = False
        stored_bin_result = False
        while 1:
            row = bdbe.fetchone()
            if row is None:
                break
    Now check if the binary data results to an empty string,
    This should never happen (= the database bug)
            bin_result = (row[7]() == '')
            if bin_result != stored_bin_result:
                bug_occured = True
                print "Toggle to %s at torderid %s" % (
                    true_false_result(bin_result),
                    row[0])
                stored_bin_result = bin_result
        if not bug_occured:
            print "No Bug for this query"
        bdbe.close()
        bdbc.close()
    #bdb.close()
    if __name__ == '__main__':
        bdb = sapdb.dbapi.connect('USER', 'PASS', 'DBNAME', 'LOCALHOST')
    First try the original query, which results in a bug
        sqlcmd = 'select * from torder where customerid=1624 order by torderid desc'
        check_bincols(bdb, sqlcmd)
    This query normally is bugfree
        sqlcmd = 'select * from torder where customerid=1624 order by torderid'
        check_bincols(bdb, sqlcmd)
    This query has a bug, too
        sqlcmd = 'select * from torder order by torderid desc'
        check_bincols(bdb, sqlcmd)
    But this one not
        sqlcmd = 'select * from torder order by torderid'
        check_bincols(bdb, sqlcmd)
    This triggers the bug, too, which is curious as there's practically no ordering
        sqlcmd = 'select * from torder where customerid=1624 order by customerid desc'
        check_bincols(bdb, sqlcmd)
    So, it seems that the bug occurs only when using "DESC" for descending
    ordering.
    </pre>
    <p/>
    The output of this program is:
    <p/>
    <pre>
    QUERY: select * from torder where customerid=1624 order by torderid desc
    Toggle to Bug begins at torderid 1355
    Toggle to Bug ends at torderid 582
    QUERY: select * from torder where customerid=1624 order by torderid
    No Bug for this query
    QUERY: select * from torder order by torderid desc
    No Bug for this query
    QUERY: select * from torder order by torderid
    No Bug for this query
    QUERY: select * from torder where customerid=1624 order by customerid desc
    Toggle to Bug begins at torderid 1355
    Toggle to Bug ends at torderid 582
    </pre>
    <p/>
    So, it can be seen that the problem occurs ONLY when using descending ordering. Moreover it's interesting that the result for "select * from torder order by torderid desc" is sometimes buggy, sometimes not, which seems to be related if someone inserted some more rows or not. What's furthermore interesting is the last query, as there the order is applied to "customerid", which is the very same for every row, so there is no ordering and the bug occurs here, too.
    <p/>
    All this happens on my production instance. I have a testing environment, where I imported the very same data set (same database version etc.) and there is no such problem (for now), so it's quite complicated to nail down the problem further as I cannot easily disrupt the availability of the production instance.
    <p/>
    All I could do for now is not to use the "DESC" command and reorder the data in my application, but that is really suboptimal as I have to keep all results in memory.
    <p/>
    Any help is really appreciated!
    <p/>
    Best Regards,<BR>
    Hermann Himmelbauer
    <p>
    Update: I tried the same query with the following code with C++ / SQLDBC (I modified one of the SQLDBC examples):
    <p>
    <pre>
    First you have to include SQLDBC.h
    #include "SQLDBC.h"
    #include <stdio.h>
    typedef struct ConnectArgsT {
        char * username;
        char * password;
        char * dbname;
        char * host;
    } ConnectArgsT;
    static void parseArgs (ConnectArgsT * connectArgs, int argc, char **argv);
    using namespace SQLDBC;
    Let start your program with a main function
    int main(int argc, char *argv[])
       ConnectArgsT connectArgs;
       parseArgs (&connectArgs, argc, argv);
       char errorText[200];
    Every application has to initialize the SQLDBC library by getting a
    reference to the ClientRuntime and calling the SQLDBC_Environment constructor.
       SQLDBC_IRuntime *runtime;
       runtime = SQLDBC::GetClientRuntime(errorText, sizeof(errorText));
       if (!runtime) {
         fprintf(stderr, "Getting instance of the ClientRuntime failed %s", errorText);
         return (1);
       SQLDBC_Environment env(runtime);
    Create a new connection object and open a session to the database.
       SQLDBC_Connection *conn = env.createConnection();
       SQLDBC_Retcode rc;
       rc = conn->connect(connectArgs.host, connectArgs.dbname,
                          connectArgs.username, connectArgs.password);
       if(SQLDBC_OK != rc) {
         fprintf(stderr, "Connecting to the database failed %s", conn->error().getErrorText());
         return (1);
       printf("Sucessfull connected to %s as user %s\n",
              connectArgs.dbname, connectArgs.username);
    Create a new statment object and execute it.
       SQLDBC_Statement *stmt = conn->createStatement();
       rc = stmt->execute("select * from torder where customerid=1624 order by torderid desc");
       if(SQLDBC_OK != rc) {
         fprintf(stderr, "Execution failed %s", stmt->error().getErrorText());
         return (1);
    Check if the SQL command return a resultset and get a result set object.
       SQLDBC_ResultSet *result;
       result = stmt->getResultSet();
       if(!result) {
         fprintf(stderr, "SQL command doesn't return a result set %s", stmt->error().getErrorText());
         return (1);
    Position the curors within the resultset by doing a fetch next call.
       while (1) {
         rc = result->next();
         if(SQLDBC_OK != rc) {
           break;
           //fprintf(stderr, "Error fetching data %s", stmt->error().getErrorText());
           //return (1);
         char szString[30];
         char szString1[3000];
         SQLDBC_Length ind;
    Get a string value from the column.
         rc = result->getObject(1, SQLDBC_HOSTTYPE_ASCII, szString, &ind, sizeof(szString));
         if(SQLDBC_OK != rc) {
           fprintf(stderr, "Error getObject %s", stmt->error().getErrorText());
           return (1);
         rc = result->getObject(8, SQLDBC_HOSTTYPE_ASCII, szString1, &ind, sizeof(szString1));
         if(SQLDBC_OK != rc) {
           fprintf(stderr, "Error getObject %s", stmt->error().getErrorText());
           return (1);
         printf("%s %s\n", szString, szString1);
    Finish your program with a returncode.
       return 0;
    static void parseArgs (ConnectArgsT * connectArgs, int argc, char **argv)
    setting defaults for demo database
        connectArgs->username = (char*)"USER";
        connectArgs->password = (char*)"PASS";
        connectArgs->dbname = (char*)"MYDB";
        connectArgs->host = (char*)"localhost";
    use values from command line
        if (argc > 4) {
            connectArgs->host = argv [4];
        if (argc > 3) {
            connectArgs->dbname = argv [3];
        if (argc > 2) {
            connectArgs->password = argv [2];
        if (argc > 1) {
            connectArgs->username = argv [1];
    </pre>
    <p/>
    This works!! So it seems, that the problem is related to the Python module, which is interesting, as adding "DESC" should not be any difference to it. I personally suspect that there are some memory leaks in the code, which result in this strange behavior.
    <p/>
    Any suggestions?<p/>
    Best Regards<br>
    Hermann Himmelbauer
    Edited by: Hermann Himmelbauer on Oct 28, 2009 12:51 PM
    Edited by: Hermann Himmelbauer on Oct 28, 2009 12:55 PM

  • Insert Large Binary Values

    Hi all.,
    I want to insert a very large binary value of about 40000 character into database table i have tried by using clob datatype and blob datatype but all my efforts where ended in vain..
    So can any one help me on this......
    Thanks In advance

    You should use the dbms_lob package.
    RTM first, then ask.

  • Binary values corrupted in Content Manager

    Hello,
    When I copy and paste (or move) a content that has a property binary, in the second instance (the copy) these properties are corrupted. When I try to access to these properties, I receive the next exception:
    com.bea.content.RepositoryException: No binary value could be found for property.
    I'm working with WLPortal 10.3.
    Is this a bug of Portal?
    Is there any way to do this and the data are not corrupted?
    Thanks.

    When I copy or move there isn't exception, but when I access to the binary property of copy, it log this exception:
    An error occurred while attempting to download the file. Use the browser back button to continue working.
    com.bea.content.RepositoryException: No binary value could be found for property. Repository: catsrv Repository Property ID: 510536002/Docu_relacionada.archivo/510540053 at com.bea.content.manager.internal.InternalNodeOpsBean.getPropertyBytes(InternalNodeOpsBean.java:1853) at com.bea.content.manager.internal.InternalNodeOpsBean.getPropertyBytes(InternalNodeOpsBean.java:2023) at com.bea.content.manager.internal.NodeOpsEJB_ihurl6_ELOImpl.getPropertyBytes(NodeOpsEJB_ihurl6_ELOImpl.java:181) at com.bea.content.manager.internal.NodeOpsImpl.getPropertyBytes(NodeOpsImpl.java:748) at com.bea.content.federated.internal.NodeManagerImpl.getStream(NodeManagerImpl.java:990) at com.bea.portal.tools.content.controls.ContentNodeControlImpl.getStream(ContentNodeControlImpl.java:281) at com.bea.portal.tools.content.controls.ContentNodeControlBean.getStream(ContentNodeControlBean.java:1223) at content.node.nodeSelected.download.DownloadContentController.begin(DownloadContentController.java:184) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.apache.beehive.netui.pageflow.FlowController.invokeActionMethod(FlowController.java:879) at org.apache.beehive.netui.pageflow.FlowController.getActionMethodForward(FlowController.java:809) at org.apache.beehive.netui.pageflow.FlowController.internalExecute(FlowController.java:478) at org.apache.beehive.netui.pageflow.PageFlowController.internalExecute(PageFlowController.java:306) at global.internal.AbstractBaseController.internalExecute(AbstractBaseController.java:360) at org.apache.beehive.netui.pageflow.FlowController.execute(FlowController.java:336) at org.apache.beehive.netui.pageflow.internal.FlowControllerAction.execute(FlowControllerAction.java:52) at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:431) at org.apache.beehive.netui.pageflow.PageFlowRequestProcessor.access$201(PageFlowRequestProcessor.java:97) at org.apache.beehive.netui.pageflow.PageFlowRequestProcessor$ActionRunner.execute(PageFlowRequestProcessor.java:2044) at org.apache.beehive.netui.pageflow.interceptor.action.internal.ActionInterceptors.wrapAction(ActionInterceptors.java:91) at org.apache.beehive.netui.pageflow.PageFlowRequestProcessor.processActionPerform(PageFlowRequestProcessor.java:2116) at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:236) at org.apache.beehive.netui.pageflow.PageFlowRequestProcessor.processInternal(PageFlowRequestProcessor.java:556) at org.apache.beehive.netui.pageflow.PageFlowRequestProcessor.process(PageFlowRequestProcessor.java:853) at org.apache.beehive.netui.pageflow.AutoRegisterActionServlet.process(AutoRegisterActionServlet.java:631) at org.apache.beehive.netui.pageflow.PageFlowActionServlet.process(PageFlowActionServlet.java:158) at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:414) at javax.servlet.http.HttpServlet.service(HttpServlet.java:707) at javax.servlet.http.HttpServlet.service(HttpServlet.java:820) at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227) at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125) at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:292) at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26) at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:42) at com.bea.jsptools.servlet.PagedResultServiceFilter.doFilter(PagedResultServiceFilter.java:82) at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:42) at com.bea.p13n.servlets.PortalServletFilter.doFilter(PortalServletFilter.java:336) at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:42) at weblogic.servlet.internal.RequestDispatcherImpl.invokeServlet(RequestDispatcherImpl.java:503) at weblogic.servlet.internal.RequestDispatcherImpl.forward(RequestDispatcherImpl.java:251) at org.apache.beehive.netui.pageflow.internal.DefaultForwardRedirectHandler.forward(DefaultForwardRedirectHandler.java:128) at org.apache.beehive.netui.pageflow.PageFlowRequestProcessor.doForward(PageFlowRequestProcessor.java:1801) at org.apache.beehive.netui.pageflow.PageFlowRequestProcessor.processPageFlowRequest(PageFlowRequestProcessor.java:741) at org.apache.beehive.netui.pageflow.PageFlowRequestProcessor.processInternal(PageFlowRequestProcessor.java:474) at org.apache.beehive.netui.pageflow.PageFlowRequestProcessor.process(PageFlowRequestProcessor.java:853) at org.apache.beehive.netui.pageflow.AutoRegisterActionServlet.process(AutoRegisterActionServlet.java:631) at org.apache.beehive.netui.pageflow.PageFlowActionServlet.process(PageFlowActionServlet.java:158) at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:414) at javax.servlet.http.HttpServlet.service(HttpServlet.java:707) at javax.servlet.http.HttpServlet.service(HttpServlet.java:820) at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227) at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125) at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:292) at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26) at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:42) at com.bea.jsptools.servlet.PagedResultServiceFilter.doFilter(PagedResultServiceFilter.java:82) at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:42) at com.bea.portal.tools.servlet.http.HttpContextFilter.doFilter(HttpContextFilter.java:60) at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:42) at com.bea.p13n.servlets.PortalServletFilter.doFilter(PortalServletFilter.java:336) at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:42) at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3502) at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321) at weblogic.security.service.SecurityManager.runAs(Unknown Source) at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2186) at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2092) at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1406) at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201) at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)

  • CFGRID shifting column values

    Hi,
    I have a CFGRID that has 5 columns in which its values are
    obtained from the database. There is a single submit button that
    would submit to a processor page that updates any records with
    changed cells. The problem that I'm having is that the processor
    page would shift the values of the columns one over. For example,
    the value of column 4 would display as column 3 on the processor
    page. Below is the code:
    cfgrid page:
    <cfform method="post" name="adcost"
    action="index.cfm?fuseaction=process_advertising_cost_grid">
    <cfgrid name="advertizingCosts"
    format="HTML"
    query="advertizingcosts"
    selectMode="edit"
    colHeaders="true"
    colHeaderBold="yes"
    width="600"
    maxRows="25"
    stripeRows="yes"
    stripeRowColor="efefef"
    >
    <cfgridcolumn name="AdvertizingCostsID" header="ID"
    width="20" select="no">
    <cfgridcolumn name="AdvertizingCostsDate"
    header="Advertizing Costs Date" mask="MMMM D, YYYY" width="160">
    <cfgridcolumn name="Amount" header="Amount"
    width="60">
    <cfgridcolumn name="Details" header="Details">
    <cfgridcolumn
    name="StoreFrontName"
    header="StoreFront"
    width="150"
    values="#ValueList(storefronts.StoreFrontCode)#"
    valuesDisplay="#ValueList(storefronts.StoreFrontName)#"
    >
    </cfgrid>
    <input type="submit" value="submit" class="button" />
    </cfform>
    processor page:
    <cfif
    IsDefined("form.advertizingCosts.RowStatus.Action")>
    <cfloop index="counter" from="1"
    to="#ArrayLen(form.advertizingCosts.RowStatus.Action)#">
    <cfoutput>
    <p>
    counter is #counter#<br />
    The row action for #counter# is
    #form.advertizingCosts.RowStatus.Action[counter]#<br />
    AdvertizingCostsID is
    #form.advertizingCosts.AdvertizingCostsID[counter]#<br />
    AdvertizingCostsDate is
    #form.advertizingCosts.AdvertizingCostsDate[counter]#<br />
    Amount is #form.advertizingCosts.Amount[counter]#<br
    />
    Details is #form.advertizingCosts.Details[counter]#<br
    />
    StoreFrontName is
    #form.advertizingCosts.StoreFrontName[counter]#
    </p>
    <cfif #form.advertizingCosts.RowStatus.Action[counter]#
    eq "U">
    <pre>
    Original AdvertizingCostsDate:
    #form.advertizingCosts.Original.AdvertizingCostsDate[counter]#
    Original Amount:
    #val(form.advertizingCosts.Original.Amount[counter])#
    Original Details:
    #form.advertizingCosts.Original.Details[counter]#
    Original StoreFrontName is
    #form.advertizingCosts.Original.StoreFrontName[counter]#
    </pre>
    <cfelse>
    </cfif>
    </cfoutput>
    </cfloop>
    </cfif>
    The Amount data would end up going to the details column, the
    date appears as the amount on the second page. This page only
    displays values.
    It looks to be correct, but I'm not sure what is causing the
    shifting.
    Any help would be great!
    Jason

    This fixed it for me. Only do this if you have version 9.01 of coldfusion.
    Open cfide/scripts/ajax/package/grid.js
    find this line of code
    var _5aa=$G.computeActualRow_editField(this.editFieldState,this.selectedRow);    (IT is in the $G.Actions.afterEdit=function(_5a8))
    change it to
    var _5aa=$G.computeActualRow_editField(this.editFieldState,_5a8.row+1);
    every thing should now be in sync

  • Losing the leading zero in binary values

    Hi all,
    I�m currently creating some basic examples of bitwise operations and I�ve just noticed that I�m losing the leadnig zero of a binary value ( e.g.
    decimal 1 (expecting to see bin of 0001) is manifesting as 1
    decimal 16 (expecting to see bin of 00010000) is manifesting as 10000
    below is a full example
    import static java.lang.Integer.*;
    public class BitExample {
    public static void main(String[] args) {   
    System.out.println(
         toBinaryString(0x1) + '\n' +
         toBinaryString(0x16) + '\n' +
         toBinaryString(0x6a) + '\n' +
         toBinaryString(0x80)
    I can see I�m missing something, but not sure what. Can you help?
    Many Thanks
    Giles

    which obviously returns a very different resultNo it does not ... let's translate the example to decimal (with additions instead of bitwise operations, but that doesn't change anything:
    1234 +
    0001
    1235and
    1234 +
    1
    1235both notations are correct, aren't they? Now the second one doesn't look so nice (and usually the 1 should be right-aligned to be easily readable, but it isn't wrong, because of this.
    The same is true for binary operations. The problem is, that while learning bitwise operations it's easier to unserstand if you always write the leading zero (as you do in your example).

  • Convert decimal to binary values

    Hello friends, I have this:
    Doblue [ ][ ] dbValues;and I need convert that array in a binary values...and save it in a File
    Do you know how can I do it?....thanks

    So, I need create a binary file, how can I creat
    it??..thanks....There. Are. No. Files. That. Are. Not. Binary.
    File f = new File("/wherever/whatever.name");
    FileOutputStream fos = new FileOutputStream(f);Wrap an ObjectOutputStream around fos and stuff in the array. Like I already said.

  • Binary value to string

    Hi,
    I want to convert binary value to string format. How can i do that if possible please give me sample code.?
    One more question is i want to do reverse thing also that is convert string value to binary format.?
    Waiting for reply

    There are methods in Integer, Long etc for transforming to binary.
    I think there are probably also methods to go from binary to an int. Check out the JavaDoc

  • Issues storing binary values

    Hi,
    I am desperately trying to store userCertificate or cACertificate attributes on an OpenLDAP server. I always end up with following exception:
    javax.naming.directory.InvalidAttributeValueException: [LDAP: error code 21 - cACertificate;binary: value #0 invalid per syntax]; remaining name 'cn=1234,�'
    The code I am using looks like this:
    Attributes attrs = new BasicAttributes(true);
    Attribute objclass = new BasicAttribute("objectclass");
    objclass.add("top");
    objclass.add("applicationProcess");
    objclass.add("pkiCA");
    attrs.put(objclass);
    byte[] certBuf = new byte[] {1,2,3,4,5};
    BasicAttribute cert = new BasicAttribute("cACertificate;binary", certBuf);
    attrs.put(cert);
    Context result = _ctx.createSubcontext("cn=1234,�I assume I need the �;binary� option, as I get following exception if I don�t use it:
    javax.naming.directory.InvalidAttributeIdentifierException: [LDAP: error code 17 - cACertificate: requires ;binary transfer]; remaining name 'cn=234,�
    The very strange thing is that I have tried to add a jpegPhoto (same dummy-data as the certificate )to the LDAP server and this works fine - without the �;binary� option:
    BasicAttribute photo = new BasicAttribute("jpegPhoto", photoBuf);I don�t think that it is a matter of the JRE as I have tried version 1.4, 1.5 and 1.6. I am also not sure if it is OpenLDAPs fault because it is possible to add those Attributes by using a LDAP client (in my case LDAPStudio).
    Does anybody know this issue?
    Thanks for any help,
    Phil

    caCertificate has a well known syntax defined in X.509.
    OpenLDAP does have support for these X.509 syntaxes and will verify that the certificate you are adding to the server is valid.
    Clearly certBuf = new byte[] {1,2,3,4,5}; is not a valid certificate.
    Regards,
    Ludovic.

  • Doubt on calculating Hexadecimal and binary values

    Please give me some tips to find the hexadecimal and binary values of negative numbers for eg:-
    The hexadecimal value of -1 is 0xffffffff. Here I don't know how the corresponding hex value is calculated.
    I calculate the hex value of numbers in this way. For eg: to get the hex value 11
    1*16^1 + 1*16^0 = 17.
    Similar logic to convert binaries to decimal by using the base 10.

    It's about 2s complement arithmatic.
    Hexidecimal representation is used by people interested in the bit patterns, rather than numerical values as such so integers are treated as unsigned. But when working in decimal we're generally treating the variable as signed. Negative integers are represented by "adding" 2^32 to them so -1 becomes 2^32-1. This is stored as a word where all bits are 1s, which means in hex all nybles are 'F'.

  • CacheStore access to binary value in store/storeAll

    What is the best way to get the raw binary value of the entry(ies) in a store/storeAll CacheStore method?

    Hi Jk,
    Thanks. This is actually what i had been trying without any success (although i mistakenly said BinaryStoreCacheStore rather than BinaryEntryStore in the post above). When the BinaryEntryStore.store is called, i try and convert just the key back to object with:
    Object o = ExternalizableHelper.fromBinary(paramBinaryEntry.getBinaryValue());
    but like i mentioned above, this throws the following as it seems to think the binary is not pof.
    java.io.StreamCorruptedException: invalid type: 171
         at com.tangosol.util.ExternalizableHelper.fromBinary(ExternalizableHelper.java:266)
         at com.tangosol.util.ExternalizableHelper.fromBinary(ExternalizableHelper.java:230)
         at com.b.p.coherence.cacheStore.DatabaseCacheStore.store(DatabaseCacheStore.java:139)
         at com.tangosol.net.cache.ReadWriteBackingMap$BinaryEntryStoreWrapper.storeInternal(ReadWriteBackingMap.java:6035)
         at com.tangosol.net.cache.ReadWriteBackingMap$StoreWrapper.store(ReadWriteBackingMap.java:4814)
         at com.tangosol.net.cache.ReadWriteBackingMap.putInternal(ReadWriteBackingMap.java:1236)
         at com.tangosol.net.cache.ReadWriteBackingMap.put(ReadWriteBackingMap.java:745)
    thanks

  • Get binary value

    Hi all
    Consider that I have a string in hex like this:
    3020058020C00004Now I wanna convert it to binary, then I wanna have each digit single. For example, binary value for above string is:
    11000000100000000001011000000000100000110000000000000000000100And I wanna have
    1
    1
    0
    0
    0
    0
    0
    0
    1
    0
    0
    0
    0
    0
    0
    0
    0
    0
    0
    1
    0
    1
    1
    0
    0
    0
    0
    0
    0
    0
    0
    0
    1
    0
    0
    0
    0
    0
    1
    1
    0
    0
    0
    0
    0
    0
    0
    0
    0
    0
    0
    0
    0
    0
    0
    0
    0
    0
    0
    1
    0
    0How can I achieve this?

                String s_hex = "3020058020C00004";
                String s_bin = Long.toBinaryString(Long.parseLong(s_hex, 16));
                for(int i = 0;i<s_bin.length();i++)
                    System.out.println(s_bin.charAt(i));

Maybe you are looking for