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

「SNSに不適切な投稿を繰り返したとして訴追された裁判官」のニュースを見ながら、嫁さんが言いました。

When we watched the news of "Judge Accused for Repeatedly Posting Inappropriate Posts on Social Networking Sites," my wife said,

嫁さん:「裁判官が罪を犯したら、どうなるの」

Wife: "What happens when a judge commits a crime?"

私:「何言ってんだ。『弾劾裁判(*)』があるだろうが」

Me: "What are you talking about? There will be an 'impeachment trial(*)'

(*)憲法第64条1項、裁判官弾劾法

(*) Article 64, Section 1 of the Constitution and the Act of Impeachment of Judges

と言ったら、嫁さんと次女が、口を併わせて言いました。

When I said this, my wife and second said in unison.

「あったねー『弾劾裁判』。中学受験の時にやったねー」

"'Impeachment Trial' I remember. We did that in middle school when we were taking exams"

と、懐しそうにしゃべっていました。

They spoke each other nostalgically.

教育は無力だ ―― と、実感しました。

Education is powerless -- and I realized that.

=====

ちなみに、弾劾裁判は、裁判官を罷免(クビ)にできるだけではありません。その制裁は苛烈です。

Incidentally, an impeachment trial not only allows a judge to be removed from office (fired). The sanctions are severe.

裁判官の身分はもちろん、検察官や弁護士となる資格を失うほか、公証人となることも制限されます。

In addition to losing their status as judges, they are disqualified from becoming prosecutors or attorneys, and are restricted from becoming notaries.

調停委員、司法委員、参与員にもなれず、退職金を支給されず、年金の額も制限されます。

They cannot be mediators, judicial commissioners, or counsellors, are not entitled to retirement benefits, and their pensions are limited.

そして、弾劾裁判所は一審かつ終審であるため、判決は宣告と同時に確定し、不服申立ての方法はありません。

And since the impeachment court is a single and final instance, the judgment becomes final upon pronouncement and there is no way to appeal.

再審請求はできるようですが、過去に例はないようです。

It seems that a request for a retrial can be made, but there have been no previous cases.

ただし、5年経過後に法律家としての資格を回復することはできるようです ―― 「困窮生活の救済」「人格改善」いう理由が見られました。

However, it seems that after five years, it is possible to regain the qualification to practice law -- "relief of needy life" and "improvement of character" were some of the reasons seen.

-----

弾劾裁判については、ロッキード事件の「ニセ電話事件」くらいは覚えていましたが ―― ちょっと調べてみたところ、

The only thing I remembered about the impeachment trial was the "phony phone call" in the Lockheed case -- but I did a little research.

「ストーカー」

"Stalker"

「児童売春」

"Child Prostitution"

「スカート内の動画撮影」

"Video recording in skirt"

などという、なんとも下品な理由で弾劾裁判を喰らっている裁判官もいました。

Some judges were impeached on the most vulgar grounds, like the above.

裁判官が相手であっても、一般の刑事事件、民事事件で訴訟を起こすことはできるようです。

It seems that even if the judge is against you, you can still file a lawsuit in a general criminal or civil case.

しかし、裁判の有罪確定をもってしても、裁判官の資格を失効させることはできないようです。

However, it appears that the conviction of the trial court does not disqualify the judge.

裁判官の身分の保証は非常に強く、あくまで弾劾裁判を経なければ、裁判官を辞めさせることはできません。

The guarantee of a judge's status is very strong, and only through an impeachment trial can a judge be removed from office.

-----

今回の「SNSに不適切な投稿を繰り返したとして訴追された裁判官」の弾劾裁判は戦後10件目のケースで、弾劾裁判自体、極めてレアケースであるようです。

This impeachment trial of a "judge accused of repeatedly posting inappropriate posts on social networking sites" is the 10th case in the postwar period, and impeachment trials themselves seem to be extremely rare.

まあ、レアケースでなければ、困りますけどね。

Well, if it wasn't a rare case, we would be in trouble.

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

私の次のコロナワクチン接種(第3回目)は、今週の金曜日です。

My next corona vaccination (3rd dose) is this Friday.

今になって『しまった』と思っています。

Now I'm thinking, 'Oh! No!".

私、ウイークデーの就業時間中は、『社会人』江端智一ですが、私は、その時間以外は、『私人』江端智一です。

I, Tomoichi Ebata, am a "working person" during my working hours on weekdays, but I am a "private person" outside of those hours.

でもって、土日は、概ね、私人としての私は、資料調査、図表作成、コラム執筆、シミュレーションに、ほぼ全ての時間を投入しています。

And, on Saturdays and Sundays, as a "private person", I generally invest almost all my time in researching materials, creating charts, writing columns, and simulations.

-----

第3回目の副反応は凄いぞ ―― という話を色々なところから聞いています。

I've heard from various sources that the third adverse reaction is going to be terrible.

今週の土日が、副反応対応で潰れてしまったら、3月のコラムの執筆計画が、かなり危うくなってきます。

If I have to spend this Saturday and Sunday dealing with adverse reactions, my writing for the March column will be in serious critical condition.

振り返ってみると・・・

Looking back...

1回目は、私は、副反応を自覚できませんでした。

The first time, I was not aware of any adverse reactions.

2回目は、翌日から翌々日にかけて、歩行困難となる時がありました。

The second time, I had difficulty walking at times during the next day and the day after that.

総じて、江端家夫婦は、副反応は軽症だったと思います。

ワクチン接種後の江端家の状況(2021/09/08現在) #江端家副反応レポート完了

In general, I think that my wife and I had a mild adverse reaction.

-----

ですから、3回目もきっと軽症に違いない、と信じています ―― が、

So I'm sure that the third will be minor -- however,

共同執筆者であるシバタ先生や、編集担当であるMさんは、副反応で大変な目に遭われているようです。

Dr. Shibata, my co-author, and Ms. M, my editor, have been having a hard time with adverse reactions.

「私(江端)だけ、3回目も軽症で逃げ切った」ということになれば、私たちのチームに『気まずい空気』が流れるのではないかと、(ちょっとだけ)心配しています。

I'm (a little) worried that if it turns out that I (Ebata) was the only one who escaped with a minor injury in the third round, there will be an 'awkward atmosphere' in our team.

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

ここ最近、コーディング(プログラミング)に嵌っています。

Recently, I've been into coding (programming).

色々検討した結果、ここ2月ほど検討してきた方法が、間違っていることが分かってきて、現在、絶賛やりなおし中です(丸々無駄という訳でもなかったのですが)。

After much deliberation, I've come to realize that the method I've been considering for the past two months is wrong, and I'm currently in the process of redoing it (though it wasn't a total waste).

「pythonで遺伝的アルゴリズム(GA)を実装して巡回セールスマン問題(TSP)をとく」の交叉(部分的交叉)のアルゴリズムをgolangで書き直してみた

現在、トライアル中のモノは「予測できない変化をリアルタイムで組み込んで、動的に変化しつづける推論エンジン」でして これが、結構難しい。

The one we I currently trialing is an inference engine that incorporates unpredictable changes in real time and keeps changing dynamically.

状況を固定させた状態での研究は腐るほどあるのですが、実際の環境を組み込みながら動くエンジンの研究は、ほとんどありません。

There is a plethora of research that has been done with fixed situations, but there is very little research on engines that work while incorporating real environments.

まあ、これは、実際にコーディングをやってみれば分かります。

Well, you can find this out by actually doing some coding.

『現状の計画を大きく変更させないようにして、新しい情報を組みつつ、行動を変える』という、人間が普通にやっていることを、プログラムに組み込むのことは、結構難しいのです。

It is quite difficult to incorporate into a program what we normally do, which is to "change our behavior while incorporating new information without significantly altering our current plans.

それでも、私が踏ん張っているのは、『多分、大掛かりなプログラムとしては、これが現役(というか人生)ラストコード(プログラミング)になるだろう』という予感があるからです。

Still, I'm holding on because I have a feeling that this will probably be the last code (programming) I'll ever use in my life as a large-scale program.

-----

私は、テレビやスマホのゲームを楽しめない性格です。

I am a person who does not enjoy playing games on TV or on my phone.

しかし、ゲームに嵌っている人の状況と、コーディングに嵌っている私の状況は、良く似ているかもしれないなぁ、と思っています。

However, I think that the situation of people who are addicted to games and my situation of being addicted to coding may be very similar.

- 興奮状態が続き、眠れなくなる。

- The excitement lasts and makes it difficult to sleep.

- 目を瞑っても、アルゴリズムが頭の中を走り回る

- Even when I close my eyes, algorithms run through my head.

- 夢の中でバグに気がつき、その後、寝付けなくなる

- Noticing a bug in a dream and then not being able to sleep

昔は、この時点で「大量のアルコールを投入して、強制的に睡眠に入る/維持する」ということをやっていたのですが ―― その結果が、アルコール依存症の予備軍(いや、正規軍か?)になってしまいました。

In the past, I used to "throw in a lot of alcohol" at this point to force/maintain sleep -- and the result was a reserve army of alcoholics (or is it a regular army?).

今は、アルコールではなく、精神安定剤に、スイッチしただけですが。

Now, I just switched to tranquilizers instead of alcohol.

それでも、毎日のアルコールの鯨飲よりは、処方通りの安定剤の方が、はるかに健康的だとは思います。

Still, I believe that stabilizers as prescribed are much healthier than whaling on alcohol daily.

体調もいいですし。

I'm in good physical condition.

それはさておき。

That's beside the point.

-----

一般的に、プログラムはパラメータの値に実際の値を使わずに、変数にしておいて、外部から入力するようにします。

In general, programs do not use actual values for parameters. The parameter values are kept as variables and are input from outside.

(3.52)^3 + 3.52^2 + 3.52 の値(=543.9174828032)としてプログラムに書き込むのではなく、x^3 + x^2 + x と記述しておけば、プログラムの起動時に、xの値を自由に変えることができて、便利だからです。

Instead of writing it into the program as the value of (3.52)^3 + 3.52^2 + 3.52 (=543.9174828032), it is convenient to write it as x^3 + x^2 + x, so that you can freely change the value of x when the program starts.

直接、値を書き込むコーディングは、「ハードコーディング」と言われて、(実験や検証用途を除けば)やってはならないプログラミングとされています。

Coding that directly writes values is called "hard coding" and is considered programming that should not be done (except for experiments and verification purposes).

"goto"と同じように。

Just like "goto".

Golangでgotoを使ってみた

しかし、興奮状態が納まらず、睡眠障害が発生し、疲労が取れない、この私のコーディングこそが「ハードコーディング」と呼びに相応しい、と思っています。

However, I think that my current coding is worthy of being called "hard coding", as I can't stop the excitement, sleep disturbance, and fatigue.

そして、体力的にも、精神的にも、今が、このような「ハードコーディング」ができるラストチャンスだろうと、腹を括っています。

And I' believe the fact that this will be my last chance to do this kind of "hard coding", both physically and mentally.

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
}

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

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

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

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

以上