Questions tagged [boolean]
A Boolean data type is a data type with only two possible values: true or false.
boolean
11,777
questions
-3
votes
1
answer
39
views
When attempting to enter time in string format, it results in an infinite loop [duplicate]
I started learning to program in C++. The task is to get the user to input the number of hours. However, when trying to enter the time in text string format, it starts to infinitely execute the loop ...
1
vote
1
answer
23
views
How to set pandas.DataFrame cell to null without FutureWarning
I would like to set some cells to null based on a condition. For example:
import pandas as pd # version is 2.2.2
df = pd.DataFrame({'x' : [1, 2, 2, 1, 1, 2]})
df["b"]=False
df.loc[df["x&...
-1
votes
3
answers
41
views
Clarification on how PHP handles true and false values
I would like to use a true/false result to do alternative things in PHP. I was surprised by the following:
$falsevar = false;
$truevar = true;
echo "falsevar which I just set to false is".$...
0
votes
0
answers
6
views
Using boolean difference in Pyvista gives artefacts
I am trying to do a boolean difference between two different shapes (a larger cylinder and a smaller cylinder that's deformed).
The reasons is I want to use this geometry input for a simulation later ...
0
votes
0
answers
6
views
Coding and Plotting Haar Wavelet
I am trying to plot Haar Wavelet function using the code below:
#define the t variable
#define the range of the time domain
L = 10
#Define the number of points in the time domain
n = 100
#define the ...
1
vote
1
answer
26
views
How to resolve complex boolean expressions into all possible combinations
I'm trying to solve the following problem. I have a set of logical operations and I would like to resolve them into all possible combinations. For example:
"((A | X) & B & C) | (C | E) &...
1
vote
0
answers
22
views
Opposite results between `bool(x)` and `x.__bool__()` after patching
In this simple little test case, I monkey patch the __bool__ method of an instance, but am surprised to see that calling bool(x) and x.__bool__() give opposite results afterwards. What is the ...
0
votes
0
answers
56
views
Convert undefined state (x) to high impendance state (z)
I have this set and reset test bench:
module sr_tb;
reg s = 0;
reg r = 0;
wire p;
wire q;
wire y;
or or1(y, s, p);
not not1(q, r);
and ...
0
votes
0
answers
14
views
Support for complex queries using analyzers
I submitted this as a feature request but perhaps it is best for this to be addressed as a question here.
We have the need to be able to build some more complex search queries that logically combine ...
-1
votes
0
answers
48
views
I have this error: Trying to access array offset on value of type bool
Warning: Trying to access array offset on value of type bool in C:\xampp\htdocs\streaming\includes\classes\Video.php on line 27
Warning: Trying to access array offset on value of type bool in C:\xampp\...
0
votes
1
answer
103
views
What's wrong with this simple boolean expression in Ruby?
Here is my Ruby 3.2 code:
puts (1 and 0)
puts (1 and 0 and 1)
It prints 0 and then 1 (I'm expecting 0 in both cases). Can someone explain, why?
0
votes
1
answer
57
views
Sending data from Rails to get validated in JSON Schema
In my app I am sending product information in various types (string, integer, float, and boolean) for validation by a JSON Schema.
I noticed today when attempting to send false boolean values for ...
1
vote
1
answer
67
views
How to redirect a user after a boolean check in Flutter
I have a button that checks the time difference, so I would want the user to be redirected if the button is active or when he clicks on the button when it is active. Below is what I have tried but I'm ...
0
votes
1
answer
50
views
How can I make a bool happen only once?
I'm trying to set up a dialogue system and I can't figure out how to make it stop repeating every frame.
{
[SerializeField] public TMP_Text dialogueText;
[SerializeField] public GameObject ...
0
votes
1
answer
29
views
Check if child exist in firebase database and return true or false [duplicate]
I want to create method that will check if a child is present or not in firebase database and returns the value true or false accordingly. here's my code
public boolean check_if_child_exist(...