Skip to content

Instantly share code, notes, and snippets.

View rinx's full-sized avatar
🍵
sencha

Rintaro Okamura rinx

🍵
sencha
View GitHub Profile
@rinx
rinx / mc1drad_mersenne.hs
Created June 25, 2017 08:28
monte carlo 1d radiative transfer code written in haskell using random-mersenne package.
import System.Random.Mersenne
np = 1000000
tau = 1.0 -- cloud optical thickness
sal = 0.5 -- surface albedo
omg = 1.0 -- single scattering albedo
zu = tau -- atmosphere upper boundary
zb = 0.0 -- atmosphere lower boundary
@rinx
rinx / count.elm
Created May 30, 2017 14:37
my first elm sample
module Main exposing (..)
import Html exposing (..)
import Html.Events exposing (..)
import Html.Attributes exposing (..)
type alias Model = Int
type Msg = Click
@rinx
rinx / akima.hs
Created April 15, 2017 06:12
Akima 補間 途中まで書いて放置
type ZipList = [(Double, Double)]
-- akima interpolation
akimaint :: ZipList -> Double -> Maybe Double
akimaint zls x = akimacore zls' x
where
zls' = zlistsort zls
zls'' = selzls zls' n n2
xls = map fst zls'
@rinx
rinx / cnn-tikz.tex
Created January 15, 2017 10:04
TikZでCNNの図を描くやつ
\begin{figure}[htbp]
\centering
\tikzset{%
every channel/.style={
rectangle,
draw,
draw=black,
fill=white,
minimum size=1cm,
},
@rinx
rinx / wp_change.sh
Created January 9, 2017 06:21
wpchange.sh for iterm2 version3
#!/bin/sh
CMDNAME=`basename $0`
BASE_DIR=$(cd $(dirname $0);pwd)
image_list=(${BASE_DIR}/*.jpg)
numimglist=${#image_list[@]}
rannum=$(( $RANDOM % ${numimglist}))
image_path=${image_list[$rannum]}
@rinx
rinx / hist_gp.rb
Last active January 7, 2017 06:42
Histogram libraries for ruby using gnuplot gem
# -*- coding: utf-8 -*-
# hist_gp.rb
#
# Author: Rintaro Okamura
#
# Description:
# Histogram libraries for ruby using gnuplot gem
#
@rinx
rinx / cover.tex
Last active December 2, 2016 04:08
東北大地物の修論とかアレとかの表紙テンプレ
\documentclass[a4j, 12pt, titlepage]{ltjreport}
%\documentclass[a4j, 12pt, titlepage]{jreport}
\usepackage[top=20truemm,bottom=20truemm,left=20truemm,right=20truemm]{geometry}
\usepackage{graphicx}
\usepackage{tikz}
\usetikzlibrary{automata,positioning}
\makeatletter
@rinx
rinx / animation.pdf
Last active November 26, 2016 11:24
animation sample of beamer with TikZ
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@rinx
rinx / sushi-soku-enzan.hs
Created September 30, 2016 08:32
sushi-soku-enzan
--
-- 🍣-soku-enzan.hs
--
(🍣) = (+)
(🍣🍣) = (-)
(🍣🍣🍣) = (*)
(🍣🍣🍣🍣) = (/)
main :: IO ()
@rinx
rinx / test.rb
Created July 29, 2016 13:31
tsv reader
require 'csv'
filename = "test.tsv"
# read original_records into hash
original_records = []
headers = []
CSV.read(filename, :col_sep => "\t", headers: false).each_with_index do |row, i|
if i == 0 then
headers = row
next