by shigemk2

当面は技術的なことしか書かない

2013-05-03から1日間の記事一覧

97 Things Every Programmer Should Know 29 Don't Rely on Magic Happens Here

テニスに逆転ホームランはねぇ! there is an unconscious tendency to assume that they are simple and happen "by magic."

97 Things Every Programmer Should Know 32 Encapsulate Behavior, Not Just State

don't break the encapsulation, and use the power of your programming language to maintain it.

97 Things Every Programmer Should Know 26 Don't Ignore That Error!

If you ignore an error, turn a blind eye, and pretend that nothing has gone wrong, you run great risks.

97 Things Every Programmer Should Know 27 Don't Just Learn the Langage, Understand Its Culture

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…

97 Things Every Programmer Should Know 30 Don't Repeat Yourself

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つ目の子プロセスが終了してしまうが、 # その時親プロセス…

対話によるCommon Lisp入門 48 and その2

itemがlstの要素であるためには、lstが空リストでないこと (not null lst)) lstの先頭要素がitemであるか、 (eql item (first lst)) もしくはitemはリストの残りの部分の要素であるかである。 (member? item (rest lst)) (defun member? (item lst) (and (no…