2008-12-01から1ヶ月間の記事一覧

国立邪宗門が終わってしまった件

とうとうマスターが亡くなってしまい、12/21をもって営業終了という話を聞いたので、昨日行ってきた。 この、物が沢山あってゴチャゴチャした雰囲気が好きだった。

ファイルに何か書いたりとかする時に

今まで def f = new File('hoge.out'); f.write('HELLO WORLD!'); とかやってたんだけど、 def f = new File('hoge.out'); f << "HELLO WORLD!"; でも大丈夫らしい。最近気づいた。 そしてこっちの方が便利だと思う。

ディレクトリを再帰的に辿っていってファイル探すメモ

new File("/home/user01/futasuke").eachFileRecurse{ file -> if ( file.file && file.name =~ /.*\.jpg/ ) { printf "%s\n", file; } }; eachFileMatchRecurseとか無いんかねぇ...

javaでJarファイル読むときのメモ

import java.io.*; import java.util.*; import java.util.jar.*; public class Test{ public static void main(String args[]) { try{ JarFile jarfile = new JarFile(new File("SAMPLE.jar")); Enumeration<JarEntry> enm = jarfile.entries(); while(enm.hasMoreEle</jarentry>…

日付を表す文字列→struct tmへの変換メモ

c

#include <stdio.h> #include <time.h> #include <errno.h> #include <string.h> int main(int argc, char** argv){ if ( argc < 2 || strlen(argv[1]) < 8 ) { return -1; } /* struct tm の初期化 */ struct tm tmbuf; memset(&tmbuf,0x00,sizeof(struct tm)); /* 文字列→struct tmへの変換 */ </string.h></errno.h></time.h></stdio.h>…