boolean-logic Questions
2
Solved
I'd like to define a boolean function (with n inputs and m outputs) in a tabular form. I'd like to find an optimal boolean expression which implements the function. Optimal here means that, impleme...
Wickham asked 7/5, 2011 at 16:10
9
Solved
I can't understand the logic behind the terms intersection types and union types in TypeScript. I'm thinking of interfaces (or classes) as sets of properties.
The logical conjunction operator &...
Wasteful asked 9/8, 2016 at 16:21
4
Solved
I am aware that AND corresponds to & and NOT, ~. What is the element-wise logical OR operator? I know "or" itself is not what I am looking for.
Medea asked 16/7, 2014 at 8:19
11
Solved
I'm trying to evaluate ((x == a and y == b) or (x == b and y == a)) in Python, but it seems a bit verbose. Is there a more elegant way?
Manicure asked 17/10, 2019 at 15:5
4
Solved
This is more of a just for fun question. I’m working on a SC61860 CPU, which is an 8-bit CPU for a Sharp PC-1360 Pocket Computer from 1987 (also used in PC-1401 & 1403’s). Its instruction set d...
Portauprince asked 14/8, 2015 at 20:58
3
I would like to check multiple conditions in an if loop of GNU make file. Here's an example:
ifeq ($(TEST_FLAG),TRUE && ($(DEBUG_FLAG),FALSE))
true statement
else
false statement
endif
...
Geminate asked 23/6, 2011 at 8:46
15
Solved
I was playing around in jsfiddle.net and I'm curious as to why this returns true?
if(0 < 5 < 3) {
alert("True");
}
So does this:
if(0 < 5 < 2) {
alert("True");
}
But this doesn'...
Melodee asked 3/11, 2010 at 16:32
7
Solved
I have a pandas Series object containing boolean values. How can I get a series containing the logical NOT of each value?
For example, consider a series containing:
True
True
True
False
The ser...
Connect asked 14/4, 2013 at 10:44
7
Solved
I've got some dynamically-generated boolean logic expressions, like:
(A or B) and (C or D)
A or (A and B)
A
empty - evaluates to True
The placeholders get replaced with booleans. Should I,
Co...
Pasturage asked 18/3, 2010 at 4:49
2
Solved
I want to delete rows when a few conditions are met:
An example dataframe is shown below:
one two three four
0 -0.225730 -1.376075 0.187749 0.763307
1 0.031392 0.752496 -1.504769 -1.247581
2 -0.44...
Triphibious asked 12/3, 2015 at 18:26
4
Solved
I have three boolean values. I need to return false if all three are true or if all three are false. I will return true in every other situation. Based on my research, in some specifications this i...
Allerus asked 31/8, 2018 at 5:23
6
Solved
Is there any way to use boolean algebra in JS?
Eg I would like to loop through an array containing true & false, and simplify it down to either only true, or false.
Doing it with boolean algebr...
Laconic asked 14/7, 2011 at 18:3
35
Solved
How can I check whether a string is not null and not empty?
public void doStuff(String str)
{
if (str != null && str != "**here I want to check the 'str' is empty or not**")
{
...
Hialeah asked 30/8, 2010 at 8:1
31
Solved
I'm trying to make a function that will compare multiple variables to an integer and output a string of three letters. I was wondering if there was a way to translate this into Python. So say:
x = ...
Docilla asked 27/2, 2013 at 12:26
4
Solved
a + b = c
c - a = b
Ok, now
a & b = c
c ?? a = b
which operator replace "??" ?
Thanks
Towhaired asked 26/3, 2014 at 13:56
5
Solved
I am filtering rows in a dataframe by values in two columns.
For some reason the OR operator behaves like I would expect AND operator to behave and vice versa.
My test code:
df = pd.DataFrame({'a':...
Certifiable asked 23/3, 2014 at 12:52
3
I find myself doing this kind of thing somewhat often:
$foo = true;
$foo = $foo && false; // bool(false)
With bitwise operators, you can use the &= and |= shorthand:
$foo = 1;
$foo ...
Oersted asked 9/7, 2013 at 16:5
2
Solved
If I had the sum of products like z*a + z*b + z*c + ... + z*y, it would be possible to move the z factor, which is the same, out before brackets: z(a + b + c + ... y).
I'd like to know how it is p...
Cerium asked 27/10, 2011 at 10:14
1
Solved
I'm working on a project where we are appling MISRA 2004.
On most of the violations I got the reason, but one I don't understand:
Its in the if-statement with && and || operations.
Example:...
Caustic asked 24/3, 2022 at 9:38
3
Solved
I have an object which has a state property, for example state = 'state4' or state = 'state2'.
Now I also have an array of all available states that the state property can get, state1 to state8 (no...
Sunburst asked 7/2, 2012 at 9:10
9
Solved
Currently I have a web application where a user can use dropdown lists to generate SQL SELECT statements like so:
Column Select Dropdown | Operator Dropdown (= != > < <= >=) | Value select d...
Olympe asked 9/11, 2009 at 19:55
11
Solved
How can I check if 20 variables are all true, or if 20 variables are all false?
if possible without using a really long if ...
the variables are actually array elements:
array('a'=> true, 'b'=> ...
Lectra asked 27/7, 2011 at 19:57
3
Solved
Is there ever a circumstance in which I would not want to use the AndAlso operator rather than the And operator? …or in which I would not want to use the OrElse operator rather than the Or o...
Dipterocarpaceous asked 10/9, 2008 at 18:51
7
Solved
I want to write an if/else statement that tests if the value of a text input does NOT equal either one of two different values. Like this (excuse my pseudo-English code):
var test = $("#test").val...
Metamorphic asked 24/5, 2011 at 19:29
2
Solved
I was playing around with booleans and ended up with this line of code:
std::cout << true && false;
which, for some reason, produces 1. How is this possible, if && requires bo...
Recover asked 3/8, 2021 at 7:49
1 Next >
© 2022 - 2024 — McMap. All rights reserved.