How can you express X of Y are true, in boolean logic? a rule like 2 of the following must be true (A, B, C, D, E, F)
is it a form of multiplcation or set operations?
the end result is all the permutations like AB OR AC OR AD, if you said 3 of following it is like ABC, ABD, ABE, etc.. so it is like (A,B,C)^2?
thanks!
...
Hi
I just uploaded my first ASP.NET (as part of my learning of vb.net) and got into awful mess with the connection pooling (funny things happen when there are more than 1 user of your web site) all sorted now by better use of the try catch statements (well the idea was to learn) BUT I was wondering if this is the best / final method, no...
Hi,
I'm going back to Uni to do an MSc and for one of my target courses I need to know first order logic, inlcuding semantic tableaux and resolution inside out. I don't have an academic background in the subject, so what's a good book, or online course, or online resource to learn this subject? I need clear explanations with lots of que...
You walk into a store, select several products, then go to the counter to pay your bill. The total is some amount (A). You reach into your wallet, purse, or pocket and put down some cash (P), where P >= A, and the cashier gives you change.
Given the set of coins and bills that are in circulation, what are the most likely values for P?
...
So I'm doing this in PHP but it is a logic issue so I'll try to write it as generically as possible.
To start here's how this pagination script works:
for (draw first three pages links)
if (draw ellipsis (...) if there are pages between #1's pages and #3's pages)
for (draw current page and two pages on each side of it links)
if (draw ...
I am working on an If statement and I want to satisfy two conditions to ignore the loop. This seemed easy at first, but now... I don't know. this is my dilemma...
if((radButton1.checked == false)&&(radButton2.checked == false))
{
txtTitle.Text = "go to work";
}
The dilemma is "go to work" is not executed if radButton1 is false a...
Edit: this puzzle is also known as "Einstein's Riddle"
The Who owns the Zebra is an example of a classic set of puzzles and I bet that most people on Stack Overflow can solve it with pen and paper. But what would a programmatic solution look like?
Based on the clues listed below...
There are five houses.
Each house has its own unique...
I am looking for a way of efficiently specifying a recurring job execution time without having to write an explicit execution time to a datastore. In other words, rather than saying 'job x next runs at 13.00pm on 11.12.08' and then having to update the execution time for the following week once the job has run, I want to be able to say '...
What is domain logic? The Wikipedia page for domain logic redirects to business logic. Are they the same thing, and, if not, how do they differ?
...
I'm writing a basic crawler that simply caches pages with PHP.
All it does is use get_file_contents to get contents of a webpage and regex to get all the links out <a href="URL">DESCRIPTION</a> - at the moment it returns:
Array {
[url] => URL
[desc] => DESCRIPTION
}
The problem I'm having is figuring out the logic behind determining wh...
I'm working with a couple of AI algorithms at school and I find people use the words Fuzzy Logic to explain any situation that they can solve with a couple of cases. When I go back to the books I just read about how instead of a state going from On to Off it's a diagonal line and something can be in both states but in different "levels"....
Hey Everyone,
I wanted to run something by you guys. I am starting a new project which is roughly the following:
Important information: I am using PHP and MySQL
Every minute I get a list of to-do transactions from an API from different users.
Example:
user1 send $1 to user2
userx send $2 to usera
userw send $0.50 to user2
etc..
...
How do you get the logical xor of two variables in Python?
For example, I have two variables that I expect to be strings. I want to test that only one of them contains a True value (is not None or the empty string):
str1 = raw_input("Enter string one:")
str2 = raw_input("Enter string two:")
if logical_xor(str1, str2):
print "ok"
el...
So I'm trying to build a script that automagically prepends valid column names with its appropriate table prefix (e.g. "t." or "r.")
$t_columns = array('id', 'name', 'label');
$r_columns = array('related_value');
INPUT:
id > 1 AND (name = 'Hello' OR label IN ('World', 'Planet name AND label')) AND (related_value > 1 AND related_value...
Sorry if this is a comp-sci 101 question. I'm just unsure if I'm missing something obvious.
So let's say some user input throws an error, and I want to catch it and return some feedback. The error will be a number, 0 - 8. 0 means "No Error". I want to give the user very specific feedback if the error is 3 (No numbers allowed, let's say)...
People who are not IT, more specifically programmers, do not have a good way of solving problems. They simply do not think like us, programmers, who have a good logic.
I have been asked too many times what I would recommend them to improve their logic which would eventually help with day-to-day professional problems. Things that come up ...
I posted an answer to another stackoverflow question which requires some digital logic to be implemented in Verilog or VHDL so that it can be programmed into an FPGA.
How would you implement the following logic diagram in Verilog, VHDL, or any other hardware description language?
The numbered boxes represent bits in a field. Each field...
I'm having an issue understanding the MixColumns step described here.
I know about diffusion and it all makes sense up the the point where it states that each column is treated as a polynomial and multiplied modulo over GF(2^8).
BUT..multiplying in GF(2^8). Although the domain is still the same, it is not reversible due to mod.... and ...
I need to shorten this query and while I'm pretty good at SQL, I'm still learning.
SELECT
'doejoh',
DATETIME,
[Recipient-Address], [Message-Subject], [Sender-Address]
FROM
dbo.Logs
WHERE
LEFT([Recipient-Address], 6) IN ('doejoh')
UNION ALL
SELECT
'doejoh',
DATET...
What I am trying to do is save a Move objects into a Vector called topMoves. There will be many Move objects which is why I create the object within the loop.
The pastPriceMap stores prices for stocks at some past time (in this case one minute ago). The currPriceMap stores price for stocks some time within the last second.
I get the fo...