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
require 'java' | |
require 'libssrckdtree-j-1.0.2.jar' | |
GenericPoint = Java::com.savarese.spatial.GenericPoint | |
KDTree = Java::com.savarese.spatial.KDTree | |
def generate_points(tree, size) | |
size.times do | |
x = rand(100) | |
y = rand(100) |
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 com.wierd | |
import org.openqa.selenium | |
import org.scalatest.selenium.Firefox | |
object FFTest extends Firefox { | |
def main(args: Array[String]): Unit = { | |
webDriver.manage.window.setSize(new selenium.Dimension(1200, 800)) |
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
object Model { | |
trait Mutation[A]{ | |
val doc: A | |
} | |
case class Upsert[A](doc: A) extends Mutation[A] | |
case class Delete[A](doc: A) extends Mutation[A] | |
// Json format |
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
case class ViewRow[K, V, D](id: String, key: K, value: V, doc: Option[D]) | |
def viewRowFormat[K : Format, V : Format, D : Format] = ( | |
(__ \ 'id).format[String] ~ | |
(__ \ 'key).format[K] ~ | |
(__ \ 'value).format[V] ~ | |
(__ \ 'doc).formatNullable[D] | |
).apply(ViewRow.apply, unlift(ViewRow.unapply[K, V, D])) |