2022/11,江端さんの忘備録

今週末は、終日コーディングをしていました ―― 仕事が山ほどたまっていまして。

This weekend, I was coding all day long -- because I had a lot of work.

で、ついさっき、ようやく、某中国地方の都市に、100人の観光客と、100人の地元民のエージェントを作るプログラムを完成させました。

So, just a few minutes ago, I finally completed a program to create 100 tourists and 100 local agents in a city in Japan.

もちろん、「作れること」は分かっていたのですが、実際に作るとなると、色々思い出さなければならないことが多くて、予想以上の時間がかかりました。

Of course, I knew that I could "make it," but when it came to actually making it, I had to remember a lot of things, and it took longer than expected.

-----

で、ほっとして、リビングに降りて行ったところ、嫁さんが録画したテレビ番組を見ていました。

So, relieved, I went down to the living room and found my wife watching a TV program she had recorded.

私は、その番組を20秒ほど見て、書斎に直帰しました ―― せっかくテレビを見ている嫁さんに、いらんことを言いそうになったからです。

I watched the program for about 20 seconds and went straight back to the study -- because I was about to say something unwanted to my wife who was watching TV.

そのドラマは、『ゲーム制作の現場』を題材としているようなのですが、そのプログラム開発の現場の設定が、あまりにも「ありえなさ過ぎた」からです。

The drama seems to be based on a "game production site," but the setting of the program development site was too "improbable".

■みすみすサイバー攻撃を許すプログラム開発現場(×システム運用現場)は『素人の寄せ集め』としか思えないし、

- The program development site (x system operation site) that allows cyber-attacks to go unchecked can only be thought of as a "bunch of idiots," and

■バックアップなんぞ、2重、3重にかけるのは当然だし、クラウドにバラしておくのは常識だし、

- It's common sense to double or triple backups, and to keep them in the cloud, and

■プログラムが「データの設計図」などという、ビックリ仰天の解釈を聞いたことがない

- I've never heard such a startling interpretation of a program as a "data blueprint"!

ですが、それらについて、色々つっこむのは、大人げないじゃないですか。

However, it is not mature to poke a lot of questions about them.

―― 考証が甘いとか、そういう話じゃないんだ。これは、ドラマの視聴者に分かりやすくする為に、敢えて、こういうベタな設定をしているんだ

"I'm not talking about the lack of archaeological evidence or anything like that. This is just a goofy setup that I'm daring to use in order to make it easier for drama viewers to understand"

と思っています。

I believe that this is a good idea.

ですが、これは、逆に言うと、世間様の「プログラム開発の知識」とはこの程度である、ということを示してもいます。

However, this also indicates, conversely, that this is the level of "knowledge of program development" among the general public.

-----

正直、ぞっとしました。

Frankly, I was horrified.

私は、コラムで偉そうに、内政や外交や軍事について、論じていますが ―― 基本的に、私は素人です。

I discuss domestic politics, foreign policy, and military affairs in my columns in a pompous manner -- basically, I'm an amateur.

内政や外交や軍事の業務に、リアルタイムで関わっている、官僚や政治家や公務員(自衛隊員や消防隊員)の人の知識や知見に、対抗できる訳がありません。

There is no way I can compete with the knowledge and expertise of bureaucrats, politicians, and civil servants (Self Defense Force members and firefighters) who are involved in domestic, diplomatic, and military affairs in real time.

でも、私のコラムに対して『ド素人! 引っ込んでいろ!!』というようなコメントを、私は一度も受けたことはありません。

But in response to my column, I have never received such a comment, like "Amateur!" or "Stay out of it!"

-----

実は、私は、このテレビドラマ程度の知見しかないにも関わらず、内政や外交や軍事物事を論じていて、

Actually, I might have discussed domestic policy, foreign policy, and military things, despite having only this TV drama level of knowledge.

そして、フロントの方々から

And from the people at the front field,

―― まあ、しょせん、素人の言うことだからね

"Well, after all, he(Ebata) is just an amateur isn't he?"

という、生暖かい目で見逃されて続けていたのかもしれない ―― そう考えると、心底、怖くなってきたのです。

I was afraid that I might have continued to be overlooked by the warm-hearted eyes. When I thought about it, I became truly frightened.

『お前(江端)の意見なんぞ、世の中を1mmも動かしていない』

"Your (Ebata's) opinion doesn't move the world even one millimeter"

と、誰かに言われていると思うだけで、私は、床の上で転げ回りたくなるほど、恥しいのです。

Just the thought of someone saying that to me is so embarrassing that I want to roll around on the floor.

2022/11,江端さんの技術メモ

以前、

円周内の一様乱数

から、乱数の生成を作ることができました。

現在、斜め45度くらいに述びた街の位置情報を乱数で作る為に、楕円周内の一様乱数を調べていたのですが、見つけられていません。

累積密度関数が一様になるように計算式を作れば良い、ということは分かったのですが、そんなの面倒くさくてやっていられません。

ふと思ったのですが、円周内の一様乱数ではθとr を使って、乱数を使っていて、この場合、r=sqrt(乱数)を使っているのだから、θの値に応じた新しいr'を作ってそのまま放り込んでやればいいのでは、と思いつきました。

面倒なので、x軸方向の長さは1.0として、y軸方向の長さをbとすれば、

x=cosθ 、 y=b sinθ となるので、r'= sqrt(x^2+y^2) に放り込むだけ、上記の円周内の一様乱数と同じやり方でできるんじゃないの、と考えて、エクセルで試しました。ここではb=0.5にしています。

結論:上手くいきませんでした。

もう面倒くさくなったので、r' に sqrt(0~1)の乱数を使って、x=cosθ 、 y=b sinθ に乗算するだめの「なんちゃって楕円内の一様乱数」 を作って対応しました。

こんな感じです。

// 住民の居住区を計算
		shita := 2.0 * 3.141592654 * rand.Float64()
		x := 0.03296 * math.Cos(shita)
		y := 0.01893 * math.Sin(shita)
		r := math.Sqrt(rand.Float64())
		rx := r * x
		ry := r * y
		// 45度回転 + 基本座標
		x_map := 1.0/math.Sqrt(2.0)*(rx-ry) + 131.46231887576513
		y_map := 1.0/math.Sqrt(2.0)*(rx+ry) + 34.171317284454766

「ここは主戦場でなない」と腹を括って、逃げるのも、エンジニアには必須の技量です。

2022/11,江端さんの忘備録

エネルギー(石油)の9割を頼っている国に対して、こちらから宣戦布告をして戦争をしかけた国は、どーこだ?

Which country declared war on a country that relies on them for 90% of its energy (oil)?

答えは、ウチ(日本)です。

The answer is "Japan".

1941年に、日本から米国に戦争をしかけました。

In 1941, Japan launched a war against the United States.

ちなみに、当時の国力比は50(米国):1(日本)です。

The ratio of national power at that time was 50 (U.S.):1 (Japan).

-----

私が言いたいのは、

What I'm trying to say is,

『戦争は、それがどんなに不合理なものであったとしても、始まる時には始まる』

'War, however irrational it may be, begins when it begins.'

という事実と、多くの場合

and, in many cases

『戦争は、どっちかが、壊滅と言える状態になるまで、止めることができない』

A war cannot be stopped until one side or the other is in a state of what might be called devastation."

という歴史的事実です。

This was a historical fact.

これについては、『4つの"if"と、1つの"might"で、開戦に踏み切った日本』こちらもご一読下さい。

For more on this, please read "Japan's Decision to Start War with Four "Ifs" and One "Might"" here.

『太平洋戦争と同じような状況になれば、歴史の教訓があろうがなかろうが、私たちは再び開戦してしまう』

他の事例に関しては知りませんが、国家間の戦争に関しては、歴史の教訓とは、『歴史の教訓は生かされない』ということのようです。

I don't know about other cases, but it seems that when it comes to wars between nations, a lesson of history is that 'lessons of history are useless'.

-----

今回のロシアのウクライナ侵略に関して、ロシアと日本の間について、私は分からないことが多いのです。

There are many things I do not understand about the relationship between Russia and Japan regarding this Russian invasion of Ukraine.

その中でも、私は、ロシアと我が国のエネルギー問題がよく分かっていません。

I am not familiar with the energy issues between Russia and our country.

「サハリン1」「サハリン2」というプロジェクトです。

For example, the projects called "Sakhalin 1" and "Sakhalin 2."

日本は、アジアの中にあって、西側自由主義陣営の旗手の役割を担って、ロシアに対してシャレにならないレベルの経済制裁をしています。

Japan, in its role as the standard-bearer of the Western liberal camp in Asia, is imposing an unprecedented level of economic sanctions against Russia.

で、普通に考えれば、ロシアが、その報復として、『日本へのエネルギー輸出を完全に止める』ということは(契約とか、国際法上の違法行為とか、国際的慣例とか、キッパリ無視するのであれば)、理に叶っていますよね。

So, it would make sense for Russia to "completely stop energy exports to Japan" in retaliation (if they completely disregard contracts, illegal acts under international law, international conventions, etc.).

1941年の米国の日本への石油輸出禁止措置だって、民間レベルで見れば、完全な契約違反行為だったと思いますが、国家権力に対してエネルギー民間企業ごときが、太刀打ちできる訳ありません。

Even the U.S. oil export ban on Japan in 1941 was a complete breach of contract on the private level. However, there is no way that a private energy company can compete with the power of the state.

そもそも、ロシアへの、WIPOの最恵国待遇の撤回の話が、今、どうなっているのかもよく分かりません。

To begin with, I am not even sure what is going on right now with the withdrawal of WIPO's MFN status to Russia.

「最恵国待遇の『撤回』」って、どの条文を適用するんだっけ?

-----

この辺の事情について、江端に簡易に説明して頂ける方からのメールを、お待ちしております。

I am looking forward to receiving an e-mail from anyone who can provide a simple explanation of this situation to Ebata.

頂いたネタが江端のハートをキャッチすれば、即、コラムで採用させて頂きたいと思います。

If the stories I receive catch Ebata's heart, I would like to immediately adopt them in our column.

もちろん、ネタ元の秘密は、がっちり守ります。

Of course, we will keep the source of the story confidential.

「江端ファイアウォール」とは

2022/11,江端さんの忘備録

今、私は、大学の講義で座学を受けているのですが、今さらながら『勉強って、こんなにも面白かったんだ』を実感しています。

I am currently taking a classroom lecture at a university, and after all this time, I realize that 'studying was so much fun'.

『はあ? 今頃、何言ってんだ?』という声が聞こえてきそうです。

I can almost hear you saying 'Huh? What are you talking about now?'

しかし、社会人研究員を長くやってきて、日々とりあえず必要な知識を取り込んで、使える道具(計算方法や手法)はなんでも使ってきたという日々にあって、

However, after working as a researcher for a long time, I have been taking in the necessary knowledge and using whatever tools (calculation methods and techniques) are available to me on a daily basis.

「体系化された学問」を「体系的に教わる」

"Systematic study" is given "in a systematic way"

ということの、素晴しさ(というか、美しさ)を実感しています。

I realize how wonderful (or rather, how beautiful) it is to be able to do this.

―― この素晴しさや、美しさを、現役の大学生に実感して貰うのは、難しいだろうなぁ・・・

"It will be difficult for current college students to appreciate the beauty and splendor of this place..."

と思ってしまいます。

I thought that.

もちろん、"それ"を理解できる現役の大学生もいるとは思いますが、ついつい、そう思ってしまうのは『シニアの思い込み』ってやつでしょうか?

Of course, there are still some current college students who can understand "it", but is it "senior people's assumption" that makes me think so?

-----

問題は、講義が"英語"で行われていることです ――当然「英語に愛されないエンジニア」である私には、その内容は理解できません。

The problem is that the lectures are given in "English" - of course, as an "engineer who does not love English", I cannot understand the content at all.

となると、もはや、英語の理解は諦めて、講義の内容を徹底的な予習で対抗するしかありません。

Then, it is no longer a matter of giving up on understanding English and countering the lecture content with thorough preparation.

で、今の私が使い倒しているのが、"YouTube"です。

And now I am using "YouTube".

"YouTube"で提供されている講義も、やっぱり英語なのですが、とりあえず、何でもいいので聞きまくって、書きまくって、なんとか『理解したような気になれる』までがんばっています。

The lectures on "YouTube" are also in English, but I am trying to listen to whatever I can, and write about it, until I somehow "feel like I understand it".

私が、お世話になっているのは、インドのある大学が提供している大学講座です。

I use the lecture offered by one of the universities in India.

現実の数字を使った例題が実践的で、本当に助かっています。

The examples with real-life numbers are practical and really helpful.

講義のビデオを途中で止めて、戻して、印刷して ―― その大学講座を使い倒しています。

I stop the lecture video in the middle of a lecture, put it back, print it out -- I am running them out.

これだけ潤沢な講座が、YouTubeに溢れているのは、間違いなく『リモート講義』であり ―― 「これも、コロナ禍のおかげだろうな」と思っています。

It is definitely the "remote lectures" that have flooded YouTube with such an abundance of courses -- "I think this is also thanks to the Corona disaster.

-----

シニアの学徒としては、『リアルな座学って、もう、いらなくない?』と思ってしまうのですよ。

As a senior academic, I'm thinking, 'Don't we need real classroom learning anymore?' I think.

2022/11,江端さんの忘備録

以前、スーパー銭湯のサウナのテレビで「笑点」を見たのですが、その『つまらなさ』に愕然としました。

I once watched "Shouten" on TV in the sauna of a public bathhouse and was astonished at how "boring" it was.

特に、下ネタ回りの使い回しが下品というか『汚ない』。

In particular, the use of the lower part of the story is "vulgar". Moreover it was 'dirty'.

「古い」、「時代外れ」、コンプライアンス的にも『もう扱えないネタ』を平気で使って、それに気がついてもいない ――

They are not afraid to use "old," "out of date," and "out of compliance" material, and they don't even realize it.

私は見るに耐えず、サウナ室から出てしまいました。

I could not bear to look and left the sauna room.

この日の放送が、たまたま、こういう悪い巡り合わせだったのかもしれません。

Perhaps this day's broadcast just happened to be such a bad turn of events.

とは言え、これが「古い」のだとしても、私の年令的にはマッチしているはずです。

Nevertheless, even if this is "old", it should match my age.

そんな風に考えていったら、これは「笑点」が原因ではなくて、受容体としての私の問題かもしれないなぁ、とも思えました。

When I thought about it that way, it occurred to me that this might not be because of the "Shouten", but rather my problem as a receptive person.

-----

「サザエさん」もそうですね。

The same goes for "Sazae-san."

私は、全く見なくなりましたし、子どもに見せたくないと思いました。

I stopped watching them altogether and didn't want my children to see them.

教育的上、良くないと思いまして。

I thought it would not be good from an educational standpoint.

少なくとも、私は、あの家族を規範にしたくないのです。

At the very least, I don't want to make that family the norm in my family.

-----

あのサザエさん的家族態様が、もの凄く有効に働いた時代は、確かにあったのです。

There was certainly a time when the Sazae-san style of family structure worked extremely well.

『実質経済成長率10%、19年間連続達成』という、脅威の成長率を叩き出したのは「サザエさん的家族態様」であることは間違いありません。

There is no doubt that it is the "Sazae-san-like family attitude" that has led to the threatened growth rate of "10% real economic growth rate, achieved for 19 consecutive years.

ただ、その態様は、今の時代には良くない ―― というか『害悪』とさえ思えます。

However, the attitude is not good for the current era -- or even "harmful"

私の中では、このような価値観を強固に主張していた個人の一人が『故 安倍元首相』であり、それを強固に主張し続けている宗教団体が『旧称 統一教会』です。

In my mind, one of the individuals who firmly asserted these values was the "late former Prime Minister Abe" and the religious group that continues to firmly assert them is the "former name of Unification Church".

もちろん、我が国には『思想・良心の自由(憲法19条)』があり、『信教の自由(同20条)』があり、どのような考え方も、自由であるべきです。

Of course, Japan has "freedom of thought and conscience (Article 19 of the Constitution)" and "freedom of religion (Article 20)," and any way of thinking should be free.

常識外れの献金をさせて、個人やその家族を破滅に追いやって、なお『宗教法人』を名乗り、その利権を最大限利用する ―― てなことをしない限りは、ですが。

As long as it is an individual or a corporation that does not make unorthodox donations, ruin individuals and their families, and still call itself a "religious corporation" and make maximum use of its interests.

ちょっと脱線しました。

I digress a bit.

-----

「笑点」に笑えず、「サザエさん」に嫌悪感を感じる ――

Not laughing at "Shouten" and feeling disgusted by "Sazae-san" --

このような私の受容体は、私自身を不幸にしているかもしれんなぁ、と思うことがあります。

I sometimes wonder if these receptors of mine might be making me unhappy with myself.

2022/11,江端さんの忘備録

投資詐欺による被害が、後を断たないようです。

There seems to be no end to the damage caused by investment fraud.

江端:「投資詐欺を防止するかなり有効な手段は、高校の時にならっているはずの『等比級数』なんだけどな」

Ebata: "A fairly effective means of preventing investment fraud is the 'equi-proportional series,' which you should have learned in high school."

次女:「そんなの、覚えてないよ」

Daughter: "I don't remember that."

江端:「『指数関数』でも、いいんだけどな」

Ebata: "'Exponential function' would be fine."

(投資詐欺に関しては、確率、期待値、標準偏差あたりの方が有効だ、と、今気がつきました)

(I just realized that probability, expected value, and standard deviation are more valid for investment fraud.)

嫁さん:「それが、『投資詐欺と結びつく』と気がつく人は、ほとんどいないと思う」

Wife: "I don't think most people realize that it's 'tied to an investment scam.'"

江端:「うん。だから数学の授業で『投資セミナーの例題を使って、等比級数と指数関数を教えれば、一石二鳥だ』と、昔から、ずっと言い続けているんだけど ―― 文部科学省って、バカなの?」

Ebata: "Yes. That's why I've been saying for a long, long time, 'If you use the examples from the investment seminar to teach equi-proportional series and exponential functions, you kill two birds with one stone' in math class--is the MEXT stupid?"

-----

久々に、家族全員から「その通りだ!」という賛同を得られました。

My whole family shouted "You're right!"

-----

まあ、詐欺の被害者になったことがある私が語るのも、おこがましいとは思いますが。

Well, I know I am not proper to talk about this, as I have been a victim of fraud before.

2022/11,江端さんの忘備録

持ち歩ける軽量のデスクトップPCが欲しい ―― てなことを、以前書きました。

I have written before about wanting a lightweight desktop PC that I can carry around with me.

ITの仕事の種類も知らずに『フリーアドレス』を主張している奴って、

買ってしまいました。

I bought it.

本当に本当に痛い出費でしたが、フリーアドレスのパソコンはセキュリティの観点から怖くて使えないし、これからのフリーアドレスで「ガチのコーディング」をする為にも、避けられない出費と腹を括りました。

It was a really, really painful expense, but I was afraid to use a free-address computer for security reasons, and I was determined to make it an unavoidable expense in order to do "serious coding" with a free-address from now on.

とは言え、お金を使うのであれば、PC以外のものにしたかったです。

Having said that, if I was going to spend money, I wanted it to be something other than PC.

ラズパイもPCとしてカウントするなら、我が家には10台近くのPCがあることになります。

If I count Raspberry Pi as a PC, then I have almost 10 PCs in our house.

-----

PCというのは『生もの』で、3年もすれば使いものになりません。

A PC is a "raw product" and will be useless after three years.

例えば、昨日のゼミでは、iPadのバックアップとして持ってきたノートPCが、全く使いものにならず、あやうくせっかく準備したプレゼンが台無しになるところでした。

For example, in yesterday's seminar, the laptop I brought as a backup for my iPad was completely useless, and I almost ruined the presentation I had prepared.

もっとも、古いOSとアプリを使い続ければ、もちろん100年だって使えます。

But of course, if I keep using the old OS and apps, I can use them for even 100 years.

でも、ここに、Officeを入れて、Teamsを入れて、VSCodeを入れて、Rを入れて、Dockerを入れて、SAIを入れて・・・てなことをやっていれば、当然にPCは使えなくなる訳です。

But if I install Office, Teams, VSCode, R, Docker, SAI, and so on, my PC will naturally become unusable.

-----

―― ノートPCのエディタで文章が書ければ、それだけで良い

"As long as I can write in my laptop's editor, that's all that matters"

という、世界であれば、私は、10台ものパソコンを管理する必要はなかった訳です。

In this world, I would not have to manage 10 computers.

その文章に図や表を入れたいだの、計算をしたいだの、シミュレーションをしたいだの、100万のオブジェクトを使いたいだの、 ――

I want to put figures and tables in that text, I want to do calculations, I want to do simulations, I want to use a million objects, I want to--

そういうことを望むから、毎年、PCが『腐っていく』のです。

That's what I want, and that's why the PC 'rots' every year.

2022/10,江端さんの忘備録

「「お金に愛されないエンジニア」のための新行動論」の最新記事が掲載されました。

The latest article on "New Behavioral Theory for 'Engineers Not Loved by Money'" has been published.

■最新記事

■Latest Articles

「新しい資本主義」をエンジニア視点で考えてみる

Thinking about the "new capitalism" from an engineer's viewpoint

https://eetimes.itmedia.co.jp/ee/articles/2210/31/news054.html#utm_source=series&utm_medium=email&utm_campaign=20221101
今回は「新しい資本主義」について考えてみます。

In this issue, I would like to think about "new capitalism".

きっかけは嫁さんの「新しい資本主義って何だろうね」というひと言。これを調べていくと、「令和版所得倍増計画」なるものの実施が絶望的に難しそうであることが明らかになってきました。

The trigger was my wife's comment, "I wonder what new capitalism is". As I researched this question, it became clear that it would be hopelessly difficult to implement the "2022 version of the income doubling plan".

 


今回からは、EE Times Japan編集部から提供されているメールを流用させて頂こうかと思います。

From this time on, I would like to use (copy and paste) the e-mail provided by the EE Times Japan editorial office.

2022/10,江端さんの技術メモ

論文購読発表の準備をしていますが、このSEMというのがなかなか面白そうで、今、調べています、

「動かして理解する」が私の信条ですので、"R"と、"RStudio"をインストールして、

井出草平の研究ノート

を参考にして勉強させて頂いております。

install.packages("lavaan")
install.packages("semPlot")
In install.packages("XML") :
   パッケージ 'XML' のインストールは、ゼロでない終了値をもちました

→ が、上手くいかないなぁ

エラーメッセージは、

make: *** [C:/PROGRA~1/R/R-42~1.1/etc/x64/Makeconf:253: DocParse.o] Error 1
ERROR: compilation failed for package 'XML'
* removing 'C:/Users/ebata/AppData/Local/R/win-library/4.2/XML'
Warning in install.packages :
パッケージ ‘XML’ のインストールは、ゼロでない終了値をもちました

ですね。
MSYS2から、pacmanで libxml2-devel のインストールを試みています。

(ここまで)

$ pip install --upgrade pip

install.packages("XML", type = "binary") # これで上手くいった

以下、メモ

install.packages("AER")
install.packages("memisc")

library(lavaan) #lavaanパッケージの読み込み
library(AER) #AERパッケージの読み込み。
data(CPS1985) #データCPS1985の読み込み