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 blah: Int = { | |
val a: Option[Int] = Some(10) | |
a getOrElse {return 1} | |
2 | |
} | |
public int blah(); | |
Code: | |
0: new #16; //class java/lang/Object |
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 JmxView < StatefullServlet | |
env = java.util.Hashtable.new | |
env[javax.naming.Context::PROVIDER_URL] = "jnp://127.0.0.1:1099" | |
env[javax.naming.Context::INITIAL_CONTEXT_FACTORY] = "org.jnp.interfaces.NamingContextFactory" | |
@@srv = javax.naming.InitialContext.new(env).lookup("jmx/invoker/RMIAdaptor") | |
def index | |
if domain = request["domain"] | |
mbeans = @@srv.query_names(javax.management.ObjectName.new(domain+":*"),nil).sort_by{|m|m.key_property_list_string} | |
name = request["name"] || mbeans.to_a.first.key_property_list_string |
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
prntln("foo");1 |
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
println("dupa");1 |
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
println("b") | |
class A | |
class B extends A | |
class C extends B | |
println("a") |
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 ar { | |
trait AroundFile { | |
def around[T](f: => T): T = f | |
def session[T](f: => T): T = f | |
} | |
trait SessionFile extends AroundFile { | |
abstract override def around[T](f: => T): T = this.session(super.around(f)) | |
} |
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 pl.irc | |
import org.jibble.pircbot.PircBot | |
import util.parsing.json.{JSON, JSONObject, JSONArray, JSONType} | |
import dispatch._ | |
import Http._ | |
object Multibottest extends PircBot { | |
val BOTNAME = "multibot" | |
val BOTMSG = BOTNAME + ":" |
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 pl.irc | |
import org.jibble.pircbot.PircBot | |
import util.parsing.json.{JSON, JSONObject, JSONArray, JSONType} | |
import dispatch._ | |
import Http._ | |
object Multibottest extends PircBot { | |
val BOTNAME = "multibot" | |
val BOTMSG = BOTNAME + ":" |
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
trait Num { type a[F[_], X] } | |
trait Zero extends Num { type a[F[_], X] = X } | |
trait One extends Num { type a[F[_], X] = F[X] } | |
trait Two extends Num { type a[F[_], X] = F[F[X]] } | |
trait Three extends Num { type a[F[_], X] = F[F[F[X]]] } | |
trait PApp[F[P[_], _], A[_]] { | |
type a[X] = F[A, X] | |
} |
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
abstract class Tree[+A] | |
case class Node[A](x: A, l: Tree[A], r: Tree[A]) extends Tree[A] | |
case object Empty extends Tree[Nothing] | |
abstract class Direction[A](x: A, t: Tree[A]) | |
case class Left[A](x: A, tree: Tree[A]) extends Direction(x, tree) | |
case class Right[A](x: A, tree: Tree[A]) extends Direction(x, tree) | |
case class Zipper[A](t: Tree[A], d: List[Direction[A]]) { |