fact

drools programmatically generate a fact model

痴心易碎 提交于 2019-12-06 07:49:39
I need to generate an enormous fact model using an ontology external to drools. Now, I could certainly write a script/program to pull this off. My approach would be to generate a java bean for each ontology class which contains the appropriate fields, methods, and references to other java objects based on ontological relationships (probably in a map). My question is whether drools has a more elegant way to approach this problem. I figure it must be a common problem that the fact model is derivable from resource available outside of drools, so I'm wondering if maybe drools(or guvnor) has a

How to model process and status history in a data warehouse?

…衆ロ難τιáo~ 提交于 2019-12-05 15:56:10
Let's say that we have D_PROCESS , D_WORKER and D_STATUS as dimensions, and the fact F_EVENT that links a process (what) with a worker (who's in charge) and the "current" status. The process status changes over time. Shoud we store in F_EVENT one line per process/status/worker, or one line per process/worker, and "somewhere else" one line per status change for a given process/worker? I'm new to Datawarehouse and it's hard to find best practices/tutorial related to data modelization. Read The Data Warehouse Toolkit by Ralph Kimball for a good introduction to dimensional modeling. It sounds like

shell脚本

谁说胖子不能爱 提交于 2019-12-04 10:24:15
1.n的阶乘。 #! # f() { if [ $1 -lt 1 ];then echo 1 else i=$[$1*$(f $[$1-1])] echo $i fi } f 5 2.斐波那契函数。(1,1,2,3,5,8,13,21,34,55....) #!/bin/bash # fact() { if [ $1 -lt 3 ];then echo 1 else i=$[$(fact $[$1-1])+ $(fact $[$1-2])] echo $i fi } fact 8 来源: https://www.cnblogs.com/COO-zsy/p/11589522.html

Ansible date variable

耗尽温柔 提交于 2019-12-04 09:51:25
问题 I'm trying to learn how to use Ansible facts as variables, and I don't get it. When I run... $ ansible localhost -m setup ...it lists all of the facts of my system. I selected one at random to try and use it, ansible_facts.ansible_date_time.date, but I can't figure out HOW to use it. When I run... $ ansible localhost -m setup -a "filter=ansible_date_time" localhost | success >> { "ansible_facts": { "ansible_date_time": { "date": "2015-07-09", "day": "09", "epoch": "1436460014", "hour": "10",

递归函数

允我心安 提交于 2019-12-03 14:07:11
在函数内部,可以调用其他函数。如果一个函数在内部调用自身本身,这个函数就是递归函数。 def fact(n): if n==1: return 1 return n * fact(n - 1) fact(3) 使用递归函数需要注意防止栈溢出 解决递归调用栈溢出的方法是通过尾递归优化 尾递归是指,在函数返回的时候,调用自身本身,并且,return语句不能包含表达式 def fact(n): return fact_iter(n, 1) def fact_iter(num, product): if num == 1: return product return fact_iter(num - 1, num * product) 汉诺塔问题 不太懂 来源: https://www.cnblogs.com/g2thend/p/11798344.html

Ansible date variable

点点圈 提交于 2019-12-03 04:11:58
I'm trying to learn how to use Ansible facts as variables, and I don't get it. When I run... $ ansible localhost -m setup ...it lists all of the facts of my system. I selected one at random to try and use it, ansible_facts.ansible_date_time.date, but I can't figure out HOW to use it. When I run... $ ansible localhost -m setup -a "filter=ansible_date_time" localhost | success >> { "ansible_facts": { "ansible_date_time": { "date": "2015-07-09", "day": "09", "epoch": "1436460014", "hour": "10", "iso8601": "2015-07-09T16:40:14Z", "iso8601_micro": "2015-07-09T16:40:14.795637Z", "minute": "40",

Is it possible to set a fact of an array in Ansible?

匿名 (未验证) 提交于 2019-12-03 02:44:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: Is it possible to set a fact containing an array in ansible using set_fact ? What's the correct syntax for it? 回答1: Indeed it is. You need to quote the entire array though: - name: set fact set_fact: foo="[ 'one', 'two', 'three']" - name: debug debug: msg={{ item }} with_items: foo The above tasks should generate the following output: TASK: [set fact] ************************************************************** ok: [localhost] TASK: [debug] ***************************************************************** ok: [localhost] => (item=one) => {

Using a list from a fact within Prolog rules

梦想与她 提交于 2019-12-02 06:23:00
I am currently writing a rail line program but am having a little trouble using lists that come from facts. I am quite new to Prolog and so far have written the following facts and rules: location(euston, [northernLine]). location(warrenStreet, [victoriaLine, northernLine]). location(warwickAvenue, [bakerlooLine]). location(paddington, [bakerlooLine]). hasCommonLine(Location1, Location2, Line) :- location(Location1, Line), location(Location2, Line). The idea is for the rule to return the name of the line(s) that the two locations have in common. This works if I try hasCommonLine(warwickAvenue

“every class in java extends the MetaClass Object” does it imply that every subclass causes a Diamond issue

╄→尐↘猪︶ㄣ 提交于 2019-11-28 02:26:34
问题 These two facts in java Fact 1 “ Every class in java by default extends the java meta class Object ” and Fact 2 “ Multiple inheritance is not allowed in java ” read more about diamond proble here Java inheritance are quiet confusing Suppose ClassB extends ClassA then according to fact1 ClassB extends Object Does that mean ClassB is extending both ClassA and Object ? Is it a case of multiple inheritance? If it’s not multiple inheritance then how aren't the two statements contradictory? 回答1: