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
;;; 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
### 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
## オリジナル | |
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
;;; 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
;;; 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
(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
;;; pi calculation in Clojure | |
(defn square | |
"Square a number" | |
[n] | |
(* n n)) | |
(defn seq-of-numerators | |
"Sequence of numerators up to n-th element" | |
[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
#!/usr/bin/env lein-exec | |
;; Can run as a shell script if proper configurations have been done | |
;; https://github.com/kumarshantanu/lein-exec#executable-scripts | |
;;; Getting dependencies from within script | |
;; https://github.com/kumarshantanu/lein-exec#getting-dependencies-from-within-script | |
;; Usually run by lein exec script.clj | |
(use '[leiningen.exec :only (deps)]) | |
(deps '[[org.clojure/clojure "1.6.0"] | |
[bigml/sampling "3.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
#_(defdeps ;; Need to be at line 1 | |
[[org.clojure/clojure "1.6.0"] | |
[bigml/sampling "3.0"]]) | |
;; lein oneoff script.clj to run | |
;; https://github.com/mtyaka/lein-oneoff | |
;; Namespace | |
(ns oneoff | |
(:require [clojure.string :as cstr] | |
[clojure.set :as cset] |