boolean

Magento and unsetting a custom boolean attribute

Hi, I've added an attribute to a customer address entity. Attribute setup code is as follows- 'entity_type_id'=>$customer_address_type_id, 'attribute_code'=>'signature_required', 'backend_type'=>'int', 'frontend_input'=>'boolean', 'frontend_label' => 'Signature required', 'is_global' => '1', 'is_visible' => '1', 'is_required' => '0', '...

Evaluation of PL/SQL boolean variables in Oracle Forms

Suppose I have a BOOLEAN variable within a PL/SQL block in an Oracle Form: DECLARE is_viewable BOOLEAN; BEGIN is_viewable := ...; IF NOT is_viewable THEN raise_my_error(); // pseudo-code END IF; END; After stepping through this code several times with a debugger, I have determined that raise_my_error() never gets called. ...

functions that produce lists of lists in scheme

Hi, I'm trying to use scheme to write a function f that takes a number n and a function g and returns a list of lists of length n, but according with booleans according to the pattern indicated by g. For example, the function f should take n say 3 and the function g which makes every 3rd item on the list a true. It should return this: ...

Convention result and code error C++ int foo (...)

In Linux for example when i use batch if error code is 0 thats good, but what is the convention in C++ ? when int (or bool) is equal to one we say that's true, but what must be the return of such function in C++ ? ...

Bitwise Or: C# versus C++

Hi ::- ). Assume you have two integers, a = 8, b = 2. In C++ a | b is true. I used that behavior to work with collections of flags. For example the flags would be 1, 2, 4, 8 and so on, and any collection of them would be unique. I can't find how to do that in C#, as the | and & operators don't behave like they would in C++. I read docume...

C# Flag Charlie-Fox

Hi everybody. I've been trying to emulate in C# a behavior which I was implementing without any problems in C++. I have a flag collection, which based on powers of 2, and a flag which I need to check if it exists in the collection. byte flagCollection = 1 | 2 | 4 | 8; byte flag = 2; if ((flagCollection & flag) != 0) MessageBox.S...

Convert.ToBoolean and Boolean.Parse don't accept 0 and 1

Why was it decided that when parsing a boolean, 0/1 are not acceptable? When parsing any integer type value, it accepts numerical strings to be parsed. (And if .NET can parse the string "One hundred million two hundred and sixty five thousand eight hundred and sixty five" I would be surprised). What makes booleans special? They are ess...

Java - boolean primitive type - size

The Java Virtual Machine Specification says that there is limited support for boolean primitive types. There are no Java virtual machine instructions solely dedicated to operations on boolean values. Instead, expressions in the Java programming language that operate on boolean values are compiled to use values of the Java virtual mac...

How can I programmatically flip the value of an element attribute using JQuery?

Hello, I'm just starting to get into JQuery so I apologize in advance if this is a simple question. I'm working with the A List Apart article on Print Previews to try to get live Print Previews in the webapp that I'm working on. I've gotten it to work satisfactorily but I'm now trying to refactor my code to what I think it should look...

Using [0,1] versus ["Y","N"] versus ["T","F"] in a logical/boolean database field?

Just out of curiosity and lack of a definite answer... I was just looking at some data that is sent from a 3rd party to us, and their "Gender" field is a [0,1] denoting either a Female (0) or a Male (1). Is there any better reason to use [0,1] over ["F","M"]? Does it depend on the scenario and the intuitiveness between a field and its...

Nominal case first vs. Positive boolean expressions

As the topic states, sometimes these issues conflict. For example... In this case, the nominal case is first, but the expression is negative. if ( !foo.IsDead() ) { DoThis(); } else { DoThat(); } In this case, the expression is positive, but the nominal case is last. if ( foo.IsDead() ) { DoThat(); } else { DoThis(); } Of ...

Multiplying out negated terms in boolean algebra?

I'm just learning boolean algebra at the moment. I read that for XOR we can rearrange the expression (A + B) . ¬(A + B) = A.¬A + A.¬B + B.¬A + B.¬B = A.¬B + B.¬A I can understand this but I'm unsure how I would proceed multiplying out an expression like (A + B) . (¬A + ¬B). If I just try and naively multiply out all the terms tha...

Using boolean values in C

C doesn't have any built in boolean types. What's the best way to use them in C? ...

Boolean Query..

if: x = 0 b = x==0 and i print be it would print 'true' but if i did: x = 0 b = x ==3 and i printed be it would be false. In stead of it printing false how would i take the boolean value 'b' to print what text i wanted? let me explain further: bool = all(n > 0 for n in list) if bool != 'True': print 'a value is not gr...

PHP: Why typecast with !!$var instead of (boolean)$var?

Both of these will ensure than $var is a boolean value, but the latter seems more clear. The double exclamation mark (!!) is shorter to type but less clear, and more likely to cause confusion. Not to mention hard to run a search on to get answers. The double exclamation mark is something I've only heard of in JavaScript, which doesn't...

Best way to handle persistent Boolean in plist?

What's the best way to handle Boolean values that derive from a UISwitch setting, and are stored in an NSMutableDictionary that is saved to the user's directory as persistent settings? Specifically, what's the best way to keep boolean values distinct from numeric values in an NSMutableDictionary that gets written to and read from the fil...

What am I doing wrong with conditional operators?

I have the following code: public class boolq { public static void main(String[] args) { boolean isTrue = true; isTrue ? System.out.println("true"): System.out.println("false"); } } when I try to compile it i get this: Exception in thread "main" java.lang.Error: Unresolved compilation problems: ...

How would I save and retrieve a boolean into a file using NSData

I want to save a boolean into a file and also I want to know how you would retrieve it again. I mainly want to use this for when the iPhone terminates and finishes launching in their respected methods. ...

Why aren't "and" and "or" operators in Python?

I wasn't aware of this, but apparently the and and or keywords aren't operators. They don't appear in the list of python operators. Just out of sheer curiosity, why is this? And if they aren't operators, what exactly are they? ...

C# Boolean expressions

Hi, in the example below, what would 'foo' be set to each time? I've searched online but I can't find anywhere that gives me the answer: static void Main(string[] args) { static public bool abc = true; static public bool foo = (abc = false); foo = (abc = true); } ...