Skip to content

Instantly share code, notes, and snippets.

@ansell
ansell / gist:1141550
Created August 12, 2011 06:06
Maven: Compiling and installing test jar without running them
mvn -DskipTests test-compile jar:test-jar install
the similar command below, will not compile or package the jar file (if you are using the surefire plugin) so, don't use it if you want to distribute the test jar file without running the tests
mvn -Dmaven.test.skip test-compile jar:test-jar install
@ansell
ansell / gist:1141581
Created August 12, 2011 06:36
Restlet web.xml skeleton
<!-- Application class name -->
<context-param>
<param-name>org.restlet.application</param-name>
<param-value>
mypackage.WebSiteApplication
</param-value>
</context-param>
<!-- Restlet adapter -->
<servlet>
@ansell
ansell / gist:1167214
Created August 24, 2011 03:03
Tasks to add dynamic service support in queryall
1. Create class QueryTypeEnum extends QueryAllEnum
2. Create interface QueryTypeParser extends QueryAllParser<QueryType>
3. Create interface QueryTypeFactory extends QueryAllFactory<QueryTypeEnum, QueryTypeParser, QueryType>
4. Create class QueryTypeRegistry extends AbstractServiceLoader<QueryTypeEnum, QueryTypeFactory>
private static class CompositeClassLoader extends ClassLoader {
private Vector<ClassLoader> classLoaders = new Vector<ClassLoader>();
@Override
public URL getResource(String name) {
for (ClassLoader cl : classLoaders) {
URL resource = cl.getResource(name);
import org.restlet.Context;
import org.restlet.Request;
import org.restlet.Response;
import org.restlet.data.Reference;
import org.restlet.resource.Directory;
public class ClassLoaderDirectory extends Directory {
private ClassLoader _cl;
michaels-imac:stardog-1.2.1 mhgrove$ ./stardog-admin db drop -n testRulesDB
Successfully deleted database 'testRulesDB'.
michaels-imac:stardog-1.2.1 mhgrove$ ./stardog-admin db create -n testRulesDB
Successfully created database 'testRulesDB'.
michaels-imac:stardog-1.2.1 mhgrove$ ./stardog data add -u admin -p admin testRulesDB ~/Downloads/rules.ttl
Adding data from file: /Users/mhgrove/Downloads/rules.ttl
Added 42 RDF triples.
@ansell
ansell / SES-1803-TestResults.txt
Last active December 21, 2015 18:39
SES-1803 Test Results
Results :
Failed tests:
NativeCascadeValueExceptionTest>CascadeValueExceptionTest.testValueExceptionEqual:61 null
NativeSPARQLQueryTest>SPARQLQueryTest.runTest:221->SPARQLQueryTest.compareTupleQueryResults:380
============ open-eq-12 =======================
Unexpected bindings:
[v1="xyz"^^<http://www.w3.org/2001/XMLSchema#string>;y=http://example/x2;v2="xyz"@en;x=http://example/x1]
[v1="xyz"^^<http://www.w3.org/2001/XMLSchema#string>;y=http://example/x3;v2="xyz"@en;x=http://example/x1]
[v1="xyz"@en;y=http://example/x1;v2="xyz"^^<http://www.w3.org/2001/XMLSchema#string>;x=http://example/x2]
@ansell
ansell / repositorymanagement.rj
Created March 25, 2014 04:40
Repository management graph created by PODD due to different ontologies selected by different users
{
"urn:podd:repository:3efbe347-408b-4476-ad06-e8dec8eb368e" : {
"http://purl.org/podd/ns/repository#containsSchemaIRI" : [ {
"value" : "http://purl.org/podd/ns/dcTerms",
"type" : "uri"
}, {
"value" : "http://purl.org/podd/ns/foaf",
"type" : "uri"
}, {
"value" : "http://purl.org/podd/ns/poddBase",
import org.junit.Before;
import org.junit.Test;
import sun.misc.Unsafe;
import sun.reflect.ReflectionFactory;
import java.lang.reflect.Constructor;
import java.lang.reflect.Field;
import java.lang.reflect.Modifier;
import static org.junit.Assert.assertEquals;
@ansell
ansell / CSVAggregator.java
Last active August 29, 2015 14:04
Aggregation of CSV rows using Java-8 functions
/**
* Finds a unique result in the given file, based on examining rows from the CSV and comparing
* them sequentially down the file using the given value aggregator function.
*
* @param <T>
* The type of the value that is being compared.
* @param <R>
* The type of the value that is being returned as the aggregation.
* @param nextFile
* The file to check