ときどきの雑記帖'

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

一つ前へ 2013年9月(下旬)
一つ後へ 2013年10月(中旬)

ホームへ

2013年11月10日

■_

10ページほどの論文がありまして。 いつもならとにかくざーっと目を通して読んだ気になる というのが多いのですが、これは特に興味のあるものだったし きちんと理解して自分でも実装なりしたいので うんうん唸りながら読んでたりするんですがまー進まない。 読むのにキリョクがいるのである程度時間が取れないと 手にする気分にもならないわ いざ読み始めても周りの環境がアレだと… で、今日割と落ち着けるマクドナルドまで行ったんですが (自宅最寄りではなく電車でちょっと行ったところ。他の用事があったのでついでに。 グラコロ期間だしw)、 商店街の催しだかなんだかでブラスバンドの演奏やっててびっくり (上手だったけど)。 とにもかくにも店内に入って論文読み始めたら、 今度は家族連れできていたうちの3才くらいの子が 何が起きたのかいきなり大声で泣き始めてしまったという。 ダメなときは何やってもダメという話でした。 しかしなにがあったんだろう…

週末に諸々。
放課後のカリスマ 10 (IKKI COMIX) エンダーのゲーム〔新訳版〕(上) (ハヤカワ文庫SF) エンダーのゲーム〔新訳版〕(下) (ハヤカワ文庫SF) チューリング: 情報時代のパイオニア 歴史群像 2013年 12月号 [雑誌]

アキバ系!電脳空間カウボーイズZ: 第三百六十五回 さらばアスキー!! 前編 面白かった。音声がカットされた話題が気になるけどw 20分過ぎくらいに「IBMの伝説言語APL」の話題が。 創刊直後のアスキーに何度かAPLの話が載ってたのが不思議だったのだけどその謎がようやく解けた :)

■_ Python 6

なにごとかと。

くだすれPython(超初心者用) その19

195 デフォルトの名無しさん [] 2013/11/09(土) 04:08:47.50 ID: Be:
    Python 6についての質問です。

    同じPython 7から加わったimportlibが使われているスクリプトを
    Python 6.6が入った別々のコンピュータで実行すると、

    ・環境1ではUserWarningが出てスルー
    ・環境2ではImportError例外が出て停止

    とそれぞれ異なった振る舞いになりました。
    環境2でもUserWarning扱いにしたいのですが、
    どのような設定をすれば良いのでしょうか?

    警告と例外のしきい値を決めることなどができるのでしょうか?

    よろしくお願いします。 

196 デフォルトの名無しさん [sage] 2013/11/09(土) 04:31:30.36 ID: Be:
    いつのまに7まで・・・
    大した奴だ・・・ 

197 デフォルトの名無しさん [sage] 2013/11/09(土) 04:42:31.59 ID: Be:
    pilは対応しているのかな? 

198 デフォルトの名無しさん [sage] 2013/11/09(土) 04:58:40.23 ID: Be:
    Python7 から実装されたコンパイラはなかなかいいよね 

199 デフォルトの名無しさん [] 2013/11/09(土) 05:01:20.04 ID: Be:
    すいません、2.6と2.7でした!! 

■_ million lines of code

すげーなー Million lines of code, an infographic : programming Million Lines of Code | Information Is Beautiful

図を見て思うところあったけど書かない :)

■_

興味のある題材なんだけど気合い入れないと読んでいけそうにない(のでまだ読んでない) The Quality of Embedded Software, or the Mess Has Happened : programming The Quality of Embedded Software, or the Mess Has Happened

■_

2013年11月09日

■_

炬燵出した。

■_ possessive

「強欲」ってやつすな。バックトラックしないやつ。

■_ Dr. Fortran

だいぶ前(10月頭)のものですが。 Dr. Fortran gets nostalgic: DEC, PDP-11, Compaq, VAX, FORTRAN-IV, Pascal V2, and Ada. : programming

訳すにはちと量があるな。面白いんだけど。

Has it really been 35 years? | Intel® Developer Zone

Has it really been 35 years?

Submitted by Steve Lionel (Intel) on Wed, 10/02/2013 - 11:27

I knew this date was coming up, but I had forgotten about it for a while until my manager reminded me -
October 2, 2013 marks my 35th anniversary "at Intel". I put that in quotes because Intel
"grandfathered" my time at DEC and Compaq. It was October 2, 1978, when I walked into DEC's facility
in Tewksbury, Massachusetts, as a new employee. The site, like many of DEC's in that day, was a converted
shopping center - the main entry was where a Caldor department store had been, and a smaller building across
the parking lot had been an A&P supermarket. Nowadays it's an office park owned by an insurance company.

I sat in the lobby waiting for the HR person to come and get me and another new hire. And sat, and sat...
Eventually, Leslie Miller (later Klein), a Fortran developer (and later manager of DEC's "Technical
Computing and Enviroments" department) recognized me from my job interview and brought me in. It turned
out that the other new employee, whom if I recall correctly was documentation writer Patti Anklam, had gone
in ahead of me as she had worked there before.

(略)

I will admit that reaching a milestone such as this is cause for reflection - I'm not as young as I used to be.
(I do work with several who have followed the DEC/Compaq/Intel path even longer, though.) I'm hoping to find
someone to eventually carry on the "Doctor Fortran" role as I know I won't be here forever. But 
for now, you're stuck with me...

■_ ラッキーストライク

知らなかったわー>ヘルメットにラッキーストライクの意味

【彷徨える艦隊】ジャック・キャンベル【Stark's War】3番艦
899 名無しは無慈悲な夜の女王 [sage] 2013/10/10(木) 02:43:22.77 ID: Be:
    100年戦争の始まりの部分「Grendel」が下記に 
    http://www.us.penguingroup.com/static/pages/specialinterests/scifi/2013/campbell_essay.html 

900 名無しは無慈悲な夜の女王 [sage] 2013/10/11(金) 09:28:36.70 ID: Be:
    「グレンデル。今も昔も将来も、何の事件も起きない星系。」
    連盟の重巡洋艦マーロンの副官デケアラ少佐は苦笑しながら
    指揮官であるジョン・ギアリー中佐の方を向いて言った。
    「口は災いの元ですよ、艦長。やめて下さい。」
    .... 

901 名無しは無慈悲な夜の女王 [sage] 2013/10/11(金) 09:32:07.25 ID: Be:
    訂正: 艦長。やめて下さい -> 気をつけて下さい、艦長。 

902 名無しは無慈悲な夜の女王 [sage] 2013/10/11(金) 13:03:50.78 ID: Be:
    >>900

    >今も昔も将来も、何の事件も起きない星系
    意味としては間違っちゃいないんだが、どうせわざわざ訳すなら、ギアリーがhappenを3回も言ってる感じを活かしてほしい。

    >連盟の
    アライアンスでいいのでは。

    >副官
    副官じゃなくて副長でしょ。

    >指揮官であるジョン・ギアリー
    艦長。

    >口は災いの元ですよ、艦長。やめて下さい。
    縁起でもないこと言わないでください、という意味合いではないかと。 

903 名無しは無慈悲な夜の女王 [sage] 2013/10/11(金) 16:26:47.89 ID: Be:
    いやここで全部訳す気はないんだ、これだけ
    結構大変だし、著作権のこともあるし
    もしやるとしたら超訳だろうか

    最初の行はそのまま訳すと冗長な感じになりそうでな
    読んだ時の調子を考えてああしてみた

    アライアンスでもいいのだろうけど固有名詞というわけでも
    ないのであえて飜訳して連盟、シンディクスは連合か
    シンジケートにするか

    commanding officerは指揮官ではまずいの? まあ艦長ではあるけど

    副長はその通りでしたね

    悪運を引っ張ってこないように注意しろということだから
     縁起でもないこと言わないで下さい
    とか
     ケチがつくようなことはやめてください
    とか迷ったが、結局
     口は災いの元ですよ...
    の方が合うような気がした 

904 名無しは無慈悲な夜の女王 [sage] 2013/10/11(金) 21:11:22.73 ID: Be:
    翻訳って難しいね。
    訳す人の感覚やこだわりによって全然意味が違ってくるし。 

905 名無しは無慈悲な夜の女王 [sage] 2013/10/11(金) 22:09:06.96 ID: Be:
    最初のセリフが
    「グレンデルじゃ、なーんも起きんのよなー、
     たまには何か起きんかのう。」
    とかだと
    「縁起でもないこと言うのやめて!」
    が合うんだけどな、日本語としては。 

906 名無しは無慈悲な夜の女王 [sage] 2013/10/11(金) 22:32:50.29 ID: Be:
    なんかタイラー艦長のようなしゃべり方だなw 

907 名無しは無慈悲な夜の女王 [sage] 2013/10/12(土) 00:11:38.79 ID: Be:
    ううむ、無責任艦長ですかい
    読んだことないなぁ
    アニメも見たことない
    なんかギアリーとは正反対なような 

908 名無しは無慈悲な夜の女王 [sage] 2013/10/12(土) 00:18:14.15 ID: Be:
    「災いを招かないように言葉に注意して下さい、艦長。」
    ならどうだろう 

909 名無しは無慈悲な夜の女王 [sage] 2013/10/12(土) 00:29:30.00 ID: Be:
    こんな感じでWeb上でやったらけっこういい翻訳が出来ると思うよ 

910 名無しは無慈悲な夜の女王 [sage] 2013/10/12(土) 12:13:17.53 ID: Be:
    発言が災いを招く、という言霊思想的なのは日本だけだと思ってたが、
    意外とそうでもないのかな? 

911 名無しは無慈悲な夜の女王 [sage] 2013/10/12(土) 12:39:06.96 ID: Be:
    >>909
    ああじゃない、こうじゃないの堂々巡りで、完成しない予感 

912 名無しは無慈悲な夜の女王 [sage] 2013/10/12(土) 15:03:28.80 ID: Be:
    >>910
    本編中でも「インビンシブル」が名前ゆえに散々やられてましたがな。

    現実でもアメリカ軍で煙草が支給品(数種類からランダムで配給される)だったころは
    ラッキーストライクは「(敵の弾が)まぐれあたり」に通ずるってんで忌み嫌われ
    他の奴が拾って祟られるといかん、とわざわざ泥の中で踏みつぶす人までいたとか。
    ベトナムのころだとわざわざヘルメットに挟んで「俺は怖くねーぜ」「狙ってみろや」的に使うのもいたけど。 

913 名無しは無慈悲な夜の女王 [sage] 2013/10/12(土) 22:34:13.58 ID: Be:
    訳を書いた後で読み直した時に別の言い回しを思いついて手直しをする
    しばらく後でさらにまたどっちがいいか自分でも悩んだりするからな
    なかなか収束しない可能性はあるね >>909 911 

914 名無しは無慈悲な夜の女王 [sage] 2013/10/12(土) 22:48:59.20 ID: Be:
    外資に勤めてて、文章はEditorを通さなければいけないんだけど
    1回目直されたのが3回目には元に戻ってたとかあったな 

915 名無しは無慈悲な夜の女王 [sage] 2013/10/12(土) 23:59:36.39 ID: Be:
    笑える...いや笑えんか 

916 名無しは無慈悲な夜の女王 [sage] 2013/10/13(日) 02:32:15.30 ID: Be:
    良くあるよな。外人Aに直されたのを外人Bに、これは違うよーと言われたり。後日同じ人に持ってったらすっかり忘れてて戻されたり。
    まあ日本語の文書で日本人の決裁とるんだって似たようなものだがw 

小説なんかはまだ原著でほいほい読めないのよねえ。 なんでだろう(鶏と卵な話はなしで)。

■_

R&JavaScriptによるデータ解析と視覚化テクニック (Programmers SELECTION)
R&JavaScriptによるデータ解析と視覚化テクニック (Programmers SELECTION) Pro Data Visualization Using R and Javascript (Professional Apress)
Pro Data Visualization Using R and Javascript (Professional Apress) Pro Data Visualization using R and JavaScript (Kindle)
Pro Data Visualization using R and JavaScript

Pro Data Visualization using R and JavaScript

Pro Data Visualization using R and JavaScript

ISBN13: 978-1-4302-5806-3
216 Pages
User Level: Intermediate to Advanced
Publication Date: June 26, 2013
Available eBook Formats: EPUB, MOBI, PDF

■_

■_

マイアミ楽しそうだなあ…

2013年11月08日

■_

なんか最近の自転車(ママチャリ的なやつ)ってずいぶんと低重心な気がする (これじゃあ言いたいことが伝わらないとは思うけど詳しく説明するの面倒だな)。

指し棒大活躍なプレゼン資料ばかりでぐんにょり。

■_ 進展

この「進展」の使い方いいのかなあ?

商店街の衰退とスーパーの進展 - Togetter しんてん【進展】の意味 - 国語辞書 - goo辞書

■_ 問題

とある Perl のコード片について。

A Tiny Code Quiz | Ovid [blogs.perl.org]

A blog about the Perl programming language
A Tiny Code Quiz
By Ovid on November 8, 2013 10:24 AM

I'll be speaking at the 2014 German Perl Workshop, so I hope to see some of you there.

Ben Tilly posted the following on Facebook a few days ago (I've modified it every so slightly to make the
possible answers clearer):

  @ar1 = qw(foo bar);
  @ar2 = qw(a b c d);
  print scalar (@ar1, @ar2);

He argued that even experienced developers will often get this wrong. Looking at the above, we could possibly
argue for any of the following to be printed:

    1
    2
    3
    4
    6
    d
    foo

Try and guess the answer without consulting the docs or reading any of the responses! I'll give a rationale
for each of those after the cut (and for the record, I got the answer wrong the first time), but I won't be
giving the answer -- I assume that will show up pretty quickly in the comments. Note that, of course, the
following rationales are wrong (badly so in some cases), but this gives you an idea of how difficult context
can be in Perl.

ドキュメントや他の人の回答を見ないで結果を予想してみてください!
上記の予想のそれぞれの根拠を以下に挙げますが、正解は書きません
(参考までに書いておくと、わたしも一回目は間違えました)。
I assume that will show up pretty quickly in the comments.
当然のことですがこれらの解釈は(質の悪いことに一部のケースで)間違っています。
しかし、それによって Perl におけるコンテキストというものがいかに面倒なものになりうるか分かっていただけるでしょう。

    1

Due to the comma being a list operator, the two arrays are first flattened into a list and either the first
or last element is returned, either of which in scalar context evaluates to 1.

カンマはリスト演算子と扱われるので、二つの配列はまず平滑化(flattened) されてリストとなり、
最初の要素か最後の要素かのいずれかが返される。そのいずれでもスカラーとして評価した結果は1となる。


    2

Reasoning: @ar1 has two elements and scalar() takes an array and evaluates it in scalar context.

@ar1 は二つの要素を持っており、scalar() は配列を一つ引数としてとる。
@ar1 をスカラーコンテキストで評価するのでこうなる。

    3

Due to the comma being a list operator, the two arrays are first flattened into a list and the first element,
foo, is returned, which evaluates to 3 in scalar context.

カンマはリスト演算子と扱われ、二つの配列が一つのリストへ平滑化されてからその最初の要素
つまり foo が返される。これをスカラーコンテキストで評価すると 3となる。

    4

All of the arrays are evaluated in scalar context, returning a list of 2, 4, but only the last element of the
list is returned by scalar().

すべての配列がスカラーコンテキストで評価され、2 と 4 からなるリストが返される。
そしてその最後の要素だけが scalar によって返される。

    6

The two arrays, combined, have six elements, which evaluated as a scalar, causes 6 to be printed.

二つの配列は結合して6個の要素を持つ配列となり、それがスカラーとして評価される。
その結果は6でありこれが出力される。

    d

Due to the comma being a list operator, the two arrays are first flattened into a list and the last element is
returned, which in scalar context is itself.

カンマはリスト演算子と扱われ、二つの配列が一つのリストへ平滑化されてからその最後の要素が返されるが、
これをスカラーコンテキストで評価した場合それ自身となる。

    foo

Due to the comma being a list operator, the two arrays are first flattened into a list and the first element
is returned, which in scalar context is itself.

カンマはリスト演算子と扱われ、二つの配列が一つのリストへ平滑化されてからその最初の要素が返されるが、
これをスカラーコンテキストで評価した場合それ自身となる。


Discuss!

Note: if you want to be really picky, according to a strict reading of the documentation, while one of the
answers above is right, none of the rationales are. Have fun!

Tiago Peczenyj ( @pac_man ) | November 8, 2013 11:05 AM

Humm... my first guess was 6, thinking in something like

print scalar ( split ",", join ",",(@ar1, @ar2));

and surprise

■_

Star TEX: The Next Generation (PDF) : lisp

■_

■_

なんだろうこの本…

2013年11月07日

■_

さよならWindows XP、そしてWindows 8.1へ:【新連載】去りゆくXPよ、君はどんな存在だったのか (2/2) - ITmedia エンタープライズ Windows OSの歴史。個々のOSがリリースされた時期によって様々なミッションがあった(米国でのTechEd2013資料より) のビットマップの細かいところが読めないので 元資料読みたいんですがどこにあるんですかねー (TechEd2013 でぐぐったが空振り)

■_ Living without Pointers

いつもの情報源w から。 Designing ParaSail, a new programming language: Tech talk and Tutorial at SPLASH 2013 on parallel programming

Designing ParaSail, a new programming language: Tech talk and Tutorial at SPLASH 2013 on parallel programming

I gave an 80-minute "tech talk" and a 3-hour tutorial on parallel programming last week at SPLASH
2013 in Indianapolis.  The audiences were modest but enthusiastic. 

The tech talk was entitled:

  Living without Pointers: Bringing Value Semantics to Object-Oriented Parallel Programming

Here is the summary:

The heavy use of pointers in modern object-oriented programming languages interferes with the ability to adapt
computations to the new distributed and/or multicore architectures. This tech talk will introduce an
alternative pointer-free approach to object-oriented programming, which dramatically simplifies adapting
computations to the new hardware architectures. This tech talk will illustrate the pointer-free approach by
demonstrating the transformation of two popular object-oriented languages, one compiled, and one scripting,
into pointer-free languages, gaining easier adaptability to distributed and/or multicore architectures, while
retaining power and ease of use.

なんかおもしろそうなので読む。 Ada がどうとか見えるなあ…

■_ 訳語とか

Twitter / Kazzz: Effective Objective-C ... Twitter / Kazzz: つらつら書かれているけど、単に訳者の方があまりObjecti ...Effective Objective-C 2.0の日本語訳版が出たらしい - なるようになるといいね

Effective Objective-C 2.0の日本語訳版が出たらしい - なるようになるといいね

    項目28 プロトコルを使って無名オブジェクトを提供せよ

これは公式ドキュメントだと匿名オブジェクトと呼ばれていたもののことかな?

ちょっと読まないと分からないや。

これは「無名」のが良いと思うがなあ。元は anonymous でしょ。たぶん。 もちろん匿名という訳もあって、なおかつそちらの方が辞書では先に載ってるんだけど 日本語の意味から考えると匿名はここでは使えないと思うんだよなあ。 anonymousの意味 - 英和辞典 Weblio辞書

Effective Objective-C 2.0の日本語訳版が出たらしい - なるようになるといいね

    項目34 メモリ最高使用水準を下げるために自動開放プールブロックを使う

これが言いたいのってたぶん、ARCを使っていてもメモリが解放されるのはスコープを抜けるタイミングだから、for
ループで大量のインスタンスを生成するようなコードを書く際には明示的に@autoreleaseを書け、みたいなことだよね。

メモリ最高使用水準ってもうちょいいい訳ないんだろうか。「最大メモリ使用量」だとニュアンスがぼけるかな。

帰宅途中に寄った書店でこの本見かけたのでぱらぱら眺めたんだけど 「解放」とすべきところがことごとく「開放」になってたような。 「保証」と「保障」もそうだけどもうちょっと気を使うべきじゃないのかなあ。 河野先生あたりはもうごっちゃでいいじゃんみたいなことを言いそうだけど。

Effective Objective-C 2.0の日本語訳版が出たらしい - なるようになるといいね

    項目45 スレッドセーフなコードのワンショット実行にはdispatch_onceを使う

ワンショット実行…という言葉は聞きなれないけど、これも直訳なんだろうか。

例えばsingletonオブジェクトを作るときに、dispatch_onceを使うだけで、マルチスレッド対応の一度きりの実行が
実現できる、ということだと思う。うーん、確かに上手く纏まる言葉が見つからないかも。

one-shot といえば gawk のマニュアルにもこういうのがあったり

@node One-shot
@subsection One-Shot Throwaway @command{awk} Programs

Once you are familiar with @command{awk}, you will often type in simple
programs the moment you want to use them.  Then you can write the
program as the first argument of the @command{awk} command, like this:

@example
awk '@var{program}' @var{input-file1} @var{input-file2} @dots{}
@end example

@noindent
where @var{program} consists of a series of @var{patterns} and
@var{actions}, as described earlier.

まあどう訳すかといわれればちょっと悩むな。 以前は「一回きりの使い捨て」とかにしたんだっけかな。

■_

最近よく山形さん翻訳の本の予定を見かけるのだけどこれまた気になるものが 『コンピュータって』(ポール・E・セルージ 山形 浩生 : 東洋経済新報社 : 2013年11月22日発売予定 : C3034 : 報道・ノンフィクション・社会 : )@近刊検索β

『コンピュータって』(ポール・E・セルージ 山形 浩生 : 東洋経済新報社 : 2013年11月22日発売予定 : C3034 : 報道・ノンフィクション・社会 : )@近刊検索β

機械式計算機からスマートフォンまで、ハードウェアの進化を手短にまとめた概説書。
コンピュータの過去・現在・未来の姿を描く。
私たちの生活に欠かせないスマホやタブレット、パソコンは、
どのように進化してきたのか。

私たちの生活を陰で支える大型汎用コンピュータの原点とは。

コンピュータとコンピューティングの過去・現在・未来について、
スミソニアン航空宇宙博物館のキュレーターが語ります。

デジタル情報時代に生きる現代人なら知っておきたい、
新しい教養がつまった本です。

とりあえず出たら要チェック。

■_

2013年11月06日

■_

歯医者。行ってきた。 なんか色々違ったw

■_ ぜーじゃくせー

細工したTIFF画像を悪用、回避策適用を推奨:Officeなどにゼロデイ脆弱性、Word用いた標的型攻撃も観測 - @IT

細工したTIFF画像を悪用、回避策適用を推奨:Officeなどにゼロデイ脆弱性、Word用いた標的型攻撃も観測 - @IT

脆弱性が存在するのは、Windows Vista、Windows Server 2008、Microsoft Office 2003~2010とMicrosoft Lync。
Microsoft Graphics ComponentのTIFF形式の画像処理に問題があり、細工を施したTIFF画像を開くと、攻撃者に権限を奪取
され、リモートからコードを実行されてしまう恐れがある。

TIFF で云々って大昔にもなかったっけ?

■_

Interview: Bjarne Stroustrup Discusses C++ | Dev Tools content from Electronic Design 最後の方にこんなのが。

Interview: Bjarne Stroustrup Discusses C++ | Dev Tools content from Electronic Design

Wong: What common mistakes do you see new C++ developers making?

Stroustrup: They think they have to choose between “efficiency” and elegance, so they either stick to a
small low-level subset (“for efficiency”) or build bloated “do-everything” designs (deeming those elegant).
My ideal is for the most efficient code also to be the most elegant. That happens when you have a perfect fit
between a problem and a solution. Obviously, you can’t always achieve that and you rarely achieve it at the
first try, but it happens often enough for the ideal to be of practical relevance.

Before dismissing C++ features, such as classes and templates, for demanding tasks, learn the basics of their
use and try them out. Measure, rather than guessing about performance! Do not feel obliged to craft huge
hierarchies or write complicated template meta-programs. Some of the most powerful C++ features are quite
simple and leads to good object code. One of the best ways to get efficient code is to write simple source
code.

まあ訳はつけないでも雰囲気伝わるでしょう。

■_

■_

コード読む時間が(当然書く時間も) とれない ○| ̄|_

2013年11月05日

■_

無灯火自転車一台撃破 :)

何日か前に、「最近のFortranにはtemplateがある」とかいうツイートを見かけたんですが マジですかこれ(調べない奴)

■_ ICU

脆弱性が云々というのを数日前に見たのだけどこれか。 Unicodeライブラリにセキュリティ脆弱性 | マイナビニュース JVN#85336306: 複数製品で使用されている International Components for Unicode (ICU) に解放済みメモリ使用 (use-after-free) の脆弱性

JVN#85336306: 複数製品で使用されている International Components for Unicode (ICU) に解放済みメモリ使用 (use-after-free) の脆弱性

International Components for Unicode (ICU) は、 Unicode 文字列を扱うためのライブラリで、C 言語向けの ICU4C と
Java 言語向けの ICU4J が提供されています。ICU4C には、解放済みメモリ使用 (use-after-free) の脆弱性が存在します。

ICU から本脆弱性を修正した ICU4C 52.1 が 2013年10月9日にリリースされています。

で、修正がこれ。 チェンジセット 34076 – ICU trac どうもこの修正と脆弱性がどう結びついているのかよくわからんげ。

■_ null

時間がなくてまだざっとしか見てないので後回し。 Self-Encapsulation: Fixing $1 Billion in Software Bugs : programming

■_

■_

ダメだなあれもこれも時間が足りない (一応色々書こうとはした)。

2013年11月04日

■_

「くまもん」ってどういうイントネーションで読むのが正しいのだろうかと ニュースを見ていて思った。

■_ 悪魔の辞典

Devil's Dictionary of Programming—programming is terrible

Devil's Dictionary of Programming—programming is terrible

programming is terrible—lessons learned from a life wasted
2013-11-02

Devil’s Dictionary of Programming

With apologies to Ambrose Bierce

simple — It solves my use case.
シンプル わたしの問題は解決してくれる

opinionated — I don’t believe that your use case exists.
              そんな use case が存在するとは思えない

elegant — The only use case is making me feel smart.
          唯一の use case がわたしを賢く感じさせてくれるもの

lightweight — I don’t understand the use-cases the alternatives solve.
              

configurable — It’s your job to make it usable.
               それを使えるようにするのはあなたの仕事

minimal — You’re going to have to write more code than I did to make it useful.
          あなたが使えるようにするにはわたしが書いた以上のコードを書かなければならない

util — A collection of wrappers around the standard library, battle worn, and copy-pasted from last weeks project into next weeks.
       標準ライブラリに対するラッパーの寄せ集め

dsl — A domain specific language, where code is written in one language and errors are given in another.
      ドメイン特化言語。ある言語で記述されているがエラーはそれとは別の言語で発生するもの

framework — A product with the business logic removed, but all of the assumptions left in.
            ビジネスロジックが削除されているのにそれが残っていると仮定されているもの

documented —There are podcasts, screencasts and answers on stack overflow.
ドキュメントがある ポッドキャストやスクリーンキャストがあり、答えが stack overflow にあること

startup — A business without a business plan.
          ビジネスプランの存在していないビジネス

hackday — A competition where the entry fee is sleep deprivation and the prize is vendor lock in.
          参加料が睡眠の剥奪で賞品がベンダーロックインであるようなコンペ

entrepreneur — One who sets out to provide a return on investment.
          投資に対するリターンを提供するための考えを述べる人

serial entrepreneur — One who has yet to provide a return on investment.
          まだ投資に対するリターンを供さなければならない人

disrupt — To overcome any legal, social, or moral barrier to profit.

■_ vim

本当にキモい Vim script - 正規表現編 - 永遠に未完成

本当にキモい Vim script - 正規表現編 - 永遠に未完成

Vim Advent Calendar 2012 の 339 日目の記事です。

先日、Lingr で :s コマンドの引数をパースする方法についての話になりました。

(略)

s%[ubstitute]

これはコマンド名の部分ですね。%[] は、コマンドを表現するのに便利です。別の書き方をすると、

s%(u%(b%(s%(t%(i%(t%(u%(te?)?)?)?)?)?)?)?)?

これの省略形です。

これは面白いと思った。 どのくらい出番があるのかわからんけど。


([\x00-\xff]&[^\\"|[:alnum:][:blank:]])

これは区切り文字となる部分です。:s/ の / です。

大抵の場合は / を使うと思いますが、実は一部の文字を除く任意の1バイト文字が使えます。

そこで、

任意の1バイト文字

[\x00-\xff]

一部の記号を除く文字(今回の場合は、\"| と英数字です)

[^\\"|[:alnum:][:blank:]]

これらを & で繋ぐことで、どちらも満たした場合、という意味になります。この & は very magic でない場合は \& なので注意。

vim の正規表現にもあったのかー>&


(%(\\.|.){-})

これは {pattern} の部分です。キャプチャするために () で囲ってあります。

{-} は最短一致です。Perl などで言うところの *? です。全体のパターンを見ると、次は \1 になっており、つまり区切り
文字が来るまで、という意味になります。最短一致にしないと、末尾にある区切り文字まで見に行ってしまいます。

ここのキモなのですが、単純に .{-} とすると、\ でエスケープされた区切り文字で止まってしまいます。そこで、

%(\\.|.)

これです。これは \ を見付けた場合、次の任意の1文字もマッチに含めます。こうすることで、\ の直後の区切り文字は
{pattern} に含まれるようになります。

これを逆に、%(.|\\.) と書くと、先に任意の 1 文字である . がマッチしてしまうので、うまく行きません。| で区切る
順番はとても重要です。

%() は後方参照を伴わないグループです。

\\. | . がちょっと気になる。こういうのの繰り返しのようなパターンを書いちゃうと ReDOS にはまりかねないような。 まあエディタのマクロだし、意地悪い入力はこないんだろうけど。

詳しい解説は→ 詳説 正規表現 第3版
詳説 正規表現 第3版

■_

なんか twitter のTLに流れてきたので気になってみてみた 関数型プログラミング言語のまとめ - ワザノバ | wazanova.jp

関数型プログラミング言語のまとめ - ワザノバ | wazanova.jp

関数型プログラミング言語のまとめ

http://funceng.com/2013/11/03/review-of-functional-languages/

Kevin Buellがブログの一連のエントリーで関数型プログラミング言語の概要をまとめています。

    1) Haskell

    ラテン語がわかる人には親しみやすい。に似てプロとして使ってなくても、分かっていればすごく役に立つ。
    [今までで最高に恥ずかしい誤訳でした。早速ご指摘いただいた皆様ありがとうございました!!! ]

    [Background]

    遅延評価の研究成果をとりまとめる委員会が1990年にHaskell 1.0の仕様をつくった。コンパイラはGlasgow Haskell
    Compiler (GHC)が最も有名。Haskellに関する研究はMicrosoft Researchで盛ん。.NETのための関数型言語であるF#も
    Microsoft Researchの成果であるが、別の研究者グループの手により後年世にでてきた。

    その他の項目は原文参照ください。

[Background] までをみると

Intro to Haskell | Functional Engineering

Intro to Haskell

Since language selection is an important part of software engineering and planning, I’m kicking off a series
of posts on comparative functional languages. My goal is to provide a brief introduction to the major modern
functional programming languages aimed especially at those who have some basic background in FP but only
modest experience with the FP language landscape. Even if you have significant experience in one or two
functional languages, hopefully you’ll find it useful to compare what you’re used to with what else is
available in the FP community.

Today I’ll be discussing Haskell. In some ways, I think Haskell is a bit like Latin. Even if you don’t
actually use it professionally, it helps immensely if you know it. However, in other ways Haskell is not like
Latin because it is a fully featured and widely used language capable of producing real world software
systems. Indeed, I myself have programmed professionally in Haskell.

Background

最初のパラグラフは全体を通しての導入ということで切って良しとして、 However から後の文をごっそり切っちゃってるのはいいのかなこれ。 ある意味でHaskellはラテン語と似ている。それは~。でも違う点があってそれは~。 という流れで意味を持つんだろうし、そもそも「ラテン語」を持ち出してくるのには 「裏」があると思うんだけど(それが何かは書かないw)

■_

2013年11月03日

■_

今日のネタ帳に「数学」とだけメモが残ってるんだけど ここから何をどう広げて書こうとしてたんだろう…

有頂天人生 今更ながら買ってみた。 歌詞の「走らないけど止まりはしない」とか「立ち向かうけどたまには逃げる」 という部分がタイヘン気に入りました :)

■_ プロクロニズム

11/2 のジュンク堂書店池袋本店(のPC書)のtwitterアカウントからの投稿

なんか気になったので調べてみた。 コンテンツと人とログは何を生み出すのか?『インターネットを生命化する プロクロニズムの思想と実践』:[mi]みたいもん!

ということでとりあえず wishlist に放り込んでおこう。 Amazon.co.jp

■_

■_

ここ数日 GNU APLのソース読んでません。

glibc regex のアレ extend_buffers (mctx, next_char_idx + 1); の呼び出しが ソース上では三箇所あるんだけど、この関数での呼び出しだけが ループの中にあるのでここが一番アヤシイ気がするんだよねえ

/* Check whether the regular expression match input string INPUT or not,
   and return the index where the matching end, return -1 if not match,
   or return -2 in case of an error.
   FL_LONGEST_MATCH means we want the POSIX longest matching.
   If P_MATCH_FIRST is not NULL, and the match fails, it is set to the
   next place where we may want to try matching.
   Note that the matcher assume that the maching starts from the current
   index of the buffer.  */

static int
internal_function __attribute_warn_unused_result__
check_matching (re_match_context_t *mctx, int fl_longest_match,
		int *p_match_first)
{

(略)

  while (!re_string_eoi (&mctx->input))
    {
      re_dfastate_t *old_state = cur_state;
      int next_char_idx = re_string_cur_idx (&mctx->input) + 1;

      if ((BE (next_char_idx >= mctx->input.bufs_len, 0)
	   && mctx->input.bufs_len < mctx->input.len)
	  || (BE (next_char_idx >= mctx->input.valid_len, 0)
	      && mctx->input.valid_len < mctx->input.len))
	{
	  err = extend_buffers (mctx, next_char_idx + 1);
	  if (BE (err != REG_NOERROR, 0))
	    {
	      assert (err == REG_ESPACE);
	      return -2;
	    }
	}

      cur_state = transit_state (&err, mctx, cur_state);
      if (mctx->state_log != NULL)
	cur_state = merge_state_with_log (&err, mctx, cur_state);

      if (cur_state == NULL)
	{
	  /* Reached the invalid state or an error.  Try to recover a valid
	     state using the state log, if available and if we have not
	     already found a valid (even if not the longest) match.  */
	  if (BE (err != REG_NOERROR, 0))
	    return -2;

	  if (mctx->state_log == NULL
	      || (match && !fl_longest_match)
	      || (cur_state = find_recover_state (&err, mctx)) == NULL)
	    break;
	}

      if (BE (at_init_state, 0))
	{
	  if (old_state == cur_state)
	    next_start_idx = next_char_idx;
	  else
	    at_init_state = 0;
	}

      if (cur_state->halt)
	{
	  /* Reached a halt state.
	     Check the halt state can satisfy the current context.  */
	  if (!cur_state->has_constraint
	      || check_halt_state_context (mctx, cur_state,
					   re_string_cur_idx (&mctx->input)))
	    {
	      /* We found an appropriate halt state.  */
	      match_last = re_string_cur_idx (&mctx->input);
	      match = 1;

	      /* We found a match, do not modify match_first below.  */
	      p_match_first = NULL;
	      if (!fl_longest_match)
		break;
	    }
	}
    }

  if (p_match_first)
    *p_match_first += next_start_idx;

  return match_last;
}

ステップ実行して追いかけてみるかねえ…

2013年11月02日

■_

パターン・ランゲージ: 創造的な未来をつくるための言語 (リアリティ・プラス)
パターン・ランゲージ: 創造的な未来をつくるための言語 (リアリティ・プラス) やっと買った。 (あったのは)社会学のところだったー。

行けるかな hirax.net::11月2・3日はMaker Faire Tokyo 2013で会いましょう!

■_ 僅か

シリコンバレーが考える「次の10億人」 - nanapi社長日記 @kensuuGoogle、「Android 4.4 KitKat」と「Nexus 5」を発表 -INTERNET Watch Android KitKatにおける最大の発表は、様々な新機能よりも、わずか512MバイトのRAMしか搭載していない古い端末でも快適に動作するようにしたことだ。

512 メガバイトに「わずか」という形容がつくなんてすげー時代だなあと思ってしまう世代なんですがそれはさておき。 Android 4.4 KitKat and Updated Developer Tools | Android Developers Blog

Android 4.4 KitKat and Updated Developer Tools | Android Developers Blog

As part of this release, we kicked off Project Svelte, an effort to reduce the memory needs of Android so that
it can run on a much broader range of devices, including entry-level devices that have as little as 512MB RAM.
From the kernel to system, frameworks, and apps, we've reduced memory footprint and improved memory management
so Android can run comfortably on only 512MB of RAM. We did this not only on Android but across Google apps,
like Chrome and YouTube.

ふむん。

■_ hang ~

こういう二語構成のイディオム苦手ー○| ̄|_ 特に in だの on だの of だのくっついたやつ

「hang out」の意味と、「hangout」との違い ー 誰かと遊びたい時はこのフレーズを使おう | 英語 with Luke hang outの意味 - 英和辞典 Weblio辞書 『hang out』の意味は『会う』ですよね? ニュアンスに『デートする』は含まれませ... - Yahoo!知恵袋

■_ 先越されても泣かない

本の虫: DOOM 3 BFGの技術ノート

たぶん DOOM 3 BFG Technical Note [pdf] | Hacker News 経由だと思うんだけど、取りあげられてたpdfに見覚えがあった。 Firefoxのダウンロード履歴を見るとその pdfドキュメントを10月6日にダウンロードしてた。 さらに検索すると多分これで知ったっぽい。 DOOM3 BFG Technical Notes [pdf] : programming でまあ印刷してカバンに放り込みっぱなしだったという話でしたー ○| ̄|_ 邪悪な pdf 読んだンすね。江添さん。

DOOM3 BFG Technical Notes [pdf] : programming

Even if you don't know the DOOM3 source code, section 4 of the paper is a great example of how bizarrely
mismatched CPUs and memory have become. Every intuition you have about fast and slow code, everything you
vaguely remember from your Data Structures class, is all invalid. It's faster to do just about anything using
arrays, no matter how computationally expensive, than it is to use "efficient" data structures with
pointers in them.
DOOM 3 BFG actually does perform skinning on both the CPU and GPU. While the code is very similar the results
actually do not have to be exactly the same. The CPU skinning is only used to do culling and to create the
shadow volumes. However, only shadow triangle indices that are generated on the CPU are used for rendering.
The shadow volumes are not rendered with the CPU skinned vertices. The shadow volumes are rendered with GPU
skinned vertices that use the exact same skinning calculation that is used for all other skinned vertices that
are rendered on the GPU (for the depth pass and light passes). In other words, the shadow volumes silhouette
determination may have slightly different results between skinning on the CPU and GPU, but there will never be
any rendering anomalies or cracks because all rendered triangles use the exact same vertex positions for all
rendering passes (all skinned on the GPU).

Turning off the r_useGPUSkinning cvar all skinning is done on the CPU (not just for shadow volume generation).
This is much more similar to how the original DOOM 3 worked. However, storing the CPU skinned vertices out to
memory and uploading them to the GPU is not the best solution from a performance perspective on today's hardware.

さらに遡るとこういうのもあったり。 これも書こうと思ったままだったなあ。 John Carmack's comment on Doom 3's code style | Hacker News

(自粛)

■_

2013年11月01日

■_

歯医者。 ずっとお世話になっていたところが長期休業中なので新規開拓。

■_

なかなか興味深い顔ぶれな気が。

■_

ボツ。

■_ Toyota Case

追いかけにくいページだなあ(^^; 印刷も1ページごとになるし(まとめて読ませろー~ Toyota Case: Inside Camry's Electronic Control Module | EE Times

Toyota Case: Inside Camry's Electronic Control Module | EE Times

A. So the code complexity and the McCabe Code Complexity is one of the measures of that. And the code complexity
for Toyota's code is very high. There are a large number of functions that are overly complex. By the standard
industry metrics some of them are untestable, meaning that it is so complicated a recipe that there is no way to
develop a reliable test suite or test methodology to test all the possible things that can happen in it.

Some of them are even so complex that they are what is called unmaintainable, which means that if you go in to
fix a bug or to make a change, you're likely to create a new bug in the process. Just because your car has the
latest version of the firmware -- that is what we call embedded software -- doesn't mean it is safer necessarily
than the older one.

So the metrics that I see in the source code that I will talk more in specific with you about, they predict that
there are many more bugs.

実際どんなコードだったのか気になるなあ。

別の記事から Toyota Case: Vehicle Testing Confirms Fatal Flaws | EE Times

Toyota Case: Vehicle Testing Confirms Fatal Flaws | EE Times

A dozen embedded systems experts were allowed to review Toyota's electronic throttle source code in a secure
room in Maryland -- described as the size of a small hotel room. The room, with a guard at the door, was
disconnected from the Internet. No cellphones, paper, belts, or watches were allowed inside. The experts
viewed Toyota's code on five computers in cubicles.

Having spent more than 18 months going in and out of the secure room to study Toyota's code, Michael Barr,
CTO of the Barr Group, put together an 800-page report analyzing the 2005 Camry L4's software. On the witness
stand, he walked a jury step by step through what the experts discovered in their source-code review.
According to Barr's testimony, that review revealed:

    Software bugs that specifically can cause memory corruption
    ソフトウェアバグ。なかでもメモリー破壊を起こす可能性があるもの

    Unmaintainable code complexity in Toyota's software
    トヨタによるソフトウェアにおけるコードの保守不能な複雑さ

    A multifunction kitchen-sink Task X designed to execute everything from throttle control to cruise control
    and many of the fail-safes
    multifunction kitchen-sink Task X は
    スロットルの制御からクルーズの制御、さらに fail-safes の諸々といったものすべてを実行するように設計された

    That all Task X functions, including fail-safes, are designed to run on the main CPU in the Camry's
    electronic control module
    fail-safes を含む Task X 関数群のすべてはカムリの electronic control module のメインCPU 上で実行されるように設計されている

    That the brake override that is supposed to save the day when there is an unintended acceleration is also in Task X

    The use of an operating system in which there is no protection against hardware or software faults
    ハードウェアおよびソフトウェアの故障 faults に対する

    A number of other problems
    その他数多くの問題

memory corruption は「腐敗」より「破壊」のがいいんじゃなかろうか。ということで。 brake override の文章はニュアンス(ブレーキ関連の制御コードも Task X)はわかるんだけど…

日々のことごと ~翻訳の仕事の周辺~ save the dayって? あ、unintended acceleration が起きたときに save the day (事態を収拾) したと推測される brake override も。つーことかしらん。 他の記事も読み直さないと把握できない部分があるなあ。

■_


一つ前へ 2013年9月(下旬)
一つ後へ 2013年10月(中旬)

ホームへ


リンクはご自由にどうぞ

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