flags Questions

1

Solved

Is there a method typically used to check if a flag is present in an int/other data type? I figured out something like this: if ((host&flagtocheckfor)==flagtocheckfor) Which works fine- howe...
Donald asked 19/10, 2011 at 2:5

3

Solved

Hi I need to remove a flag in Java. I have the following constants: public final static int OPTION_A = 0x0001; public final static int OPTION_B = 0x0002; public final static int OPTION_C = 0x0004;...
Silas asked 29/9, 2011 at 10:5

2

Solved

I've read that if eflags bit 18 (AC - alignment check) can be modified, you know the CPU is a 486 or newer. On the 386, the bit resists modification. I've lifted the following assembly code from t...
Saharan asked 23/9, 2011 at 15:22

4

Solved

Is using an integer flag and bitwise operations an effective way of reducing the memory footprint of high volume Objects? Memory Footprint It is my understanding that commonly a boolean is store...
Filings asked 14/9, 2011 at 11:29

1

Solved

While looking for ways to add an ordered to-many relationship to my Core Data model, with the least possible amount of changes to the model, I noticed an option of the to-many relationship that say...
Wonderstricken asked 8/9, 2011 at 9:44

5

Solved

Does any have a more elegant way of doing this? [Flags] public enum SomeFlaggedEnum { Value1 = 1, Value2 = 2, Value3 = 4 } private SomeFlaggedEnum _myFlags; public bool EnabledValue1 { set...
Porpoise asked 5/8, 2011 at 15:12

3

Solved

For testing purposes only, I am allowing my app APK to be downloaded and installed via a URL. Once downloaded on the phone, it can be launched with the Android app installer which gives the user an...
Coenocyte asked 15/6, 2011 at 10:42

2

Solved

In my project, I create a form with the opacity controlled by the user. If the form was fully transparent the mouse events 'fell through' (without my intervention), otherwise my form handled them. ...
Confined asked 29/5, 2011 at 0:4

4

Solved

How to do either a HQL or a Criteria search (the latter is preferred) involving an enum that is used as flags. In other words, I have a persisted enum property that stores some kind of flags. I wan...
Hygrometry asked 10/5, 2010 at 19:10

4

Solved

Hey, is there any way to store negative flags in C#? For example I have the following flags enum that represents some styles: [Flags] public enum Styles { Default = 0, Bold = 1, Italic = 2 } ...
Retrogradation asked 4/4, 2011 at 10:13

2

Solved

I've developed a small binary flag system for our admin centre. It allows us to set items to have multiple options assigned to them, without having to store have a table with several fields. Once ...
Crackbrain asked 27/4, 2011 at 8:36

2

Solved

Why is the flag that indicates a System property in Java -D? Surely there is some semantics to this letter choice, but I can't guess what it is.
Funky asked 26/4, 2011 at 14:19

3

Solved

I'm creating a flags enumeration in C#, similar to the following: [Flags] public enum DriversLicenseFlags { None = 0, Suspended = 1 << 1, Revoked = 1 << 2, Restored = 1 <&l...
Lise asked 31/3, 2011 at 18:41

4

Solved

Let's say I have this enum: [Flags] public enum SomeType { Val1 = 0, Val2 = 1, Val3 = 2, Val4 = 4, Val5 = 8, Val6 = 16, All = Val1 | Val2 | Val3 | Val4 | Val5 | Val6 } and some variables...
Poisoning asked 11/2, 2011 at 11:57

2

Solved

I'm currently reading the book C# 4.0 in a Nutshell, which by the way I think is an excellent book, even for advanced programmers to use as a good reference. I was looking back on the chapters abo...
Yingyingkow asked 9/2, 2011 at 20:21

2

Solved

If I write data to a file via file_put_contents with the FILE_APPEND flag set and two users submit data at the same time, will it append regardless, or is there a chance one entry will be overwritt...
Hepatitis asked 13/1, 2011 at 16:36

1

Solved

What's the difference between using Flags and FlagsAttribute with an enum?
Jamarjamb asked 9/1, 2011 at 19:44

1

Solved

MDN says: To perform a "sticky" search, that matches starting at the current position in the target string, use the y flag. I don't quite understand it.
Strapped asked 27/12, 2010 at 22:33

3

Solved

I've seen some possible approaches (in some database engines some of them are synonyms): TINYINT(1) BOOL BIT(1) ENUM(0,1) CHAR(0) NULL All major database engine supported by PHP should be noted...
Facile asked 26/12, 2010 at 22:41

1

Solved

What exactly happens when you set the flag on a pending intent to 0? Does it just not raiise a flag or does it default to one of the others?
Infuse asked 23/12, 2010 at 23:57

9

Solved

I have a method with a flag argument. I think that passing a boolean to a method is a bad practice (complicates the signature, violates the "each method does one thing" principle). I think splittin...
Wellinformed asked 24/11, 2010 at 11:41

3

Solved

There is a variable that holds some flags and I want to remove one of them. But I don't know how to remove it. Here is how I set the flag. my.emask |= ENABLE_SHOOT;
Koehn asked 13/10, 2010 at 2:1

4

Solved

Recently I have come across several examples of "flags" in C and C++, and I don't quite understand how they work. After looking at some source code I noticed that often flag values are defined in h...
Charlie asked 4/9, 2010 at 19:25

1

Solved

I'm attempting to create a function with flags as its arguments but the output is always different with what's expected : define("FLAG_A", 1); define("FLAG_B", 4); define("FLAG_C", 7); function...
Repetitious asked 28/8, 2010 at 5:16

7

Solved

I need to detect if a flag is set within an enum value, which type is marked with the Flag attribute. Usually it is made like that: (value & flag) == flag But since I need to do this by gen...
Augustinaaugustine asked 6/7, 2009 at 12:3

© 2022 - 2024 — McMap. All rights reserved.