Skip to content

Instantly share code, notes, and snippets.

@ssugiyama
ssugiyama / fontset-sourcecodepronoto
Created July 19, 2014 04:37
emacs で Source Code Pro と Noto Sans Japanese を組み合わせて使う設定
(when window-system
(create-fontset-from-ascii-font
"Source Code Pro-12:weight=normal:slant=normal" nil "sourcecodepronoto")
(set-fontset-font "fontset-sourcecodepronoto"
'unicode
(font-spec :family "Noto Sans Japanese" :size 14)
nil
'append)
(add-to-list 'default-frame-alist '(font . "fontset-sourcecodepronoto"))
)
;; 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)
;(when load-file-name
; (setq user-emacs-directory (file-name-directory load-file-name)))
#! /bin/bash
max=100
voices=(audrey sebastien thomas virginie)
while getopts n: OPT
do
case $OPT in
"n" ) max="$OPTARG"
esac
class EmacsJp < Formula
desc "GNU Emacs text editor"
homepage "https://www.gnu.org/software/emacs/"
url "https://ftp.gnu.org/gnu/emacs/emacs-25.3.tar.xz"
mirror "https://ftpmirror.gnu.org/emacs/emacs-25.3.tar.xz"
sha256 "253ac5e7075e594549b83fd9ec116a9dc37294d415e2f21f8ee109829307c00b"
head do
url "https://github.com/emacs-mirror/emacs.git"
vote <- read.csv("~/Downloads/oota2015.csv")
plot(vote) #散布図
vote.newdata = seq(1800, 7200, 100)
vote.lm <- lm(X2011 ~ X2015, data = vote)
#95%予測。片側なので0.9
vote.pred <- as.data.frame(predict(vote.lm, data.frame(X2015 = vote.newdata), interval = "prediction", level = 0.9))
lines(cbind(vote.newdata, vote.pred$fit), type="l")
lines(cbind(vote.newdata, vote.pred$lwr), type="l", col="blue", lty=2)
#80%予測。片側なので0.6
vote.pred80 <- as.data.frame(predict(vote.lm, data.frame(X2015 = vote.newdata), interval = "prediction", level = 0.6))
@ssugiyama
ssugiyama / poppo.rb
Created December 12, 2016 10:29
あめの数から最大限進化可能な回数を求める
def poppo(candies, n=12)
evolutions = (candies/n).to_i
rest = evolutions *2 + candies%n
evolutions += poppo(rest) if rest >= n
evolutions
end
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.