2023,江端さんの忘備録

『ロシア大統領を暗殺すればいいのに』というぶっそうな話が、私たち民間人の間で口にされます。

We civilians talk about 'why don't you just assassinate the Russian president?

気持ちは分かるのですが、『ロシア大統領を暗殺した"後"にどうなるか』、の視点が抜けているように思います。

I understand their feelings, but I think they are missing the point of view of what happens after the assassination of the Russian president.

例えば、独裁的な大統領と反目している、民権主義者の国際融和を唱える穏健派で、市民に支持されているような"No.2"がいれば良いです。

For example, there should be a "No. 2" who is a moderate, civil-rights international reconciliation advocate who is opposed to the dictatorial president and who is supported by the public.

しかし、そんな人物、ラインから外されているのは当然でしょうし、下手すれば粛清されています。

However, such a person, it would be natural to be removed from the line, and if he/she should have had to be purged.

あるいは、国内の状況としては、警察または軍隊によって市民が虐殺されていて、独裁者が完全に国民から反目されているという状況が望ましいです。

Alternatively, the domestic situation should be one in which civilians are being slaughtered by the police or army and the dictator is completely turned against the people.

加えて、独裁者は国内で国民によって処刑されるのがベストシナリオです。

In addition, the best scenario is for the dictator to be executed by the people within the country.

ところが、こんな好条件、なかなかあるものではありません。

Such favorable conditions, however, are not easy to realize.

独裁者の暗殺後は ―― 私の知っている限り ―― 内戦、テロで国内死傷者がシャレにならない規模で発生し、ISのような宗教国家の樹立を掲げるやつが跋扈しはじめて、テロが他国に波及します。

After the assassination of a dictator -- as far as I know -- civil wars and terrorist attacks cause domestic casualties on an unprecedented scale, and those who advocate the establishment of a religious state like IS begin to dominate and terrorism spreads to other countries.

とにかく、独裁体制の国家というのは、壊した後のメンテナンスが、恐しく難しいのです。

Anyway, dictatorships are terribly difficult to maintain after they are destroyed.

-----

そもそも、暗殺を含めて、国外からの武力介入は、内政干渉や侵略になります。

In the first place, armed intervention from outside the country, including assassination, constitutes interference in internal affairs and invasion.

現在のウクライナ侵攻も、NATO軍がロシアに攻め込めないのは、上記の大原則があるからです(もちろん、核の脅威もありますが)。

The current invasion of Ukraine is also the reason why NATO forces cannot invade Russia because of the above major principles (and of course, the nuclear threat).

NATOという組織は、この内政干渉や侵略の問題を回避する為に作られた軍事同盟 ―― 『同盟国の一つが攻撃されれば、同盟国全部が攻撃されたとみなす』というものです。

The NATO organization is a military alliance designed to avoid this problem of interference in internal affairs and aggression -- "If one of the allies is attacked, all of the allies are considered to have been attacked.

ちなみに、日米安全保障条約も同じ仕組みです。

Incidentally, the Japan-U.S. Security Treaty has the same structure.

例えば、コロラド州のフォートコリンズが武力攻撃されれば、我が国の自衛隊は同盟国として参戦が"できます"。

For example, if Fort Collins, Colorado is attacked, our Self-Defense Forces, as an ally, "can participate" in the war.

ところが、日本の場合、憲法の規定から、自衛隊は領土防衛以外の目的では、武力行使ができません ―― で、これでは、軍事同盟の意味がないので、なんとかしようとしたものが『集団的自衛権』というやつです(今日はこの話は割愛します)。

『米軍』が絡んできて、そこで始めて『集団的自衛権』が発動するのだから、米軍が何もされていない段階では、自衛隊は、1mmも動けない、が、正論です ―― が、

However, in the case of Japan, the Self-Defense Forces cannot use force for any purpose other than territorial defense under the provisions of the Constitution -- and since this makes no sense for a military alliance, the "right of collective self-defense" was created (I will skip this topic today).

ともあれ、ぶっちゃけ、ウクライナがNATOに加盟する、というのは、ロシアにとっては、悪夢の中でも、最悪の部類の悪夢であるのは確かなのです。

Anyway, to be frank, Ukraine joining NATO is certainly one of the worst of nightmares for Russia.

これについては、BSプレミアム「ロシア 衝突の源流」が、面白かったです。

Regarding this, the BS Premium "Russia: The Origins of the Clash" was interesting.

-----

『北朝鮮の首領を暗殺すればいいのに』も同様です。

The same is true of "Why Don't You Just Assassinate the Head of North Korea?

あそこは地政学的に、めちゃくちゃ面倒な場所にあります。

That place is geopolitically located in a messy place.

ロシアと中国と韓国に接していて、特に中国と韓国は、あの王政社会主義の国を、心底面倒くさいと思っています。

Bordered by Russia, China, and South Korea, China and South Korea in particular find that monarchical socialist country to be a hassle at heart.

米国なんか、何度もあの国に騙されてきましたが、面倒な大国(ロシアと中国)の抑えの役割を果しているので、本気で軍事攻撃しようとはしません。

The U.S. has been fooled by that country many times, but since it serves to keep the troublesome powers (Russia and China) at bay, it will not seriously attempt a military attack.

自棄になられて、ミサイルで米国の本土を攻撃されるくらいなら、今のままの方が良いでしょう。

It would be better to remain as they are now than to become desperate and attack the U.S. mainland with missiles.

-----

『中国の総書記を暗殺すれば』は、もう問答無用でダメです。

'If you assassinate the General Secretary of China' is no longer good enough, no questions asked.

もうこれは、私の想像の斜上はるか上をいく、とんでもない惨劇が待っていると簡単に予想できます。

I can easily predict that this will be a terrible tragedy, far beyond my imagination.

-----

ともあれ、『悪人(但し、私たちの価値基準でですか)を殺害すれば、物事が好転する』というのは、正直ちょっと見積りが甘いんじゃないかな、と思うのです。

Anyway, I honestly think it is a bit naive to estimate that 'killing bad people (but by our standards of value) will turn things around'.

2023,江端さんの忘備録

『膨大な回り道をして、もの凄く小さな真実に辿りつく』 ―― いえいえ、私は、「いい話」をしたい訳ではないのです。

'A huge detour, leading to an awfully small truth.' No, no, I am not trying to tell a "good story".

ここ数日間、慣れない言語(Python)で、機能モジュールを作る為に、ネットで公開されている沢山のプログラムを片っぱしから写経して、成功したり失敗したりを続けてきました。

For the past few days, I have been trying to create a functional module in a language (Python) that I am not familiar with, copying from scratch many programs available on the Internet, with success and failure.

『自分が何をしなければならないか、ようやく気がついた時、それは、非常に小さくて基本的なものであった』

'When I finally realized what I had to do, it was something very small and basic.'

ということって、結構あります。

This is quite often the case.

私は、今、1つの山を越えて、ちょっとホッとしています。

I am a bit relieved now that I have crossed one mountain.

-----

最初から「正解が見える人」もいるかもしれませんが、私はそういう人間ではないようです。

There may be people who can "see the right answer" from the beginning, but I don't seem to be one of those people.

この自分の『低能 & 無能』によって、膨大な時間が消費され続けていますが、『暇を感じる時間はない』というポジティブな考え方もできると思っています。

This 'low & incompetence' of mine continues to consume a huge amount of my time, but I believe I can also think positively that 'I don't have time to feel bored'.

『本当に、意義のない、無駄な人生を生きてきたなぁ』と、つぶやきながら、私は死んでいくつもりです。

-----

ところで、今期から始まった、アニメ「スキップとローファー」のオープニング、いいですね(YouTubeに飛びます)

By the way, I like the opening of the anime "Skip and Loafer," which started this season (jump to YouTube).

主人公の『ポンコツなエリート女子』が、ほのぼのと良いです。

The main character, a "clunky elite girl," is mildly good.

後半のダンスの部分は、実際に踊った人の動きをトレースしたのだろうなぁ、と思います。

I think that the dance part in the latter half must have been traced from the actual dancers.

服の動きが、とてもリアルでいいなぁ、と。

The movement of the clothes is very realistic, I thought.

メイキングの映像も見たいです。

I would like to see a video of the making of the film.

2023,江端さんの技術メモ

結論から先に言うと

json_payload ='{"ID":"M005","Name":"Aya","Class":"C"}'
'"が付いているかどうか、だったというオチでした。

pythonでFastAPIを試す

のように、pythonでFastAPIを使って、外部と内部のインターフェースのテンプレートを作るというのが、目下の課題でした。
多くのサンプルプログラムがあったのですが、私はhttpのGET/POSTができれば十分だったので、他のことは忘れて、そのポイントのみに絞って、ネットを探し回りました。
まずは、FastAPIを受ける側(サーバと言えるのかな)のプログラムは、

Python | FastAPIでAPI作成 ~その6:DELETEでデータ削除 & Pandas活用

を参考(というかコピペ)させて頂きました。

以下のコードを、私の場合はC:\Users\ebata\fastapi4に、index.pyという名前で置きました。
# https://miseruit.com/2022/07/18/post-2939/

from fastapi import FastAPI
from pydantic import BaseModel
import pandas

class Item(BaseModel):
    ID: str
    Name: str
    Class: str

app = FastAPI() #インスタンスを作成

User_list =[
    {"ID":"M001","Name":"Takashi","Class":"A"},
    {"ID":"M002","Name":"Hanako","Class":"A"},
    {"ID":"M003","Name":"Hiroshi","Class":"B"},
    {"ID":"M004","Name":"Kyoko","Class":"B"},
    ]

# joson_normalize関数を用いてJsonデータをDataFrame型に変換します。
df = pandas.json_normalize(User_list)

# Get /Users/ : 全件取得
# Get /Users/{ID} :特定のIDのみ取得
# POST /Users/ :ユーザの登録
# DELETE /Users/{ID} :ユーザの削除

# curl http://localhost:8000/Users/
@app.get("/Users/")
async def users():
    return User_list


# curl http://localhost:8000/Users/M003
@app.get("/Users/{u_id}")
async def users(u_id:str):
    return list(filter(lambda item : item['ID']==u_id, User_list))


# Windowsの場合 
# {"ID":"M005","Name":"Aya","Class":"C"}]を追加する
# curl -X POST -H "accept: application/json" -H "Content-Type: application/json" -d "{\"ID\":\"M005\", \"Name\":\"Aya\", \"Class\":\"C\"}" http://localhost:8000/Users/

@app.post("/Users/")
async def users(user: Item):
    User_list.append({"ID": user.ID,"Name":user.Name,"Class":user.Class})
    return User_list

# curl -X DELETE -H "accept: application/json" http://localhost:8000/Users/M003
@app.delete("/Users/{u_id}")
async def users(u_id:str):
    global df
    df = df.drop(df.index[df["ID"]==u_id])
    return df.to_json(orient='records')
このプログラムは、メモリ上の名簿を検索(GET)、追加(POST)、削除(DELETE)するものです。

C:\Users\ebata\fastapi4> uvicorn index:app --reload

で起動します。
多分、プログラムの方から、「pipでxxxxを入れろ」と文句を言ってきますので、大人しく従います。
プログラム中に記載されている、curlのコマンドを使うとFastAPIの動作を確認できます。
さて、このプログラムで基本動作は確認できますが、基本的にクライアントのプログラムの叩き台がなければ、使えません。モジュールプログラムの中から、curlのコマンドを発行しろというのも乱暴な話です。
ですので、サクッとクライアント(というかFastAPIのアクセス用のテストプログラム)を作成してしまうと思ったのですが、ここで嵌りました。
先ずは、以下のコードをrequest.pyという名前で、C:\Users\ebata\fastapi4に置きました。
(以下のファイルは、動きたてのコードを修正せずに、汚いままで展開しています)
import requests
import json

# テスト
#url = 'https://wp.kobore.net/'
#response = requests.get(url)
#print(response.text)

#print()

print("-----start of get(1)")

# curl http://localhost:8000/Users/ と同じ機能を実施
r = requests.get('http://localhost:8000/Users/')

print(r.url)
print(r.status_code)
print(r.text)
print(r.json())


print("-----end of get(1)")

print()

# curl http://localhost:8000/Users/M003 と同じ機能を実施

print("-----start of get(2)")

r = requests.get('http://localhost:8000/Users/M003')

print(r.url)

print(r.status_code)
print(r.text)
print(r.json())
print("-----end of get(2)")


print()
print("-----start of delete")
# curl -X DELETE -H "accept: application/json" http://localhost:8000/Users/M003と同じ機能を実施
r = requests.delete('http://localhost:8000/Users/M003')

print(r.url)

print(r.status_code)
print(r.text)
print(r.json())

print("-----end of delete")
print()



# curl -X POST -H "accept: application/json" -H "Content-Type: application/json" -d "{\"ID\":\"M005\", \"Name\":\"Aya\", \"Class\":\"C\"}" http://localhost:8000/Users/ と同じ機能を実現
# {"ID":"M005","Name":"Aya","Class":"C"}]を追加する

headers = {'Accept': 'application/json', 'Content-Type': 'application/json'}
json_payload = '{"ID":"M005","Name":"Aya","Class":"C"}'  # ここで100回くらいのパターンを試したぞ

print("headers:",headers)
print("payload:",json_payload)

#r = requests.post('http://localhost:8000/Users/',headers=headers, params=payload)
#r = requests.post('http://localhost:8000/Users/', headers=headers,params=json.loads(payload))
r = requests.post('http://localhost:8000/Users/', headers=headers, data=json_payload)

print(r.url)

print(r.status_code)
print(r.text)
print(r.json())
で、
C:\Users\ebata\fastapi4> python request.py
にて、GETとDELETEは問題なくサクっと動いたのですが、POSTだけが思うように動かない
{'detail': [{'loc': ['body'], 'msg': 'value is not a valid dict', 'type': 'type_error.dict'}]}
{"detail":[{"loc":["body"],"msg":"field required","type":"value_error.missing"}]}
エラー番号422
やらが、ワラワラと出てきて、頭を抱えました。
色々検索して調べると『こうやればいい』というアドバイスだけして、サンプルコード(1行で足る)を残さない奴が、世界中には山ほどいます(アドバイスではなく、コードを残して欲しい)。
のコードを真似て、ようやく動かすことができました(本当に助かりました)。
とりあえず、これでサーバとクライアントの対(つい)が完成し、実プログラムに展開できる準備ができたと思います。

以上

2023,江端さんの忘備録

嫁さんが家に戻ってきました ―― 家の中の空気が流れ出したような気がします。

My wife is back home -- I feel like the air in the house has started to flow.

こういう話を嫁さんにすると『私は家政婦か』と文句を言われるのですが、そういうことではないのです。

When I talk to my wife about these things, she complains, 'Am I a housekeeper?

家の中で話ができる相手がいるというのは、やっぱり良いものです。

It is still nice to have someone to talk to in the house.

もし嫁さんが先に逝き、私が「孤立」すると、空気が止った家の中での生活がずっと続くことになる ―― と考えると、結構怖いです。

If my wife passes away first and I am "isolated", I will be living in a house with the air stopped for a long time -- which is pretty scary.

それでも、嫁さんよりは私の方が「孤立」には耐性があるように思います。

Still, I think I am more tolerant of "isolation" than my wife.

嫁さんからの依頼事項『嫁さんより長生きをする』を実施すべく、酒、たばこ、女、博打、「全て"なし"」にして、人生を実施中です。

In order to fulfill my wife's request, "I will live longer than my wife," I am now living my life "without" alcohol, cigarettes, women, gambling, and everything else.

-----

江端:「『遊ぶ金が欲しくて、強盗した』というニュースを聞くことがあるけど、訳が分からないんだよな」

Ebata: "Sometimes we hear on the news that people 'wanted money to play with, so they robbed people,' but I don't understand the reason."

嫁さん:「そう?」

Wife: "Really?"

江端:「遊ばなければいいじゃんか」

Ebata: "Why don't they just not play?"

嫁さん:「じゃあ、何をしてればいいの」

Wife: "Well, what should they do?"

江端:「勉強」

Ebata: "Study"

と言ったら、嫁さんが大爆笑していました。

When I said this, my wife burst out laughing.

24時間いつでもディズニーランド

----

江端:「コーディングしたり、コラム書いたり、特許のアイデア考えたり、やることなんて、山ほどあるじゃん?」

Ebata: "There are so many things to do, like coding, writing columns, coming up with ideas for patents, etc."

嫁さん:「じゃあ、強盗犯のところにいって『なんで、"遊ぶ"のではなくて、"コーディング"しなかったの?』って聞いてみたらどうかな?」

Wife: "Well, why don't you go to the robbers and ask them, 'Why didn't you "code" instead of "play"?'

2023,江端さんの忘備録

今年度から新しいチームに所属することになりました。

I am now a member of a new team this year.

このチームには、オフィシャル言語が英語(母国語は別)の方が何人か入っています。

The team includes several people whose official language is English (not their native language).

このチームでは、全員が普通に英語をしゃべっている、というのも驚いているのですが、それ以上に、新しいコミュニケーション形態に、驚いている ―― というか、驚愕しています。

I am surprised that everyone on this team speaks English normally, but more than that, I am surprised -- or rather, astonished -- by the new form of communication.

―― 2言語同時使用コミュニケーション

"Bilingual Simultaneous Use Communication"

日本語ネイティブの人は日本語をしゃべり、英語オフィシャルの人は英語をしゃべり、そして、

Native Japanese speakers speak Japanese, English officials speak English, and

『ほぼ完璧にコミュニケーションが成立している』

"Almost perfect communication"

ということです。

has been completed.

-----

『目から鱗(うろこ)』とは、こういうことですね。

This is what "eye-opnening" means.

『ヒアリングは大丈夫でも、スピーキングに難あり』というケースは多くあります(その逆は、ほとんど"ない"と思っています)。

There are many cases in which a person can speak well but has difficulty speaking (I believe the opposite is almost never the case).

私たちの目的は、英語を使うことでも、日本語を使うことではなく、『コミュニケーション』です。

Our goal is not to use English or Japanese, but 'communication'.

その目的が達成できるのであれば、そのアプローチは、何だって構わないのです。

The approach can be anything, as long as that objective can be achieved.

もちろん、その為には、相互に日本語と英語の"ヒアリング"は前提になりますが、逆に言えば"ヒアリング"だけで十分なのです。

Of course, this requires mutual "hearing" between Japanese and English, but conversely, "hearing" alone is enough.

正直に申し上げて、

To be honest, I am stunned by the fact

―― 私(江端)は、このやり方に辿りつけなかった

"I (Ebata) did not come to this way"

ということに、呆然としています。

-----

そう言えば、『英語は理解できるが、上手くしゃべれない』という日本人は、山ほど見てきました。

Come to think of it, I have seen a lot of Japanese who say, 'I can hear English, but I can't speak it well'.

また、国外の人であっても、『日本語は理解できるが、上手くしゃべれない』という人も、確かに沢山いました。

There were also certainly many people, even from outside Japan, who said, 'I can hear Japanese, but I can't speak it well.

だから、このやり方を気がつくべきだったのですが、私(たち)の『英語至上主義』の考え方が、この発想を妨げてきた、と思います。

So, I should have realized this approach, but I think that our (our) 'English supremacy' mindset has prevented us from thinking this way.

先日、大学で留学生から、「大学の守衛門で、建物を聞いたら、腕で×印をされて、『私は大学の学生ではない』と言われた」という話を聞いて ―― 私(江端)がキレました。

-----

この方式は、

This method is, neither,

『日本にいるなら日本語を使え』

"If you're in Japan, use Japanese"

nor

『英語はデフォルト言語だ』

"English is the default language"

のどちらでもない、新しいパラダイムです。

This is a new paradigm.

そして、この方法は、次世代の「あるべき」新しいコミュニケーション形態として広がっていくことが重要必要ではないか、と思います。

And I think it is important to expand this method as a new form of communication that "should" exist in the next generation.

皆さんのチームで、この運用をされていましたら、どんどん発信して頂きたいです。

If your team has this operation, we would like you to keep sending it out.

2023,江端さんの忘備録

私には「基本的に他人を理解しよう」という気持ちはありません。最初から諦めています。

I have no desire to "basically understand others". I have given up from the beginning.

「諦める」は、ネガティブな意味で使われることが多いですが、私は、多様性のある共生社会の為には、「諦める」ことが大切だと思っています。

Although "give up" is often used in a negative sense, I believe it is important to "give up" for a diverse and symbiotic society.

上記につきましては、私の「江端さんのひとりごと 「壁」」をご一読頂ければ幸いです。

I would appreciate it if you could read my article "Mr.Ebata's Small Talk "Wall"" for more information on the above.

-----

先日の現職首相に対するテロ事件に関する、犯人の動機がぼちぼちと明かになっているようですが、

The motive of the perpetrators of the recent terrorist attack on the incumbent prime minister seems to be slowly coming to light, however, to be honest, the followig is my impression.

―― 1mmも理解できん

"I don't understand him at all"

が、正直な感想です。

私は、ずっと昔から、テロ事件の犯人に対して、『何をどうしたら、そういう思想に至り、そしてそういう行動になるのか』と考えてきました。

For a long time now, I have been asking myself, 'What could have led to such a thought and such an action against the perpetrators of terrorist attacks?"

その『?』のリストのトップにるのが、日本赤軍の「テルアビブ空港乱射事件」です。

私、この週末に、「超法的措置」の法的根拠を、かなり真剣に探しました

At the top of the list is the "Tel Aviv Airport Shooting" by the JRA.

-----

最近では、SNSが小集団化して、カルト化してテロリストになっています。

Recently, social networking sites have become small groups, cults and terrorists.

このコラムの2ページ目をご一読下さい。

Please read page 2 of this column.

-----

で、今や、我が国におけるテロは、SNSカルトによる小集団テロを経て、今や、個人テロという単位に至っております。

So now, terrorism in our country has gone through small group terrorism by social networking cults and has now reached the unit of individual terrorism.

そして、このような個人テロを生み出す原因は、『孤独・孤立化』であることは、ほぼ確定でしょう。

And it is almost certain that the cause of such individual terrorism is 'loneliness and isolation'.

特に今回のテロ事件の動機は、『リアルな社会で、他者とコミュニケーションができていれば、あっと言う間に飛散してしまうような稚拙で幼稚な動機』 ―― であるように見えます(もう少し見てからまとめたいです)。

In particular, the motive for this terrorist attack appears to be 'a poor and childish motive that would fly away in a flash if we were in a real society and able to communicate with others' -- (I'd like to summarize after seeing a few more).

私は、孤独の負の側面についても、論じてきました。

I have also discussed the negative aspects of loneliness

-----

長くなってしまったので、纏めます。

It has been a long time coming, so I will summarize.

(1)「私は他人は理解できない」

(1) "I don't understand others."

(2)「いわんや、テロリストの思考は全く理解できない」

(2) "I don't understand the thinking of terrorists at all, so to speak."

(3)「個人テロリストの思考は、コミュニケーション程度で壊せる程度の稚拙なものが多い」

(3) "Many of the thoughts of individual terrorists are so poorly thought out that they can be broken only by a degree of communication."

(4)「それ故、個人テトリストを発生させている主要因は『孤独』であると考えられる」

(4) "Hence, 'loneliness' appears to be the primary factor generating the individual tet list."

『孤独』というのは、それ自体が悪いのは言うまでもないとして、これを放置すれば、私たちがテロの被害者になる可能性があるという点においても悪いのです。

'Loneliness' is bad in its own right, not to mention bad in that if left unchecked, we could become victims of terrorism.

-----

では、その『孤独』問題は、誰が引き起こしているのか ―― もちろん、その本人です。

So who is causing the "loneliness" problem - the person oneself, of course.

しかし、これを『個人の問題』であると突き放せば、これからも『個人テロ』は続くはずです。

However, if we dismiss this as a 'personal problem', then 'personal terrorism' will continue.

それは、私(たち)にとって、望ましいことではありません。

That is not desirable for us.

孤独は、本人のプライバシーを踏み躙っても、潰す必要があるのかもしれません。

Loneliness may need to be crushed, even if it oversteps the person's privacy.

-----

今、私が辿りついた一つの案が、あの、太平洋戦争中の「隣組」制度の導入です。

One idea I have now arrived at is the introduction of that "Tonari Gumi" system during the Pacific War.

―― 営業時間外酒類提供をしている店舗の密告制度の導入

『嫌な考えに辿りついてしまったなぁ』と、ちょっと後悔しています。

I'm a little regretful that I've got at this unpleasant idea.

なぜなら、"孤独"派の私は、その政策に抵抗するサイドに立っているからです。

I am on the side of the "solitary", and I am on the side of resistance to that policy.

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

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

以上