Skip to main content
0 votes
0 answers
68 views

Why does R evaluate `NA==T|F` as NA, but `NA==F|T` as True? (and related Qs) [duplicate]

If you run the following lines of code in R, you may be surprised by the results (printed above each line as a comment) #1: NA NA==T #2: NA NA==F #3: NA NA==T&T #4: FALSE NA==F&F #5: NA NA==F&...
Some Attribute's user avatar
1 vote
2 answers
84 views

truthy values == false return true

So I am a beginner at javascript and learnt that there are only a limited falsy values: false, 0, -0, BigInt 0n, “”, null, undefined, NaN Yet when I use the == operator with truthy values, this ...
applepie's user avatar
0 votes
1 answer
32 views

Troubleshooting of Boolean combination of AND and OR conditions in Excel Formula [duplicate]

I am trying to set up an Excel conditional formula with both AND and OR criteria. However, the last 2 criteria OR(Table1[Col5]=$J$4,Table1[Col5]=$K$4) and OR(Table1[Col6]=Pivot!$J$5,Table1[Col6]=Pivot!...
sjedi's user avatar
  • 97
2 votes
2 answers
81 views

Odd boolean expression

I'm trying to debug (rewrite?) someone else's Python/cherrypy web app, and I ran across the following 'if' statement: if not filename.endswith(".dat") and ( filename.endswith(".dat&...
user3765883's user avatar
0 votes
0 answers
53 views

Logical condition equivalent with restrictions

I am developing an Azure DevOps custom task. Part of the setting of the inputs is a VisibleRule which can contain a condition which will determine if the input will be visible, if the condition is ...
CodeMonkey's user avatar
  • 12.4k
-2 votes
1 answer
35 views

Can a contradiction Boolean expression with variables 𝑎 and 𝑏 be represented in NAND form? [closed]

I have f(a,b) = 0 and want to represent it in NAND form (only using NAND gates) in terms of a and b, but I don't think is possible.
Glooring's user avatar
9 votes
0 answers
304 views

Limiting the depth of Boolean expressions

I am given a Boolean expression of arbitrary depth, like (A or (B and (C or (~D and E) or F) or (G and H))). There can be any number of terms at each level. I want to limit the depth of the ...
Matt Timmermans's user avatar
0 votes
1 answer
79 views

In pytorch, how can I parallelize of a set of boolean functions that are executed (on a GPU) repeatedly?

I have a set of Boolean functions that are independent, and (hypothetically) can be executed in parallel. I want to call those same functions repeatedly. See the code below, in which the outputs of ...
mattroos's user avatar
  • 135
0 votes
1 answer
39 views

Re-fomulate bitwise boolean expressions between register bits in terms of register values

Suppose we have two e.g. 32-bit input registers and one equally wide output register, with boolean functions linking individual bits of these registers. Is there a method to express these bitwise ...
A B's user avatar
  • 1
1 vote
1 answer
68 views

How to simplify boolean expression given kmap

Can someone explain to me how to find the simplified boolean expression given the kmap below? kmap I'm grouping the 1's in the upper left corner, top row, and wrap-around in the fourth column but am ...
moosemarrin's user avatar
1 vote
2 answers
150 views

How to detect whether each element of a list of element-nodes does feature a specific css-class name?

Given the following test environment ... const nodeList = document.querySelectorAll('p'); const testArray = Array.from(nodeList); testArray.every(function (elmNode) { if (elmNode.classList....
Виталий Юрко's user avatar
1 vote
2 answers
220 views

Simplify a boolean expression with 4 variables to 3 variables

I'm doing some simplifications for a circuit and I ended up getting the following expression: A.C'.D' + A.B'.C' + B.C.D' + B'.C.D + A'.B'.D' which translates to the truth table where 0, 2, 3, 6, 8, 9, ...
Waffle_Runian's user avatar
-2 votes
2 answers
134 views

What actually happens when we put conditions without [] (brackets) in if else block in a bash script?

final='' if [ $final ]; then echo "final"; else echo "not final"; fi; Look at this code above. How would it apply and why, if I remove the brackets in the if block? How does it ...
Debajyati Dey's user avatar
0 votes
0 answers
114 views

Updating items of Boolean array in For Each loop

How to update each item of a Boolean array in a For... Each loop? This code updates item variable in every loop but it doesn't update the array items themselves. Dim BoolArr(1 to 4) as Boolean Dim ...
house_of_codes's user avatar
1 vote
0 answers
73 views

Python: How to slice a 2d array to specified range of x and y values? Also how to improve this code?

I have a meshgrid given by X and Y of unequal length and a 2d array of values vx2. I want to create a sub-2d array Z from a certain xlim and ylim. I want to create a contour plot but since matplotlib ...
Pundarikaksha Kavipurapu's user avatar

15 30 50 per page
1
2 3 4 5
72