This file contains hidden or 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
// Java interface | |
interface ITextConverter { | |
public void nodesToText(List<? extends Object> nodes); | |
} | |
// Scala implementation | |
new ITextConverter { | |
override def nodesToText[T <: Object](nodes: java.util.List[T]) { ... } // Error: Does not override anything. | |
} |
This file contains hidden or 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
sealed trait Response[+T] | |
object Response { | |
case class Failure(error: String) extends Response[Nothing] | |
case class Success[+T](value: T) extends Response[T] | |
} | |
object Picklers { | |
import Response._ | |
import upickle.Js | |
import upickle.Aliases._ |
This file contains hidden or 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 main(args: Array[String]) { | |
sealed trait Type | |
object Type { | |
case object A extends Type | |
case object B extends Type | |
} | |
upickle.read[Type]("") | |
} |
This file contains hidden or 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 main(args: Array[String]) { | |
sealed trait Base | |
case object Child extends Base | |
case class Wrapper(t: Base) | |
val x = upickle.read[Wrapper](null) | |
} | |
// Main.scala:23: uPickle does not know how to read [Wrapper]s; define an implicit Reader[Wrapper] to teach it how |
This file contains hidden or 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
trait A[T] { def print(t: T) } | |
trait B[T] { def ret: T } | |
case class Wrapper[T](a: A[T], b: B[T]) | |
val wrapper = Wrapper[String](null, null) | |
wrapper.a.print(wrapper.b.ret) /* Compiles */ | |
val anyWrapper = wrapper.asInstanceOf[Wrapper[_]] | |
anyWrapper.a.print(wrapper.b.ret) /* Does not compile */ |
This file contains hidden or 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
> publishSigned | |
[info] Packaging /Users/tim/dev/widok/target/scala-2.10/root_2.10-0.1-SNAPSHOT-sources.jar ... | |
[info] Updating {file:/Users/tim/dev/widok/}root... | |
[info] Done packaging. | |
[info] Wrote /Users/tim/dev/widok/js/target/scala-2.11/widok_sjs0.6_2.11-0.2.0-SNAPSHOT.pom | |
[info] Wrote /Users/tim/dev/widok/jvm/target/scala-2.11/widok_2.11-0.2.0-SNAPSHOT.pom | |
[info] Wrote /Users/tim/dev/widok/target/scala-2.10/root_2.10-0.1-SNAPSHOT.pom | |
[info] Resolving org.fusesource.jansi#jansi;1.4 ... | |
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder". | |
SLF4J: Defaulting to no-operation (NOP) logger implementation |
This file contains hidden or 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
[Background] | |
Color=40,40,40 | |
[BackgroundIntense] | |
Color=40,40,40 | |
[Color0] | |
Color=73,72,62 | |
[Color0Intense] |
This file contains hidden or 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
> run -i 2 -wi 2 -f 0 | |
SR v1.1.0, Slick v3.0.0 | |
[info] Benchmark Mode Cnt Score Error Units | |
[info] Test.slickDelete thrpt 2 0,008 ops/ms | |
[info] Test.slickInsertBatch thrpt 2 0,086 ops/ms | |
[info] Test.slickInsertSeparate thrpt 2 0,056 ops/ms | |
[info] Test.slickQuery thrpt 2 0,009 ops/ms | |
[info] Test.slickUpdate thrpt 2 0,010 ops/ms | |
[info] Test.srDelete thrpt 2 2,460 ops/ms |
This file contains hidden or 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 com.badlogic.gdx.ApplicationAdapter; | |
import com.badlogic.gdx.Gdx; | |
import com.badlogic.gdx.backends.lwjgl3.Lwjgl3Application; | |
import com.badlogic.gdx.backends.lwjgl3.Lwjgl3ApplicationConfiguration; | |
import com.badlogic.gdx.graphics.Color; | |
import com.badlogic.gdx.graphics.g2d.BitmapFont; | |
import com.badlogic.gdx.scenes.scene2d.Stage; | |
import com.badlogic.gdx.scenes.scene2d.ui.Label; | |
import com.badlogic.gdx.graphics.g2d.Batch; |
OlderNewer