Questions tagged [rules-and-constraints]
The rules-and-constraints tag has no summary.
41 questions
3
votes
1
answer
128
views
Constraint to enforce pairwise distinctness of values in two columns in table
I'm kind of stumped by a seemingly simple problem in Db design, but the more I think about about it, the more it twists my mind.
Let's say I have columns C1 and C2 in a table. How do I enforce that ...
-1
votes
1
answer
115
views
Rules (calculated field) engine
I have a fun problem ahead of me.
So, I have built a solution for my company that basically handles unstructured information. It works like this:
A user creates a Task, the Task is in reality just a ...
2
votes
4
answers
307
views
Is it a bad practice to query remote resources inside validation?
Watching this talk about Symfony Forms and validation, at 23:06, I got stuck with a doubt
I couldn't find a satisfying answer to:
Is it a bad practice to execute a query (or a web request, or a side ...
0
votes
2
answers
553
views
2 way multiplicity constraints in code
my goal is to convert this class diagram into Java code.
How should I approach this, given that I want the constraints to hold at all times? It creates a chicken-egg problem where the first Course or ...
0
votes
0
answers
78
views
Should a new access control mechanism use a precedence-based or an order-based permission system?
Let's say I have users, groups (or "roles") and resources, and I want to manage various permissions on those resources. As far as I can see, there are two main "philosophies" when it comes to ...
1
vote
4
answers
2k
views
Rules engine suggestion for hard coded if-then-else
Reposting question as Previous post on same Topic was not clear.
Currently our financial application receives multiple feeds in csv format from client, there are usually 100k to 5M rows of data. ...
1
vote
1
answer
2k
views
How to solve a Constraint Satisfaction Problem for Scheduling
This presentation describes several algorithms for solving a CSP for scheduling.
Say I have a few processes with some constraints:
a before c
c before b
b after d
c 50% more important than e
give d ...
14
votes
6
answers
5k
views
Forbid calls to arbitrary functions/classes in external code
I've experienced cases where it would be valuable to restrict access to the API of external libraries and frameworks to prevent negative consequences in the system.
For example, in a SharePoint ...
0
votes
1
answer
2k
views
How to design a Rule Engine Validation System to be asynchronous and highly performant!
I am implementing a validation system which has some constraints, there are category of users let's say 30 and for each category there are number of rules. Actually there are 100 different rules.
I ...
55
votes
7
answers
3k
views
What happened to database constraints?
When I review database models for RDBMS, I'm usually surprised to find little to no constraints (aside PK/FK). For instance, percentage is often stored in a column of type int (while tinyint would be ...
0
votes
1
answer
258
views
Validating combinations based on rule sets (or similar mechanism)
Let's say I've got many functions and each function accepts an unordered list (order does not matter). For each function I want to see if this list is valid based on certain rules (a knowledgebase ...
5
votes
2
answers
686
views
Preferred approach to a matching process
I am currently in the process of putting together a matching algorithm. The matching process is as follows:
Query data is used to perform a "lookup" on a set of reference data in order to determine an ...
0
votes
2
answers
85
views
Trouble handling constraints for the input of a method
I'm looking for advice on how to handle constraints on the input of a method. I have a method that only works if the input argument(s) fulfill certain constraints. If the method is called on input ...
7
votes
2
answers
2k
views
Specifying a bi-directional unique constraint on a join table in Postgres [closed]
Problem description
I have a situation where I want to enforce that a relationship can only be defined once and I want to solve it on database (Postgres) level.
The following situation I consider ...
4
votes
3
answers
2k
views
C#/VB struct – how to avoid case with zero default values, which is considered invalid for given structure?
How to implement some constrained .NET struct/structure (let's say LimitedString), where its state with default values (set by CLR to technical defaults, i.e. nulls, zeros, etc.) should be prohibited ...
0
votes
1
answer
184
views
Mapping match-up combinations into an integer
First of all, I want to say I wasn't sure if I should post this here or in math.stackexchange but I think the question is too programming-related to belong to the latter community. Definetly not a SO ...
20
votes
6
answers
3k
views
Is scientific code a different enough realm to ignore common coding standards?
Lately I've been trying to wrap my mind about the following fact.
On one hand, there is a host of coding guidelines and standards for what is considered to be "healthy", "clean", "well-written" and ...
2
votes
2
answers
167
views
From a set of rules, derive the implications? [closed]
I've only just become interested in this domain, so sorry if I'm not using the correct terminologies.
What I want is the following: Say I have a set of rules (or constraints), I want to derive some ...
4
votes
2
answers
490
views
Database constraints for a recursive folders structure
In an application, I have a recursive folder structure (like folders in OS X or Windows file system).
Each folder can contain three kind of things:
Other folders (hence the recursive structure)
...
2
votes
0
answers
473
views
Algorithm to maximize pairwise comparisons using transitive property
I'm looking for some direction on building an algorithm that will maximize the number of pairwise comparisons of objects in a set using transitivity.
To explain in detail:
Suppose there are x ...
26
votes
4
answers
12k
views
Calendar/Planning algorithm
I'm facing a problem I'm not sure how to approach. I have to generate a calendar for employees, each of them having specific work constraints (some personal, some common)
What I'm working with :
I ...
0
votes
1
answer
235
views
How to deal with product owner who refuses to follow UI design rules
We develop Android application. We base on old version of similar application developed in our company. This old application was designed by some noobs which didn't follow UI Android design rules.
...
4
votes
1
answer
739
views
Fixing bad data in a database - redo or incremental
I have pseudo-ownership of a fairly old db (original data from 30 years ago; current design is >15 years old). In my opinion, the schema is pretty broken, and one of the implications of this is that ...
4
votes
0
answers
145
views
Environment that enables variable constraint checking and creation
Currently, I'm working on a system that enables users to add Tag's to available TagTypes on specific pages. For instance, we would have a TagType called "Installer" and the user wants his name ...
0
votes
4
answers
118
views
alerting that an object cannot be deleted (due to constraints)
Assume an application with a rich domain model with many classes (e.g School, Classroom, Teacher, Student, Course, Exam, Submission, ...) linking to each other. Model and links are mapped to the ...
1
vote
1
answer
769
views
Chained ruleset parsing and evaluation code: recommendations?
So I have to write a filtering system, which may apply preprocessed ruleset to data - and trigger some actions defined in the ruleset while continuing its evaluation.
<ruleset name="1">
<...
2
votes
2
answers
2k
views
Is there a download limit to ios apps?
With reference to iOS 7.
I couldn't find any Apple documents with regards to this.
Are we able to download any size of documents and manage them ourselves (within our app say < 100MB)?
Example, we ...
3
votes
1
answer
4k
views
Guidance on Excel VBA resource scheduling algorithm?
This was posted originally at StackOverflow though suggested to post here instead.
I am looking to create an Excel VBA solution that will create a rota/schedule allocating staff to service users ...
16
votes
4
answers
3k
views
Conceptually, how does one make a rules/constraints (not graphics/physics) engine for a game
I want to make a simple game similar to the choose-your-own-adventure books. The player is presented with a narrative text and gets to choose his action from a list of possibilities. This, in turn, ...
2
votes
3
answers
6k
views
How do I convert a list of Requirements into Constraints?
I am trying to prepare my first software design document. I am self-taught and have no formal training in CS. Having done a wee bit of reading up on it beforehand, I have created a list of ...
2
votes
3
answers
248
views
What kind of algorithm could be used to produce an ordering which maximizes # of satisfied 'less than' constraints?
Let's say I have a set of items {e1, e2, ..., en}, and I also have a set of constraints {c1, c2, ..., cm}, with ci := ej appears before ek, for some j and k.
I want to produce an ordering of my items ...
3
votes
0
answers
168
views
Understanding algorithms for numeric constraint solving
As an educational exercise, I am looking to implement a constraint solver from scratch. However, since the field is entirely new to me, I am at a loss of where to begin with background research.
The ...
1
vote
1
answer
244
views
Is there a name for this kind of database constraint? "Functional foreign key"? And is it a good idea?
Say we want to enforce that a table represents a tree. I have found this method for doing so:
create table tree (
id integer[] primary key,
parent integer[] references tree (id),
item text not ...
3
votes
2
answers
189
views
Should I check integrity in my application code or defer to the database? [duplicate]
At work we have a lot of code like this (pseudocode):
response form_submit(string username, string password) {
if ( username == ""
|| username.contains(invalid_chars)
|| password.length &...
6
votes
4
answers
3k
views
Representing a rule in a ruleset
How to represent rules for a rule engine as objects?
A rule would be
if (booleanExpression(input)) then a chain of generic actions" else next rule
...where the generic actions might be e.g. ...
1
vote
1
answer
3k
views
What does value propagation mean?
I am working on an algorithm which calculates intervals for variables in some given constraints. For example there is a function called propagateValues and its description is
Propagate value ranges ...
1
vote
3
answers
3k
views
How do I approach this PHP/MYSQL query?
I have a reservation system that I have coded and my final task is to allow the user to enter a set of dates and then show them all available options.
The reservation table is set up with unit_id, ...
22
votes
4
answers
6k
views
The relation between Business Rules Engines and Constraint Programming languages
If one looks at (perhaps older) manuals of Drools or some other rule engines,
one of the illustrations of their added value is solving puzzles such
as the Miss Manners puzzle (listed in the Drools ...
5
votes
2
answers
1k
views
How to program for constraints/rules
First the background, during interviews in the past, many times I have been asked to design some or other variation of card game as programming puzzle, and I have tried to design it in OO way, but I ...
8
votes
6
answers
6k
views
Highly scalable and dynamic "rule-based" applications?
For a large enterprise app, everyone knows that being able to adjust to change is one of the most important aspects of design. I use a rule-based approach a lot of the time to deal with changing ...
17
votes
6
answers
5k
views
Representing business rules with exceptions
I know it is expensive but (IMO) I believe it is a very good practice. I'm talking about rules like say, you can't save an Invoice if you are not a sales person... so in that case throwing an ...