ときどきの雑記帖 RE* (新南口)
Bye-Bye Jupiter
見出し
【DeNA】牧秀悟が通算300打点 球団最速、球界では01年高橋由伸以来23年ぶり10人目 - プロ野球 : 日刊スポーツ
通算300打点はいいとして、なにが10人目なの? と思って本文を読むと
プロ4年目での(通算300打点の)到達は球団最速で、球界でも01年高橋由伸以来23年ぶり10人目。 長嶋茂雄、清原和博らに並ぶスピード記録となった。
プロ4年目で通算300打点達成が。ということか。 あの見出しからわかるかそんなの😓
訳
Blueskyで(たぶん)自動投稿されている Hacker Newsのスレッドを日本語で紹介する投稿の 翻訳がちょっと面白い
- Hacker News JP 🤖: “Crafting Interpreters 通訳を育てる 🔺 250 💬 17 🔗 HN Post | Article” — Bluesky
- Hacker News JP 🤖: “After initially rejecting it, Apple has approved the first PC emulator for iOS 当初は却下されていたアップルが、iOS向け初のPCエミュレーターを承認 🔺 220 💬 23 🔗 HN Post | Article” — Bluesky
- Hacker News JP 🤖: “How to Know When It’s Time to Go 出陣の時期の見極め方 🔺 246 💬 24 🔗 HN Post | Article” — Bluesky
- Hacker News JP 🤖: “Writing a BIOS bootloader for 64-bit mode from scratch 64ビットモード用BIOSブートローダをゼロから書く 🔺 240 💬 9 🔗 HN Post | Article” — Bluesky
bsdtar
会社でzipファイルを(定期的に)作らないといけないという事情が発生して、 エクスプローラーからぽちぽちやるのも面倒だし なんかしらのツールを持ち込むのも色々面倒くさい。 どうにかできんのかと試しに Bing copilotに訊いてみたら 「tarを使え」と返事がかえってきた
まーた適当こいてこの「えーあい」はと思いつつ 試したら本当にそれでよかった😓
C:\Users\kbk>tar --version
bsdtar 3.5.2 - libarchive 3.5.2 zlib/1.2.5.f-ipp
C:\Users\kbk>tar --help
tar(bsdtar): manipulate archive files
First option must be a mode specifier:
-c Create -r Add/Replace -t List -u Update -x Extract
Common Options:
-b # Use # 512-byte records per I/O block
-f <filename> Location of archive (default \\.\tape0)
-v Verbose
-w Interactive
Create: tar -c [options] [<file> | <dir> | @<archive> | -C <dir> ]
<file>, <dir> add these items to archive
-z, -j, -J, --lzma Compress archive with gzip/bzip2/xz/lzma
--format {ustar|pax|cpio|shar} Select archive format
--exclude <pattern> Skip files that match pattern
-C <dir> Change to <dir> before processing remaining files
@<archive> Add entries from <archive> to output
List: tar -t [options] [<patterns>]
<patterns> If specified, list only entries that match
Extract: tar -x [options] [<patterns>]
<patterns> If specified, extract only entries that match
-k Keep (don't overwrite) existing files
-m Don't restore modification times
-O Write entries to stdout, don't restore to disk
-p Restore permissions (including ACLs, owner, file flags)
bsdtar 3.5.2 - libarchive 3.5.2 zlib/1.2.5.f-ipp
このヘルプの内容だとできるように見えないけど、
-a
オプションを指定してさらにアーカイブファイルの拡張子を.zip
にすると…
あとこういうのも標準で入っているらしい
C:\Users\kbk>curl --version
curl 8.7.1 (Windows) libcurl/8.7.1 Schannel zlib/1.3 WinIDN
Release-Date: 2024-03-27
Protocols: dict file ftp ftps http https imap imaps ipfs ipns mqtt pop3 pop3s smb smbs smtp smtps telnet tftp
Features: alt-svc AsynchDNS HSTS HTTPS-proxy IDN IPv6 Kerberos Largefile libz NTLM SPNEGO SSL SSPI threadsafe Unicode UnixSockets
strawberryperl
Windows IIS + Perl 2024 #Cgi - Qiita
IISとかまだあったんかと思いつつ本文を読んでみたら
標準ではperlが入っていないので、Strawberry Perlを使う。ただし、最新版を入れると Locale ‘Japanese_Japan.932’ is unsupported, and may crash the interpreter.と言われてしまう。
strawberry-perl-5.28.2.1-64bit.msiをインストールするとよいようだ。 参考(X:自作とゲームと趣味の日々)
などとあり
Strawberry Perlで『Locale 'Japanese_Japan.932' is unsupported』のエラーが出るの、Strawberry Perl自体のバージョンが原因だった。
— 自作とゲームと趣味の日々 (@jisakuhibi) November 23, 2023
5.38で発生、5.28まで戻ると発生せず。(5.36も発生?)https://t.co/xVWMwtwTnM
おいおいと思いながら 「警告」メッセージ(Locale ‘Japanese_Japan.932’ is unsupported, and may crash the interpreter) でググると
みんな(?)同様の「対策」をしているようだ。
- Locale ‘Chinese (Simplified)_China.936’ is unsupported, and may crash the interpreter. ・ Issue #145 ・ StrawberryPerl/Perl-Dist-Strawberry
- Locale ‘Korean_Korea.949’ is unsupported, and may crash the interpreter. with perl 5.38.0.1 ・ Issue #119 ・ StrawberryPerl/Perl-Dist-Strawberry
同じ原因(のはず)で発生している中国語版や韓国語版のユーザーは ちゃんとレポートしているのにねえ…
んで
#include <stdio.h>
#include <locale.h>
int
main(int argc)
{
if (argc>1) {
setlocale(LC_ALL, "");
}
printf("%s\n", setlocale(LC_ALL, NULL));
return 0;
}
>gcc showlocale.c
>a
C
>a a
Japanese_Japan.932
Japanese_Japan.932 (やChinese (Simplified)_China.936、Korean_Korea.949)の 発生源はこれだよね。 Windowsに移植するならこの辺の手当てをしないといけないはずなんだけど やってないのかな。 そもそも5.38でどう変わったんだ
新刊近刊
いけがみさん
以前書いたように数学セミナーは少し前に毎月買うのをやめてしまったのだけど、 今月号は久しぶりに買った。
4月号から一年間、「集合論の雑学--無限についてのおはなし--」というタイトルで連載を担当することになりました。興味のある方、ぜひ手に取ってみてください。 https://t.co/IUo4ekGesQ
— Ikegami Daisuke (@DaiskeIkegami) March 15, 2024
そう言えばいけがみさんどうされたんだろうか。
「いけがみだいすけ」と名前は全く同じだけど
字が違っていたような気がするし、
Twitterのアカウント名には_
があったような覚えがあるので
この投稿の人ではない。はず。
n月刊ラムダノート
というわけで、「n月刊ラムダノート」の新刊です。今回は、ぜんぜんシンプルじゃないSMTPと、ぜんぜんシンプルじゃない機械学習パイプラインと、意外とシンプルな深層学習の計算グラフの話が揃いました! https://t.co/ZkTGy7hbqM
— 専門性・売上・原稿 (@golden_lucky) July 16, 2024
というわけで、「n月刊ラムダノート」の新刊です。今回は、ぜんぜんシンプルじゃないSMTPと、ぜんぜんシンプルじゃない機械学習パイプラインと、意外とシンプルな深層学習の計算グラフの話が揃いました! https://t.co/ZkTGy7hbqM
— 専門性・売上・原稿 (@golden_lucky) July 16, 2024awk
gawk
例の、printfのreworkは何をやろうとしているのか パッチだけを見てもよくわからないので ブランチの最初の方で何か書いてないか探してみると
diff --git a/ChangeLog b/ChangeLog
index 6847f98..9108e64 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,20 @@
2024-07-02 Arnold D. Robbins <arnold@skeeve.com>
+ * awk.h (format_tree_new, format_tree_old): Add declarations.
+ (format_tree): Temporarily make into a function.
+ * main.c (format_tree): Declare it.
+ (main): Check PRINTF_NEW environment variable and if so,
+ use the new version. Otherwise use the old one.
+ * printf.c (struct flags): Declare.
+ (format_tree_old): The original version.
+ (format_tree_new): The new one, being refactored.
+ (add_thousands): Use the global `loc' variable, not a parameter.
+ static const char *format_integer(NODE *arg, struct flags *flags);
+ (format_mpg_integer, format_float, format_out_of_range,
+ compute_zero_flag): New functions.
+
+2024-07-02 Arnold D. Robbins <arnold@skeeve.com>
+
* re.c (make_regexp): \u escapes also now treated literally
for do_traditional.
diff --git a/main.c b/main.c
index 4ef0208..f71d358 100644
--- a/main.c
+++ b/main.c
@@ -161,6 +161,8 @@ GETGROUPS_T *groupset; /* current group set */
int ngroups; /* size of said set */
#endif
+NODE *(*format_tree)(const char *, size_t, NODE **, long);
+
void (*lintfunc)(const char *mesg, ...) = r_warning;
/* Sorted by long option name! */
@@ -218,6 +220,11 @@ main(int argc, char **argv)
const char *initial_locale;
#endif
+ if (getenv("PRINTF_NEW") != NULL)
+ format_tree = format_tree_new;
+ else
+ format_tree = format_tree_old;
+
myname = gawk_name(argv[0]);
check_pma_security(persist_file);
というのがあった。 目的はやっぱりわからんけど どうやろうとしているのかは少し明確になったかな。 んで、
Bugs in printf/sprintf formatted output によると、gawkのprintfには以下のような問題がある(あった)らしい
-
extraneous leading 0 produced for the alternative form with the o conversion, e.g. { printf “%#.2o”, 1 } produces “001” rather than “01”,
-
unexpected 0 produced where no characters are expected for the input of 0 and the alternative form with the precision of 0 and the integer hexadecimal conversions, e.g. { printf “%#.x”, 0 } produces “0” rather than “”,
-
missing + character in the non-bignum mode only for the input of 0 with the + flag, precision of 0 and the signed integer conversions, e.g. { printf “%+.i”, 0 } produces "" rather than “+”,
-
missing space character in the non-bignum mode only for the input of 0 with the space flag, precision of 0 and the signed integer conversions, e.g. { printf “% .i”, 0 } produces "" rather than " “,
-
for released gawk versions of up to 4.2.1 missing - character for the input of -NaN with the floating-point conversions, e.g. { printf “%e”, “-nan” }’ produces “nan” rather than “-nan”,
-
for released gawk versions from 5.0.0 onwards + character output for the input of -NaN with the floating-point conversions, e.g. { printf “%e”, “-nan” }’ produces “+nan” rather than “-nan”,
-
for released gawk versions from 5.0.0 onwards + character output for the input of Inf or NaN in the absence of the + or space flags with the floating-point conversions, e.g. { printf “%e”, “inf” }’ produces “+inf” rather than “inf”,
-
for released gawk versions of up to 4.2.1 missing + character for the input of Inf or NaN with the + flag and the floating-point conversions, e.g. { printf “%+e”, “inf” }’ produces “inf” rather than “+inf”,
-
for released gawk versions of up to 4.2.1 missing space character for the input of Inf or NaN with the space flag and the floating-point conversions, e.g. { printf “% e”, “nan” }’ produces “nan” rather than " nan”,
-
for released gawk versions from 5.0.0 onwards + character output for the input of Inf or NaN with the space flag and the floating-point conversions, e.g. { printf “% e”, “inf” }’ produces “+inf” rather than " inf",
-
for released gawk versions from 5.0.0 onwards the field width is ignored for the input of Inf or NaN and the floating-point conversions, e.g. { printf “%20e”, “-inf” }’ produces “-inf” rather than " -inf",
メールの本文にもあったけど本当に「コーナーケース」って感じですねえ。 これらの問題に対処するため。ってことですかね。
FORTRAN Compiler on IBM 704
Hugo メモ
stringify
構造体もクラスもある言語なのに全てのデータをstringに変換して連結、各データのオフセットを定数で定義してて、都度splitして取り出して元のデータ型へ変換。なら見たことある。そのコード原因のバグで何度もノートPCを真っ二つに破りそうになった。 https://t.co/SNpUDq2Guw
— Hazy (@kawada_syogo225) July 11, 2024
そういえばとあるお方の書いたRubyの入門本がそんなコードを載せていて あきれ果てた記憶が。
もう15年以上前の話だし書名や著者名は書かないけど (ぶしのなさけ)
フレーバーテキスト風
Claude に C++ の予約語をフレーバーテキスト風にしてもらったら、ちょっと面白かった。 pic.twitter.com/EtFtyv3pyL
— Ryo Suzuki (@Reputeless) July 14, 2024
旗
こういう小規模な「知らない文化」と出会うために放浪をしている。 pic.twitter.com/20vxVGl1rk
— すこやかむいむい (@sukoyakamuimui) July 13, 2024
平成に入るころにはもうなかったと思うけど、 わたしが小学生の頃はわりと残っていた記憶
ビームナギナタ
ゲルググのビームナギナタ
— 永遠の蒼 (@sioagisoluto) July 16, 2024
・まずナギナタじゃない
・グリップでビーム刃を受ける
・時々ビーム刃が黄色
・たまに実体刃が出る
これぞジオン脅威のメカニズム pic.twitter.com/5C7dkqV1Te
ビームの「刃」が黄色になるのは、 「めぐりあい宇宙」で テキサスコロニーでのギャン(とマ・クベ)のエピソードを ゲルググ(とシャア)のものとまとめちゃったので TV版だとギャン(刃は黄色)と戦っているカットとの整合性を とるためだったはず (ついでに言えば刃を片方だけ出しているのも)。
まあそんなことは承知の上で書いているのかもしれないけど
主砲
昔のアメリカ空母の艦橋前にある主砲好きなんだがわかるやついる? pic.twitter.com/yCI5jUvoiE
— トムキャッター ZEN (@ZENTomcat) July 15, 2024
「主砲」なのかなあ。あれ。 レキシントンやサラトガ(の改装前)なら20㎝砲(重巡洋艦と同じ)だけど エセックス級のは「両用砲」だし