logic

In C#, (and feel free to answer for other languages), what order does the runtime evaluate a logic statement?
Example:
DataTable myDt = new DataTable();
if (myDt != null && myDt.Rows.Count > 0)
{
//do some stuff with myDt
}
Which statement does the runtime evaluate first -
myDt != null
or:
myDt.Rows.Count > 0
?
Is there a...

If I have a variable in C# that needs to be checked to determine if it is equal to one of a set of variables, what is the best way to do this?
I'm not looking for a solution that stores the set in an array. I'm more curious to see if there is a solution that uses boolean logic in some way to get the answer.
I know I could do something ...

What is the best way to teach someone how to program, the language doesn't matter.
It's more of a case of how to make them think logical and clearly on how to over come a problem. Or is this something that comes naturally to most developers and can't be taught.
Any online resources or book recommendations appreciated.
...

I need to implement a 4-to-1 function in Veriog. The input is 4 bits, a number from 0-15. The output is a single bit, 0 or 1. Each input gives a different output and the mapping from inputs to outputs is known, but the inputs and outputs themselves are not. I want vcs to successfully optimizing the code and also have it be as short/n...

We all know the various ways of testing OO systems. However, it looks like I'll be going to do a project where I'll be dealing with PLC ladder logic (don't ask :/), and I was wondering if there's a good way of testing the validity of the system.
The only way I see so far is simply constructing a huge table with all known states of the s...

To elaborate ..
a) A table (BIGTABLE) has a capacity to hold a million rows with a primary Key as the ID. (random and unique)
b) What algorithm can be used to arrive at an ID that has not been used so far. This number will be used to insert another row into table BIGTABLE.
Updated the question with more details..
C) This table already h...

What's the best way to create recurring tasks?
Should I create some special syntax and parse it, kind of similar to Cronjobs on Linux or should I much rather just use a cronjob that runs every hour to create more of those recurring tasks with no end?
Keep in mind, that you can have endless recurring tasks and tasks with an enddate.
...

I refer specifically to predicate logic, somewhat as implemented in PROLOG, but less strictly bound to first-order logic.
PROLOG-techniques offers powerful solutions towards data-analysis, data-mining, problem-solving, etc., but PROLOG's reputation as an exotic toy for AI, expert-systems and research seems to prevent the application of ...

I'm currently writing a simple .sh script to parse an Exim log file for strings matching " o' ". Currently, when viewing output.txt, all that is there is a 0 printed on every line(606 lines). I'm guessing my logic is wrong, as awk does not throw any errors.
Here is my code(updated for concatenation and counter issues). Edit: I've adopte...

Wondering if it would ever be useful to index every possible state of an application using some reference keys...
Meaning, say we have a program that starts, has only so many possible outcomes, say 8.
but if each outcome is attained through stepping through many more logic states, and in between each branch is considered to be a state ...

I'm using DB2, although a solution using any flavor of SQL would likely be easy enough for me to convert.
I didn't design this database, or the application that uses the database. I haven't the power to change this application, how it works, or the data. Because it defies what I consider to be conventional use of a start and an end da...

Hi,
Does anyone know of a good .NET library rules library (ideally open-source)? I need something that can do nested logic expressions, e.g., (A AND B) AND (B OR C OR D). I need to do comparisons of object properties, e.g., A.P1 AND B.P1. (Ideally, I could compare any property -- A.P1 AND B.P2).
It should store the rules in a data...

i know this doesnt work but i dont know why, also how can i make it work?
<% int result = referer.indexOf("smlMoverDetail.do"); %>
<% if (result == -1){%>
<%out.print("checking");%>
<bean:define id="JOININGDATE" name="smlMoverDetailForm"
property="empFDJoiningDate" type="java.lang.String" toScope="session"/>
<%}%>
Please pleas...

Why doesn't the code below work? The idea is that the page checks to see if the dropdown variable has changes since you last refreshed the page.
<logic:equal name="Result" value = "-1">
<bean:define id="JOININGDATE" name="smlMoverDetailForm" property="empFDJoiningDate"
type="java.lang.String" toScope = "session" />
</logic...

By Logic Programming I mean the a sub-paradigm of declarative programming languages. Don't confuse this question with "What problems can you solve with if-then-else?"
A language like Prolog is very fascinating, and it's worth learning for the sake of learning, but I have to wonder what class of real-world problems is best expressed and...

I am new to programming, and am wondering if there is a correct way to order your control structure logic.
It seems more natural to check for the most likely case first, but I have the feeling that some control structures won't work unless they check everything that's false to arrive at something that's true (logical deduction?)
It wou...

I am trying to design a 4-bit adder subtracter in verilog. This is only the second thing I have ever written in verilog, and I don't know all the correct syntax yet. This is the module I have so far:
module Question3(carryin, X, Y, Z, S, carryout, overflow);
parameter n = 4;
input carryin, Z;
input [n-1:0]X, Y;
output re...

I were reading about parsers and parser generators when I hit upon this statement in wikipedia's LR parsing -page:
"Many programming languages can be parsed using some variation of an LR parser. One notable exception is C++."
Why is it so? What particular property in C++ causes it to be impossible to parse with LR parsers?
I first tri...

I have essentially a survey that is shown, and people answer questions a lot like a test,
and there are different paths, it is pretty easy so far, but i wanted to make it more dynamic, so that i can have a generic rule that is for the test with all the paths, to make the evaluator easier to work with currently i just allow AND's, and ea...