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
#!/usr/local/bin/ruby | |
require "pp" | |
if ARGV.size < 2 | |
$stderr.puts "Usage: ruby ipip.rb PID1 PID2" | |
exit -1 | |
end | |
pid_1 = ARGV[0] |
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 play.api.libs.functional._ | |
import scala.language.higherKinds | |
import scala.util.{Success, Try} | |
object Play2FunctionalImplicitConversions { | |
implicit val tryApplicative:Applicative[Try] = | |
new Applicative[Try] { |
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
trait GenericTuple[T] { | |
type Base = T | |
type Left[A] | |
type Right[A] | |
def <<[A](o:Base, a:A): Left[A] | |
def >>[A](a:A, o:Base):Right[A] | |
} |
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
package jp.segfault.optparsec | |
import scala.language.implicitConversions | |
import scala.language.postfixOps | |
import scala.language.higherKinds | |
object HLists { | |
import 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
// stream.ts - A TypeScript module for FRP. | |
// - https://gist.github.com/hisui/6261547 | |
// - tsc stream.ts -t es5 --sourcemap --noImplicitAny | |
module sf { | |
export class Packet<T> { | |
constructor(private _flags:number, private _value:any=void 0) {} | |
static next<A>(e:A):Packet<A> { |
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
package jp.segfault.cvs.util | |
import scala.concurrent.duration.Duration | |
import scala.collection.mutable.ArrayBuffer | |
import scala.util.Try | |
import java.io._ | |
case class TtyOutput(data:Array[Byte], isError:Boolean) |
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
package jp.segfault.minlb | |
import java.nio.channels._ | |
import java.nio.channels.SelectionKey._ | |
import java.nio.ByteBuffer | |
import java.net.{HttpURLConnection, URI, InetSocketAddress} | |
import java.io.IOException | |
import java.util.concurrent.atomic.AtomicBoolean | |
import java.util.concurrent.TimeoutException |
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.language.higherKinds | |
import scala.language.implicitConversions | |
trait Wrap[X] { | |
type Out[_] | |
} | |
object Wrap { | |
implicit def case0[M[_]] = new Wrap[M[_]] { type Out[a] = M[a] } | |
implicit def case1[M[_,_],A,B] = new Wrap[M[A,B]] { type Out[a] = M[A,a] } |
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
def options(ctx): | |
ctx.load('compiler_cxx') | |
def configure(ctx): | |
ctx.env.CXX = 'clang++' | |
ctx.load('compiler_cxx') | |
def build(ctx): | |
ctx(target='mylib', | |
source=ctx.path.ant_glob('src/*.cpp'), |
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
#ifndef SF_POLY_QUEUE_H_ | |
#define SF_POLY_QUEUE_H_ | |
#include <stdexcept> | |
#include <iostream> | |
#include <stdint.h> | |
#include <type_traits> | |
namespace sf { |