flags

How to strip a list of tuple with python ?

I have an array with some flag for each case. In order to use print the array in HTML and use colspan, I need to convert this : [{'serve': False, 'open': False}, {'serve': False, 'open': False}, {'serve': False, 'open': False}, {'serve': False, 'open': False}, {'serve': False, 'open': False}, {'serve': False, 'open': False}, {'serve': F...

How to Compare Flags in C#? (part 2)

Bit flags are a little difficult to understand :) I know about this and this questions and I do understand the answers and I even followed this article from a good friend of mine. But I still cant figure it out when I need to "evolute" more than the standard... What I'm trying to do is this: if (HttpContext.Current.Session["Debug...

How to make functions with flag parameters? (C++)

How could I make a function with flags like how Windows' CreateWindow(...style | style,...), for example, a createnum function: int CreateNum(flag flags) //??? { int num = 0; if(flags == GREATER_THAN_TEN) num = 11; if(flags == EVEN && ((num % 2) == 1) num++; else if(flags == ODD && ((num % 2) == 0) ...

Process Explorer security flags

Hi, What is the difference between "Default Enabled" and simply "Enabled"? My guess would be that "Default Enabled" can be changed at some point, but "Enabled" cannot. Is this correct? Thanks! ...

How to use different ifstream modes in c++?

According to the reference, if I use ifstream infile ( "test.txt" , ifstream::in ); it will Allow input operations on the stream. But what are some of the examples of the "input operations"? Is ifstream infile ( "test.txt" , ifstream::in | ifstream::binary ); the right syntax to use multiple flags? Will it make a difference if I change...

Enum flags in JavaScript

I need to emulate enum type in Javascript and approach seems pretty straight forward: var MyEnum = {Left = 1; Right = 2; Top = 4; Bottom = 8} Now, in C# I could combine those values like this: MyEnum left_right = MyEnum.Left | MyEnum.Right and then I can test if enum has certain value: if (left_right && MyEnum.Left == MyEnum.Left)...

Flags, enum (C)

I'm not very used to programming with flags, but I think I just found a situation where they'd be useful: I've got a couple of objects that register themselves as listeners to certain events. What events they register for is dependent on a variable that is sent to them when they are constructed. I think a nice way to do this would be to...

Freezing Ruby version - is it possible? (Linker flags question)

Hi, I have a problem with RubyCocoa, which has a weak link to a libruby.dylib and not always can find this dylib on user's computer, which resulting a crash on the launch of my application (RubyCocoa based). I wonder whether it's possible to copy Ruby.framework to the bundle of my application and tell somehow to RubyCocoa to look for ru...

Outlook 2007 - Email Flag Status

This might be a duplicate of this question? Is there a way in Outlook 2007 using VBA to set a follow-up flag on an email object? It looks like it was supported in Outlook 2003 with .FlagStatus property, but I can't find it in 2007. In advance, thanks! I got a vote for this to be moved to SuperUser and considering this is VBA, it seem...

Java flag to enable extended Serialization debugging info

i am currently struggling with HTTP Session replication on tomcat with complex objects. some objects implement Serializable but hold non-serializable members. unfortunately, the stacktraces do not provide much useful info here by default. there is a flag -XX:???? to enable verbose class names in the stacktrace when a NotSerializableEx...

Testing a [Flags] enum value for a single value

If I have an enum that's marked with [Flags], is there a way in .NET to test a value of this type to see if it only contains a single value? I can get the result I want using bit-counting, but I'd rather use built-in functions if possible. When looping through the enum values dynamically, Enum.GetValues() returns the combination flags a...

Elegent Web Permission Schemes

Hello Everyone, I'm currently writing a web application that have about 6-12 pages. On each one of these pages, I want the user to be able to do some (or all) of the following actions: View, Add, Update, and Delete. The current permission scheme I thought of is having an integer in a database. This integer will correspond to a binary n...

Explanation of Flags in Go

Can anyone explain flags in Go? flag.Parse() var omitNewline = flag.Bool("n", false, "don't print final newline") ...

Simulate a 128-bit unsigned integer in SQL and C# using a 64-bit signed value?

Take this scenario: You have a few flag enumerations in C# tied to (and in fact generated from) Enum-ish tables in SQL Server. Say you are a distributor, and you allow your resellers to specify what US states they ship to. Being a brilliant and elegant software engineer, you implemented these as a bitwise-combinable flag value to save st...

Why doesn't this Outlook 2007 VBA work (I'm trying to remove a flag programatically)?

I have some code that adds a flag to an email but when I try this code below to remove it, it doesn't seem to have any effect in Outlook 2007. Public Sub Clear() Dim objOutlook As Outlook.Application Dim objInspector As Outlook.Inspector Dim strDateTime As String ' Instantiate an Outlook Application...

C# Enums with Flags Attribute

I was wondering if Enums with Flag attribute are mostly used for Bitwise operations why not the compilers autogenerate the values if the enum values as not defined. For eg. [Flags] public enum MyColor { Yellow = 1, Green = 2, Red = 4, Blue = 8 } It would be helpful if the values 1,2,4,8 are autogenerated if they are ...

Using flag to identify spoken language

Hello, In the webapp I am doing, I need to identify language people are speaking. I wanted to use flag to do that. But I have some problems. For example, if you speak French, you can put the French flag. But if you speak English you can put either the US or UK flag or a mix of both. Which flag to choose for Arabic language ? Saudi Ara...

Flags enumeration with multiple zero values problem (TextFormatFlags)

While trying to write a custom control I've come across a problem with the System.Windows.Forms.TextFormatFlags enum in combination with the Visual Studio (2005/2008) editor. The reason for this problem seems to come from the fact that this enum has multiple members which map to a zero value. Selecting any of these members (GlyphOverhang...

What are the gcc preprocessor flags for the compiler's version number?

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 flags to detect the version number of the compiler? Thanks. ...

How do you clear the read-only flag on a file in .NET?

How do you clear the read-only flag on a file in .NET and leave the rest intact? ...