Skip to content

Instantly share code, notes, and snippets.

View tarilabs's full-sized avatar
🎹
Your fingers hit the keys, your heart develop the code (semi cit.)

Matteo Mortari tarilabs

🎹
Your fingers hit the keys, your heart develop the code (semi cit.)
View GitHub Profile
@tarilabs
tarilabs / gist:7af2ac16f560517d59bc45c0032a7a9f
Created August 3, 2016 08:54
concurrent creation of kiecontainer check
@Test
public void testMATTEO() throws InterruptedException {
ReleaseId releaseId = ks.newReleaseId("org.kie", "test-delete", "1.0.0");
createAndDeployJar( ks, releaseId, createDRL("ruleA") );
ExecutorService es = Executors.newFixedThreadPool(10);
List<Callable<Boolean>> list = new ArrayList<Callable<Boolean>>();
for (int i = 0; i < 6; i++) {
list.add(new Callable<Boolean>() {
@Override
public void testMatteo() {
ParserConfiguration conf = new ParserConfiguration();
boolean doImportNameMethod = true;
if (doImportNameMethod) {
Class<?> clazz = CoreConfidenceTests.class;
Method nameMethod = null;
for (Method m : clazz.getMethods()) {
if (m.getName() == "name") {
nameMethod = m;
}
@Test
public void testMacOSXClassLoaderBehavior() throws Exception {
final ClassTypeResolver resolver = new ClassTypeResolver( new HashSet(), Thread.currentThread().getContextClassLoader() );
resolver.addImport("org.drools.core.test.model.*");
assertEquals( org.drools.core.test.model.Cheese.class,
resolver.resolveType( "Cheese" ) );
try {
resolver.resolveType( "cheese" ); // <<- on Mac/OSX throws NoClassDefFoundError which escapes the try/catch and fail the test.
@tarilabs
tarilabs / gist:9511107
Created March 12, 2014 16:48
memo iOS AddressBook SQLite extract numbers and stuff
SELECT * from ABPerson join ABMultiValue on ABPerson.ROWID = ABMultiValue.record_id where ABPerson.First LIKE '%name%'
@tarilabs
tarilabs / gist:2654859
Created May 10, 2012 18:19
Open PowerPoint file directly in SlideShow mode, cycle between SlideShows for the PowerPoint files found in the directory; useful for kiosks/totems information display (reminder: Advanced settings in PowerPoint, disable "End with black slide")
@echo off
REM this batch to be placed in the same directory as the PowerPoint files
REM this batch requires for powerpnt.exe to be in the PATH Environment variables
echo @ECHO OFF > loop.bat
for %%A in (*.ppt*) DO echo powerpnt.exe /s "%%A" >> loop.bat
echo loop.bat >> loop.bat
loop.bat
@tarilabs
tarilabs / gist:2595655
Created May 4, 2012 15:49
Undecorated, alwaysOnTop, centered PROCESSING.ORG Frame (tested on 1.5.1)
boolean drawOnce;
int w = 640;
int h = 480;
void setup() {
drawOnce = true;
frame.removeNotify();
frame.setUndecorated(true);
frame.setAlwaysOnTop(true);
frame.addNotify();