This file contains 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
a = '万中久乾亀亨享仁保元勝化吉同和喜嘉国大天字安宝寛寿平康延建弘徳応感慶成承授政文斉昌明昭景暦正武永治泰白祚神祥禄禎福老至興衡観護貞銅長雉雲霊養' | |
a.split(//).each do |x| | |
a.split(//).each do |y| | |
print "#{x}#{y}," | |
end | |
end |
This file contains 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[dvipdfmx,a4paper,10pt]{jsbook} | |
\usepackage{tikz} | |
\usepackage{ifthen} | |
\usepackage{calc} | |
\pagestyle{empty} | |
\begin{document} | |
\begin{tikzpicture}[line join=round,line cap=round,>=latex,x=1mm,y=1mm] | |
\tikzset{AXIS/.style={color=black,thin,->}} | |
\tikzset{GRID/.style={color=gray!50!white,very thin}} |
This file contains 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
EYE = %w( შ ๑ ะ ๏ ཅ ⌑ ◌ მ פ இ ௫ ° •) | |
MOUTH = %w( _ ⌓ ﹏ ⌄) | |
EYE.each do |e| | |
MOUTH.each do |m| | |
print "(#{e}#{m}#{e}) " | |
end | |
puts | |
end |
This file contains 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 ruby | |
DIRECTORY = '/Users/USERNAME/.check' | |
def check(file) | |
File::open(file) do |f| | |
f.each_line do |line| | |
puts line | |
STDIN.gets.chomp | |
end |
This file contains 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 | |
(1..12).each do |month| | |
(1..31).each do |day| | |
r = (month.to_f / day).to_s | |
s = (day.to_f / month).to_s | |
puts "#{month}月#{day}日 #{month}/#{day} = #{r}" if r.match(/^3\.1/) | |
puts "#{month}月#{day}日 #{day}/#{month} = #{s}" if s.match(/^3\.1/) | |
end | |
end |
This file contains 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
<ol> | |
<li>ex ea commodo consequat | |
<ol> | |
<li>Lorem ipsum dolor sit amet</li> | |
<li>consectetur adipiscing elit</li> | |
<li>sed do eiusmod tempor</li> | |
</ol> | |
</li> | |
<li>Duis aute irure dolor in | |
<ol start="4"> |
This file contains 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
set formatexpr="" | |
set formatprg=/YOUR/BIN/DIR/formatprg.rb |
This file contains 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 ruby | |
DIRECTORY = '/YOUR/PDF/DIR' | |
keyword = nil | |
number = nil | |
if ARGV.length != 1 and ARGV.length != 2 | |
puts "Usage (1): book keyword" | |
puts "Example (1): book Galois" | |
puts "Usage (2): book keyword number" |
This file contains 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
N = 2016_06_01 | |
(1..N).each do |n| | |
if (N / n) * n == N | |
puts "#{N} can be divided by #{n}." | |
end | |
end | |
__END__ | |
20160601 can be divided by 1. | |
20160601 can be divided by 20160601. |
This file contains 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 Fixnum | |
def to_ss | |
if self == 0 | |
"" | |
elsif self == 1 | |
"{}" | |
else | |
(self - 1).to_ss + ',' + (self - 1).to_s | |
end | |
end |