ときどきの雑記帖 RE* (新南口)
Monday morning quaterback
英語でもこういう言い回しがあるんだねえ
事後孔明な質問(事後諸葛亮、Monday morning quarterback)と…一方で、拡張対応するも使われずに消えた幾多の規約/製品も。
— Shirouzu Hiroaki(白水啓章) (@shirouzu) March 5, 2024
----
「IPv4アドレスの総数は43億個で足りなくなるのは最初から分かっていたと思うんですが、なぜ最初からIPv6にしなかったんでしょうか?」https://t.co/qPldxu2x4o
- [連載] 英語フレーズ 第30回 “Monday morning quarterback” | beo | 留学一括サポート可能な留学コンシェルジュ
- 英語「monday morning quarterback」の意味・使い方・読み方 | Weblio英和辞書
マジンガーZ@MX
いつの間にかゴーゴン大公が出てきたり ホバーパイルダーがぶっ壊されたり。 ジェットパイルダー登場は次回。
NTTM
渋谷にもお店ができるらしい
【開店】元祖ニュータンタンメン本舗 渋谷店 – 開店閉店.com
東京都渋谷区円山町1-18 峯ビル 1F
ってどのへんかと思ったら東急本店(があった)のあたりか。
宇田川町
もうひとつ渋谷ネタ。
バンナム、渋谷に2000人収容のコンサートホール建設へ 26年春の開業目指す 運営会社「バンダイナムコベース」も設立 - ITmedia NEWS
そんなもの建てられるような場所(土地)があったっけ? と疑問に思ったのだけど、 記事にあった地図を参考にグーグルマップで確かめてみると ハンズからもう少し「奥」に行ったところにある 結構大きな駐車場(だった場所)みたいね。
あの辺は全然いかないからよくわからん。
powertoys
メモメモ。
Windowsで消えたマウスを見つける方法 | TECH+(テックプラス)
他責
そこそここういう使い方をする人が増えている?
なんだろう?
— 横地 啓史 (@ose_tweety) March 4, 2024
自分の人生がうまくいってないことを、他責にするのやめてもらっていいですか?
今パフォーマンスが出せないのに、何の努力もせずに、ほかの場所行ったら急にパフォーマンスが上がるなんてことある訳ないじゃ無いですか?
結果を出してる人はパフォーマンスを出す努力をしてるんです。
ビジュアルバータイマー
ちょっと欲しい
残り時間を可視化する「ビジュアルバータイマー」、キングジムが発売 プレゼンや筋トレの時間管理に - ITmedia NEWS
新刊近刊
パカッと開く! Excelデータ集計
パカッと開く! Excelデータ集計 (PC前に置いて学べる) | 太田耕市 |本 | 通販 | Amazon
短辺綴じの本と言うのも悪くないかもしれない
クレーンゲームで学ぶ物理学
4月上旬新刊予定
— 書泉_MATH (@rikoushonotana) March 3, 2024
ゲーム歴30年の物理学者による、クレーンゲームで物理学を学べる一冊。
『クレーンゲームで学ぶ物理学』小山 佳一(集英社インターナショナル)
ゲームの仕組みや景品ゲットまでの悪戦苦闘を描きながら、物理の基本に触れていく。 pic.twitter.com/2ts3ThAnTg
でたらチェック
数理科学
【近刊】次回の数理科学2024年4月号(3月19日発売)の特集テーマは「データサイエンスと数理モデル」です!
— サイエンス社 (@saiensu_sha) March 4, 2024
本特集ではお互いが密接に関係するデータサイエンスと数理モデルについて紹介していきます。#数理科学 pic.twitter.com/Oug9hrQMlv
ゲーム開発で学ぶC言語入門
3/5新刊『#ゲーム開発で学ぶC言語入門プロのクリエイターが教える基本文法と開発技法』#インプレス(9784295017660)#廣瀬豪 著「#C言語・ゲームプログラミング」棚にて!ゲーム開発を通して、C言語の基礎知識を学べる1冊。ゲームに特化することで、C言語の技法を幅広く学ぶことができます。#CUI #GUI pic.twitter.com/xtwNI0XXL1
— 書泉ブックタワーコンピュータ書【営業時間11:00~20:00】 (@shosen_bt_pc) March 5, 2024
見かけたら中身チェック
現実世界は理論どおりには進みません。その困難の中で論理的に動く部分を切り取ろうとするのが数学です。将来どんなに自動証明の技術が進んだとしても、間違った論理に基づいた定理が自動証明されることはありません。実際のところ、数学の歴史はそのような定理の反例が見つかる歴史でもありました。 pic.twitter.com/xCClk2ELyW
— 共立出版 (@kyoritsu_pub) March 5, 2024
awk
OTA
Fix fnematch buffer use-after-free by caffe3 · Pull Request #223 · onetrueawk/awk
perl version cheat sheet
これはありがたいまとめ
GNU
February GNU Spotlight
2月分
gengetopt
こんなのが Savannah Git Hosting にあった。 どんなものかみてみると
README - gengetopt.git - gengetopt
This program generates a C function that uses /getopt_long/ function to parse the command line options, to validate them and fills a /struct/ .
ふむ
coreutils
coreutilsのリポジトリを眺めていたらこんなコミットがあった
mv: revert add –swap (-x) option
Since this functionality is recently available in the exch(1) utility from util-linux, it was thought best not to complicate mv with it.
mv: add –swap (-x) option to atomically swap 2 paths
renameat2() syscall allows atomically swapping 2 paths on one file system. Expose this ability to the user with –swap.
renameat2ってなんじゃらほいと調べてみると
Ubuntu Manpage: rename, renameat, renameat2 - ファイルの名前や位置を変更する
renameat2() はカーネル 2.6.16 で Linux に追加された。
renameat2() は Linux 固有である。
glibcに入ったのは割と最近?
17662 - please implement binding for the new renameat2 syscall
Product: glibc
Target Milestone: 2.28
らるるの自宅と職場を往復する人生@それをすてるなんてとんでもない!: 2017年2月アーカイブ
RENAME_WHITEOUT(Linux-3.18から), whiteoutなinodeにする、OverlayFSなどで下位のFilesystemに存在する名前を上からカバーして 「見えない状態」にしてファイルがないことにしてしまう仕組み。
alisp
なにやらよくわからないけどLisp処理系のリポジトリがあった。
どんなもんかと眺めてみると
#define CAR(list) ((list)->value_ptr.cons_pair->car)
#define CDR(list) ((list)->value_ptr.cons_pair->cdr)
struct
object
{
int refcount1;
int refcount2;
int mark;
int flags;
/*const char *begin;
const char *end;*/
enum object_type type;
union object_ptr_union value_ptr;
};
struct
cons_pair
{
int filling_car;
int empty_list_in_car;
int found_dot;
int filling_cdr;
int empty_list_in_cdr;
struct object *car;
struct object *cdr;
};
union
object_ptr_union
{
struct symbol *symbol;
struct symbol_name *symbol_name;
struct object *next;
mpz_t integer;
fixnum *fixnum;
mpq_t ratio;
double *floating;
struct complex *complex;
gmp_randstate_t random_state;
struct bytespec *bytespec;
struct cons_pair *cons_pair;
struct string *string;
char *character;
struct array *array;
struct bitarray *bitarray;
struct hashtable *hashtable;
struct environment *environment;
struct package *package;
struct filename *filename;
struct stream *stream;
struct structure_class *structure_class;
struct structure *structure;
struct standard_class *standard_class;
struct standard_object *standard_object;
struct condition_class *condition_class;
struct condition *condition;
struct function *function;
struct function *macro;
struct method *method;
struct sharp_macro_call *sharp_macro_call;
};
syntax of C
引用で漁って読んでいる人向け
— 百千万億 萬(つもいよろず) (@TumoiYorozu) March 2, 2024
C の文法は宣言の * とデリファレンスの * が効果が逆でユーザーフレンドリーじゃ無いと思うかもしれないけど、
思想としては使用時と宣言時が似た文法になる様に、この視点ではユーザーフレンドリーになってて、… https://t.co/hNRXdMPGfk pic.twitter.com/F8d1K9MO93
Cの型の構文は「使う時と同じように型を書くようにすればわかりやすいだろう」という考えのもとに設計されました。
というのが気になったので(ry
いやまあ自分もどこかでそういう話を聞いた覚えはあるんだけど、 ゲイツの640k発言みたいに妙な尾ひれがついた形で 語られていたりはしないのかと。
で、まずはdmrその人が書いた The Development of the C Language を読んでみた。
この辺?
For each object of such a composed type, there was already a way to mention the underlying object: index the array, call the function, use the indirection operator on the pointer. Analogical reasoning led to a declaration syntax for names mirroring that of the expression syntax in which the names typically appear. Thus,
int i, *pi, **ppi;
declare an integer, a pointer to an integer, a pointer to a pointer to an integer. The syntax of these declarations reflects the observation that i, *pi, and **ppi all yield an int type when used in an expression. Similarly,
int f(), *f(), (*f)();
declare a function returning an integer, a function returning a pointer to an integer, a pointer to a function returning an integer;
int *api[10], (*pai)[10];
declare an array of pointers to integers, and a pointer to an array of integers. In all these cases the declaration of a variable resembles its usage in an expression whose type is the one named at the head of the declaration.
The second innovation that most clearly distinguishes C from its predecessors is this fuller type structure and especially its expression in the syntax of declarations.
The syntax of these declarations reflects the observation that i, *pi, and **ppi all yield an int type when used in an expression.
In spite of its difficulties, I believe that the C’s approach to declarations remains plausible, and am comfortable with it; it is a useful unifying principle.
そう言えばこれ(The Development of the C Language)って翻訳されてたりはしないのかな? まあ最後に
Copyright © 2003 Lucent Technologies Inc. All rights reserved.
とあったりするので面倒と言えば面倒。 改めて読み返してみても いろいろ興味深い内容があるんだけどねえ…
- C (programming language) - Wikipedia
- C syntax - Wikipedia
- History of C Language: Timeline, Origin, Basics & Features
- UNIXのCコンパイラ(cとpcc)のソースコード リンク集 #C - Qiita
- KMC Staff Blog:K&R C ができるまで
- C and the AT&T Unix Port – A Personal History
- Unix v6 の C コンパイラが面白かった話 - 兼雑記
- pre K&R Cコンパイラ - Plan9日記
function pointer
もうひとつCの話題
でもコード規約で関数ポインタは必ずデリファレンスして呼び出しなさいってのもあったりするんですよね。あれなんなんだろ。
— mattn (@mattn_jp) March 3, 2024
(*pfn)(1, 2, 3);
たしかANSI以前はそうしないといけなかったんじゃなかったか (で、それを引きずり続けている) >ポインター経由の関数呼び出し
と思ってちょっと調べたら(懐かしの(?)) C FAQ にも載ってた。
4.12:
関数を呼ぶのに、ポインターを通す方法をみたことがある。どうなっ てるの。A: もともとは関数へのポインターは*演算子を使って(かつ優先順位をはっきりさせるためのおまけのかっこを使って) “本物の"関数へ変換しなければならなかった。
int r, func(), (*fp)() = func r = (*fp)();
また以下のように主張することも可能である。関数は常にポインター 経由で起動され"本物の"関数の名前は常にポインターに成り下がる (式の中で、初期化のときと同じ様に。質問1.34参照)から何も問題はない。こういう裏付けがpccを通して広がりANSI規格にも採用された。 すなわち、
r = fp();
はfpが関数の名前でも、関数へのポインターでも正しく問題なく動く (この書き方は始めからあいまいさの入る余地の無いものであった。 関数へのポインターに引数が続いていれば、そのポインターが指している関数を呼ぶしか仕方がないもの)。*を書くことは害がないし、 今まで通り許される(許されるどころか、古いコンパイラとの互換性が重要であれば使うことを勧める)。
質問1.34も参照のこと。
References: K&R1 Sec. 5.12 p. 116; K&R2 Sec. 5.11 p. 120; ANSI Sec. 3.3.2.2; ISO Sec. 6.3.2.2; Rationale Sec. 3.3.2.2; H&S Sec. 5.8 p. 147, Sec. 7.4.3 p. 190.
リファレンスで挙げられている文献に当たる元気はないので誰か頼んだ😄
そういやこの項目、英語版と微妙に内容が違っているような気がするけど、 翻訳の後にアップデートがあったのかな
- comp.lang.c Frequently Asked Questions
- Question 4.12
- CプログラミングFAQ: Cプログラミングのよく尋ねられる質問 (新紀元社情報工学シリーズ) : スティーブ サミット, Summit,Steve, 欽一, 北野: 本
- C Programming Faqs: Frequently Asked Questions: 9780201845198: Summit, Steve: Books
- CFAQを読む - 風で飛んでいくチラ裏
結構いい値段がついてるな>翻訳本
気にする必要はたぶんもうないと思うけど、 K&R時代のCとANSI(あるいはそれ以後)のCの違いはそれなりにあったりする。
- Major differences between ANSI C and K&R C
- ANSI C vs K&R C - Sanfoundry
- What is the difference between K&R and ANSI/ISO (C89) versions of the C programming language? - Quora
- How to write portable clean source code
ついでに ちょっと前にどこかで話題になってたような気もするこれも
history - Why does C use the asterisk for pointers? - Software Engineering Stack Exchange
So following @MichaelT's suggestion, I asked Ken Thompson: From: Ken Thompson < ken@google.com > near on the keyboard: no. c copied from b so & and * are same there. b got * from earlier languages - some assembly, bcpl and i think pl/1. i think that i used & because the name (ampersand) sounds like "address." b was designed to be run with a teletype model 33 teletype. (5 bit baud-o code) so the use of symbols was restricted.
BCPLは’*‘じゃなくて’!‘だし、 PL/Iには該当する演算子あったっけ?
まあそれはそれ。
C is
「いいか、C言語は、この世界でいちばんいい言語だ! いちばんすぐれた言語なんだ!! おれ達には、これしかないんだ! だから、これがいちばんいいんだ!!」
— シャポコ🌵 (@shapoco) March 3, 2024
元ネタがマイナーすぎて伝わってない感ある
— シャポコ🌵 (@shapoco) March 4, 2024
これ解るの、たぶん50代〜70代の松本零士にやられてる世代だけ。 https://t.co/XPccwoR0lS
— ysyk (@yasu010) March 3, 2024
いい言語の前にD言語どこに行ってしまったんだ。
— ケロちゃん-frogman™-@つぼ八 (@frogman_kerocha) March 3, 2024
まぁそんな事はどうDもFか。 https://t.co/JRStxXWE96
現状としてはそうだろうなとは思うものの、高木浩光氏のあれからもう四半世紀。GoなりRustなり、他の言語に置き換わるのはいつになることやら。https://t.co/JcqUAi7uOy https://t.co/9bvLHZvMhh
— odz (@odz) March 5, 2024
僕も【現状は】 C かな。 https://t.co/InOuSaBdEM
— mattn (@mattn_jp) March 4, 2024