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
<html> | |
<head> | |
<title>diff player</title> | |
<script type="text/javascript" src="play.js"></script> | |
</head> | |
<body> | |
<textarea id="text"></textarea> | |
<br /> | |
<textarea id = "diff"></textarea> | |
<button id="start">start</button> |
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
<html> | |
<head> | |
<title>difftest</title> | |
<script type="text/javascript" src="test.js"></script> | |
</head> | |
<body> | |
<textarea id="text"></textarea> | |
<br /> | |
<textarea id="res"></textarea> | |
</body> |
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
-- http://d.hatena.ne.jp/ku-ma-me/20100901/p1 ここ参考にして書いた | |
import Data.Char | |
samplingRate = 8000 | |
sinWaveGen f cnt = sin (2 * pi * f / (fromIntegral samplingRate) * cnt * 1.0) | |
sinWave f = map (\i -> 256 / 2 + 60 * sinWaveGen f i) [1..] | |
wave = (take 4000 $ sinWave 440) ++ (take 4000 $ sinWave 880) |
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 'net/http' | |
# Userオブジェクト生成 idはスクリーンネーム(例: "toshi_a") | |
# ここ適当なのでもっと良い方法があるかも | |
def openuser_create_user(id) | |
json = nil | |
Net::HTTP.start("api.twitter.com", 80) {|http| | |
res = http.get("/1/users/show/" + id + ".json") |
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 File.expand_path('utils') | |
miquire :core, 'environment' | |
miquire :mui, 'skin' | |
require 'gtk2' | |
require 'net/http' | |
require 'uri' | |
require 'digest/md5' | |
require 'thread' |
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
miquire :core, 'messageconverters' | |
miquire :addon, 'addon' | |
class TCo < MessageConverters | |
require 'uri' | |
require 'net/http' | |
def plugin_name() | |
:tco | |
end | |
def shrink_url(url) |
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
# 元ネタ: http://dis.4chan.org/read/prog/1295544154 | |
# Sleep Sortみたいなものを時間待ちも無ければプロセス生成も無い方法で | |
class A | |
def initialize(a) | |
@a = a | |
@b = a | |
end | |
def next | |
@a = @a - 1 | |
SleepSort.add(@b) if @a == 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
import std.string; | |
extern (C) { | |
alias uint VALUE; | |
extern void ruby_init(); | |
extern VALUE rb_eval_string(const char*); | |
extern void ruby_cleanup(int); | |
} | |
int main() { |
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 'curses' | |
to_o_pos = [[3, 2], [4, 2], [5, 2], [2, 3], [6, 3], [2, 4], [6, 4], [2, 5], [6, 5], [3, 6], [4, 6], [5, 6]] | |
to_r_pos = [[9, 2], [12, 2], [13, 2], [9, 3], [11, 3], [9, 4], [10, 4], [9, 5], [9, 6]] | |
to_z_pos = [[16, 2], [17, 2], [18, 2], [19, 2], [20, 2], [19, 3], [18, 4], [17, 5], [16, 6], [17, 6], [18, 6], [19, 6], [20, 6]] | |
def make_rand_pos_arr(count) | |
arr = [] | |
count.times { | |
arr << [rand(21), rand(9)] |