ときどきの雑記帖 RE* (新南口)
迷い道
宅配便
つい最近の配達で、 おにーさんが(画面をこちらに向けて)スマホを差し出し 「サインを」と言ってきた。 どういうことだろうとしばし固まっていたら 「スマホ画面に指で(受領の)サインをしてほしい」 ということだった。
そういうのが今はあるのかと内心驚きつつ 指で画面をなぞってサインしたけど 字がぐちゃぐちゃでひでえサインになってしまった。 あれでいいんだろうか😓
firefox
なんか数日前からamazonのページを表示させると 正しくレンダリングされていないっぽいけどなんじゃこれ。 (最後の)Firefoxの更新の後からというわけではなかったと思うので 本体のバグではなさそうだけどさてどうしたものか
german string
メモ。 なんとなくRubyのオブジェクトのレイアウト変更を思い出した。
- Why German Strings Are Everywhere | Hacker News
- Why German Strings are Everywhere : r/programming
- Why German Strings are Everywhere | CedarDB - The All-In-One-Database
12バイトはASCIIの範囲を超えた場合にちょっと短すぎな気もするけど、 それで構造体大きくしたら本末転倒だしねえ
ノイエ銀英伝
今週放送のこのエピソードは結構好きだったり。
Understanding code is the hard part
Codemap - No Code is Hard to Read for Everyone! : r/programming
このコメントにクスリと来た。
Reading code is easy. Understanding code is the hard part, especially the “why”.
FillVolatileMemory
Win32API 時々しれっと新 API が追加されてて鼻水噴くんだけど。>FillVolatileMemory 関数 (winbase.h) - Win32 apps | Microsoft Learn https://t.co/8BwMecNwAt
— UNAGI𝕏の (@unagix) July 15, 2024
最適化の結果呼ばれなくなるようなことがないもの。と。
strnlen
gnulibのコミットを追いかけていたらこんなのを見かけた
strnlen: port to Android 5.0 (API 21)
+2024-07-15 Paul Eggert <eggert@cs.ucla.edu>
+
+ strnlen: port to Android 5.0 (API 21)
+ This is needed for GNU Emacs, which attempts to port to these
+ old Android versions.
+ * m4/strnlen.m4 (AC_FUNC_STRNLEN): Replace if Autoconf 2.72 or
+ earlier, with code that detects the Android problem with strnlen.
+ This version works around some further bugs in the test, notably,
+ misplaced 'volatile' and need for volatile in the AIX 4.3 bug
+ check too.
+
その名前で見当がつくけどsrenlen
とは
どんな関数なのか調べてみると
Ubuntu Manpage: strnlen - 固定長の文字列の長さを調べる
返り値
strnlen() 関数は maxlen 以下ならば strlen(s) と同じ値を返す。 s の指す文字列が最大 maxlen バイトまでにヌルバイト (’\0’) 文字を含まない場合には maxlen を返す。
やはり。 しかし見覚えのないことは確かなので どういうところから来たものかを見ると
準拠 POSIX.1-2008.
ふむ。
ところで
maxlen 以下ならば strlen(s) と同じ値を返す
は
「未満」ならば~
だよねえ。
返り値
The strnlen() function returns strlen(s), if that is less than maxlen, or maxlen if there is no null terminating (’\0’) among the first maxlen characters pointed to by s.
誤訳かな?
このstrnlen、MSのページにもあってちょっとびっくり
VC++でも使えるってことですか
strawberryperl
例のメッセージはここにあるものっぽい。
perl5/locale.c at 3c9d78c0eb151a4917a98f20de4b2bd603dbef05 ・ Perl/perl5 ・ GitHub
"Locale '%s' is unsupported, and may hang"
" or crash the interpreter",
もうちょっと前後を見ると
/* We only handle single-byte locales (outside of UTF-8 ones); so if this
* locale requires more than one byte, there are going to be BIG problems.
* */
if (MB_CUR_MAX > 1 && ! PL_in_utf8_CTYPE_locale
/* Some platforms return MB_CUR_MAX > 1 for even the "C" locale.
* Just assume that the implementation for them (plus for POSIX) is
* correct and the > 1 value is spurious. (Since these are
* specially handled to never be considered UTF-8 locales, as long
* as this is the only problem, everything should work fine */
&& ! isNAME_C_OR_POSIX(newctype))
{
DEBUG_L(PerlIO_printf(Perl_debug_log,
"Unsupported, MB_CUR_MAX=%d\n", (int) MB_CUR_MAX));
Perl_ck_warner_d(aTHX_ packWARN(WARN_LOCALE),
"Locale '%s' is unsupported, and may crash the"
" interpreter.\n",
newctype);
}
まあそれはそうかという条件ではある。 で、これがどういうコミットで入ったのか確かめようと思ったのだけど History for locale.c - Perl/perl5 ・ GitHub コミットがたくさんあってどれが該当するものやら。 差分に特定の文字列があるかどうかとかで絞れないのだっけ?
- Locale ‘Chinese (Simplified)_China.936’ is unsupported, and may crash the interpreter. · Issue #145 · StrawberryPerl/Perl-Dist-Strawberry · GitHub
- Locale ‘Korean_Korea.949’ is unsupported, and may crash the interpreter. with perl 5.38.0.1 · Issue #119 · StrawberryPerl/Perl-Dist-Strawberry · GitHub
- Don’t output msg for harmless use of unsupported locale by khwilliamson · Pull Request #22160 · Perl/perl5 · GitHub
- Release Strawberry Perl 5.39.10.1 64-bit · StrawberryPerl/Perl-Dist-Strawberry · GitHub
- 5.38 outputs locale errors with UTF-8 LANG environment variable set · Issue #150 · StrawberryPerl/Perl-Dist-Strawberry · GitHub
- Add ability to emulate mingw locales on other boxes · Perl/perl5@0d202a9 · GitHub
問題のコミットは見つけられてないけど、 issueの発言を追いかけてみたら 警告メッセージが出てしまう件は5.39で修正されている模様。 んで、それが5.38バックポートされないのなら 5.40待ちということですかね。
それと例のメッセージが入ったのはこのコミットのようだ (issue追いかけている途中で見つけた)
ただ、setlocleの動作がglibcなどと Windows(mingwもこっち)とで動作が違うので、 その辺手当てしてやる必要があるとは思うんだけど (Japanese_Japan.932みたいのが「湧いて」出てきているのはそのせい)
setlocale, _wsetlocale | Microsoft Learn
setlocale( LC_ALL, "" );
ロケールを既定に設定します。これはオペレーティング システムから取得したユーザー既定の ANSI コード ページです。 ロケール名は、GetUserDefaultLocaleName によって返される値に設定されます。 コード ページは、GetACP によって返される値に設定されます。
""
Specifies an implementation-defined native environment. [CX] [Option Start]
The determination of the name of the new locale for the specified category depends on the value of the associated environment variables, LC_* and LANG ; see the Base Definitions volume of IEEE Std 1003.1-2001, Chapter 7, Locale and the Base Definitions volume of IEEE Std 1003.1-2001, Chapter 8, Environment Variables. [Option End]
新刊近刊
大規模データセットのためのアルゴリズムとデータ構造
良い本に仕上がりました🙌🏻
— Ozy (@ozy4dm) July 17, 2024
みんな見て見て!!!
はてなブログに投稿しました
大規模データセットのためのアルゴリズムとデータ構造 - カメヲラボ https://t.co/zWqTlFvI9E#はてなブログ
サはサイエンスのサ
鹿野司『サはサイエンスのサ』完全版が出るぞ。連載全回収録600ページ。おれはあのあとがきを思い返さなかった日は一日もない。ほんとはあらゆるテキストを本にしてほしい。ツイートとかも。
— 今田健太郎(ラジオポトフ/トリコロールケーキ) (@1mada) July 18, 2024
これとかさらに古くはアシモフの科学エッセイなどがとても好きなんだけど、 最近はこういうのを書く人いるんだろうか?
awk
gawk
printf-rework
改めてブランチ printf-rework gawk の最初の方を見ていたらこんなのを見つけた
Start refactoring format_tree.
+struct flags {
+ bool left_just;
+ bool alt;
+ bool zero;
+ bool space;
+ bool plus;
+ bool quote;
+ bool have_prec;
+ bool magic_posix_flag;
+ char format;
+ int base;
+ int field_width;
+ int precision;
+};
+
なんだろうこれ>magic_posix_flag
OTA
しばらく動きがない…
FORTRAN Compiler on IBM 704
Hugo メモ
○○ぽ
例の騒ぎの原因らしい
Crowdstrike Analysis:
— Zach Vorhies / Google Whistleblower (@Perpetualmaniac) July 19, 2024
It was a NULL pointer from the memory unsafe C++ language.
Since I am a professional C++ programmer, let me decode this stack trace dump for you. pic.twitter.com/uUkXB2A8rm
が、この部分の説明だけされてもねえ という気はする。
CrowdStrikeによる技術的説明。センサの挙動を決めるChannel Filesというのがあり、この中で名前付きパイプを監視して振舞い検知に使う時のルールを決めるファイルを更新したら問題発生と。ファイルの健全性チェック漏れか? / “Technical Details on July 19, 2024 Outage…” https://t.co/J3dfyFD8dF
— 上原 哲太郎/Tetsu. Uehara (@tetsutalow) July 20, 2024
個人的には○○ぽに至った 経路(と経緯)を知りたいんだけど その辺の情報は出なさそうねえ…
ハセガワ
毎度毎度言ってるけど、とにかく
— はまやん (@hmynmodel) July 19, 2024
ハセガワを買うんだ、ハセガワを。
毎月ハセガワだw
でないと危ない。
1000円のキットでもいい、リサイクルショップではなく新品で1000円のハセガワを買うんだ。
頼む。