2013,江端さんの忘備録

10月に部署を異動したのですが、異動先の共有ルームに「ニューズウィーク日本版」が陳列されていたので、毎日読んでいます。

Last October, I moved to another section, and I found "Newsweek (in Japanese edition) " in the shared area. I read the past issues every day.

-----

「ニューズウィーク」には苦い思い出があります。

I have a bitter memory about "Newsweek".

大学入学直後、新しい希望に溢れていた私は、どの大学生とも違わず「これからは英語が大切だ」と思い込んでいました。

After entering the college, I was a new fresh student in the full of hope, and I believed that I had to study English very hard.

そして、無謀にも「ニューズウィーク(×日本版)」の年間定期購読を申し込んでしまいました。

Recklessly, I admitted the annual subscription of "Newsweek (in English edition)".

結果は言うまでもありません。

It went without saying that the result.

一ページも開かれない「ニューズウィーク」が、床に詰み上げられただけでした。

Many Newsweek not be opened at all had been stacked on the floor.

そして、このような「自分の能力を客観的に把握できない」「無謀な希望に満ちた若者を狙った」英語商法は、今なお健在です。

Now the business like that, is going strong, that targets young guys who cannot grasp their English performances by themselves, and are full of reckless hope.

営業から見れば、私なんぞ、笑いが止まらない「カモ」ですよね。

I had been a top of the sucker list, and the sales reprehensive had not be able to stop laughing.

会社員になってからも、社員寮の玄関に、英字新聞が配達されているのを見ると、「ああ、ここにも『カモ』になった新入社員が・・・」と思ったものです。

After joining the company, whenever I found English-language newspaper in my co-worker's post in the dormitory, I was afraid that the victim was in here.

最近は同じような商法を、日本経済新聞などがやっていますよね。CMで大々的に。

Now some economy newspaper company did some business using commercial messages.

まあ、それはさておき。

-----

で、そこから30年近い時間を経て、ようやく「カモ」から卒業した私は、「ニューズウィーク日本版」を日本語で読んでいます。

After about 30 years ago, I was graduated from the sucker list and read "Newsweek in Japanese edition" everyday.

私が「ニューズウィーク(×日本版)」を読めなかった理由の99%の理由は、その能力の欠如ですが、仮に能力があったとしても無駄だったろうと、今になって思います。

Though I know the reason why I couldn't read the magazine was the luck of my English performance, even if I had the performance, the result was same.

―― 内容がつまらん。

"Bored"

「米国大統領の動向」「米国の経済」「中東情勢」「テロ」、こんなネタが、私にとって面白いものである訳がない。

Am I interested in "U.S. president current", "Economy in the U.S", "Middle East situation" and "terror attack" ?

そもそも、コンテンツが私向きではなかったのです。

First of all, the contents were not suitable for me.

コンピュータ、制御LAN、GPSというような記事であれば、英語でも踏ん張ったかもしれませんが、大学生の頃の私であれば、それすらも読まなかったでしょう。

Though "computer", "control network", "GPS" might catch me, it was also meaningless for me in campus life.

-----

このような英語雑誌等の「カモ」商法。当然批判されるべきものですが、それを言い出すことができる人がいないところに、この商法の巧さがあります。

This sucker list business should be criticized violently, but none of them accuse the business.

でも、どこかにいないかな。

Whoever tries to accuse the company, with saying,

―― お前のところの雑誌、私には一行も読めんぞ!

"I can't read just one line in your magazine."?

と文句を言えるクレーマ。

2019,江端さんの忘備録

十数年前、私はフィールド(屋外)での無線を使った実証実験システムで、開発チームのリーダをやっていました。

About ten years ago, I was a development team leader of an experimental system in an outdoor field.

その時、

At that time,

―― 屋外実験において、無線通信に手を出してはならない

"I never touch "wireless communication" in any outdoor experiment.

というフレーズを自らの人生訓としました。

has been my motto.

■設置場所によって通信に失敗し、

- communications were going down in some quarters,

■原因不明のシステム障害が発生し、

- some unknown system failures happened,

■飛んでいる電波の電文内容が読めなくなる、

- broken characters were inserted in communication messages

して、システム障害の要件を特定できないからです。

Anyway I could not fix the reason for the system failures of "wireless"

-----

無線は非常に役に立つものです。

I know that "wireless" is useful.

それはスマホを見れば明らかです。

It's clear if you look at your smartphone.

しかし、それは、キャリア(通信インフラ会社)が、

However, this is a result that carries(telephone companies) have invested some resources about

■10年に及ぶ期間と、

- more than ten years,

■万の単位の技術者と、

- tens of thousands of engineers,

■兆の単位のお金と、

- some trillion yen of money,

を投入した結果のものです。

数週間程度の期間と、数人のエンジニアを投入しただけのシステムとは、投入コストが違います。

The input cost is different from a cost of several weeks and only a few engineers.

-----

―― 屋外実験において、無線通信に手を出してはならない

"I never touch "wireless communication" in any outdoor experiment.

私の人生の三大教訓の一つであったはずの、こんな大切なことを、なぜ、私は、忘れてしまったのだろうか?

Why have I forgotten such an important thing that should have been one of the three lessons of my life?

今、私は、大型ディスプレイに表示された、カーネルパニックの表示内容(内容は意味不明)の前で、ただ青冷めながら、呆然と立ちすくんでいます。

Now, I'm standing stunningly pale in front of the large display that shows kernel panic messages (I don't understand the content).

(ちなみに、江端家のセキュリティシステムは、「無線を絶対的に信じない」という思想の上に成り立っています)

(By the way, the security system of the Ebatas is based on the idea of "never believing in radio absolutely")

2023,江端さんの忘備録

技術は日進月歩 ―― それは分かっているのですが。

"Technology is constantly advancing", I know it well.

このアンテナが15年前にあれば、私の仕事(実証実験)はどれだけ楽だっただろうか、と。

I wonder how much easier my work (demonstration) would have been if this antenna had been around 15 years ago.

屋外実験において、無線通信に手を出してはならない

電波のルートを確保する為に、雨の中、デパート屋上での、体を張った決死のアンテナ設置工事など、走馬灯のように思い浮んできます。

I can still recall the desperate, physically demanding installation of antennas on the roof of a department store in the rain in order to secure a route for the radio waves.

これと同程度の性能のアンテナを自作する為に、勉強したりもしていました。

I even studied to build my own antenna with the same level of performance as this one.

え? 電波法ですか? すみません、エンジニアなので、法律面は素人でして。

What? The Radio Law? Sorry, I am an engineer, so I am a layman in the legal side.

-----

私(たち)のあの苦労は一体何だったのだろうか ―― と考えると虚しいものがあります。

I wonder what all those hardships I (we) went through were all about -- it's a very empty feeling.

以前、20年待てば、誰でも『現時点と同じ性能のスパコン』が手に入るというお話をしました。

I mentioned before that if we wait 20 years, anyone can get a "supercomputer with the same performance as at present".

なるほど、『私たちは、みんな、20年前のスパコンを使っている』ことになる訳です。

ならば、私(たち)は『20年後に解決することが決っている技術課題』の為に、闘ってきたのだろうか、と。

If so, I wonder if I (we) have been fighting for the sake of "technological issues that will be solved in 20 years.

-----

せめて、

At least,

―― 私たちの辛く厳しい実証実験は、その20年間の技術を進歩させるための必要な犠牲であった

-- Our painful and severe demonstrations were a necessary sacrifice to advance the technology over those 20 years.

と、でも思い込まないと、やってられません。

If I didn't think so, I wouldn't be doing it.

2023,江端さんの忘備録

最近、FastAPIについて勉強をしていました。

Recently, I was learning about FastAPI.

で、最初の入門書と言われているWebサイトを読み直してみました。

So I re-read the Web site that is supposed to be the first introductory book.

実に分かりやすく、素晴しい入門書だ、

This is a very clear and excellent introduction to the subject,

―― と、今なら思えます。

-- I can see it now.

入門書というのは、"入門を終えた人"が後からふりかえると、よい復習にはなるが、それ以上のものではない。

An introductory book is a good review for those who have completed the introductory course, but it is not much more than that.

何が言いたいかというと、

What I'm trying to say is, the fact of

『ほとんどの入門書は、入門者にとっては、ただの"ゴミ"』

"Most introductory books are just "garbage" for beginners"

という事実です。

-----

結局私は、FastAPIを、YouTubeに教えてもらいました。

Eventually, about FastAPI, YouTube taught me how to use it.

講師と全く同じ環境にして、全く同じ手順を、画面を止めたり、巻き戻したりしながら、自分の手と目と頭でやりながら、やっと、一番最初の理解に辿りつきました。

I finally arrived at the very first understanding by putting myself in the same environment as the instructor and going through the same steps, stopping and rewinding the screen, using my hands, eyes, and mind.

『FastAPIが何をするものかも分からない状態で、YouTubeの画面と同じこと実施した』が『最適解』だった、ということです。

The best solution was to do the same thing as on the YouTube screen without knowing what FastAPI does.

-----

という訳で、これも再三言っていることですが、

This is why I have repeated this,

『基礎が大事』というのは、多くのケースでウソです。

"It is a lie in many cases that 'fundamentals matter'"

すでに理解してしまった人が執筆した入門書が、本当の入門者に理解できる訳がない。

There is no way that a real beginner can understand an introductory book written by someone who already understands.

バックグランドが全然違うのですから。

The backgrounds are completely different.

『基礎が大切』がウソであることは、私の経験では、英語、プログラム、数学、量子力学、制御システム、少子化問題、年金問題・・・、ほとんど全部ですね。

It's my experience that 'fundamentals matter' is a lie: English, programming, math, quantum mechanics, control systems, fertility issues, pension issues... almost everything.

私の経験から言えることは、『始めてしまうことがが大事』です。

From my experience, I can say that 'getting started is the key.

もっと端的に言えば、『突っ込んでいくことが大事』です。

To put it more simply, 'it's important to go in.

訳が分からないまま、小さい失敗と成功を繰り返しながら、膨大な時間を使って、ほんの小さなゴールに辿りついた時

When you reach a small goal after spending a great deal of time repeating small failures and successes without understanding the reason...

―― その時、初めて「入門書」は役に立つのです。

-- Only then "the introductory book" will be useful.

-----

『何事も基礎が大切』という大人がいたら ―― その大人のことは、信じなくてもいいです。絶対に、です。

2023,江端さんの忘備録

本日は、コラムがリリースされましたので、お休みです。

Today's diary is taken off, as the new column has been released.

Don't be afraid of ChatGPT - Use it up and make it easy!

ある日突然登場し、またたく間に世間を席巻した生成AI「ChatGPT」。

ChatGPT, a generative AI, appeared one day out of the blue and quickly took the world by storm.

今や、ネットでその名を聞かない日はないほどです。

Nowadays, there is not a day that goes by that we do not hear its name on the Internet.

このChatGPTとは、一体何なのか。

What exactly is this ChatGPT?

既に数百回以上、ChatGPTを使い倒している筆者が、ChatGPTの所感をエンジニア視点で語ってみたいと思います。

The author, who has already used ChatGPT more than several hundred times, would like to talk about his impressions of ChatGPT from an engineer's point of view.

2023,江端さんの忘備録

私の土日は、貴重なワークデーです。

My weekend is an important workday.

下手すると、普通のウィークデーよりも、やることが多かったりします。

Moreover, on the weekend, I am busier than on weekdays.

メールやチャットや打ち合わせがない分、作業が捗るとも言えます。

I can say that I work better because I don't have to get emails, chats, and meetings.

で、その疲れが、月曜日にくる、と ―― 本末転倒と言えます。

So, the tiredness comes on every Monday -- it's a real downer.

-----

ただ、土日は、やらなければならないことの中でも、やりたいことからやっています ―― ダラダラと。

However, I work on what I want to do first, among what I have to do.

ですので、まあ、生産性が上がっているかは不明です。

So, I doubt if my productivity is increasing.

そもそも、「生産性」の意味が不明ですが。

To begin with, no one seems to be able to define "productivity" itself.

-----

日本人的な考え方では、

From the viewpoint of the nationality of Japanese,

『"楽しい"と感じる仕事には、生産性がない』

"Works we feel enjoy are not productive"

『"苦しい"と感じる仕事には、生産性がある』

"Works we feel pain are productive"

と捉えられているのかなぁ、と感じることがあります。

I sometimes think about the above.

私が楽しくやっている仕事は、ちゃんとカウントされていないような気がするからです。

Because I think that "my work I can feel enjoy" seems to be not counted as work.

-----

―― その"生産性"を上げるのは、"私以外の誰か"で良くね?

 

未分類

意外と簡単なVS Codeの環境移行

を参考にさせていただき、引越し準備中。

環境移行に必要なフォルダ

下の2つのフォルダを,古いPCから(USBメモリ等)に退避させ,新しいPCで同じ場所に置いてあげるだけ.

  • ~/.vscode( Windows : C:\Users\100323XX\.vscode ) ディレクトリ
    • このディレクトリの中にプラグインのファイルが入ってたりします.
    • 20230516.vscode.zip で退避
  • ~/.config/Code/User( Windows : C:\Users\100323XX\AppData\Roaming\Code\User ) ディレクトリ
    • このディレクトリの中に基本設定やキーコンフィグが入ってたりします.
    • 20230516User.ssh.zip で退避

これに加えて、

  • ~/.ssh( Windows : C:\Users\100323XX\ ) ディレクトリ
    • sshに必要な情報一式
    • 20230516.ssh.zip で退避

以上

2023,江端さんの技術メモ

FASTAPIを使ってPOSTでファイルを送り込む方法

 main.py

import uvicorn
from fastapi import FastAPI, File, UploadFile

import shutil
import os

app = FastAPI()

@app.post("/files/")
async def file(file: bytes = File(...)):
    content = file.decode('utf-8')
    formatfile = content.split('\n')
    return {'filedetail': formatfile}

@app.post("/uploadfile/")
async def upload_file(file: UploadFile = File(...)):
    if file:
        filename = file.filename
        fileobj = file.file
        #UPLOAD_DIR = os.getcwd() 
        #print(UPLOAD_DIR)
        #upload_dir = open(os.path.join(UPLOAD_DIR, filename),'wb+')
        upload_dir = open(os.path.join("C:\\Users\\ebata\\fastapi6\\", filename),'wb+')
        shutil.copyfileobj(fileobj, upload_dir)
        upload_dir.close()
        return {"アップロードファイル名": filename}
    return {"Error": "アップロードファイルが見つかりません。"}



'''
@app.post("/uploadfile/")
async def upload_file(file: UploadFile = File(...)):
    return {'filename': file.filename}
'''

で、

> uvicorn main:app --reload

でAPIサーバを起動する。

request.py

import requests
import json

# curl -X POST http://127.0.0.1:8000/uploadfile/ -H 'accept: application/json' -H 'Content-Type: multipart/form-data' -F file=@dummy.txt;type=text/plain と同じ機能を実現
# C:\Users\ebata>curl -X POST http://127.0.0.1:8000/uploadfile/  -F file=@dummy.txt;type=text/plain とすれば、エラーメッセージは出てこない

url = 'http://localhost:8000/uploadfile/'

# headers = {'Accept': 'application/json', 'Content-Type': 'application/json'} //失敗
# headers = {'Accept': 'application/json', 'Content-Type': 'text/html'} # 失敗
headers = {'Accept': 'application/json'} # 成功

# file_payload = {'file=@dummy.txt;type=text/plain'} # 失敗
file_payload = {'file':open('data/dummy1.csv','rb')} # 成功  ファイルはdataというフォルダを掘って、dummy1.csv という名前のファイルを放り込んでおく

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

# r = requests.post('http://localhost:8000/uploadfile/', headers=headers,files=file_payload) # 成功
r = requests.post(url, headers=headers,files=file_payload) # 成功

print("--->1:", r.url)
print("--->2:",r.status_code)
print("--->3:",r.text)
print("--->4:",r.json())

>python requests.py

でクライアント起動。

以上

2019,江端さんの忘備録

私は、文章を書くのが好きなのですが、「文章の書き方」のようなものを、人に説明することができません。

I like to write sentences, but I can't explain to people how to write sentences.

もちろん、『テクニカルライティング』のようなメソッドについては、語ることはできます。

Of course, I can talk about methods like "technical writing".

しかし、『コラム』のようなものをどうやって書くと問われると、答えることができません。

But no matter how you write something like a column, I can't answer.

-----

私は、コラムの挿絵(イラスト)も自分で作成しています。

I also draw a column illustration (illustration) by myself.

しかし、私のイラストは、他の人のコンテンツを真似して、それらを均(なら)しているだけのものです。

But my illustrations are just imitating other people's content and merging them.

ですから、私は「自分で絵を描いている」とは思っていません。

So I don't think I'm drawing myself.

-----

そもそも私は、「イラストの書き方」という教本の内容を理解することができません。

First of all, I cannot understand the content of the textbook “How to draw Illustrations”.

「イラストの書き方」なる本は、『頭の中にあるイメージを紙の上に表現できる人間の存在』を前提として説明されています。

The book "How to draw Illustrations" is explained on the premise of "a human being who can express the image in his head on paper".

なぜ、そのような才能が「前提」とされているのか?

Why is such a talent considered a "premise"?

「イラストの書き方」の執筆者は、

The author of "How to draw illustrations" think that

『世の中のほとんどの人は、そのような才能が全ての人間に"デフォルト(初期設定)"として備わっている』

"Most people in the world have such a talent as a "default" for every human being."

と思っているからです。

-----

―― 冗談ではありません

"No kidding"

私が、エンジニアリング手法を使って、必死にそれらしいイラストを「作って(×描いて)」いるのに ――

Though I'm desperately "making (not drawing)" such an illustration using engineering techniques,

そんな特殊な才能を"デフォルト"とされては、敵(なか)いません。

I cannot be helped that such a special talent is regarded as "default".

-----

絵を描ける人は、自分の才能を「前提」としてアドバイスをします。

A person who can draw a picture will give someone advice based on his talent as a "premise".

英語が使い熟せる人は、自分の才能を「普通」としてアドバイスをします。

A person who can use English will give someone advice based on his talent as an "ordinary".

彼らに悪意はありません。

They are not malicious.

故に、彼らは、平気で「毎日の練習」だの「継続は力」だの「努力は報われる」だのと言い放ちます。

Therefore, they are confident that they are "everyday practice", "continuation is power" and "effort is rewarded".

そして、そのような才能を持っていない人は、才能を持っている人の「前提」と「普通」に苦しめられます。

And those who do not have such talents suffer from the "premise" and "ordinary" of those who have talents.

-----

私は、再三

I have said many times that

―― 努力は天才に勝てない

"Effort cannot win over genius"

―― 努力に負ける程度の天才は、天才の名に価しない

"A genius who loses his efforts is not worthy of "genius""

と、言い続けてきました。

仮に、あなたが、天才の費す時間の100倍の時間をかけて、天才を越えたとしても、

Even if you spend 100 times the time that a genius spends and you can overcome a genius,

天才は、あなたの1/100の力で、たちまち、あなたを「ぶっちぎり」ます。

the genius will "break" you with your 1 / 100th power.

-----

才能と闘ってはなりません。

Don't fight against talent.

それは、あなたを不幸にするだけです。

It only makes you unhappy.

そのようなプロセスなしに、あなたを幸せにする方法は、

The way to make you happy without such a process is

"To be crazy"

この一択しかありません。

There is only one choice.

2023,江端さんの忘備録

以前、制御LANについての連載をしていました。

Previously, I had serial columns about control LAN.

photo

多くの制御LANでは、マスター/スレーブ方式という方法が採用されています。

Many control LANs employ a master/slave method.

これは、複数の機器や装置、ソフトウェア、システムなどが連携して動作する際に、一つが管理・制御する側、残りが制御される側、という役割分担を行う方式です。

In this method, when multiple devices, equipment, software, systems, etc. work in cooperation, one of them is the side that manages and controls, and the other is the side that is controlled.

制御する側を「マスター」、される側を「スレーブ」といいます。

The controlling side is called the "master" and the controlled side is called the "slave".

英語圏では、この「主人と奴隷」という言葉を宛てることの是非をめぐる論争がしばしば起こっているようです。

In the English-speaking world, there seems to be a lot of controversy over whether to use the words "master and slave".

"制御屋"としての私としては、この論争には違和感しか感じません。

As a "controller engineer" myself, I find this controversy only discomfort.

名古屋の名物「味噌煮込みうどん」を『脳機能に障害を持つ人に対する差別語』と騒ぐような、奇妙に感じる話です。

It's a strange story like Nagoya's specialty "Miso Nikomi Udon" being called "a discriminatory term for people with brain disorders."

この「味噌煮込みうどん」の話、本当の話です。興味のある人はググってみて下さい。

This "Miso Nikomi Udon" is a true story. If you are interested, please google it.

それはさておき。

That aside.

-----

「プライマリー/セカンダリー」「プライマリー/レプリカ」「ペアレント/チャイルド」「マネージャー/ワーカー」などの代替用語が提案されているようですが ――

It seems that alternative terms such as "primary/secondary", "primary/replica", "parent/child" and "manager/worker" have been proposed.

私の提案は、

My proposal is

「マスター/メイド」

"Master/Maid"

の一択です。

That's my only choice.