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
@Grab(group='org.gparallelizer', module='gparallelizer', version='0.8.4') | |
import org.gparallelizer.Asynchronizer | |
output={msg,i,j-> | |
println "${msg}:${i}:${j}" | |
} | |
echo={msg,i->println"$msg:$i" | |
for(int j=0;j<10;j++){ |
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 sbt._ | |
class BowlerProject(info: ProjectInfo) extends DefaultWebProject(info){ | |
val bowler = "org.bowlerframework" %% "core" % "0.5.1" | |
val slf4jVersion = "1.6.0" | |
val sfl4jnop = "org.slf4j" % "slf4j-nop" % slf4jVersion % "runtime" | |
// allows you to use an embedded/in-JVM jetty-server to run unit-tests. |
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
// Generated from test.mirah | |
public class Test extends java.lang.Object { | |
public static void main(java.lang.String[] argv) { | |
int __xform_tmp_1 = 0; | |
int __xform_tmp_2 = 0; | |
int i = 0; | |
__xform_tmp_1 = 1; | |
__xform_tmp_2 = 5; | |
label1: | |
while ((__xform_tmp_1 <= __xform_tmp_2)) { |
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.karatachi.javassist; | |
import java.io.BufferedInputStream; | |
import java.io.DataInputStream; | |
import java.io.File; | |
import java.io.IOException; | |
import java.util.ArrayList; | |
import java.util.Enumeration; | |
import java.util.List; | |
import java.util.Set; |
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
[0]ozaki@mbp $ scala -Xexperimental [~/sandbox/scala/work][0] | |
Picked up _JAVA_OPTIONS: -Dfile.encoding=UTF-8 | |
Welcome to Scala version 2.9.0.RC1 (Java HotSpot(TM) 64-Bit Server VM, Java 1.6.0_22). | |
Type in expressions to have them evaluated. | |
Type :help for more information. | |
scala> trait DI extends Dynamic { | |
| def applyDynamic(name:String)(args:Any*):Any = println("Hello, %s %s" format( name, args.mkString("[", ", ", "]"))) | |
| } | |
defined trait DI |
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
// Usage: | |
// p(instance)('privateMethod)(arg1, arg2, arg3) | |
class PrivateMethodCaller(x: AnyRef, methodName: String) { | |
def apply(_args: Any*): Any = { | |
val args = _args.map(_.asInstanceOf[AnyRef]) | |
def _parents: Stream[Class[_]] = Stream(x.getClass) #::: _parents.map(_.getSuperclass) | |
val parents = _parents.takeWhile(_ != null).toList | |
val methods = parents.flatMap(_.getDeclaredMethods) | |
val method = methods.find(_.getName == methodName).getOrElse(throw new IllegalArgumentException("Method " + methodName + " not found")) |
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
(defmacro sfn [params expr] | |
`(proxy [~(symbol (str "scala.Function" (count params)))] [] | |
(apply ~params | |
~expr))) |
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
type ¬[A] = A => Nothing | |
type ∨[T, U] = ¬[¬[T] with ¬[U]] | |
type ¬¬[A] = ¬[¬[A]] | |
type |∨|[T, U] = { type λ[X] = ¬¬[X] <:< (T ∨ U) } | |
class FoldUnion[T](t: T) { | |
def boxClass(x: java.lang.Class[_]): java.lang.Class[_] = x.toString match { | |
case "byte" => manifest[java.lang.Byte].erasure | |
case "char" => manifest[java.lang.Character].erasure | |
case "short" => manifest[java.lang.Short].erasure |
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 json | |
sealed abstract class JValue[+A](value: A) | |
case class JString(value: String) extends JValue(value) { | |
override def toString = "\"" + value + "\"" | |
} |
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
// see https://github.com/gseitz/Lensed | |
object Lensed { | |
import scalaz._ | |
import Scalaz._ | |
case class Address(street: String) | |
case class Person(name: String, address: Address) |
OlderNewer