bitmask
if (mask & VALUE) or if ((mask & VALUE) == VALUE)?
You\'re probably familiar with the enum bitmask scheme, like: enum Flags { FLAG1 = 0x1, FLAG2 = 0x2, FLAG3 = 0x4,[详细]
2023-02-03 23:37 分类:问答Monochrome Bitmap SetPixel/GetPixel problems... Win32 C Code
This is some of my bitmask code (monochrome bitmaps). There is no problem with the Bitmask_Create() function. I have tested it with opening, loading and saving windows monochrome bitmaps, and it works[详细]
2023-01-30 00:49 分类:问答Finding data gaps with bit masking
I\'m faced with a problem of finding discontinuities (gaps) of a given length in a sequence of numbers. So, for example, given [1,2,3,7,8,9,10] and a gap of length=3, I\'ll find [4,5,6]. If the gap is[详细]
2023-01-29 00:56 分类:问答concurrent modification of bits in a integer
I want to know if i attempt to set bits inside a char/integer from multiple thr开发者_如何学Pythoneads, will i lose any modification?I will have all zeros initially and the threads will only set it to[详细]
2023-01-24 16:41 分类:问答How to read/write full 32 or 64 bits of an int or bigint bitmasked field in TSQL
Setting the 32nd and 64th bits is tricky. 32-bit Solution: I got it to work for 32-bit fields.The trick is to cast the return value of the POWER function to binary(4) before casting it to int.If you[详细]
2023-01-22 11:19 分类:问答Java Working with bits
Let me start by saying I have never really worked with bits before in programming. I have an object that can be in 3 states and I want to represent those states using a 3 bit array.[详细]
2023-01-22 08:33 分类:问答Finding duplicate records in mysql based on a bitmask
I have a mysql table which stores maintenance logs for sensors. I\'d like to design a query that finds instances where a given sensor was repaired/maintained for the same reason. (Recurring problem fi[详细]
2023-01-10 02:50 分类:问答Using a bitmask in C#
Let\'s say I have the following int susan = 2; //0010 int bob = 4; //0100 int karen = 8; //1000 and I pass 10 (8 + 2) as a parameter to a method and I want to decode this to mean susan and ka开发者[详细]
2023-01-07 18:54 分类:问答Java: How do I create a Method to extract an Integer's split bits from a byte array using a mask
While working on decoding some video streaming standards I have noticed a lot of instances where the bits of an Integer value are provided in anything from 2-6 bytes but separated by reserved bits, as[详细]
2023-01-06 04:18 分类:问答How can I get the bitmask value back out of an enum with the flag attribute in C#?
In our database we have a bitmask that represents what types of actions a user can make. In our C# client when we retrieve this integer value from the database we construct an enum/flag.It looks some[详细]
2023-01-01 22:05 分类:问答