ときどきの雑記帖 RE* (新南口)
背中ごしにセンチメンタル
パニーニ
ひと月くらいぶりに例のお店のパニーニを買ってみたら… 小さくなった?
ZZ@tvk
次回放送(2/19)が最終回なのだけど、 後番組はどうなるのかと思っていたら ガンダムではないらしい。 vガンやってくれー。
DAP
(複数個持っている中のひとつが)壊れた。 まあ(たぶん)10年以上使ってたしなあ。 ちなみに壊れたのはメカ(可動)部分。
ブラタモリ
次回放送(3/18)は佐賀らしい。
#230「佐賀」◆初回放送2023年3月18日◆ - ブラタモリ - NHK
Neptyne
Launch HN: Neptyne (YC W23) – A programmable spreadsheet that runs Python | Hacker News
面白そうと思いつつも最初に見たときは
Why do you require a login for the tutorial? I backed out because of it.
We just added a button to let you skip the sign-in for the tutorial: https://neptyne.com/neptyne/tutorial
I had three minutes, clicked tutorial and got a modal asking me to sign up.
Left the page.
I didn’t even get three minutes; as soon as the page opened, I couldn’t do anything without signing into Google or creating an account. Closed the tab.
というものだったので これらの投稿と同じく自分も即タブを閉じてしまったのだけど、 別の経路でこのスレッドが目に入ってきたので もう一度見たらコメントがやたら増えていて、 しかも好意的なものばかりに見えたので なにがあったと思ったら
Hi HN! We are Douwe and Jack, founders of https://neptyne.com. Neptyne is a programmable spreadsheet that runs Python. It’s like Google Sheets, but for software engineers and data scientists. If you have three minutes, go to https://neptyne.com/neptyne/tutorial and it gives you a taste.
作者が降臨していたらしい。
なおこんな意見もあり。
I think Gnumeric has supported this for years.
https://help.gnome.org/users/gnumeric/stable/sect-extending-…
I recall doing a noise model of a transimpedance amp in Gnumeric where I called out to Python/Numpy to do integration of 1/f noise based on parameters from a datasheet. That was at least 10 years ago. What’s the difference between this Gnumeric feature and Neptyne?
Founder of AlphaSheets here – we built this back in 2015 and developed it for 3 years. We built Python, R, SQL and full excel formula/hotkey/format/conditional formatting/ribbon compatibility. It was a long slog!
I wish you good luck and all the best. It’s a tough field but a big market. And I still think the potential is there.
新刊近刊
manningの本、人気だなあ。
今回は
出版社 : 翔泳社 (2023/4/19)
で、
本書は Yehonathan Sharvit, “Data-Oriented Programming”, Manning Publications 2022 の邦訳版です。
この本もMEAPで買っておきながらあまりきちんと読んでいない😓
One True awk
言われてみれば。の話。 one true awkのリポジトリにこんなissueがあった。
Syntax question – expression should be an error but seems not to be · Issue #173 · onetrueawk/awk
Why is ‘NF==2 && $0=$2’ not a syntax error? == has higher precedence than &&, which has higher precedence than =. This should parse as ‘(NF==2 && $0) = $2’, should it not? The left side of that assignment is not an lvalue. What am I missing? This works in the awk implementations I have on hand, but not in the one I am trying to write. If this is valid, it’s a problem for my parser…
In C (similar precedence rules), this works as expected:
if (2 == 2 && (n = 37)) printf("%d\n", n);
but (with gcc) this gets “error: lvalue required as left operand of assignment”:
if (2 == 2 && n = 37) printf("%d\n", n);
$0=$2 “glitch” · Issue #147 · onetrueawk/awk
での内容と被る部分があるのだけど(実際そこから派生したissueではある)、
NF==2 && $0=$2
の解釈がおかしいのでは?
という指摘で、それに対してこんな回答が。
The answer, as unsatisfying as it may be, is that Awk has always worked this way. I didn’t look at this in great detail, but in the grammar for The One True Awk, it seems to be handled in the productions for pattern and ppattern. In the gawk grammar, it’s handled in the product for exp using a %prec directive.
You might want to look at the mawk grammar which is likely to be the cleanest of all. This is also likely fodder for a POSIX interpretation request. @benhoyt asked me about this privately a little while back and I gave him the same answer.
なるほど。
そしてGoAWKの作者も登場。
Yes, I just ran across this in GoAWK and fixed it here: benhoyt/goawk#170 … GoAWK uses a hand-written recursive descent parser so it this is a bit of a hack, but oh well, at least it’s consistent with the other Awks now.
- Error parsing “cond && var=value” · Issue #166 · benhoyt/goawk
- Allow parsing of “cond && var=value” and similar expressions by benhoyt · Pull Request #170 · benhoyt/goawk
ampersand
もう一つone true awkのリポジトリから。
subやgsubでそのreplacementに&
を使ったときの
結果がおかしいという指摘。
gsub and sub does not take “&” · Issue #172 · onetrueawk/awk
command:
awk 'BEGIN {s="qwerty xxxx"; s2=s; s3=s; sub(/xxxx/,"&",s); sub(/xxxx/,"\046",s2);sub(/xxxx/,"!!",s3);print s,s2,s3}'
result:
qwerty xxxx qwerty xxxx qwerty !!
this shows that sub() does not substitute regular expression for “&”, but it does it for all other characters e.g. “!!” as seen by the example above. “xxxx” is not replaced when replacement string is “&” but it is replaced if other string e.g. “!!”
これ、知らない人は驚くかもしれないけどそういうもので、 実際こういう回答がついている。
you do realize “&” is special, right?
opengroupの awk でも
sub(ere, repl[, in ])
Substitute the string repl in place of the first instance of the extended regular expression ERE in string in and return the number of substitutions. An
( ‘&’ ) appearing in the string repl shall be replaced by the string from in that matches the ERE. An <ampersand> preceded with a <backslash> shall be interpreted as the literal <ampersand> character.
と&
についての記述がある。
gawkのマニュアルだとこの辺。
sub(regexp, replacement [, target])
If the special character ‘&’ appears in replacement, it stands for the precise substring that was matched by regexp. (If the regexp can match more than one string, then this precise substring may vary.) For example:
{ sub(/candidate/, "& and his wife"); print }
changes the first occurrence of ‘candidate’ to ‘candidate and his wife’ on each input line. Here is another example:
$ awk 'BEGIN { > str = "daabaaa" > sub(/a+/, "C&C", str) > print str > }' -| dCaaCbaaa
gensub(regexp, replacement, how [, target]) #
As with sub(), you must type two backslashes in order to get one into the string. In the replacement text, the sequence ‘\0’ represents the entire matched text, as does the character ‘&’.
gsub(regexp, replacement [, target])
As in sub(), the characters ‘&’ and ‘\’ are special, and the third argument must be assignable.
FORTRAN Compiler on IBM 704
CC000 CLASSIFIES STATEMENT AS TO WHICH NON-ARITHMETIC.
のつづき。
REM CC000/ CALLS=CC500,C0190X,DIAG,C0190,TET00.
REM CC000 CLASSIFIES STATEMENT AS TO WHICH NON-ARITHMETIC.
CC000 STZ 2G ワークエリアをゼロクリア
LXA L(0),3 ir1,ir2をゼロに
CC001 TSX C0190X,4 ソース読み込み情報クリア
TSX CC500,4 辞書から一文字取得
CAS ENDMK 辞書の終わりか?
TRA ERR77P NO MACHINE ERROR
TSX DIAG,4 YES 辞書になかった
TXI CC004,4 NO 比較ループへ
*比較ループ
CC002 TSX CC500,4 辞書から一文字取得
CAS ENDMK 辞書の終わりか?
TXI ERR77P,0 NO MACHINE ERROR
TXI CC007,0 YES 辞書に一致するエントリがあった
CC004 STO 1C NO SAVE CHARACTER
STQ 1C+1 PUSH MQ
TSX C0190,4 ソースから一文字取得
LDQ 1C+1 POP MQ
SUB 1C 辞書の文字と同じ?
TZE CC002 YES 比較継続
CC005 TSX CC500,4 辞書を次のエントリまで読み進める
SUB ENDMK
TNZ CC005
TXI CC001,1,-1 新しい辞書エントリとの比較を開始
(読み込みエントリ数のカウンタを増やす)
CC007 CLA T,1 カウンタの内容を使ってディスパッチ
TPL T,1 OF THE NON-EXCUTABLE TYPE,
SXD 1C+2,1 PUSH IR1
TSX TET00,1 * GO ENTER EIFNO IN THE
PZE 14 NONEXC TABLE.
LXD 1C+2,1 POP IR1
CC008 TRA T,1 * TAKE INDICATED TRANSFER.
REM END OF PROGRAM CC000.
TET00はこれまで読んできたサブルーチンでも使っていたりしたのだけど これまでスルーしていた。 のでここで、とはならず今回もスルー😓
REM TET00,1/ CALLERS=CA000,CC000,C0100,C0200,C0300,C1300,C1400,
REM C1500,C3000,C3100,SS000,FOR,SPC,CMA,EMK,LIB,VRA(VRD).
REM TET00 MAKES ENTRIES IN THE TAPE TABLES. WHEN A BUFFER IS
REM FULL IT IS WRITTEN AS A RECORD ONTO TAPE 4.
TET00 SXD TETXR2,2 SAVE THE C(XR2),
MAKES ENTRIES IN THE TAPE TABLES.
で何かを察してくださいな😄
それはそれとして、辞書から一文字持ってくるサブルーチンのCC500。
REM CC500,4/ CALLER=CC000,
REM CC500 BRINGS NEXT CHARACTER OF DICTIONARY INTO AC(30-35),
CC500 PXD ,0 アキュムレーターをクリア
TIX CC502,2,1 ワードの読み残しなし?
LXD 2G,2 YES 辞書の位置ポインタ復帰
LDQ DIC,2 MQレジスタに1ワード読み込み
TXI CC501,2,-1 辞書位置ポインタ増加
CC501 SXD 2G,2 辞書位置ポインタ保存
LXA L(6),2 SET THE CHARACTER COUNT = 6
CC502 LGL 6 MQレジスタから一文字をアキュムレーターに
TRA 1,4 呼び出し元に戻る
REM END OF PROGRAM CC500.
辞書(DIC)とジャンプテーブル(T)は 以下の通り、ちょっとわかりづらいけど 辞書のエントリとそれに対応するジャンプテーブルのエントリの 順番は同じ。
DIC
REM DIC/ DICTIONARY OF NON-ARITHMETIC STATEMENTS (USED BY CC500).4F13326
DIC OCT 244677274663 DO-GOT 4F13327
OCT -67731267462 O-IF(S 4F13328
OCT 254562256266 ENSESW 4F13329
OCT 316323307731 ITCH-I 4F13330
OCT 267462254562 F(SENS 4F13331
OCT 254331273063 ELIGHT 4F13332
OCT -373126243165 -IFDIV 4F13333
OCT 312425233025 IDECHE 4F13334
OCT 234277312621 CK-IFA 4F13335
OCT 232364446443 CCUMUL 4F13336
OCT 216346514665 ATOROV 4F13337
OCT 255126434666 ERFLOW 4F13338
OCT -373126506446 -IFQUO 4F13339
OCT -233125456346 TIENTO 4F13340
OCT -252551264346 VERFLO 4F13341
OCT -267731267721 W-IF-A 4F13342
OCT -226231274577 SSIGN- 4F13343
OCT -226346477747 STOP-P 4F13344
OCT 216462257762 AUSE-S 4F13345
OCT 254562254331 ENSELI 4F13346
OCT 273063772431 GHT-DI 4F13347
OCT -42545623146 MENSIO 4F13348
OCT -57725506431 N-EQUI 4F13349
OCT -252143254523 VALENC 4F13350
OCT 257726512550 E-FREQ 4F13351
OCT -242545237077 UENCY- 4F13352
OCT 234645633145 CONTIN 4F13353
OCT -242577512521 UE-REA 4F13354
OCT 246321472577 DTAPE- 4F13355
OCT -112521243145 READIN 4F13356
OCT -76463632147 PUTTAP 4F13357
OCT 257751252124 E-READ 4F13358
OCT 245164447751 DRUM-R 4F13359
OCT 252124776651 EAD-WR 4F13360
OCT 316325632147 ITETAP 4F13361
OCT 257766513163 E-WRIT 4F13362
OCT 254664634764 EOUTPU 4F13363
OCT -236321472577 TTAPE- 4F13364
OCT -265131632524 WRITED 4F13365
OCT -116444774751 RUM-PR 4F13366
OCT 314563774764 INT-PU 4F13367
OCT -52330775125 NCH-RE 4F13368
OCT -263145247722 WIND-B 4F13369
OCT 212342624721 ACKSPA 4F13370
OCT 232577254524 CE-END 4F13371
OCT 263143257726 FILE-F 4F13372
OCT -65144216377 ORMAT- 4F13373
OCT -226422514664 SUBROU 4F13374
OCT -233145257723 TINE-C 4F13375
OCT -064444464577 OMMON- 4F13376
OCT -112563645145 RETURN 4F13377
OCT -372321434377 -CALL- 4F13378
OCT 254524747726 END(-F 4F13379
OCT -244523633146 UNCTIO 4F13380
OCT -057777777777 N----- 4F13381
BSS 10 4F133815
REM END OF DICTIONARY. 4F13382
T
REM T/ TRANSFER TABLE IUSED BY CC000), 4F13385
T TXI C0100,0 DO, 4F13386
TXI C0200,0 GO TO. 4F13387
TXI C0400,0 IF ISENSE SWITCH. 4F13388
TXI C0500,0 IF (SENSE LIGHT. 4F13389
TXI C0600,0 IF DIVIDE CHECK. 4F13390
TXI C0700,0 IF AC OVERFLOW, 4F13391
TXI C0800,0 IF MQ OVERFLOW. 4F13392
TXI C0300,0 IF. 4F13393
TXI C1000,0 ASSIGN. 4F13394
TXI C1300,0 STOP. 4F13395
TXI C0900,0 PAUSE. 4F13396
TXI C1100,0 SENSE LIGHT, 4F13397
TXL C1200,0 DIMENSION* 4F13398
TXL C1500,0 EQUIVALENCE. 4F13399
TXL C1400,0 FREOUENCY, 4F13400
TXI C1600,0 CONTINUE. 4F13401
TXI RBT,0 READ TAPE. 4F13402
TXI RIT,0 READ INPUT TAPE. 4F13403
TXI RDD,0 READ DRUM. 4F13404
TXI RDC,0 READ CARD. 4F13405
TXI WBT,0 WRITE TAPE. 4F13406
TXI WOT,0 WRITE OUTPUT TAPE. 4F13407
TXI WRD,0 WRITE DRUM, 4F13408
TXI RDP,0 PRINT. 4F13409
TXI PDC,0 PUNCH. 4F13410
TXI RWN,0 REWIND. 4F13411
TXI BSP,0 BACKSPACE. 4F13412
TXI EFT,0 END FILE. 4F13413
TXL FOR,0 FORMAT. 4F13414
TXL C3000,0 SUBROUTINE. 4F13415
TXL C3100,0 COMMON. 4F13416
TXI C3200,0 RETURN. 4F13417
TXI C3300,0 CALL. 4F13418
TXL C3400,0 END. 4F13419
TXL C3500,0 FUNCTION. 4F13420
BSS 10 4F134205
REM END OF TRANSFER TABLE. 4F13421
ジャンプテーブルを参照している部分、よく見ると二か所ある
CC007 CLA T,1 カウンタの内容を使ってディスパッチ
TPL T,1 OF THE NON-EXCUTABLE TYPE,
SXD 1C+2,1 PUSH IR1
TSX TET00,1 * GO ENTER EIFNO IN THE
PZE 14 NONEXC TABLE.
LXD 1C+2,1 POP IR1
CC008 TRA T,1 * TAKE INDICATED TRANSFER.
REM END OF PROGRAM CC000.
の、TPL T,1
とTRA T,1
ね。
今まで気がつかなかったのだけど、ジャンプテーブルに並べられている命令は
T TXI C0100,0 DO, 4F13386
TXI C0200,0 GO TO. 4F13387
TXI C0400,0 IF ISENSE SWITCH. 4F13388
のようにすべてTXI命令を使っていると思っていたら
TXI C3300,0 CALL. 4F13418
TXL C3400,0 END. 4F13419
TXL C3500,0 FUNCTION. 4F13420
のようにTXL命令を使ったものもある。 これはジャンプ先のサブルーチンで処理する文の 性質によって使い分けられているらしい・
The IBM 7094 and CTSS | Hacker News
Swearing (英語でいう "fuck", "shit"など) が入っているコードは、入っていないコードよりも高品質である。GitHubにおける数千個のCソースコードを検査した結果。https://t.co/jfRkansR4I
— 新山祐介 (Yusuke Shinyama) (@mootastic) February 12, 2023
- Open source code with swearing in the comments is statistically better than that without : programming
- jwz: Code with swearing is better code.
mk2のオーロラ 身にまとい
— 超兄貴 〜シン・MSX〜 (@SuperAniki_MSX) January 9, 2018
君は戦う 人になれ
同期ずれを 恐れたら
高速化は 悪の手に沈む
Wake Up, BASIC 立ち上がれ
64KBとのバトル
Wake Up, floppy 2Dよ
俺に記憶を与えてくれ
8801 黒いボディ
8801 8Mhzの頭脳
PCー8801 BLACK FH pic.twitter.com/h9Sn22PbPc