ときどきの雑記帖 RE* (新南口)
尺沢之鯢
衣替え
ぼちぼち今週末にでも長袖を少し出すかと思っていたら、 ここ二日ばかりでかなり気温が下がったでござるの巻。
VIFAM
40周年ということで9/30にMXで一話が放送されてた。
そう言えば歌っている歌手(グループ)の関係なのか主題歌が
に入っていないんだよねえ。
笑わない数学
Season2始まった。
これまでこの時間に放映されていた「神田伯山の これがわが社の黒歴史」も 完全に終わったわけではないっぽい? この番組がきっかけで知ったというわけではないのだけど、 最近ちょっと講談に興味があってですね。
Man UTD
マンチェスターユナイテッドってこんな略し方するのか。
士農工商
今時の子は「士農工商」を習わないの!?小6娘が知らなくて、調べてみたら教科書から削除されていた!! | ママ広場 [mamahiroba]|小学生・園児ママの悩みの解決の糸口に
士農工商が教科書からなくなったのってずいぶん前のことだったと思うのだけど 世間一般にはそんな認識なのかもしれない (自分も知らない変わった部分も少なからずあるだろうし)。
40
これも40周年(ほかにもいろいろ見かけたけど)。
『機甲創世記モスピーダ』放送40周年 「バイクからロボ」の変形が斬新!「裏番組」には苦戦 | マグミクス
陰陽師
【他館展示情報】千葉県佐倉市にある国立歴史民俗博物館@rekihakuでは明日10/3より「陰陽師とは何者か-うらない、まじない、こよみをつくる-」展を開催。陰陽道の歴史とそこから生み出されてきた文化をさまざまな角度から紹介する。詳しくは→https://t.co/vZ1p5deoGa pic.twitter.com/u37OLi48Ba
— 太田記念美術館 Ota Memorial Museum of Art (@ukiyoeota) October 2, 2023
これはちょっと行ってみたい。
新刊近刊
ませまちか
けっこうな値段(6380JPY)だなあ。 そもそも本体が以下略
合同式への招待
10月末新刊予定
— 書泉_MATH (@rikoushonotana) October 1, 2023
『合同式への招待』仁平 政一 2310円(プレアデス出版)
第1章 整数の基本性質とユークリッドの互除法
第2 章 整数の合同
第3 章 位数,原始根,指数
第4 章 平方剰余と相互法則
第5 章 ガウス数体の整数の性質と合同 pic.twitter.com/NbVwcjTD79
子どもの算数、なんでそうなる?
『子どもの算数、なんでそうなる?』谷口隆/著(岩波科学ライブラリー)
— 書泉_MATH (@rikoushonotana) October 4, 2023
第1話 イジワル問題
第2話 九九表
第3話 マルとペケ
第4話 電卓を通して見る数
第5話 子どもの世界
第6話 事件簿
第7話 かけ算の順序・かけ算の種類
第8話 理論と術
第9話 ストーリーが紡がれるとき
結び―誤りは宝物 pic.twitter.com/o31YWgxFjt
MEAP
邦訳も何冊か出ている例のシリーズの新刊(まだ出ていない(MEAP)だけど)。
awk
@cindex @code{RS} variable @subentry multiline records and
Another technique is to have blank lines separate records. By a special dispensation, an empty string as the value of @code{RS} indicates that records are separated by one or more blank lines. When @code{RS} is set to the empty string, each record always ends at the first blank line encountered. The next record doesn’t start until the first nonblank line that follows. No matter how many blank lines appear in a row, they all act as one record separator. (Blank lines must be completely empty; lines that contain only whitespace do not count.)
ISO 8601
とある用事(謎)で見ていて気がついたこと
起点
グレゴリオ暦による年月日は、パリにおけるメートル条約の調印年月日を1875年5月20日とすることによって定義されている[12]。
曜日は、2000年1月1日を土曜日とすることによって定義されている[13]。
週の最初の日は、月曜日である[14]。
月日、時分秒の起点の指定は特にない。
年と月と日
YYYYMMDD(基本形式)または YYYY-MM-DD(拡張形式) のいずれかで表記される。 「年」が最初にあることを明らかにするため、また視認性を良くするために、この拡張表記がよく用いられている。
YYYY-MM だけにして -DD を省くことも、YYYY だけにして MMDD(-MM-DD) を省くことも可能であり、 その場合、前者は年月だけを、後者は年だけを表す。ただし、 YYYYMM というようなハイフン(-)なしで数字6桁だけの表記は認められていない。
なるほど。以前Excel(のPower Query)で 引っかかった日時を表す文字列からの Date型やDetaTime型への 変換時の動作はこの辺に従ったものだったのかもしれない。
High C
cohost! - “The lost language extensions of MetaWare’s High C Compiler” を見ていて、TOWNS用のHigh Cには興味深い拡張がいくつかあった。
この記事で参照しているのが日本語のマニュアルなんだけど、 TOWNS用というのはおいといても 日本でしか流通していなかったものだったっけ?>High C
nested function
void Wind(void Callme()!) {
void P(int Cnt) {
if (!Cnt) Callme();
P(Cnt-1);
}
P(100);
}
void main() {
void Called() {
printf("%s%s", "Called from deep within"
"recursion -- exiting.\n");
goto EXIT;
}
Wind(Called);
printf("I should not get here.\n"); return;
EXIT:
printf("%s%s", "Deep recursion unwound by"
" a single goto.\n");
}
ネストした関数(関数内関数)がgccにもあるけど、 このgotoの使い方はgccではできなかったと思う。
関数Windの仮引数の型もユニーク。
genertor
void Upto(int Lo, int Hi) -> (int)
{
int i = Lo;
while (i <= Hi)
yield(i++);
}
for <- Upto(1, 10) dp
printf("%d squared is %d\n", i, i*i);
ジェネレーターその1
void Each_node(Node N) -> (Node) {
void P(Node N) {
if (N == 0) return;
// サブツリーを進む
P(N->left)
yield(N);
p(N->Right);
}
P(N);
}
ジェネレーターその2
true/false
前回の(Cでの)trueの話 のつづき。
C言語010 真 TRUE と 偽 FALSE : プログラミング指南 - Code Knowledge
私が遙か昔に使っていた太古の C言語では、TRUE は -1 でした。-1 は 2進数で表すと 0b11111111 なので、 0b00000000 のビット反転という意味では正しかったのだと思います。 これを知ってる人は昭和の時代からのプログラマかも。※ 或いは C言語の歴史に詳しい人とか
細かいことを書いていくときりがないので、とりあえずここでは
1 == 1
や
2 > 1
のような式を評価した結果を整数とみなしたときにどうなるかという話として書く。
C99だと明確に1と決まっていたと思うのだけど(要確認)、 C89(C90)だとどうだったのだっけか? そこでもやっぱり1だったように思うのだけど(要確認)、 それ以前となると処理系によって異なっていた可能性はある (と思う。自分は見たことないけど)。
C以外のプログラミング言語ではどうなのかとか boolean型を初めて持ち込んだプログラミング言語は やっぱりALGOL辺りなのだろうか という話はさておき、
手元のCPLの文書 http://www.math.bas.bg/~bantchev/place/cpl/features.pdf を見るとCPLにもあったようだ。
9. Boolean and logical expressions and assignment commands
Expressions may be built up from Boolean variables, parentheses, constants and the following operators (in descending order of binding power).
∼ (not) ∧ (and) ∨ (or) ≡ ≢ imp (implies) The infixed operators associate from left to right. A Boolean expression yields a rule for obtaining a Boolean value. A Boolean assignment command is an instruction to the computing system to assign to the (Boolean) variable specified by the left-hand side expres- sion the (Boolean) value specified by the right-hand side expression.
An arithmetic relation is a pair of arithmetic expressions separated by one of the relational operators
< ≤ = ≠ ≥ >
. It is in fact a Boolean expression having the value true or false and may occur as a term in Boolean expressions. An extended arithmetic relation is introduced; for example, a relation such asa ≤ b < c
is interpreted as
(a ≤ b) ∧ (b < c)
Logical expressions and assignment commands have the same appearance as their Boolean counterparts and in fact have identical syntax, with the exception that arithmetic relations cannot be introduced. Their meaning, however, is concerned with manipulation of the bit-patterns which are the logical values. For example, if a, b, c are logical variables, the commanda := b ∧ c
means: assign to the variable a the bit-pattern which has 1-bits wherever the corresponding positions of b and c both have 1-bits, and which has O-bits in all other positions.
ただ、当然と言えば当然ではあるのだけど trueやfalseの内部表現がどうだということは 書かれていないのであった。
そもそもふつーの算術式の中に論理式を混ぜられたのだろうか? (JavaとかPascalってできなかったような)
脱線するけどCPLにはこんなのもあった。
10. Conditional expressions
B → E1,E2
2050
あと、UNIXマシン黎明期の2050では0がtrueってなっていたので、算術値をそのまま論理値として使うコードは全滅だったなんてこともありました、、、
— どくたけ (@dokutake) September 29, 2023
なので、算術値を論理値として使うことには抵抗があります、、、
この2050って日立のマシンだと思うんだけど、 実は自分も大学で(ちょっとだけ)使っていたことがある。 「0がtrueだった」とかは全然記憶にないなあ (その辺が「ちょっとだけ」だった証)。
Q
すいません。出来心でつい、、ナビエストークス方程式を解いてのウルトラ Q。
— michio inoue l MATLAB の中の人 (@michio_MWJ) October 1, 2023
レイノルズ数: 1
グリッド: 80x80
流れに流されるだけの粒子: 10^4 個
コードは GitHub に上げてます⬇️ pic.twitter.com/m8Sp20j1S1
おお、それっぽい😄
- 2D-Lid-Driven-Cavity-Flow-Incompressible-Navier-Stokes-Solver/ultraQ/ultraQ.m at master · mathworks/2D-Lid-Driven-Cavity-Flow-Incompressible-Navier-Stokes-Solver
- ナビエ-ストークス方程式の導出 | 高校数学の美しい物語
- ナビエ–ストークス方程式 - Wikipedia
Lisp
DefFromDefine https://t.co/Caw5zhDItx pic.twitter.com/y6U1LM9TAo
— Programmer Humor (@PR0GRAMMERHUM0R) September 30, 2023
ふと、昔のLispには関数定義に使うのが
define
defun
def
de
などなど処理系(方言)ごとにいろいろあった(他にもまだあったかも) のを思い出した。