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
#include <type_traits> | |
#include <iostream> | |
extern void *enabler; | |
// 文字のリスト | |
template<char H, typename T> | |
struct cons {}; | |
struct nil {}; |
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
declare module sf { | |
export interface Future<T> extends AsyncEither<Error,T> { | |
lhs():FutureProjection_L<T>; | |
rhs():FutureProjection_R<T>; | |
flatMap<B>(f: (e:Either<Error,T>) => AsyncEither<Error,B>):Future<B>; | |
map<B>(f: (e:Either<Error,T>) => Either<Error,B>):Future<B>; | |
each(f: (e:Either<Error,T>) => void):Future<T>; | |
} |
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 scalaz._ | |
import scalaz.Scalaz._ | |
object Play4Scalaz { | |
type PlayApp[M[_]] = play.api.libs.functional.Applicative[M] | |
implicit def applicative[M[_]:PlayApp]:Applicative[M] = | |
new Applicative[M] { | |
override def apply[A,B](f:M[A => B], a:M[A]) = implicitly[PlayApp[M]].apply(f, 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 { | |
import mx.logging.ILogger; | |
import mx.logging.Log; | |
public final class LogUtil { | |
public static function get cinit():ILogger | |
{ | |
// This matching fails on AIR runtime.. | |
const result:Object = /[^\/\s.:]+(?=\$cinit\(\))/.exec(new Error().getStackTrace()); |
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
I x -> x | |
K c x -> c | |
S f g x -> f x (g x) | |
S' c f g x -> c (f x) (g x) | |
C f g x -> f x g | |
C' c f g x -> c (f x) g | |
B f g x -> f (g x) | |
B' c f g x -> c f (g x) | |
B* c f g x -> c (f (g x)) | |
J f g x -> f g |
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
#include <iostream> | |
template<typename F, typename T, typename Ret, typename ...Args> | |
void bar(Ret (T::*func)(Args...) const, const F &f) | |
{ | |
(f.*func)(Args()...); | |
} | |
template<typename F> | |
void foo(const F &f) { bar(&F::operator(), f); } |
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.io; | |
import java.io.EOFException; | |
import java.io.IOException; | |
import java.io.InputStream; | |
public class BitReader { | |
private InputStream in; | |
private long data; |
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
#include <stdio.h> | |
typedef char*a;struct b{b*c;a d,e;int f,g,h;int i(a&j,a k=0,b*l=0){b m={l,j,0,2 | |
,0,1};return(*j&&*j-')'&&*j-'|'?(n(j,0,0),*j=='*'||*j=='+'&&(m.f=-1)||(m.g=2,*j | |
=='?')?(m.h=*++j-'?')||++j:(m.f=1),m.e=j,l=&m,0):!(k&&(j=l->d,l->c)))||l->o(j,k | |
);}int o(a&j,a k){b m=*this,p=m;return k?f<m.g--?n(p.d,k,&m):!m.g?i(p.e,k,c):h | |
&&n(p.d,k,&m)||i(p.e,k,c)||!m.h&&n(p.d,k,&m):i(j);}int n(a&j,a k,b*l,int q=0){ | |
if(q||(q=*j++)=='('||(q=k&&(q=='$'?!*k:((q-'.'?q==*k:*k)&&++k))&&l->o(j,k),0)) | |
while(!((q=i(j,k,l))&&k||(i(j),*j++-'|')));return q;}}r={0,0,0,0,1,1};int main( | |
int s,a*t){while(r.n(*t=t[1],t[2],&r,1)?(puts("ktkr."),0):*t[2]++);return 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 java.io.*; | |
import java.util.*; | |
import java.util.List; | |
import java.awt.*; | |
import java.awt.event.*; | |
import javax.swing.*; | |
public class Poly extends JPanel { | |
public static void main(String[] args) { |
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 java.io.PrintStream | |
trait TreeDumps[T] { | |
def out:PrintStream | |
def dump_r(node:T, last:Boolean=true, indent:String=" ") { | |
out.println(indent + (if (last) "└" else "├") + describe(node)) | |
val a = children(node) | |
if (a.size > 0) { |