Skip to content

Instantly share code, notes, and snippets.

View koba-e964's full-sized avatar

Hiroki Kobayashi koba-e964

View GitHub Profile
@koba-e964
koba-e964 / gist:7138788
Created October 24, 2013 15:00
disassembly list of func/FuncTest.java
Classfile /C:/Users/2adc/Documents/Programming/experiment/Java8EA/func/FuncTest.class
Last modified 2013/10/24; size 2027 bytes
MD5 checksum 8bf77797cdd2bb1b21081afd3c3dae69
Compiled from "FuncTest.java"
public class func.FuncTest
SourceFile: "FuncTest.java"
InnerClasses:
public static #29= #12 of #27; //Counter=class func/FuncTest$Counter of class func/FuncTest
public static #31= #9 of #27; //Stopper=class func/FuncTest$Stopper of class func/FuncTest
public static final #113= #112 of #116; //Lookup=class java/lang/invoke/MethodHandles$Lookup of class java/lang/invoke/MethodHandles
@koba-e964
koba-e964 / quantum-tsume.txt
Last active December 27, 2015 02:29
量子詰将棋のFAQ(のようなもの)です。一部独断と偏見が入っているかもしれないので注意。
量子詰将棋のFAQ(質問集) (2013/11/01)
量子詰将棋でよくある質問をまとめています。
[1]ルールが分からない
量子将棋のルールは http://shogitter.com/rule/108 を参照していただければわかります。
量子詰将棋特有のルールは今のところ正確に決まっていません。
私の作品では、
(1)王手:玉の可能性のある駒が一つしかなく、その駒に自分の駒の利きが入っている状態
(2)詰み:玉方がどのような応手をとろうとも、次の一手で確実に玉が取られ、量子将棋のルールで敗北が決定する状態
@koba-e964
koba-e964 / quantum-linkto.txt
Created October 31, 2013 17:01
自作量子詰将棋へのリンク
自作量子詰将棋へのリンク
第1作 https://twitter.com/kobae964/status/395166593589579777/
(見やすくしたもの https://twitter.com/kobae964/status/395185285308243968)
第2作 https://twitter.com/kobae964/status/395173401309896704
(注意!!! 欠陥があることが報告されています。詰まない応手が存在するので解かないことを強くお勧めします。)
@koba-e964
koba-e964 / gist:7339472
Last active December 27, 2015 14:19
Java8でYコンビネータ
import java.util.function.*;
public class Comb{
static class YCombinator<T> implements Function< UnaryOperator<UnaryOperator<T>> ,UnaryOperator<T> >{
public UnaryOperator<T> apply(UnaryOperator<UnaryOperator<T>> f){
return x->f.apply(this.apply(f)).apply(x);
}
}
public static void main(String[] args){
UnaryOperator<UnaryOperator<Integer>> hf=
(define-library (srfi 95)
(import (scheme base)
(scheme load))
;; this hack works only if the current directory is the root of picrin.
(load "piclib/srfi/1.scm")
(import (srfi 1))
(define (list-sorted? ls less?)
(let loop ((cur ls))
(if (<= (length cur) 1) #t
(if (less? (second cur) (first cur)) #f
module Var where
import Control.Monad.Trans (lift)
import Control.Monad.Trans.State.Strict
import Data.Map (Map, insert, empty)
import qualified Data.Map as Map
import Data.List (foldl')
type Var m = StateT (Map String Double) m
c-strtold.c
dtoastr.c
fprintftime.c
ldtoastr.c
strtoumax.c
xstrtold.c
false.c
lbracket.c
ls-dir.c
ls-ls.c
(* CoqEx 15 in http://qnighy.github.io/coqex2014/ *)
Inductive Tree:Set :=
| Node: list Tree -> Tree.
Theorem Tree_dec: forall a b:Tree, {a=b} + {a<>b}.
Proof.
fix 1.
intros a b.
destruct a.
Modification:
pic_try {
v = pic_apply(pic, mac->proc, args);
} pic_catch {
#if 1 && 1 /// TODO FIXME XXX
pic_printf(pic, "me error: %p --> %p %p :*: ~s \n", mac, mac->proc, mac->senv, pic_car(pic, args));
#endif
pic_errorf(pic, "macroexpand error while application: %s", pic_errmsg(pic));
kobae964@debian-kobae964:~/srcview/picrin/build$ bin/picrin
fatal error: failure in loading built-in.scm
macroexpand error while application: macroexpand error while application: pair required, but got #<proc 0xbc4910>アボートしました