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

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

一つ前へ 2016年3月(下旬)
一つ後へ 2016年4月(中旬)

ホームへ

2016年04月10日

■_

今さら「スターウォーズ エピソード7」の話。 「May the Force be with you」の訳が以前と変わったのはなぜなんだろう? 実は旧作についても訳し直しされてたりする? (手間をかけて確かめる気はない) 鉄人会議室【議論】/★あのセリフの英訳・和訳☆ 名台詞May The Force Be With Youの正しい日本語訳は? - 洋画 締切済 | 教えて!goo

なんつーか、美術館でも盛大な音立てて鼻すすったり痰を切るような咳したりする人が いてびっくりだよ。

■_

■_

Linus Torvalds: The mind behind Linux | TED Talk | TED.com

2016年04月09日

■_

必要に迫られてバッチファイルを組むことになった人向けのTips - Qiita たしか Windows2000だったと思うんだけど date コマンドの出力がびみょーに変わっててちょっと苦労した記憶がかすかに (2000以前と比べてどうだったかとかは知らない)。

■_

2016年04月08日

■_

ハヤカワ文庫。 最近の新刊に、タイトル(と作者名)ではそうでもなかったけど 表紙とあらすじ見たら気になるのが幾つか。

Effective Pyhton メモ 項目17 引数に対してイテレータを使うときには確実さを尊ぶ - Qiita なんか面白い言い回しだなあと思ったんだけど Effective Python › Item 17: Be Defensive When Iterating Over Arguments 原文はこうなのね。 どこからこの訳が出てきたんだろう?

日本型セキュリティの現実と理想:第20回 戦艦大和の防御構造に学ぶ効率的な守り方(前編) (1/3) - ITmedia エンタープライズ を読んでしまって頭がクラクラしちゃったんだけど、 参考文献に挙げられてるのが 「戦艦大和ノ最期」 戦艦「大和」と「武蔵」 というところでお察しだった。 そして 日本型セキュリティの現実と理想:第18回 機動戦士ガンダムの量産型モビルスーツから学ぶセキュリティ戦略 (1/3) - ITmedia エンタープライズ これ書いた人だとわかっていろいろ納得。

■_

■_

Handling null in different languages – The Science of Code null に対処した方法のあれこれ。

  def constructionFirm = person?.residence?.address?.constructionFirm

  String constructionFirm = person?.residence?.address?.constructionFirm;

  constructionFirm = person&.residence&.address&.constructionFirm

上から Groovy、C#、Ruby。ってGroovy と C# は実質同じかこれ。 ast year in 2015, Ruby and C# added this feature as well. C# uses the same syntax as Groovy: とあるし。

で、

Handling null in different languages – The Science of Code

This is a great addition to the respective languages, however it does have one flaw. These null-checks are never enforced, so you can forget about them quite easily and introduce subtle bugs into your code base.

Other functional languages, such as Scala, F# and Haskell, take a different approach. They strive to completely eliminate the null value from their Type System.

Java 8 やら swift やら。

2016年04月07日

■_

今日は高校生(たぶん)の購入待ちもいたので 定期券売り場の待ち行列がちょっと長かった。

静かな職場が欲しいでござる……

■_

2016年04月06日

■_

また例の如く「坂の上の雲」からひいてきたお話を聴かされた訳なんですが。 「坂の上の雲」と史実の違いはさておいても、 ちゃんと作品読んだ(あるいは映像作品を観た)のか問いただしたくなるものだった…… なんつーか頭抱えてよいですか○| ̄|_

■_

■_

Comparing types in Python 3 - Eli Bendersky's website Python 2 と 3 の違い(のひとつ)。

Comparing types in Python 3 - Eli Bendersky's website

    /* Compare addresses */
    vv = (Py_uintptr_t)v;
    ww = (Py_uintptr_t)w;
    switch (op) {
    case Py_LT: c = vv <  ww; break;
    case Py_LE: c = vv <= ww; break;
    case Py_EQ: c = vv == ww; break;
    case Py_NE: c = vv != ww; break;
    case Py_GT: c = vv >  ww; break;
    case Py_GE: c = vv >= ww; break;
    default:
        result = Py_NotImplemented;
        goto out;
    }
    result = c ? Py_True : Py_False;

ふむふむ(↑は2の方のコードの一部)。

2016年04月05日

■_

色々ダメ。

■_

■_

nullぽ。

2016年04月04日

■_

定期券買うのも楽になったよねえ(特に継続)と 以前に比べれば格段に短い待ち行列を見て思うなど (わたしの定期の更新はもうちょっと先。自販機でできるし)。

■_

■_

世界の凄腕エンジニア達からのプログラミングに関するお言葉集は不思議にココロを打つのでした - Qiita これ、出典をきちんと書いてもらえないもんかなあ。 本ならタイトルとページとか。 全部は調べてないけど、 これとか。

世界の凄腕エンジニア達からのプログラミングに関するお言葉集は不思議にココロを打つのでした - Qiita

早過ぎる最適化が悪の元凶。確固たる理由が見つかるまでは総当りアルゴリズムでいいから始めよ。 

"Premature optimization is the root of all evil" Start with a brute force algorithm until you find a reason to change. 

- Donald Knuth

Start with 以降はどこからでてきたんだろう? Premature optimization is the root of all evil - Google 検索Donald Knuth - Wikiquote あたりをみると

Donald Knuth - Wikiquote

Computer Programming as an Art (1974) 
 
1974 Turing Award Lecture, Communications of the ACM 17 (12), (December 1974), pp. 667–673 

Science is knowledge which we understand so well that we can teach it to a computer; and if we don't fully understand something, it is an art to deal with it.

p. 668 

In this sense, we should continually be striving to transform every art into a science: in the process, we advance the art.

p. 669 [italics in source] 

The real problem is that programmers have spent far too much time worrying about efficiency in the wrong places and at the wrong times; premature optimization is the root of all evil (or at least most of it) in programming.

p. 671

Programmers waste enormous amounts of time thinking about, or worrying about, the speed of noncritical parts of their programs, and these attempts at efficiency actually have a strong negative impact when debugging and maintenance are considered. We should forget about small efficiencies, say about 97% of the time: premature optimization is the root of all evil. Yet we should not pass up our opportunities in that critical 3%.

なんてのが。

Start with a brute force algorithm until you find - Google 検索 で調べたら スゴ腕エンジニア・プログラマー達から珠玉のお言葉集 - Ruby on Railsのビシバシはぁはぁ日記 スゴ腕エンジニア・プログラマー達から珠玉のお言葉集 その2 - Ruby on Railsのビシバシはぁはぁ日記 が引っかかって、中身を見るに ここからもってきたっぽい? What are the greatest programming tips and tricks you have learned on your own by years of coding? - Quora

What are the greatest programming tips and tricks you have learned on your own by years of coding? - Quora

"Premature optimization is the root of all evil" - Donald Knuth. Start with a brute force algorithm until you find a reason to change.

んー? Knuthセンセの言ってることに Start with 以降は入らないだろこれ。

2016年04月03日

■_

ダイエー碑文谷店、5月5日閉店-閉店セール始まる | 都市商業研究所 既に高層階を中心にテナントの多くが退店しており、3階以上の売場は4月3日を以て閉店、4月4日~5月5日は1~2階のみの営業となる。 ここには「マイコン」をさわりに行ったのだよねえ(遠い目)

https://youtu.be/lWcp_aYpY3M

■_

2016年04月02日

■_

ギークママ、月へ行く:「アポロ計画」を支えた女性プログラマーの肖像 « WIRED.jp 元の英文記事も読んでいたと思うけど、色々読み落としていた気がする。 にしても、翻訳記事のタイトルはちといただけない気が。

文中でタイトルが出てくる Amazon.co.jp: Digital Apollo: Human and Machine in Spaceflight (MIT Press): David A. Mindell: 洋書 は面白そうだな

あと元記事と比べると

ギークママ、月へ行く:「アポロ計画」を支えた女性プログラマーの肖像 « WIRED.jp

「こういった重要なコンピューターが宇宙船に搭載され、ミッションにおいて中核的な役割を与えられたのは 歴史上初めてのことでした」とMIT在籍時にアポロ月着陸船のソースコードに取り組んでいたドン・アイルズは言う。 「われわれは、それが可能だということを示すことができました。いまでは考えられないほどメモリー容量は少なく、 計算速度も遅いコンピューターでしたが、われわれはやり遂げたのです」

Her Code Got Humans on the Moon—And Invented Software Itself | WIRED

The system stored more than 12,000 “words” in its permanent memory—the copper “ropes” threaded by the Raytheon workers—and had 1,024 words in its temporary, erasable memory. “It was the first time that an important computer had been in a spacecraft and given a lot of responsibility for the mission,” says Don Eyles, who worked on the lunar module code while at MIT’s IL. “We showed that that could be done. We did it in what today seems an incredibly small amount of memory and very slow computation speed.” Without it, Neil Armstrong wouldn’t have made it to the moon. And without the software written by Hamilton, Eyles, and the team of MIT engineers, the computer would have been a dud.

ちょーっと大事なところが抜けてるような。 全パラグラフを調べてはないのでほかにもあるかもしれない。

■_

■_

  
コンピュテーショナル・シンキング / 磯辺 秀司 小泉 英介 静谷 啓樹 早川 美徳 著 | 共立出版
  http://www.kyoritsu-pub.co.jp/bookdetail/9784320123984
  まえがき(pdf)http://www.kyoritsu-pub.co.jp/app/file/goods_contents/2504.pdf
  詳細目次(pdf)http://www.kyoritsu-pub.co.jp/app/file/goods_contents/2505.pdf
  Computational thinking - Wikipedia, the free encyclopedia
    https://en.wikipedia.org/wiki/Computational_thinking
    Computational Thinking   Jeannette M. Wing
      https://www.cs.cmu.edu/~15110-s13/Wing06-ct.pdf
    計算論的思考 翻訳:中島秀之
      https://www.cs.cmu.edu/afs/cs/usr/wing/www/ct-japanese.pdf
    教育プログラミング - catch.jp-wiki
      http://www.catch.jp/wiki/index.php?educational_programing
    Thinking as Computation: A First Course (MIT Press): Hector J. Levesque
      http://www.amazon.com/Thinking-Computation-First-Course-Press/dp/0262016990

2016年04月01日

■_

お、4割引。 No Fooling: Save 40%, now at pragprog.com Save 40% on all ebooks at pragprog.com with coupon code APRILNOFOOLS2016. Good through end of day Monday, April 4. なんか買おうと思ってたのあったかな。

こっちも4割引。 期間も長い Apress 40% off all eBooks - Apress IT eBooks Save 40% on all Apress and Springer eBooks! All categories are on sale. Get your discount through April 15. Start now and browse below!

■_

■_

【2016年度版】このPerlハマりどころがすごい!100連発 - Hatena Developer Blog

【2016年度版】このPerlハマりどころがすごい!100連発 - Hatena Developer Blog

each は中断した時、中断した時点の状態が残り続ける 
 
Perlのeachは配列のvalueとともにindexも知りたい時に便利です。 
 
use strict; 
use warnings; 
my @array = ('友奈', '美森', '風', '樹', '夏凜'); 
 
while (my ($index, $value) = each @array) { 
   print $index, $value, "\n"; 
}

え、配列(@array)に対してeach使えたっけ? で調べてみると

Perlの組み込み関数 each の翻訳 - perldoc.jp

each HASH 
each ARRAY 
each EXPR 

ハッシュに対してリストコンテキストで呼び出した場合は、次の要素に対する、 ハッシュのキーと値を返します。 Perl 5.12 以降でのみ、配列のインデックスと値からなる 2 要素のリストを返すので、反復を行えます; より古い Perl ではこれは 文法エラーと考えられます。 スカラコンテキストで呼び出した場合は、 ハッシュの場合は(値ではなく)キー、配列の場合はインデックスを返します。

以下略

げ、結構前から使えてたんじゃん。


一つ前へ 2016年3月(下旬)
一つ後へ 2016年4月(中旬)

ホームへ


リンクはご自由にどうぞ

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