Skip to content

Instantly share code, notes, and snippets.

View pokutuna's full-sized avatar
๐Ÿ‘๏ธ
๐Ÿ‘„๐Ÿ‘๐Ÿ‘‚

pokutuna pokutuna

๐Ÿ‘๏ธ
๐Ÿ‘„๐Ÿ‘๐Ÿ‘‚
View GitHub Profile
class BoxMuller
def initialize(average, deviation)
@pos = -1
@ave = average
@dev = deviation
@buf = Array.new
end
def get(position = @pos)
return @buf[position]
class File
def self.actual_path(file = nil)
file = __FILE__ if file == nil
file = File.expand_path(file)
if File.ftype(file) == 'link' then
actpath = File.readlink(file)
file = File.actual_path(actpath)
end
return file
module Latin1Conv
require 'cgi'
LATIN1_CONVERT_TABLE = {
' ' => ' ',
'¡' => '¡',
'¢' => '¢',
'£' => '£',
'¤' => '¤',
# -*- coding: utf-8 -*-
require 'date'
require 'monitor'
WAIT_TIME = 10
class BDALogger
attr_accessor :today, :logfile
ใƒ†ใ‚ฃใƒƒใƒ—
Giga PointsใŒใ„ใ„ใ‚‰ใ—ใ„
ใƒใƒฌใƒซ
็œŸ้ฎ(ใƒ–ใƒฉใ‚น)ใฏ้ฃฒใฟ้ฃŸใ„ใ—ใชใŒใ‚‰ใฏใƒžใ‚บใใ†
ๅฎ‰ใ„ใฎใ„ใใคใ‹่ฒทใ†ในใ๏ผŸ
ใ‚ฐใƒชใƒƒใƒ—ๅŠ›ใฎ้•ใ„
*ใ‚ฐใƒชใƒƒใƒ—ๅผฑใ„ใปใ†ใŒๅฅฝใฟใใ†
ๅฝข็Šถใซใ‚ˆใ‚‹ๆ„Ÿ่ฆšใฎ้•ใ„
็ดฐใ้•ทใ„: ้‡ใๆ„Ÿใ˜ใ‚‹
ใใกใ‚ƒใใกใ‚ƒใชใ‚ณใƒผใƒ‰ใฏ้–‹็™บใ‚’้…ใใ™ใ‚‹
็”Ÿ็”ฃๆ€งใ‚’ๅฎˆใ‚‹ใŸใ‚ใซใฏใ‚ณใƒผใƒ‰ใ‚’ๅธธใซ็ถบ้บ—ใช็Šถๆ…‹ใซไฟใค
ๆ›ธใใฎใฏ1ๅ›žใ€่ชญใ‚€ใฎใฏไฝ•ๅ›žใ‚‚
2็ซ  ๆ„ๅ‘ณใฎใ‚ใ‚‹ๅๅ‰
ๆ„ๅ›ณใŒๆ˜Ž็ขบใชๅๅ‰ใซใ™ใ‚‹
ใชใœใใ‚ŒใŒๅญ˜ๅœจใ™ใ‚‹ใฎใ‹ใ€ไฝ•ใ‚’ใ™ใ‚‹ใฎใ‹ใ€ใฉใฎใ‚ˆใ†ใซไฝฟ็”จใ™ใ‚‹ใฎใ‹
ใ‚‚ใ—ๅๅ‰ใซ่งฃ่ชฌใŒๅฟ…่ฆใชใ‚‰ใ€ๆ„ๅ›ณใŒๆ˜Ž็ขบใชๅๅ‰ใงใฏใชใ„
int d //ๆ—ฅๅ˜ไฝใฎ็ตŒ้Žๆ™‚้–“
require 'formula'
class Nano <Formula
url 'http://www.nano-editor.org/dist/v2.2/nano-2.2.6.tar.gz'
homepage 'http://www.nano-editor.org/'
md5 '03233ae480689a008eb98feb1b599807'
depends_on 'ncursesw'
def install
repos = [
'~/dotfiles',
'~/termtter',
'~/privaterepos',
'~/pokutuna_misc',
'~/btproject',
'~/scala-query',
'~/Documents/scala-collections-impl-doc-ja',
'~/Documents/scala-actors-doc-ja',
# -*- coding: utf-8 -*-
raise ArgumentError unless ARGV.size >= 2
def prompt(message)
puts "#{message} [Y/n]"
answer = STDIN.gets.chomp
answer == 'Y' ? true : false
end
# -*- coding: utf-8 -*-
@turu = { :head => 1, :leg => 2, :wing => 2 }
@kame = { :head => 1, :leg => 4, :wing => 0 }
@tonbo = { :head => 1, :leg => 6, :wing => 4 }
raise ArgumentError if [@turu, @kame, @tonbo].any? { |a| a[:head] != 1 }
def calc(head, leg, wing)
(0..head).each do |t|