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
;;; red | |
;; (defconst color1 "#FF6699") | |
;; (defconst color3 "#CDC0B0") | |
;; (defconst color2 "#FF0066") | |
;; (defconst color4 "#CDC0B0") | |
;;; green | |
;; (defconst color1 "#66FF99") | |
;; (defconst color3 "#E1FFCC") ;; active mode-line | |
;; (defconst color2 "#00FF66") |
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
# coding: utf-8 | |
# 日本語でやった人の日本語のデータと、 | |
# 英語でやった人の英語のデータを取得する | |
# データは打ち込んだ文(表示されてるやつ)と | |
# 折り返し翻訳されたものの2つ | |
# language = 'ja' | |
# $ ruby langrid.rb > ja | |
# language = 'en' |
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
# coding: utf-8 | |
require 'watir' | |
require 'pp' | |
# !!! EDIT HERE !!! | |
userid = '' | |
password = '' | |
language = 'ja' # 'ja' or 'en' | |
topic_id = |
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
# coding: utf-8 | |
require 'mechanize' | |
require 'pp' | |
agent = Mechanize.new | |
page = agent.get('http://www.fos.kuis.kyoto-u.ac.jp/~t-sekiym/classes/isle4/testcases.html') | |
number = 1 |
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
#!/bin/sh | |
vector=$1 | |
border=$2 | |
/usr/bin/gnuplot <<EOF | |
ismin(x) = (x<min)?min=x:0 | |
ismax(x) = (x>max)?max=x:0 | |
grabx(x)=(x<x0)?x0=x:(x>x1)?x1=x:0 |
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
291 126 -1 | |
269 60 1 | |
293 291 1 | |
265 195 1 | |
380 133 -1 | |
294 211 1 | |
170 156 -1 | |
180 249 1 | |
239 201 1 | |
293 164 -1 |
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
require 'pp' | |
require 'set' | |
class Array | |
def rotmin | |
self.rotate(self.index(self.min)) | |
end | |
end | |
class Permutation < Array |
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
;; '((1 . 2) (2 . 3) (3 . 1)) | |
;; '((1 . 4) (2 . 3) (4 . 1) (3 . 2)) | |
;; '((5 . 1) (4 . 2) (2 . 5) (3 . 4) (1 . 3)) | |
(defun mapping (item g) | |
(cdr (assoc item g))) | |
(defun normalize (g) | |
(sort g #'(lambda (x y) (< (car x) (car y))))) |
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
require 'mp3info' | |
dir = '/my/music/library/' | |
Dir::glob(dir + '*.mp3').each {|f| | |
Mp3Info.open(f) do |mp3| | |
t = mp3.tag.title | |
title = t.slice(t.rindex('/') + 2, t.length) | |
artist = t.slice(0, t.rindex('/') - 1) | |
if title.index(' - ') |
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
require 'pp' | |
str = 'a+b*c*(d+e)+f+g' | |
$idx = 0 | |
def term(str) | |
ops = [] | |
while $idx < str.length | |
if str[$idx] == '(' |
OlderNewer