logic

Looking for simple rules-engine library in .NET [closed]

前提是你 提交于 2019-12-17 17:23:52
问题 As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance. Closed 6 years ago . Does anyone know of a good .NET library rules library (ideally open-source)? I need something that can do nested logic expressions, e

jQuery password strength checker

…衆ロ難τιáo~ 提交于 2019-12-17 15:35:06
问题 I'm quite new to jQuery, and I've written a simple function to check the strength of a password for each keypress. The idea is that every time a user enters a character, the contents is evaluated to test the strengh of the password they have entered... I'm sure everyone has seen these before. Anyhow, the logic I have used is that no password begins with a value of 1. When a lower-case character is used, the score increments to 2. When a digit is used the score increments by 1 again, same for

Total sum from a set (logic)

人走茶凉 提交于 2019-12-17 13:40:12
问题 I have a logic problem for an iOS app but I don't want to solve it using brute-force. I have a set of integers, the values are not unique: [3,4,1,7,1,2,5,6,3,4........] How can I get a subset from it with these 3 conditions: I can only pick a defined amount of values. The sum of the picked elements are equal to a value. The selection must be random, so if there's more than one solution to the value, it will not always return the same. Thanks in advance! 回答1: This is the subset sum problem, it

XSLT Bitwise Logic

一个人想着一个人 提交于 2019-12-17 12:39:34
问题 I have an existing data set that utilizes an integer to store multiple values; the legacy front end did a simple bitwise check (e.g. in C#: iValues & 16 == 16) to see if a particular value was set. Is it possible to do bitwise operations in XSL, and more explicitly, to do bit level comparisons via masking? The built-in "and" will always result in "true" or "false", but perhaps it's possible via the math operators available? I'm currently using .NET 2.0, which uses XSLT 1.0. 回答1: I haven't

XSLT Bitwise Logic

丶灬走出姿态 提交于 2019-12-17 12:38:54
问题 I have an existing data set that utilizes an integer to store multiple values; the legacy front end did a simple bitwise check (e.g. in C#: iValues & 16 == 16) to see if a particular value was set. Is it possible to do bitwise operations in XSL, and more explicitly, to do bit level comparisons via masking? The built-in "and" will always result in "true" or "false", but perhaps it's possible via the math operators available? I'm currently using .NET 2.0, which uses XSLT 1.0. 回答1: I haven't

Cypher Neo4J - CASE Expression with MERGE

天涯浪子 提交于 2019-12-17 12:20:10
问题 I'm trying to implement the logic in Cypher where, based on a particular condition ( CASE Statement), I would create some nodes and relationships; the code is as below MATCH (g:Game)-[:PLAYER]->(u:User)-[r1:AT]->(b1:Block)-[:NEXT]->(b2:Block) WHERE g.game_id='G222' and u.email_id = 'xyz@example.com' and b1.block_id='16' SET r1.status='Skipped', r1.enddate=20141225 WITH u, b2,b1, g, r1 SET b1.test = CASE b2.fork WHEN 'y' THEN MERGE (u)-[r2:STAGE {startdate:20141225, enddate:'99999999', status:

Django edit form based on add form?

允我心安 提交于 2019-12-17 05:34:10
问题 I've made a nice form, and a big complicated 'add' function for handling it. It starts like this... def add(req): if req.method == 'POST': form = ArticleForm(req.POST) if form.is_valid(): article = form.save(commit=False) article.author = req.user # more processing ... Now I don't really want to duplicate all that functionality in the edit() method, so I figured edit could use the exact same template, and maybe just add an id field to the form so the add function knew what it was editing. But

Generating non-repeating random numbers

[亡魂溺海] 提交于 2019-12-17 05:14:20
问题 I want to create a function in C. It will return a random integer in-range of N like:- rand() % N; but the thing is I want to keep track of uniqueness. I don't want the numbers to repeat. but i can also do this by making an array and copying the generated integers in it. like :- array[count] = rand() % N; and check every time if the number generated was already inside it or not. (simply by searching it inside the array[]); this is a simple approach but a correct one. it will take many if's

How to separated zero with point in my bash script? [closed]

扶醉桌前 提交于 2019-12-14 03:37:42
问题 It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 6 years ago . My script echo -n "number 1 : "; read bil1 echo -n "number 2 :"; read bil2 jlh=$(echo $bil1 + $bil2 |bc -l |sed -e 's/^\./0./' -e 's/^-\./-0' -e 's/\.0*$//'); echo " Your result : $bil1 + $bil2 = $jlh"; if I

Truth Table Generation

我与影子孤独终老i 提交于 2019-12-14 03:27:59
问题 Anybody have thoughts on generating a row of a truth table with out creating the entire table. For example, a user would enter in a row number and that truth table row is generated. Also, this should be done without creating the table until you get to that row number. Essentially, I want to know if there is an efficient way to calculate a truth row value only based on a the truth table row as an input. Example: Assume 3 variables printTruthTableRow(3) would produce 010 Actually, could I just