ときどきの雑記帖 RE* (新南口)
かくしごと
メモリー
PC(ってなんですか)用のWindows95 の最小メモリは4メガバイトで間違いなかったと思うけど、 98用はハードの制約だかなんだかで、 4メガバイトをちょっと切った大きさだったような記憶が。
そういえば初代Win95の最小要件ってたしかメモリ4メガだった気がします…
— sava (@lpproj) June 25, 2021
(自分は386sx-16MHzでメモリ5MのラップトップにWin95を入れたことがありますが…まともに動かすのは無理ゾ…OS/2 Warp V3のほうが「相対的に」軽快だった記憶…)
今週のしずえさん
中世ヨーロッパで化粧の下地に使われていた食品は? → ハチミツ
「近しい」
ITエンジニアの働き方を尊重し、技術的な成長を促進する開発組織に求められるものとは? ──ユーザベースの取り組みに見る - はてなニュース
アンケートの
最も近しい現在の職種を一つ選択してください
これで、申し訳ないけどそれまでの内容は(その説得力など含めて)全部ふっとんだ(笑)
まあこれも「定着」しそうだけどねえ。
- 近しい/親しい(ちかしい)の意味 - goo国語辞書
- 近しい(ちかしい)の類語・言い換え - 類語辞書 - goo辞書
- 『近しい』という言葉を『(距離が)近い、似ている』という意味で観測する機会が多い - 時が癒す
- どうしても気に障る言葉「近しい」 - 駄文だって
単位系
とある本を読んでいて知った(思い出した?)のだけど
しかし、マーズ・クライメイト・オービターは、航行上のミスにより、予定されていた火星の上空140-150 kmの軌道ではなく、 高度57kmの軌道に乗ってしまったために、探査機は、低高度での大気による抵抗と圧力により搭載機材が故障し、通信不可能になった。 調査委員会によるとこの原因は、地上局でのとある計算がポンド重・秒(ヤード・ポンド法)の単位で行われていたが、 それをニュートン・秒(メートル法)による単位を予期していた探査機の航行担当のチームに単位変換をせずに報告したためである。 探査機は、2つの単位システムの間を変換するようにはできていなかった。
ここだけ切り取ると「なんでヤード・ポンド法を使うの」という反応になりそうだけど、 それで片付けてはいけない「諸々」がある(あった)らしい。
Github Copilot
思うところはありますが例によって(今はまだ)様子を眺めて何も言わないでおくのです😄
僕達が失業するまであと少しです。(TABとENTERしか押してない) pic.twitter.com/YdPPWcjpuf
— mattn (@mattn_jp) July 1, 2021
- Built on Stolen Data
- Copilot regurgitating Quake code, including swear-y comments and license : programming
- Research recitation - GitHub Docs
- GitHub Copilot and License Restrictions : programming
- GitHub Copilot and License Restrictions | zephyrtronium
- GitHub Copilot Experiences - a glimpse of an AI-assisted future : programming
- GitHub Copilot Experiences - a glimpse of an AI-assisted future
- GitHub Copilot generates valid secrets [Twitter] : programming
GitHub Copilot、プログラマのやりたいこと・やりたくないことをベースに機能を考えると、「人間が実装コードを書いたらAIが名前とコメントを考えてくれる」の方が顧客が本当に必要だったもの感ある。なぜAIがおいしいところだけ取っていって人間が苦行を強いられなきゃいけないのか。
— athos)))))))) (@athos0220) July 1, 2021
ただのFYIですが、それも研究レベルでは結構やられているタスクで、 例えば From Programs to Deep Models – Part 1 https://t.co/qvVwhfbv0S という記事では Semantic Labeling of Code Snippets (Code -> Label) とCode Captioning (Code -> Text) に分類して紹介しています。
— Masahiro Sakai (@masahiro_sakai) July 2, 2021
新山さん
Github Copilotの話題を追いかけていたら見覚えのあるお名前を発見。
「GitHubが著作権のあるコードを許可なく機械学習の訓練に使用し、ユーザの知らないうちに生成されたコードに勝手に利用することに反対します。これにともない、私は今後GitHubの利用を中止します」
— 新山祐介 (Yusuke Shinyama) (@mootastic) July 4, 2021
Copilotは昔からの「AIの生成物は著作物なのか」問題を再燃させてしまった。https://t.co/lLFNSjrzk4
いつの間に。と思って確かめたらこのアカウントが作られたのつい最近(2021年3月)なんですね。
- 新山祐介 (Yusuke Shinyama)(@mootastic)さんがフォローしているアカウント / Twitter
- 新山祐介 (Yusuke Shinyama)(@mootastic)さんをフォローしているアカウント / Twitter
気がついた時点から結構なペースで(個人的な見解です)フォロワーが増えていっているような。 他では見かけないような海外情報(のリンク)が出てくるので 定期的に追いかけるかなあ。
glob zsh 1
以前にもちょっと書いた(はずだ)けど、 zshの場合globはこの関数が呼び出し口になっているようだ。
zsh/Src/glob.c
/* Main entry point to the globbing code for filename globbing. *
* np points to a node in the list which will be expanded *
* into a series of nodes. */
/**/
void
zglob(LinkList list, LinkNode np, int nountok)
{
/* The actual processing takes place here: matches go into *
* matchbuf. This is the only top-level call to scanner(). */
scanner(q, shortcircuit);
この関数を呼び出しているところを検索してみると、それほど多くはみつからない。
cond.c:50: zglob(args, firstnode(args), 0);
exec.c:3196: zglob(args, firstnode(args), 0);
glob.c:1182:zglob(LinkList list, LinkNode np, int nountok)
subst.c:481: * - PREFORK_NO_UNTOK: pass into zglob() a flag saying do not untokenise.
subst.c:501: zglob(list, node, (flags & PREFORK_NO_UNTOK) != 0);
それぞれがどういった状況でzglobを呼び出しているのかを調べるのはあとにして、 まずはこのzglobが置かれているファイルglob.cを見ていくことにする。
glob.c の先頭の方に
#include "zsh.mdh"
#include "glob.pro"
という部分がある。.pro
は以前.indent.pro
というファイルを紹介したことがあり
それは indentというコマンドに食わせるものだったけど
プリプロセッサ経由で取り込むようなものとは思えない。
そしてもうひとつの.mdh
ははてなんだろう?
ということでソースディレクトリを検索してが そもそもそんな拡張子を持ったファイルが見当たらない。
じゃあ。ビルド過程のどこかで生成されたものではないだろうか
(例えばyaccが生成する y.tab.h
のように)
と考えてmakefile(のテンプレート)をみる。
Makemod.in.in
.SUFFIXES: .c .$(DL_EXT) ..o .._foo_ .o ._foo_ .syms .pro .epro
.c$(ANSI@U@OBJ):
$(COMPILE) -o $@ $<
@rm -f $(dir_src)/stamp-modobjs
.c$(KNR@U@OBJ):
@ANSI2KNR@ $< > $@.c
$(COMPILE) -o $@ $@.c
rm -f $@.c
@rm -f $(dir_src)/stamp-modobjs
.c.$(ANSI@U@OBJ):
$(DLCOMPILE) -o $@ $<
.c.$(KNR@U@OBJ):
@ANSI2KNR@ $< > $@.c
$(DLCOMPILE) -o $@ $@.c
rm -f $@.c
.c.syms:
$(AWK) -f $(sdir_src)/makepro.awk $< $(subdir) > $@
.syms.epro:
(echo '/* Generated automatically */'; sed -n '/^E/{s/^E//;p;}' < $<) \
> $@
(echo '/* Generated automatically */'; sed -n '/^L/{s/^L//;p;}' < $<) \
> `echo $@ | sed 's/\.epro$$/.pro/'`
mkmakemod.sh
clean-here:
rm -f *.o.c *.syms *.pro *.epro *.mdh *.mdhi *.mdhs *.mdh.tmp
echo "\$(MODOBJS_${mddname}) \$(MODDOBJS_${mddname}): ${mddname}.mdh"
sed -e '/^ *: *<< *\\Make *$/,/^Make$/!d' \
-e 's/^ *: *<< *\\Make *$//; /^Make$/d' \
< $top_srcdir/$the_subdir/${mddname}.mdd
echo
どうやらその推測は外れていなかったようだ。
10月
【お知らせ】オライリー卓上カレンダーをご利用中の皆さまへ
— O'Reilly Japan (@oreilly_japan) July 1, 2021
東京オリンピック・パラリンピックの開催に伴い、7月、8月、10月のカレンダーに変更があります。今回、祝日の移動を反映したデータを制作いたしましたのでご利用ください。 pic.twitter.com/1aQ8i03iYo
7月と8月の祝日の移動にばっかり頭がいって忘れてたけど、 10月が祝日なしになるんですな>今年
gawk
5.1の話 を過去に書いているけれども、 gawk.git - gawk を改めて見てみると
- gawk-5.1.0 15 months
- gawk-5.0.1 2 years
- gawk-5.0.0 2 years
- gawk-4.2.1 3 years
- gawk-4.2.0 4 years
- gawk-4.1.4 5 years
- gawk-4.1.3 6 years
- gawk-4.1.2 6 years
5.1.0以降、一年以上リリースがない。さらに ChangeLog - gawk.git - gawk をみるとこんな感じ。
2020-04-14 Arnold D. Robbins
* 5.1.0: Release tar ball made.
2019-06-18 Arnold D. Robbins
* 5.0.1: Release tar ball made.
2019-04-12 Arnold D. Robbins
* configure.ac: Update version to 5.0.0.
* configure: Regenerated.
* ChangeLog.1: Rotated ChangeLog into this file.
* ChangeLog: Created anew for gawk 5.0.0 and on.
* README: Bump version to 5.0.0.
* 5.0.0: Release tar ball made.
コミットは結構頻繁にされているようなので なぜだろうと疑問に思いつつ NEWS - gawk.git - gawk をみると…
Changes from 5.1.x to 5.2.0
---------------------------
1. Numeric scalars now compare in the same way as C for the relational
operators. Comparison order for sorting has not changed. This only
makes a difference when comparing Infinity and NaN values with
regular numbers; it should not be noticeable most of the time.
2. If the AWK_HASH environment variable is set to "fnv1a" gawk will
use the FNV1-A hash function for associative arrays.
3. The CMake infrastructure has been removed. In the five years it was in
the tree, nobody used it, and it was not updated.
4. There is now a new function, mkbool(), that creates Boolean-typed
values. These values *are* numbers, but they are also tagged as
Boolean. This is mainly for use with data exchange to/from languages
or environments that support real Boolean values. See the manual
for details.
というのがあり、その後にも
Changes from 5.1.0 to 5.1.1
---------------------------
1. Infrastructure upgrades: Bison 3.7.1, Gettext 0.20.2, Automake 1.16.3.
2. asort and asorti now allow FUNCTAB and SYMTAB as the first argument if a
second destination array is supplied. Similarly, using either array as
the second argument is now a fatal error. Additionally, using either
array as the destination for split(), match(), etc. also causes a
fatal error.
3. The new -I/--trace option prints a trace of the byte codes as they
are executed.
4. A number of subtle bugs relating to MPFR mode that caused differences
between regular operation and MPFR mode have been fixed.
5. The API now handles MPFR/GMP values slightly differently, requiring
different memory management for those values. See the manual for the
details if you have an extension using those values. As a result,
the minor version was incremented.
6. $0 and the fields are now cleared before starting a BEGINFILE rule.
7. The duplication of m4 and build-aux directories between the main
directory and the extension directory has been removed. This
simplifies the distribution.
8. The test suite has been improved, making it easier to run the entire
suite with -M. Use `GAWK_TEST_ARGS=-M make check' to do so.
9. Profiling and pretty-printing output has been modified slightly so
that functions are presented in a reasonable order with respect
to the namespaces that contain them.
10. Several example programs in the manual have been updated to their
modern POSIX equivalents.
11. Handling of Infinity and NaN values has been improved.
12. There has been a general tightening up of the use of const and
of types.
13. The "no effect" lint warnings have been fixed up and now behave
more sanely.
14. There have been numerous minor code cleanups and bug fixes. See the
ChangeLog for details.
といった記述があった。
5.2.0はともかく、5.1.1をリリースしないのはなにか理由があるんだろうか? ひょっとしたら(一部のパッケージがそうであるように) ある時点でのバージョンのtar玉をつくることをしなくなったのでは? と思って configure - gawk.git - gawk をみると
# Identity of this package.
PACKAGE_NAME='GNU Awk'
PACKAGE_TARNAME='gawk'
PACKAGE_VERSION='5.1.60'
PACKAGE_STRING='GNU Awk 5.1.60'
PACKAGE_BUGREPORT='bug-gawk@gnu.org'
PACKAGE_URL='http://www.gnu.org/software/gawk/'
となっていたのでそれは(少なくとも現時点では)ないっぽい。 しかしバージョン番号が5.1.60って5.2へあげていく気満々ですな(たぶん)。
Day One Bug
あと、ChangeLogを見ていたら Day One Bug
というフレーズが目についた。
2021-01-28 Arnold D. Robbins
Fix a Day One Bug!
* main.c (main): For -b option, only set LC_ALL to C if
not --posix. Ooops.
どういう類のバグなのだろう(off-by-oneとかあるいはZero Dayみたいなものか?)とまずは差分をみてみると
--- a/main.c
+++ b/main.c
@@ -359,11 +359,12 @@ main(int argc, char **argv)
if (do_binary) {
if (do_posix)
warning(_("`--posix' overrides `--characters-as-bytes'"));
- else
+ else {
gawk_mb_cur_max = 1; /* hands off my data! */
#if defined(LC_ALL)
- setlocale(LC_ALL, "C");
+ setlocale(LC_ALL, "C");
#endif
+ }
}
if (do_lint && os_is_setuid())
…よくわからん。
差分だとわかりづらいけど、要は do_posix
のときに
setlocale(LC_ALL, "C");
を実行しないようにした。修正なのはわかった。
が、それのどの辺がDay One Bug なのだろう?
ということでDay One Bug
で検索してみると
こんなのが見つかった。
terminology - What does the term day-one-bug mean? - Software Engineering Stack Exchange
A day-one bug is a defect that is not a regression. The defect was there from day one when the feature was implemented. It is used to argue that a defect is low priority, because it has been shipped in previous releases without many complaints from customers.
A “day one” bug is simply a bug that has been around a long time (day one being the software’s creation date), as compared to a “regression”, or recently introduced bug. When analyzing a problem which has just been reported for the first time, it is general practice to focus on recent changes to the software as the most likely source of the problem. Some bugs however, lead a charmed life and lay dormant for years (or even decades) without being noticed. In my experience as a developer, day one bugs generally are masked by other software that repairs the damage or prevents the bug from being exercised; seemingly unrelated changes can remove one of these “compensating factors” which allow the original bug to finally manifest and be noticed. I found a bug in 2012 in code that I wrote in 1986 and which had processed billions if not trillions of transactions at hundreds of installations before its first crash. I spent several days convincing myself (by constructing elaborate tests) that the bug was truly day one.
The term “zero day” is totally unrelated to the much older “day one”.
なるほどん。
Ask the person who used the expression. It is not widely-enough used for a generally-agreed-upon definition to exist.
A “zero day exploit” is a security exploit that the developer of the software (or the security community in general) has known about for 0 days (i.e. not yet) so that there can’t be a fix. Extrapolating from that, a “one day exploit” would be one that has become publically known today, so if the developer and the users act fast, a few systems may already be patched.
But that extrapolation is not necessarily correct, the expression may not have anything to do with zero-day exploits. Brian’s answer actually sounds more likely. Which leads us back to my first paragraph.
OneTab のダークテーマ
OneTabにダークテーマないのだろうかと思い探してみたが(Firefox用には)ないっぽい。 作者にリクエストは出されているみたいだど。
- OneTab のダークテーマ - jBlog
- pullup/OneTab-Night-Mode: Little theme for the onetab page to make it less eye raping.
長時間(ってどのくらいですか)VDT作業したあとで 白背景の明るい画面を見るの辛いのよ最近。
Hugoメモ
最近はteenyが上がることはほとんどなくて、すぐ次のminorが上がるなあと思ってたら 0.84は色々あった模様。
- Release v0.84.1 · gohugoio/hugo
- Release v0.84.2 · gohugoio/hugo
- Release v0.84.3 · gohugoio/hugo
- Release v0.84.4 · gohugoio/hugo
- Release v0.85.0 · gohugoio/hugo
割とすぐに次のminor(0.85)になってしまった。 といった状況なので様子見を続けて まだ微妙に古いバージョンを使い続けているのだけど、 あるとき参照していたツイートが削除されたらしく サイトのビルドに失敗するようになってしまった (ビルドの失敗はバージョン云々とは無関係だけど)。
これはその部分の記述を削除するしかないか と思ったがエラーメッセージを見るとなにやら見慣れないものが (いつから入ったものかはわからないけど、ツイート削除によるビルドエラーは 過去にもあったはずなので割と最近?)
PS > $env:HUGO_ENV="" ; hugo --buildFuture server
Start building sites …
ERROR 2021/07/xx xx:xx:xx Failed to get JSON resource "https://api.twitter.com/1/statuses/oembed.json?id=xxxxxxxxxxxxxxxxxxx&dnt=false": Failed to retrieve remote file: Not Found
If you feel that this should not be logged as an ERROR, you can ignore it by adding this to your site config:
ignoreErrors = ["error-remote-getjson"]
Built in 5202 ms
Error: Error building site: logged 1 error(s)
ignoreErrors = ["error-remote-getjson"]
を config.toml に追加するとビルドの失敗はしなくなったけど 完全に握りつぶすというのもひっかかるな…
関係するissueはこの辺か。 Failures in getJSON crash the build instead of allowing the user to handle it. · Issue #7228 · gohugoio/hugo