Bitwise And operator

If the binaryStrings of two ints "a" and "b" are different lengths will the & operator always return zero? i.e
int a =8;
int b =4;
String binarya = "1000"
String binaryb = "100"
System.out.println(8,4); --> 0
Thanks

847102 wrote:
Kayaman wrote:
There is no "different length", the two parameters will always have the same length. Bitwise AND will work on bytes, shorts, ints and longs, meaning 8-bit, 16-bit, 32-bit or 64-bit "lengths".
Each resulting bit is 1 if both input bits are 1, otherwise the resulting bit is 0.The answer 8 & 4 = 0Both are ints. Both are 32 bits.
   00000000 00000000 00000000 00001000  // 8
   00000000 00000000 00000000 00000100  // 4
   00000000 00000000 00000000 00000000
1000
100That's the same as if, in 2nd grade arithmetic, when you're adding 1000 + 100, you do
   1000
   100
+_____
   2000Edited by: jverd on Apr 20, 2011 8:35 AM

Similar Messages

  • Bitwise AND in sql?

    Hi gurus and gurettes,
    In different programming languages I've used bitwise AND operations to determine if a certain bit in a number is set. e.g.
    i := (129 and 130);
    print i;
    (answer would be 128 since only bit 128 is present in both numbers)
    10000001 (129)
    10000010 (130)
    -------- AND
    10000000 (128)
    My question: how do i do this in sql? It seems sql only knows AND for logical evaluations (true/false).
    Thanx,
    Lennert

    on Oracle 9 this works:
    SQL> select bitand(129,130) from dual;
    BITAND(129,130)
    128
    however, on oracle 815 it gives me this:
    SQL> select bitand(129,130) from dual;
    ERROR:
    ORA-00932: inconsistent datatypes
    I looked in the Oracle 8i documentation and I couldn't find 'bitand'. was this introduced in O9? is there an equivalent on O8i?
    Cheers,
    Lennert

  • How can i do bitwise (binary) operations (AND, OR, XOR)

    I need to do bitwise (binary) operations such as AND, OR, and XOR.  For example, how do I AND 10101000 with 11111000?

    for OR, with 10101000 in A1 and 11111000 in A2, try:
      =1×SUBSTITUTE(A1+A2,2,1)
    Result:  11111000
    and for XOR, try:
       =1×SUBSTITUTE(A1+A2,2,0)
    Result: 1010000  (missing leading 0)
    You can display missing leading zeros by setting the cell's Data Format to 'Numeral System' with Base set to 10 and Places to 8, or turn the result into a string with something like this (assuming the result is in A3):
         =RIGHT("0000000"&A3,8)
    SG

  • What is a Legal Entity and Operating Unit??

    Hi,
    Could someone let me know what exactly is a Legal Entity and Operating Unit. The definition or explanation in the documentation is not satisfactory or clear. What are the differences between the above.
    And where in the per_all_assignments_f table is the Legal entity stored. I know that the Legal entity is stored in the Statutory information in the assignments screen. Also can someone let me how based on the company code in the organization the legal entity is linked. Where in the tables is this link maintained?
    Could someone let me know the above.
    Thanks
    Shekar.

    Dear Shekar
    what exactly is a Legal Entity and Operating Unit?
    ANS: According the Book or user guide definitions says:
    GRE/Legal Entity: Use this classification to represent the following organizations:
    Ultimate Legal Entity: this represents the enterprise, and typically, the enterprise is the highest (global) level of a business organization.
    Legal Entity: this represents the designated legal employer for all employment-related activities. The legal authorities in a country recognize this organization as a separate employer. In an organization hierarchy, a legal entity may report to an operating company or to the ultimate legal entity.
    Consolidated Legal Entity: this organization acts on behalf of multiple operating companies that are not legally registered, or simply on behalf of the enterprise in a country.
    See Shekar the Legal Entity is taken under Classification is we know that the organization is going to show the Taxation to the Government. where as if u take typical UAE countruies here every store is an LLC and they submit the taxing for every store or shop.
    Where as Operating Unit is generally used for the different lines of business which are under that Business GRoup
    Say for an Example:
    ABC is the Company name and that has its root in UAE, Qatar and Oman
    then it is like ABC Business Group > UAE Legal Entity > REtail/Property/Furniture etc are the Operating Units.
    Hope this information is helpful and clear to you or else let me know if you have any concerns.
    Coming to the Company Code we use the code for the Inventory Organizations so that the clients will not get confused with the existing code and the system code so generally we use the same codes for it.

  • I am currently using Lightroom 5.6 and operating on a Mac with OSX Ver 10.9.5. I am receiving an error problem when doing the following -  I am exporting selected photos from a particular Catalogue saved on Drive 1 to a folder created on another Drive whe

    Hi, I am having a little trouble with exporting images to another drive and Catalogue and need some help if anyone can give me some advice
    I am currently using Lightroom 5.6 and operating on a Mac with OSX Ver 10.9.5.
    I am receiving an error problem when doing the following -
    I am exporting selected photos from a particular Catalogue saved on Drive 1 to a folder created on another Drive where a Lightroom Catalogue has been created. In this Catalogue I have arranged for the images once exported to be moved to a different folder - I used the Auto Import process under the File dialogue box.
    When processing the Export I receive an error message for each of the images being exported indicating the following -
    Heading Import Results
    Some import operations were not performed
    Could not move a file to requested location. (1)
    then a description of the image with file name
    Box Save As                                  Box  OK
    If I click the OK button to each image I can then go to the other Catalogue and all images are then transferred to the file as required.
    To click the OK button each time is time consuming, possibly I have missed an action or maybe you can advise an alternative method to save the time in actioning this process.
    Thanks if you can can help out.

    Thank You, but this is a gong show. Why is something that is so important to us all so very, very difficult to do?

  • Error  while configuring SSO between Portal 7.0 and Operating System.

    Dear all,
    I am having an issue,i need to configure SSO between the Portal 7.0 and operating System.I have followed both the Kerberos as well as spNego wizard methods,but i am not able to configure UME settings as we are using datasourceConfiguration_abap.xml. I tried to edit the datasource confuiguration file but after editing the server is not starting.
    Please let me know the steps i have to do to edit the datasourceConfiguration_abap.xml
    We are not able to Map the Service USer to the UME CONFIGURATION XML File.
    Thanks
    Ravi.S

    Ravi,
    If you have successfully configured the SSO, please pass on the document if any you have.
    Regards,
    Mohammad.

  • JSP works in IE 7 and Opera 9.1 but not Firefox 2.0

    Hi everyone,
    I have a JSP with a form and a list box. When the user selects a value in the list box the form is submitted:
    <form id="ampForm" method="POST" action="AMPSearch">
        <fieldset>
            <p>
                <label for="amp">
                    Actual Medicinal Product Search Result:
                </label>
                //Here is where I think the problem lies the "onchange" method does not appear to be recognised by Firefox.
                <select size="10" name="amp" onchange="ampForm.submit()" class="listbox">
                    <c:out escapeXml="false" value="${requestScope.ampList}" />
                </select>
                <input type="hidden" name="ampList" value="<c:out escapeXml="true" value="${requestScope.ampList}" />" />
                   </p>
            <p>
                <label for="ampp">
                    Actual Medicianl Product Pack Sizes:
                </label>
                <select size="10" name="ampp" class="listbox">
                    <c:out escapeXml="false" value="${requestScope.amppList}" />
                </select>
            </p>
            <c:if test="${!empty requestScope.amppList}">
                <p>
                    <label for="quantity">
                        Quantity:
                    </label>
                    <input type="text" name="quantity" value="" />
                    <input type="submit" value="Add Order" name="addOrder" />
                </p>
            </c:if>
        </fieldset>
    </form>This all works fine in IE7 and Opera 9.1 and Netscape 8.1 when it is set to display like IE, but not in Firefox 2.0 or when Netscape is set to display like Firefox.
    Does Firefox not recognise the "onchange" method? What should I use instead? Any help would be much appreciated.
    Tom

    Not to worry people, I have done it again.
    For some reason when I post on here a few minutes later I figure the problem out even though I have been struggling with it for ages.
    The form should have had name="ampForm" not id="ampForm". Stupid thing.

  • So I just bought a used MacBook from Amazon with OSX 10.5.8.  I am trying to install new software and operating system, but I don't have the passwords to the Users set up in the computer.  What do I do?

    So I just bought a used MacBook from Amazon with OSX 10.5.8.  I am trying to install new software and operating system, but I don't have the passwords to the Users set up in the computer.  What do I do?

    Put your install DVD into the optical drive (CD/DVD drive) and reboot. Be sure to either use the disc that came with your Mac, or, if you installed a later Mac OS X version from disc, use the newer disc. As soon as you hear the boot chime, hold down the "c" key on your keyboard (or the Option Key until the Install Disk shows up) until the apple shows up. That will force your MacBook to boot from the install DVD in the optical drive.
    When it does start up, you'll see a panel asking you to choose your language. Choose your language and press the Return key on your keyboard once. It will then present you with an Installation window. Completely ignore this window and click on Utilities in the top menu and scroll down to Reset Password. After resetting the password use Startup Disk from the same menu to choose your hard drive for startup and restart.

  • How do I transfer all my Firefox saved passwords to my new hard drive and operating system? Going from xp to windows 7.

    How do I transfer all my Firefox saved passwords to my new hard drive and operating system? Going from xp to windows 7. I have the old hard drive hooked up as drive f. Can I copy and paste from old drive directory to new drive directory?

    You need to copy 2 files, key3.db and signons.sqlite, from the old [[profiles|profile folder]] to the profile folder on the new computer.

  • Help required with Photoshop Elements 4.0 this has been installed on my new Toshiba laptop with windows 8.1 for some 18 months and operating well. Now it will not open, message pops up saying "attempt to access invalid address" then "application not respo

    Help required with Photoshop Elements 4.0 this has been installed on my new Toshiba laptop with windows 8.1 for some 18 months and operating well. Now it will not open, message pops up saying “attempt to access invalid address” then “application not responding” Suggestions how to access would be much appreciated. Tks. Stuart

    What is the size of your hard disk?  PSE 4 is a very old program and I suspect it is not able to access the entire hard disk on your machine.  Just a thought here.

  • Legal Entity and Operating Unit Setup

    Hi,
    we are in a process of implementing Oracle Financials R12.1.3 to a group of company (Ex:"A").
    That parent company ("A") associates with another three subsidiaries (Ex: A1, A2 and A3). All these four companies can share the same ledger and operating in one country.
    So I'm with bit confusion whether It can use One Legal Entity with four operating units or do we have to create four legal entities?
    Awaiting for clarifications and Thanks / Lathika

    Hi All,
    You have to think beyond application functionality, if there these 3 subsidiaries are registered with different name under local governance law then you should create separate Legal entity for each company or subsidiary.
    Regards,
    Abdul Hafeez

  • Same Org as Business Group and Operating Unit cannot be migrated via isetup

    Hi,
    I have tried to migrate the setup of an organization which is classified as both Business group and Operating unit.
    When it comes to Operating unit API, it errors out with the following Warning message.
    I request the iSetup Team to clarify whether there is any restriction in iSetup that the same org as BG and OU cannot be transferred.
    If yes, then how to migrate the same...
    The above situation happens for the org classified as OU and IO. In this case the INV org API give the warning message.
    Regards,
    Senthil
    Name: HR_OperatingUnit
    Type: BC4J
    Path: oracle.apps.per.isetup.schema.server.OperatingUnitAM
    Time Taken(seconds): 1.0
    Importing rows from xml file, and validating rows ......
    Message not found. Application: AZ, Message Name: AZW_FWK_USER_ROW_EXCEPTION. Tokens: VONAME = Operating Unit; KEY = Name = 'POC Business Group'
    Group Name = 'POC Business Group'
    ; EXCEPTION = The organization 'POC Business Group' is a business group, please use the business group API to handle it
    Transaction rolled back
    Processed API:HR_OperatingUnit
    Generating Deployment Report...
    Generation of Deployment Report process completed.
    Status: WARNING
    ******************************************

    It is a known issue and has been fixed as a part of HRMS 12.0.7. You may apply HRMS 12.0.7 or request for back-port on top specific version.

  • Not able to see material and operation overview as tab in production order

    Hello Friends,
    While creating the production order by T.C CO01, after giving the material code , production plant and order type, system took me inside it.There i am not able to see component overview, operation overview as tab.Whereas in menu option Goto - overview - component , i can see there.But i want this things as tab in screen where we give qty and dates.
    So guys do you know where to do configuration for it.
    Thanking you guys in ad

    Dear Jitendra,
    In Production Order you will find Component and Operation screen under two different icons (not tab) production Header screen.
    - For Component Overview it is something like Balance or on pressing F6 you will branch to Component overview Screen.You will find it just after Hat icon
    - And for Operation over view it looks like ladder or on pressing F5 you will branch directly to operation screen.you will find this icon just after Component overview Icon.

  • Get URL from Chrome and Opera.

    Hello,
    I need to extract the URL and title of currently active tab in Google Chrome and Opera browsers. I manage to do this with Internet Explorer and Mozilla Firefox but having troubles with those two.
    Can someone help me with this issue?
    Would be grateful for a code sample.
    Thanks in advance.

    As far as I know Opera uses QT for the UI (or at least used to use QT in older versions and now uses an different UI frameswork). I assume Chrome also used QT or a similar UI framework. QT is completely different from the normal Windows Controls. You will
    not find anything in a Opera or Chrome Window using SpyXX.
    Therefore there are only a less ways getting the URL. A suitable way could be taking a screenshot and finding the URL bar and doing an OCR on this URL bar.
    Best regards
    Bordon
    Note: Posted code pieces may not have a good programming style and may not perfect. It is also possible that they do not work in all situations. Code pieces are only indended to explain something particualar.

  • Applet, Netscape and Opera but not IE, encore

    I've got the following trivial applet that runs under Netscape and Opera, but not under IE. It's also at www.MartinRinehart.com as the ColorChooser choice. There's a half dozen Dukes from previous posts, and my sincere gratitude for anyone who can tell me what I need to do so IE doesn't say "Load: class CCApplet not found."
    import java.awt.BorderLayout;
    import java.awt.Button;
    import java.awt.Label;
    public class CCApplet extends java.applet.Applet {
         public void start() {
              Label l = new Label( "CCApplet!" );
              setLayout( new BorderLayout() );
              add( l, BorderLayout.NORTH );
              add( new Button("South"), BorderLayout.SOUTH );
    } // end of class CCAppletThe .class is in the same directory as the .html. Putting it in a .jar doesn't seem to matter. My IE runs other applets from the web, but not the ones I write. Thanks in advance.

    The applet runs for me in IE with 1.5.0_02, XP Pro (current updates), with class and html files in same directory.
    Check that everything in IE's Java Plug-in is valid and correct. Check IE's Internet Options.
    What JVM version are you wanting the applet to be able to run with? What does this statement mean? "...most visitors can use without knowing what a JRE is."
    To get greatest compatibility, use code that conforms to the 1.1 API, compile to that target version, possibly use the old 1.1 libraries, and then test each jvm. (BTW - Swing has limited compatibility - it isn't MS compatible, and wasn't [Sun] standard until jvm version 1.2.)

Maybe you are looking for

  • My web browser is not working

    Dear sir, I'm using blackberry 9320.. Now the problem is facebook is not work properly in my web browser.. This problem is only for facebook site.. Other sites is work well.. When I open facebook my web browser is showing error like this ..( Destinat

  • Photo Booth and a few Browsers wont open

    A few days ago i changed my home screen,I moved everything from the Old Home to the new, Then Logged out of the Old and Into the New and deleted the Old.  Then I had to repair permissions and then go to Get Info and Unlock permissions on almost every

  • Update payment info in account

    How do I add a new credit card to my account/ID/Whatever . I know it's got to be somewhere in my "manage accounts". Sorry I'm PC only by protest and am half ******** here with this simplest things. Audrey.krostich

  • How can a question marked as "solved" be restored to unsolved status?

    How do you remove the "This solved my question" status icon if the answer turns out to be wrong? Variations of this question can be found in a few discussion threads in the Apple Support Community. I found one very similar question marked as "This so

  • Convert SmartForm to Word File or EXCEL,POSSIBLE?

    Hi, I have a requirement to convert a SmartForm to Word File or EXCEL because they need to do some changes in the form.I know how to convert it to PDF but I don't know how to convert it to WORD or EXCEL.I've searched the forum and know i have to use