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

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

Today, new my column is released, so I take a day off.

 

「お金に愛されないエンジニア」のための新行動論(1)

"A New Theory of Action for Engineers Who Are Not Loved by Money".

定年がうっすら見えてきたエンジニアが突き付けられた「お金がない」という現実

The reality of "no money" confronts an engineer whose retirement is just around the corner

 

-----

===== EE Times Japan編集部 担当者Mさんからメール ここから ======

===== Email from Ms. M, EE Times Japan Editor, from here ======

お世話になっております。大変お待たせ致しました。Web稿を作成しましたので、28日(月)の正午をメドに、ご確認をお願いできますでしょうか。

Thank you for your cooperation. We have prepared a web draft, which should be ready for your review by noon on Monday the 28th.

※連載名ですが、「「お金に愛されないエンジニア」のための新行動論」のみとしました。

I've changed the name of the series to just "A New Theory of Action for Engineers Who Are Not Loved by Money".

「世界で『数字』を~~~」を頭につけると、コンテンツ生成システムから「長すぎて入らん」と怒られまして…(涙)。

When I put "numbers in the world~~" at the beginning, the content generation system got angry and said it was too long to fit... (tears)

なので、新シリーズというより、完全なる新連載という形で行こうと思います。

So, rather than a new series, I think we'll go with a completely new series.

===== ここまで =====

===== to here =====

―― えっ? 新連載なの?

"What? Is this a new series?"

という感じで、なし崩し的に、始まってしまいました、新連載。

And so, in an uncontrolled process, the new series has begun.

システムからの要求だけでなく、『気合入れて書けよ』という、Mさんの内なる声も入っているような"気"を感じます。

I can feel the "spirit" of Mr. M, not only from the system's requirements, but also from her inner voice that says, "Put your heart and soul into your writing.

未分類

私、知財(知的財産法)四法については詳しいです。どの記述がどの条文に書かれているのか知っているレベルです。

加えて、知財に関する国際条約についても、かなり知っている方だと自負しています。

憲法は、高等教育のレベルで知っているくらいです。

民法は、ちょっと怪しくなってきます。

刑法、刑事訴訟法については、ボロボロです。

-----

今回の、「ロシアによるウクライナ侵攻」について、多くの人が、「国際法違反」と言っているようですが、その根拠となる法令について、どこを捜せばいいのか、まったくサッパリ分かりません。

また、我が国においては、憲法98条2項に「国際法優位説」と読める記載があり、現時点では「国内法と国際法がバッティングした時は、国際法が優位である」という考え方が、定説です。

ちなみに、特許法の場合は、「国際法優位」が、ばっちり明文化されていて、疑義の生じる余地がありません(第26条)。

で、何が言いたいかというと、私は『戦争に関する国際法』については、完全にド素人である、ということです。

-----

以上を踏まえまして、読者の皆様に2つお願いがあります。

(1)「ロシアによるウクライナ侵攻」を国際法違反と断じる、国際法の根拠条約と条文の場所(URL)を教えて下さい

(2)「ロシア」の法体系が、「国際法優先」か「国内法優先」のどちらに寄っているかについて、論じられているコンテンツの場所(URL)を、ご紹介下さい(論文でもいいけど、できれば、簡易に記載されているコラムで、日本語なら、なお嬉しいです)

これは、純粋に調査に供する事項であり、「正論」「正義」「理念」「倫理」などの観点は、(今回は)必要ありません。

ご教示頂けましたら、幸いです。

ご利用頂けるメールアドレスは"until20220310@kobore.net"です。

ご協力のほど、何卒、よろしくお願い致します。

 

江端

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

実家に帰ると、萩尾望都先生の「銀の三角」を読みます。そして、時間が消失してしまいます。

When I go back to my parents' house, I read "Silver Triangle" by Ms. Moto Hagio. And time disappears.

当時、高校生としては、かなりの高価だったと思うのですが、「銀の三角」はハードブックで購入しました。

I bought "Silver Triangle" as a hard book, although I think it was quite expensive for a high school student at the time.

「銀の三角」の内容を、どう解説すれば良いのか分かりません。

I don't know how to explain the contents of the "Silver Triangle".

ただ、このストーリを言語で説明するのであれば、必要なモノは相対性理論・・・違うな。量子論とも違う。

But if I want to explain this story in language, I need the theory of relativity...No no. It's not quantum theory either.

少なくとも、「時空間コンテンツ」の最高傑作であり、江端の最高評価、ということだけは言えるのですが。

At least, I can say that it is the best of "space-time contents" and Ebata's highest evaluation.

これまで、百回以上は読み直したかと思いますが、今でも、よく分からないのです。

I must have reread it a hundred times or more, but I still don't understand it.

「銀の三角」は、万人受けする作品ではないのかもしれません。

"Silver Triangle" may not be a work for everyone.

思うに、これは『私たちが作品を選ぶのではなく、作品が私たちを選ぶ』という作品なのだと思うのです。

I think this is the book that "we don't choose the book, the book chooses us".

-----

光瀬 龍先生の原作の「百億の昼と千億の夜」は、量子論の2つ目の解釈「エヴェレットの多世界解釈」の一つの形として完成した作品であると思います。

I believe that the original work "Ten Billion Days and One Hundred Billion Nights" by Mr. Ryu Mitsuse is a completed work as a form of the second interpretation of quantum theory, Everett's Many Worlds Interpretation.

「ウは宇宙船のウ」「スターレッド」「11人いる!」「恐るべき子どもたち」「半神」「メッシュ」「エッグ・スタンド」「偽王」

"R is for Rocket", "Start Red," "There are 11 of Us!" "Terrible Children", "Half-Blood", "Mesh", "Egg Stand", "The False King".

おお、凄い。

Well, I am great.

こんなにも、スラスラとタイトルが出てくるとは思わなかった。

I didn't expect the title of the book to come out so sloppily.

-----

以前「スターレッド」をテーブルに出しておいたのですが、家族に読まれた形跡がありません。

I left "Star Red" out on the table before, but there was no sign of it being read by my family.

どうやら、我が家において「選ばれし読者」は、私だけのようです。

Apparently, I am the only "chosen reader" in my family.

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

"goto"を使う ―― とても、感慨深いです。

"goto"追放キャンペーンが発生したのは、私が大学院在学中の頃でしょうか。そして、現在も"goto"に対する差別的扱いは、変っていません。"goto"なんか使ったら、それだけで『無能』扱いされ、仕事の依頼を打ち切られるような空気すらあります。

まあ、"goto"に、そこまで言われるだけの弊害があるのは確かです。特に「可読性は最悪」ですし、放置された変数が、どんな悪さをするか分かったもんではありません。メモリリークは確実で、スレッドとか使っていたら高い確率でクラッシュします。

しかし、私、学生のころ、N-BASICで"goto"使い倒していましたけど、『あれは、あれで便利でした』。

実際、プログラミング初心者には、とても便利なモノでした。初学者には、"goto"で、ラクラクプログラミングを楽しんでもらっていいんじゃないかな、私は思うのです。


ところで、調べてみたら、golangに、"goto"が実装されていました。C/C++にもありました。Pythonにもありました。Javaにもあるみたいですが、動かないようです(?)。

「使うな」と言われている割に、一応準備だけはされているのが、なかなか興味深いです。

ちゃんと動きましたので、書き残しておきます。

// go run main2.go

package main

import (
	"fmt"
	"time"
)

var ch1 chan interface{}
var ch2 chan interface{}

func main() {

	ch1 = make(chan interface{}) // チャネルの初期化
	ch2 = make(chan interface{}) // チャネルの初期化(ここでは使っていない)

	go loop()

	for i := 0; i < 5; i++ {
		time.Sleep(3 * time.Second) // 3秒待つ
		fmt.Println("send")
		ch1 <- i
	}
}

func loop() {

L:
	fmt.Println("先頭からやりなおし")

	for {
		time.Sleep(1 * time.Second) // 1秒待つ
		fmt.Println("loop")

		//チャネルからメッセージの到着を確認する
		select {
		case i := <-ch1:
			fmt.Println("ch1:", i)
			goto L

		case <-ch2:
			fmt.Println("ch2")

		default:
			//fmt.Println("No value")
		}
	}
}

以上

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

GAを使った推論エンジンを、無限ループで回し続けながら(止めないで)、変数の変更やら、パラメータの変更を突っ込みたいんだけど、その「割り込み」方法が思いつきませんでした。たしか select, caseを使ったやり方があって、defaultの使い方がキモだったようなものがあったような気がして、ちょっとテストプログラム書いてみましたところ、動いたみたいなので、メモの残しておきます。

// go run main2.go

package main

import (
	"fmt"
	"time"
)

var ch1 chan interface{}
var ch2 chan interface{}

func main() {

	ch1 = make(chan interface{}) // チャネルの初期化
	ch2 = make(chan interface{}) // チャネルの初期化(ここでは使っていない)

	go loop()

	for i := 0; i < 5; i++ {
		time.Sleep(3 * time.Second) // 3秒待つ
		fmt.Println("send")
		ch1 <- i
	}
}

func loop() {

	for {
		time.Sleep(1 * time.Second) // 1秒待つ
		fmt.Println("loop")

		//チャネルからメッセージの到着を確認する
		select {
		case i := <-ch1:
			fmt.Println("ch1:", i)

		case <-ch2:
			fmt.Println("ch2")

		default:
			//fmt.Println("No value")
		}
	}
}

で、この最後の"default"をコメントアウトすると、selectが無限待ちになってしまう(チャネルからメッセージが飛んでこないとロックしてしまう)ので注意して下さい。
コメントアウトした結果↓

 

# チャネルからイベント入ったら、初期設定のルーチンまで強制的に飛ばしてしまおうと思っているのですが、golangに、"goto"ってあるのかなぁ・・・

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

今、GAのアルゴリズムを使った動的ルーティングのライブラリ化を試みているのですが、Geneに複雑な(というか、面倒くさい)メカニズムを組み込む為に、四苦八苦しています。

これまで私は、「順序交叉」という手法を用いてきたのですが、昨夜(の深夜)この方式では、私のやりことができないことが判明し、現在、一から作り直しています(2ヶ月分がふっとんだ感じがします)。

で、こちらのpythonで遺伝的アルゴリズム(GA)を実装して巡回セールスマン問題(TSP)をとくのページの「実装例: partial_crossover」の部分を参考させて頂いて、golangで表現してみました。

package main

import (
	"fmt"
	"math/rand"
)

func main() {

	//var sliceA = []int{-1, 1, -1, 2, 6, 3, -1, 4, -1, 5}
	//var sliceB = []int{1, -1, 2, 3, -1, 4, -1, 5, 6, -1}

	var sliceA = []int{1, 2, 3, 4, 5, 6, 7, 8, 9, 0}
	var sliceB = []int{1, 3, 5, 7, 9, 0, 2, 4, 6, 8}

	fmt.Println("before sliceA:", sliceA)
	fmt.Println("before sliceB:", sliceB)

	sliceA, sliceB = partial_crossover(sliceA, sliceB)

	fmt.Println("After sliceA:", sliceA)
	fmt.Println("After sliceB:", sliceB)

}

// 交叉:2つの遺伝子をランダムな位置で交叉させる
// def partial_crossover(parent1, parent2):
func partial_crossover(sliceA []int, sliceB []int) ([]int, []int) {

	//num = len(parent1)
	length := len(sliceA)

	//cross_point = random.randrange(1, num-1)
	cross_point := rand.Intn(length-2) + 1

	//cross_point = 3

	fmt.Println("length:", length, "cross_point", cross_point)

	//child1 = parent1
	sliceA1 := make([]int, length)
	copy(sliceA1, sliceA)

	//child2 = parent2
	sliceB1 := make([]int, length)
	copy(sliceB1, sliceB)

	//for i in range(num - cross_point):
	for i := 0; i < length-cross_point; i++ {
		//target_index = cross_point + i
		target_index := cross_point + 1

		//target_value1 = parent1[target_index]
		//target_value2 = parent2[target_index]
		target_value1 := sliceA[target_index]
		target_value2 := sliceB[target_index]

		//exchange_index1 = np.where(parent1 == target_value2)
		//exchange_index2 = np.where(parent2 == target_value1)

		var exchange_index1, exchange_index2 int

		for k := 0; k < length-cross_point; k++ {
			if target_value2 == sliceA[k] {
				exchange_index1 = k
				break
			}
		}

		for k := 0; k < length-cross_point; k++ {
			if target_value1 == sliceB[k] {
				exchange_index2 = k
				break
			}
		}

		//child1[target_index] = target_value2
		//child2[target_index] = target_value1
		//child1[exchange_index1] = target_value1
		//child2[exchange_index2] = target_value2

		sliceA1[target_index] = target_value2
		sliceB1[target_index] = target_value1
		sliceA1[exchange_index1] = target_value1
		sliceB1[exchange_index2] = target_value2
	}
	return sliceA1, sliceB1
}

このコーディングで正解なのか分かりません(私が、バグを仕込んでいる可能性大)。

また検証した結果、私の考えている遺伝子配列(染色体の中に、遺伝子"*"を使う)では、使えないことが分かりました。

この方式では重複する遺伝子は使えないからです(というか、"*"を使う遺伝子配列は、普通ではない)。

もし利用を予定されている方は、十分に検証されることをお勧めします。

以上

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

監督と脚本と声優の皆さんのラインナップを見て、今期、アニメ「平家物語」の視聴を決めました ―― が

I decided to watch the anime "The Tale of the Heike" this season after seeing the lineup of the director, scriptwriter, and voice actors -- however, I think

『これは、これから長い間、視聴され続けるアニメになるかもしれないなぁ』

"This may become an anime that will be watched for a long time to come"

と思っています。

滅亡する平家一族の視点から描かれる、まさしく、琵琶法師の世界観を描いたアニメで、「見事」の一言に尽きます。

It is an anime that depicts the world of Biwahoushi(lute player) from the point of view of the Heike clan that is dying out, and it is absolutely "brilliant".

声優の悠木碧さんの語る平家琵琶の迫力が凄くて、圧倒されます。

The power of the Heike Biwa, as told by the voice actress Aoi Yuuki, is amazing and overwhelming.

-----

なんだかんだいっても、私は、日本の歴史を扱うコンテンツを、楽しむ能力があると思います。

For what it's worth, I think I have the ability to enjoy content about Japanese history.

これは、やはり、入試で「日本史」を選択したのが大きいと思います。

I think this was largely due to the fact that I chose "Japanese History" for the entrance exam.

世界史は、世界史の教師の教え方が絶望的にお粗末で、大嫌いであったのに加えて、私は、複数の世界で流れる時間を、マルチタスクで理解する能力がなかったからです。

World history, not only because my world history teacher was hopelessly lousy at teaching and a total asshole, but also because I lacked the ability to multitask and understand the time that flows in multiple worlds.

とは言え、海外に打って出ようとする若者には、「世界史選択」をお勧めしたいです。

Nevertheless, I would like to recommend the "World History Option" to young people who are planning to venture abroad.

特に、世界で同時並列で存在する宗教や思想を理解するのに、世界史はもっとも役に立つ道具です。

In particular, world history is the most useful tool for understanding religions and ideas that exist simultaneously and in parallel in the world.

そういえば、世界史と日本史をミックスした、「歴史総合」という教科になる、といういう話を聞きました。大変良いことだと思います。

By the way, I heard that there will be a new subject called "Integrated History", which is a mixture of world history and Japanese history. I think this is a very good thing.

この「歴史総合」に、「数学」を入れると、さらに面白いだろうと思います。

I think it would be even more interesting to include "mathematics" in this "Integrated History" course.

国家とか、権力とか、戦争などには、発生原因と存続時間があります。

Nations, powers, wars, etc. have a cause and duration.

これらは、数値モデルで説明できると思いますが ――

It would be interesting to be able to explain these in a numerical model, but--

その前に、『歴史数学』という学問分野の確立が必要ですね。

Before that, we need to establish the discipline of "historical mathematics".

-----

一方、私のように、

On the other hand, if you're like me,

■世間とコミットしたくなくて、

- I didn't want to commit to the world.

■1人の世界でヌクヌクしていたくて、

- I just wanted to relax in my own world.

■『閉塞した世界こそが私の楽園』

- The closed world is my paradise.

という方には、「日本史」はお勧めできます。

I can recommend "Japanese History" to you.

少なくとも、「NHK大河ドラマ」と「歴史小説/アニメ」と「寺社/名所巡り」を楽しむ人生は、担保されると思います。

At the very least, you will be guaranteed a life of enjoying NHK historical dramas, historical novels/animations, and visits to temples, shrines, and famous places.

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

「露、クリミア侵攻」という見出しが、今朝の新聞のトップに大々的に記載されていました。

The headline, "Russia invades Crimea," was at the top of this morning's newspaper.

これを見た瞬間、一気に、時間が遡ったような気がしました。

The moment I read this, all at once, I felt as if I had been transported back in time.

「天安門、死者数千百人に」

"Tiananmen Square Death Toll Rises to Thousands."

当時、学生寮に住む学生だった私は、新聞の記事を激怒しながら読んでいました。

At the time, I was a student living in a student dormitory, and I read the articles in the newspaper with fury.

-----

そういえば、当時、私は、毛沢東思想系の左翼団体(名称は忘れましたが)からオルグを受けていたのですが、私、徒党を組んでの(政治)運動が嫌いでした。

By the way, at that time, I was being organized by a leftist group (I forgot the name) that was affiliated with Mao Zedong's ideology, but I didn't like the idea of a (political) movement in a clique.

私は、『やるなら、一人でやる』という、自称「ボッチ系運動家」で、おまけに、ほとんど政治運動もしませんでした。

I was a self-proclaimed "solo activist" who said, "If I'm going to do something, I'm going to do it alone," and in addition, I rarely did political campaigns.

寮長をやらされていた時に、2回ほど大学キャンパスでアジテーションしたくらいです。

I even did a couple of agitations on the university campus when I was a dormitory director.

警察や公安からも、完全にノーマーク ―― というより、存在を認識して貰えなったです。

Even the police and public security were completely unaware of our existence.

ちなみに、天安門事件後、その団体から声がかかることはなくなりました。

Incidentally, after the Tiananmen Square incident, I was no longer approached by that organization.

-----

この事件の前に中国大陸を1月放浪してきた身の上としては、非武装の学生に対して、一斉射撃で殺傷したこの事件を、『絶対に許せない』と思いました。

As a person who had spent a month wandering around mainland China before this incident, I thought that this incident, in which unarmed students were killed and wounded in volley firing, was 'absolutely unacceptable'.

そして、中国共産党の横暴に対して、アジって(アジテーションして)いました ―― 学習塾の小学生(高学年)たちに。

And I was agitating against the arrogance of the Chinese Communist Party -- to the elementary (upper grade) students at the cram school.

加えて、最後に、子ども達に『誰にもこの話は言うなよ。特にご両親には』と、念を押していました。

In addition, at the end, I reminded the children, "Don't tell anyone about this, especially your parents.

自分でも、「チンケ」で「ヘタレ」な奴だと思います。

I think I was "poor" and "incompetence" myself.

それはさておき。

But that's beside the point.

-----

今回の、「露、クリミア侵攻」の事件ですが、色々思うことはあるのですが(例えば、侵攻? 進出? 侵略?等)

I have a lot of thoughts about this "Russian invasion of Crimea" incident (for example, Advance? Invasion? etc.)

取り敢えず、私が何をしたかというと、『ロシア軍に関する資料』を、市立図書館に予約しました。

Anyway, what I did was to reserve "Materials on the Russian Army" at the city library.

何はともあれ、今回の事件の(歴史的)背景と数値を、ざっくり理解しよう、と思いまして。

At any rate, I thought I'd try to get a rough understanding of the (historical) background and figures of this case.

このアクションが「コンサバ(コンサバティブ:保守的)」であるとすれば ―― 私は、加齢とともに、予定調和的に「コンサバ」になってきているのだと思います。

If this action is "conservative" -- I think I am becoming more and more "conservative" in a scheduled way as I age.

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

私の会社では、毎週のように、業務災害や交通事故について、詳細な報告が行われます。

At my company, detailed reports are given every week about work-related accidents and traffic accidents.

もちろん、多くの人にとっては、このような話は「聞き流す」ものだと思うのですが ―― さすがに、これが何十年も続くと「安全意識」が叩き込まれてしまいます。

Of course, for many people, this kind of talk is "overheard" -- as expected, after decades of this, "safety awareness" is drummed into them.

他の会社の人が聞きたら、『江端が勤務している会社は、"安全"に関して集団ヒステリーでも起こしているんじゃないのか』と、疑われているのじゃないかと、と心配になるほどです。

If someone from another company were to ask me, I would be worried that they would suspect that the company Ebata works for is experiencing mass hysteria over safety.

『洗脳』といっても良いレベルかもしれませんが ―― 「良い洗脳」だと思います。

It's not an exaggeration to call it "brainwashing", however it is a good "brainwashing"

「安全」は、絶対的正義だからです。

Because "safety" is absolute justice.

安全にかかるコストは決して安くありませんが、それでも「事故発生」の対応コストに比べれば、圧倒的に「安い」です。

The cost of safety is not cheap, but it is still overwhelmingly "cheap" compared to the cost of responding to an "accident".

-----

問題は、この安全意識に関する『洗脳』が、他の部分でも発揮されてしまうことです。

The problem is that this 'brainwashing' about safety awareness can play out in other areas as well.

電気配線、ストーブ前の荷物、その他整理整頓に関しての安全意識が、自宅で発揮されると『家族にウザがられます』。

My family gets annoyed when I show my safety awareness about electrical wiring, stuff in front of the stove, and other tidiness in my home.

町内会では、ヘルメットや防護靴などの着想しないで、夏祭の櫓の設営作業しているところなどを見ていると、イライラします。

It's frustrating to see people in the neighborhood association working on setting up the turrets for the summer festival without wearing helmets or protective shoes.

まあ、「洗脳の弊害」というやつです。

Well, it's called "the evil of brainwashing'.

-----

ですから、社内での死亡事故などの報告がされると、私は、本当に「ショック」を受けます。

Therefore, I am really "shocked" when I hear reports of fatal accidents within the company.

で、最近気になっているのは、この「私のショック」が、他の社員と共感できているのか、ということです。

So, what I've been wondering lately is whether this "shock of mine" is something I can share with other employees.

私、この『洗脳』だけは、次世代に繋げていく価値があると信じているので、とても心配しています。

I am very worried about this "brainwashing" because I believe it is the only thing worth passing on to the next generation.