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

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

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

ホームへ

2016年03月31日

■_

某社は会計年度の切り替わりが1/1なんだけど、それでも四半期の切れ目ということであれこれと。

MX で毎週火曜日に無印(ファースト)からいくつかのエピソードを選んで放送していたのが今週最終回。 そして放送されたエピソードも最終話の「脱出」。 どうしても「めぐりあい宇宙」と比べてしまうけど、例の 「護衛機をまわせ! ザクでいいザクで!」 はTV版の方にしかないのだよねえ。

■_

2016年03月30日

■_

■_

2016年03月29日

■_

川俣さんの typescript 本が図書館にあったので借りて読み始めたんだけど 前からこういうの書く人だったっけ? なんというか、ENIX移植プログラマー戦記と大差ないような。 もちろん? 個々の文章はあそこまでひどくはないのだけど 全体として受ける印象というか雰囲気というか。

■_

2016年03月28日

■_

書評: Site Reliability Engineering · re-imagine SLA違反など、重大な障害では”Postmortem(過激だが死体解剖の意)“を作成し、 カタカナ書きで「ポストモーテム」ってそれなりに使われてないかなあ。

船の科学館でなんだかやってるという話を聞き、あそこ閉館したろうと思いつつうぃきぺをみると 船の科学館 - Wikipedia 2011年10月1日以降も南極観測船「宗谷」と屋外展示物の公開、体験教室プールでの各種イベント開催を継続している。また、2012年1月2日からは新設されたMINI展示場にて本館収蔵資料の展示公開を開始した[4]。 なんですと。

■_

■_

なかなか楽しい。 JuanitoFatas/what-do-you-call-this-in-ruby: Solving the second hard problem in Computer Science. いくつかあげてみる

JuanitoFatas/what-do-you-call-this-in-ruby: Solving the second hard problem in Computer Science.
== unassembled hashtag 
=~ eek squeak 
=~ cigarette operator 
=~ bacon cannon 
~> optimistic 
~> twiddlewalka 
~> pessimisive match 
~> harpoon 
~> tadpole 
# octothorpe 
||= pipe bomb 
||= top hat operator 
||= birthday cake operator 
||= hammer 
||= t-square 
||= duck operator 
<%= skull tag 
() wax/wane 
() southern hemisphere 
#{} crab claws 
&:foo salted pretzel operator 
<< shovel 
<< back shovel 
<< chevron 
<< exxon 
<< gazinta 
<< inhales 
>> forward shovel 
_ don't care 
_ whatever 
_ meh 
_ skid 
_ skim 
!!! temporarily reverse the value of this bool to try something out, but it should stand out enough that I don't accidentally leave it in. 
" rabbit ears 
&:-@ surprise 
trailing comma the Livingston-Gray comma 
... here be dragons 

あんま削れなかったw

2016年03月27日

■_

コンピュテーショナル・シンキング
コンピュテーショナル・シンキング 誰にでも。というわけではないけどオススメ (ってまあ「誰にでも」なんてないよねえ)。

なんだこの本(気になる)

■_

2016年03月26日

■_

葬送のリミット(1) (アフタヌーンコミックス)
葬送のリミット(1) (アフタヌーンコミックス) 買った。 アフタヌーンでの連載最初の方を不覚にも逃していたのだった。 kindle 版も同時発売で 葬送のリミット(1) (アフタヌーンKC)
葬送のリミット(1) (アフタヌーンKC) 二巻は来月。 葬送のリミット (2): アフタヌーン
葬送のリミット (2): アフタヌーン

うぃきぺでこんなの発見。 Subroutine - Wikipedia, the free encyclopedia 呼び出し規約の話もあって、

  Call by value
  Argument is evaluated and copy of value is passed to subroutine
    

Default in most Algol-like languages after Algol 60, such as Pascal, Delphi, Simula, CPL, PL/M, Modula, Oberon, Ada, and many others. C, C++, Java (References to objects and arrays are also passed by value)

いちいちというかきちんというか言及してるのが >カッコの中

結構なボリュームだけどなかなか面白かった。 内容にどのくらい賛成(or 反対)なのかはナイショ。 Let’s be mainstream! User focused design in Elm /p>

■_

■_

これ、「文字化け」なんだろか。 同じページにある SJIS の方の結果なら間違いなくそうだと思うけど。 【 Python 】日本語文字 を 含む 辞書(dict)型オブジェクト を json.dump してファイル出力するときは、文字化け防ぐために、必ず ensure_ascii=False オプション指定 を付ける - Qiita

    MacBook の 場合、UTF-8 でないので、文字化けする
    $ nkf -g nation_capital_city.json
    ASCII
    $head nation_capital_city.json
    {
      "\u30d5\u30e9\u30f3\u30b9": "\u30d1\u30ea\u5e02",
      "\u65e5\u672c": "\u6771\u4eac\u90fd"
    }$
  

2016年03月25日

■_

米シャトル事故を事前に警告、元技術者が死去 : 科学・IT : 読売新聞(YOMIURI ONLINE)米スペースシャトル「チャレンジャー」の1986年1月の爆発事故で、 事前に異常を警告していた元技術者ボブ・エベリング氏が21日、米ユタ州で死去したと、 米公共ラジオ(NPR)などが報じた。 この名前に見覚えがあるなあと思ってブラウザの最近の履歴を確かめた。 あったあったこの記事だ。 Your Letters Helped Challenger Shuttle Engineer Shed 30 Years Of Guilt : The Two-Way : NPR そうかあ亡くなられたのか。

プリンシプル オブ プログラミング 3年目までに身につけたい一生役立つ101の原理原則
プリンシプル オブ プログラミング 3年目までに身につけたい一生役立つ101の原理原則 買ってみた。

■_

■_

2016年03月24日

■_

この本ちょっと(とっても?)気になってる 数学における証明と真理 ―様相論理と数学基礎論― / 菊池 誠 編 佐野 勝彦 倉橋 太志 薄葉 季路 黒川 英徳 菊池 誠 著 | 共立出版

■_

getopt の仕様について。

http://pubs.opengroup.org/onlinepubs/009695399/functions/getopt.html
RETURN VALUE
  

The getopt() function shall return the next option character specified on the command line. A colon ( ':' ) shall be returned if getopt() detects a missing argument and the first character of optstring was a colon ( ':' ). A question mark ( '?' ) shall be returned if getopt() encounters an option character not in optstring or detects a missing argument and the first character of optstring was not a colon ( ':' ). Otherwise, getopt() shall return -1 when all command line options are parsed.

Utility Conventions
  

The following guidelines are established for the naming of utilities and for the specification of options, option-arguments, and operands. The getopt() function in the System Interfaces volume of IEEE Std 1003.1-2001 assists utilities in handling options and operands that conform to these guidelines.

(略)

Guideline 7:
    Option-arguments should not be optional.

GNU getopt の仕様はこの項目にはしたがってない(動作もできる)。 と。

2016年03月23日

■_

transpiler つづき。 ソースコード (gitorious.org Git - ratfor-revived:c-ratfor.git/tree - src/) や、 http://striky.ece.jhu.edu/~sasha/SOFTWARE/FORTRAN90/ratfor.pdf をみるに、

Bad Things

The biggest single problem is that many
Fortran syntax errors are not detected by Ratfor
but by the local Fortran compiler. The compiler
then prints a message in terms of the generated
Fortran, and in a few cases this may be difficult to
relate back to the offending Ratfor line, especially
if the implementation conceals the generated Fortran.
This problem could be dealt with by tagging
each generated line with some indication of the
source line that created it, but this is inherently
implementation-dependent, so no action has yet
been taken. Error message interpretation is actually
not so arduous as might be thought. Since
Ratfor generates no variables, only a simple pattern
of IF’s and GOTO’s, data-related errors like
missing DIMENSION statements are easy to find in
the Fortran. Furthermore, there has been a steady
improvement in Ratfor’s ability to catch trivial
syntactic errors like unbalanced parentheses and
quotes.
  

とあるので、「ratfor レベルでの構文解析」はしていない。っぽい。 であればこれは昨今の「transpiler」とは違っているはずで、 ratfor がそこに含まれない理由として考えられるものだと思う。 高水準言語→(それよりちょっと能力の低い)高水準言語の変換という点を 重視するかどうかというところだけど、 transpiler が「ratforと同じ」は言い過ぎな気がするなあ。 p2c (Pascal to C) はやってたよね構文解析(たぶん)。

んでまあなんとか最後まで読みました。 話がすぐ本筋から離れるとかケアレスミスが多いとかもありましたがあれだ、 やたらと「しかし」で接続する(しかもそれが適切とは思えないケースも少なくない)パターンが 使われるのには閉口した(よみづれー)。

■_

■_

FreeBSD の sed と GNU sed のそれぞれの -i オプションの違いについて。

On-line Manual of "sed"

名称
     sed - ストリームエディタ

書式
     sed [-Ealn] command [file ...]
     sed [-Ealn] [-e command] [-f command_file] [-i extension] [file ...]

(略)

     -i extension
             ファイルをその場で編集し、指定した extension のバックアップを保存
             します。長さ 0 の extension が指定された場合、バックアップは保存
             されません。その場で編集するときに、長さ 0 の extension を指定す
             ることは勧められません。ディスク空間が尽きてしまったときなどに、
             ファイルが壊れたり内容が一部だけになってしまうことがあるからで
             す。

↑は -i のあとの extension を省略できないけど

sed, a stream editor
 
sed may be invoked with the following command-line options: 

(略)
-e script 
--expression=script 
 Add the commands in script to the set of commands to be run while processing the input. 
-f script-file 
--file=script-file 
 Add the commands contained in the file script-file to the set of commands to be run while processing the input. 
-i[SUFFIX] 
--in-place[=SUFFIX] 

こっちは省略できますよ。と(suffix を与えない場合、バックアップファイルを作成しない)。

■_

むきりょくー

2016年03月22日

■_

transpiler ってものがあります。 わたしが目にするようになったのは去年くらいからだと思いますが もうちっと以前からあった模様。 それがどういったものかというと、 最近よくある JavaScript へ「コンパイル」するようなあれ(たぶん)。 Compiling Vs Transpiling - Steve Fenton

Compiling Vs Transpiling - Steve Fenton

Despite the fact that the term “transpiling” has been around since last century, there appears to be a fair bit of confusion about what it means and what the difference between transpiling and compiling is.

Firstly, transpiling is a specific kind of compiling. This helps a great deal as we now know we are talking about the same kind of thing. It is actually a specific kind of compiling. So how do we define it compared to the more general term?

Compiling is the general term for taking source code written in one language and transforming into another.

Transpiling is a specific term for taking source code written in one language and transforming into another language that has a similar level of abstraction.

うぃきぺには、transpile や transpiler という項目はなかったけど Source-to-source compiler - Wikipedia, the free encyclopedia に、

Source-to-source compiler - Wikipedia, the free encyclopedia

A source-to-source compiler, transcompiler or transpiler is a type of compiler that takes the source code of a program written in one programming language as its input and produces the equivalent source code in another programming language. A source-to-source compiler translates between programming languages that operate at approximately the same level of abstraction, while a traditional compiler translates from a higher level programming language to a lower level programming language. For example, a source-to-source compiler may perform a translation of a program from Pascal to C. An automatic parallelizing compiler will frequently take in a high level language program as an input and then transform the code and annotate it with parallel code annotations (e.g., OpenMP) or language constructs (e.g. Fortran's forall statements).[1]

Another purpose of source-to-source-compiling is translating legacy code to use the next version of the underlying programming language or an API that breaks backward compatibility. It will perform automatic code refactoring which is useful when the programs to refactor are outside the control of the original implementer (for example, converting programs from Python 2 to Python 3, or converting programs from an old API to the new API) or when the size of the program makes it impractical or time consuming to refactor it by hand.

こんな記述が。

その transpiler がどーしたって話ですが、 例の川俣さんの電書に「トランスコーダー」って記述で transpiler に言及してるところがあったんですが トランスコーダー - Google 検索 transpiler と同じ意味で使ってる例はなさそうだよなあ…… どこからでた? >「トランスコーダー」

あと、transpiler を指して 「RATFOR と同じじゃないかあんなもん」的なことも書いてあったんですが 先のうぃきぺ含め、RATFOR を transpiler に入れてる例はなさげ? それは意図して外してるのか、古くてマイナーなものだから抜け落ちたのか。 実際の例として初期のC++ (C のコードに変換する) が入ってるしなあ。 同じとみなしていいような気も違うものだろうという気もする (玉虫色)。

■_

■_

担保。

2016年03月21日

■_

フィルターバブル──インターネットが隠していること (ハヤカワ文庫NF)
フィルターバブル──インターネットが隠していること (ハヤカワ文庫NF) 原題に沿うタイトルになって文庫になってた。 文庫になる前のはこれ 閉じこもるインターネット――グーグル・パーソナライズ・民主主義
閉じこもるインターネット――グーグル・パーソナライズ・民主主義

軍事とIT (130) 軍事作戦と通信(4)国立暗号博物館訪問記 | マイナビニュース それどころか、日本海軍が開発して外務省で使っていた「九七式欧文印字機」の現物がある。確かこれは、ベルリン陥落の時に日本大使館の敷地に埋められたものを掘り出したという一品だ。 なにそれ見たい。

■_

■_

会社でとあるExcel上にまとめられているデータをちまちまいじくっておりましたら 日付データがある列の一部でどうも結果がおかしい。 調べてみると、2016.2.1 のように年月日の区切りが / ではなく . になっているものが 紛れ込んでいた。 ええい、なんでこんなものがと思いつつ調べてみると

  日付 - Wikipedia
  

日本では、日本工業規格のJIS X 0301「情報交換のためのデータ要素及び交換形式 ― 日付及び時刻の表記」[8] という規格がある。内容は、元号による年表現も可能となっている点を除いてISO 8601と全く同じである。

「明」「大」「昭」「平」または「 M 」「 T 」「 S 」「 H 」を必要に応じて年2桁の前に付け、 区切りは「ハイフン( - )」ではなく「終止符( . )」を用いることが認められている。

なんだってー>JISのお墨付き


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

ホームへ


リンクはご自由にどうぞ

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