ときどきの雑記帖 RE* (新南口)
東京ゴッドファーザーズ
今週のしずえさん
イタリアではサンタクロースのほかにもクリスマスの時期にプレゼントを配って回る人物がいる。
BS12
東京ゴッドファーザーズ | 日曜アニメ劇場 | 無料アニメ番組 | BS無料放送ならBS12(トゥエルビ)
わくわく。
Wolfram Cloud
ちょっと気になる。
Wolfram Cloud Basicを使うと,無料ですぐに始められます.
翻訳ネタ三題
pen test
メモメモ。
英語での略語について(IT分野の “pen test” は筆記用具の書き味とは関係ない) - Hoarding Examples (英語例文等集積所)
あなたはそこに~
Windows 11の「あなたはそこに~ %です」という奇妙な翻訳、とうとう修正される - やじうまの杜 - 窓の杜
「readになることはできませんでした」 (「“read” になることはできませんでした」のひみつ) の類かと思ったら違った模様。
by Xe
不幸なlog4j2騒動の余波で書かれたこの記事(「オープンソース」はXeによって壊れている)を読みました。
I read this article (“Open Source” is Broken by Xe) written in the aftermath of the unfortunate log4j2 fiasco.
“Open Source” is Broken - Xe のページ上部にあるタブっぽいリンクの並びの一番左のXe をみると筆者の名前でないですかね>Xe
だから「「オープンソース」はXeによって壊れている」 ではなく、 「Xeによる「オープンソース」は壊れている」 じゃないかと。
va
va_listってなんだ - Qiita を読んで、そういやx64だとva_list以外のva_なんちゃらも 面倒くさいことになってんのかなと gcc/stdarg.h at 16e2427f50c208dfe07d07f18009969502c25dc8 · gcc-mirror/gcc をみると
/* Define the standard macros for the user,
if this invocation was from the user program. */
#ifdef _STDARG_H
#define va_start(v,l) __builtin_va_start(v,l)
#define va_end(v) __builtin_va_end(v)
#define va_arg(v,l) __builtin_va_arg(v,l)
#if !defined(__STRICT_ANSI__) || __STDC_VERSION__ + 0 >= 199900L \
|| __cplusplus + 0 >= 201103L
#define va_copy(d,s) __builtin_va_copy(d,s)
#endif
#define __va_copy(d,s) __builtin_va_copy(d,s)
なるほど🤔
va_listも
/* Define va_list, if desired, from __gnuc_va_list. */
/* We deliberately do not define va_list when called from
stdio.h, because ANSI C says that stdio.h is not supposed to define
va_list. stdio.h needs to have access to that data type,
but must not use that name. It should use the name __gnuc_va_list,
which is safe because it is reserved for the implementation. */
#ifdef _BSD_VA_LIST
#undef _BSD_VA_LIST
#endif
#if defined(__svr4__) || (defined(_SCO_DS) && !defined(__VA_LIST))
/* SVR4.2 uses _VA_LIST for an internal alias for va_list,
so we must avoid testing it and setting it here.
SVR4 uses _VA_LIST as a flag in stdarg.h, but we should
have no conflict with that. */
#ifndef _VA_LIST_
#define _VA_LIST_
#ifdef __i860__
#ifndef _VA_LIST
#define _VA_LIST va_list
#endif
#endif /* __i860__ */
typedef __gnuc_va_list va_list;
#ifdef _SCO_DS
#define __VA_LIST
#endif
#endif /* _VA_LIST_ */
#else /* not __svr4__ || _SCO_DS */
(gccに関しては)gccのソースを追いかければ もう少し詳しいことがわかりそうだけど、さて。
- 可変引数とx86とx64 - プログラマのつれづれなるままに
- stdarg.hにあった#defineva_start(v,l)__buil… - Yahoo!知恵袋
- 自作 OS で可変長引数実装 (for x86-64)
- c - Implementation of __builtin_va_start(v,l) - Stack Overflow
- gcc - ‘__gnuc_va_list’ has not been declared - Stack Overflow
- c - How is “__builtin_va_list” implemented? - Stack Overflow
- gcc/builtins.def at 16e2427f50c208dfe07d07f18009969502c25dc8 · gcc-mirror/gcc
- gcc/builtins.c at 16e2427f50c208dfe07d07f18009969502c25dc8 · gcc-mirror/gcc
- gcc/builtin-types.def at 16e2427f50c208dfe07d07f18009969502c25dc8 · gcc-mirror/gcc
- gcc/builtin-attrs.def at 16e2427f50c208dfe07d07f18009969502c25dc8 · gcc-mirror/gcc
- gcc/brig-builtins.def at 16e2427f50c208dfe07d07f18009969502c25dc8 · gcc-mirror/gcc
Commands Requiring a newline (GNU sed)
sed の ブロック {} 内で i, r, e コマンドを使うと “unmatched `{‘” とエラーになる | Aqua Ware つぶやきブログ
を読んで以前GNU sedのrコマンドでひっかかった件
を思い出した。言われてみればファイル名に使えるか>;
そして 3.8.1 Commands Requiring a newline - sed, a stream editor を見ればきちんと書いてあったという。
The following commands cannot be separated by a semicolon and require a newline:
r,R,w,W (reading and writing files)
The r,R,w,W commands parse the filename until end of the line. If whitespace, comments or semicolons are found, they will be included in the filename, leading to unexpected results:
$ seq 2 | sed '1w hello.txt ; 2d' 1 2 $ ls -log total 4 -rw-rw-r-- 1 2 Jan 23 23:03 hello.txt ; 2d $ cat 'hello.txt ; 2d' 1
m17n
shellを制作する際の留意点 - Qiita のコメントに
bashにおいて、 $"…" は多言語化の機能です。空文字を翻訳した結果の空文字が表示されています。参考 https://www.unixuser.org/~ysjj/bash_script_i18n.html
とあったのが気になったのでマニュアルをみると確かにこういうセクションがあった。
3.1.2.5 Locale-Specific Translation
A double-quoted string preceded by a dollar sign (‘$’) will cause the string to be translated according to the current locale. The gettext infrastructure performs the message catalog lookup and translation, using the LC_MESSAGES and TEXTDOMAIN shell variables, as explained below. See the gettext documentation for additional details. If the current locale is C or POSIX, or if there are no translations available, the dollar sign is ignored. If the string is translated and replaced, the replacement is double-quoted.
Some systems use the message catalog selected by the LC_MESSAGES shell variable. Others create the name of the message catalog from the value of the TEXTDOMAIN shell variable, possibly adding a suffix of ‘.mo’. If you use the TEXTDOMAIN variable, you may need to set the TEXTDOMAINDIR variable to the location of the message catalog files. Still others use both variables in this fashion: TEXTDOMAINDIR/LC_MESSAGES/LC_MESSAGES/TEXTDOMAIN.mo.
Hugo メモ
手元のバージョンを0.90.1にあげたらすぐに0.91.0が出てしまった。 すぐに上げた方が良いかちょっと調べる (とはいえ、ternaryが0のものはちょっと様子見するのがいつものことなんだけどね)。
Release v0.91.0 · gohugoio/hugo
Hugo 0.91.0 is mostly on the boring and technical side. See the list of changes below, but especially note the fix that allows passing falsy arguments to partials with the return keyword (5758c37 #7528), thanks to @ptgott.
Notes
This release contains some changes that may break your build:
などという気になるような記述があったが
0.90.0
{{ $font := resources.Get "https://github.com/google/fonts/raw/main/apache/roboto/static/Roboto-Black.ttf" }}
{{ $img := resources.Get "https://gohugo.io/images/gohugoio-card-1.png" }}
{{ $img = $img | images.Filter (images.Text
"Rocks!"
(dict
"color" "#E6B405"
"size" 100
"lineSpacing" 8
"x" 400 "y" 320
"font" $font))
}}
<img src="{{ $img.RelPermalink }}" />
0.91.0
{{ $font := resources.GetRemote "https://github.com/google/fonts/raw/main/apache/roboto/static/Roboto-Black.ttf" }}
{{ $img := resources.GetRemote "https://gohugo.io/images/gohugoio-card-1.png" }}
{{ $img = $img | images.Filter (images.Text
"Rocks!!!"
(dict
"color" "#E6B405"
"size" 100
"lineSpacing" 8
"x" 400 "y" 320
"font" $font))
}}
(今のところは)使っていない機能なので個人的には影響なし?
New Security Configuration
の方も目を通しておく。 本筋からは外れるけど、Hugoでorgフォーマットも使えたのか(外部のヘルパープログラムが必要)。
- Hugo’s Security Model | Hugo
- Content Formats | Hugo
- niklasfasching/go-org: Org mode parser with html & pretty printed org rendering. also shitty static site generator.