ときどきの雑記帖 RE* (新南口)
Yellow warning blocks
warning
最近まで気がつかなかったのだけど、東京メトロのホームでの英語アナウンスで「warning」が使われている。 路線によって時期が違うのかわからないが、2018年にはそうなっていたらしい。
おっと2017年12月というものが
Please wait behind the yellow warning blocks ⚠️ pic.twitter.com/UffClMiwXZ
— Josh Keller (@jwk2240) December 19, 2017
これで、コンパイル時の「warning」をどう発音するか問題も解決(するか?) 😄
普段耳にしている範囲ではJR東では同様のアナウンスで「yellow line」を使っているのだけど これも「yellow warnig blocks」を使っていた(いる?)という話もあって、はて?
- 「白線(黄色い線)の内側」から「黄色いブロックの内側」というアナウンスに変わっている電車到着ホームのアナウンス(JR横浜駅は5月の連休明けから?): のりっきぃ・バー
- 1.2.8 英語放送スクリプト編: JR東日本・駅ホームの放送 - Learn English with FUN!
bash 5.1
リリースされたというので、使いはしないけれど NEWS を見ていたら気になる新機能が二つばかり。
d. There are new loadable builtins: mktemp, accept, mkfifo, csv, cut/lcut
具体的な動作はドキュメントを見るなりしないといけないのだろうけど、 名前から判断すると個別のユーティリティを起動しないでも テキストデータをいじれる拡張っぽい>csvとかcutとか
dd. New
U',
u’, and `L’ parameter transformations to convert to uppercase,
convert first character to uppercase, and convert to lowercase,
respectively.
でこっち。
'${PARAMETER@OPERATOR}'
The expansion is either a transformation of the value of PARAMETER
or information about PARAMETER itself, depending on the value of
OPERATOR. Each OPERATOR is a single letter:
'U'
The expansion is a string that is the value of PARAMETER with
lowercase alphabetic characters converted to uppercase.
'u'
The expansion is a string that is the value of PARAMETER with
the first character converted to uppercase, if it is
alphabetic.
'L'
The expansion is a string that is the value of PARAMETER with
uppercase alphabetic characters converted to lowercase.
'Q'
The expansion is a string that is the value of PARAMETER
quoted in a format that can be reused as input.
'E'
The expansion is a string that is the value of PARAMETER with
backslash escape sequences expanded as with the '$'...''
quoting mechanism.
'P'
The expansion is a string that is the result of expanding the
value of PARAMETER as if it were a prompt string (*note
Controlling the Prompt::).
'A'
The expansion is a string in the form of an assignment
statement or 'declare' command that, if evaluated, will
recreate PARAMETER with its attributes and value.
'K'
Produces a possibly-quoted version of the value of PARAMETER,
except that it prints the values of indexed and associative
arrays as a sequence of quoted key-value pairs (*note
Arrays::).
'a'
The expansion is a string consisting of flag values
representing PARAMETER's attributes.
Q 以降のものは以前かあったらしいけどそれはそれとして、 今回増えた大文字化と小文字化は
- ${parameter^pattern}
- ${parameter^^pattern}
- ${parameter,,pattern}
とどう使い分けるんだろう? (先頭のみ小文字化というのは増やさなかったようだ)
Bash: How to use operator parameter expansion ${parameter@operator}? - Stack Overflow
Hugo メモ
Amazon のアフィリエイトも twitter のような感じでお手軽に 画像入りで貼り付けられないかと思ったが、ひと手間いる模様。 Hugo | Yuuniworks Notes
amazon afi
- Hugoのブログ用にamazonのアフィリエイトリンクのShortcodesを作った | ITオムライス
- nyakapokoのブログ - HugoでAmazonのブログカード作成
- Hugoでわりと楽してわりとかっこよくAmazon商品紹介をする - ゆーすけべー日記
- hugo-amazon-jp向けのショートコード等を出力するブックマークレット作った - テストウフ
- GitHub - ikemo3/hugo-amazon-jp
- HugoでAmazonアフェリエイトとかのShortcodeを作った - bokunonikki.net
OGP (Open Graph Protocol)
- Hugo で静的なサイト・ブログを構築しよう - Qiita
- nyakapokoのブログ - Hugo(erblog)でサムネイル画像を指定する
- Hugo の OGP 画像を自動生成できる「tcardgen」を試した - kakakakakku blog
サイト内リンク
{{< ref “markdownfile.md” >}}
で(サイト内の)検索もしてリンクを作ってくれる。
cc65
6502 用のCコンパイラって引数や戻り値をどうやり取りしてんだろうか と以前から気になっていたのだけど、こんな感じだったらしい (別の手法を採用しているものもあるかもしれんけど)。
Parameter passing and calling conventions
Parameters are passed to functions on the parameter stack. In general, parameters are pushed from left to right, so the rightmost parameter is the last one pushed (and therefore, the one at the lowest position on the parameter stack). Provided that there are no local variables, the last parameter is at offset zero on the parameter stack. If the function returns a value, it comes back in A/X.
The compiler expects all return values to use X, even if they are declared as an 8-bit type. X should always contain the high byte of the return value as if it was promoted to a 16-bit integer.
- Parameter and return stacks ・ cc65/wiki Wiki
- cc65 internals
- cc65:parameter_passing_and_calling_conventions [cc65 Wiki]
- cc65 Users Guide: Extensions
- Parameter passing and calling conventions ・ cc65/wiki Wiki
forgive
null-forgive operator の訳語をどうすべきか問題(おおげさ)。
allowとforgiveの意味の違いは?翻訳によって神様の印象が変わる!?【聖書で英語】 - ENGLISH JOURNAL ONLINE
allowは「何かをすることを許可する」という意味ですが、forgiveは「受けるべき罰を免除する」という意味です。 日本語では同じ「ゆるす」という発音をするので混同しやすいのですが、英語でも、そして原典のギリシャ語でも、この2つはまったく違う言葉です。
IETR
parse.y の話 の続きを書くためにBisonのマニュアルを見ていたら見慣れない名前に遭遇した。
Bison - GNU Project - Free Software Foundation
Bison is a general-purpose parser generator that converts an annotated context-free grammar into a deterministic LR or generalized LR (GLR) parser employing LALR(1) parser tables. As an experimental feature, Bison can also generate IELR(1) or canonical LR(1) parser tables.
LR、GLR、LALRはわかる。がIELRって? と思いつつglossaryを見ると
IELR(1) (Inadequacy Elimination LR(1))
A minimal LR(1) parser table construction algorithm. That is, given any context-free grammar, IELR(1) generates parser tables with the full language-recognition power of canonical LR(1) but with nearly the same number of parser states as LALR(1). This reduction in parser states is often an order of magnitude. More importantly, because canonical LR(1)’s extra parser states may contain duplicate conflicts in the case of non-LR(1) grammars, the number of conflicts for IELR(1) is often an order of magnitude less as well. This can significantly reduce the complexity of developing a grammar. See section LR Table Construction.
とあった。 割と最近登場した(と言っても10年以上前)アルゴリズムだったらしい。
- IELR(1) | Proceedings of the 2008 ACM symposium on Applied computing
- (PDF) IELR(1): Practical LR(1) parser tables for non-LR(1) grammars with conflict resolution
- The IELR(1) algorithm for generating minimal LR(1) parser tables for non-LR(1) grammars with conflict resolution - ScienceDirect
- formal languages - What is an IELR(1)-parser? - Computer Science Stack Exchange
ひょっとしてWikipediaには載ってない? LR parser - Wikipedia