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 script that ties the files with same prefix, | |
import sys, os, re | |
prefix = sys.argv[1] | |
suffix = '.avi' | |
valid = re.compile( r'^%s%s' % (prefix, suffix) ) | |
list = os.listdir('.') |
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 Foundation import * | |
from ScriptingBridge import * | |
import time, twitter | |
iTunes = SBApplication.applicationWithBundleIdentifier_("com.apple.iTunes") | |
prev = current = iTunes.currentTrack().name() | |
api = twitter.Api("kuenishi", "***********") | |
while(True): | |
if (current != prev): # new track has came! |
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
print open(__file__).read() |
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
# index-generation script for search.py - an easy desktop search script | |
import sys, os, re, pickle, stat | |
pfile = "_filelist.pkl" | |
path_separator = "\\" | |
#class File: | |
# def __init__(self, path, filename): | |
# self.path = path | |
# self.filename = filename |
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
# Copyright (c) 2010 UENISHI Kota | |
# | |
# Permission is hereby granted, free of charge, to any person obtaining a copy | |
# of this software and associated documentation files (the "Software"), to deal | |
# in the Software without restriction, including without limitation the rights | |
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
# copies of the Software, and to permit persons to whom the Software is | |
# furnished to do so, subject to the following conditions: | |
# | |
# The above copyright notice and this permission notice shall be included in |
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
% MIT License: http://www.opensource.org/licenses/mit-license.php | |
% | |
% as the data exceeds data-size limit of one dets file, | |
% dets:insert/2 returns {error,{{bad_object,read_buckets},"test.dets"}}. | |
module(dets_test). | |
-export([test/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
-module(hex). | |
-export([itos/1, hashs/1]). | |
-type hexchar() :: 48..57 | 65..70 . | |
-spec itos( I::non_neg_integer() )-> [ hexchar() ]. | |
itos(I) when is_integer(I)-> | |
lists:reverse(itos_(I)). |
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
/* | |
Copyright (c) 2010 kuenishi <kuenishi_at_gmail.com> | |
Permission is hereby granted, free of charge, to any person obtaining a copy | |
of this software and associated documentation files (the "Software"), to deal | |
in the Software without restriction, including without limitation the rights | |
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
copies of the Software, and to permit persons to whom the Software is | |
furnished to do so, subject to the following conditions: |
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(yc). % Y Combinator | |
-compile(export_all). | |
-spec f( Fact::fun( (integer())-> integer() ) )-> fun((integer())-> integer()). | |
f(Fact)-> fun (1)-> 1;(X)-> X*Fact(X-1) end. | |
-spec y( F::fun( (fun((TypeA)-> TypeB)) -> fun((TypeA)-> TypeB) ))-> fun((TypeA)->TypeB). | |
y(F)-> fun(X)-> (F( y(F)))(X) end. | |
-spec do(integer())-> integer(). |
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
(* solving http://recruit.drecom.co.jp/event2010 | |
State the minimum combination of initial value | |
in Fibonacci series including 7110. | |
※limit to Natural number | |
7110を含むフィボナッチ数列で、 | |
初期値の組み合わせが一番小さいものをあげろ。 | |
※自然数に限る *) |