11,780 questions
0
votes
0
answers
66
views
Apache HOP PostgreSQL Bulk Loader Boolean Bug?
I am experimenting with Apache HOP to become the successor of the (dead end) SSIS ETL platform. I am very impressed with the quality and the performance of Apache HOP so far.
I am trying to load data ...
2
votes
1
answer
72
views
Return value of python3 keyword in [duplicate]
A student was trying to write a simple script to determine if a string possibly constituted an email address. It looked something like this:
text = input("Enter a string")
if ("@" ...
0
votes
1
answer
65
views
Error in OPENMODELICA: INTEGER_ATTRIBUTE' has no member named 'nominal'
I have created a modelica package with dymola with opensource libraries. the models in the package are compiled and simulated in Dymola perfectly but when I try to simulate them in openmodelica, the ...
1
vote
0
answers
81
views
Why is !FALSE + !FALSE not equal to 2? [duplicate]
In writing some error-checking code for an R function, I was adding boolean values and I came across something counterintuitive. I know that when doing arithmetic with booleans, FALSE is treated as 0 ...
0
votes
1
answer
46
views
How to set up a hook in Wix data for a column that has been set to Boolean using Velo?
I am trying to help my church set up a lending library. I have a wix dataset that shows the "Book Name" and the "Author". These are text fields. I have column that I would like to ...
1
vote
1
answer
89
views
Inconsistent Results for Boolean Filters in Bigquery based on whether the table is aliased
I'm getting really really inconsistent results, and I can't tell why. Here is the most obvious example:
Two queries:
select * from my_table
where invitation_deleted = true
-- returns 118 results
...
1
vote
1
answer
98
views
Error in passing by reference a 1D array of booleans in c++
I am trying to create a program that is capable of randomly generating a grapgh (matrix representation) and then understand if it is connected or not. To do so, I need to pass to the is_connected ...
-2
votes
4
answers
117
views
Finding if a value is found within a list in python [duplicate]
My code is something like
aList = ['apple', 'banana', 'cherry']
anotherList = ['orange', 'apple', 'blueberry']
adifferentList = ['strawberry', 'pear', 'peach']
aSet = [aList, anotherList, ...
3
votes
1
answer
101
views
Best practice to validate a boolean array in PowerShell
I wanted to know what would be the best practice and quickest way to validate a boolean array in PowerShell to see if it's all true respectively all false.
My own approach looks like this:
$boolArray =...
2
votes
3
answers
94
views
Toggle Boolean on 'flick'
Have a next task
Create a function that always returns True/true for every item in a given list.
However, if an element is the word 'flick', switch to always returning the opposite boolean value.
...
0
votes
2
answers
158
views
How to check if literal pathspecs are set in git?
Is there any reliable way to check if Git literal pathspecs are enabled in a shell script?
This option can be set either by assigning a boolean value to the variable GIT_LITERAL_PATHSPECS or by ...
4
votes
1
answer
167
views
Can any char be converted in bool using std::bit_cast?
May one convert a char with the value not \0 and not \1 into bool using std::bit_cast? And if yes, what will the value of the resulting bool: true or false?
For example,
#include <bit>
...
5
votes
2
answers
370
views
Is static_cast<bool> guaranteed to send a value to 0 or 1?
I am trying to investigate an issue where a database driver expect a certain uint8_t member in a struct to contain 0 or 1.
In the code, this value is assigned via static_cast<bool>(...). I ...
-2
votes
1
answer
118
views
Why Python's `all` built-in function returns `True` when checking if an empty string is in a list when it isn't? [duplicate]
I wrote a function that checks if every character on a given string is also present in an arbitrary list. The code works for most cases, but when the input is an empty string, the built-in function ...
0
votes
0
answers
50
views
Why is PropertyInfo returning this weird type name (nullable boolean within a class)? [duplicate]
I ran the following code:
String s = String.Empty;
bool abool = false;
bool? nbool = false;
BoolsClass bc = new BoolsClass();
bc.classbool = false;
bc.classnbool = false;
s += $"The type of ...
0
votes
1
answer
105
views
issue with gradle and boolean errors when trying to build apk,
I am trying to build an APK in android studio with flutter and gradle. I received the following errors and I am not sure how to resolve them. I got stuck in a loop changing the output formatting, ...
2
votes
1
answer
92
views
google sheets array formula for boolean logic based on duplicate numbers per cell
I have a column A that looks like:
11
11 11
5 6
5 5
5 6 6 5
11 11 11 11
6 7 8
3
3 2 3
and seeking for an alternative-smarter way how to output TRUE/FALSE as shown here:
desired result
11
TRUE
FALSE
...
0
votes
0
answers
87
views
TypeError: 'bool' object does not support the context manager protocol at odoo 17 th version stock
I am struggling to fix the error called "TypeError: 'bool' object does not support the context manager protocol from button action called action_confirm in newly created module at odoo inventory ...
2
votes
3
answers
82
views
boolean indexing using .isin simply returns the series it is indexing, not the values it's supposed to
here's the dataset and the problem I'm working with
import numpy as np
import pandas as pd
couples = pd.DataFrame({
'man': [
['fishing', 'biking', 'reading'],
['hunting', 'mudding'...
-1
votes
2
answers
141
views
How specifically request rows with null values through an API request
This is in the context of a Python API. I have a column where the value can be either True, False or Null, lets call it is_impounded. The Null "value" is when it is unknown whether it is ...
0
votes
1
answer
104
views
How can I assign a varible to an output in java? [closed]
Im rather new to java and I love Boolean logic, so I've been trying to make a functional AND gate with the output tied to a variable and am completely lost. This is what I have.
public class Main {
...
1
vote
3
answers
146
views
Powershell converting bit values to Boolean in result set
I have an issue whereby a query called via Invoke-SQLCmd returns a certain set of results. For some columns the value is a 0 or 1 of BIT data type. The results instead come back as False or True in ...
2
votes
2
answers
69
views
Pandas convert string column to bool but convert typos to false
I have an application that takes an input spreadsheet filled in by the user. I'm trying to bug fix, and I've just noticed that in one True/False column, they've written FLASE instead of FALSE. I'm ...
0
votes
1
answer
40
views
Node js boolean function doesn't return false
I have a simple class Date with a few functions. One of them is SetMonthAndYear.
I export this class with module.export to make it accessible for other classes:
class MyDateClass {
currentMonth = ...
0
votes
0
answers
50
views
my C# code to create new password isn't working [duplicate]
I'm trying to make a code that create a password that's longer than 8 and contains at least one symbol, but when I run that code It keep looping in the symbols condition even if the password contains ...
0
votes
0
answers
58
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 ...
1
vote
1
answer
424
views
bool and boolean Dtype in Pandas
What is the rationale between bool and boolean Dtype in Pandas?
import pandas as pd
import numpy as np
df1 = pd.DataFrame({'col1': [True, False, False]}, dtype='bool')
print(df1)
print(df1.info())
...
-1
votes
3
answers
131
views
How do I fix my closed form mathematical formula that returns 0 or 1 only whether or not theformula is true or false? [closed]
I need help with my mathematical formula in python. I want to fix it because it's returning -1 for some values and it's not properly returning 0 and 1 when n is the right number.
All I'm trying to do ...
0
votes
1
answer
96
views
Why can the $state rune not handle a boolean condition ($effect needed)
I am a bit confused as to why the $state rune cannot handle a boolean condition. Why is that something that requires a separate rune, in this case $effect? In the Svelte documentation, they put an ...
2
votes
2
answers
83
views
How does JavaScript evaluate this boolean conversion to arrive at the expected output?
const toBool = [() => true, () => false]
The above line is used in this MDN guide to (seemingly) evaluate the output from Node's fs.promises.access method as a boolean.
The snippet in question ...
1
vote
1
answer
44
views
Why Typescript infers specific type, while logically it should be different type [duplicate]
Let's assume that we have following definition of Equal type:
type Equal<X, Y> = (X extends Y ? (Y extends X ? true : false) : false);
Using that definition, we can create other types:
type ...
0
votes
2
answers
43
views
Global matrix doesn't return the right value when read
I'm trying to make a game of life in java using a matrix of booleans, but when i try to read all the neighboors of one one point the return of the position nearby is always false for some reason... ...
0
votes
0
answers
82
views
Why is performing boolean faster on int as compared to bool [duplicate]
Consider the following code:
class Solution {
public:
bool canPartition(vector<int>& nums) {
int n = nums.size();
int sum = 0;
for (const auto &x: nums) sum +=...
0
votes
1
answer
67
views
How do i make an onTap toggle Icon to switch between two 'username' and 'Anonymous on Flutter?
I am making a Charity App project, and I am struggling to figure out how to have an anonymous button before someone submits their donation. I want the anonymous option to display before someone ...
0
votes
1
answer
82
views
Liquibase DATABASECHANGELOGLOCK.LOCKED column data type
After trying to migrate my database from Oracle to Postgres Liquibase has problems setting the lock because the LOCKED column got converted from NUMBER(1) to int4 and the update statement is using ...
0
votes
0
answers
58
views
Referencing another function and weird booleans in javascript for rpgmaker MZ
I'm learning Javascript by using it in the context I want it for, rpg maker MZ, to slightly override it's error handling. It would essentially tell the engine to more or less skip playing the missing ...
2
votes
3
answers
257
views
How to prevent the SPLIT function from converting text to non-text in Google Sheets
I have a comma-delimited list of words in a single spreadsheet cell, such as this:
hello, True, Franklin, true, goodbye
The SPLIT() function extracts each word into its own cell.
Except that it ...
0
votes
1
answer
104
views
How to change a bool from true to false using an if statement that has user input as its condition?
Header file:
#include <iostream>
#include <string>
std::string correctText = "\nCorrect! +";
std::string incorrectText = "False!\n";
std::string answer = "paris&...
0
votes
1
answer
56
views
init 1D numpy array with boolean mask and a smaller array containing nonzero values
Problem
I have valid_data (1D np.array with nonzero values) and mask (boolean 1D np.array), which are not of the same size. The mask contains the wanted positions of the valid_data in a new np.array ...
1
vote
1
answer
99
views
why is (2>3 == False) False and ((2>3) == False) True [duplicate]
I tried
print (2>3 == False)
with result
False
and
print ((2>3) == False)
with result
True
precedence is equal. so evaluate from left to right , assignment from right to left.
maybe it's a ...
1
vote
1
answer
238
views
Is pd.get_dummies() updated in newer versions of Pandas making it default to Booleans (True/False) instead of (0/1)? [duplicate]
I could've sworn df = pd.get_dummies(df, columns=categorical_cols) used to output binary values (0 and 1). It even says it when I hover over get_dummies.
Buy why my output Boolean (True/False)?
Here ...
0
votes
2
answers
71
views
VBA Triggering IF-Statement containing Left()
I'm trying to dynamically concat 2 cells together under particular circumstances and I'm having trouble getting any of my formula changes to trigger. If column A reads "Yes" and the ...
0
votes
0
answers
85
views
Handling MySQL BIT Data Type in Knex: Conversion from Buffer to Boolean
i am using knex db with mysql in wappler low code software and i have a column in my table and column name is is_active and it have bit datatype ig it means boolean right ?
so when i use select query ...
0
votes
1
answer
52
views
jq select condition with nested field
I have the following json string below which I would like to select the proxied field.
I've used:
.result[] | select(.proxied=="false") but that results in "no output"
It seems to ...
0
votes
1
answer
69
views
Callback in python ctypes
I'm trying to wrap a C library in Python using ctypes. A function call requires a callback function which I implemented using the programming manual.The problem is that I'm unable get the return value ...
0
votes
1
answer
43
views
Python -I am adding to list as long as sum of list is less than 17. the while loop works except when sum is between 12 & 16. I dont know why
I am writing a simple version of the Black Jack app. Everything works to the point where I check if computer/dealer has <=16. Here is an image of it working:
enter image description here
Once the ...
5
votes
2
answers
331
views
Is there a way to find all occurences of std::vector<bool> in my code?
I manage a big complex code with a lot of template classes.
I would like to forbid usage of std::vector<bool> in the code (because this is a recurrent and painful cause of compilation problems). ...
0
votes
2
answers
65
views
How can I use a button name to change a boolean value in the script?
Little disclaimer: I haven't posted on here before so please let me know if I'm missing any vital information
I'm making an order taking system for a game in Unity. This system has several size ...
0
votes
1
answer
752
views
Conditional rendering based on a boolean value in React JS
I'm working with a JavaScript object and I'm trying to render a button based on a boolean value, but I'm running into an issue. Here's a snippet of my code:
const toy_material = toy.material.allow; // ...
1
vote
2
answers
82
views
Tkinter - How to check a buttons' state; repeat for multiple buttons, and total the results?
I have made a digital version of a pen-and-paper game as my first major python practice project. You can see from the attached picture that the main board consists of buttons. They can be toggled ...