七行プログラミング (452レス)
七行プログラミング http://medaka.5ch.net/test/read.cgi/php/1036141603/
上
下
前
次
1-
新
通常表示
512バイト分割
レス栞
384: nobodyさん [sage] 2006/01/25(水) 22:06:31 ID:??? 初回起動時からの累計と過去1週間の日別カウンタ。 設定を変えれば一日の時間別みたいな使い方もできる。 ($f,$l,$z)=qw{./counter.dat 7 5};use CGI':all';sub d{sprintf '%d年%02d月%02d日(%s)',1900+$_[5],1+$_[4],$_[3],(qw/日 月 火 水 木 金 土/)[$_[6 ]]}sub n{sprintf"%0${z}d回",shift}$n=time;$d=24*60*60;$p=$n-$n%$d;if(open F, "+<$f"){eval{flock F,2};($s,@d)=map[split/\s+/],<F>;$s->[0]||=$n;$s->[1]++;$p== $d[0][0]?$d[0][1]++:unshift@d,[$p,1];$n-=$d*$l;seek F,0,0;printf F"%d\t%010d\n" ,@$_ for@d=($s,grep$n<$_->[0],splice@d,0,$l);truncate F,tell F;close F}charset '';print header,ul map{li b(n$_->[1]),d localtime$_->[0]}@d http://medaka.5ch.net/test/read.cgi/php/1036141603/384
メモ帳
(0/65535文字)
上
下
前
次
1-
新
書
関
写
板
覧
索
設
栞
歴
あと 68 レスあります
スレ情報
赤レス抽出
画像レス抽出
歴の未読スレ
AAサムネイル
Google検索
Wikipedia
ぬこの手
ぬこTOP
0.029s