Bit wise operators

Does Forte have bit wise operators? If not, does anyone know how to
implement bit wise operator
functionality.
For example.
A, B : integer;
A = 10;
B = 8;
MyCheck = A Xor B; //should return 2 (bit-wise comparison)
// or in C-language
Mycheck = (A ^ B);
Thanks,
/Roland
Onewave Inc.
Email: [email protected]
Thanks,
/Roland

http://help.sap.com/hana/SAP_HANA_SQL_and_System_Views_Reference_en.pdf
Page 116
Cheers,
Rich Heilman

Similar Messages

  • Making bit wise operations

    What is the function to perform bitwise operations in SQL. I want to set/mask a particular bit (ie set 16 or 18th bit)

    bitand

  • Tiger and Leopard compared bit-wise.

    Hi guys, I'm not very familiar with the 64-bit-friendly part of the OSs, and if you don't mind me, I'll ask...
    1. Wasn't 64-bit already introduced with Tiger?
    2. What sort of improvement will this bring to Leopard in this sense?
    3. Will non-pro users benefit from this?
    4. Are the MBP going to benefit from this as well (as opposed to a Mac Pro)?
    I was trying to read a bit more online before posting this, but there's no traces of Tiger in Apple's website.
    Thanks in advance.

    For most users, I don't think 64-bit versus 32-bit makes any difference. I don't know the difference between Leopard and Tiger, in this regard. 64-bit does make the memory ceiling MUCH higher (over 4GB I think), so pros who need a lot of RAM will benefit. All new Macs going forward will be 64-bit (ever since the Mac mini went to Core 2 Duo). The remaining 32-bit Macs that will work with Leopard (officially), are: G4 Macs above the speed limit, Core Solo Macs (only the 1.5 GHz Mac mini), Core Duo Macs. 64-bit Macs include the PowerPC G5 Macs. It will be interesting to see if the next NEXT major Mac OS X release "cutoff" will be for 64-bit Macs only.

  • Bit wise operator and octal help

    Author: JAVANewbs Jul 29, 2004 10:23 AM
    I tried to do this problem,
    System.out.println(010|4);
    and I thought it's six but it's actually 12.
    Why is it outcome is 12?
    I read the answer, it is because 010 is octal but how to tells if it is octal or hex or binary?

    Sorry for the confusion: Let walk from the beginning...
    I tried to do this problem,
    System.out.println(010|4);
    and I thought it's six but it's actually 12.
    Why is it outcome is 12?
    I read the answer, it is because 010 is octal but how to tells if it is octal or hex or binary?
    Hex is represented by ox
    Oct is represented by 0
    and what about binary?

  • I'm back, maybe bit wiser, but still square One.

    Ok, here is what I want to happen.
    I have 8 buttons, tweened at 3 frame intervals over frames 1 through 25
    I am dabbling with this code:
    stop();
    Link1a_1.addEventListener(MouseEvent.CLICK, buttonClickHandler);
    Link2a_1.addEventListener(MouseEvent.CLICK, buttonClickHandler);
    function buttonClickHandler(event:MouseEvent):void
        if( event.target == Link1a_1 )
            gotoAndPlay(1); //Here I want it to only play 1 to 4 then stop, then resume from frame 4 if user clicks any link.
        else
        if( event.target == Link2a_1 )
            gotoAndPlay(1); //Here I want it to only play 1 to 7 then stop, then resume from frame 8 if user clicks any link
    //and so on and so forth.
    There will be a total of 8 items each stopping at different points in the timeline. It's just a design thing and I really want it to work. Just can't get my head around it right now.
    Thanks for any help forthcoming.

    stop();
    var currentClicked:*;
    Link1a_1.addEventListener(MouseEvent.CLICK, buttonClickHandler);
    Link2a_1.addEventListener(MouseEvent.CLICK, buttonClickHandler);
    function buttonClickHandler(event:MouseEvent):void
        if( event.target == Link1a_1 )
            gotoAndPlay(1);
            currentClicked = Link1a_1;
            addEventListener(Event.ENTER_FRAME, checkFrame);
        else
        if( event.target == Link2a_1 )
            gotoAndPlay(1);
            currentClicked = Link2a_1;
            addEventListener(Event.ENTER_FRAME, checkFrame);
    funciton checkFrame(e:Event):void{
         switch(currentClicked){
              case Link1a_1:
              if(currentFrame == 4){
                   stop();
                   removeEventListener(Event.ENTER_FRAME, checkFrame);
              break;
              case Link2a_1:
              if(currentFrame == 7){
                   stop();
                   removeEventListener(Event.ENTER_FRAME, checkFrame);
              break;

  • Doubt on Programing

    Q:How to write a program for addition of two decimal numbers without using arthmatic operators?
    (HINT: using Bit-wise operators)

    Nice thought provoking "home work" - Did you get any ideas ?

  • Handling bits of data

    Hello Everyone,
    I want to bit wise manipulation of data.
    I have 6 bit of data ranging from 0 to 63 and 2 bits of data ranging from 0 to 4.
    I want to add so as to get one byte of data.
    Meaning 00000111, should give an output of 7  (first 6 bits from first data and 11 from second data)
    I have two arrays of these values.
    Please help or provide any information if avaliable for manipulating bit wise opeartion..
    Thanks a lot in advance.
    Avni

    Hi Avni,
    Please see the attached vi for handling the data bitwise.
    Hope this will be helpful to u n is as per your need.
    Regards,
    Alifiya
    Attachments:
    BitwiseDataHandling.vi ‏11 KB

  • Bit operations, base64

    I have 4 bytes with 6 significant bits (base64) which should be concatenated into 3 bytes, moved to the left.
    Im just wondering if this is right, or maybe if theres some better solution:
    oldbyte1 << 2;
    tempbyte2 = oldbyte2;
    tempbyte2 >> 4;
    newbyte1 = oldbyte1 | tempbyte2;
    oldbyte2 << 4;
    tempbyte3 = oldbyte3;
    tempbyte3 >> 2;
    newbyte2 = oldbyte2 | tempbyte3;
    oldbyte3 << 6;
    newbyte3 = oldbyte3 | oldbyte4;Stig.

    Studenik:
    This is part of a decoding algorithm for Base-64 encoded content (RFC 1421). This encoding technique allows a binary file or message to be transmitted through applications or protocols that traditionally only work with human-readable data, such as News or Mail.
    Each group of 3 8-bit byte values, 24 bits, are split into a group of 4 6-bit values. Each of these values (0-63) is then mapped to a printable ASCII character [A-Z,a-z,0-9,+,/]. The process is reversed to recover the original binary values.
    Slackman:
    Except for a few syntax errors, it looks "right". You need to turn those bit shift operators into bit-shift assignments, and the results of your bitwise OR needs to be cast back to byte (the OR implicitly promotes both values to ints): tempbyte3 >>= 2;
    newbyte2 = (byte)(oldbyte2 | tempbyte3);
    oldbyte3 <<= 6; I typically have used an algorithm that first recombines the 6-bit values back into a 24-bit int and then splits them back into 8-bit values. I found that it works well when I'm passing the byte values into a method by array and want to avoid modifying the values:     /**
         * decodes a group of 4 base-64 digital values, stored as
         * individual bytes, into 3 base-256 digital values.
         * @param src       input bytes
         * @param srcOffset index of the first byte to decode in src
         * @param dst       output bytes
         * @param dstOffset where in dst to start writing bytes to
         * @return the 3 output bytes rendered as a single int
        static public int decodeBase64(byte[] src, int srcOffset, byte[] dst, int dstOffset) {
            int retval ;
            int register = src[srcOffset] ;
            int i ;
            for (i=1; i<4; i++) {
                register = (register << 6) | src[srcOffset + i] ;
            retval = register ;
            for (i=2; i >= 0; i--) {
                dst[dstOffset + i] = (byte)register ;
                register >>>= 8 ;
            return retval ;
        }I've found that your algorithm works well with individual bytes.

  • Comparing Bit Sequences - O - Bits are One

    Hi Gurus,
    I need an info on Comparing Bit Sequences, for example O operator - Bits are One.
    An ABAP code piece from Include LBZFCF01; Form BMASKE_TO_FTAB looks like this:
      IF <b> O hex01. ftab-inp = on. ENDIF.
      IF <b> O hex02. ftab-req = on. ENDIF.
      IF <b> O hex04. ftab-out = on. ENDIF.
      IF <b> O hex08. ftab-act = on. ENDIF.
      IF <b> O hex16. ftab-int = on. ENDIF.
      IF <b> O hex32. ftab-inv = on. ENDIF.
    Now I would like to know; whether this is bit wise equivalent XOR operation.
    II need to do the similar comparison in SAP BO Data services.
    Please help.
    Best Regards, Murugesh

    *

  • Converting a hex String to its corresponding hex value...?

    Yeah, I'm having quite a bit of fun guessing this one... :p
    I have a string of n characters and have used Integer.toHexString( ( int )str.charAt( i ) ) to convert each character to a string representing its hex value. Now I need to USE that value for bit-wise operations, like, say, applying the AND, OR, etc. operators...
    Example:
    hexvalue &= 0xC000FFFF; //the second value is the one extracted from the string;
    How can achieve this...? Any help is greatly appreciated... :}

    Since a Java char is numerically a Java short, you can apply bitwise operators to chars directly - the conversion to hex simply changes the way that the char is viewed; the result can also be viewed as a number in other bases.
    For instance, the char 'A' can be also be represented as any of the following values:
    binary - 1000001
    octal - 101
    decimal - 65
    hex - 41
    Likewise, 'Z' can also be viewed as
    binary - 1011010
    octal - 132
    decimal - 90
    hex - 5A
    "Anding" the letter 'A' with 'Z' ('A' & 'Z') or doing the same using any of the other representations will result in (binary 1000000, octal 100, decimal 64, or hex 40) - the bit pattern is the same, only the representation of the result varies.

  • The Mystery of ^, & and |

    I am very keen to understand as to when we should be using ^ (exclusive-OR), & (AND) and | (OR) operator in Java. I know that someone will think that whenever you want to do some bit wise operation you use that. That's OK but I was looking at the java.lang.HashMap code and I found that for generating the hashcode we have the following piece of code
    static int hash(int h) {
            // This function ensures that hashCodes that differ only by
            // constant multiples at each bit position have a bounded
            // number of collisions (approximately 8 at default load factor).
            h ^= (h >>> 20) ^ (h >>> 12);
            return h ^ (h >>> 7) ^ (h >>> 4);
        }You see. Now I am not able to understand why someone (the authors of the class: Doug Lea, Josh Bloch, Arthur van Hoff and Neal Gafter) used the above exclusive-OR operator to generate the hash. Can someone please give me the practical application of the bit wise operator? Let me tell you that I have always work on the commercial software like Java to build web application most of the time and hence I do not know much about the application of those operators.
    I would really appreciate if someone can clear my concepts on this.
    Thanks
    Raj

    raj_patni wrote:
    Guys, thank you all for taking your time to answer to my question...I really appreciate it. But I think I have not made myself clear enough.
    1. I want to know is there any application of the ^, & and | operators in the high level programming language like Java.I would think the answer is obviously yes, given that you yourself have produced such an application.
    which operator to use and when?You use them when you want to perform the operations they provide. Sometimes it's simple bit masking, other times it's more complicated stuff like this.
    2. I gave the example of HashMap because I thought it would be helpful in understanding the application of the above mentioned operator. I know >>> shifts the bit to the right and << shifts the bit to the left. I am more interested in knowing as to why did the author used '^' and not '|' or '&' operator.Math, not Java.

  • ITunes Truncate Track Ending, Unsolved in 2+ Years: My Letter to Steve Jobs

    I have posted this problem twice in this forum. Twice they were answered with something totally irrelevant, and then marked "Solved" and deleted.
    Finally, I am going to mail the CD, and this letter to Steve Jobs, to let him know personally the bug, after so many years of iTunes, and the bullish way his stuff has been treating my questions.
    Dear Steve,
    My name is Leping, Ph.D. in Physics, working in the San Francisco Bay area as a senior medical imaging scientist. I am a long time and loyal Mac user and promoter -- actually I have not yet really needed to use a PC in my life (except for serious music ripping -- see below), and in the graduate school days our five+ million dollar NMR lab was run from a Mac.
    Unfortunately, I am also an avid classical music enthusiasts, and part time musician. Needless to say I am now with my 6th iPod, and I believe I understand all the bells and whistles of iTunes. I am not talking about the higher-level bit-wise accurate CD ripping, that is only available on the PCs, through the EAC software, since also, as a well-regarded and published photographer, I know when is the time to use the pro level applications, such as Adobe Photoshop instead of iPhoto. For my photography works please check out my website at http://www.lepingzha.com -- I will be more than glad if you and/or Apple have use of any of my images.
    However, I know a long time iTunes bug, that have never been addressed. Actually I posted it twice to the Apple web discussion forums, but was twice offered irrelevant answers, followed by the subject flagged as "Solved", and subsequently deleted.
    Please open the still sealed compact disc in this letter, which I got in a retailer just to show you the problem. The title, Deustsche Grammaphon (DG) B0003902, is "Lang Lang plays Rachmaninov Concerto for Piano and Orchestra No. 2 and Rhapsody on a Theme of Paganini". It happens I am a Chinese American, but I want you to listen a bit into the disc not because I am a fan of Mr. Lang's playing -- as a matter of fact I actually not, but for the much more serious reason.
    Please rip the Rhapsody in iTunes, to any format (AAC, Apple Lossless (ALAC), WAV, MP3...) starting from track number 4. A few tracks after that point would be adequate -- these are very short (10-30 seconds) tracks that truly highlight the problem. Listen to the resulting music, and the original CD, you will immediately hear the big problem, start right at the end of track 4 and at the end of every of these short tracks -- fraction of the ending second(s) are harshly chopped off, brutally truncated, and uncover-ably lost.
    The same thing happens anywhere I use the Apple codecs, for example, converting the EAC (bit-wise correctly, as confirmed by its check-sum feature against the known sum database) ripped WAV files to ALAC or AAC, for instance, either on a Mac or a PC. The very same thing just happen, while there is no problem to any other non-Apple codecs (mainly to flavours of MP3 -- since Apple has the AAC and ALCA codec nobody bothered to write their own, I guess). So for our serious classical listeners, the iTunes and the Apple codecs are very problematic if not useless in many cases (operas immediately in my mind)!
    Please alse not that, over the time the same problem has always been reported here, there, and basically everywhere, but every time there are gurus made comments which does not solve the issue. The followings are some recent examples.
    http://discussions.apple.com/thread.jspa?messageID=6246698&#6246698
    http://discussions.apple.com/thread.jspa?messageID=6513266&#6513266
    I hope you, my much respected and praised Steve, realize, that, how could, and mostly unthinkable, after so many great years, there can be still such very basic and serious issue the iTunes codecs can not handle in the right way? Does the track length information get truncated somewhere (or floored to an integer)? Why it is so difficult to acknowledge such a basic issue, and to have it fixed in the next release?
    Thanks for your time and hope you enjoy the music.
    Look forward to hearing from you soon.
    Best regards,
    Leping Zha, Ph.D.
    San Mateo, California, U.S.A.

    Finally found the reason: in the track's option field for some reason the "stop time" flag is checked and the timing is always about a second earlier than the actual track length.
    Searched Doug's scripts and there is nothing to batch reset, or unflag the "stop time" tag. Anyone has a better idea rather than trying to deselect the tag track by track?
    Once the "stop time" is unset the converted tracks will play through without truncations at the end.

  • Please help me to get a clue from this program

    I'm sorry to bother you with such stupid questions. I have to admit I'm just making my first steps in programming.
    So I have a program like this and don't understand how it works:
    // Masking sign extension.
    class HexByte {
    static public void main(String args[]) {
    char hex[] = {
    '0', '1', '2', '3', '4', '5', '6', '7',
    '8', '9', 'a', 'b', 'c', 'd', 'e', 'f'
    byte b = (byte) 0xf1;
    System.out.println("b = 0x" + hex[(b >> 4) & 0x0f] + hex[b & 0x0f]);
    Specifically, how could 0xf1 be represented in binary? As far as I know 11110001 contains negative value. Moreover 0xf1 in 10's base is 241, so how can I convert it to byte? Doin so, I'm gonna lose its value (since the byte range is from -128 to 127). And why do I need it? I even have no idea how the variable would look like in binary after converting to byte, not mentioning last part of this program.
    I would really appreaciate your help.
    Thank you for your time.

    AntShay wrote:
    Thank you so much for your help guys. Now I got just 2 more questions. First of all. I guess sign-extension works only with negative values. Is that correct? When sign-extension takes place and I shift any value to the right by any number of positions, does it fill in all the previous bits with *1s*? If you can, please, tell me how exactly this works.Java primitives are all signed, so sign extension is always at work for right bit shifts. However, if you were to look into the code, it has masked away the 4 most significant bits using bit-wise and operation. Alternatively, you may use the unsigned shift (+>>>+) operator.
    And by the way, is there any method to convert the value of byte to a binary string? I only figured that it might work this way: Integer.toBinaryString(b&0xff), but is there Byte.toBinaryString method or something?It is always okay to up cast, as sign extension will convert correctly. If you don't like the long integer output, you may do a substring() on the output. It is also not hard to roll your own.

  • Partition Map Schemes: HFS+ and FAT32 partitions with OSX and Windows

    OK so I know this question has been practically beaten to death, but I keep finding conflicting information. I am using a 2011 MacBook Pro, on which I will set up Windows through Boot Camp. I recently purchased a 750 GB WD external hard drive to use with time machine for a backup on my Mac. However, I also need to be able to use part of this for Windows files. SO.. I intend to use the HFS+ partition for the the Mac (500GB) and create a FAT 32 partition (250GB) to use for backing up windows files (using it for solely computer modeling and need to be able to transfer/share files with Mac users who use Parallels as well as copying to PC desktops). My question is what to use as the partition map scheme. I have heard that when using these two partition types, a Master Boot Record is needed (so Windows can recognize the FAT32 partition) and also that a GUID partition map is required for use with time machine, meaning windows would no longer be able to read the FAT32 partition. Is there a way to reconcile this? Either using Time Machine with HFS+ partition that is set to MBR or uisng FAT32 on Windows with a GUID partition map? Also if I were to use Parallels (with a GUID setup) instead of Boot Camp, could that be the way to save the windows files to the FAT32 Partition and avoid problems with Time Machine not working with MBR? Thanks for any expertise, as I have heard that both setups that I have mentioned both will work and both will not work. Any experience with a similar situation?

    Wow. Thanks for the extremely quick responses. Just for a few points of clarification.. I'm a complete newb at backing up strategies.
    Steve, you would recommend to not backup files from my Mac OSX and files from Windows (also on my Mac) on the same drive, correct?
    I appreciate the strategy of using it only as a backup, that makes quite a bit of sense. However, if I want to only backup my OSX files, and also store (solely as backup copies) say, a number of computer models (Rhino, Revit, etc.) that were created in Windows programs (not needing to store the entire Windows disk), would it not make sense to store these on the same drive in a different partition, creating the need for two different partition formats? And if I were to do this, maybe I should use NTFS instead of FAT32 (and reformat to GUID since that seems to be a standard for Apple and Windows 7 recognizes it..?) to keep them completely separate since the computer model files cannot be opened unless running the Windows programs.
    How do you use your drive with HFS+ and NTFS if not for backups? I will not need to access the HFS+ backup files in Windows, nor need to access files from an NTFS partition in OSX, so that seems to simplify things in that, at least at the moment, I will not need any Paragon software.
    Currently my drive is partitioned as HFS+ and FAT32 as MBR, with the HFS+ partition set up with Time Machine. It appears to be successful, I see my files in Mac HD -> "users" and all my docs, desktop items, etc. are listed. Seems that there is in fact no limit on TM's use of MBR maps, or else it is way above 160GB.
    Third, are you using CarbonCopyClone in place of Time Machine or in addition to it? If in addition would it create the bit-wise clone on the same HFS+ partition as TM is backing up to? Or a separate drive? I'd like to only have one external that I am backing up to for simplicity's sake. I've never used TM before, so this is all new to me. Also, I suppose I have been missing the distinction between storing copies of files, and making a complete backup of a disk image... just now realizing the difference. Thanks so much.

  • Defining a variable help

    What's it mean when variables are defined with boolean operators? I've seen it before but can't find any help on it in the Java Tutorial so I don't really know what it means.
    e.g.
    int var1 = (var2 & var3) | var4

    Bitwise and Bit Shift Operators
    [http://java.sun.com/docs/books/tutorial/java/nutsandbolts/op3.html|http://java.sun.com/docs/books/tutorial/java/nutsandbolts/op3.html]

Maybe you are looking for