flags Questions

5

Solved

Recently I came across flag variables, but I have no idea what they do. I am little unsure about when to use a flag variable and how to go about it. I Googled it but there weren't any specific ex...
Desmonddesmoulins asked 1/7, 2013 at 10:20

3

Solved

I'm implementing GCM. My app has two activities, say A and B. I'm using this code to launch B from the NotificationBar: long when = System.currentTimeMillis(); NotificationManager notificationMana...
Barbra asked 30/10, 2012 at 8:56

3

Solved

Why are bools sometimes referred to as "flags"? Is it just a metaphor or is there some historical reason behind it?
Despiteful asked 27/9, 2015 at 16:35

3

Solved

Found an interesting JVM Flag : java -XX:+UnlockDiagnosticVMOptions -XX:+PrintFlagsFinal -version It prints hundreds of various options, I never heard about before. It also prints default value...
Bronnie asked 7/5, 2012 at 17:28

3

Solved

I have flags that may be defined in multiple components. Its not possible to know if a component has already defined a flag, as such if two components Foo and Bar require flag Zed, but Foo and Bar ...
Ader asked 9/3, 2018 at 12:6

13

Solved

how do i switch on an enum which have the flags attribute set (or more precisely is used for bit operations) ? I want to be able to hit all cases in a switch that matches the values declared. The...
Princely asked 24/6, 2009 at 20:18

18

Solved

Sometimes I want to just insert some print statements in my code, and see what gets printed out when I exercise it. My usual way to "exercise" it is with existing pytest tests. But when I run these...
Ashelman asked 18/1, 2013 at 18:14

2

Solved

I see many times flags such as if [-n ${Parameter}] or echo -n <string>. Sometimes, I have seen flags like -r and others used. However, I don't know how to search for the meaning of the...
Crumby asked 20/7, 2020 at 15:41

4

Solved

I have been messing around with the Flags while learning ARM assembly on my Raspberry PI. I have devised of ways only to set the zero flag, only the negative, and only the carry flag. However I can...
Alfonsoalfonzo asked 2/10, 2018 at 3:15

5

Solved

I used: getWindow().addFlags(android.view.WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON); How do I resume to Default state (no-keep-on)?
Latarsha asked 26/1, 2011 at 17:18

7

I'm getting a lot of noise from the output of the 3rd party's page i'm currently playing with and i wonder if there's a way to filter the output on the console. Something like Logcat's flags. Is th...
Unbounded asked 12/7, 2011 at 3:55

4

Solved

Would someone explain me the role of flags in functions like setFlags? What exactly does this word mean in that situation...? My example is protected void onCreate(Bundle savedInstanceState) { ...
Opalescent asked 19/2, 2014 at 3:14

11

Solved

I have to build an extension method for each flag type I declare, like so: public static EventMessageScope SetFlag(this EventMessageScope flags, EventMessageScope flag, bool value) { if (value)...
Belita asked 1/5, 2011 at 19:45

4

Solved

Instead of doing this to add a value to flags enum variable: MyFlags flags = MyFlags.Pepsi; flags = flags | MyFlags.Coke; I'd like to create an extension method to make this possible: MyFlags f...
Syreetasyria asked 26/4, 2011 at 16:38

18

Solved

Let's say I have this enum: [Flags] enum Letters { A = 1, B = 2, C = 4, AB = A | B, All = A | B | C, } To check if for example AB is set I can do this: if((letter & Letters.AB) == Letters...
Cyanohydrin asked 27/8, 2009 at 9:44

3

Solved

Im designing a Pyside Qt application and I want to toggle the QtCore.Qt.WindowStaysOnTopHint window flag in my main window. Setting this hint using this code works fine: self.setWindowFlags(QtCore...
Phratry asked 3/1, 2014 at 1:46

11

Solved

I have a QTreeWidgetItem with two columns of data, is there any way to make only the second column editable? When I do the following: QTreeWidgetItem* item = new QTreeWidgetItem(); item->setFla...
Pinebrook asked 10/5, 2010 at 10:40

11

In the middle of a script, I want to check if a given flag was passed on the command line. The following does what I want but seems ugly: if echo $* | grep -e "--flag" -q then echo ">>>&...
Hyams asked 20/5, 2010 at 15:45

5

Solved

I have run into a bug with gcc v3.4.4 and which to put an #ifdef in my code to work around the bug for only that version of the compiler. What are the GCC compiler preprocessor predefined macros t...
Triplex asked 20/12, 2009 at 19:32

14

Solved

From time to time I see an enum like the following: [Flags] public enum Options { None = 0, Option1 = 1, Option2 = 2, Option3 = 4, Option4 = 8 } I don't understand what exactly the [Flags]...
Impede asked 12/8, 2008 at 4:9

6

Solved

I want to check a condition inside a loop and execute a block of code when it's first met. After that, the loop might repeat but the block should be ignored. Is there a pattern for that? Of course ...
Pulverulent asked 17/7, 2013 at 13:33

4

Solved

Is there a work around to make country flag emoji visible on windows 10 through HTML? <!DOCTYPE html> <html> <style> body { font-size: 40px; } </style> <body> ...
Frizette asked 4/7, 2020 at 13:27

3

Solved

Is it possible not to set default value in flag package in Go? For example, in flag package you can write out the following line: filename := flag.String("file", "test.csv", "Filename to cope with...
Hypothalamus asked 25/8, 2013 at 13:47

3

Solved

I'm running a containerized java application in Kubernetes. In order to make the jvm reserve memory according to the container specifications, the flags -XX:+UnlockExperimentalVMOptions -XX:+UseCG...
Trincomalee asked 28/9, 2018 at 12:11

4

Solved

I know that you can use FlagsAttribute to instruct the compiler to use bitfields for an enumeration. Is there a way to specify that enum values cannot be combined with bitwise OR? Example: enum ...
Corfu asked 22/7, 2016 at 9:7

© 2022 - 2024 — McMap. All rights reserved.