Skip to content

Instantly share code, notes, and snippets.

View ahoy-jon's full-sized avatar
🐋
Thinking!

Jonathan Winandy ahoy-jon

🐋
Thinking!
View GitHub Profile
/*
* Copyright (c) 2012 Henry Story (bblfish.net)
* under the MIT licence defined at
* http://www.opensource.org/licenses/mit-license.html
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in the
* Software without restriction, including without limitation the rights to use, copy,
* modify, merge, publish, distribute, sublicense, and/or sell copies of the Software,
* and to permit persons to whom the Software is furnished to do so, subject to the
import akka.dispatch.Future
object Contexts {
type SingleThreaded[X] = X
type Concurrent[X] = Future[X]
}
trait AsyncGraphStore[Rdf <: RDF] extends GenericGraphStore[Rdf,Contexts.Concurrent]
@ahoy-jon
ahoy-jon / build.sbt
Created June 25, 2012 11:07
ScalaTest + sbt
name:= "Sbt+ScalaTest"
libraryDependencies += "org.scalatest" %% "scalatest" % "1.8" % "test"
testOptions in Test += Tests.Argument("-l", "com.mycompany.tags.BadTest")
scalaSource in Test <<= baseDirectory(_ / "test")
import sbt._
import Keys._
import PlayProject._
object ApplicationBuild extends Build {
val appName = "test"
val appVersion = "1.0-SNAPSHOT"
val appDependencies = Seq(
def addNamedGraph(uri: Jena#URI, graph: Jena#Graph): Unit = writeTransaction {
dg.addGraph(uri, graph)
}
def appendToNamedGraph(uri: Jena#URI, graph: Jena#Graph): Unit = writeTransaction {
graph.toIterable foreach { case Triple(s, p, o) =>
dg.add(uri, s, p, o)
}
}
[info] TDBJenaGraphStore:
[info] - getNamedGraph should retrieve the graph added with addNamedGraph
[info] - appendToNamedGraph should be equivalent to graph union
[info] - addNamedGraph should drop the existing graph *** FAILED ***
[info] org.scalatest.TestFailedException was thrown. (GraphStoreTest.scala:65)
[info] - adding a named graph should not pollute the default graph *** FAILED ***
[info] com.hp.hpl.jena.tdb.TDBException: GraphNamedTDB: Null graph name
[info] at com.hp.hpl.jena.tdb.store.GraphNamedTDB.<init>(GraphNamedTDB.java:62)
[info] at com.hp.hpl.jena.tdb.store.DatasetGraphTDB._createNamedGraph(DatasetGraphTDB.java:219)
[info] at com.hp.hpl.jena.sparql.core.DatasetGraphCaching.getGraph(DatasetGraphCaching.java:99)
@ahoy-jon
ahoy-jon / gist:3130763
Created July 17, 2012 17:42
Weird error
[info] Resolving org.scalaz#scalaz-core_2.10.0-M4;7.0-SNAPSHOT ...
[info] Resolving joda-time#joda-time;2.1 ...
[info] Resolving org.joda#joda-convert;1.2 ...
[info] Resolving com.novocode#junit-interface;0.8 ...
[info] Resolving junit#junit;4.8.2 ...
[info] Resolving org.scala-tools.testing#test-interface;0.5 ...
[info] Resolving org.scalatest#scalatest_2.10.0-M2;1.8-SNAPSHOT ...
[info] Done updating.
[info] Compiling 58 Scala sources to /Users/jon/Projects/banana-rdf/rdf/target/scala-2.10.0-M4/classes...
[error] /Users/jon/Projects/banana-rdf/rdf/src/main/scala/util/package.scala:14: not found: type Id
package test
import scalaz._
import Scalaz._
trait Claim[+S] {
protected val statement: S
def verify(implicit fn: S=> Boolean ): Option[S]
@ahoy-jon
ahoy-jon / App.scala
Created August 7, 2012 13:57
Pick your poison
val log = new {def warn(a:Any) {}}
val timeoutWarn = () => log.warn("Actor ask timed-out while calling HttpClient")
def handleTimeouts[A](response : Option[(Int, Option[String])],
trait Page
trait PageData
trait PageOperation {
type P <: Page
}
trait PageComponent {
self: PageOperation =>