2013-05-03から1日間の記事一覧
テニスに逆転ホームランはねぇ! there is an unconscious tendency to assume that they are simple and happen "by magic."
don't break the encapsulation, and use the power of your programming language to maintain it.
If you ignore an error, turn a blind eye, and pretend that nothing has gone wrong, you run great risks.
If you instead explore new languages to expand your mind and get fresh ideas on how you can solve things in different ways, you will find that the code you write in your trusty old language gets more beautiful for every new language you've…
OF ALL THE PRINCIPLES OF PROGRAMMING, Don't Repeat Yourself (DRY) is perhaps one of the most fundamental. Duplication Is Waste "every piece of knowledge must have a single, unambiguous, authoritative representation within a system." Repeti…
終了した子プロセスの情報は親プロセスがProcess.waitを使うとかしない限り ずっと情報を持ち続ける。もしProcess.waitを使って子プロセスの終了を待たないつもりなら、 子プロセスをデタッチする必要がある。 # -*- coding: utf-8 -*- # 1秒後に終了する子…
# -*- coding: utf-8 -*- 2.times do fork do # いずれもすぐ終了する abort "Finished!" end end # 親プロセスは最初のプロセスの終了を待ってから、5秒間スリープする。 # スリープしている間に 2つ目の子プロセスが終了してしまうが、 # その時親プロセス…
itemがlstの要素であるためには、lstが空リストでないこと (not null lst)) lstの先頭要素がitemであるか、 (eql item (first lst)) もしくはitemはリストの残りの部分の要素であるかである。 (member? item (rest lst)) (defun member? (item lst) (and (no…