Skip to content

Instantly share code, notes, and snippets.

@igjit
igjit / Dockerfile
Last active June 28, 2020 12:29
Use reticulate with pyenv
# https://github.com/rocker-org/rocker/tree/master/r-ubuntu
FROM rocker/r-ubuntu:18.04
RUN apt update && \
apt install -y \
make build-essential libssl-dev zlib1g-dev libbz2-dev \
libreadline-dev libsqlite3-dev wget curl llvm libncurses5-dev libncursesw5-dev \
xz-utils tk-dev libffi-dev liblzma-dev python-openssl git
RUN curl -L https://github.com/pyenv/pyenv-installer/raw/master/bin/pyenv-installer | bash && \
@igjit
igjit / copl_sandbox.rb
Created July 31, 2018 22:31
プログラミング言語の基礎概念の演習システム http://www.fos.kuis.kyoto-u.ac.jp/~igarashi/CoPL/index.cgi に回答をpostするスクリプト
require 'net/http'
require 'uri'
require 'nokogiri'
URL = 'http://www.fos.kuis.kyoto-u.ac.jp/~igarashi/CoPL/index.cgi'
DEFAULT_FORM_DATA = {
command: 'answer',
no: 0
}
@igjit
igjit / .gitignore
Last active October 17, 2019 10:07
/.env
@igjit
igjit / lispr.R
Last active November 22, 2016 03:36
Scheme Interpreter in R (more R-ish implementation of "lisp.R")
## Scheme Interpreter in R
## (more R-ish implementation of "lisp.R")
addGlobals <- function(env) {
procs <- list("+" = sum,
"*" = prod,
"-" = function(...) Reduce(`-`, list(...)),
"/" = function(...) Reduce(`/`, list(...)),
"=" = `==`,
"eq?" = `==`,
@igjit
igjit / lisp.rb
Last active December 20, 2015 20:19
Scheme Interpreter in Ruby (a Ruby port of the Peter Norvig's "lis.py")
# -*- coding: utf-8 -*-
# Scheme Interpreter in Ruby
# (a Ruby port of the Peter Norvig's "lis.py")
class Env < Hash
def initialize(parms = [], args = [], outer = nil)
@outer = outer
update(Hash[parms.zip(args)])
end
@igjit
igjit / lisp.R
Created May 17, 2013 09:51
Scheme Interpreter in R (an R port of the Peter Norvig's "lis.py")
## Scheme Interpreter in R
## (an R port of the Peter Norvig's "lis.py")
Env <- setRefClass('Env',
fields = c(".outer", ".dict"),
methods = list(
initialize = function(outer=NULL) {
.outer <<- outer
.dict <<- list()
},