Skip to main content
Filter by
Sorted by
Tagged with
0 votes
1 answer
103 views

I have the following excerpt from my Python code For emp in employees: Model.Add(d[emp] >= 25) .OnlyEnforceIf(d120[emp]) Model.Add(d[emp] < 25) .OnlyEnforceIf(d121[emp]) It is my ...
Prem Narasimhan's user avatar
0 votes
0 answers
79 views

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
107 views

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
45 views

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
3 votes
2 answers
89 views

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
58 views

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.6k
-2 votes
1 answer
46 views

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
321 views

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
122 views

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
47 views

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
91 views

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
159 views

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
290 views

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
216 views

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
120 views

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
79 views

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
0 votes
2 answers
58 views

I need to find a formula that can tell me if certain conditions are met in multiple columns. I have Column A "Day of Week" and Column B "24 Hr Clock" In column C I would like to ...
Ron B's user avatar
  • 13
5 votes
3 answers
1k views

Update: please see my discussion if you want to delve further into this topic! Thank you everyone for your feedback on this! I have a boolean(ish) flag that can be True or False, with None as an ...
AutumnKome's user avatar
0 votes
1 answer
54 views

In order to implement simplification of a 5-variable Boolean expression using Karnaugh map, I write a JavaScript function to group cells (which input is a list of integers specifying minterms): ...
Duy Duy's user avatar
  • 621
1 vote
0 answers
58 views

I have a problem when try to use a filter in a query that have a null field. if (StringUtils.isNotBlank(query)){ expression = expression.and(qAdopt.name.containsIgnoreCase(query) ...
Michael Navarrete Cartes's user avatar
0 votes
2 answers
145 views

I've defined a grammar, which I have to parse in C# and evaluate the resulted "constraints" on a list of dictionaries. The grammar is mainly boolean algebra. Here you can check it: grammar ...
vencelbajnok's user avatar
-1 votes
1 answer
124 views

Suppose I have several environment variables, going by the hypothetical names OBJECT_A, OBJECT_B, OBJECT_C, etc. I must implement a function doTheyExist() that must return a boolean. I want to know ...
Pedro Falcão's user avatar
0 votes
2 answers
327 views

I not understand how the first Boolean expression on the question can be simplified into the last. Please help me. My attempt: 1. (xy)' + (yz) 2. (x' + y') + (yz) # Using de Morgan's law. 3. x' + (y' +...
Alix Blaine's user avatar
0 votes
1 answer
63 views

I am trying for several hours to calculate a boolean AND operation in Octave. It return a wrong number. I want to calculate following numbers: result = 4037 & 63 result should be 5 but i get 1. I ...
user19471767's user avatar
1 vote
2 answers
114 views

Here is the problem: number = 1101 #You may modify the lines of code above, but don't move them! #When you Submit your code, we'll change these lines to #assign different values to the variables. # #...
XYZ's user avatar
  • 19
0 votes
1 answer
117 views

According to the documentation (section A.9.12), CLP(FD) constraints such as #>, #=, #/\ etc. can be reified. Constraint #<==>/2 is supposed to be True iff P and Q are equivalent according ...
Yui Rio's user avatar
  • 41
0 votes
1 answer
52 views

I am trying to create a function that returns a different greeting depending on two variables: the country and time provided. If time is greater than or equal to 0 but less than 12 it will be morning. ...
Umar Hussain's user avatar
0 votes
1 answer
127 views

The inputs are A[2:0], B[2:0] and C[2:0] respectively. The outputs are E,RA,RB,RC. If at least at one of the inputs (A,B,C) none of the bits are equal to 1 or if at least at one input the bits that ...
Bhuhu's user avatar
  • 1
0 votes
1 answer
96 views

I'm implementing a compiler as part of a class, for a language which is supposed to support both arithmetic and boolean expression. Unfortunately, I'm having some trouble implementing rules for both ...
Ter Maxima's user avatar
-1 votes
1 answer
86 views

I am a bit confused. < means that the right side of the number is bigger, no? So natually, the while condition while (height > 0 && height < 9); in #include <cs50.h> #include &...
Deni's user avatar
  • 1
1 vote
2 answers
117 views

I have a function which takes in 3 arguments and I want to make sure those three arguments are numbers. As of right now, I've made this after a bit of experimenting and it seems to work but I'm not ...
Chargou's user avatar
  • 13
2 votes
1 answer
143 views

I was trying to solve a coding problem which ended up with these conditionals: x_A2 <= x_B1 OR x_A1 >= X_B2 --> 0 x_A1 <= x_B1 <= x_A2 --> x_A2 - X_B1 x_B1 <= x_A1 <= x_B2 --...
user3621272's user avatar
-3 votes
1 answer
53 views

Which of the following will be fully evaluated that first option will be checked inclusive the second option, if the following variables represent the following boolean values a = True b = False ...
Kondwani Paul Kufeyani's user avatar
-2 votes
1 answer
122 views

I'm have a problem with understanding this question about syntax it says the answer is boolean xx = (43.3L == 3.333f); but i don't understand how it is Which of the following Java statements are NOT ...
Edward lucas's user avatar
0 votes
1 answer
133 views

I know this is can be a very basic question, but I found something curious on Python. I will try to explain this with the following example: l = [1,2,3,4,5] n1 = 1 We know the following: print( n1 in ...
Sebastián Silva's user avatar
1 vote
2 answers
68 views

When a DataFrame ("Given_DF") has a Boolean variable (such as B below),how can one subset the DataFrame to keep only rows of Variable B with True value?. Given_DF ID A B 0 123 ...
sonicpoem's user avatar
-1 votes
1 answer
49 views

I had a problem with checking falsy conditions and don't understand how 'false' works. I tested the code above, echo (0 == false); //->true echo ("0" == false); //->true echo ("0&...
Nicolas Henry's user avatar
1 vote
1 answer
66 views

a = {1 : 4} print(4 in a) # case 1: False a = {1 : 's'} print('s' in a) # case 2: False a = {1 : None} print(None in a) # case 3: False a = {1: True} print(True in a) # case 4: True so my ...
cardinal2000's user avatar
1 vote
2 answers
578 views

I have a simple macro function which will check the condition and return an Boolean value. Below is the snippet of code assume: #define boolean bool Test.h file #define CHECK_STATE(X) (...
user2986042's user avatar
  • 1,300
0 votes
1 answer
99 views

Here goes an example of C# code. I did not get why in first case we will have 1 instead of 0. Why does it return 1 instead? static void Main(string[] args) { int firstNumber = 0; bool ...
DeepBlue's user avatar
-2 votes
2 answers
64 views

I was wondering if those familiar with codingbat's problems might be able to help me with understanding the differences between these two solutions and why one doesn't work. The problem: Given a ...
AzureBoredom's user avatar
-2 votes
1 answer
203 views

i am trying to learn python and for that i am watching a course, in which the core concepts of the language are being taught. I wrote the following code, in which a secret word has to be guessed: I ...
mdot's user avatar
  • 1
2 votes
1 answer
173 views

I have a tree of boolean operations from a boolean expression that I have to run in Java. The tree would be something like this: And I would need to run it in Java iteratively so that it returns me a ...
simondx's user avatar
  • 103
-1 votes
2 answers
197 views

As the title says, what can be the possible boolean expression of the logic circuit given? The Truth table is also included.Logic Circuit I have tried to solve my own Boolean Expression and coded it ...
Ragna Alt's user avatar
1 vote
1 answer
95 views

I want to filter the datapoints I have, until I only have the datapoints were the participant was asleep left. I have my dataframe with DateTime values and the values I am researching, and a different ...
Marloes's user avatar
  • 13
0 votes
1 answer
94 views

Imagine this "sneaky" python code: >>> 1 == 2 < 3 False According to Python documentation all of the operators in, not in, is, is not, <, <=, >, >=, !=, == have the ...
oBrstisf8o's user avatar
-1 votes
1 answer
95 views

I´m a 1 week self taught python3 guy, and i´m into the comparison and boolean operators and learn this: True and True True True and False False False and True False False and False ...
Jaime Cordoba's user avatar
0 votes
0 answers
284 views

Full Query: SELECT '' as [id], a.OrganizationId as [organization_id], a.AdmissionNo as [admission_no], a.AdmissionDate as [admission_date], p.MrNo as [mr_no], ...
My August's user avatar
0 votes
1 answer
48 views

I have a horrible feeling that the answer to this question is going to be obvious, but... I am reading data from a small file in MicroPython. The value of the line I read determines whether a bool ...
PhilTilson's user avatar
0 votes
1 answer
252 views

Problem How do you write a "product-of-sums" Boolean expression, in m Boolean variables, which enforces at least n of those variables being 1/true? Attempt Starting in the "sum-of-...
Lazy Titanic's user avatar

1
2 3 4 5
22