Skip to content

Instantly share code, notes, and snippets.

# find things in a jar
# taken from http://www.unix.com/shell-programming-scripting/21551-jar-file-search.html
find . -name \*jar -print -exec jar -tvf {} \; | nawk '/YOURSEARCHSTRING/ || /jar/ {print} '
@leogomes
leogomes / drools-core results.txt
Created November 12, 2010 17:05
drools-core results
Results :
Failed tests:
Exists node assert/retract test(org.drools.reteoo.test.NodeSuiteTest)
Exists node index test(org.drools.reteoo.test.NodeSuiteTest)
Exists node modify test(org.drools.reteoo.test.NodeSuiteTest)
Join node duplications check(org.drools.reteoo.test.NodeSuiteTest)
assert retract test(org.drools.reteoo.test.NodeSuiteTest)
Not node index test(org.drools.reteoo.test.NodeSuiteTest)
Not node modify test(org.drools.reteoo.test.NodeSuiteTest)
@leogomes
leogomes / waltz_stack.java
Created November 13, 2010 11:26
waltz_stack
Caused by: java.lang.NullPointerException
at org.drools.core.util.RightTupleIndexHashTable.remove(RightTupleIndexHashTable.java:264)
at org.drools.reteoo.JoinNode.modifyRightTuple(JoinNode.java:236)
at org.drools.reteoo.BetaNode.modifyObject(BetaNode.java:316)
at org.drools.reteoo.CompositeObjectSinkAdapter.doPropagateModifyObject(CompositeObjectSinkAdapter.java:464)
at org.drools.reteoo.CompositeObjectSinkAdapter.propagateModifyObject(CompositeObjectSinkAdapter.java:429)
at org.drools.reteoo.ObjectTypeNode.modifyObject(ObjectTypeNode.java:263)
at org.drools.reteoo.EntryPointNode.modifyObject(EntryPointNode.java:172)
at org.drools.common.AbstractWorkingMemory.update(AbstractWorkingMemory.java:1461)
at org.drools.common.AbstractWorkingMemory.update(AbstractWorkingMemory.java:1366)
@leogomes
leogomes / JoinNodeWithCollections.java
Created November 14, 2010 12:59
JoinNodeWithCollections
public LeftTupleCollection assertLeftTuple(final LeftTupleCollection leftTupleCollection,
final PropagationContext context,
final InternalWorkingMemory workingMemory) {
final BetaMemory memory = (BetaMemory) workingMemory.getNodeMemory( this );
boolean useLeftMemory = true;
LeftTuple leftTuple = leftTupleCollection.getInsert();
LeftTuple rootLeftTuple = null;
@leogomes
leogomes / MiscTest.java
Created November 15, 2010 12:31
MiscTest changes
public void testRuleRemovalWithJoinedRootPattern() {
String str = "";
str += "package org.drools \n";
str += "rule rule1 \n";
str += "when \n";
str += " String() \n";
str += " Person() \n";
str += "then \n";
str += "end \n";
@leogomes
leogomes / setting production
Created November 18, 2010 22:56
setting rails to production
$ rake db:migrate RAILS_ENV=”production”
ENV['RAILS_ENV'] ||= 'production'
@leogomes
leogomes / brasouverts_backup.bat
Created November 19, 2010 00:06
Backup Brasouverts
@echo off
echo Creating backup for %DATE%
for /F "tokens=1-4 delims=/ " %%A in ('echo %date%') do (set CDATE=%%B%%C%%D)
mysqldump -u root brasouverts_development > d:\brasouverts\backup\dump_%CDATE%.sql
@leogomes
leogomes / right_memory.java
Created November 23, 2010 15:40
right memory iteration
RightTuple first = new RightTuple(
(InternalFactHandle) expectedFactHandles.get(0));
List<RightTuple> actualRightTuples = new ArrayList<RightTuple>();
for (RightTuple rightTuple = rightMemory.getFirst(first); rightTuple != null; rightTuple = (RightTuple) rightTuple.getNext()) {
actualRightTuples.add(rightTuple);
}
@leogomes
leogomes / RightUnlinking
Created November 23, 2010 21:16
RightUnlinking
TestCase "RightUnlinkingComplex"
/*
* A bit more complex, this test case shows that memories get properly populated
* when there are loops like the one between Join1 and Join2 here.
*/
Setup
Config:
drools.lrUnlinkingEnabled, true;
ObjectTypeNode:
@leogomes
leogomes / NamedEntryException.java
Created November 23, 2010 22:08
Multiple Entry points
org.drools.RuntimeDroolsException: Unexpected exception executing action org.drools.reteoo.ReteooWorkingMemory$WorkingMemoryReteAssertAction@114304e
at org.drools.common.AbstractWorkingMemory.executeQueuedActions(AbstractWorkingMemory.java:1492)
at org.drools.common.NamedEntryPoint.insert(NamedEntryPoint.java:182)
at org.drools.common.NamedEntryPoint.insert(NamedEntryPoint.java:145)
at org.drools.common.NamedEntryPoint.insert(NamedEntryPoint.java:96)
at org.drools.common.NamedEntryPoint.insert(NamedEntryPoint.java:44)
at org.drools.integrationtests.CepEspTest.testIdentityAssertBehaviorOnEntryPoints(CepEspTest.java:1816)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)