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
(defun foldr (f lst) | |
(if (null (cdr lst)) (car lst) | |
(funcall f (car lst) (foldr f (cdr lst))))) | |
(defun foldl (f lst) | |
(if (null (cdr lst)) (car lst) | |
(funcall f (foldl f (butlast lst)) (car (last lst))))) | |
(defun foldr-tail (f a lst) | |
(if (null lst) 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
;;; my naive solution to clojure puzzle at | |
;;; Boston Clojure meetup on 8/14/2015 | |
;;; http://www.meetup.com/Boston-Clojure-Group/events/224014745/?a=uc1_te&_af=event&_af_eid=224014745 | |
(def bosclj-data | |
[[:b 7 2 1 2 2 2 1 2 1 2 7] | |
[:b 1 5 1 3 3 1 3 2 2 1 1 5 1] | |
[:b 1 1 3 1 1 1 3 1 3 1 1 3 1 1 1 1 3 1 1] | |
[:b 1 1 3 1 1 2 3 1 3 2 2 2 1 1 3 1 1] | |
[:b 1 1 3 1 1 3 1 3 1 2 3 2 1 1 3 1 1] | |
[:b 1 5 1 2 1 3 1 3 1 1 1 2 1 5 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
;;; Mac-only configuration to use command and options keys | |
(when (eq system-type 'darwin) | |
;; Mac-only | |
;; Command key as Meta key, Option key untouched | |
;; http://www.emacswiki.org/emacs/MetaKeyProblems#toc15 | |
;; http://ergoemacs.org/emacs/emacs_hyper_super_keys.html | |
;; | |
;; left command | |
(setq mac-command-modifier 'meta) | |
;; left option |
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
## オリジナル | |
result<-NULL | |
for(i in 1:20000){ | |
result<-c(result,roc(...)) | |
} | |
## 2000-vectorを最初に作成 | |
result <- as.numeric(rep(NA,2*10^4)) | |
for(i in 1:20000){ | |
result[i] <- roc(...) |
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
### Elecrow HDMI 5inch 800x480 LCD display | |
# https://www.amazon.com/Elecrow-Display-Monitor-800x480-Raspberry/dp/B013JECYF2/ | |
# Adopted from the following URL. Modified for clarity and corrections. | |
# https://www.amazon.com/gp/aw/review/B013JECYF2/R3ZXW0VTV8AEB/ref=cm_cr_dp_mb_rvw_1?ie=UTF8&cursor=1 | |
# DOCUMENTATION > CONFIGURATION > CONFIG-TXT | |
# https://www.raspberrypi.org/documentation/configuration/config-txt.md | |
### Display configuration | |
# hdmi_group: 0 auto-detect from EDID; 1 CEA; 2 DMT | |
hdmi_group=2 |
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
;;; dot_emacs.el --- -*- lexical-binding: t; -*- | |
;;; Select emacs config file directory depending on emacs being run | |
;; Added by Package.el. This must come before configurations of | |
;; installed packages. Don't delete this line. If you don't want it, | |
;; just comment it out by adding a semicolon to the start of the line. | |
;; You may delete these explanatory comments. | |
;; (package-initialize) |
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
;;; Suppress messages | |
;; http://qiita.com/itiut@github/items/d917eafd6ab255629346 | |
;; http://emacs.stackexchange.com/questions/14706/suppress-message-in-minibuffer-when-a-buffer-is-saved | |
(defmacro with-suppressed-message (&rest body) | |
"Suppress new messages temporarily in the echo area and the `*Messages*' buffer while BODY is evaluated." | |
(declare (indent 0)) | |
(let ((message-log-max nil)) | |
`(with-temp-message (or (current-message) "") ,@body))) | |
;;; |
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
(defun org-babel-get-all-src-block-info () | |
"Get information on all src blocks in an org file." | |
(interactive) | |
(let ((lst '())) | |
(save-excursion | |
;; Go to the beginning of buffer | |
(beginning-of-buffer) | |
(while (condition-case err | |
;; Try to move to the next src block. | |
(org-next-block nil nil org-babel-src-block-regexp) |
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
## Implement multivariate version of Rubin's formula | |
## eq 14 in https://www.ncbi.nlm.nih.gov/pmc/articles/PMC4029775/ | |
## Page 97 of https://www.amazon.com/Multiple-Imputation-Nonresponse-Surveys-Donald/dp/0471655740 | |
AlternativeMIcombine.default <- function (results, variances, call = sys.call(), df.complete = Inf, ...) { | |
m <- length(results) | |
oldcall <- attr(results, "call") | |
if (missing(variances)) { | |
variances <- suppressWarnings(lapply(results, vcov)) | |
results <- lapply(results, coef) | |
} |
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
class Jpeg < Formula | |
desc "Image manipulation library" | |
homepage "http://www.ijg.org" | |
url "http://www.ijg.org/files/jpegsrc.v8d.tar.gz" | |
sha256 "00029b1473f0f0ea72fbca3230e8cb25797fbb27e58ae2e46bb8bf5a806fe0b3" | |
bottle do | |
cellar :any | |
rebuild 2 | |
sha256 "85d1f6055de99c1b764c697498bb86d003f5d24b324133f036f0393b97b3e869" => :sierra |