ときどきの雑記帖 RE* (新南口)
長い夜
二つ名
山手線車内の動画広告でウマ娘の宣伝が流れていたんだけど そこに登場する三頭(三人?)の二つ名が
- 「異次元の逃げ足」(サイレンススズカ)
- 「日本の総大将」(スペシャルウィーク)
- 「帝王」(トウカイテイオー)
三番目…
23 15 15 …
岡本太郎展に行った日にこっちにも行っていた(最終日)
『スペースインベーダー』が希少なテーブル筐体で遊べる!第2回「昭和レトロな世界展」が池袋にて、10月20日から開催 | インサイド
第2回「昭和レトロな世界展」は2022年10月20日(木)~25日(火)の6日間、東武百貨店池袋本店 8階催事場で行われます。
UFOが300点になるのは23発目とそれ以降の15発目ごと。だっけ? パートIIの筐体もあったけどどこが変わったのかもう覚えてないや。
最高得点である300点を出すためには、最初は8発目、それ以降は15発目の弾を命中させればよい[注釈 6]。
^ 一般的には23発目(=8+15)の次に15発目とされている
マジで?!
Goblin Slaying
Bug-fixing is a lot like goblin-slaying : programming というのを見かけたので 「ひょっとして…いやまさか」 と思いつつ元記事 Goblin Slaying - Kenneth Dunlop’s Game Dev Blog を見ると…
重箱の隅
ソフトウェアライセンスでヒヤッとした事例から学んだ教訓 - Synamon’s Engineer blog
GPLライセンス(およびその緩和版のLGPLライセンス)の恐ろしい特性はCopy Left、つまり「GPLライセンスのプログラムを使用した場合、 制作物もGPLライセンスで配布する必要がある」というものです。
「copyleft」と一つの単語のはずだけどなんで間にスペース入れてキャピタライズ?
やり取りは英語だったので意訳になりますが、返答は「REAL-TIME YCOCG DXT COMPRESSIONは使ってないけど、 macOSのプラグインにリンクが残っているから、次のリリースで削除するよ」というものでした。
辞書的な意味で使っているように取れなくもないけどたぶんそういう意図では使ってないよね。
zig
- Zig Is Self-Hosted Now, What’s Next? | Hacker News
- Zig is Self-hosted Now, What’s Next? : programming
- Zig Is Self-Hosted Now, What’s Next? | Loris Cro’s Blog
Performance improvements
の
The new self-hosted compiler reduces memory usage 3x compared to the old C++ implementation, also known as the bootstrap compiler.
As an example, building the compiler itself used to require 9.6GB of RAM, while now it takes 2.8GB.
改善前のメモリの要求量にちとビックリ。
New for loop syntax
で
const nums = [3]usize {42, 42, 42}; const chars = [3]u8 {'a', 'b', 'c'}; // easy "zip" iteration (all arguments must have the same length) for (nums, chars) |n, c| { ... } // easy range loops for (0..3) |idx| { ... } // but this won't work anymore (old syntax) for (chars) |c, idx| { ... } // now you need a range if you want an index for (chars, 0..) |elem, idx| { ... }
三番目のパターンが使えなくなったというのに一瞬悩んだけど
インデックス(idx)の扱いの問題なのね、
これは||
の間にある変数が一つか二つかで動作が変わるのを嫌った?
あとは次の例のようにすれば開始値も自由にできると。
Best book to learn C in 2022
ちょっと前のものだけど Ask HN: Best book to learn C in 2022? | Hacker News というのがあった。
I know a few other languages but have really been wanting to learn C. I see a lot of books all with a lot of praise and it’s difficult choosing one.
Any recommendations?
で、色々と挙げられているのだけど ざっと抜き出してみるとこんな感じ?
- C Interfaces and Implementations: Techniques for Creating Reusable Software
- Amazon.com: C A Software Engineering Approach
- Effective C: An Introduction to Professional C Programming
- C Programming: A Modern Approach
- Understanding and Using C Pointers: Core Techniques for Memory Management
- Bare Metal C: Embedded Programming for the Real World
- Learn C Programming: A beginner’s guide to learning C programming the easy and disciplined way
- Hands-On Network Programming with C: Learn socket programming in C and write secure and optimized network code
- The Cert C Coding Standard: 98 Rules for Developing Safe, Reliable, and Secure Systems
- Secure Coding in C and C++
- C: A Reference Manual
- Learn C the Hard Way
- C++ Programming Language
- Extreme C: Taking you to the limit in Concurrency, OOP, and the most advanced capabilities of C
- Rust for Rustaceans: Idiomatic Programming for Experienced Developers
Shell Script Best Practices
- Shell Script Best Practices, from a decade of scripting things | Hacker News
- Shell Script Best Practices — The Sharat’s
というのがあったのでどんなものかとみてみると
初っ端が
- Use bash. Using zsh or fish or any other, will make it hard for others to understand / collaborate. Among all shells, bash strikes a good balance between portability and DX.
これで笑ってしまった。 実際のところはどうだかわからん。>make it hard for others to understand / collaborate
次の
- Just make the first line be #!/usr/bin/env bash, even if you don’t give executable permission to the script file.
はどうなんだろね。
以下15項目まで。 ざっとみて「なんじゃこりゃ」というのはない。かな。
Conclusion
I try to follow these rules in my scripts, and they’re known to have made at least my own life better. I’m still not consistent though, unfortunately, in following my own rules. So perhaps writing them down this way will help me improve there as well.
Do you have anything you think I should add to this? Please share in the comments!
Edit 1: Included fixes from HN comments at https://news.ycombinator.com/item?id=33355407 and https://news.ycombinator.com/item?id=33355077.
Edit 2: Fix from https://news.ycombinator.com/item?id=33354759.
history
シェルスクリプトじゃなくシェルそのもの話になるけど こんな話題が流れてきた。
bash の history search (C-r) 便利だからって言って若者に教えるんだけど、どうも使ってもらえず。bash が動いてるところならどこでも使えるんだぞ C-r
— ステ猫 (@stereocat) October 25, 2022
むしろこれ、bash だけじゃなくて zsh なんかの別のシェル、DBクライアントの mysql, pgsql コマンド、プログラミング言語の RELP 操作 ( irb や python コマンド )、デバッガの gdb、色んなところで共通なので、もっとプッシュしても良いくらい。
— angel (as ㌵㌤の猫) (@angel_p_57) October 27, 2022
※readlineというライブラリの機能で実現してるから https://t.co/Kl32WFD9HE
これなー
— saygox (@saygox) October 25, 2022
なんでctrl+hじゃないんだろう
rだということを忘れてしまって.bash_historyをgrepしてしまうのよな https://t.co/eVjLNtncbQ
Ctrl+r
云々はあとのツイートにあるようにbashの機能というよりはreadlineの機能のはず。
まあ「Bashが使えるところなら~」というのは間違いではないだろうけど。
Emacsを使っていればなんでCtrl+r
なのかは連想できそうなものだけど、
昨今はEmacs使っている人は減ってそうだものねえ。
最後のはZshなら!-3[TAB]が便利だと声を大にして言いたい https://t.co/7Okj674N3s
— はるかみ☆ (まさきはるか) (@reasonset) October 27, 2022
TABで展開。というのはzshだけの機能かな? ヒストリに関してはcsh時代に編集コマンドを必死こいて覚えたのだけど ほぼ忘れていた😓
- Readline vi Mode (Bash Reference Manual)
- Readline - ArchWiki
- 9.3.1 Event Designators - Bash Reference Manual
- csh Howto history
FORTRAN Compiler on IBM 704
ラベル
ソースコードの右端にあるラベル(のようなもの)をみると いくつかのパターンがあって、
- F2ATN
- F2EXP
- F2SIN
- F2TNH
- SQRT
- LOG
- EXP
あたりは実装している関数を表しているようだ。 試しにどれか一つ細かく追いかけてみようか。
空き
コードのこの辺
CDBUF SYN 8 EDT 0093
REM THERE FOLLOW THE 7 SUBROUTINES EDT 0094
REM ONE2CS, LB, SAVE, CLEAR, READ, WRITE, MOVE EDT 0095
REM EDT 0096
ONE2CS RTT TRANSCRIBES EDT 0097
NOP SPECIAL EDT 0098
RTB 5 IST RECORD EDT 0099
LXD ZERO14,1
LXA ZEROTW,2
RCD
CS1 CPY MAINBF,1
TXI CS1,1,-1
HTR *
TIX CS1-1,2,1
LXD ZERO14,1
WTB 1
CS2 CPY MAINBF,1
TXI CS3,1,-1
CS3 TXH CS2,1,-27
IOD
TRA 1,4
ZEROTW 2
REM EDT 0124
LB RCD PRESSES LOAD CARDS BUTTON EDT 0125
CPY 0 EDT 0126
CPY 1 EDT 0127
TRA 0 EDT 0128
REM EDT 0129
EDT 0099
からEDT 0124
に番号が飛んでいたり
その間にある行では空白になっているのが気になる。
Hugoメモ
目立った機能追加やバグFIXはない模様。
また落ちた
前回とはだいぶ情報が違う?
Change of Static files detected, rebuilding site.
2022-10-29 23:23:58.324 +0900
panic: runtime error: invalid memory address or nil pointer dereference
[signal 0xc0000005 code=0x0 addr=0x20 pc=0x2093d26]
goroutine 352 [running]:
github.com/gohugoio/hugo/commands.(*commandeer).handleEvents(0xc000698700, 0xc0054cf6b0, 0xc0025dac48, {0xc0064c4300?, 0x14, 0x20}, 0xc00054f680?)
/root/project/hugo/commands/hugo.go:1114 +0x726
github.com/gohugoio/hugo/commands.(*commandeer).newWatcher.func1()
/root/project/hugo/commands/hugo.go:895 +0x265
created by github.com/gohugoio/hugo/commands.(*commandeer).newWatcher
/root/project/hugo/commands/hugo.go:886 +0x3ca
PS C:\Users\kbk\home\mypage\z3>