Re: bitmask ? Programming Software Development by mike_2000_17 A bitmask is a special number that has a bunch of bits (… of interest for a particular task. One example where a bitmask is used is for subnet masks on IPv4 addresses. An…`), it means that those flags are probably read using a bitmask in a similar way as I showed with the switch… bitmask ? Programming Software Development by nicholas.f.fortino im a newbie in c++ i want to ask whats bitmask ? Probably preg_match return bitmask multi term search Programming Web Development by R0bb0b … subject with an array of search terms which returns a bitmask, one bit for each index of the array. 1 = found…,green,sky,my,house,is" I will get a bitmask back of "10100101". my solution: public function stringSearchReturnBitMask… type function but how would I have it return a bitmask and would it actually be more efficient? Re: Probably preg_match return bitmask multi term search Programming Web Development by diafol I think a regex in preg_match would be best option. preg_* are slow, but quicker than nested loops I think. BUT getting bitmask output - hmm - have to think about that. Re: Find all subsets of a given set - Optimization? Programming Software Development by mrboolf … class Subset { private: int Dimension; T *Set; bool *Bitmask; public: Subset(T *set, int dim); ~Subset(void); …i<0) { break; } } if(i>=0) { Bitmask[i] = !Bitmask[i]; } for(int j = i+1; j < Dimension…; j++) { Bitmask[j] = !Bitmask[j]; } return; } template <class T> void Subset… Find all subsets of a given set - Optimization? Programming Software Development by mrboolf … Subset { private: int Dimension; T *Set; bool *Bitmask; public: Subset(T *set, int dim); ~Subset(void…gt;=0) { i--; } if(i>=0) { Bitmask[i] = !Bitmask[i]; } for(int j = i+1; j <…; Dimension; j++) { Bitmask[j] = !Bitmask[j]; } return; } #endif // H_SUBSET[/CODE] [CODE=C++]//… Re: Find all subsets of a given set - Optimization? Programming Software Development by ArkM 1. Try to profile subset generator without any printing. There are ~1 million subsets (2^20) for N==20. To print 1 million lines... The program PRINTS all the time. 2. NextSubset code is obviously wrong: [icode]while(!Bitmask[i]&&i>=0)[/icode] refers to Bitmask[-1] at the last loop. Present all class Subset definition. Re: Find all subsets of a given set - Optimization? Programming Software Development by ArkM Keep it simpler, swap subexpressions: [code=c++] while (i >= 0 && !Bitmask[i]) // that's all... [/code] I'll see your code later ;) Good luck! Re: Find all subsets of a given set - Optimization? Programming Software Development by ArkM …; ++bit) { // Now bits in bit are the same as your Bitmask // Use >> and & operators to select elements } // long… Re: Find all subsets of a given set - Optimization? Programming Software Development by mrboolf … idea that came to me was, given that my first bitmask-array method generated the subsets from { Whole Set } to { }, to… How to list the name and the size of hard driver in python Programming Software Development by tony75 … ctypes import windll def get_drives(): drives = [] bitmask = windll.kernel32.GetLogicalDrives() for letter in string.ascii_uppercase:… if bitmask & 1: drives.append(letter) bitmask >>= 1 return drives… Transparent JButton Artifact Help Programming Software Development by murrple_1 …amp;& model.isEnabled()){ if((downImage.getTransparency() == BufferedImage.BITMASK || downImage.getTransparency() == BufferedImage.TRANSLUCENT) && … - beginY, null); }else{ if((upImage.getTransparency() == BufferedImage.BITMASK || upImage.getTransparency() == BufferedImage.TRANSLUCENT) && usePreferredColor){ … Printing Uppercase Characters Programming Software Development by Eleventeen …: 97-122 ;Uppercase: 65-90 LD R3, UPPER ; load uppercase bitmask LEA R1, STRING ; pointer into string LD R2, HIGH LOAD… Load User gen Char set ... Programming Software Development by NotNull … 'a' dec. 97 mov bh, 0x10 ; 16 bytes per font bitmask xor bl, bl ; table zero mov ax, 0x1100 ; Load User… dealing with Images Programming Software Development by gedas …().getDefaultConfiguration(); Image image = gc.createCompatibleImage(sourceImage.getWidth(),sourceImage.getHeight(),Transparency.BITMASK); [/CODE] i would be very great full if you could… Spot the bug/glitch Programming Software Development by cwarn23 … image int transparency = Transparency.OPAQUE; if (hasAlpha == true) {transparency = Transparency.BITMASK;} // Create the buffered image GraphicsDevice gs = ge.getDefaultScreenDevice(); GraphicsConfiguration gc… Re: Spot the bug/glitch Programming Software Development by cwarn23 … image int transparency = Transparency.OPAQUE; if (hasAlpha == true) {transparency = Transparency.BITMASK;} // Create the buffered image GraphicsDevice gs = ge.getDefaultScreenDevice(); GraphicsConfiguration gc… Drupel 6.22 install errors Programming Databases by alb44b … $file * The file to check for. * @param $mask * An optional bitmask created from various FILE_* constants. * @param $type * The type of… Strange comments in executable Programming Software Development by myk45 … should mask the source of the cast with the appropriate bitmask. For example: > char c = (i & 0xFF); > Changing… Re: Lost with bitwise Programming Software Development by jephthah …code you should now understand, shown above. shift teh bitmask 2 bits to the left using the same code, so… (0xEE, dec 238) n=5 00011111 (get 5 bits through bitmask) AND ________ y1= ---01110 (extracted from 'y'. '-' are zeros)…, dec 85) p=6 ^ (bit #6) n=5 10000011 (bitmask inverted and shifted left 'p+1-n' places) AND ________… Re: How to Change Custom Cursor When Form Load Programming Software Development by TnTinMN …Public yHotspot As Int32 ''' <summary>The icon bitmask bitmap. If this structure defines a black and white icon… a color icon, this mask only defines the AND bitmask of the icon.</summary> Public hbmMask As…structure defines a black and white icon. The AND bitmask of hbmMask is applied with the SRCAND flag to … Re: Read registers from PLC and check bits Programming Software Development by nick.crane … output using a bit-mask. [CODE]Console.WriteLine("Using bitmask"); for (int i = 0; i < read….Length; i++) { int bitMask = 0x8000; // start from left most bit Console.Write(string.Format… 0 Console.Write(((read[i] & bitMask) == bitMask) ? "1" : "0"); bitMask >>= 1; // right shift … Re: Lost with bitwise Programming Software Development by jephthah … the portion [icode]~(~0 << n)[/icode] created a bitmask of the form where number of 1's equaled the…-bit) bit mask would be [icode]0000000000011111[/icode] . now this bitmask could be shifted two bits to the left, so that… used to extract the correct bits from 'y' this same bitmask can then be inverted, so that it looked like [icode… Re: How this code works??? Programming Software Development by jephthah … each and every bit in the value against the 0x8000 bitmask. look up "bitwise AND" if you dont understand…) and thus be the one that is checked by the bitmask in LINE 8. this is accomplished by using the "… Re: Decoding machine code using C and sign extending NEED HELP Programming Software Development by jephthah …'s not how you do it. AND it with a bitmask [icode] 0x00FF[/icode] to get the lower 16 bits out…, then OR all ones into bits 16-31 using the bitmask [icode]0xFF00[/icode], otherwise leave it alone since it already… Re: Decoding machine code using C and sign extending NEED HELP Programming Software Development by ArkM >AND it with a bitmask 0x00FF to get the lower 16 bits... It's one-byte mask... Where are 16 bits?.. >If bit 15 == 1, then OR all ones into bits 16-31 using the bitmask 0xFF00... It's one-byte mask too... ? Re: Bitwise Operators Programming Software Development by jephthah [icode]~(~0 << n)[/icode] makes a bitmask of ones equal to the number 'n'. does this by … inverts all the bits. for instance, n=5 makes a bitmask = '...00000011111' [icode]x >> (p+1-n)[/icode] shifts… Re: Bitwise Operators Programming Software Development by MrNoob …=jephthah;890519][icode]~(~0 << n)[/icode] makes a bitmask of ones equal to the number 'n'. does this by… inverts all the bits. for instance, n=5 makes a bitmask = '...00000011111' [icode]x >> (p+1-n)[/icode] shifts… Re: System wide hook to block certain keystrokes Programming Software Development by ktsangop …. So i distinguished those with the help of the lParam bitmask calculation. Eventually, bit 31 of lParam DOES tell you wether… the same and contains probably scancode information. So applying the bitmask : [ICODE]//KEY_DOWN (00000000000)111110000000000000001 //values on parentheses are implied AND… Re: Sign extend 16 bit to 32 bit Programming Computer Science by trololo #define BITMASK 0xffff0000 return (x >> 15 == 0) ? x : (x | BITMASK)