2023,江端さんの忘備録

嫁さんが、義母の介護の為に、一週間ほど帰省しています。

My wife is returning home for a week to care for my mother-in-law.

という訳で、当然ながら、普段、嫁さんがやってくれている家事を、自分でやっています。

So, naturally, I am doing the housework that my wife usually does for me.

-----

ところで、私、海外出張をする時も、服は下着3セットを基準に、荷物を最小限にして、荷物は機内持ち込みのみにしています。

By the way, when I go on overseas business trips, I also minimize my luggage based on three sets of underwear as my standard of clothing, and only carry-on luggage.

ロストバゲージが怖いからです。

Because I am afraid of lost baggage.

海外旅行時の、私の下着の洗濯は、極めて簡単です。

When traveling abroad, washing my underwear is extremely easy.

下着を湯船に突っ込んで、下着と一緒に入浴します。

Plunge my underwear into the bathtub and take a bath together with my underwear.

でもって、下着を石鹸で洗います ―― そんでもって、下着で、体を洗っています。

And then I wash my underwear with soap -- and then I wash my body with my underwear.

下着と私のどちらが汚れているかと言われれば、私の体の方に決っていますので、これは合理的なWin-Winと言えます。

If you ask whichi is dirtier, my underwear or me, it is my body, so this is a reasonable win-win.

あとは、下着を絞って、浴槽または部屋に干しておけば終了です。

Then, wring out the underwear and hang them in the bathtub or room to dry. That's all.

2日間も干しておけば、下着は乾きます。

After two days of drying, the underwear will be dry.

ゆえに、下着は3セットあれば十分なのです。

Hence, three sets of underwear are sufficient.

これは、余計な水も使わず、最短時間で行える『SDGs的洗濯』です。

This is "SDG-style laundry" that can be done in the shortest amount of time without using extra water.

-----

この他、

In addition to the above,

- 腐りそうになった食材は、すべてカレーに突っ込んで食べ切る

- All ingredients that are about to go bad are plunged into the curry and eaten up.

- 三角コーナーの生ゴミは、冷凍庫に凍らせておき、纏めてゴミの日に出す

- Freeze food scraps in the freezer and put them out on garbage day.

など、各種のノウハウがあります。

Various types of expertise, such as above.

これは、6年間の学生時代の下宿生活で取得したものです。

These were acquired during six years of student boarding and lodging.

-----

嫁さんと私の間には、娘との結婚を希望する者(性別を問わず)に対して一つの暗黙的ルールがあります。

My wife and I have one unspoken rule for anyone (regardless of gender) who wishes to marry our daughter.

『一人暮らしを、ちゃんと成立させてきた実績があること』です。

The first is "to have a proven track record of establishing a one-person household".

自立して生活もできんような生活無能力者に、娘を渡せない ―― と思っていたのですが、最近、驚愕の事実を知りました。

We thought, "we can't give my daughter to a person who is incapable of living independently," but recently I learned a startling fact.

何年も一人暮らしをしているのにも関わらず、自炊一つできない奴(男)がいたことを知りました。

I learned that there was a guy (man) who lived alone for years but could not cook a single meal for himself.

彼は『鳥と豚と牛の肉の違いも分からん』と無邪気に語っていましたが ―― はっきりいって、それ『マザコン』や『ロリコン』以上にヤバい。

He innocently said, "I don't even know the difference between chicken, pork, and beef meat" -- clearly, that's worse than "mother's boy " or "pedophile".

例えば、幼児や小学生の女児がいるような家に、頻繁に独身の男がやってくるのを、歓迎する親がいると思うか?

正直言って『恐しいカミングアウトだ』と思いました。

To be honest, I thought, 'This is a horrible coming out.

------

私、近年の非婚率の上昇に対して、自分なりのいくつかの見解を示してきました。

I have offered several views of my own on the recent rise in the rate of nonmarriage.

―― 『結婚の価値、良さ、メリット』を、若者に対して言語化できない、私(たち)の無能

そして、今だに『結婚というシステムを前提とした出産』などという、タルいことを言い続けていれば ―― 『ゼロエミッション』は、二酸化酸素より先に、人口の方で、簡単に実現されてしまうでしょう。

―― 課題先進国(少子化、非婚化、高齢化)である我が国を、世界中が見守っています。

しかし、上記のような『生活能力の欠如』も、その大きな要因の一つであると痛感しました。

However, I keenly felt that the 'lack of life skills' mentioned above was alson one of the major factors.

2023,江端さんの忘備録

―― プレゼンを見れば、モテるヤツかどうかは、一発で分かる

"I can tell if you are popular or not by your presentation"

という私の主張は、最近、学生さん達の発表(プレゼン)を見ることで、さらに確信が深まっています。

My assertion has been further confirmed by watching a student's presentation recently.

-----

- 暗記もせずに、しゃべるセリフを用紙に印刷してきて、それを読み上げているだけ

- They don't even memorize their phrases, just print out and read them out loud.

- 投影された資料の記載を、そのまま読んでいるだけ

- Thye are just reading the description of the projected papers as it is.

- 資料に図面がない

- No drawings in the papers.

- 説明にめりはりがない

- Explanation lacks verisimilitude.

要するに、聞き手に対して自分の主張ができておらず、そして、聞き手の理解を助けようという努力もしていない、ということです。

In short, they are not making their case to their listeners, and they are not making any effort to help them understand.

そんなヤツ、モテる訳がない ―― と、思う。

I don't think such a guy would be popular.

-----

という話を、以前娘にして、さんざん批判されたので、この辺で止めておきます。

I have told this story to my daughter before, and she criticized me a lot, so I will stop here.

長女:「さっきから、パパの偉そうな物言いに、本気でムカムカしていたからさぁ。いやーすっきりした! ありがとう、! これで、気分よく眠れるわぁ」

2023,江端さんの忘備録

「陰謀やテロリズムでは、けっきょくのところ歴史の流れを逆行させることはできない。だが、停滞させることはできる」
(創元SF文庫「銀河英雄伝説」7巻 284Pより)

"Conspiracies and terrorism cannot, after all, reverse the course of history. But they can stall it."(From "The Legend of the Galactic Heroes," Sogen SF Bunko, vol. 7, p. 284)

という、ヤン提督の言葉は、長期的に見た時には、正しいのかもしれません。

Admiral Yang may be right in the long run.

しかし、私たちが生きている間の短い時間においては、そうでもないように見えることがあります。

In the short time we are alive, however, this may not appear to be the case.

-----

まず、少なくとも私たちの国家は、法律によって、いかなる形の暴力も容認しないことになっております。

First, at least our state, by law, does not tolerate violence in any form.

(法によって定められた組織 ―― 暴力装置(警察、自衛隊) ―― によって、詳細かつ厳格にコントロールされた暴力を除きます)

(except for violence that is detailed and strictly controlled by an organization defined by law -- a violent apparatus (police, Self-Defense Forces))

法治国家である我が国においては、いかなるテロリズムも許されません。

In our country, which is governed by the rule of law, terrorism of any kind will not be tolerated.

-----

しかし、テロによって、問題がクローズアップされることがあります。

However, terrorism can bring the issue to the forefront.

『"元首相の殺害テロ事件"と"統一協会"』は、典型的な例でしょう。

The "terrorist murder of the former prime minister" and the "Unification Association" are typical examples.

この『統一協会』問題は、私が最初に知った時から、実に40年間も動かなかったのに、あのテロ事件を契機として一気に動き出しました。

This "Unification Association" issue had been inactive for 40 years since I first learned about it, but the terrorist attack was the catalyst that set it all in motion.

そして、多分、今回がラストチャンスです ―― 最近、この問題に対する世間の注目度が落ちてきているようで、私はとても心配しています。

And maybe this is the last time -- I am very concerned that public attention to this issue seems to be waning lately.

今回の統一地方選挙で、この『統一協会問題』が争点にならなかった(ように見える)ことに、私はショックを受けています。

I am shocked that this "Unification Association issue" was not (seemingly) an issue in the current local elections.

それはさておき。

Aside from that.

-----

最近、また、現職首相を狙ったテロ事件が発生しました。

Recently, another terrorist attack targeted the incumbent prime minister.

犯行動機については、まだ明らかになっていません。

The motive for the crime is not yet clear.

しかし、少なくとも、テロの犯人は『自分の主張を社会に押しつけることができた』という一点においては、その目的を達成している訳です。

However, at least in one respect, the perpetrators of the terrorist attacks have achieved their goal: He has been able to impose their point of view on society.

こういう現実を見ると、ブログで主張を繰り返しているだけの自分(江端)が、バカバカしくなってしまいます。

These realities make me (Ebata) feel foolish for just repeating my assertions on my blog.

そして、私のように考える人間は、私以外にも結構多いのではないか、と思うのです。

And I think that there are quite a few people who think like I do, besides me.

『SNSでは炎上程度でしかない。街頭デモをしてもニュースにもならない。ニュースになるだけの賛同者を得るカリスマもロジックも弁舌も、私にはない』と考える人間が、

A person who think that "I just can make a flame on SNS. Even if I demonstrate in the streets, it won't make the news. I don't have the charisma, logic, or oratory skills to get enough supporters to make the news", come to think

―― 結局のところ、要人テロが一番てっとり早い

"After all, terrorism of dignitaries is the fastest way"

と考えるのは、まあ、普通に考えて、普通だと思うのです。

I think it is, well, normal to think that.

-----

昔、先輩に『原則として、自爆テロを防ぐ方法はない』と教えて貰ったことがあります。

I had a senior colleague once tell me, 'In principle, there is no way to prevent suicide bombers.

―― 政治、宗教、野球、恋愛については、人と議論してはならない

残念ながら、私には、これを解決する方法を思いつけません。

Unfortunately, I can't think of a solution to this.

2023,江端さんの技術メモ

一回纏めて再学習

FastAPI入門https://zenn.dev/sh0nk/books/537bb028709ab9/viewer/f1b6fc

パラメタの違い

  • パスパラメタ   http://127.0.0.1:8000/items/3
  • クエリパラメタ http://127.0.0.1:8000/items/?skip=0&limit=10
  • リクエストボディ ???

環境構築

 pip install fastapi

pip install sqlalchemy uvicorn

を実施。途中でpythonのバージョンアップしろと言われたので、素直に従いました。

run.py (サーバ立ち上げ用)
urls.py (URLのルーティング用)
controllers.py (レスポンス処理用)
を作りましたが、以下のエラーが出てきました。

> python run.py
Traceback (most recent call last):
  File "run.py", line 1, in <module>
    from urls import app
  File "C:\Users\ebata\fastapi\urls.py", line 1, in <module>
    from controllers import *
  File "C:\Users\ebata\fastapi\controllers.py", line 3, in <module>
    app = FastAPI(
NameError: name 'FastAPI' is not defined

さて、python環境構築の経験もなく、python使うの数年ぶり、ということで、まあ、「ご挨拶」でしょう。

試しに、 https://wp.kobore.net/江端さんの技術メモ/post-7450/ を入れて実行してみたとこ、ちゃんと動くようなので、環境側の問題 と特定しました。

ーーーー

PS C:\Users\ebata\fastapi> uvicorn main:app --reload
ERROR: Error loading ASGI app. Attribute "app" not found in module "m

が出てきたので、いろいろ調べたら、なんとプログラムがセーブされていなかったという間抜けなオチでした。

実施した(履修した)ページ

現時点までの実施事項(続き)

https://fastapi.tiangolo.com/ja/tutorial/body/ の、「クエリパラメータ」まで履修完了。續きは、「リクエストボディ」から。

現在、履修に使っているホルダは、~/fastapi, ~/fasapi2

所感

外部インタフェースについては、Webや他の手段でAPIを叩くことができると思うが、モジュール間の関数にfastapiを使うことは可能だろうか。

原理的には、curl等で送り込めばば、何でも可能と思うが、相互通信を考えるとwebsocketを剥き出しにした方がよいのではないだろうか?

ちなみに、FastAPIでPostgresqlのDBアクセスをやろうと思ったけど、

$ pip install psycopg2

がどうしてもインストールできずに、断念(くやしい)

以上

2023,江端さんの忘備録

私は、高度経済成長期の日本(の後半)と、その後の凋落を観測し続けてきました。

I have continued to observe Japan (in the second half of its high economic growth period) and its subsequent decline.

特に、オイルショック(1973年)あたりの物価の高騰については、子どもながら『何かとんでもないことが起こっているんだ』と実感したものです。

In particular, the sharp rise in prices around the oil crisis (1973) made me realize, even as a child, that something terrible was happening.

 

 

それでも、『なんとなく、そのように感覚していた』というレベルを越えません。

Still, it does not go beyond the level of 'somehow I had a sense of it that way.

-----

今、私は、物価高を『実感』として感じています。

I am now 'really feeling' the high prices.

- トーストのパンが小さい

- Toast bread is small.

- ほうれんそうの値段の乱高下が激しい

- The price of spinach is wildly fluctuating.

- 長ネギ、玉ネギが手に入らないことが多い

- Onions and leeks are often unavailable

- 最近、『鶏モモ』ではなく『ささみ』ばかりを食べている

- Lately, I have been eating only "white meat" instead of "chicken thighs".

-----

という訳で、私、新しいダイエットを提唱してみたいと思います。

Therefore I would like to advocate a new diet.

―― インフレダイエット

"Inflation diet"

世界経済と連動する"ダイエット"としては、多分、世界初ではないかと自負しています。

I am proud to say that this is probably the first "diet" in the world that is linked to the global economy.

さあ、反論のある奴は、かかってこい。

 

2023,江端さんの忘備録

私たちは、多様性を認めなければならない世界に生きていますが、多様性を個人が理解するというのは難しく、社会が認めるのはさらに難しいです。

We live in a world that must recognize diversity, but it is difficult for individuals to understand diversity, and even more difficult for society to recognize it.

マイノリティーの人々は、世間の無理解に対する根気強い、長期間(四半世紀から100年オーダ)の闘いが必要となります。

Minorities will need a persistent, long-term (quarter century to century order) struggle against public incomprehension.

しかし、個人が(×社会が)多様性を認める手っ取り早い方法があります。

However, there is a quick way for individuals (x society) to recognize diversity.

マイノリティの当事者になることです。

It is to be a minority party.

-----

仕事の出張帰りの新幹線の中、3席シートの通路側に座っていた時のことです。

I was sitting on the aisle side of a three-seat seat on the Shinkansen bullet train on my way home from a business trip.

窓際の席に座っている、私と同程度の年齢のごっつい風体の男性が、数枚のスナップ写真を熱心に見ていました。

A burly-looking man about my age, seated by the window, was looking intently at several snapshots.

私がトイレに立ったとき、たまたま、その写真が目に入りました。

When I stood up to use the restroom, I happened to see that picture.

それは、その男性とアイドルコスチュームで装ったティーン風の女の子が、笑顔で一緒に写っている写真でした。

It was a picture of the man and a teen-like girl dressed in an idol costume, smiling together.

女の子がアイドルコスチュームさえ着ていなければ、明らかに親子、という感じの写真でした。

If only the girls weren't wearing idol costumes, they were clearly parent and child.

『新幹線に乗って、アイドルを追っかけるおっさん』というのは、もはや珍しい存在ではありません ―― アニメとか小説の中では。

The "old man on a bullet train, chasing after idols" is no longer an uncommon existence -- in anime and novels in my mind.

しかし、現実に生身の人間を見ると、ちょっとビックリというかビビってしまう ―― これは、私の人間としての器の小ささと言えましょう。

However, when I see a live person in real life, I am a bit surprised or scared -- this is my small human capacity, I guess you could say.

アイドルとのツーショットのスナップ写真を眺める中年から初老の男性を、一月に1回見るくらいの頻度があれば、私も「引く」ことはなくなると思うのですが。

If I could see a middle-aged to early-aged man looking at snapshots of himself with his idols once a month, I would not "put off" as often.

しかし、それには、これからも長い時間が必要になるだろう、と思いました。

But it will take a long time from now, I thought.

-----

で、思ったんですよ。

And I thought that,

この多様性を理解するためには、私自身が『アイドルの追っかけ』に参入しなければならない、と。

In order to understand this diversity, I have to enter the "idol chase" myself.

というわけで、一応、人生のToDoリストには入れているのですが、現時点では、そのリストの最下位くらいです。

So, in a nutshell, I have it on my to-do list for life, but at this point, it is about at the bottom of that list.

『"紅天女"なんぞに、どれだけのコストと時間をかけているんだ?』と

2023,江端さんの技術メモ

package main

import (
	"fmt"
)

// (1)
var m = make(map[int]int)  // (2)をコメントアウトするならこっちを使う

func main() {

	// (2)
	//m := map[int]int{} // (1)をコメントアウトするならこっちを使う

	m[3124] = 9
	m[1992] = 2
	m[2020] = 3

	// キーのみ取り出す
	for key := range m {
		fmt.Println(key)
	}

	//3124
	//1992
	//2020

	fmt.Println()

	// キーと値
	for key, value := range m {
		fmt.Println(key, value)
	}
	fmt.Println()

	//1992 2
	//2020 3
	//3124 9

	// 値のみ必要な場合
	for _, value := range m {
		fmt.Println(value)
	}

	//9
	//2
	//3

	fmt.Println()

	// ループの回数を数える
	i := 0
	for key, value := range m {
		fmt.Println(key, value)
		i++
	}

	//3124 9
	//1992 2
	//2020 3

	fmt.Println()
	fmt.Println("delete(m, 1992)")
	delete(m, 1992)
	for key, value := range m {
		fmt.Println(key, value)
	}

	//delete(m, 1992)
	//2020 3
	//3124 9


	fmt.Println()
	fmt.Println("add as m[2999] = 2")
	m[2999] = 2
	for key, value := range m {
		fmt.Println(key, value)
	}

	//add as m[2999] = 2
	//3124 9
	//2999 2
	//2020 3

	_, ok := m[100]
	if ok {
		fmt.Println("OK")
	} else {
		fmt.Println("NG")
	}

	// NG

	_, ok = m[2999]
	if ok {
		fmt.Println("OK")
	} else {
		fmt.Println("NG")
	}

	// OK

	fmt.Println(m)
	// map[2020:3 2999:2 3124:9]

	m[2020]++

	fmt.Println(m)
	// map[2020:4 2999:2 3124:9]



}

2023,江端さんの技術メモ

問題

現在、192.168.0.23/postgresにアクセスを確認

で、A5:SQL Mk-2は接続成功している様子

だが、publicの下の「テーブル」「ビュー」などを叩いても何も出てこない。

念のためpgAdAdmin4 で試してみたが、こちらも問題なし

解決(T研究所のKさんに教えて貰いました)

『データベースを登録する際に、データベース名に「agent_db」 を指定していただく必要があります』

 

参考文献

https://izit-infobox.net/blog/2021/07/15/a5sql-mk-2/

2023,江端さんの技術メモ

研究室の学生さんたちに負荷テストに協力してもらっています。

今、"cannot parse invalid wire-format data" のエラーでGTFS_HUBのダウンを確認しました。

PrumeMobileの方は、そのままにして、GTFS_HUBの再起動をかけました。

(以下、後日対応)

2023,江端さんの忘備録

最近、この問題でずっと困っていました。

Recently, I have been in trouble about this problem.

repeated read on failed websocket connection (一応解決)

金曜日の日深夜(正確には土曜日の未明)に『これで動くはず』というコードを仕込んで、動くことを祈りながら、床につきました。

Last Friday midnight(early Saturday morning to be precise), I completed the code that "should be worked" I expected and went to bed.

あの時点で、プログラムを走らせたら、そのデバッグに取り組み始めて、完全に徹夜作業になって、結果として、体調を崩すという確信があったからです。

If I would try to execute the program, I should have started debugging for all night, and I confirmed that I was convinced that I would get sick.

ですから、土曜日の朝、2箇所程度の修正で動いた時は、本当に嬉しかった。

Therefore, I was very happy that I confirmed the program worked well with just two modifications.

このプログラムを、AWS(正確には、廉価版AWSであるAmazon Lightsail)にアップして稼動実験を続けていました。

I uploaded this program to AWS (correctly, Amazon Lightsail, a low-cost version of AWS) and continued the test run.

取り敢えず、サーバ稼動することが確認できxたので、月曜日に同僚やゼミ生に協力して貰って、負荷テストをしたいと思っています。

Anyway, I could confirm that this program is working as a server, I am going to ask my workers and students to do the test run.

-----

このサーバ化は、実は仕事でもなく、単に興味でやっています。

The reason I am trying to make the server, is not for work but for my interest.

誰に命じられたという訳でもなく、私の直感が『将来、これでラクできる』と言っているだけですが。

No one ordered me to do that, it is just that my intuition is telling me "this wil make my work easier in the future"