Skip to content

Instantly share code, notes, and snippets.

View taichi's full-sized avatar
😸
shaving...

taichi taichi

😸
shaving...
View GitHub Profile
API
http://develop.github.com/p/gist.html
emacs向け
http://github.com/defunkt/gist.el/blob/master/gist.el
リクエスト処理
(defun* gist-request (url callback &optional params)
"Makes a request to `url' asynchronously, notifying `callback' when
complete. The github parameters are included in the request. Optionally
@taichi
taichi / スキルシミュレータ
Created September 27, 2010 15:17
スキルシミュレータ
まずココ。
http://www.geocities.jp/masax_mh/logic/index.html
まとめる
頑シミュでは検索前に全ての装飾品をハメてしまって、
可能性のあるポイントが一致するものをまとめています。
頑シミュでは検索後に、具体的には検索結果をクリックした時点で計算しなおしています。
@taichi
taichi / クエストセレクタ
Created September 27, 2010 15:35
クエストセレクタ
http://www7b.biglobe.ne.jp/~yumedori/monhankue.html
素材基準で選べるといいかもしれぬ。
@taichi
taichi / スキルシミュレータ設計
Created September 27, 2010 16:25
スキルシミュレータ設計
内部処理に関するメモ
400の5乗で、10兆以上のデータが最大では存在しうるとあるが、スキルが全く発生し得ないデータはどの程度あるだろうか?
そもそも、ガンナー装備と剣士装備は混ぜられないのだから、それよりも遥かに少ないデータ件数じゃね?
実行のたびに全件探索はありえないが、扱い易い形に一度だけ丸めるんなら、やっても良い気がする。
装備は半分ずつ存在するとして、1レコードが200バイトとすると、
(200 * 200 * 200 * 200 * 200 * 2 * 200) / (1024 * 1024 * 1024 * 1024) = 116.415322
116テラバイト。
@taichi
taichi / cython
Created October 31, 2010 13:24
cython
/* callback.h START*/
#ifndef _CALLBACK_H_
#define _CALLBACK_H_
typedef int (*op)(int,int);
int binary_op(int a, int b, op func);
#endif
/* callback.h END*/
@taichi
taichi / result.xml
Created December 8, 2010 06:04
arrow detection data
<?xml version="1.0"?>
<opencv_storage>
<result type_id="opencv-haar-classifier">
<size>
24 24</size>
<stages>
<_>
<!-- stage 0 -->
<trees>
<_>
@taichi
taichi / opencv
Created December 8, 2010 08:41
opencv学習コマンド。
opencv_createsamplesd.exe -img arrow.bmp -vec data.vec -num 3 -bgcolor 255
opencv_haartrainingd.exe -data result -vec data.vec -bg ngfiles.txt -npos 3 -nneg 11
@taichi
taichi / AddressTest.java
Created January 5, 2011 12:25
v6address matching regex test.
import java.util.regex.Pattern;
import junit.framework.Assert;
import org.junit.Test;
/**
*
* @author taichi
* @see <a href="http://tools.ietf.org/html/rfc4291">IP Version 6 Addressing
(
((?=(?>.*?::)(?!.*::)))
(::)?
([0-9a-f]{1,4}::?){0,5}|([0-9a-f]{1,4}:){6}
)
(
\2([0-9a-f]{1,4}(::?|$)){0,2}
|(
(25[0-5]|(2[0-4]|1[0-9]|[1-9])?[0-9])(\.|$)
){4}
static void brace() {
String regex = "((?=\\[.+\\])\\[?[a-z]+\\]?)";
Pattern p = Pattern.compile(regex);
String[] datas = { "[aaaa]", "[aaaa", "aaaa]", "aaaa" };
for (String s : datas) {
System.out.println(s);
System.out.println(p.matcher(s).matches());
System.out.println("********");
}
}