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

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

一つ前へ 2015年4月(下旬)
一つ後へ 2015年5月(中旬)

ホームへ

2015年05月10日

■_

とある書評を読んで気になってたので。 というか帯のトルケルさんに説得された(書影にないのが残念だ)w アンゴルモア 元寇合戦記 (1) (カドカワコミックス・エース)
アンゴルモア 元寇合戦記 (1) (カドカワコミックス・エース) アンゴルモア 元寇合戦記 (2) (カドカワコミックス・エース)
アンゴルモア 元寇合戦記 (2) (カドカワコミックス・エース)

kindle版はこっち アンゴルモア 元寇合戦記(1) (角川コミックス・エース)
アンゴルモア 元寇合戦記(1) (角川コミックス・エース) アンゴルモア 元寇合戦記(2) (角川コミックス・エース)
アンゴルモア 元寇合戦記(2) (角川コミックス・エース)

とある場所で、「ここにゴミを捨てないでください」ってのに英文が併記してあって 「Please do not throw away garbage here」とかあったんだけど (ちょっと記憶があやふや)、 それ、「please」はつけない方がいいんじゃなかろか。

これにも押井監督へのインタビュー記事があるってんで読もうと思ったら近場の本屋では早々に売れてたので 某書店へ PANZER(パンツァー) 2015年 05 月号 [雑誌]
PANZER(パンツァー) 2015年 05 月号 [雑誌]

ホイールダック2号気に入った:) イラストで学ぶ 人工知能概論 (KS情報科学専門書)
イラストで学ぶ 人工知能概論 (KS情報科学専門書)

戦国時代に詳しい人なら割と知っている人多そう>「かんながわ」 神流川の戦い - Wikipedia 吉田さんの家を訪問 - L'eclat des jours(2015-04-20)

■_

■_

Floating Point Routines for the 6502

  Dr. Dobb's Journal, August 1976, pages 17-19.

Floating Point Routines for the 6502

by Roy Rankin, Department of Mechanical Engineering,
   Stanford University, Stanford, CA 94305
   (415) 497-1822

and

   Steve Wozniak, Apple Computer Company
   770 Welch Road, Suite 154
   Palo Alto, CA  94304
   (415) 326-4248

日本の雑誌に掲載されたこの手の奴もこういう形で公開してもらえないもんかねえ…… (Oh!Mz/X のあれとかさー)

■_

40歳以上は「古くさい」? 64歳エンジニア、年齢差別されたとグーグルを提訴 « WIRED.jp 文中に出てきたブライアン・リードってこのひとかな。 Brian Reid (computer scientist) - Wikipedia, the free encyclopedia んで、この件に言及してるのはこの辺り。と。 64-year-old engineer sues Google for age discrimination | Ars Technica Google faces age discrimination class action lawsuit from 64-year-old engineer Robert Heath Developer, 64, sues Google for age discrimination | HLNtv.com

■_

近刊で気になってるメモ。

2015年05月09日

■_

不発弾。前から気になってたんだけど米軍の爆弾てポンド単位だから 1トンとか500Kgのように「切りのいい」数字にはならないような気が 大阪市市民の方へ 不発弾の処理について 米国製2,000ポンド普通爆弾(1トン爆弾) 1発(長さ1.8メートル、直径0.6メートル) ……あれ?

「正軌道」ってどこからでてきたんだろう? テスラのバッテリーは市場破壊の正軌道上にある : ギズモード・ジャパン Tesla Battery Economics: On the Path to Disruption

やっぱりそうかw>「ディレクターズカット版」 [パトレイバー]押井監督「プロデューサーともめまして……」 ディレクターズカット版公開へ | マイナビニュース

■_

■_

Nim Programming Language

■_

なんか妙に盛り上がってるので Five programming problems every Software Engineer should be able to solve in less than 1 hour : programming "Real programmers can do these problems easily"; author posts invalid solution to #4 : programming Five programming problems every Software Engineer should be able to solve in less than 1 hour

The 5 problems (The following problems are ridiculously simple, but you'd be surprise to discover how many people struggle with them. To the point of not getting anything done at all. Seriously.)

で、問題。 訳つけないでも大丈夫だよね?w

Problem 1
Write three functions that compute the sum of the numbers in a given list using a for-loop, a while-loop, and recursion.

Problem 2
Write a function that combines two lists by alternatingly taking elements. For example: given the two lists [a, b, c] and [1, 2, 3], the function should return [a, 1, b, 2, c, 3].

Problem 3
Write a function that computes the list of the first 100 Fibonacci numbers. By definition, the first two numbers in the Fibonacci sequence are 0 and 1, and each subsequent number is the sum of the previous two. As an example, here are the first 10 Fibonnaci numbers: 0, 1, 1, 2, 3, 5, 8, 13, 21, and 34.

Problem 4
Write a function that given a list of non negative integers, arranges them such that they form the largest possible number. For example, given [50, 2, 1, 9], the largest formed number is 95021.
Update: Apparently this problem got a lot of people talking (although not as much as Problem 5 below.) You can click here to read my solution.

Problem 5
Write a program that outputs all possibilities to put + or - or nothing between the numbers 1, 2, ..., 9 (in this order) such that the result is always 100. For example: 1 + 2 + 34 – 5 + 67 – 8 + 9 = 100.
Update: (Here is one solution to this problem in case you are curious.)

2015年05月08日

■_

昨日発売のTV Bros に押井監督へのインタビュー記事があるってんで買って読んでみたら…… なんじゃそりゃー(以下自粛)

首都決戦での疑問点がまた一つ解消したけど、うーむ。

■_

■_

Programming languages: not just the usual suspects - blog post | Financial Industry & Algorithmic Trading News | Automated Trader この記事の途中にある周期表っぽいのに書かれたプログラミング言語、 幾つか読み取れない(わからない)ものが

  A →?
  E →?
  Ft →FORTRAN
  Ag →ALGOL
  Cb →COBOL
  L  →Lisp
  Sn →SNOBOL
  Bs →BASIC
  Sm →?
  P  →PL/I
  B  →B
  Lg →Logo
  Fo →FORTH
  Pc →Pascal
  St →Smalltalk
  Sq →SQL
  Pg →Prolog
  C  →C
  M  →? (Modula?)
  Ml →ML
  Sc →Scheme
  Ad →Aada
  Cp →C++
  Ef →Eiffel
  Oc →Objective-C
  Ps →PostScript
  Tc →Tcl
  Ht →HyperTalk
  Pl →Perl
  Cl →Common Lisp
  Er →Erlang
  Vb →Visual Basic
  Dp →Delphi
  Jv →Java
  Py →Python
  As →AppleScript
  Cf →Coldfusion
  Js →JavaScript
  Pp →PHP
  Fs →F#
  Hk →Haskell
  Cs →C#
  Sl →Scala
  Gv →Groovy
  Rb →Ruby
  G →Go
  Cj →Clojure

追記: Periodic Table Of Programming Languages

Periodic Table Of Programming Languages

1. THE PERIODIC TABLE OF PROGRAMMING LANGUAGES © Paul Bowler
A E 1 2 Analytical Engine Visualisation of the evolution of popular programming languages
ENIAC Short Order Code Code Mechanical
Functional Ft Ag Cb L 3 4 5 6
Imperative Dynamic Fortran ALGOL Object Oriented Concurrent COBAL LISP
Scripting Multi-paradigm Sn Bs Sm P B Lg 7 8 9 10 11 12
Declarative SNOWBOL BASIC Simula PL/1 B LOGO Fo Pc St Sq Pg C M Ml Sc 13 14 15 16 17 18 19 20 21
Forth Pascal Smalltalk SQL Prolog C Modula ML Scheme Ad Cp Ef Oc Ps Tc Ht Pl Cl Er
22 23 24 25 26 27 28 29 30 31 Ada C++ Eiffel Objective C PostScript Tcl HyperTalk Perl Common LISP Erlang
Vb Dp Jv Py As Cf Js Pp Fs Hk 32 33 34 35 36 37 38 39 40 41
Visual BASIC Delphi Java Python AppleScript Coldfusion JavaScript PHP F# Haske
lEach row represents roughly a decade, The colours denote the programming
Cs Sl Gv Rb G Cjstarting on the second row with the 1950s
42 43 44 45 46 47 paradigm that the language in questionup to the 2000s on the final row.
The first originally supported or the primaryrow is pre-1950 with the two mechanical paradigm for which it is known.
Someprogramming systems from which all others languages may have evolved to supporthave evolved
- the first from around 1837 C# Scala Groovy Ruby GO Clojure other paradigms over time which are notcreated by
Charles Babbage and Ada shown.Lovelace. 

2015年05月07日

■_


連休中、某美術館とか他の某美術館とか行こうと思ってたのだけど 入場待ちが嫌で断念。

歴群の隣に歴史街道が置かれていたのでついでにちょっと読んでみたけど 内容が何ともアレだったなあ…… 歴史群像 2015年 06 月号 [雑誌]
歴史群像 2015年 06 月号 [雑誌] 歴史街道 2015年 06 月号
歴史街道 2015年 06 月号

■_

2015年05月06日

■_

新しいの来た。 Technology Radar | ThoughtWorks The Pragmatic Bookshelf | Pragmatic Scala, new May PragPub magazine

JR渋谷駅の新南口を初めて使った。 改札口ができたってのもあるんだろうけど(東横線の移設の方がでかいか?)、 記憶とだいぶ違ってた。あの辺り。

■_

■_

2015年05月05日

■_

最近は大きめな書店であればわりと暗黒通信団の本を見かけるようになりましたが 最近見かけたこれは中身を見て大笑い。 読むのにデコーダー必要じゃなかろうか。 圧縮された本
圧縮された本

菖蒲湯。

■_

■_

2015年05月04日

■_

とある記事経由でこの記事を読みまして。 NIKKEI is Worst of Worsts. もしくは「無料(ただ)より高くつくものはない」 — Baldanders.info

そういえば、アレとかアレの「この先を読むには会員登録云々」のその先を読むために 日○なんちゃらの会員登録してるんですが、 確かに○○もかくやというくらいの数のメールを送ってきますね。 んで、必要最低限のものを除いては from のアドレスを使ってフィルタリングするようにしたんですが それでもやたらとスパムまがいのメールが inbox に入ってくるわけですよ。 おかしいなあと思いつつ調べてみると、 どうも from に使っているアドレスを数日に一個くらいの感じで増やしてるんですねこれが。 過去に使ったアドレスがそのまま使い続けられているかどうかは面倒なんで調べてないんですが、 いずれにしてもご苦労なこって。 もうあれですね、日○からのメールは基本弾くようにして (さすがにドメインまでは(まだ)いじってないですがさて…w)、 必要なものだけ通すようにした方がいいか。 いや、そもそも(ry

TNG パトレイバー 首都決戦。 まだまだ感想やら書く気はないけど、 小説と四月末に出てた新書を読んで疑問点は一部解消した(増えたのもあるけどw)。 押井守ぴあ (ぴあMOOK)
押井守ぴあ (ぴあMOOK) 友だちはいらない。(TV Bros.新書) (TOKYO NEWS MOOK 481号 テレビブロス新書 1)
友だちはいらない。(TV Bros.新書) (TOKYO NEWS MOOK 481号 テレビブロス新書 1) TOKYO WAR (2) 灰色の幽霊 THE NEXT GENERATION パトレイバー
TOKYO WAR (2) 灰色の幽霊 THE NEXT GENERATION パトレイバー

■_

■_

Embedded in Academia : この記事、コメント欄のやり取りがなかなか。

Embedded in Academia : UB Canaries

As a dyed-in-the-wool Luddite, my take on this is that the whole problem is that *compilers change* in the first place. Me, I’d buy a compiler *once* and use it *forever,* and that’d be that. I’d get used to it, and I’d know its quirks, and all would be well. It’s *upgrading all the time* that gets you involved in this sort of stuff. (David Jacobson | April 22, 2015 at 4:06 pm)

You have canaries for signed arithmetic overlfow. You need similar canaries for pointer arithmetic. Many people think that they can detect pointer wrapping with something like “if (p + offset < p) …", but compilers will often optimize that away. In GCC, if offset is signed, the compiler will optimize the conditional to false, even with -fwrapv. (regehr | April 22, 2015 at 4:24 pm)

David, definitely. Do you have a canary for me? (regehr | April 22, 2015 at 4:25 pm)

Chris, embedded system developers do this to some extent (depending on what kind of system it is). Alas, for mainstream program development it’s often impossible to stay with an old compiler for very long. (David Jacobson | April 22, 2015 at 4:44 pm)

Clarification: I meant to say that given the code “if (p + offset = 0, it will optimize the conditional to false. Sorry for omitting the other condition. (Michael Norrish | April 22, 2015 at 7:38 pm)

Minor typo: Cerberus, not Cerebus. (regehr | April 22, 2015 at 9:40 pm)

Thanks Michael, I always get that wrong. (bcs | April 23, 2015 at 10:43 am)

Regarding “random flags”, I agree the simple -O levels are the most valuable, but for any library that often gets built outside the control of the author, I think those random flags are a risk worth inspecting. (Particularly if the cost can be reduced to a few minutes of compute time and adding a line to a config file.) (Richard Kettlewell | April 23, 2015 at 3:11 pm)

memcpy-overlap depends partly on the C library of the platform you run it on. (regehr | April 23, 2015 at 4:39 pm)

本文の方にもあのお方の名前が

2015年05月03日

■_

選挙カーが使われはじめたのって、太平洋戦争後ですよね。たぶん。 いつぐらいから今みたいな感じになったんですかね。 わたしががきんちょの頃(昭和○○年代)にはそうだった記憶はあるな。 某政党の選挙カーに手を振ったらシールだかなんだかもらった覚えがかすかに

100分で読む名著5月は荘子だとか。 管子やらないかなw 『荘子』 2015年5月 (100分 de 名著)
『荘子』 2015年5月 (100分 de 名著) 管子 (中国の思想)
管子 (中国の思想)

■_

■_

ループの制御変数の名前で(安易に) i, j, k とか使うのやめよーぜ。 という話なんですが I, J, and K Should Die

I, J, and K Should Die

ijkOne of the hardest things we do as programmers is naming things. But the easiest thing to name is counter variables and most of us do it wrong several times a day.

Of course, I’m talking about the notorious habit of naming our counter variables I, J, or K depending on how far down we’ve nested our looping.

Here is what the code looked like:

for(i = 0;i < someValue;i++)
{
    // lots of code here
    for(j = 0;j < someOtherValue;j++)
    {
        // still more code here
        for(k = 0;k < yetAnotherValue;k++)
        {
            // and again, more code
            if(someConditionThatBarelyEverHappens)
            {
                for(i=0;i < 3;i++)
                {
                    // some correcting code here
                 }
             }
            // more code
         }
        // more code
    }
}
Copyright © 2015 DMB Consulting, LLC. All Rights Reserved.

そのプログラム例はどうかと。

■_

↑の References から。 Loop counter - Wikipedia, the free encyclopedia

Loop counter - Wikipedia, the free encyclopedia

A common identifier naming convention is for the loop counter to use the variable names i, j, and k (and so on if needed), where i would be the most outer loop, j the next inner loop, etc. The reverse order is also used by some programmers. This style is generally agreed to have originated from the early programming of FORTRAN[citation needed], where these variable names beginning with these letters were implicitly declared as having an integer type, and so were obvious choices for loop counters that were only temporarily required. The practice dates back further to mathematical notation where indices for sums and multiplications are often i, j, etc. A variant convention is the use of reduplicated letters for the index, ii, jj, and kk, as this allows easier searching and search-replacing than using a single letter.

■_

Code Aware Libraries with Roslyn Code Aware Libraries are “libraries that provide guidance on correct use through embedded tooling and operates on the user’s code in real time.”

Universal Programs and API Contracts Historically, creating universal or “run anywhere” applications meant restricting yourself to the lowest common denominator. New features can’t be used until all devices support it, which may be never depending on your customer base. In the Windows 10 vision, that isn’t going to be the case.

Deep Dive into Universal Applications

One cornerstone of Universal Applications is .NET Native.

2015年05月02日

■_

GW の連休の影響だろうと思うけど早売りでもないのに 月刊マガジンがもう売られていてちょっとびっくりした。 同じく6日発売(隔月刊だけど)の歴史群像は連休明けなんだよなー

TNG パトレイバー 首都決戦を観た。 色々書きたいことはあるけどしばらく寝かせる (自分には充分面白かった。食い足りない部分(とちょっとした疑問)はあったけど)。

にしても、なんだってこういう映画を観た直後の館内や通路で「論評」をかましている連中はああも (不愉快な)甲高い声なんだか。 白髪交じり。というよりは白い方が多い頭でさ。

■_

■_

To keep a Boeing Dreamliner flying, reboot once every 248 days 例によってコメント欄

To keep a Boeing Dreamliner flying, reboot once every 248 days

A bigger question is; how do we stop this kind of bug in the future. In my professional life I've encountered a very similar bug where an OS counter was monitored by the application, but the application didn't handle the 32-bit roll-over properly and crashed after a couple of hundred days. So this isn't unique by any means.

Its easy to say "stupid programmer forgot about the overflow case". But its not that simple. Maybe the programmer didn't think of the overflow, or maybe they did but got it subtly wrong. If you are going to rely on human beings to get it 100% right in a complex system you are going to be disappointed. Thats why we have rigorous testing on something like this. But a time-based overflow bug like this is actually quite hard to test; putting the thing on a rig for a few years to see if any overflow bugs happen is not feasible. You would have to have a specific test case that pokes 0xFFFFFF00 into the relevant counter to see what happens. Maybe we need to add those test cases to our lists.

Merely using a 64 bit Int may not be a solution if you are interfacing with the operating system, and the OS designer used 32 bits.

■_

Death to C | Hacker News Death To C | TechCrunch

2015年05月01日

■_

会社で。 「『たたき』を作ろう」、「『たたき』を作ろう」と繰り返し会話に出てくるのが聞こえてきたんですが 勤務時間中に(そこそこ大きな声で)何食い物の話をしとるのか…… と思ってたら実は 「叩き台」を略していたという。 その略に何か意味はあるのかと。ったく。

こいつのテーマ曲が気に入ったんだけど販売されないかなw NHKアニメワールド 英国一家、日本を食べる Sushi and Beyond

神奈川県で「よこすかカレーフェスティバル」開催! 幻の護衛艦カレーも登場 | マイナビニュース

■_

■_

こんなところでまたその名前を見かけるとは! > ゴルディロックス エントロピーとデザイン | ÉKRITS / エクリ

エントロピーとデザイン | ÉKRITS / エクリ

イギリスの有名な童話に「3びきのくま」というのがある。ゴルディロックスという女の子が森で一軒の家を見つける。 中に入ると誰もいないが、テーブルに3つのスープがある。1つめは熱すぎ、2つめは冷たすぎ、 3つめがちょうどよかったので、それを飲んでしまう。同じように椅子やベッドも3つずつあり、 そのうちの1つがちょうどよい。最後にクマの家族が帰ってきて、驚いた女の子は慌てて逃げ帰る。

この話が元になって、物事が多すぎず少なすぎずちょうどよい具合である範囲のことを、ゴルディロックスゾーン※2という。

なるほど。 ハビタブルゾーン - Wikipedia

ハビタブルゾーン - Wikipedia

ハビタブルゾーン(HZ:habitable zone)とは、宇宙の中で生命が誕生するのに適した環境と考えられている天文学上の領域。
ゴルディロックスゾーン(GZ:Goldilocks zone)とも呼ばれる。

一つ前へ 2015年4月(下旬)
一つ後へ 2015年5月(中旬)

ホームへ


リンクはご自由にどうぞ

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