ときどきの雑記帖 倒行逆施編

最新ページへのリンク
目次ページへのリンク

一つ前へ 2015年6月(上旬)
一つ後へ 2015年6月(下旬)

ホームへ

2015年06月20日

■_

■_

2015年06月19日

■_

2015年06月18日

■_

2015年06月17日

■_

Sales Information
 
書泉ブックタワー (集計期間:6/7~6/13)
 
 1位 リーダブルコード 
 2位 Cython 
 3位 詳説 イーサネット 第2版 
 4位 データ匿名化手法 
 5位 データサイエンス講義 
 6位 マイクロインタラクション 
 7位 実践Vagrant 
 8位 プログラミングC# 第7版 
 9位 インタフェースデザインの実践教室 
 10位 Land of Lisp 

あ、ブックタワーには入ってたのか!>Cython

もういっこオライリーから。 Sales Information 今月のキャンペーンは、アニマルデザインのキャンバスバッグをプレゼント。白地にプリントされたペンギンのシルエットのデザインです。オライリーの書籍が数冊入るようにマチがついていますので、写真のサイズ感より収納力は大きいです。普段の鞄に加えて書籍を持ち運んだり、ちょっとしたお買い物にもお使いいただけます。 ぐはっ。欲しかったこれ。

■_

■_

はてなブックマーク - 「型」の定義に挑む | コンピュータサイエンス | POSTD 例のサイトの翻訳記事なんで内容はお察しなんですが、このふたつのコメントには笑った 良記事だと思うが、「この型システムは、論理でリンクに戻り、従来の”言語の安全性”プロパティを拡張します」といった残念な訳文がある、いつものPOSTDだ。 多分、このサイトでの翻訳は手に余るんじゃないかな。

翻訳記事の重箱の隅つつきは……いいか。

■_

"Literate programming - Wikipedia, the free encyclopedia" https://en.wikipedia.org/?title=Literate_programming "文芸的プログラミング - Wikipedia" https://ja.wikipedia.org/wiki/%E6%96%87%E8%8A%B8%E7%9A%84%E3%83%97%E3%83%AD%E3%82%B0%E3%83%A9%E3%83%9F%E3%83%B3%E3%82%B0

■_

Secure Coding Practices Checklist

Input Validation:

Conduct all data validation on a trusted system (e.g., The server)
すべてのエンコーディングを信頼できるシステム(サーバー)上で行うこと

Identify all data sources and classify them into trusted and untrusted.
Validate all data from untrusted sources (e.g., Databases, file streams, etc.)
すべてのデータ源を indentify し、それらを trusted なものと untrusted なものに分類する。
untrusted なデータ源(データベースやファイルストリームなど)からのデータはすべて validate する。

There should be a centralized input validation routine for the application
アプリケーション用の centralized input validation routine を持っているべきである。

Specify proper character sets, such as UTF-8, for all sources of input
すべての sources of input に対して、UTF-8 のような proper な character set を指定する

Encode data to a common character set before validating (Canonicalize)
validating に先立ち、common character set へエンコードする

All validation failures should result in input rejection
validation の失敗はすべて input rejection とすべきである

Determine if the system supports UTF-8 extended character sets and if so,
validate after UTF-8 decoding is completed
使用しているファイルシステムが UTF-8 の extended character set をサポートしているか判定し、
サポートしている場合には UTF-8 decoding が完了したあとで validate を行う

Validate all client provided data before processing, including all parameters,
URLs and HTTP header content (e.g. Cookie names and values).
Be sure to include automated post backs from JavaScript, Flash or other embedded code
処理を行う前に、すべてのパラメータ、URL、(Cookieの名前や値のような) HTTP header content を validate する。
validate の対象に JavaScript や Flash その他の embedded code からの automated post を含めることを忘れないこと

Verify that header values in both requests and responses contain only ASCII characters
request と response の両方ともその header values には ASCII キャラクターのみが含まれていることを verify する

Validate data from redirects
(An attacker may submit malicious content directly to the target of the redirect,
thus circumventing application logic and any validation performed before the redirect)
リダイレクトからのデータを validate する
(攻撃者はリダイレクトのターゲットに対して malicious content を直接 submit して
application logic とリダイレクト前に行われる一切の validation を回避してしまう可能性がある)

Validate for expected data types
予期していたデータ型であるか validate する

Validate data range
データの範囲を validate する

Validate data length
データの長さを validate する

Validate all input against a "white" list of allowed characters, whenever possible
"white list" of allowed characters が利用可能である場合は常に
それを使ってすべての入力を validate する

If any potentially hazardous characters must be allowed as input,
be sure that you implement additional controls like
output encoding, secure task specific APIs and
accounting for the utilization of that data throughout the application.
Examples of common hazardous characters include:  < > " ' % ( ) & + \ \' \"
入力としてなんらかの potentially hazardous characters を許可しなければならないのであれば、
出力のエンコーディングや secure task specific API、
accounting for the utilization of that data throughout the application のような
additional control を確実に implement しておくこと
一般的な hazardous characters の例には  < > " ' % ( ) & + \ \' \" がある

If your standard validation routine cannot address the following inputs, then they should be checked discretely
使用している standard validation routine が以下に挙げたような入力に対処できないのであれば、
そのような入力に対しては discretely にチェックすべきである
  o Check for null bytes (%00)
    null bytes (%00) に対するチェック
  o Check for new line characters (%0d, %0a, \r, \n)
    改行キャラクター (%0d, %0a, \r, \n) に対するチェック
  o Check for "dot-dot-slash" (../ or ..\) path alterations characters.
    In cases where UTF-8 extended character set encoding is supported, address alternate representation like: %c0%ae%c0%ae/
    (Utilize canonicalization to address double encoding or other forms of obfuscation attacks)
    "dot-dot-slash" (../ or ..\) path alterations characters (../ や ..\ のこと) に対するチェック。
    UTF-8 の extended character set encoding がサポートされている場合には、%c0%ae%c0%ae/ のような
    alternate representation にも対処すること。
    (double encoding やその他の form での obfuscation attacks に対処するために canonicalization を行う)

Output Encoding:

Conduct all encoding on a trusted system (e.g., The server)
すべてのエンコーディングを trusted なシステム上で行う

Utilize a standard, tested routine for each type of outbound encoding
外向きのエンコーディングのそれぞれの型に対して、標準でかつテスト済みのルーチンを使用する。

Contextually output encode all data returned to the client that originated outside
the application's trust boundary.
HTML entity encoding is one example, but does not work in all cases
originated outside the application's trust boundary なクライアントに対して
返すデータはすべて contextually に output encode する。
HTML の entity encoding は一つの例であり、それがすべてのケースで有効であるわけではない

Encode all characters unless they are known to be safe for the intended interpreter
intended interpreter に対して安全であることが分かっていない限り、すべてのキャラクターをエンコードする

Contextually sanitize all output of un-trusted data to queries for SQL, XML, and LDAP
queries for SQL, XML, LDAP といったものでの untrusted な data の出力はすべて contextually に sanitize する

Sanitize all output of un-trusted data to operating system commands
オペレーティングシステムのコマンドに対する untrusted data の出力はすべて sanitize する

(適切と思われる)訳を決めるのが面倒な単語や言い回しは英文表記のまま。悪しからず。

2015年06月16日

■_

Facebook、静的コード解析ツール「Infer」を公開。Objective-C/Java/Cコードのバグを指摘してくれる - Publickey の記事にあった Inferは2013年にFacebookが買収したMonoidicsの技術がベースになっており、 静的解析の技術としてSeparation logicとbi-abductionと呼ばれる理論を用いていると説明されています。 Separation logic と bi-abduction ってどんなんだっけ と思いつつ調べたら以前にも調べていた模様。 インタビュー - ホーア論理を拡張しポインタを扱える「Separation Logic」、静的検証ツール「Infer」でMonoidics社が実用化:ITpro Coqで分離論理(separation logic) - keigoiの日記 Separation logic - Wikipedia, the free encyclopedia 非単調論理 - Wikipedia Thesis Abstract: 489734014 Research Introduction

某氏の訳がなんか怪しい気がするが面倒なのでスルー。

■_

■_

Beautiful Map ≫ nvie.com

Beautiful Map » nvie.com

Beautiful Map 
Map isn't mad. It's beautiful. 

By Vincent Driessen 
on Monday, June 15, 2015 

I was reading Igor Kalnitsky's blog post on why Python's map() is mad, and wanted to provide a different perspective. In fact, I would call the design of Python's map() beautiful instead.

First off, what does map(f, xs) represent mathematically in the first place? It should invoke function f(x) for every x in xs. Functions, of course, can take many arguments—single argument functions are just the simplest case. So what would be reasonable to assume map(f, xs, ys) would do? In the blog post, Igor suggests the behaviour should be to chain xs and ys, but chances are they represent completely different things, so chaining them would lead to a heterogenous collection of items. Mathematically, you would expect the function calls made to be f(x1, y1), f(x2, y2), ...

以下略

で、言及先の記事で Python 2 から Python 3 で変わった動作(仕様)について 3 のそれの方が良いよー というお話。たぶん。

■_

あまり盛り上がってないけど両方で取り上げられてたし 重箱の隅つつき感がなかなかだったので TRIVIA QUESTIONS FOR X86 NERDS | Hacker News Trivia Questions for X86 Nerds : programming Trivia Questions for X86 Nerds — Möbius Strip Reverse Engineering

Trivia Questions for X86 Nerds — Möbius Strip Reverse Engineering
 
Trivia Questions for X86 Nerds 

June 10, 2015 Rolf Rolles 

Googling, referencing the Intel manuals, and using a debugger are all discouraged. Please don't post the answers in the comments!

  1. Name two instructions that have a memory expression for an operand, but do not access memory. (memory expressionをそのオペランドに持つがメモリーにアクセスはしない命令を二つ挙げよ)
  2. Conditional jumps with 16-/32-bit displacements were not available on the 8086. How did compilers generate long conditional jumps back then? (16ビットや32ビットのディスプレースメントを持った条件ジャンプは8086では 使えなかった。 当時のコンパイラーは長い条件ジャンプをどのように生成したのだろうか?)
  3. For ModRM-32 memory expressions (such as dword ptr [eax], byte ptr [eax+ebx], word ptr [eax+ebx*4], qword ptr [ebx*8]), what are the rules for determining the segment against which the address is applied? What about ModRM-16 memory expressions (like [bx+si])? ((dword ptr [eax], byte ptr [eax+ebx], word ptr [eax+ebx*4], qword ptr [ebx*8] のような), ModRM-32 memory expressions において、 アドレスに適用されるセグメントを決定するルールはどういったものか? ([bx+si] のような) ModRM-16 memory expression についてはどうか?)
  4. The instruction "bswap r32" endian-swaps the specified 32-bit register. I.e., if eax = 12345678h, after executing bswap eax, eax = 78563412h. The behavior of "bswap r16" (i.e., bswap ax) is undefined as per the Intel manuals. Name a behavior exhibited by an actual processor when "bswap r16" executes. ("bswap r32" 命令は指定された32ビットレジスターの endian-swap を行う。 たとえば eax レジスターの内容が 12345678h であったとすると bswap eax 実行後の eax の内容は 78563412h となる。 "bswap r16" (たとえば bswap ax)の動作はインテルのマニュアルによれば未定義である。 "bswap r16" を実行したときの実際のプロセッサーが exhibit する動作を解説せよ)
  5. Name two single-byte, undocumented instructions, and describe their behavior. (undocumented な一バイト長の命令を二つあげ、その動作を解説せよ)
  6. Name a circumstance under which the "aam" instruction can fault. ("aam"命令が fault する可能性のある状況を説明せよ)
  7. Name an instruction that writes to memory in some specific segment, where the segment cannot be overridden by a segment prefix. (特定のセグメントに属するメモリーに書き込みを行うが、 そのセグメントをセグメントプリフィックスによってオーバーライドできない命令を挙げよ)
  8. The "nop r/m32" instruction (e.g., "nop [eax]"), introduced in the Pentium Pro series of processors, behaves identically to the "nop" instruction which has been present since the original 8088. Why does the Pentium Pro instruction exist? (Pentium Proシリーズから導入された ("nop [eax]" のような) "nop r/m32" 命令は、original 8088以来提供され続けている "nop" と同一の動作をする。 Pentium Proで増えた前者の命令はなぜ存在するのだろうか?)
  9. For SSE instructions with mandatory prefixes (66/F1/F3), what happens if you put two such prefixes on an instruction? (mandatory なプリフィックス(66/F1/F3)を持つSSE命令に対して、 それらのプリフィックスの二つを与えた場合に何が起こるか?)
  10. Name a 32-bit instruction that is not encodable in 64-bit mode due to its assimilation into the VEX prefix schema. (VEX prefix schema の assimilation (融合、同化)のために 64ビットモードでは encodable ではなくなってしまう 32ビット命令を挙げよ)
  11. "mov eax, [reg32]" is an invalid instruction (i.e., cannot be encoded) for which general-purpose 32-bit register (eax, ebx, ecx, edx, esp, ebp, esi, edi)? "mov eax, [reg32]" が不正命令(invalid instruction) となるような32ビット汎用レジスター (eax, ebx, ecx, edx, esp, ebp, esi, edi) はどれか?
  12. Comparing "inc eax" and "add eax, 1", what is the difference in processor state (i.e. the registers, flags, and memory, without considering EIP) after execution? ("inc eax" と "add eax, 1" のそれぞれの実行後を比較したとき、 (EIPに関するものを除く、レジスターやフラグ、メモリなどの) プロセッサーの状態で異なるものはなにか?)
  13. Name a register that existed before the Pentium series, and ceased to exist beginning with the Pentium series. (Pentiumシリーズより前には存在していたが、Pentiumシリーズからなくなってしまったレジスターを挙げよ)
  14. What happens when you put an address size (67) prefix on a conditional jump? (条件ジャンプに対してアドレスサイズプレフィックス(67)をつけたとき、何が起こるか?)
  15. "movsb" implicitly references two memory operands, ds:[esi] and es:[edi]. What happens when you put a segment prefix on this instruction? ("movsb" は暗黙裡に ds:[esi]と es:[edi] という二つのメモリーオペランドを参照する。 この命令にセグメントプリフィックスをつけた場合に何が起こるか?)
  16. The "bit-scan in reverse" instruction, "bsr eax, ebx", sets eax to the bit number of the least significant 1-bit set within ebx. If ebx is zero, the value placed into eax is undefined as per the Intel manuals. Name a behavior exhibited by an actual processor when executing "bsr" with a right-hand size of zero. ("bit-scan in reverse" 命令、"bsr eax, ebx" は ebx で1がセットされているうち least siginifcant なビット位置をeaxにセットする。 ebx がゼロであったとき、eaxの値はインテルのマニュアルによれば未定義である。 right-hand sizeがゼロであるときに "bsr" を実行した際に 実際のプロセッサーにより exhibit される動作を説明せよ)
  17. Arithmetic comparison operations are not commutative. I.e., "cmp eax, ebx" is not the same as "cmp ebx, eax". In the instruction "cmpxchg cl, bl", which comparison is performed? (算術比較演算は commutative (交換可能)ではない。たとえば "cmp eax, ebx" は "cmp ebx, eax" と同一ではない。 "cmpxchg cl, bl" という命令においてはどの比較が実行されるか?)
  18. In terms of processor state, is "rol al, 0" the same as "rol al, 8"? プロセッサーの状態に関して、"rol al, 0" と "rol al, 8" は等しいものか?
  19. The auxiliary carry flag (AF) is similar to the carry flag (CF), albeit for X-bit quantities instead of 8/16/32/64. What is X? (補助キャリーフラグ(AF)はキャリーフラグ(CF)に似たものであるが、 8/16/32/64 のいずれのビット数でもないXビットに対するフラグである。 このXはいくつか?)
  20. Apart from "pushf" and "lahf", name an instruction that uses the value of the AF flag (as opposed to merely defining AF without using it). ("pushf" と "lahf" 以外の、(AFを使うことなく単にAFをdefineするのではない) AF フラグの値を使う命令を挙げよ)
  21. "shld r32, r/m32, r/imm8" shifts bits from the second operand into the first operand (from the left, i.e., the bottom). For example, if eax = 0x40000001, edx = 0x80000000, and cl = 1, after executing "shld eax, edx, cl", eax = 0x80000003. The shld instruction behaves analogously for 16-bit operands, but its behavior is undefined as per the Intel manuals if the shift count (third operand) specifies a shift of more than 16. Name a behavior exhibited by an actual processor when "shld ax, dx, cl" executes with 0x10 <= cl < 0x20. ("shld r32, r/m32, r/imm8" は、第二オペランドの左から第一オペランドの bottom へビットを移動する。 たとえば eax が 0x40000001、edx が 0x80000000、cl が1であったとき、 "shkd eax, edx, cl" の実行後の eax は0x80000003 となる。 このshld命令は16ビットオペランドに対しても同様の動作をするが、 第3オペランドで与えられるシフトカウントが16を超えるものであった場合は (インテルのマニュアルによれば)未定義である。 clに0x10以上0x20未満の値を与えて "shld ax, dx, cl" を実際のプロセッサーで 実行した際の exhibit を説明せよ)
  22. After executing "shl eax, 32", is the overflow flag (OF) defined? If so, what is its value? ("shl eax, 32"の実行後、オーバーフローフラグ(OF)は define されるか? defineされるのであればその値はなにか?)
  23. After executing "shl ax, 16", is the overflow flag (OF) defined? If so, what is its value? ("shl ax, 16"の実行後、オーバーフローフラグ(OF)は define されるか? defineされるのであればその値はなにか?)
  24. In terms of processor state, is there any difference between: "btc eax, ebx" and "push eax / btc [esp], ebx / pop eax" (apart from the values of EIP and dword ptr [esp-4])? (プロセッサーの状態に関して、 "btc eax, ebx" と "push eax / btc [esp], ebx / pop eax" とに違いはあるか? (EIPの値および、 dword ptr [esp-4]の値は除く))
  25. In 16-bit real mode, segments are 64k windows into a 1MB address space. This coincides with the range of a 16-bit near call or near jump. Name a strategy that 16-bit linkers employ to allow seamless merging of the control flow between object files whose combined code size exceeds 64kb. (16ビットリアルモードにおいて、セグメントは1メガバイトのアドレス空間に対するウィンドウである。 これは16ビットの near call や near jump の range と一致する。 64キロバイト以上の combined code size を持った複数のオブジェクトファイルにおける control flow の seamless merging を可能にするために16ビットリンカーが employ する戦略を説明せよ)

最後のものとか、幾つか色々情報を補わないといけないだろうものもあるけど 面倒なので略。また、アヤシイ訳なのであくまでも原文基準でどうぞ:)

2015年06月15日

■_

先週末にCython本(の早売り)くるかなーと思ってたんだがー

コミケWebカタログに入金。

■_

■_

COBOL はよく知らないので的外れかもしれませんが (指摘歓迎)

システム開発技法の歴史<経営とIT<歴史<木暮仁

プログラミング作法 

そもそもCOBOLは、プログラムを文書として表現することを意図した言語である。しかし、現実には、 その目的が達成できているプログラムは少ない。少しでも理解しやすく、保守改訂を容易にするために、 ガイドラインを作成した。

 (略)
 字下げのルール

例えばIF文、特に入れ子のIF文での字下げの標準化が重要だった。COBOLでは、THEN、ELSE、 END-IFなどが省略可能であり、「.」の有無により処理が異なるので、字下げとともに、省略の是非を 標準化することが必要だった。

又聞きであるが、米軍のIT部門の事務室に「.」だけの額が掲げられていたという。 ミサイル発射実験の失敗で大きな損失を蒙った。プログラムの「.」が不適切で誤動作したのが原因だという。

ミサイルの動作に関わるプログラムをCOBOLで書くものだろうかというのはさておき、 この . のあるなしで意味(動作)が変わるプログラムって書けるんだろうか? もちろんエラーにならずにコンパイル通るのは前提。

■_

Learn APL in 10 Minutes : programming

jms_nhがLearn APL in 10 Minutesについて記入したコメント

Yes, but that's for writing APL. It takes you a month to learn how to read APL. 
 
Actually this page is pretty useful, I can understand some of it now.

うははw>書くのに10分読むのに一月

2015年06月14日

■_

C88。

最近、でもないけど「黒いポルシェ」を良く見るようになった気がする。 流行り?

■_

■_ Why did Borland fail?

Why did Borland fail? | Hacker News (1) Danny Thorpe's answer to Why did Borland fail? - Quora で、特にこのコメント。 I used Delphi for more tan 10 years, so this is what I believe it went wrong: ... | Hacker News

I used Delphi for more tan 10 years, so this is what I believe it went wrong: ... | Hacker News

used Delphi for more tan 10 years, so this is what I believe it went wrong: 
 
 * They lost Anders Hejlsberg 
 * Free compilers got aceptable. 
 * Lack of back compatibility, new VCL components from one version weren't compatible with older ones, every new versión require to biy the new components. 
 * To expensive. 
 * No new books to learn Delphi, they are to old.

個人的な印象でいうと(実際の売り上げやら利益がどうだったかは知らない(調べない))、 Delphi は「中興」で、それ以前に「衰退」してたよな。 という気がするw でもまあ ↑のような意見も分からないでもない。 わたし自身もバージョンアップ料ががつんと値上がりした辺りで脱落しちゃったし。

■_

あともうちょいでできそうなんだけどなあ>Access でアレ

2015年06月13日

■_

某古書店で、以前にも一度見かけてはいたのだけどその値段のために 逡巡している間に売れてしまった本に再度遭遇。 今回は買った(たぶん以前のと同じ値段)。 自分へのプレゼントということにしておこう。6月だしな :)

でも、贅沢いうならこれだともっと良かったw → Amazon.co.jp: APL-プログラミング言語 (1975年): イバーソン, 内山 昭, 長田 純一: 本

■_

■_

こうやって都市伝説はできていくのだなあ。 なんてね。

前にも言及したけど 生死をも左右するソフトウェアの設計・構築はどうすれば完璧に近づけられるのか? - GIGAZINE の書き方には問題があって、

生死をも左右するソフトウェアの設計・構築はどうすれば完璧に近づけられるのか? - GIGAZINE

1980年代後半、ちょうど航空業界ではエアバスがA340型機のデビューを控えていた頃だが、 ソフトウェア関連やセーフティ関連のエンジニアの間ではあるエピソードが有名だった。 そのエピソードとは、ボーイングとエアバスという2大航空機メーカーで、 FBWのテスト方法がどれだけ異なるかについてのものだった。

それによると、エアバスでは機体に搭載されるシステムを検証するために、最新かつ非常に優れた手法を取り入れ、 モデル検証を行ってプログラムの形式的証明を実施した。

一方のボーイングでは、大がかりな設計審査とテストを行い、最後に全てのプログラマーを機体の初飛行の際に同乗させた。

このエピソードを聞くと、多くの人は何となくボーイング製の旅客機に多くの安心感を抱くようだ。

上記のエピソードはあくまで都市伝説的に語り継がれているものなので、 実際にそのような手法が行われていたかどうかは不明ですが、 両社のコンピューターシステムに対する考え方の違いをよく表しているものといえそう。

見事にGIGAZINEが(内容が微妙に違っているのに)元記事からの「引用のように書いた」部分だけ「引用」されてますね。 都市伝説云々がすっぽり落ちてる。

それとGIGAZINEの記事で

生死をも左右するソフトウェアの設計・構築はどうすれば完璧に近づけられるのか? - GIGAZINE

2011年には、オンラインQ&Aサイト「Stack Exchange」のスレッドで、そんなテスト手法についての議論が交わされており、 GoogleのSEプログラマーであるウリ・デケル氏は 「ここでいうボーイングのような手法は、とっくに時代遅れのものとなっています」と指摘しています。

とあるの、折角だから staclexchange の該当スレッドから探してみると testing - How is software used in critical life-or-death systems tested? - Programmers Stack Exchange

testing - How is software used in critical life-or-death systems tested? - Programmers Stack Exchange

There's a serious move towards formal verification rather than random functional testing.

Government agencies like NASA and some defense organizations are spending more and more on these technologies.

They're still a PITA for the average programmer, but they're often more effective at testing critical systems.

There's also a tendency to try out more techniques from academia, for things like validating multithreaded code.

これですね。 「ここでいうボーイングのような手法は、とっくに時代遅れのものとなっています」 ってどこから湧いて出た? 「ボーイングのような手法」 はここでいう "random functional testing" なのだろうけど 後ろの部分を「時代遅れ~」とまとめられる?

■_

ちなみに何を買ったのかというと…… Mirosoft vs Shuwa-System

2015年06月12日

■_

一人称研究のすすめ: 知能研究の新しい潮流
一人称研究のすすめ: 知能研究の新しい潮流 ちまちま読んでるけど面白い。 偶然見つけた本だけど当たりだった。

■_

■_

Four short links: 2 June 2015 - O'Reilly Radar から The Power of Ten -- Rules for Writing Safety Critical Code

  1. Restrict to simple control flow constructs.
  2. Give all loops a fixed upper-bound.
  3. Do not use dynamic memory allocation after initialization.
  4. Limit functions to no more than 60 lines of text.
  5. Use minimally two assertions per function on average.
  6. Declare data objects at the smallest possible level of scope.
  7. Check the return value of non-void functions, and check the validity of function parameters.
  8. Limit the use of the preprocessor to file inclusion and simple macros.
  9. Limit the use of pointers. Use no more than two levels of dereferencing per expression.
  10. Compile with all warnings enabled, and use one or more source code analyzers.

詳細な解説は元記事経由で。 まあそれなりに妥当なルール?

そういえばF-35のソフトウェア開発はその後どうなってるんだろうか。

2015年06月11日

■_

英語版、だろうか Creating a language using only assembly language // Speaker Deck Creating a language using only assembly language : programming

ありがとうございます。 久しぶりの書き込みのネタになったようで嬉しいです:) Emacs Lispでvariance - odz buffer エゴサーチなどはしないので他に気づいてないのがあったらごめんなさい。

しまったーっ一月ごとに変わるものだったのかーーっ ○| ̄|_ 作家書店 二十一代 安彦良和書店【作家とジュンク堂書店とのコラボレーション企画】|イベント・フェア詳細 |丸善&ジュンク堂ネットストア デザインは計6種、月1回(毎月11日更新)です。前月以降のものはダウンロードできなくなりますのでご注意ください。

■_

■_

Four short links: 2 June 2015 - O'Reilly Radar The Power of Ten -- Rules for Writing Safety Critical Code

  1. Restrict to simple control flow constructs.
  2. Give all loops a fixed upper-bound.
  3. Do not use dynamic memory allocation after initialization.
  4. Limit functions to no more than 60 lines of text.
  5. Use minimally two assertions per function on average.
  6. Declare data objects at the smallest possible level of scope.
  7. Check the return value of non-void functions, and check the validity of function parameters.
  8. Limit the use of the preprocessor to file inclusion and simple macros.
  9. Limit the use of pointers. Use no more than two levels of dereferencing per expression.
  10. Compile with all warnings enabled, and use one or more source code analyzers.


一つ前へ 2015年6月(上旬)
一つ後へ 2015年6月(下旬)

ホームへ


リンクはご自由にどうぞ

メールの宛先はこちらkbk AT kt DOT rim DOT or DOT jp