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
$reserved = 0; | |
$indent = 0; | |
while (<>) { | |
if ($reserved) { | |
$indent++; | |
$reserved = 0; | |
} | |
if (/^#if/) { |
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
--- bind.c.backup 2016-08-10 19:52:17.000000000 +0900 | |
+++ bind.c 2016-08-11 01:24:41.000000000 +0900 | |
@@ -496,6 +496,7 @@ static SEXP NewBase(SEXP base, SEXP tag) | |
/* This isn't strictly correct as we do not know that all the | |
components of the name were correctly translated. */ | |
ans = mkCharCE(cbuf, CE_UTF8); | |
+ if (!ENC_KNOWN(base)) ans = mkCharCE(translateChar(ans), CE_NATIVE); | |
vmaxset(vmax); | |
} | |
else if (*CHAR(tag)) { |
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
# > source("typedFunction.R") | |
# | |
# > cat(src) | |
# double calcPiLoop_typed() { | |
# int circle_in; | |
# int i; | |
# double l; | |
# | |
# circle_in = 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
from __future__ import division | |
from parser import read, ParseError | |
from util import * | |
from obj import * | |
def eval(exp, env): | |
global visible | |
visible = True |
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 <string> | |
#include <iostream> | |
#include <fstream> | |
#include <cstdlib> | |
// usage: | |
// time ./a.out [1G|1M|default] filename > /dev/null | |
void error(const char* p, const char* p2 = "") | |
{ |
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
from __future__ import division | |
import numpy as np | |
class _callableArray(np.ndarray): | |
def __call__(self, *arg): | |
return np.array([f(*arg) for f in self]) | |
def carray(funcs): |
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
library(scatterplot3d) | |
p <- function(n) { | |
m <- matrix(0, ncol=n, nrow=n*6) | |
m[1:6, 1] <- 1/6 | |
val <- function(i, j) if(i < 1) 0 else m[i,j] | |
for (j in 2: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
opt <- options(warn=-1) | |
## ------------------------------------------------------------ | |
## Test | |
## ------------------------------------------------------------ | |
## > rm(list=ls()); source("Eval.R") | |
## > repl() | |
## rlisp > (<- make.counter (function (c) (function () (<<- c (+ c 1))))) |
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
from __future__ import division | |
def pderiv(f, i): | |
e = 1e-10 | |
init_h = 0.1 | |
def deriv_exp(arg, h): | |
return(f(*arg_h(arg, h)) - f(*arg)) / h |
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
f <- function(x){x**2} | |
fgen <- function(k){ | |
k # for forcing arg k | |
return(function(x){ | |
f(k*x) | |
}) | |
} | |
generatedfuncs <- lapply(c(1:4),fgen) |
NewerOlder