ときどきの雑記帖 RE* (新南口)
テクニカラータイムマシン
新宿
新宿も色々あるなあ。
- 京王線と京王新線、2つの「新宿駅」に迷う人は後を絶たず その謎構造を調べてみた - 弁護士ドットコム
- 新宿駅~西新宿を結ぶ地下歩道 新たに140m開通 - Impress Watch
- 小田急線新宿駅「ロマンスカーカフェ」2月閉店へ 再開発に伴う駅改良工事で…運営「お客様に厚く御礼」: J-CAST ニュース
京王線はまあ知らんと引っかかるよなあ。
行列を整理するときに使うあれの名前
気になったので調べた。いくつか名前があるらしい。
パーティションポール|ガイドポール&ベルトで行列を整理。収納に便利なタイプのステンレス製|Hotdogger
パーティションポール(ガイドポール)は、銀行や空港、ホテルやイベント会場などでよく見かけるように、 順番待ちや行列を整理するために使います。「パーティションポール」「ベルトパーティション」「ガイドポール」とも。 あるいは「テンサバリアー」という呼び方もあります。
「テンサバリアー」(tensabarrier) というのは商品名?
アレ
そういえばアトランタ・ブレーブスのアレとかNFLのあのチームの名前とかは?
とか書いていたけどNFLのチームは改称されてた模様。 知らんかったわ
「ボストン・ブレーブス」という名称で1932年に創設され、翌年1933年のスタジアム移転に伴い「ボストン・レッドスキンズ」に改称した。 ワシントンD.C.に移転後も「ワシントン・レッドスキンズ(英語: Washington Redskins)」という名称で長年活動したが、 1990年代頃から先住民族の蔑称の使用は不適切であるとして公に広く批判されるようになった (#インディアンによる名称変更訴訟も参照)[11]。1990年代以降も度々批判されてきたが、 2020年5月25日のジョージ・フロイドの死を発端としたブラック・ライヴズ・マター運動の拡大により、 チーム名称が本格的に政治問題化した。同年7月13日、旧ニックネームおよび旧ロゴは廃止された。 新ニックネームが決定するまでの2020年・2021年の2シーズンは、 暫定的に「ワシントン・フットボールチーム(英語: Washington Football Team)」という名称を用いて活動した。 2022年2月2日に新名称「ワシントン・コマンダース」に改称した。
さらにアトランタのはなし
GNU grep
GNU grepのコミットログを眺めていたら grep: diagnose no UTF-8 support (Bug#60708) というのが気になったのでみてみたところ 差分はこんな感じで
diff --git a/src/pcresearch.c b/src/pcresearch.c
index a8034fb..5b111be 100644
--- a/src/pcresearch.c
+++ b/src/pcresearch.c
@@ -145,10 +145,12 @@ Pcompile (char *pattern, idx_t size, reg_syntax_t ignored, bool exact)
= pcre2_general_context_create (private_malloc, private_free, NULL);
pcre2_compile_context *ccontext = pcre2_compile_context_create (gcontext);
- uint32_t unicode = 1;
- pcre2_config (PCRE2_CONFIG_UNICODE, &unicode);
- if (unicode && localeinfo.multibyte)
+ if (localeinfo.multibyte)
{
+ uint32_t unicode;
+ if (pcre2_config (PCRE2_CONFIG_UNICODE, &unicode) < 0 || !unicode)
+ die (EXIT_TROUBLE, 0,
+ _("-P supports only unibyte locales on this platform"));
if (! localeinfo.using_utf8)
die (EXIT_TROUBLE, 0, _("-P supports only unibyte and UTF-8 locales"));
flags |= (PCRE2_UTF | PCRE2_UCP);
localeinfo.multibyte
ってなんだろうと気になったので(ry
- grep.git - grep
- grep branch, master, updated. v2.25-62-g368d38f
- grep branch, master, updated. v2.25-91-gca2ded9
どうもgnulibで定義しているものらしく、 何かの標準に従ったものではない?
localeinfo.hにあるstruct localeinfoの定義
localeinfo.h\lib - gnulib.git - gnulib - GNU portability library
/* locale information
Copyright 2016-2023 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3, or (at your option)
any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
02110-1301, USA. */
/* Written by Paul Eggert. */
#include <limits.h>
#include <wchar.h>
struct localeinfo
{
/* MB_CUR_MAX > 1. */
bool multibyte;
/* The locale is simple, like the C locale. These locales can be
processed more efficiently, as they are single-byte, their native
character set is in collating-sequence order, and they do not
have multi-character collating elements. */
bool simple;
/* The locale uses UTF-8. */
bool using_utf8;
/* An array indexed by byte values B that contains 1 if B is a
single-byte character, -1 if B is an encoding error, and -2 if B
is the leading byte of a multibyte character that contains more
than one byte. */
signed char sbclen[UCHAR_MAX + 1];
/* An array indexed by byte values B that contains the corresponding
wide character (if any) for B if sbclen[B] == 1. WEOF means the
byte is not a valid single-byte character, i.e., sbclen[B] == -1
or -2. */
wint_t sbctowc[UCHAR_MAX + 1];
};
extern void init_localeinfo (struct localeinfo *);
/* Maximum number of characters that can be the case-folded
counterparts of a single character, not counting the character
itself. This is a generous upper bound. */
enum { CASE_FOLDED_BUFSIZE = 32 };
extern int case_folded_counterparts (wint_t, wchar_t[CASE_FOLDED_BUFSIZE]);
struct localeinfoの初期化関数
localeinfo.c\lib - gnulib.git - gnulib - GNU portability library
/* Initialize *LOCALEINFO from the current locale. */
void
init_localeinfo (struct localeinfo *localeinfo)
{
localeinfo->multibyte = MB_CUR_MAX > 1;
localeinfo->simple = using_simple_locale (localeinfo->multibyte);
localeinfo->using_utf8 = is_using_utf8 ();
for (int i = CHAR_MIN; i <= CHAR_MAX; i++)
{
char c = i;
unsigned char uc = i;
mbstate_t s = {0};
wchar_t wc;
size_t len = mbrtowc (&wc, &c, 1, &s);
localeinfo->sbclen[uc] = len <= 1 ? 1 : - (int) - len;
localeinfo->sbctowc[uc] = len <= 1 ? wc : WEOF;
}
}
初期化関数で呼び出している関数
/* The sbclen implementation relies on this. */
static_assert (MB_LEN_MAX <= SCHAR_MAX);
/* Return true if the locale uses UTF-8. */
static bool
is_using_utf8 (void)
{
wchar_t wc;
mbstate_t mbs = {0};
return mbrtowc (&wc, "\xc4\x80", 2, &mbs) == 2 && wc == 0x100;
}
/* Return true if the locale is compatible enough with the C locale so
that the locale is single-byte, bytes are in collating-sequence
order, and there are no multi-character collating elements. */
static bool
using_simple_locale (bool multibyte)
{
/* The native character set is known to be compatible with
the C locale. The following test isn't perfect, but it's good
enough in practice, as only ASCII and EBCDIC are in common use
and this test correctly accepts ASCII and rejects EBCDIC. */
enum { native_c_charset =
('\b' == 8 && '\t' == 9 && '\n' == 10 && '\v' == 11 && '\f' == 12
&& '\r' == 13 && ' ' == 32 && '!' == 33 && '"' == 34 && '#' == 35
&& '%' == 37 && '&' == 38 && '\'' == 39 && '(' == 40 && ')' == 41
&& '*' == 42 && '+' == 43 && ',' == 44 && '-' == 45 && '.' == 46
&& '/' == 47 && '0' == 48 && '9' == 57 && ':' == 58 && ';' == 59
&& '<' == 60 && '=' == 61 && '>' == 62 && '?' == 63 && 'A' == 65
&& 'Z' == 90 && '[' == 91 && '\\' == 92 && ']' == 93 && '^' == 94
&& '_' == 95 && 'a' == 97 && 'z' == 122 && '{' == 123 && '|' == 124
&& '}' == 125 && '~' == 126)
};
if (!native_c_charset || multibyte)
return false;
/* As a heuristic, use strcoll to compare native character order.
If this agrees with byte order the locale should be simple.
This heuristic should work for all known practical locales,
although it would be invalid for artificially-constructed locales
where the native order is the collating-sequence order but there
are multi-character collating elements. */
for (int i = 0; i < UCHAR_MAX; i++)
if (0 <= strcoll (((char []) {i, 0}), ((char []) {i + 1, 0})))
return false;
return true;
}
((char []) {i, 0})
に面食らったけど
複合リテラルかこれ。
- 【C言語】複合リテラル【完全解説、生存期間、注意点、構造体/配列リテラル】 | MaryCore
- C言語の最新事情を知る: C99の仕様 - Build Insider
- Compound Literals (Using the GNU Compiler Collection (GCC))
新山さん
「JavaScript と Java を比べるのは、"ハムスター" と "ハム" を比べるようなもんだ」 -- Jeremy Keithhttps://t.co/4tbeZpT1sZ
— 新山祐介 (Yusuke Shinyama) (@mootastic) January 14, 2023
画像にはツイートにあるような文章が見当たらないし、 Jeremy Keith という名前は?
というのが気になったので ツイートにあったredditのスレ Academic literature be like : ProgrammerHumor をみると最初の発言に
Numerous-Occasion247
Java is to JavaScript like Ham to hamster
とあった。 が、名前が違うので それではと名前でググると
- Jeremy Keith (web developer) - Wikipedia
- Top 3 JEREMY KEITH famous quotes and sayings | inspringquotes.us
- Jeremy Keith Quotes (Author of HTML5 for Web Designers)
うぃきぺにも名前がある方でした(知らんかった😓)
新山さんと言えば メも (Memo) も2020年あたりで書き込みがなくなってたよな と思っていたら 少し前に復活(?) していたようで
過去
Sep. 2022 Oct. 2022 Dec. 2022 ≒ Newest
2020
Jan. 2020 Feb. 2020 Marr. 2020 Apr. 2020
Jan. 2023 からつらつらと眺めていたら
Twitter嫌い 2022-09-06 [Tue] 04:59
というのを見かけて苦笑いしたり納得したり。
Unison
最近HNで見かけたUnisonという言語、 新山さんが21年に言及していて(最近自分でリツイート)
関数型言語Unison。プログラムの要素 (変数, 関数) を識別子から独立させるというアイデア。従来のプログラミング言語は「名前」に値が束縛されるという構図だったが、ここではオブジェクトに名前が関連づけられるため、識別子を変更しても同じコードが動く...らしい。https://t.co/xDxglE6Lf9
— 新山祐介 (Yusuke Shinyama) (@mootastic) June 28, 2021
HN、redditで過去に話題になっていた。
2023.1
A look at Unison: a revolutionary programming language : programming
2022.11
The Unison language - a new approach to Distributed programming | Hacker News
Discussion from
- a year ago https://news.ycombinator.com/item?id=27652677
- 8 years ago https://news.ycombinator.com/item?id=9512955
Unison Programming Language - https://news.ycombinator.com/item?id=27652677 - June 2021 (131 comments)
Unison: A Content-Addressable Programming Language - https://news.ycombinator.com/item?id=22156370 - Jan 2020 (12 comments)
The Unison language - https://news.ycombinator.com/item?id=22009912 - Jan 2020 (141 comments)
Unison – A statically-typed purely functional language - https://news.ycombinator.com/item?id=20807997 - Aug 2019 (25 comments)
Unison Language March Update - https://news.ycombinator.com/item?id=19528189 - March 2019 (1 comment)
Unison: a next-generation programming platform - https://news.ycombinator.com/item?id=9512955 - May 2015 (128 comments)
んで、新山さんの説明が気になったので The Unison language を見てみたのだけど
💡 The big idea · Unison programming language
Here’s the big idea behind Unison, which we’ll explain along with some of its benefits:
🧠Each Unison definition is identified by ahashofitssyntax tree. Put another way, Unison code iscontent-addressed.
Here’s an example, the increment function on Nat:
increment : Nat -> Nat increment n = n + 1
While we’ve given this function a human-readable name (and the function Nat.+ also has a human-readable name), names are just separately stored metadata that don’t affect the function’s hash. The syntax tree of increment that Unison hashes looks something like:
increment = (#arg1 -> #a8s6df921a8 #arg1 1)
So all named arguments are replaced by positionally-numbered variable references, and all dependencies (in this case the Nat.+function) are replaced by their hashes. Thus, the hash of increment uniquely identifies its exact implementation and pins down all its dependencies.
An analogy: Each Unison definition has a unique and deterministic address (its hash) in this vast immutable address space. Names are like pointers to addresses in this space. We can change what address a name points to, but the contents of each address are forever unchanging.
ふむ?
「時勢に疎いと生き残れませんぜ、大尉殿」軍曹はなだめた。かれの瞳は死んだ魚のそれにそっくりだった。「なにもかもが変わっちまったんですよ、ここでは。やったことは過ぎたこと、ぐだぐだ行っても仕方ありませんや」/英国軍曹 第一巻「ルール・ブリタニア」
— レッドサンブラッククロスbot (@RSBC_bot) January 15, 2023