Questions tagged [boolean-logic]

An algebraic system developed by George Boole. Uses operations such as "And", "Or" and "Not" on Binary True/False values. It may be used to accomplish complex tasks.

Boolean logic is a two-element boolean algebra, a formalism that gives algebraic semantics for classical propositional logic.

1775 questions
0
votes
4 answers

Javascript expression: double greater than x and greater than y

So I wondered to myself if there is a way to do a double greater than, like this: if(x > y > z) { ... } Then I saw this Expression for "more than x and less than y"? But then I tried the following expression in the console and got a weird…
Arman Bimatov
  • 1,789
  • 4
  • 24
  • 31
0
votes
2 answers

EXCEPT considering DateTime?

I have a database that tracks the location of widgets (i.e. an inventory system that tracks individual items rather than simply Counts of SKUs). There are two tables concerned: InventoryUpdates ( UpdateId bigint PRIMARY KEY, LocationId…
Dai
  • 141,631
  • 28
  • 261
  • 374
0
votes
1 answer

Shifting left in 2's complement and multiplication

I'm implementing a simple (virtual) ALU and some other chips (adder, multiplier etc.). I'm using the 2's complement representation for my numbers. For multiplication of x and y, two 16-bit numbers, I thought I'd use left shifts along these lines…
Paz
  • 737
  • 7
  • 22
0
votes
1 answer

Build predicates from user input

I have an application server written in java that must use different machine learning models based on the request context. For example my request context looks like class RequestContext { String clientId; String experimentId; …
0
votes
1 answer

Troubles comprehending Boolean Algebra

I am going through my Boolean Algebra book trying do some of the problems and I am looking for some help with regards to one wanting a function simplified using only DeMorgan's relationships and Involution. f(A,B,C,D) = [A + (BCD)']*[(AD)' +…
0
votes
1 answer

Lecture collision boolean expression algorithm

I am trying to write a lecture collision algorithm for a schedule application. Each lecture has a start and end date. currentListElement is the existing lecture in my current schedule, and I want to add chosenLecture, and check if there is a…
Yagiz
  • 1,033
  • 2
  • 21
  • 47
0
votes
2 answers

Can someone explain this line of c# code to me?

In my c# windows store app I have the following line of code to detect if the CTRL key is pressed. I got this code from an online sample, and it works perfectly. var state =…
roryok
  • 9,325
  • 17
  • 71
  • 138
0
votes
1 answer

Computer Architecture - Boolean functions

I'm trying to revise for an exam and i'm rewatching a lecture : http://vvcap.net/db/7r9irWuoU1v_L4_KT-A-.htp I do not understand the slide, although I do know the logic gates/truth tables. This makes no sense to me. So, if someone could explain…
0
votes
3 answers

RegEx in C: Match pattern with a string in the middle

So, I'm trying to minimize boolean expressions using RegEx in C. I would need a regular expresion to match XXX AND XXX, where "XXX" is the same thing on both ends, for example, I need to match: ((p OR q) AND (p OR q)) but not match (p AND (p OR…
Florius
  • 125
  • 1
  • 7
0
votes
1 answer

Converting ACL into flat expression

I want to create ACL-based authorization system for a web application that uses SQL database as storage. My problem is - I want to use the authorization rules defined as ACLs to filter the searches. For this I need to convert the ACLs to flat…
zefciu
  • 1,967
  • 2
  • 17
  • 39
0
votes
0 answers

Manipulating datagridview data using boolean logic (in C#)

I have a databound datagridview. When clicked, a second databound datagridview loads AND the numbers within the columns of this second datagridview are mulptiplied by 60. The problem is that when I click on the first datagridview a second, third etc…
Tatiana Laurent
  • 281
  • 1
  • 4
  • 13
0
votes
1 answer

When applying the operation OR to two numbers in assembly, why do I always get one value regardless?

SYS_EXIT equ 1 SYS_READ equ 3 SYS_WRITE equ 4 STDIN equ 0 STDOUT equ 1 segment .data msg1 db "Enter two digits: ", 0xA,0xD len1 equ $- msg1 msg2 db "Result: ", 0xA,0xD len2 equ $- msg2 segment .bss num1…
swarajd
  • 977
  • 1
  • 10
  • 18
0
votes
0 answers

SQL Server 2012 - HAVING clause evaluate all expressions

recently when we have migrated to SQL Server 2012, we have seen a change in how it evaluate the logical expression in the having clause . I created a simple query that allows you to see the problem : SELECT sum (0) HAVING sum (0) > 0 AND 1/sum (0)>…
0
votes
3 answers

Calculating Perfect Numbers

See, I have a boolean method that gets the divisors that work by moding the number by a divisor that is checked and determined true by a for loop (not the first one, that just loops the program for a determined amount of input. I'm not sure if…
0
votes
2 answers

if statement doesn't seem to ever fail

I have a loop which goes through an image stored in a buffer, grabs 1024 bytes at a time, and sends this kilobyte off as a UDP packet. Below is the relevant section of code. Why doesn't my second if statement, if (buf.bytesused - curr*1024 > 1024)…
WhiteHotLoveTiger
  • 2,088
  • 3
  • 30
  • 41