ときどきの雑記帖 RE* (新南口)
Flutter into Life
丸の内オアゾ
行ってきた。 ゲルニカ実物大レプリカも確認。 行って確かめてみて、今まで気がつかなかった理由も納得した😓
ソフデの値段
なんのかんので1500円するのか今 (今まであまり気にしてなかった)。
東京豚饅
「もう大阪行かなくてもいい」「味の違いが分からなくて悔しい」“ジェネリック551蓬莱”こと『羅家 東京豚饅』に“本家超え”と絶賛の声 | 週刊女性PRIME
そういやまだ行ってない。 自由が丘って意外に(?)行かないんだよな。 「通過」は毎日のようにしてるんだけど。
Inside the Cult of the Haskell Programmer
WIREDでこういう記事がでるのは珍しい気がする
- Inside the Cult of the Haskell Programmer | WIRED
- Inside the Cult of the Haskell Programmer : r/programming
読書
[B! エンジニア] エンジニア3年目までに読んで良かった書籍 - Yuki Watanabe’s Blog
古い記事がなぜ今話題に? というのはさておき、
TAoCP や コルメン本のようなものが皆無なのが気になった。 そんなもの読まなくても仕事にはなる(できる)ということなのかもしれないけど。 読むにしても大変だしね
- The Art of Computer Programming Volume1 Fundamental Algorithms Third Edition 日本語版
- アルゴリズムイントロダクション 第3版 総合版
- セジウィック:アルゴリズムC 第1~4部 ―基礎・データ構造・整列・探索―
エディター
GNU nanoはlinked listっぽい
GNU nano
/* More structure types. */
typedef struct linestruct {
char *data;
/* The text of this line. */
ssize_t lineno;
/* The number of this line. */
struct linestruct *next;
/* Next node. */
struct linestruct *prev;
/* Previous node. */
#ifdef ENABLE_COLOR
short *multidata;
/* Array of which multi-line regexes apply to this line. */
#endif
#ifndef NANO_TINY
bool has_anchor;
/* Whether the user has placed an anchor at this line. */
#endif
} linestruct;
ed (v7)
ところでUNIX v7のedのソースを眺めていたら
append(f, a)
int *a;
int (*f)();
{
register *a1, *a2, *rdot;
int nline, tl;
nline = 0;
dot = a;
while ((*f)() == 0) {
if ((dol-zero)+1 >= nlall) {
int *ozero = zero;
nlall += 512;
free((char *)zero);
if ((zero = (int *)realloc((char *)zero, nlall*sizeof(int)))==NULL) {
lastc = '\n';
zero = ozero;
error("MEM?");
}
dot += zero - ozero;
dol += zero - ozero;
}
tl = putline();
nline++;
a1 = ++dol;
a2 = a1+1;
rdot = ++dot;
while (a1 > rdot)
*--a2 = *--a1;
*rdot = tl;
}
return(nline);
}
freeした領域をreallocの引数に使っていいんだっけ?
それにreallocに失敗したときに実行される
zero = ozero;
のozero
って…?
んで、どうもこのedではファイル丸ごとを一つの領域で管理しているような。 GNU edだとgap bufferぽい気がする(要確認)
gap buffer
- Gap Buffer Data Structure - GeeksforGeeks
- Gap buffer - Wikipedia
- Buffer Gap (GNU Emacs Lisp Reference Manual)
まあv7の時代にはまだgap bufferはなかったような気がするし。
TINY BASIC
前回TINY BASICの比較演算子のことを書いたの だけど、ソースコードではどうなっていたのか気になったので ソースコードを確かめようとしたら
で紹介されているソースコードが置かれていたサイトがなくなっているようだ。 問題のファイルは以前ダウンロードしてどこかに保存していたと思うのだけど 探すのが面倒なので(ry
それはそれとして別のマニュアルでも比較演算子に><
があるのを見つけた
http://retro.hansotten.nl/uploads/tinybasic/Tiny%20Basic%20User%20Manual.pdf
The IF statement compares two expressions according to one of six relational operators/ If the relationship is True, the statement is executed; if False, the associated statement is skipped. The six relational operators are:
= equality < less than > greator tham <= less or equal (not greator) >= greator or equal (not less) <>, >< not equal (greator or less)
さらに検索すると(せーせーAI様にお尋ね申し上げた方が早かった?) Z80版がgithubにあるのがわかったので
- Z80-FPGA/Tinybasic at master · Obijuan/Z80-FPGA
- dimitrit/tastybasic: a BASIC interpreter for CP/M and the RetroBrew SBC v2, based on the Z80 port of Palo Alto Tiny Basic
これを読んでみた
Z80-FPGA/Tinybasic/Basic.asm at master · Obijuan/Z80-FPGA
TAB8: ;RELATION OPERATORS
DB '>='
DWA XP11
DB '#'
DWA XP12
DB '>'
DWA XP13
DB '='
DWA XP15
DB '<='
DWA XP14
DB '<'
DWA XP16
DWA XP17
><
はおろか<>
もない?
そして#
ってナニ?
式の評価部分を見ると
Z80-FPGA/Tinybasic/Basic.asm at master · Obijuan/Z80-FPGA
;*************************************************************
;
; *** EXPR ***
;
; 'EXPR' EVALUATES ARITHMETICAL OR LOGICAL EXPRESSIONS.
; <EXPR>::<EXPR2>
; <EXPR2><REL.OP.><EXPR2>
; WHERE <REL.OP.> IS ONE OF THE OPERATORS IN TAB8 AND THE
; RESULT OF THESE OPERATIONS IS 1 IF TRUE AND 0 IF FALSE.
; <EXPR2>::=(+ OR -)<EXPR3>(+ OR -<EXPR3>)(....)
; WHERE () ARE OPTIONAL AND (....) ARE OPTIONAL REPEATS.
; <EXPR3>::=<EXPR4>(* OR /><EXPR4>)(....)
; <EXPR4>::=<VARIABLE>
; <FUNCTION>
; (<EXPR>)
; <EXPR> IS RECURSIVE SO THAT VARIABLE '@' CAN HAVE AN <EXPR>
; AS INDEX, FUNCTIONS CAN HAVE AN <EXPR> AS ARGUMENTS, AND
; <EXPR4> CAN BE AN <EXPR> IN PARANTHESE.
;*************************************************************
EXPR1:
LD HL,TAB8-1 ;LOOKUP REL.OP.
JP EXEC ;GO DO IT
XP11:
CALL XP18 ;REL.OP.">="
RET C ;NO, RETURN HL=0
LD L,A ;YES, RETURN HL=1
RET
XP12:
CALL XP18 ;REL.OP."#"
RET Z ;FALSE, RETURN HL=0
LD L,A ;TRUE, RETURN HL=1
RET
XP13:
CALL XP18 ;REL.OP.">"
RET Z ;FALSE
RET C ;ALSO FALSE, HL=0
LD L,A ;TRUE, HL=1
RET
XP14:
CALL XP18 ;REL.OP."<="
LD L,A ;SET HL=1
RET Z ;REL. TRUE, RETURN
RET C
LD L,H ;ELSE SET HL=0
RET
XP15:
CALL XP18 ;REL.OP."="
RET NZ ;FALSE, RETURN HL=0
LD L,A ;ELSE SET HL=1
RET
XP16:
CALL XP18 ;REL.OP."<"
RET NC ;FALSE, RETURN HL=0
LD L,A ;ELSE SET HL=1
RET
XP17:
POP HL ;NOT .REL.OP
RET ;RETURN HL=<EXPR2>
XP18:
LD A,C ;SUBROUTINE FOR ALL
POP HL ;REL.OP.'S
POP BC
PUSH HL ;REVERSE TOP OF STACK
PUSH BC
LD C,A
CALL EXPR2 ;GET 2ND <EXPR2>
EX DE,HL ;VALUE IN DE NOW
EX (SP),HL ;1ST <EXPR2> IN HL
CALL CKHLDE ;COMPARE 1ST WITH 2ND
POP DE ;RESTORE TEXT POINTER
LD HL,0000H ;SET HL=0, A=1
LD A,01H
RET
#
がnot equal
?
実際このtiny basicのマニュアルっぽい
Tiny BASIC for the CPUville Z80 Computer
を見ると
Arithmetic and Compare operators
/ divide. * multiply. subtract. + add. > greater than (compare). < less than (compare). = equal to (compare). # not equal to (compare). >= greater than or equal to (compare). <= less than or equal to (compare).
+, , *, and / operations result in a value between 32767 and 32767. (32768 is also allowed in some cases). All compare operators result in a 1 if true and a 0 if not true.
となっていた。
さらに DR. WANG’S PALO ALTO TINY BASIC にも
#
compare if not equal to.
という記述があった。
とすると、Tiny BASICにはいくつかの「源流」があったようなのは事実だったようなので(要確認)、 この辺の表記に「ゆれ」があったということなんだろうか。
で、><
(や<>
)を使っていたと思われるTiny BASICの例。
https://hyamasynth.web.fc2.com/ACII_NTB/NTB_sourcecode_Part2.pdf
EX11 ORA B #1
FCB $8C
EX12 ORA B #2
FCB $8C
EX13 ORA B #4
FCB $8C
INX
FCB $C1
EX14 CLR B
BSR PKUP
CMP A #'>'
BEQ EX11
CMP A #'='
BEQ EX12
CMP A #'<'
BEQ EX13
CLR A
RTS
このコードだと><
は<>
と同じ結果になるよね。
CPU(MPU)が違うけど、GW-BASICもこんな感じのコードだった
sort -u
いつもの人のいつものような記事なのはさておき
[B! tutorial] なぜsortコマンドはuniq機能を含んでいるのか?(Unix哲学はどこ行った!?) - Qiita
v7のsort(1)にuオプションがあったというのを見て気になったので(ry
v7unix/v7/usr/man/man1/sort.1 at master ・ v7unix/v7unix ・ GitHub
.B u
Suppress all but one in each
set of equal lines.
Ignored bytes
and bytes outside keys
do not participate in
this comparison.
ホントだ。 今まで知らなかったけどなんで「ない」と思い込んでいたんだろう? まあ先に(あのちょっと使い物にならない)DOSのソートコマンドに慣れ親しんでいたから というのはあるかもしれない。
sortf
ソートと言えばDOS時代からsortfという「フリーソフト」を愛用していて、 それはソースコードも公開されていたので 自分で移植(というほど大したことはしていない)して使い続けていたのだけど、 数年前にふとそのソースコードを読みたくなって(謎)探してみたところ 公開も配布も停止されたようでベクターにも見当たらなかった。
残念。
C
すげー長いのでまだ飛ばし読みしかしていない
- strb_t: A new string buffer type : r/programming
- strb_t: A new string buffer type (1 of 2) | by Christopher Bazley | May, 2024 | ITNEXT
- https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3250.pdf
strb_t: A new string buffer type (1 of 2) | by Christopher Bazley | May, 2024 | ITNEXT
Although C23 adopted strdup and strndup from POSIX, other functions that would be useful for dealing with strings of unbounded maximum size are absent.
No function is provided to:
- allocate storage for a string generated under control of a format string, as a single operation.
- allocate storage for a copy of one string concatenated with another, as a single operation.
- insert characters into a string, reallocating storage as necessary.
この辺はまあごもっとも。
今日見たら2/2も公開されていた strb_t: A new string buffer type (2 of 2) | by Christopher Bazley | May, 2024 | ITNEXT
smart pointer
(2015) or earlier
新刊近刊
- 脱税の世界史 (宝島SUGOI文庫) | 大村 大次郎 |本 | 通販 | Amazon
- 税金の世界史 | ドミニク・フリスビー, 中島由華 |本 | 通販 | Amazon
- 『クトゥルフ神話生物解剖図鑑』が5月28日より発売、予約受付中。生贄袋、邪神肺などクリーチャーたちの器官や生態を紐解く
awk
OTA
前回ちょっと触れたissueのはなし。
spurious syntax error with ? :
in combination with print
· Issue #233 · onetrueawk/awk
$ printf 'foo\n\nbar\n' |nawk '{print $0 !~ /^$/ ? $0 : "[blank]"}'
foo
[blank]
bar
$ printf 'foo\n\nbar\n' |nawk '{print ($0 != "") ? $0 : "[blank]"}'
foo
[blank]
bar
をちょっと書き換えると
$ printf 'foo\n\nbar\n' |nawk '{print $0 != "" ? $0 : "[blank]"}'
nawk: syntax error at source line 1
context is
{print $0 >>> != <<<
nawk: illegal statement at source line 1
nawk: illegal statement at source line 1
構文エラーになる。と、
This may fix it, but it increases the number of shift/reduce and reduce/reduce conflicts. And I didn’t run the test suite on it.
In general, the grammar is a MESS; in particular I don’t understand the reason for separate pattern and ppattern and related non-terminals.
という意見があり、
I agree the grammar is in need of some careful cleanup. I had spent some time working on that for eg. issue #149 but left unfinished. I will take a close look at this one as well, and see if I can come up with a solution without increasing the conflicts.
ということになった模様。 構文定義絡みでは同様の問題が以前にもあったようで、 このリプライにある #149はこれ
Cannot build IANA tz database 2022b · Issue #149 · onetrueawk/awk
Hugo メモ
ふと最新版て試したらどうなるんだろうかと思って試してみたところ
PS C:\Users\kbk> $env:HUGO_ENV="" ; hugo --buildFuture server --source C:\Users\kbk\home\mypage\z3 --logLevel error --verbose
Watching for changes in C:\Users\kbk\home\mypage\z3\{content,layouts,static,themes}
Watching for config changes in C:\Users\kbk\home\mypage\z3\config.toml
Start building sites …
hugo v0.126.0-32c967551be308fbd14e5f0dfba0ff50a60e7f5e+extended windows/amd64 BuildDate=2024-05-14T13:24:11Z VendorInfo=gohugoio
ERROR render of "home" failed: execute of template failed: html/template:index.html:43:18: no such template "_internal/google_analytics_async.html"
ERROR render of "section" failed: execute of template failed: html/template:_default/list.html:43:18: no such template "_internal/google_analytics_async.html"
ERROR render of "page" failed: execute of template failed: html/template:page/single.html:43:18: no such template "_internal/google_analytics_async.html"
ERROR render of "page" failed: execute of template failed: html/template:_default/single.html:43:18: no such template "_internal/google_analytics_async.html"
Built in 3022 ms
Error: error building site: render: failed to render pages: render of "404" failed: execute of template failed: html/template:404.html:43:18: no such template "_internal/google_analytics_async.html"
PS C:\Users\kbk>
なんか見たことないエラーが発生。なんじゃこれはと調べると すでに同様の報告が出ていて
Upgraded to the latest version of hugo, 0.125.2, and now several of my sites are failing to build with errors that end in the following…
no such template “_internal/google_analytics_async.html”
Was this deprecated?
Any help is appreciated. Thanks!
そのリプライによれば
Yes, this was deprecated. We’ve been emitting a deprecation notice for a while…
Which theme?
Use this instead:
{{ template "_internal/google_analytics.html" . }}
とのこと。先ほどのエラーメッセージが正しくエラーの原因の場所を指摘していないので ちょっと手間取ったけど
layouts/_detaults/naseof.html
{{ if eq (getenv "HUGO_ENV") "production" | or (eq .Site.Params.env "production") }}
{{ template "_internal/google_analytics_async.html" . }}
{{ end }}
これをアドバイスに従って書き換えると
PS C:\Users\kbk> $env:HUGO_ENV="" ; hugo --buildFuture server --source C:\Users\kbk\home\mypage\z3 --logLevel error --verbose
Watching for changes in C:\Users\kbk\home\mypage\z3\{content,layouts,static,themes}
Watching for config changes in C:\Users\kbk\home\mypage\z3\config.toml
Start building sites …
hugo v0.126.0-32c967551be308fbd14e5f0dfba0ff50a60e7f5e+extended windows/amd64 BuildDate=2024-05-14T13:24:11Z VendorInfo=gohugoio
ERROR failed to fetch remote resource: Forbidden
Built in 13136 ms
Error: error building site: logged 1 error(s)
PS C:\Users\kbk>
見慣れた(?)エラーに。 めでたしめでたし(か?)
キー配置
私は器の小さい人間なので、こういうPCを触るたびに
— かわさき@Flutterで個人開発💻 (@kwsk_create) May 4, 2024
FnキーとCtrlキー逆にしろ😡💢
って思ってます pic.twitter.com/A2shkSOiQX
実は会社で使っているPCと自宅で使っているPCとで fnキーとCtrlキーの位置関係が逆で、 (省略されました)
格納庫
雲龍型は五〇〇七号艦(生駒)あたりから揚魚雷・爆弾筒のせいで微妙に格納庫搭載機数が減っているのは内緒です。上が五〇〇七号艦、下は五〇〇四号艦(笠置)。 pic.twitter.com/JvCYhuJPyZ
— 烈風改 (@RX2662) April 26, 2024
わりと最近(でもないか)まで、 格納庫内の飛行機は規則正しく並べられているもの (発艦時の飛行甲板のイメージ)だと思っていたのだけど、 考えてみればそれだと「無駄」が結構でてしまい 格納できる機数が減ってしまう。と。
んで、メリケンの空母の格納庫はもっと「すっきりした形」で 日本の空母はなんでこんな(ry という話もあるんだけど、それはそれで「いろいろある」んだよねえ… (イギリスのはしらない)
小田原
お知らせ
— 西 和彦 Kazuhiko Nishi (@nishikazuhiko) May 17, 2024
来年の春に小田原で「日本パソコン博物館」の開館を予定して準備が進行中ですが、今年の秋にMSX40周年のイベントの時に、開館に先行して特別展示とシンポジウムを行うことにしました
テーマは「MSXパソコンの歴史と未来:MSXの兄弟と親戚たち」(仮称)です MSX0やMSX3も展示する予定です… pic.twitter.com/jcgNfWuLnV
へー。小田原のどのへんだろうと調べてみると
嬉しいお知らせ
— 西 和彦 Kazuhiko Nishi (@nishikazuhiko) March 3, 2024
小田原に「日本パーソナルコンピューター博物館」を創ることになりました
もと関東学院大学の2号館です
一階はゲームの博物館です 準備中
館長は元NECでTK80やPC8001を作られた後藤富雄さんです 一番左、右から2番目は西
詳しいことが決まり次第、発表します… pic.twitter.com/GaczdXaPVL
素晴らしい。名古屋から青春18きっぷとか使って(セコい)行きたいですねぇ。
— トシノコウ (@suna81040) March 3, 2024
問題は小田原駅からの“ラスト1マイル”。バスもあるけどほぼ1時間に1本。佐伯眼科行き(日中は「いこいの森」行きもある)に乗ればいいようだ。2025年にもバス停はあるよね?
しかし立派な眼科だ▶︎https://t.co/7qGUO0FrNR pic.twitter.com/V6fCDr3NHP
小田原駅からはちょっと(かなり?)離れたところのようだ。
あと
工学特化の大学構想 小田原、関東学院大の敷地内に | 社会 | カナロコ by 神奈川新聞
米マイクロソフト副社長やアスキー社長などを歴任した西和彦氏らは24日、 小田原市荻窪に工学に特化した新たな4年制大学を開設する構想を明らかにした。 関東学院大のキャンパス内に整備し、同大も一般教養の講義などで協力する。 デジタル医療情報工学など3学科で計1120人の学生を集め、教員は世界中からエンジニアらを招く計画。 今後、各種手続きを進め2022~23年の開学を目指すという。
関東学院大は当面の間、教育機関を残すが、将来的には新設大学と連携を図る事務所のみになるという。 規矩学長は「撤退ではなく、深くコミットして協力していく」とした。 同大小田原キャンパスは1991年に法学部が開校して開設。 その後、受験者数の低迷などから2017年に同学部が横浜に移転、材料・表面工学研究所が小田原に移り、 大学院が新設され「国際研究研修センター」として活用されている。
日本先端大学(仮称) 関東学院大の施設を取得へ 開学は2025年4月予定 | 小田原・箱根・湯河原・真鶴 | タウンニュース
学校法人小田原教育メディア(西和彦理事長)が1月15日に、関東学院大学小田原キャンパス(小田原市荻窪) の建物の売買契約及び土地の譲渡契約を締結したことが本紙の取材で分かった。 同法人は日本先端大学(仮称)の開学を2025年4月に予定している。
この大学と博物館の関係は?
そういや1980年代末期辺りから都心にあった大学キャンパスが 郊外に移転ってけっこうあったような (近年回帰してるけど)。
メモ
The Art of UNIXを読み直したら、ずっと出典を探してた、Dick Hammingの「誤った問題を正しく解くよりも、正しい問題を誤った方法で解く方がよい」が出てきた
— magnoliak🍧 (@magnolia_k_) October 14, 2018
これと、Richard P. Gabrielの「Worse is Better」と併せて、みんな朝起きたら3回復唱しよう
同じような意味のことを他の人も言っていたような気がするけど調べない
Stop Killing Games
気持ちはめちゃ分かるし、
— 杉森 雅和 (Masakazu Sugimori) (@m_sugimori) May 17, 2024
僕だって永遠にFF11は生きてて欲しい。
でも、サーバー代どうすんだ?って問題や、
オフライン版にしても、サーバーに問い合わせてた物を全部CPUに投げるようにプログラム変えないといけない。
普通に移植版作る改修コストが掛かります。… https://t.co/2fIJCKIBRg
なんか気になったので(ry
- サービス終了後もゲームをプレイ可能な状態に保つことを義務付けさせる運動「Stop Killing Games」に英国政府が回答―海外報道 | インサイド
- Ubisoft「ザ クルー」のサービス終了を受け立ち上がった「サービス終了でゲームが遊べなくなるのはおかしい」と訴える運動「Stop Killing Games」とは? - GIGAZINE
一か月ほど前にGIGAZINEが記事にしてたのね。気がつかなかった(か忘れた)。 まあそれはさておき、プロジェクトのサイトへ行ってみると
An increasing number of videogames are sold as goods, but designed to be completely unplayable for everyone as soon as support ends. The legality of this practice is untested worldwide, and many governments do not have clear laws regarding these actions. It is our goal to have authorities examine this behavior and hopefully end it, as it is an assault on both consumer rights and preservation of media. We are pursuing this in two ways:
sold as goods
がちょっと気になった。
オンラインのみのゲームって対象になるの?
FAQもあったのでみてみたが
Q.Aren’t you asking companies to support games forever? isn’t that unrealistc?
A: No, we are not asking that at all. We are in favor of publishers ending support for a game whenever they choose. What we are asking for is that they implement an end-of-life plan to modify or patch the game so that it can run on customer systems with no further support from the company being necessary. We agree it is unrealistic to expect companies to support games indefinitely and do not advocate for that in any way. Additionally, there are already real-world examples of publishers ending support for online-only games in a responsible way, such as:
- ‘Gran Turismo Sport’ published by Sony
- ‘Knockout City’ published by Electronic Arts
- ‘Mega Man X DiVE’ published by Capcom
- ‘Scrolls / Caller’s Bane’ published by Mojang AB
- ‘Duelyst’ published by Bandai Namco Entertainment etc.
Q. What about large scale MMOROGs, isn’t it impossible for customers to run those when servers are shitdow?
A: Not at all, however limitations can apply. Several MMORPGs that have been shut down have seen ‘server emulators’ emerge that are capable of hosting thousands of other players, just on a single user’s system. Not all will be this scalable, however. For extra demanding videogames that require powerful servers the average user will not have access to, the game will not be playable on the same scale as when the developer or publisher was hosting it. That said, that is no excuse for players not to be able to continue playing the game in some form once support ends. So, if a server could originally support 5000 people, but the end user version can only support 500, that’s still a massive improvement from no one being able to play the game ever again.
まあよくわからん。 が、第一印象と思いこみで言及するようなことではなさげ。
PasocomMini PC-8801mkIISR
ベーマガイベントで、PasocomMiniの新製品「PasocomMini PC-8801mkIISR」の発表が!!
— ゆるふわんにゃーHashi (@Hashi6001) May 18, 2024
パピコンミニPC-6001まだー?#ベーマガイベント pic.twitter.com/vdT4b0XalA
PC-8801mkSRミニが発表へ
— 西川善司 (@zenjinishikawa) May 18, 2024
ハル研が開発断念したプロジェクトを電波新聞社が継承。
ゲームだけ動かせばいいのに、あえてパソコンとして復活させる高みを目指すのはミニX68000と同じ
価格と完成度が注目される
X68000Zは本体とゲームパッド付きで3万円だった
果たして…。https://t.co/wBMNZ1lLNt
おー。
発売予定詳細発表が2024年8月8日というのは
「ハチハチの日」?😄