This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Projection(source: Pipe, transformers: List[(Map[String, Any]) => (Map[String, Any])]) extends Traversable[Map[String, Any]] { | |
def foreach[U](f: (Map[String, Any]) => U) { | |
source.foreach((m) => { | |
transformers.map((transformer) => transformer.apply(m)).reduceLeft(_ ++ _) | |
}) | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package org.neo4j.lab.cypher | |
import commands.Query | |
import util.parsing.combinator.JavaTokenParsers | |
import org.junit.Assert._ | |
import org.junit.Test | |
class ParserTest { | |
@Test def lowerCaseWorks() { | |
val parser = new TestParser |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Context initialization failed | |
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.security.authentication.ProviderManager#0': Cannot create inner bean '(inner bean)' of type [org.springframework.security.config.authentication.AuthenticationManagerFactoryBean] while setting bean property 'parent'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name '(inner bean)#4': FactoryBean threw exception on object creation; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.security.authenticationManager': Cannot resolve reference to bean 'org.springframework.security.authentication.dao.DaoAuthenticationProvider#0' while setting bean property 'providers' with key [0]; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.security.authentication.dao.DaoAuthenticati |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import org.junit.Test | |
import util.parsing.combinator.JavaTokenParsers | |
class ParserTest extends JavaTokenParsers { | |
@Test def aorb() { | |
val json = """{ "address book": John }""" | |
val r = parse(json) | |
println(r) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def term: Parser[Expression] = factor ~ rep("*" ~ factor | "/" ~ factor) ^^ { | |
case head ~ rest => { | |
var result = head | |
rest.foreach { | |
case "*" ~ f => result = Multiply(result,f) | |
case "/" ~ f => result = Divide(result,f) | |
} | |
result | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ata@iMac-3$ (git::master) mvn -version | |
Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=2048m; support was removed in 8.0 | |
Apache Maven 3.0.5 (r01de14724cdef164cd33c7c8c2fe155faf9602da; 2013-02-19 14:51:28+0100) | |
Maven home: /usr/local/Cellar/maven/3.0.5/libexec | |
Java version: 1.8.0-ea, vendor: Oracle Corporation | |
Java home: /Library/Java/JavaVirtualMachines/jdk1.8.0.jdk/Contents/Home/jre | |
Default locale: en_US, platform encoding: UTF-8 | |
OS name: "mac os x", version: "10.8.4", arch: "x86_64", family: "mac" | |
~/dev/neo/cqsgraph | |
ata@iMac-3$ (git::master) mvn clean package |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
= Fractal graphs | |
:author: Andrés Taylor | |
:twitter: @andres_taylor | |
//setup | |
//hide | |
[source,cypher] | |
---- | |
CREATE () |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
= Merge Examples = | |
:neo4j-version: 2.0.0-RC1 | |
:author: Andrés Taylor | |
:twitter: @andres_taylor | |
:tags: domain:example | |
//setup | |
[source,cypher] | |
---- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Test def test_rewrite() { | |
trait Exp | |
case class Add(a: Exp, b: Exp) extends Exp | |
case class Sub(a: Exp, b: Exp) extends Exp | |
case class Var(name: String) extends Exp | |
case class Num(x: Int) extends Exp | |
val add = Add(Add(Num(1), Num(2)), Num(3)) | |
def rewrite[T <: Exp with Product](ast: Exp with Product)(rewriter: PartialFunction[Exp, Exp]): Exp = { |
OlderNewer