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
| --- a/handlersocket.cpp | |
| +++ b/handlersocket.cpp | |
| @@ -1,4 +1,4 @@ | |
| -#include <handlersocket/hstcpcli.hpp> | |
| +#include <libhsclient/hstcpcli.cpp> | |
| #include "handlersocket.h" | |
| namespace { |
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
| 熊井 | 愛情 | 徳永 | |
|---|---|---|---|
| 熊井 | 愛情 | 須藤 | |
| 熊井 | 友好 | 有原 | |
| 徳永 | 愛情 | 熊井 | |
| 徳永 | 敵対 | 嗣永 | |
| 徳永 | 友好 | 有原 | |
| 徳永 | 嫉妬 | 須藤 | |
| 嗣永 | 敵対 | 徳永 | |
| 嗣永 | 危機感 | 鈴木 | |
| 嗣永 | 利用 | 菅谷 |
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 sc.ala.neo4j.Neo | |
| new Neo("/tmp/neo1") { W{ | |
| N("中国") --> "牽制" --> N("日本") <-- "牽制" <-- N("ロシア") | |
| N("アメリカ") --> "擁護" --> N("日本") | |
| }} |
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
| class Bar1 { | |
| lazy val a = "a" | |
| lazy val b = a + "b" | |
| } | |
| class Bar2 extends Bar1 { | |
| override lazy val a = "A" | |
| } | |
| (new Bar1).b // ab |
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
| scala> val map = Map[String,Any]("a"->1) | |
| map: scala.collection.immutable.Map[String,Any] = Map((a,1)) | |
| scala> map("a") | |
| res0: Any = 1 | |
| scala> val x:Int = map("a") | |
| <console>:6: error: type mismatch; | |
| found : Any | |
| required: Int |
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
| class Foo { | |
| import scala.collection.mutable.ArrayBuffer | |
| val elements = List(1,2,3) | |
| def map[T](block: Int => T) = { | |
| val vals = ArrayBuffer[T]() | |
| elements foreach{ i => vals += block(i) } | |
| vals.toArray | |
| } | |
| } |
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
| class Writer extends Actor { | |
| case class Set(key:String, value:String) | |
| def act { | |
| react { | |
| case s:Set => ... | |
| } | |
| aWriter ! Writer.Set("foo", "1") |
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
| // Why not define actor receive methods with overload? | |
| // | |
| // [features] | |
| // * simple: there are only receiver's codes | |
| // * readability: logic is defined just like receive(aMessage) | |
| // * extensibility: add new receive logic (no needs to care receive matcher) | |
| // * scalability: works well with traits and inheritances | |
| // [restrictions] | |
| // * all messages should be case classes (case objects cannot be used) |
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-1.6.0-openjdk | |
| hadoop-1.0.1 | |
| hbase-0.92.1 | |
| OS: ubuntu-11.10 | |
| input src: csv(1億行/22GB) | |
| disk rest: 77GB | |
| memory: 24GB (内12GBはramdiskで利用) | |
| io.compression.codecs: なし(無圧縮で利用) |
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
| resolvers += "Thrift" at "http://people.apache.org/~rawson/repo/" | |
| resolvers += "ClouderaRepo" at "https://repository.cloudera.com/content/repositories/releases" | |
| libraryDependencies ++= Seq( | |
| "org.apache.hadoop" % "hadoop-core" % "0.20.2-cdh3u2", | |
| "org.apache.hbase" % "hbase" % "0.90.4-cdh3u2" | |
| ) |