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

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

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

ホームへ

2015年02月20日

■_

GLL とか ALL とか知らなかったー The Quest for the One True Parser

■_

■_ configure

configureスクリプトとは何なのか 読んでていくつか気になったことが。


C の非互換性を解消するツールとして、X Window System のツールのコンパイルに使用されている imake が登場しました。
imake はポータビリティの高い Makefile を生成してくれます。
我々はついに非互換性を解消するツールを手に入れた!!

ここや、そこから少し先の

(いつなのか、どこなのか僕も知りませんが、)とあるプロジェクトで configure スクリプトが登場したそうです。 その configure スクリプトは imake と違って情報をデータベース化しませんでした。 代わりにその場で非互換性のある問題点をチェックし、ヘッダファイルや Makefile を生成するようにしたのです。

ここを読むと imake が先に登場したように読めるけどそうだったっけ? GNU の autoconf 辺りはともかく metaconfig とかどうだろう configure script - Wikipedia, the free encyclopedia によると、

configure script - Wikipedia, the free encyclopedia

The first program to come with a Configure script was rn by Larry Wall in 1984. Notable for its wry and jocular running commentary, that script was written entirely by hand and still survives as part of the build system of the trn program.

Since then, an ecosystem of programs has grown up to automate the creation of Configure scripts as far as possible, of which the most common is the GNU Autoconf system described above.

1984年に初登場らしい。んで、imake はというと

imake - Wikipedia, the free encyclopedia

imake is a build automation system written for the X Window System. It was used by X from X11R1 (1987) to X11R6.9 (2005), and continued to be used in XFree86 (last commit 2009). It is implemented on top of the C preprocessor and make. The first version was written by Todd Brunhoff at Tektronix.

■_ metaconfig

で、mtaconfig について色々調べた Autoconf - Wikipedia, the free encyclopedia

Autoconf - Wikipedia, the free encyclopedia

History

Autoconf was begun in the summer of 1991 by David Mackenzie to support his work at the Free Software Foundation.
In the subsequent years it grew to include enhancements from a variety of authors and became the most widely
used build configuration system for writing portable free or open-source software.

Approach

Autoconf is similar to the Metaconfig package used by Perl. The imake system formerly used by the X Window System
(up to X11R6.9) is closely related, but has a different philosophy.

metacoinfig を調べてたらこんなのが見つかった。 特別対談 - 梅田望夫×まつもとゆきひろ対談 第2弾「ネットのエネルギーと個の幸福」(前編):ITpro

特別対談 - 梅田望夫×まつもとゆきひろ対談 第2弾「ネットのエネルギーと個の幸福」(前編):ITpro

Larry WallはPerlの前にpatchというプログラムを作ってるんです。プログラムを変更内容を差分として抽出して, 変更作業を自動化するプログラムで,それまではプログラマが目で見て手で修正していたんですね。 今では修正することイコール「パッチをあてる」と言うくらい,世界中のプログラマが使っています。 もしかしたらLarry Wallの最も大きな功績はpacthじゃないかと思ってるんですけど, そのほかにもニュース・リーダーとか,metaconfigという autoconfの先祖にあたる設定ツールとか, プログラマを楽にするツールをいっぱい作っているんですね。そういう「楽をするための苦労は厭わない(笑)」っていう態度はあこがれですね。

ここでも metaconfig Perlニュースレター 第12号

Perlニュースレター 第12号

L: 私は自分自身でプログラムを書くことも好きですが、人々が力を合わせて
プログラムを書くのを手助けするのも好きなのです。

プログラムを書くことをprogramming hackと言います。人々がプログラムを書
くのを手助けすることはcultural hackとでも呼ぶことにしましょう。私は、
programming hackも、cultural hackも両方とも好きです。

私が作ったツールにpatchとmetaconfigがあります。patchは、差分データをも
とにして、ソースプログラムを新しいバージョンに更新するためのものです。

PNL: ええ、プログラムの開発やメンテナンスには、patchは欠かせないツール
ですね。

L: metaconfigは、ソフトウェアを、インストール先の環境に合わせてカスタ
マイズするためツールです。より正確に言えば、metaconfigは、カスタマイズ
を行なうためのスクリプトを生成してくれます。Perlでも、metaconfigを利用
しています。

Larry Wall's Home Page にも metaconfig についての記述があったものの

Larry Wall's Home Page

metaconfig

    No longer maintained. These days you're probably better off using something like GNU autoconf, one of the spiritual descendents of metaconfig. 

こう。 ところで、Larry についての英語版の記事にはmetaconfig でてこないけど ドイツ語版では名前が出てる

Larry Wall - Wikipedia, the free encyclopedia Larry Wall – Wikipedia

Larry Wall – Wikipedia

Er ist Erfinder der Programmiersprache Perl, des weitverbreiteten Programms patch, Autor des Usenet-Clients rn und des Erzeugers von Konfigurationsscripten metaconfig. Er gewann zweimal den IOCCC-Wettbewerb (International Obfuscated C Code Contest) für den undurchsichtigsten C-Quelltext, erhielt im März 1993 den Dr. Dobbs Journal Excellence in Programming Award und im Oktober 1998 den ersten FSF Award.

Larry Wall - Wikipedia, the free encyclopedia

Wall is the author of the rn Usenet client and the widely used patch program. He has won the International Obfuscated C Code Contest twice and was the recipient of the first Free Software Foundation Award for the Advancement of Free Software in 1998.

■_

Autoconf のマニュアルの「History」のところ面白い Autoconf

2015年02月19日

■_

今年もこれの時期に 「デブサミ2015」本日開幕、エンジニア個人やビジネスの成長のためのアクション「Growth!」が今年のテーマ:CodeZine デブサミ2015、講演関連資料まとめ:CodeZine

■_

■_

元ネタ うさたーん (ボーパルバニー)さんはTwitterを使っています: "CPU Affinityの設定する時に確認用の表を出力したいんだけど誰かawkだけでまとめて! https://t.co/rbHdEleakM"

んで元スクリプトと回答二つ



#CPU Affinityの設定する時に確認用の表を出力したいんだけど誰かawkだけでまとめて!
awk 'BEGIN{FS=":"} /(processor|physical id|core id)/{print $1,$2}' /proc/cpuinfo | perl -pe 's/(processor|physical)[^\d]+(\d{1,})\n/\1\t\2\t/g'
awk -F':' '{if(/processor/){printf "processor\t%d\t",$2}if(/physical id/){printf "physical id\t%d\t",$2}if(/core id/){printf "core id\t%d\n",$2}}' /proc/cpuinfo
awk -F':' '/processor/{printf "%s\t%d\t",$1,$2}/physical id/{printf "%s\t%d\t",$1,$2}/core id/{printf "%s\t%d\n",$1,$2}' /proc/cpuinfo

書式文字列がほぼ同じなのに二つも三つもあるのはよろしくないよね。 ということでこんな感じ?

awk -F':' '/processor/||/physical id/||/core id/{printf "%s\t%d%s",$1,$2, /core id/?"\n":"\t"}' /proc/cpuinfo

今度は /core id/が二つになっちゃったけど :P

2015年02月18日

■_

はじっこ@動物写真さんはTwitterを使っています: "どなたか、この御方の名前をご存知ありませんか(´・ω・`) #鳥 http://t.co/2DF7EmYtZ5" この鳥さんを「つぐみん」といってしまう 「とりぱん」読者:) とりぱん(17) (ワイドKC モーニング)
とりぱん(17) (ワイドKC モーニング)

この本かな。先週末に偶然見かけて気にはなってたんだけど 第一次世界大戦開戦原因の再検討――国際分業と民衆心理
第一次世界大戦開戦原因の再検討――国際分業と民衆心理

駅から会社に行く道の途中に、新しくコンビニ的な店ができたんですよ (「的」というのは作りはコンビニっぽいんだけど雑誌等扱ってないとかあったので)。 んで、ある朝試しに入ってみたんですが、まー店員さんが多くてびっくり。 レジが4台あってそこにひとりずつ、厨房があってそこに二人かそれ以上、 さらにフロアにも…と 思わず人件費やら計算しそうになっちゃったよw まだ早い時間だったせいか客はわたし以外いなかったんだけど、 あの商品(厨房で作ってたサンドイッチ類とかおにぎりとか)ちゃんと捌けてんだろか。 あとあれだ。BGMうっせいw

■_

■_

なにこれ Amazon.co.jp: スナフキン ノート (講談社文庫): トーベ・ヤンソン: 本

微積分が砲術のため~ ってのは違う気がするんだけど面倒なので調べない 疲れてる人さんはTwitterを使っています: "「微分積分なんて出来なくても自衛隊じゃ必要ないだろう」とタカを括って入隊した方が特課(砲兵)に配属されて泣きを見てましたね。。。 そりゃ微分積分は砲術(弾道計算)の為に産み出されたもんだからね、残念でもないし当然。"

2015年02月17日

■_

夏目友人帳の一番くじが出てた(第2弾)。 ニャンコ先生のアレとかアレとか欲しいw 一番くじ | 一番くじ 夏目友人帳 あやかし雑貨店 『春ノ新柄入荷シマシタ』

読んだ。 Harmful GOTOs, Premature Optimizations, and Programming Myths are the Root of all Evil : programming Harmful Gotos, Premature Optimizations, and Programming Myths | Hacker News Harmful GOTOs, Premature Optimizations, and Programming Myths are the Root of all Evil なんというか、ここで指摘されてることがまんま↓で起きてたりして思わず苦笑い。 一読をオススメするけど英語だからってスルーする人ばかりかな。

C言語の開発者によるgoto文の使い方を対象とした実証研究の結果、「goto文は無害だと考えられる」 | スラッシュドット・ジャパン デベロッパー An empirical study of goto in C code [PeerJ PrePrints] 頑張って? 英語版 /. のリンク先の元記事のリンクからPDF落として読みましたわさw 意外にきちんとやってたのと、日本人と思われる人の名前も執筆者の中にあったのにびっくりした。

Henry Spencer にもコードの誤り。 解説記事読んだけど、ああいうコーディングはやってしまいそうでちょっと怖い。 JVNVU#92987253: Henry Spencer の正規表現 (regex) ライブラリにバッファオーバーフローの脆弱性 Full disclosure: heap overflow in H. Spencer’s regex library on 32 bit systems | Guido Vranken

増井さんの本は偶然会社近くの書店で見かけたので買った。 KADOKAWAのこの本はなんじゃらほい。

infoq parser

■_

■_

The Joel Test Updated For Programmers Joel の

The Joel Test
    Do you use source control?
    Can you make a build in one step?
    Do you make daily builds?
    Do you have a bug database?
    Do you fix bugs before writing new code?
    Do you have an up-to-date schedule?
    Do you have a spec?
    Do programmers have quiet working conditions?
    Do you use the best tools money can buy?
    Do you have testers?
    Do new candidates write code during their interview?
    Do you do hallway usability testing?

に対して、 Several people have asked me lately if I had an idea for a Joel Test to evaluate an actual programmer, rather than a software development organization, so I’ve decided to put together a list of what I think might be a good equivalent of the Joel Test for evaluating the skills of an actual software developer. ということで作ったというのがこれ。

The Simple Programmer Test

    Can you use source control effectively?
    Can you solve algorithm-type problems?
    Can you program in more than one language or technology?
    Do you do something to increase your education or skills every day?
    Do you name things appropriately?
    Can you communicate your ideas effectively?
    Do you understand basic design patterns?
    Do you know how to debug effectively?
    Do you test your own code?
    Do you share your knowledge?
    Do you use the best tools for your job?
    Can you build an actual application?

個々の項目の詳細な説明は元記事にあります。

2015年02月16日

■_

えらい人が、月に一回くらい 全校朝礼での校長先生のお話的なものをするわけですよ。 んで、ここんとこずっと「坂の上の雲」の旅順攻略戦の下りから話を始めるんですが

日本史。 鎌倉幕府の始まりの年だとか、 大化の改新→乙巳事変(はちょっと違うか)等々 わしらががきんちょの頃に教わったものとはだいぶ変わっているようなんですが、 北条早雲のイメージもかなり変わってきている(実像が明らかになってきている) らしいですね。 北条早雲 - Wikipedia

どっかのぶろがーにもいたなあ。これ知らないで逆の意味で使ってたの。 何年前だっけ? 意外と知らない知識「ボンバイエ→やっちまえという意味」 | 「マイナビウーマン」

■_

■_

C言語の開発者によるgoto文の使い方を対象とした実証研究の結果、「goto文は無害だと考えられる」 | プログラミング - スラッシュドット・ジャパン C言語の開発者によるgoto文の使い方を対象とした実証研究の結果、「goto文は無害だと考えられる」 | スラッシュドット・ジャパン デベロッパー こういうときは原文に当たれ。と。

C言語の開発者によるgoto文の使い方を対象とした実証研究の結果、「goto文は無害だと考えられる」 | スラッシュドット・ジャパン デベロッパー

200万近いC言語のファイルと1万1千件を超えるプロジェクトからランダムに抽出した統計的に有効なサンプルを 質的および量的に分析したところ、開発者はほとんどの場合gotoの使用を適切に制限しており、 Dijkstra氏が懸念したような無制限な使用は行われていないことが判明した。 これらのことから、実際にはgotoは有害でないものと考えられる。

Empirical Study On How C Devs Use Goto In Practice Says "Not Harmful" - Slashdot

By qualitatively and quantitatively analyzing a statistically valid random sample from almost 2 million C files and 11K+ projects, we find that developers limit themselves to using goto appropriately in most cases, and not in an unrestricted manner like Dijkstra feared, thus suggesting that goto does not appear to be harmful in practice.

んー、なんかニュアンス違わない? >suggesting that goto does not appear to be harmful in practice実際にはgotoは有害でないものと考えられる

■_

むかーしちょこっとだけやったのだけど その頃のものとはだいぶ違うものらしいですね>じんこーちのー ざっくり歴史というか変遷というか変わりっぷりを追いかけるのによい資料(書籍) あるかな。 ビッグデータは人工知能に任せた! - ビッグデータは人工知能に任せた![1] 人工知能を制する者が勝つ:ITpro

■_

時間がない。あとで Harmful GOTOs, Premature Optimizations, and Programming Myths are the Root of all Evil

2015年02月15日

■_

扶桑の艦橋の裏側ってこうなってたんだ。 1/700じゃあこの辺わかんないよなあ (表紙は扶桑ですが山城の艦橋背面もあり)。 艦船模型スペシャル 2015年 03 月号 [雑誌]
艦船模型スペシャル 2015年 03 月号 [雑誌]

2015のあとの番号って通し番号だっけ? 今の時期にしてはずいぶん大きい数字な気が CVE-2015-1593 - Linux ASLR integer overflow: Reducing stack entropy by four

■_

2015年02月14日

■_

お、こんなのやってるのか。

あ、読もうと思って印刷してたやつだ( http://arxiv.org/pdf/1502.01410v1.pdf) Javaで書かれたソースコードの大部分は冗長? | スラッシュドット・ジャパン デベロッパー Your Java Code Is Mostly Fluff, New Research Finds - Slashdot

THE BLUE HEARTS 30th ANNIVERSARY ALL TIME MEMORIALS ~SUPER SELECTED SONGS~【CD3枚組通常盤】
THE BLUE HEARTS 30th ANNIVERSARY ALL TIME MEMORIALS ~SUPER SELECTED SONGS~【CD3枚組通常盤】 発売日に買っといてまだリッピングしてなくて聴いていないという…

Dr. Streamlove, or: How I Learned to Stop Worrying and Love the Flow このタイトルはやはりアレのもじりですかね。 Viktor Klang shows the purpose and power of streaming concurrent data processing with safe bounds using back pressure, discussing Akka streams and dynamic runtime as well as compile time optimizations.

■_

■_

結構awkネタあるのね>Qiita shell - awkコマンドメモ - Qiita awk力を0からせめて1に上げる - Qiita awkを使うにあったって、有用なテンプレート的なものを見つけた:メモ - Qiita

awkに関する86件の投稿 - Qiita ふむ。

2015年02月13日

■_

良い記事に目をつけてるとは思うんだよね。 それだけに(ry 【翻訳】なぜ採用される言語とされない言語があるのか | POSTD とあとえばこの翻訳記事もざっと読んで Heartbleedは表面上は採用と静的解析の進歩ですが、 この下りにびっくりしたんだけど、 (Heartbleed はバグの名前なんだから、静的解析の進歩とどう繋がってるの。と)、 原文を確かめてみるとこう。 While Heartbleed is ostensibly about the adoption and improvement of static analysis, about の扱い(解釈)が面倒かもしれないけど無視しちゃいけないんじゃないかなあ。 それと、またいつものパターンの誤訳やってますね。>「採用と静的解析の進歩」 この「採用」(adoption) は improvement と一緒に static analysis にかかってる(はず)。 しかし、この訳文自分で読んで疑問に思わなかったんだろうか……

■_

2015年02月12日

■_

戦いの世界史: 一万年の軍人たち
戦いの世界史: 一万年の軍人たち 読んでる。

駅をデザインする (ちくま新書)
駅をデザインする (ちくま新書) 面白かった。 色やアルファベット路線を区別するのは会社任せにして済まされない部分ってあるのだねえ (相互乗り入れが絡んできたりするし)。 駅構内の案内もわかりづらいとは思っていたけれども、なぜ分かりにくいのかや 分かりやすくするにはどうすればいいのかといったことがなんとなくみえてきたかも。

「The Healthy Programmer」を読んで自宅を快適なプログラミング環境にする - 八発白中 追記があって、 翻訳版が作業中だそうな>The Healthy Programmer

Larry のインタビューが。 Perl creator Larry Wall: Rethought version 6 due this year | InfoWorld InfoWorld: What are the key improvements in version 6? Why should developers be excited about it? という問に対して Wall: In a nutshell, it's what people like about Perl minus lots of what people don't like about Perl, with additional cleanups and powerups that Perl 5 could not do with its original design. Perl 6 is definitely still a version of Perl philosophically, insofar as it's an operator-rich, multi-paradigm language that prefers expressiveness and programmer creativity over telling the programmer how they have to solve the problem. 先に「minus」のことがらが来るのが何とも。

■_

2015年02月11日

■_

「The Healthy Programmer」を読んで自宅を快適なプログラミング環境にする - 八発白中" この本、みずしまさんも読んでたはずなんだけどどうだったんだろう。

今まで知らなかったんだけど「終わりなき戦い」の続編があったのね。 終わりなき平和 (創元SF文庫)
終わりなき平和 (創元SF文庫) 偶然書店でこれを見かけて、 「えー、なんかホールドマンの『終わりなき戦い』を意識したようなタイトルだなあ… え、これも著者ホールドマンじゃん」 てな感じ。 にしても、ハヤカワから創元社にかわってるんだ。 終りなき戦い (ハヤカワ文庫 SF (634))
終りなき戦い (ハヤカワ文庫 SF (634))

■_


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

ホームへ


リンクはご自由にどうぞ

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