» 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.


0
1
1
0

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)

or


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


<if>
<equals=${arg1} value="linux-86"/>
<then>
<echo message="linux"
<then>
<elseif>
<equals=${arg1} value="linux-64"/>
<then>
<echo message="linux"/>
</then>
</elseif>
<else>
&

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)))
x=80
y=60

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">
<ID>JKL</ID>
<str>MNO</str>
<str>PQR</str>
<str>
<order id="STU">
<str>VWX&
TAGS : Regex logical

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