Questions tagged [boolean]

A Boolean data type is a data type with only two possible values: true or false.

The Boolean data type represents the simple True or False values of Boolean algebra.

Though one bit is all that is necessary to store a boolean (the 1 = true, 0 = false), it is often advantageous (if unintuitively so) to use larger amounts of memory.

Some programming languages actually define a three-valued logic within their Boolean type.

In , the Boolean class is java.lang.Boolean, the object version of primitive type boolean, and questions may be related to either. Note that the java.lang.Boolean fields may hold null as well, as it's an Object.

11685 questions
4
votes
3 answers

Getting index of first occurrence in each row

I have this array full of Boolean values: array([[[ True, True, False, False, False, False], [ True, False, False, False, False, False]], [[False, False, True, False, True, False], [ True, False, False, False, False,…
user1938027
  • 135
  • 7
4
votes
3 answers

How to use "override string ToString()" method twice in a class

I have use to this method for the two properties defined in my class. The properties are public bool HasImage { get; set; } public DateTimeOffset? StartDate { get; set; } public override string ToString() { string value = ""; if…
GANI
  • 2,013
  • 4
  • 35
  • 69
4
votes
1 answer

Can ANY check for IS NOT NULL for an Array in PostgreSQL?

I have a query like this to group by one column and check if any of the records have data in a different column: SELECT bar, MAX(CASE WHEN baz IS NOT NULL THEN 1 ELSE 0 END)::BOOLEAN as baz_has_data FROM foos GROUP BY bar I feel like that's…
user1454117
4
votes
6 answers

What is the best approach to assign the visibility for multiple controls

OK so i'm trying to clean up my code because it is a mess and what i have is 25 richtext boxes and i want to put their .Visible variable into an array and have a for statement go through and make each false so that the text box doesn't show up what…
user3448117
  • 85
  • 1
  • 6
4
votes
2 answers

Javascript Boolean.prototype.toString() unexpected results

Working through Mozilla's Javascript Reference using my browser console. Looking at Boolean objects. I've come across an unexpected behaviour with the following method: Boolean.prototype.toString() Returns a string of either "true" or "false"…
Tony Cronin
  • 1,623
  • 1
  • 24
  • 30
4
votes
2 answers

Javascript: Concat boolean functions

I want to write a method which filters data for multiple criteria. These criteria should by passed as functions to the filter-function, for example: var products = [/* some data */]; function filterMyProducts(criteria) { return products.filter(/*…
user2033412
  • 1,950
  • 2
  • 27
  • 47
4
votes
2 answers

Boolean variable gets returned as an Object[]

I have a function which is returning a boolean variable function test ($param1, $param2) { [boolean]$match=$false; <# function logic #> return $match } when I try and catch the function call in a variable $retByFunct=testing $param1 $param…
user3325210
  • 163
  • 3
  • 12
4
votes
7 answers

C# If Equals Case insensitive

The following code will open up a Message Box containing the word "Fail". Is there a way to make the if statement case insensitive, so that the if statement passes and opens a mbox containg "Pass" without converting the character/string to…
user2953063
  • 437
  • 2
  • 6
  • 10
4
votes
4 answers

why is this array to 2d array boolean true?

Hi I happen to come across a code that my friend sent me, and am having trouble making out the second part of the print statement.. a[3] is 4, which is in row 0 column 2 (b[0][2]), but why is a[2] which is 53, proving true to b[2][1] == 43 ??? (The…
Leonne
  • 85
  • 3
  • 10
4
votes
3 answers

Making truthtables in python

I'm having some trouble doing some homework related to making truthtables in Python. I've tried going to Office Hours, but they don't know anything so I gotta ask you guys. Here's the question: -- In this problem, you will implement functions for…
Aleksander
  • 2,735
  • 5
  • 34
  • 57
4
votes
1 answer

How to style KendoUi Grid with boolean filter

Grid filter works as it should with any column. The only issue I've with styling Boolean data type column (see img). Any Idea what may be missing? editable: true, columns: [ { field: "kid", title: "OEM", type: "string"…
odesuk
  • 1,197
  • 1
  • 12
  • 10
4
votes
3 answers

Synthesize a BOOL to set value in Objective C

I have created a BOOL attribute in my Core Data entity called "useSystem". Additionally in order for me to get/set the data I have created an object, however whenever I try to set the synthesized BOOL I get a bus error. This is my code: @property…
mootymoots
  • 4,545
  • 9
  • 46
  • 74
4
votes
4 answers

How to insert bool into database

I have to add user data into database table named "employees". It has ID, Name, LastName,UserName, Password, E-mail, address, administrator_rights options. Administator_rigts is bool option (yes or no). How do i do that, when i make a form that has…
fkr
  • 155
  • 3
  • 9
  • 21
4
votes
4 answers

is Convert.toInt32(boolean) the only way in c# to do this?

I have some code in c# which needs to increment a number by 1 if a certain boolean value is true, but else it needs to say the same. The only method i've found using the Immediate window in VS 2012 is by + Convert.ToInt32(boolean). Am I missing…
Nzall
  • 3,439
  • 5
  • 29
  • 59
4
votes
2 answers

can we create a normal vector using custom allocator?

I recently had to write a bunch of nasty std::enable_if specializations to correctly deal with vector for what would have otherwise been a nice and clean design. There is some talk to remove the current vector that should have never…
1 2 3
99
100