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
\documentclass[a4paper,11pt]{ltjarticle} | |
% 余白調整 | |
% TOP = 1inch + \voffset + \topmargin + \headheight + \headsep | |
% BOTTOM = \paperheight - TOP - \textheight | |
\setlength{\textheight}{\paperheight} %紙面縦幅を本文領域に | |
\setlength{\topmargin}{4.6truemm} %上部余白を30mm(=1inch+4.6mm)に | |
\addtolength{\topmargin}{-\headheight} | |
\addtolength{\topmargin}{-\headsep} |
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 ruby | |
# -*- coding: utf-8 -*- | |
# ask file information | |
print("input filename: ") | |
filename = gets().chomp() | |
if (filename == "") then | |
filename = "lualatex-template.tex" |
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
"python | |
setl autoindent | |
setl softtabstop=4 | |
setl tabstop=4 | |
setl shiftwidth=4 | |
setl textwidth=80 | |
setl smarttab | |
setl expandtab |
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
"Ruby | |
setl autoindent | |
setl softtabstop=2 | |
setl tabstop=2 | |
setl shiftwidth=2 | |
setl smarttab | |
setl expandtab | |
setl smartindent cinwords=if,elsif,else,unless,for,while,try,rescue,ensure,def,class,module |
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
fb :: Int -> String | |
fb x | |
| x `mod` 15 == 0 = "FizzBuzz" | |
| x `mod` 3 == 0 = "Fizz" | |
| x `mod` 5 == 0 = "Buzz" | |
| otherwise = show x | |
fizzbuzz n = [ fb x | x <- [1..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
-- <example> | |
-- $runghc calcGPA.hs | |
-- 3 | |
-- A 2 | |
-- B 2 | |
-- C 1 | |
-- 2.2 | |
import Control.Monad | |
import Control.Applicative |
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
#-*- coding: utf-8 -*- | |
require 'userstream' | |
# --- define consts --- | |
CONSUMER_KEY = ENV['CONSUMER_KEY'] | |
CONSUMER_SECRET = ENV['CONSUMER_SECRET'] | |
ACCESS_TOKEN = ENV['ACCESS_TOKEN'] | |
ACCESS_SECRET = ENV['ACCESS_SECRET'] |
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
# -*- coding: utf-8 -*- | |
require 'nokogiri' | |
require 'open-uri' | |
# get prepaid balance | |
# from https://mp.seikyou.jp/mypage/Static.init.do | |
# | |
# The MIT License | |
# Copyright (c) 2013 @nepiadeath |
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
#!/bin/sh | |
if [ -z $1 ]; then | |
filename=doc | |
else | |
filename=$1 | |
fi | |
lualatex -ini lualatex.ini > /dev/null 2>&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
-- if this program stack space overflow, | |
-- ./monte_carlo +RTS -K200M | |
import System.Random | |
import Control.Monad | |
main :: IO () | |
main = do | |
randsx <- replicateM s $ (randomRIO(0,1.0)::IO Double) | |
randsy <- replicateM s $ (randomRIO(0,1.0)::IO Double) | |
print (getPI (isInTheCircle randsx randsy) sDouble) |
OlderNewer