2011-01-01から1年間の記事一覧

awk script language for text operation

I was looking for fileAPI today. then found blog post that it is write about text operation using javascript and fileAPI. This page introduces how to rewrite contents(csv.data) in file. after complete to read contents, it would rewrote by …

perlからunixコマンドを実行する

こんな感じ。 use warnings; use strict; open(FI,"ls|")||die; my @s = <FI>; close(FI); my $arg = $ARGV[0]; foreach my $i(@s){ chop($i); if($i =~ /$arg/){ print "$i.\n"; } } ユーザーとかプロセス見たりとか、 システム管理に使えるかも。 でもrmとかし</fi>…

perlで配列の要素を取り出す方法

my $num = [1,2,3]; print($num->[0]); my @num2 = (1,2,3); print($num2[0]); 上が配列のリファレンス、下が配列。 これって何が違うんだ。 アドレスを取得してるかどうかしかわかんないけど、 ほかに違いがあるのかな。 どっちがいいんだろうねー。

掛け算の九九

php

なぜか書きたくなったので。 \n"); echo("<tr>\n"); for($k=1;$k<10;$k++){ if($k==1){ echo("<td> </td>"); } echo("<td>".$k."の段</td>"); } echo("\n</tr>\n\n"); for($i=1;$i<10;$i++){ echo("<tr>\n"); echo("<td>".$i."</td>"); for($j=1;$j<10;$j++){ echo("<td>".$i*$j."</td>"); if($j==9){ ech…</tr>