» Home » Logical » Page 1
MongoDB - Java - what is Easiest way to combine logical OR and logical AND?
by Rida Al Barazi in Java

I have the following query as an example:
year = 2012 OR year = 2011 AND name = John OR name = Mike AND county = USA OR country = Canada

What is the best way to construct this using the JAVA driver?
Using the DBObject is a bit tricky as it's actually a Map so keys have to be distinct.
I could not find a decent example with QueryBuilder either (i.e. one using a loop).<

Basic identities of logical expressions and deriving logical expressions from truth table?
by ronansprake in Web Design

I was wondering what a basic identity of a logical expression is and how to get it. I looked on google but couldn't find anything about it.

Say, for example I have a logical expression ~(~(P ^ ~(P ^ Q)) ^ ~(Q ^ ~(P ^ Q)))
Below is the result I got from a truth table and I don't know what to do with it to get a basic identity.


Logical AND in Forth?
by amiT jaiN in Web Design

I know the AND word defines binary and... but what defines logical and?

TAGS : Logical Forth

How to use logical and in c++
by Tom Clark in C & C++ & C#
if (age > 40 && age < 60)


if (age > 40 & age < 60)

As you can see I am not sure if C++ uses two and signs or one.

TAGS : logical

How to use logical operators in ant?
by brtyler in Programming Languages

i have a small peice of code which prints if platform is unix or windowsas

<equals=${arg1} value="linux-86"/>
<echo message="linux"
<equals=${arg1} value="linux-64"/>
<echo message="linux"/>

Logical Operators in C
by GreenChile in Programming Languages

I am having trouble trying to understand how logical operators work in C. I already understand how the bit-level operators work, and I also know that logical operators treat nonzero arguments as representing TRUE and zero arguments as representing FALSE

But say we have 0x65 && 0x55. I do not understand why and how this operations gives 0x01.

I tried to convert it

logical or expression c++
by Janne Lammi in C & C++ & C#

I have a problem using the Logical OR operator in C++. The problem is coming that the right-side expression is not evaluated if the left-side is true. I have two deque-s and I need to popLeft from them with a while, but if I can pop from the first deque, I don't pop from the second because is not evaluated, by the OR operator. How can I overcome this problem. Here is the piece of code:

PHP || and && logical optimization
by legendma in Network & Servers

I'm a bit of an optimization freak (at least by my definition) and this question has been bugging me for quite a while.

I'm wondering if PHP does some optimization on && and ||:
Take the following example:

$a = "apple";
$b = "orange";
if ($a == "orange" && $b == "orange") {
//do stuff

When that code e

R - Logical operators
by Gold in Programming Languages

Please can anyone advise how I can turn the following statement into one that will do the same thing but NOT using ifelse please?

<-ifelse(y>=50, 0.2*x+0.8*y, ifelse(y<50 & x>70, y+10, ifelse(y<50 & x<70, y)))

So I the final code should give an answer of 64 - selecting the first condition. I will then test it

Regex logical OR
by nasy in Programming Languages

This is a purely academic exercise relating to regex and my understanding of grouping multiple patterns. I have the following example string

<xContext id="ABC">
<xData id="DEF">
<xData id="GHI">
<order id="STU">
TAGS : Regex logical

Privacy Policy - Copyrights Notice - Feedback - Report Violation - RSS 2017 © bighow.org All Rights Reserved .