Skip to content

Instantly share code, notes, and snippets.

trait Association {
type Item <: AbstractItem
trait AbstractItem {
def memberOf(): Group
}
type Group <: AbstractGroup
trait AbstractGroup {
def addItem(item: Item)
def removeItem(item: Item)
def items(): List[Item]
@yamkazu
yamkazu / architecture.png
Created September 8, 2011 03:48
Netty Architectural Overview
architecture.png
@xuwei-k
xuwei-k / README.md
Created September 15, 2011 14:07
"hello" を返すだけのサーバーを unfiltered で !

これ http://blog.twiwt.org/e/f835d9 がインストールされていれば、ファイルを保存して、実行権限与えておいて

./unfiltered-sample.scala

ってやるだけでローカルで、勝手に空いてるポートで、"hello" を返すだけのサーバー起動するお( ^ω^)

終了は、コンソールでなにかキーを入力すればいいはず

@hishidama
hishidama / Sample1AppMstr.java
Created November 21, 2011 22:21
Hadoop0.23 YARN 最小限サンプル
package sample1;
import java.net.InetSocketAddress;
import java.util.Map;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.net.NetUtils;
import org.apache.hadoop.yarn.api.AMRMProtocol;
OK, I understand what is not supported (now?).
In this case, hoop server should send response message means correct reason, like
'concurrent append not supported'.
But now, in fact, hoop send message as 'failed to create file'. We cannot know what is wrong
from this message. (request method? wrong path? or ...?)
This is wrong message, and i want to be fixed.
@everpeace
everpeace / A.txt
Created March 15, 2012 15:13
Matrix Multiplication in Scalding.
1 2 3
1 2 3
1 2 3
@rirakkumya
rirakkumya / build.sbt
Created March 22, 2012 11:29
漢数字変換 by scala parser combinator
libraryDependencies += "org.scala-tools.testing" %% "scalacheck" % "1.9"
@tototoshi
tototoshi / finagle_http_hello.scala
Created May 19, 2012 04:11
finagle-http で Hello, world.
package com.github.tototoshi.finagle_hack
import java.net.InetSocketAddress
import com.twitter.finagle.{Service, SimpleFilter}
import com.twitter.util.Future
import com.twitter.finagle.builder.{Server, ServerBuilder}
import com.twitter.finagle.http._
import com.twitter.finagle.http.path._
object HTTPServer {
@etorreborre
etorreborre / gist:2839993
Created May 31, 2012 01:01
Type inference trick to avoid unchecked - DOESN'T WORK... warnings in pattern matching
/**
* UPDATE: this trick doesn't work here because when using 'asInstanceOf', Nothing is inferred as being the expected type, thus the conversion fails at run-time.
*/
/**
* Let's say you have some ugly casting to do
*/
// this doesn't compile with something like: "expected _, got Any"
function match {
@etorreborre
etorreborre / gist:2952827
Created June 19, 2012 07:38
ScalaCheck Arbitrary instance for a Directed Acyclic Graph, using memoized generators to share previously generated values
/**
* Arbitrary instance for a CompNode: Load, ParallelDo, GroupByKey, Combine, Op or Return
*/
import scalaz.Scalaz._
import Gen._
/**
* we're using a sized generator where the size of the generated data will be the depth of the graph
* This allows to control the generation phase for ScalaCheck properties with minSize and maxSize
*/