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 scala.concurrent.forkjoin.ForkJoinPool | |
import scala.concurrent.forkjoin.RecursiveTask | |
object Main { | |
def main(args: Array[String]) { | |
val pool = new ForkJoinPool() | |
println(s"${Thread.currentThread.getId}: unsorted=" + args.mkString(", ")) | |
val sorted = pool.invoke(new QuickSortingTask(args)) | |
println(s"${Thread.currentThread.getId}: sorted=" + sorted.mkString(", ")) | |
} |
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
# Initialize rbenv. | |
# "eval rbenv init -" is much heavy. use cached script. | |
if [ -n "$(printenv TMUX)" ]; then | |
source $ZSHHOME/rbenv.init-no-rehash | |
else | |
source $ZSHHOME/rbenv.init | |
fi | |
check_rbenv_init() { | |
rbenv init - | diff - $ZSHHOME/rbenv.init |
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
echo '{"foo": "lorem", "bar": "ipsum"}' | python -mjson.tool |
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
# -*- coding: utf-8 -*- | |
# | |
# install: http://morgangoose.com/blog/2011/01/06/using-the-parallel-branch-of-fabric/ | |
# document: http://docs.fabfile.org/en/1.2.0/index.html | |
# | |
import os | |
from fabric.api import * | |
from fabric.decorators import * |