This file contains 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
(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 |
This file contains 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
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 |
This file contains 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
c-strtold.c | |
dtoastr.c | |
fprintftime.c | |
ldtoastr.c | |
strtoumax.c | |
xstrtold.c | |
false.c | |
lbracket.c | |
ls-dir.c | |
ls-ls.c |
This file contains 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
(* 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. |
This file contains 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
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)); | |
This file contains 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
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>アボートしました |
This file contains 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
using namespace std; | |
class Coloring { | |
private: | |
int cmin; | |
int n; | |
vector<vector<int> > e; | |
public: | |
/* n: number of edges, e: adjacent matrix of the graph */ | |
Coloring(int n, vector<vector<int> > e) : cmin(n+1), n(n), e(e) { | |
if(n>=33) { |
This file contains 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 Hungarian { | |
private int n; | |
private int e[][]; | |
/** | |
* n*n complete bipartite graph | |
* @param e | |
*/ | |
Hungarian(int[][] e) { | |
this.e = e; // shallow-copied | |
this.n = e.length; |
This file contains 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
/* | |
* Operations of power. | |
* Header requirement: algorithm, vector, cmath | |
*/ | |
class Power { | |
typedef long long i64; | |
public: | |
/* a^b with no modulo operations */ | |
static long long power(long long a, long long b) { | |
i64 s = 1; |
This file contains 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
/** | |
* Union-Find tree that contains a subset of {0..n-1} as nodes. | |
* @author koba-e964 | |
* | |
*/ | |
class UnionFind { | |
private int[] disj; | |
private int[] rank; | |
/** | |
* Initializes the union-find tree. At first, there are no nodes in it. |
OlderNewer