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
From 498781516131442c29fe6a967f03c404c5d830e8 Mon Sep 17 00:00:00 2001 | |
From: sora_harakami <[email protected]> | |
Date: Fri, 27 Mar 2009 15:07:37 +0900 | |
Subject: [PATCH] First commit | |
--- | |
bl_10_ffffff_6a6a6a.gif | Bin 0 -> 75 bytes | |
br_10_ffffff_6a6a6a.gif | Bin 0 -> 74 bytes | |
cpass.html | 339 +++++++++++++++++++++++++++++++++++++++++++ | |
favicon.ico | Bin 0 -> 318 bytes |
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
-module(fib). | |
-export([f/1,f/4]). | |
f(N) -> io:put_chars("1\n1\n"),f(1,1,1,N). | |
f(E,F,X,N) -> | |
if X > -1 -> io:put_chars(integer_to_list(E + F)), | |
io:put_chars("\n"), | |
if X /= N -> f(F,E+F,X+1,N); | |
true -> ok | |
end; | |
true -> ok |
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://ablog.seesaa.net/article/24578324.html | |
#を移植したものです。とりあえずライセンスは、Creative commonsの表示で。商用利用OKですが、自分の名前を明記してください。 | |
#クレジット:sorah 感謝:http://ablog.seesaa.net/article/24578324.html | |
#str=形態素解析したい文字列(日本語のみ) | |
#返却するのは分割された配列。 | |
def morphAnalyzer(str) | |
s = str.gsub(/([一-龠々〆ヵヶ]+|[ぁ-ん]+|[ァ-ヴー]+|[a-zA-Z0-9]+|[a-zA-Z0-9]+|[,.、。!!??()()「」『』]+|[ ]+)/,"\\1|") | |
ary = s.split("|") |
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
// ==UserScript== | |
// @name muReTweet | |
// @namespace muretweet | |
// @description | |
// @include http://twitter.com/*/statuses/* | |
// @include http://twitter.com/*/status/* | |
// ==/UserScript== | |
function xpath(query) { | |
var results = document.evaluate(query, document, null, | |
XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE, null); |
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 'socket' | |
require 'digest/md5' | |
require 'thread' | |
require 'timeout' | |
$q = Queue.new | |
$KCODE = 'u' | |
init_seed = [] | |
$regi_seed = [] | |
$talk_sum = [] | |
if ARGV[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
# -*-ruby-*- | |
require "open-uri" | |
require "uri" | |
require "kconv" | |
#Twitterのステータスのpermalinkを渡すと「id: 内容」とpost内容を返します。なにげに便利 | |
class TwitterBot < Nadoka::NDK_Bot | |
def on_privmsg prefix, ch, msg | |
if /^http:\/\/twitter.com\/(.+)\/(statuses|status)\/.+\/?$/ =~ msg | |
id = $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
# -*-ruby-*- | |
require "open-uri" | |
require "kconv" | |
#URLを渡すと、HTMLからTitleを取得し表示します。HTML以外ならcontent-typeを表示します | |
class TitleBot < Nadoka::NDK_Bot | |
# Yes person | |
def on_privmsg prefix, ch, msg | |
if /^(https?)(:\/\/[-_.!~*\'()a-zA-Z0-9;\/?:\@&=+\$,%#]+)$/ =~ msg |
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
# -*-ruby-*- | |
require "kconv" | |
require "cgi" | |
require "open-uri" | |
#「gcalc: 1+1」とかするとgoogle検索で計算し結果を表示します | |
class GcalcBot < Nadoka::NDK_Bot | |
#url http://www.google.co.jp/search?q= | |
# Yes person | |
def on_privmsg prefix, ch, msg | |
#send_notice(ch, "Yes, #{prefix.nick}!") |
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
#sorah's quicksort | |
def get_center(ar);if ar.length % 2 != 0;ar[(ar.length) / 2];else;ar[(ar.length-1) / 2];end;end | |
def get_center_index(ar);if ar.length % 2 != 0;return (ar.length) / 2;else;return (ar.length-1) / 2;end;end | |
def wsort | |
zen_pi = get_center_index(zen) | |
zen_p = get_center(zen) | |
i = nil | |
flag = false | |
zen.each_index {|n| |
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://gist.github.com/108009 |
OlderNewer