ときどきの雑記帖'

I'd just be the catcher in the rye and all. I know it's crazy, but that's the only thing I'd really like to be. I know it's crazy.

The catcher in the rye
J. D. Salinger

著作権保護期間の70年延長に反対

検索エンジン経由でこられた方へ

このページの内容は日々更新されます。 そのため、検索エンジンに引っかかったものがここに残っているとは限りません。

最新エントリ (何日分あるかは不定)

2013年05月22日

■_

会社で興味深い話を聞いたのだけど書けない。

どこまで上がるかなあ… 送料無料!県立地球防衛軍/オリジナルサウンドトラック - ヤフオク!

読書会。 23章に突入。 実は22章でちょっと引っかかってたところは後回しにしてしまったり。 いろいろあるんですが、とりあえず 22.5.5 で

λz:ZZ. λy:YY. z (y true)

<fun> : (?X0→?X1) → (Bool→?X0) →?X1

になるのがわからない○| ̄|_ 次のも(if then else のやつ)アヤシイんだけども。 どなたか解説ぷりーず。

■_ coding convention

Plan 9 Coding Conventions for C | Hacker News から

Plan 9 /sys/man/6/style

*don't use // comments; some old Plan 9 code does, but we're converting it as we touch it. We do sometimes use // to comment–out a few lines of code.
*avoid gotos.
*no tabs expanded to spaces.
*surround a binary operator (particular a low precedence one) with spaces; don't try to write the most compact code possible but rather the most readable.
*parenthesize expressions involving arithmetic and bit–wise operators; otherwise don't parenthesize heavily (e.g., as in Pascal).
*no white space before opening braces.
*no white space after the keywords if, for, while, etc.
*no braces around single–line blocks (e.g., if, for, and while bodies).
*integer–valued functions return –1 on error, 0 or positive on success.
*functions that return errors should set errstr(2).
*variable and function names are all lowercase, with no underscores.
*enum or #defined constants should be Uppercase (or UPPERCASE).
*struct tags are Uppercase, with matching typedefs.
*automatic variables (local variables inside a function) are never initialized at declaration.
*follow the standard idioms: use x < 0 not 0 > x, etc.
*don't write !strcmp (nor !memcmp, etc.) nor if(memcmp(a, b, c)); always explicitly compare the result of string or memory comparison with zero using a relational operator.

まあそうだよねえ。という感じ? いや待て待て。 あ、変数名/関数名にアンダースコア使うななんてのがあるな。 自動変数を宣言時に初期化するなとか。これはなんでだろう。

if の条件のところで代入するなというのもないのか(if ((fp=func())==NULL みたいなあれね)。

no tabs expanded to spaces ってことはタブはタブのままってことか。 幅はどうするんだろう(8固定?)

う、if/for/while などの後ろにスペース置くなとかある。

■_

Backport #8431: File.read() crash on Win32SP3 32bit - Backport 200 - Ruby Issue Tracking System

■_

PHP の array_shift から考える、実体と名称の関係について - 頭ん中 これら四つの関数名はPerlから来たものじゃないだろか。 んで、shitft はシェルスクリプトの shift から来たものじゃないかと (サブルーチンの引数やARGVを「shift」するのはまさにそれだし)。

■_

A closer look at a recent privilege escalation bug in Linux (CVE-2013-2094) at time to bleed by Joe Damato まだ細かいところまで読んでいないんだけど、 要するに原因(少なくとも一つには)は int を不用意に使ってしまった/ているところにあったという ある意味「経年劣化」とも言えるようなものだったと。

で、結論のところ

A closer look at a recent privilege escalation bug in Linux (CVE-2013-2094) at time to bleed by Joe Damato

Conclusion

    Dealing with integers in C code is tricky. Be careful and get people to review your code.
    Hijacking IDT entries to scan kernel memory to find and overwrite kernel data structures to elevate privileges of a user process so it can then execute a bash shell as root is pretty nuts.
    MAP_FIXED is actually much more useful than I had previously imagined.
    Hijacking IDT entries to scan kernel memory to find and overwrite kernel data structures to elevate privileges of a user process so it can then execute a bash shell as root is pretty nuts.
    Reading exploit code is fun and interesting. You should do it more often than you probably do right now.
    I'm tired from writing this much.

Dealing with integers in C code is tricky. Be careful and get people to review your code. こうなると。

■_

pbook→ebookと、ebook→pbbok

■_

くそう、クレーンが縮んで行くのをみたかった

■_

2013年05月21日

■_

Springer さんから半額セールのお知らせが来たのはいいんだけど、 半額でなおこのお値段か…ぐぬぬ The Algorithm Design Manual - Hitchhiker's Guide to Algorithms Handbook of Floating-Point Arithmetic Experimentation in Software Engineering

■_

これ、どうなったのかなあ。 まあ発表したからってすぐ何か変わるというものでもないと思うけど。 朝日新聞デジタル:日立など、高信頼の車制御ソフト検査技術を開発-プログラム35万行適用 - 日刊工業新聞ニュース - テック&サイエンス 成果は、米デトロイトで16日から18日まで開かれる米国自動車技術会(SAE)国際学会で発表される。

■_

マンガでわかる~は結構買ったのでもう買うのがないんじゃないかという気が… でもこーゆーの欲しいのだった。

■_

一人でやってるぽいけど、誰か分からない部分を解説できる人近くにおらんのだろか。 問題1.7 をやって。。 ではなくて写してみる;; - moremagicの日記 問題1.11 を半分写してみた - moremagicの日記 問題1.12 をやってみた。。。けどうまく動かなくて写経orz - moremagicの日記

わたしも他の本で聞きたいのがあったり以下略

■_

2013年05月20日

■_

いやもーなんというか、咳をするにしてももう少し小さい音でやってくれと(ry

Yさんの新刊見かけなかった。

■_

perl v5.18.0 released! - Islands in the byte stream perl 5.18.0 is now available! : perl 変更点みているとなかなか面白いものが

perl5180delta - perl v5.18.0 での変更点 - perldoc.jp

置換のより厳密なパース

パーサが s///e を以下のようにパースすることを悪用することはもはや できなくなりました:

    %_=(_,"Just another ");
    $_="Perl hacker,\n";
    s//_}->{_/e;print
ヒヤドキュメントのパース

クォート風演算子の内側のヒヤドキュメントの本体は、常に "<<foo" マーカーの 次の行から
始まるようになりました。 以前は、クォート風演算子を含む行の次の行から始まると文書化されていましたが、
これは時々しか正しくありませんでした [perl #114040]。

英数字演算子は正規表現の閉じ区切り文字から分離されなければならなくなりました

もはや以下のようには書けなくなりました:

 m/a/and 1

代わりに以下のように書かなければなりません

 m/a/ and 1

演算子を正規表現の閉じ区切り文字と分けるための空白が必要です。 空白がないと、Perl v5.14.0 から廃止予定
警告が出ます。

qw(...) はもはやかっことして使えなくなりました

qw リストは、常にかっこで囲まれているとパーサが考えるように騙すために 使われていました。 これにより、実
際には foreach $x (qw(a b c)) {...} と書くべきところで foreach $x qw(a b c) {...} のような驚かされる構
文が可能でした。 これは時々構文解析器を間違った状態にするので、完全には動作せず、 許されると想定するか
も知れない似たような foreach qw(a b c) {...} は 全く動作しませんでした。

qw のこの副作用は撤廃されました。 これは Perl v5.13.11 から廃止予定でした。 文法が必要としているところで
はどこでも、実際のかっこを使うことが 必要になりました。

正規表現中の逆スラッシュのある種の稀な使用法は廃止予定になりました

Perl が正規表現パターンのメタ文字として認識する 3 組の文字があります: {}, [], () です。 これらは以下
のように区切り文字としても使えます:

  m{foo}
  s(foo)(bar)

これらはメタ文字なので、正規表現では特別な意味があります; そして これらの文字を区切り文字として使った
パターンの中で使うとき、逆スラッシュを 前置して通常の意味にすることで特別な意味をなくすということがで
きないことが 分かりました。 例えば、以下のものは

  m{foo\{1,3\}}

逆スラッシュは振る舞いを変更せず、これは "f o" に引き続いて 1 から 3 文字の "o" にマッチングします。

なるほどねえ。なんでそういう動作だったのかというのもなんとなくだけど 察しがつきそう。

■_

じっくりと言うほどではないけれども、斜め読みよりは気合い入れて読んでみた。 An Interview with Bjarne Stroustrup | | InformIT

特にここというのを抜き出し。

An Interview with Bjarne Stroustrup | | InformIT

Danny Kalev: Although it may be too early to assess the full impact of C++11 right now, which insights
and conclusions have you reached already regarding C++11? Are there new features that you have grown to
like more than before? Are there features that need further polishing or fixing?

Bjarne Stroustroup: Adding move semantics is a game changer for resource management. It completes what
was started with constructor/destructor pairs, the RAII ("Resource Acquisition Is Initialization")
idiom, and smart pointers to enable safe, simple, and efficient handling of general resources. A
resource is anything that must be acquired and (explicitly or implicitly) released. Examples are memory,
locks, file handles, threads, and sockets.
An Interview with Bjarne Stroustrup | | InformIT

The importance of move semantics is that we can basically eliminate complicated and error-prone explicit
use of pointers and new/delete in most code. Such direct manipulation of memory can disappear into the
implementation of handles, such as vector.

The move semantics is part of my general aim to make simple things simple – without loss of performance,
of course. Other features that support that theme is strongly typed constant (including constexpr
functions that can be evaluated at compile time), general type aliases (to clean up the syntax of generic
code), and uniform and universal initialization (base on the initializer list {} syntax). The code below
has examples. For a list of features, see my C++11 FAQ.

move semantics。と。

An Interview with Bjarne Stroustrup | | InformIT

Danny: Currently, the committee is working on a new C++ standard dubbed C++14. Can you tell us more about
it? Which new features are in line for example?

Bjarne: My definition of the aim of C++14 is “to complete C++11.” That is, to add things we simply
didn’t have time to do before shipping C++11 or things that we didn’t quite know how to design without
the experience of using C++. It is not the job of C++14 to add major new features or support significant
new programming techniques. That’s for C++17. C++14 is a “minor release.”

11→14→17 ですか。

■_

2013年05月19日

■_

プログラマの考え方がおもしろいほど身につく本 問題解決能力を鍛えよう!
プログラマの考え方がおもしろいほど身につく本 問題解決能力を鍛えよう!
第二章まで読んだけどなかなか面白い。すでに書評を書いている人がいるので もっとつっこんだところを知りたいという人はそちらを。 重箱の隅的に気になったところがあったけどそれはまた。 L'eclat des jours(2013-05-06) プログラマの考え方がおもしろいほど身につく本 | OPC Diary - No Code, No Life. プログラマの考え方がおもしろいほど身につく本 問題解決能力を鍛えよう! 感想 V.Anton Spraul - 読書メーター

■_

Windows系からLinux系にスキルチェンジする方法、って本を書いたら売れないかな - ikeike443のブログ The dying platform: .Net | Hacker News この話題には気がつかなかったw そんなに密に見張ってるわけでもないからなあ。 などと言い訳(どこに?

The dying platform: .Net | Hacker News

Microsoft has too many developers and not enough innovation. They encourage a design attitude that
everything has to operate like the flight deck of a 747. Their culture has been incestuous so long
that any change is terribly unlikely.

There are some really, really sharp guys at Microsoft. Not only does the community deserve better
products from such a great company, the developers in many cases have an very unpleasant work
experience.

Google is not too far behind. I think they're pushing a lot of the things they are simply to keep
momentum building. In another 20 years, unless they start building time machines, it'll catch up to
them, too.

Apple is a strange case. They passed the "I wouldn't work for them for a million bucks" point
many years ago, but they're just better at slapping a better marketing image on it than the rest of
them.

Having said all of that, I like .NET, and I think combining it with Mono makes probably the most
full-featured free platform for development anywhere in the world. The effective targeting of the
business market by .NET may be waning, but the platform is nowhere near dying off.

Microsoft is so hit or miss. They're incredibly innovative in the research department, but business
tools are definitely overcomplicated (Dynamics, SharePoint). I use C#.NET daily, and it is the
programming tool I'm most in love with. There is no easier way to make business desktop apps, and
with the new MVC and Entity Framework libraries, there aren't many easier ways to make significant
web applications (i.e. beyond a to-do list or blog). Azure level of functionality makes other cloud
companies look almost archaic.

I think where they're losing is that they've stopped communicating. With customers, with developers,
even internally. They are proceeding down paths they imagined to be important. Some of them are, some
of them aren't, and thus the hit-or-miss nature of their current business. I think a lot of this is
Ballmer. He's trying to be a Jobs and failing miserably, when all he needs to do is allow his people
to actually communicate with the community.

Another part of it is that they can't do anything these days without a bunch of FUD from the media and
Anti-MS sheep. I actually like Windows 8 and appreciate the innovation even if there are some hiccups
to take care of. .NET is great, and I hope they make it easier to move forward and migrate existing
apps to whatever they do next. Will they die anytime soon? Probably not. But if they don't start
communicating soon and often, they'll lose some market share for sure.

747のフライトデッキで云々とは… 元記事もみときますかねー The dying platform: .Net | roundcrisis.Find<Solution>()

■_

情報のソフトウェア工学が学べる大学・大学院一覧 | 大学&大学院.net 通学制の情報のソフトウェア工学が学べる大学・大学院一覧(土日・夜間) | 大学&大学院.net

■_ Metzのルール

最初に Matz のと読んでしまったのはナイショ。 Sandi Metz’ rules for developers

■_

で。その中身

Sandi Metz’ rules for developers
  1. Classes can be no longer than one hundred lines of code. クラスを100行より長くはできない
  2. Methods can be no longer than five lines of code. メソッドは5行より長くはできない
  3. Pass no more than four parameters into a method. Hash options are parameters. 一つのメソッドに4つを超える数のパラメータを渡せない。 ハッシュを使ったオプションもそれぞれパラメータとして扱う
  4. Controllers can instantiate only one object. Therefore, views can only know about one instance variable and views should only send messages to that object (@object.collaborator.value is not allowed). コントローラーはオブジェクトをただ一つだけ instantiate できる。 したがってビューはただ一つだけのインスタンスのみ知り、また、そのオブジェクトに対してのみメッセージを send すべきである (@object.collaboraor.value のような書き方は許されない)

Hash options are がちと不安

各項目の詳細な説明と対処方法などは元記事でよろしく。

■_ Scheme について

なんとなく貼り付けておく

@anohana それは一面の真理ですね。でも、scheme が仮想マシンを持ってないから、そうなったのかも。Java に負けたのは、その辺りかな。

— Shinji Konoさん (@shinji_kono) 2013年5月18日

@shinji_kono JVM程にまで具体的な仮想機械を決めてしまうと新しい言語機能を入れにくい(実際TCOでみんな困ってますし)というダウンサイドがありますね。制限があった方が普及させやすいんですが。抽象的な仮想機械ならば仕様上の意味論定義がそのものだと思います。

— Kilo Kawaiさん (@anohana) 2013年5月18日

@anohana 仮想マシンではなく仕様で規定すれば実装の自由度は高い。そのはずだったんですよね。確かに Dan の言うとおり処理系は多いんだよな。

— Shinji Konoさん (@shinji_kono) 2013年5月18日

@shinji_kono 詰まるところ、ユーザよりも言語実装者向けの言語なのかもしれません。実用的な規模で性能を出そうとすると結局は特定の処理系向けにチューンすることになると思います。

— Kilo Kawaiさん (@anohana) 2013年5月18日

■_

訳されるかな? An Interview with Bjarne Stroustrup | | InformIT

■_

読んでいる時間が 泳ぐやる夫シアター やらない夫が南北戦争を戦いぬくようです 第2回 【東部戦域】ブル・ランの戦い

■_


過去の雑記帖

  1. 2013年5月(下旬)
  2. 2013年5月(中旬)
  3. 2013年5月(上旬)
  4. 2013年4月(下旬)
  5. 2013年4月(中旬)
  6. 2013年4月(上旬)
  7. 2013年3月(下旬)
  8. 2013年3月(中旬)
  9. 2013年3月(上旬)
  10. 2013年2月(下旬)
  11. 2013年2月(中旬)
  12. 2013年2月(上旬)
  13. 2013年1月(下旬)
  14. 2013年1月(中旬)
  15. 2013年1月(上旬)
  1. 2012年
  2. 2011年
  3. 2010年
  4. 2009年
  5. 2008年
  6. 2007年
  7. さらに前
リンクはご自由にどうぞ。

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