URI::QueryParamのquery_paramよりquery_param_appendを使用した方がいい理由について
URI::QueryParam - Additional query methods for URIs
https://metacpan.org/pod/URI::QueryParam
perlにはURI::QueryParamというモジュールがありまして、URIモジュールだけだと
届かない痒いところに手が届くことをしてくれるモジュールです。
例えば、uriから特定のパラメータだけを削りたいとかそういう場合
URIだけだと面倒なんですが、URI::QueryParamがあれば割と簡単に消せます。
# uri_query.pl use strict; use warnings; use URI; use URI::QueryParam; my $uri = URI->new('http://google.com/'); $uri->query_form( a => 1 ); warn $uri->as_string; $uri->query_param_delete('a'); warn $uri->as_string;
http://google.com/?a=1 at uri_query.pl line 8. http://google.com/ at uri_query.pl line 10.
その逆の追加もよろしくやってくれて
同一パラメータでもちゃんと追加対象にしてくれています。
# uri_query.pl use strict; use warnings; use URI; use URI::QueryParam; my $uri = URI->new('http://google.com/'); $uri->query_form( a => 1 ); warn $uri->as_string; $uri->query_param_append( a => 1 ); warn $uri->as_string;
http://google.com/?a=1 at uri_query.pl line 8. http://google.com/?a=1&a=1 at uri_query.pl line 10.
問題は初期化時にどうすべきか?
ということでして、通常であればこういう感じにしてあげれば
メソッドの利用目的にも合っているのではないかと思うのですが、
# uri_query.pl use strict; use warnings; use URI; use URI::QueryParam; sub add_default_param { my $uri = URI->new(shift); $uri->query_param_append( a => 1 ); $uri->query_param_append( b => 1 ); $uri->as_string; } warn add_uri_param('http://google.com/?hoge=1');
条件
- 渡される引数が想定可能であり、
- なおかつ同一パラメーターが無い
query_paramとどちらをおすすめすべきか?を定量的に返したい。
- 想定できない場合においてはquery_param_appendが正しいはず。
- 一応運用上の問題点を挙げるなら、安易にまねされるケースがあり得るなどがあげられます。
- とりあえずそこを無視した場合にquery_param_appendを推奨するに足る根拠が欲しい。
use strict; use warnings; use Benchmark qw(:all); use URI; use URI::QueryParam; my $count = 100000; timethese($count, { query_param => sub { my $uri = URI->new('http://google.com/'); $uri->query_param( a => 1 ); $uri->query_param( b => 1 ); $uri->query_param( c => 1 ); $uri->query_param( d => 1 ); $uri->query_param( f => 1 ); $uri->as_string; }, query_param_append => sub { my $uri = URI->new('http://google.com/'); $uri->query_param_append( a => 1 ); $uri->query_param_append( b => 1 ); $uri->query_param_append( c => 1 ); $uri->query_param_append( d => 1 ); $uri->query_param_append( f => 1 ); $uri->as_string; }, });
とりあえず、2回ほど試してみた。
Benchmark: timing 100000 iterations of query_param, query_param_append... query_param: 17 wallclock secs (17.43 usr + 0.00 sys = 17.43 CPU) @ 5737.23/s (n=100000) query_param_append: 14 wallclock secs (13.20 usr + 0.00 sys = 13.20 CPU) @ 7575.76/s (n=100000) Benchmark: timing 100000 iterations of query_param, query_param_append... query_param: 19 wallclock secs (18.46 usr + 0.00 sys = 18.46 CPU) @ 5417.12/s (n=100000) query_param_append: 14 wallclock secs (14.27 usr + 0.01 sys = 14.28 CPU) @ 7002.80/s (n=100000)
appendの方が高速のようだ。いったんこの結果が一つの理由になるので𠮷とする。
ただ、内部的にどうなのか追いたいので後日追記します。(短いのである程度は判明してますが)
coreutilsに何が入っているのか
いいコマンドがないか調べ物をしていると、それXXがあるよいわれ、更にそこからたどっていくとcoreutilsに入っていたというパターンにやたら遭遇するのでcoreutilsに何が入っているかを確認してみました。環境はUbuntuの14.04です。apt-get source coreutilsでソースがDLできたので
「ls man/*.x | wc -l」で104個ありました。確認してみたところ、普段よく見るコマンドは40個ぐらいでした。
cat - concatenate files and print on the standard output chgrp - change group ownership chmod - change file mode bits chown - change file owner and group cp - copy files and directories cut - remove sections from each line of files date - print or set the system date and time du - estimate file space usage echo - display a line of text env - run a program in a modified environment false - do nothing, unsuccessfully head - output the first part of files hostname - show or set the system's host name groups - print the groups a user is in kill - send a signal to a process ln - make links between files ls - list directory contents mkdir - make directories mv - move (rename) files nice - run a program with modified scheduling priority pwd - print name of current/working directory rm - remove files or directories sleep - delay for a specified amount of time sort - sort lines of text files stat - display file or file system status tail - output the last part of files tee - read from standard input and write to standard output and files test - check file types and compare values touch - change file timestamps uniq - report or omit repeated lines wc - print newline, word, and byte counts for each file who - show who is logged on yes - output a string repeatedly until killed whoami - print effective userid df - report file system disk space usage dir - list directory contents
最初の頃、自分が知らなくてあとで知って驚いた名前から役割を勘違いしやすい物がわりとあります。例えば、普段ファイルを生成するためにtouchコマンドを使用したりするんですが、実はこのコマンド、「touch - change file timestamps」というコマンドでfileのタイムスタンプを更新するコマンドなんですよね。存在しないファイルを指定したときに生成してタイムスタンプを更新するから結果的にファイルを生成しているようです。オプションで -c をつけると生成しなくなるようです。killとかシステムコールでも同じ名前がついてるからそうなったんでしょうけどプロセスに対してシグナルを送信するためのコマンドでオプションで送信するシグナルが選べます。詳細についてはsignal(7)「Standard signals」で見られるようです。よく、kill -9 をしてプロセスを殺していますがSIGKILLしているだけだったりします。
残りの60個以上のコマンドはあんまり普段目にしないので、目についたものを実際に叩いてみます。
chcon
SELinuxのコンテキストを変更するコマンドなのでほとんど目にする機会は無いです。
base64
- dオプションでdecodeできます。
base64 TODO IG11Y2ggdXNlIGZvciBpbWF4dG9zdHIgbm93YWRheXMsCiAgc2luY2UgdGhlIGludHR5cGVzIG1v ZHVsZSBhbmQgbmV3ZXIgdmVyc2lvbnMgb2YgZ2V0dGV4dCBhbGxvdyB0aGluZ3MKICBsaWtlIF8o InRydW5jYXRpbmcgJXMgYXQgJSIgUFJJZE1BWCAiIGJ5dGVzIikgdG8gd29yayBwb3J0YWJseS4K ICBJIHN1c3BlY3QgdGhhdCAoaWYgc29tZW9uZSBjYXJlcyB0byB0YWtlIHRoZSB0aW1lKSB3ZSBj YW4gcmVtb3ZlCiAgYWxsIGluc3RhbmNlcyBvZiBpbWF4dG9zdHIgYW5kIHVtYXh0b3N0ciBpbiBj
basename
/paht/to/filenameというような文字列をfilenameだけにします。
basename /path/to/filename filename
chroot
ルートディレクトリを変更するコマンド。
Jailコマンドと一緒に使用する物らしい。
comm
事前にsortされた2つのファイルを行ごとに比較する。
下記のような3カラムを出力する。
-1 suppress column 1 (lines unique to FILE1) -2 suppress column 2 (lines unique to FILE2) -3 suppress column 3 (lines that appear in both files)
csplit
与えたパターンに従ってファイルを分割します
csplit NEWS /\n/ 0 169442 # 出力されるファイル xx00 xx01 # パターンを適用する回数も指定できる # 大量にファイルができるので注意が必要 csplit NEWS /\n/ '{*}'
dd
ファイルを変換してコピーする。
convオプションを使用すると変換ができる
dd conv=lcase if=NEWS of=/tmp/NEWS 330+1 レコード入力 330+1 レコード出力 169442 バイト (169 kB) コピーされました、 0.00105946 秒、 160 MB/秒
dircolors
lsを使った際に表示される色の設定をするコマンド。
コマンド叩くと大量に設定が出てきます。
dircolors LS_COLORS='rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arj=01;31:*.taz=01;31:*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.dz=01;31:*.gz=01;31:*.lz=01;31:*.xz=01;31:*.bz2=01;31:*.bz=01;31:*.tbz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.war=01;31:*.ear=01;31:*.sar=01;31:*.rar=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.jpg=01;35:*.jpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.webm=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.flv=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.cgm=01;35:*.emf=01;35:*.axv=01;35:*.anx=01;35:*.ogv=01;35:*.ogx=01;35:*.aac=00;36:*.au=00;36:*.flac=00;36:*.mid=00;36:*.midi=00;36:*.mka=00;36:*.mp3=00;36:*.mpc=00;36:*.ogg=00;36:*.ra=00;36:*.wav=00;36:*.axa=00;36:*.oga=00;36:*.spx=00;36:*.xspf=00;36:'; export LS_COLORS
dirname
ディレクトリ名だけをパスから取得する
dirname /path/to/name /path/to
expand
タブをスペースに変換する
expr
単純に計算をしてくれます。
expr 1 + 60 61 expr 2 '*' 60 120
fmt
テキストの幅やスペースを整形してくれるフォーマッタ。
使ってみたんだがいまいち期待した動作をしてない気がする。
fold
指定した長さやバイト数で行の折りたたみを行うコマンド。
fold -w 20 NEWS Texts, and with no B ack-Cover Texts. A copy of th e license is include d in the "GNU Free Documentation Licens e" file as part of t his distribution.
install
指定されたファイルをコピーして属性を指定するコマンド。
cpと違って属性を指定できるのが特徴。
install -v ./src/install.c /tmp/src `./src/install.c' -> `/tmp/src/install.c'
join
2つのファイルの共通の行を統合して出す。
> cat > file1 1,2,3 4,5,6 7,8,9 > cat > file2 1,2,3 4,5,6 7,8,9 10,11,12 > join file1 file2 1,2,3 4,5,6 7,8,9
link
ファイルのリンクを作成する。
> link file1 linkfile > ls -al 08:58 file1 08:59 file2 08:58 linkfile # リンク元のファイルのタイムスタンプを更新 > touch file1 > ls -al 09:04 file1 08:59 file2 09:04 linkfile
mkfifo
名前付きパイプを作成する。
別の言い方をするとFIFOスペシャルファイル
UNIXにはpipeという機能があるのですがこれに名前をつけた物がそれです。
データを名前付きpipeに書き込んでそれをファイルとして扱うなどが用途として考えら選れる。
> mkfifo named_pipe
mknod
スペシャルファイルを作成するコマンド
block,charctor,fifoといったスペシャルファイルを作成できる。
> sudo mknod sfile b 11 0 # less /proc/devices
- info mkcnd
mktemp
テンポラリファイルを作成する。
- dで添付ディレクトリを作成する。
> mktemp /tmp/tmp.dPp4YD0dMc > mktemp -d /tmp/tmp.IM0k9iEPqR > file /tmp/tmp.IM0k9iEPqR /tmp/tmp.IM0k9iEPqR: directory
nohup
ハングアップシグナルを無視してコマンドを実行してttyへ出力しない。
端的に言い換えると、ログアウトした場合もバックグランドでコマンドが実行される。
> nohup echo "hoge" nohup: 入力を無視し、出力を `nohup.out' に追記します > cat nohup.out hoge
nproc
使用可能なプロセスユニット数を表示する。
> nproc 3
numfmt
数値を人間が読みやすいようにフォーマットする
manでマニュアル読むと--toに設定できる物が載っている。
> numfmt --to=si 1024 1.1K
od
ファイルを8進数もしくは他の形式で出力する。
主にバイナリファイルを16進数で表示したりする。
> od -x /bin/dir 0000000 457f 464c 0102 0001 0000 0000 0000 0000 0000020 0002 003e 0001 0000 4890 0040 0000 0000 0000040 0040 0000 0000 0000 a700 0001 0000 0000 0000060 0000 0000 0040 0038 0009 0040 001c 001b
paste
ファイルを行単位でmergeする。
> paste /tmp/file1 /tmp/file2 11111 33333 22222 44444 # /tmp/file1 # 11111 # 22222 # /tmp/file2 # 33333 # 44444
pathchk
ファイル名が有効か可搬性があるかどうかを調査する。
> pathchk /tmp/_x_dir
pinky
ログインしているユーザーの情報を表示
> pinky ログイン 名前 端末 待機 開始時刻 ログイン元 hoge hoge pts/0 2015-03-21 15:25 xxx-xxx-xxx-xx-xxx.xxx.xxx.ad.jp
pr
印刷用にテキストファイルをコンバートします。
> pr -W 20 README under the terms of t any later version pu Invariant Sections,
printenv
環境変数を表示する。
envとの違いがよく分からない。
> printenv EDITOR=/usr/bin/vim GIT_EDITOR=vim GOROOT=/usr/local/go LANG=ja_JP.UTF-8
printf
Cなどでおなじみのデータをフォーマットしてくれるコマンド。
> printf "%05d\n" 100 00100
ptx
ファイルの内容の整列済み索引を出力する。
> ptx README written ChangeLog entry,/ A complete patch includes a well- in the "GNU Free/ A copy of the license is included /only partial (and incompatible) ACL support, so although ".// The solution is to turn off ACL support manually via ".//
rmdir
空のディレクトリを削除する
rm -rに近い気がする。
> rmdir hoge
runcon
指定されたセキュリティコンテキストでコマンドを実行する。
SELinuxの関連らしい。
seq
連続した値を出力します。
> seq 5 1 2 3 4 5
sha1sum
> sha1sum README
8478daeff15e747906448f1471e09a62e59f457c README
類似に以下の様な物がある。
sha224sum - compute and check SHA224 message digest sha256sum - compute and check SHA256 message digest sha384sum - compute and check SHA384 message digest sha512sum - compute and check SHA512 message digest
shred
ファイルを上書きして、完全に消す。
rmの場合は(extundelete)復旧できる可能性がある。
> shred /tmp/tmp.OxrpPi3D3t
shuf
ランダムな順列を作成します。
> shuf /tmp/file1 11111 22222 > shuf /tmp/file1 22222 11111
split
ファイルを分割する
csplitのほうが若干便利そうなきがする。
> split -1 /tmp/file1 xaa xbb
stdbuf
標準入出力ストリームのバッファ動作を変更して指定されたコマンドを実行します。
バッファリングの調整に使われるのを発見してびっくりした。
> stdbuf -o0 -e0 echo "hello" > /tmp/aaa
stty
端末ラインの設定を変更表示する。
> stty speed 38400 baud; line = 0; eol = M-^?; eol2 = M-^?; -brkint -imaxbel iutf8
tac
ファイルの行を逆順にして表示します。
> tac README | tail -n 3 the GNU fileutils, sh-utils, and textutils packages. These are the GNU core utilities. This package is the union of > head -n 3 README These are the GNU core utilities. This package is the union of the GNU fileutils, sh-utils, and textutils packages.
timeout
コマンドをタイムアウトをつけて実行します。
> time timeout 20 sleep 100 timeout 20 sleep 100 0.00s user 0.00s system 0% cpu 20.002 total
tr
文字を変換消去する。
> cat README | tr '[:lower:]' '[:upper:]' INVARIANT SECTIONS, WITH NO FRONT-COVER TEXTS, AND WITH NO BACK-COVER TEXTS. A COPY OF THE LICENSE IS INCLUDED IN THE "GNU FREE DOCUMENTATION LICENSE" FILE AS PART OF THIS DISTRIBUTION.
truncate
ファイルのサイズを指定されたサイズに切り詰めもしくは拡張する
> truncate -s 1000000 testfile -rw-rw-r-- 1 hoge hoge 1000000 3月 21 22:25 testfile
tsort
トポロジカルソートを行う。
> tsort TODO | head -n 3 tsort: " "test" "x\ty\n" TODO: 入力にループが含まれています: tsort: are tsort: some
tty
標準入力に接続されている端末のファイル名を出す。
> tty /dev/pts/7
unexpand
スペースをタブに変換します。
uptime
現在時刻やシステムが起動してからの時間やLAなどを表示します。
> uptime 23:13:56 up 8 days, 5:07, 1 user, load average: 0.00, 0.01, 0.05
users
現在ログインしているユーザーの一覧を返します。
vdir
ディレクトリ内部のコンテンツを表示します。
lsのオプションでも代用できそう。
vimでperlを開発するための最小限の設定
必要最小限でvimでのperl開発(utf8)するのにどんな設定渡したらいいかなと考えてまとめてみました。
多分これでいけそうな気がしてる。(要検証)これを作成した過程で不要な設定などいくつか自分の環境における不要な設定が発見できたのはよかった。
代表的な物は以下の2つかな。
- termencoding
- nocompatible see Vim - set nocompatibleはもういらない - Qiita
fileencodingとfencの関係がいまいちよく分からないので後で調べます。
.vimrc
"must set expandtab set shiftwidth=4 set shiftround set autoindent set fileencoding=utf-8 set fileencodings=utf-8 set encoding=utf-8 set fenc=utf-8 "optional set number set hidden set hlsearch augroup filetypedetect autocmd! BufNewFile,BufRead *.t setf perl autocmd! BufNewFile,BufRead *.psgi setf perl autocmd! BufNewFile,BufRead *.tt setf tt2html augroup END
参照
- http://vim-jp.org/vimdoc-ja/
- http://perl-users.jp/articles/advent-calendar/2012/casual/13
- http://qiita.com/yu_suke1994/items/e0a19574994a57c8fe17
- http://vimblog.hatenablog.com/entry/vimrc_key_mapping
- http://nanasi.jp/articles/howto/editing/et-inserttab.html
- http://vimwiki.net/?%27shiftround%27
- http://17-m.seesaa.net/article/196516530.html
- http://nanasi.jp/articles/howto/note/top10-viuser-need-to-know-about-vim.html
- http://d.hatena.ne.jp/wiredool/20120618/1340019962
コーディング規約について
コンピュータ言語にはコーディング規約という、コードを書くときのルールのようなものがあります。
割とそういうものがあること自体は知られているのですが、自分自身はPerlのPBPが出たときに読んだぐらいで実際には、公開されている割とメジャーなソースコード基準で書いていたところもありそこまで気にしてませんでした。他言語やるときも言語学習を意識していたので真面目に参照してなかったんですが、思うところあって調べてみました。とりあえず気になる言語のStyleGuidを集めてみました。規約がかっちりしてる言語はこの辺にしたがっておいたほうが無難かと思われます。
この辺に準拠するメリットとしては、大規模開発において可読性を上げる。という点が大きいとは思います。可読性を上げることによって保守性があがるわけです。ただ、あくまでGuideであり規約でしかないので徹底されづらい気はしてます。goとかそうですけど言語によってある程度縛りをかけてしまうとか、Python見たいにindentを強要するとか、テストにその辺を守っているかどうかを検証するかしないと低コストで徹底するのは難しい気はしてます。やれるとすれば集団として一回それで勉強会をして周知するとかそういうことをやるしかないのかなとも思っています。
それにしても、Googleのスタイルガイドが強すぎますね。
+ https://www.python.org/dev/peps/pep-0008/
+ http://perldoc.perl.org/perlstyle.html
+ http://perldoc.jp/docs/perl/5.8.0/perlstyle.pod
+ 参照
+ http://blog.64p.org/entry/2013/03/29/112910
+ 公式としては「ない」というのが解答のようです。
+ ただ、独自な規約のようなものは割とあって参考が参照のURLに書かれています
+ 参照
+ http://www.ruby.or.jp/ja/tech/development/ruby/050_coding_rule.html
+ 最近ではGoolgeのものが有名なようです。
+ http://google-styleguide.googlecode.com/svn/trunk/javaguide.html
+ Mozilla当たりがそうかなとおもいつつここでもGoogle人気です。
+ https://google-styleguide.googlecode.com/svn/trunk/javascriptguide.xml
+ https://developer.mozilla.org/ja/docs/JavaScript_style_guide
+ 参照
+ http://efcl.info/2011/0527/res2764/
Scalaで中規模のプロダクトで参考にしたいものを探したかったので抽出してみた
言語習得をしようとした場合、ある程度のところにきたら参考にしたほうがいいと思われる現実に動いているコードを見たくなります。ところが門外漢の場合はその分野はよく分からないので非常に探しづらいです。探せても、ものすごく規模の大きいコードだったりするので辛いです。そこで、
- 世の中の公開されていて有用なコードは大抵githubにある
- そういうコードは大量にstarがついている
この仮定に基づきgithub apiを使用して見た方が良さそうなプロダクトを出してみました。
- starの数でorderをかけて上位をもらってきました。
- さらにそこからsizeでorderをかけて表示しています
さすがにSparkは人気高すぎですね(sizeも大きすぎますが)。
単純にsizeで切り分けるとfpinscala当たりから下が割と見るのに楽そうかな
と思いました。
結果
size: 1301149 stars: 2975 url: https://github.com/apache/spark size: 239164 stars: 3584 url: https://github.com/akka/akka size: 184359 stars: 3696 url: https://github.com/scala/scala size: 117478 stars: 5866 url: https://github.com/playframework/playframework size: 117306 stars: 2580 url: https://github.com/twitter/kestrel size: 104082 stars: 1725 url: https://github.com/scalaz/scalaz size: 91885 stars: 1767 url: https://github.com/twitter/scala_school size: 72924 stars: 1462 url: https://github.com/mesos/spark size: 71091 stars: 1565 url: https://github.com/snowplow/snowplow size: 48598 stars: 2097 url: https://github.com/sbt/sbt size: 45302 stars: 1636 url: https://github.com/gatling/gatling size: 33105 stars: 5941 url: https://github.com/PredictionIO/PredictionIO size: 32448 stars: 1798 url: https://github.com/spray/spray size: 32011 stars: 3226 url: https://github.com/twitter/finagle size: 25413 stars: 3795 url: https://github.com/takezoe/gitbucket size: 24529 stars: 1197 url: https://github.com/apache/kafka size: 22289 stars: 1155 url: https://github.com/mesosphere/marathon size: 20726 stars: 1962 url: https://github.com/twitter/scalding size: 17587 stars: 2455 url: https://github.com/swagger-api/swagger-core size: 13333 stars: 1508 url: https://github.com/scala-js/scala-js size: 12360 stars: 1563 url: https://github.com/scalatra/scalatra size: 11948 stars: 1430 url: https://github.com/twitter/summingbird size: 6742 stars: 1152 url: https://github.com/fpinscala/fpinscala size: 5850 stars: 1366 url: https://github.com/pocorall/scaloid size: 5458 stars: 2432 url: https://github.com/twitter/flockdb size: 5284 stars: 1951 url: https://github.com/twitter/gizzard size: 5265 stars: 2032 url: https://github.com/twitter/snowflake size: 4580 stars: 1157 url: https://github.com/GravityLabs/goose size: 602 stars: 2947 url: https://github.com/lhartikk/ArnoldC size: 494 stars: 1721 url: https://github.com/MojoJolo/textteaser
抽出用スクリプト
use strict; use warnings; use LWP::UserAgent; use JSON; my $url = 'https://api.github.com/search/repositories?q=language:scala&sort=stars&order=desc'; my $ua = LWP::UserAgent->new; my $response = $ua->get($url); unless( $response->is_success ) { die $response->status_line; } my $json = $response->decoded_content; my $data = decode_json($json); for my $item ( sort { $b->{size} <=> $a->{size} } @{ $data->{items} } ) { printf("size: %s stars: %s url: %s\n", $item->{size}, $item->{stargazers_count}, $item->{svn_url}); }
Diagrammixを購入してみました
Diagrammixというフローチャート、ダイアグラム、そしてUMLを簡単に作成出来るツールを購入してみました。個人的にはUMLモデルを作成出来る点も大きかったです。使い方も割と直感的で使いやすいので今のところ好印象です。
短時間で人に認識を伝えるのが難しい
「コードがあれば」、「文章があれば」という方もいらっしゃられるし自身も昔はそう思っていたところがありました。しかし、ビジネスや発表などの要件で短時間で齟齬無く言葉だけで伝える、聞き取るのは割と高度な技術では無いかという(もちろんそれがすんなり出来る方もいらっしゃいます)と考えさせられることがたまにありましてこちらを補助としてうまく使えると思い購入してみました。
別途必要な物
ちゃんとした書き方を学ばないと宝の持ち腐れになりそうなのでその辺は別途書籍
を買って勉強したいと思います。
UML モデリングのエッセンス 第3版 (Object Oriented SELECTION)
- 作者: マーチン・ファウラー,羽生田栄一
- 出版社/メーカー: 翔泳社
- 発売日: 2005/06/16
- メディア: 単行本
- 購入: 8人 クリック: 254回
- この商品を含むブログ (92件) を見る