ときどきの雑記帖 RE* (新南口)
ナマケモノがみてた
シュクメルリ
食べた。 が、後から隣に座ってきたにーちゃんが 犬食いなクチャラーで 肘を広げて食べるものだから その肘が何度も当たって以下略
今日の重箱の隅
新聞
13年後ってどこから出た数字なのだろうと思って記事を読んでみたら
紙の新聞が「消滅」の危機に直面している。日本新聞協会が2023年12月に発表した2023年10月時点の新聞発行部数は 2859万部と1年前に比べて7.3%、225万6145部も減少した。2005年から19年連続で減り続け、7.3%という減少率は過去最大だ。
新聞の発行部数のピークは1997年の5376万部。四半世紀で2500万部が消えたことになる。 全盛期の読売新聞と朝日新聞、毎日新聞の発行部数がすべてごっそり無くなったのと同じである。 このまま毎年225万部ずつ減り続けたと仮定すると、13年後の2036年には紙の新聞は消滅して姿を消す計算になる。
直近1年間の「減少数」がそのまま毎年続くと? それはいくらなんでも(ぴー)な想定じゃなかろうか。 まあ「率」だと(それでもアレだけど) 「0」にしにくいから。なんかねえ
総発行部数7.3%減 2859万486部 2023年10月新聞協会調べ | ヘッドライン|すべてのヘッドライン|日本新聞協会
ところで新聞といえば東スポ。 山梨も翌日の朝刊での発売になったらしい。
- 東京スポーツ - Wikipedia
- 金曜日の夕方に売っていた東スポが山梨県のほとんどで土曜日の朝… - Yahoo!知恵袋
- コンビニに東スポが売っていませんでした。明日競馬なので東スポ買いに行ったら… - Yahoo!知恵袋
なるほど翌日の朝刊になるとこんな影響もあったんだなあ
メガドライブ相当
メガドライブ相当のゲームをC言語のみで自作可能なOSSのゲーム機「VGS-Zero」 - GIGAZINE
SUZUKI PLANによると、Z80には「2のn乗を除く乗算、除算、剰余算やアークタンジェント(角度を求めるために必要な三角関数)の計算処理」 の性能が低いという欠点が存在するとのこと。
また、C言語の「memset」や「memcpy」に相当するハードウェアエミュレーターも搭載しているため、 C言語のみでメガドライブなどの16ビット商用ゲームと同等のゲームを開発可能です。
なんかよくわからんなあ(GIGAZINEだし…) ということで(ry
GitHub - suzukiplan/vgszero: SUZUKI PLAN - Video Game System Zero
Z80 でゲームプログラミングをすると、2のn乗を除く乗算、除算、剰余算やアークタンジェント (角度を求めるために必要な三角関数)の計算処理がボトルネックになりがちですが、 それらの計算処理を高速に実行できる HAGe; High-speed Accumulator for Game と呼ばれるゲーム向けの演算用途に特化したハードウェアを搭載しています。
これらの演算はゲームで必要になるシーンが多いので、ゲームを高速に動かす上では非常に有用です。
また、C言語の memset, memcpy に相当する DMA ハードウェアも搭載しているので、 メモリ間のブロック転送が(LDIRよりも)かなり高速に実行できます。
これらの特徴により 「C言語のみ」でもメガドライブの商用ゲーム相当のゲームが開発可能に することがゲームハードウェアとしての VGS-Zero の基本コンセプトです。
(Hardware Calculation)
0xC5 の OUT により Z80 が苦手とする乗算、除算、剰余算を高速に実行できます。
# 8bit 演算命令 OUT (0xC5), 0x00 ... HL = H * L OUT (0xC5), 0x01 ... HL = H / L OUT (0xC5), 0x02 ... HL = H % L # 8bit 演算命令 (符号付き) OUT (0xC5), 0x40 ... HL = H * L OUT (0xC5), 0x41 ... HL = H / L # 16bit 演算命令 OUT (0xC5), 0x80 ... HL = HL * C (※HL: 演算結果 mod 65536) OUT (0xC5), 0x81 ... HL = HL / C OUT (0xC5), 0x82 ... HL = HL % C # 16bit 演算命令 (符号付き) OUT (0xC5), 0xC0 ... HL = HL * C (※HL: 演算結果 mod 65536) OUT (0xC5), 0xC1 ... HL = HL / C ※ゼロ除算が実行された場合の HL は 0xFFFF
(memset DMA)
LD BC, 0xC000 # 転送先アドレス LD HL, 0x2000 # 転送バイト数 LD A, 0xFF # 転送する値 OUT (0xC2), A # memset
(memcpy DMA)
LD BC, 0xC000 # 転送先アドレス (RAM) LD DE, 0x6000 # 転送元アドレス (ROM Bank 3) LD HL, 0x2000 # 転送バイト数 (8KB) OUT (0xC3), A # memcpy (※書き込んだ値は無視されるので何でもOK)
なるほど。
[B! OSS] メガドライブ相当のゲームをC言語のみで自作可能なOSSのゲーム機「VGS-Zero」
新刊近刊
COBOLプログラミング 正規表現とデータ分析と可視化: データ駆動ビジネス eBook : doitsu: Kindleストア
2038年のパラダイムシフト──人生・社会・技術 | 刊行年月,2024年 | ハヤカワ・オンライン
2038年というとUNIX timeのアレを連想してしまうけど 多分それとは関係ないよね
H
【C言語】あえて連想配列をフルスクラッチし、ホールスプール法(BM法)で文字列照合を実装した #C - Qiita
はて、ホールスプール法とは? と調べたらBMH(Boyer-Mooreの改良の一種)のHだった。
- HorspoolのアルゴリズムとSunday’s Quick Search - 似非学問的な手記
- 検索アルゴリズム (4) 文字列の検索 -2-
- StringSearch~文字列検索アルゴリズム~【中編】 | TECH PROjin
- Boyer-Moore-Horspoolアルゴリズムの勉強 - FPGA開発日記
- 4_2_98.pdf
- ボイヤー-ムーア文字列検索アルゴリズム - Wikipedia
- 効果的な文字列検索アルゴリズム「Boyer-Moore-Horspool」 | TECH+(テックプラス)
- Boyer–Moore–Horspool algorithm - Wikipedia
redirect
grep -c error < *.txt
— Koichi Nakashima (@ko1nksm) February 3, 2024
(zsh専用) https://t.co/NaSFG9EXHX
というのを見かけたので(ry
この辺か。
7.2 Multios
If the user tries to open a file descriptor for writing more than once, the shell opens the file descriptor as a pipe to a process that copies its input to all the specified outputs, similar to tee, provided the MULTIOS option is set, as it is by default. Thus:
date >foo >bar
writes the date to two files, named ‘foo’ and ‘bar’. Note that a pipe is an implicit redirection; thus
date >foo | cat
writes the date to the file ‘foo’, and also pipes it to cat.
Note that the shell opens all the files to be used in the multio process immediately, not at the point they are about to be written.
Note also that redirections are always expanded in order. This happens regardless of the setting of the MULTIOS option, but with the option in effect there are additional consequences. For example, the meaning of the expression >&1 will change after a previous redirection:
date >&1 >output
In the case above, the >&1 refers to the standard output at the start of the line; the result is similar to the tee command. However, consider:
date >output >&1
As redirections are evaluated in order, when the >&1 is encountered the standard output is set to the file output and another copy of the output is therefore sent to that file. This is unlikely to be what is intended.
If the MULTIOS option is set, the word after a redirection operator is also subjected to filename generation (globbing). Thus
: > *
will truncate all files in the current directory, assuming there’s at least one. (Without the MULTIOS option, it would create an empty file called ‘*’.) Similarly, you can do
echo exit 0 >> *.sh
If the user tries to open a file descriptor for reading more than once, the shell opens the file descriptor as a pipe to a process that copies all the specified inputs to its output in the order specified, provided the MULTIOS option is set. It should be noted that each file is opened immediately, not at the point where it is about to be read: this behaviour differs from cat, so if strictly standard behaviour is needed, cat should be used instead.
Thus
sort <foo <fubar
or even
sort <f{oo,ubar}
is equivalent to ‘cat foo fubar | sort’.
Expansion of the redirection argument occurs at the point the redirection is opened, at the point described above for the expansion of the variable in >&$myfd.
ふむ