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

/*
GAでTSP問題を解くときの超定番である、
「ルート表現から順序条件に変換するアルゴリズム」と
「順序表現からルート表現に変換するアルゴリズム (前記の逆変換)」を
Golangで試してみた件
*/

package main

import "fmt"

func main() {

	// ルート表現から順序条件に変換するアルゴリズム

	var sliceA = []int{7, 8, 0, 4, 1, 6, 3, 9, 5, 2} // ルート表現
	var sliceB = []int{0, 1, 2, 3, 4, 5, 6, 7, 8, 9}
	// 1111 var sliceC = [10]int{} // 順序条件が入るところ
	var sliceC = []int{} // 順序条件が入るところ

	// ルート表現から順列表現に変換
	for i := 0; i < len(sliceA); i++ {
		fmt.Printf("i: %v\n", i)
		for k := 0; k < len(sliceB); k++ {
			fmt.Printf("k: %v\n", k)
			if sliceA[i] == sliceB[k] {

				fmt.Printf("before Slice_A: %v\n", sliceA)
				fmt.Printf("before Slice_B: %v\n", sliceB)
				fmt.Printf("before Slice_C: %v\n", sliceC)

				// 1111 sliceC[i] = k
				sliceC = append(sliceC, k)
				sliceB = append(sliceB[:k], sliceB[k+1:]...) // k番目の要素を削除

				fmt.Printf("after Slice_A: %v\n", sliceA)
				fmt.Printf("after Slice_B: %v\n", sliceB)
				fmt.Printf("after Slice_C: %v\n", sliceC)
				fmt.Printf("\n")
			}
		}
	}

	fmt.Printf("=======\n")

	// 順序表現からルート表現に変換するアルゴリズム (上記の逆変換)

	sliceA = []int{} // 今からルート表現を入れるところ
	sliceB = []int{0, 1, 2, 3, 4, 5, 6, 7, 8, 9}
	// sliceCには、すでに順序表現が入っている

	for i := 0; i < len(sliceC); i++ {
		fmt.Printf("i: %v\n", i)
		k := sliceC[i]
		fmt.Printf("k: %v\n", k)
		j := sliceB[k]
		fmt.Printf("j: %v\n", j)

		fmt.Printf("before Slice_C: %v\n", sliceC)
		fmt.Printf("before Slice_B: %v\n", sliceB)
		fmt.Printf("before Slice_A: %v\n", sliceA)

		sliceA = append(sliceA, j)
		sliceB = append(sliceB[:k], sliceB[k+1:]...) // k番目の要素を削除

		fmt.Printf("after Slice_C: %v\n", sliceC)
		fmt.Printf("after Slice_B: %v\n", sliceB)
		fmt.Printf("after Slice_A: %v\n", sliceA)
	}
	fmt.Printf("\n")
}

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

昨日、"高齢者は変われない"という話を書きました。

(Continuation from yesterday)

Yesterday, I wrote about the fact that the elderly cannot change.

私の中にある、もっとも古い記憶は ―― 小さいブラウン管の白黒テレビです。

The earliest memory I have is of a small cathode-ray tube black and white TV.

記憶にはないのですが、私の時代と重なっているはずのことでは ―― 冷蔵庫とは、近所までやってくる「氷屋」から氷の塊を購入して、それを庫内に入れる、というものでした。

I don't remember that, however, as far as my time is concerned, a refrigerator was one where they would buy a block of ice from an "ice man" who would come to your neighborhood and put it in the refrigerator.

洗濯機は二槽式で、脱水は手動ローラーで行うものでした。

The washing machine was a two-tank type, and dehydration was done with manual rollers.

-----

電子レンジは、最初は40万円くらいしたと思います。

I think the microwave oven initially cost about 400,000 yen.

ワープロは200万円くらいだったかな。

A word processor was about 2 million yen.

OSのないPC-9800は、フルセットで50万円くらいでした。

A PC-9800 without an OS was about 500,000 yen for a full set.

パソコンが使える奴は、(「おたく」と呼ばれる前は)「完璧な技術エリート」でした。

Anyone who could use a computer (before they were called "Otaku") was the "perfect technical elite".

しかし ―― 今や、スマホは国民全員が所有するものと『決めつけられました』。

However -- we have now been 'decided' that every citizen should own a smartphone.

自営業の人はPCで確定申告を行う人が強要され、国民は、行政サービスの書類の入手を、マイナンバーカードを使ってコンビニで行うように促されています。

Self-employed people are forced to use their PCs to file their tax returns, and citizens are encouraged to use their My Number cards to obtain documents for government services at convenience stores.

-----

何がいいたいかというと ―― デジタル化について行けない、私たち高齢者はそんなに『悪い』か?

What I'm trying to say is -- are we older people so 'bad' that we can't keep up with the digitalization?

ということです。

いえいえ、分っています。

No, no, no, I understand.

この私こそが、「デジタルを使えない高齢者を追い込んで、責めたてている当事者」であることは。

I know that I am the one who is blaming the elderly for not being able to use digital technology.

ただ、普通に考えて、

To be frank,

―― もし、あなたが、同じような時系列、立場で、技術の進化やイノベーションに追い立てられたとして、『普通に今のデジタル技術を使いこなすことができた』と断言できますか?

"If you were driven by technological evolution and innovation in a similar timeline and position, can you say with certainty that you could normally use today's digital technology?

と。

-----

まあ、私を含めた高齢者の皆様。

Well, all you elderly people, including me.

もちろん全てではないですが、国民の大部分は、戦禍に直接巻き込まれることなく、平和な国で生きることができした。

Not all of them, of course, but the majority of the people were able to go about their lives in a peaceful country without being directly involved in the ravages of war.

上手くいけば、戦禍に直接巻き込まれることなく、死んでいくこともできそうです。

Hopefully, we will not be directly involved in the ravages of war and will be able to die.

「デジタル」という災禍に巻き込まれましたが、まあ、受忍できる範囲だと諦めましょう。

We've been caught up in a "digital" disaster, but let's just say it's tolerable.

私たちが邪険にされ続けることで、私たちの世界はより良くなって行くのです ―― 多分。

The more we continue to be wicked, the better our world will become -- maybe.

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

『年齢を重ねることは、それ自体が「権力」になる』という話を、このコラムでちょっと書いた気がします。

I think I've written a little bit in this column about how "ageing itself becomes a 'power'".

能力がなくても、実績がなくても、高齢者は権力になる ―― これは、「儒教の敬老思想」の負の側面です。

Even if they are not capable or have no achievements, the elderly come to get the power -- this is the negative side of the Confucian concept of respect for the elderly.

能力があって実績もある高齢者ともなれば、もう誰も逆らえません。

No one can resist an elderly person who is capable and has a good track record.

当然です。

It is natural.

-----

加えて、人間は、高齢になればなるほど、パラダイムを変えるのが辛くなります ―― もちろん、私も辛い。

In addition, the older we get, the harder it is to change the paradigm -- and of course, the harder it is for me.

前にも述べましたが、私は「夫婦別姓」を獲得するのに数年、「同性婚」を獲得するには10年以上かかりました。

As I mentioned before, it took me several years to get "marital separation" and more than ten years to get "gay marriage".

これらを理解する為の自己学習(自習)は、長く辛いものでした。

The self-learning (self-study) to understand these things was long and painful.

この辛さが分からない人は、自分や家族をリアルにイメージして、

If you don't know how hard this is, imagine yourself and your family in a realistic way.

―― 血縁婚(兄弟婚、姉弟婚、兄妹婚、姉妹婚、親子婚)

"Blood marriage (brother marriage, sister marriage, brother-sister marriage, sister marriage, parent-child marriage)"

を受け入れれるようになるのに、どれくらいの時間と勉強が必要になるか、を、頭の中でシミュレーションしてみて下さい。

Try to simulate them in your mind how much time and study you will be able to accept them.

(という事例でいいのかな? )

(Is that a good example? )

-----

ともあれ、

Anyway,

■高齢者には、能力と実績と権力があり、

- The elderly have power.

■高齢者のパラダイムシフトは、「リアルな血縁婚」を受けいれるくらいに難しい

- Paradigm shift for the elderly is as difficult as accepting "real blood marriage".

と思って頂くことはできないでしょうか?

Can't you think of it that way?

うん、できないですよね。

Yeah, you can't do that.

わかります。

I understand.

とすれば、

If we assume that,

■「"高齢者は変われない"を前提とする相互理解」という概念

- The concept of "mutual understanding based on the premise that the elderly cannot change their minds.

and

■「高齢者を組織のトップから、ナチュラルに排除」する技術

- Technology to naturally remove elderly people from the top of the organization.

が、今後の社会ソリューションになっていくと思います。

I believe that these will be the social solutions of the future.

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

今、シミュレーション結果の入ったデータベース(PostgreSQL)から、必要な情報を読み出すのに、SQL文を使っています。

Now, I am using SQL statements to read out the necessary information from the database (PostgreSQL) containing the simulation results.

―― SQL、まじパねっす

"SQL is really cool"

と、感動してます。

I'm very impressed.

SQL文は、慣れてくれば、テーブル間連携も自由自在で、欲しいデータの列が簡単に作れます。魔法みたいです。

Once you get used to SQL statements, you can easily create the columns of data you want, with the freedom to link between tables. It's like magic.

今、QGIS(GISアプリケーション)と連携して使っているのですが、描画の作成で、とてもラクできています。

I am now using it in conjunction with QGIS (a GIS application), and it is very easy for me to create drawings.

-----

とは言え、SQLは非常に直感に反するインターフェースをしていますし、高度な使い方をするのであれば、かなり面倒くさいです。

However, SQL is a very counter-intuitive interface, and if you are going to use it in an advanced way, it can be quite cumbersome.

SQLと言えども、

Even though it is SQL,

―― ラクをする為には、凄く苦労しなければならない

"You'll have to work very hard to be easy"

というのは、プログラムの共通的な矛盾ではあります。

This is a common contradiction in programming.

-----

私だって、年がら年中、SQL(や、Golang)を使える環境にあれば、その場で、パッパと処理プログラムを書けるようになる、という自信があります。

I'm confident that if I had access to SQL (or Golang) all year round, I would be able to write processing programs on the spot.

(C/C++については、私は、この域に近いと信じています)。

(For C/C++, I believe I'm close to this realm)

年次報告書やら、特許明細書やら、予算管理のエクセル表の作成やら、発明相談会やら、幹部報告会資料や、社外発表審査書類や、顧客殿向けデモやら、学会発表やら ――

Annual reports, patent specifications, Excel spreadsheets for budget management, invention consultations, executive briefing materials, external presentation review documents, customer demonstrations, conference presentations, etc.

そういうことが、一切ない世界線で生きていけるのであれば、『SQL王に、俺はなる!』と宣言できます。

If I can live in a world where there is no such thing, I can declare, "I will become the SQL King!"

-----

自分でモノを作らないで、プログラムやらSQLやらを外注すれば、自分の技術力が低下していくのは当然です。

If I don't create things myself and outsource the programming and SQL, it is natural that my technical skills will decline.

しかし、モノ作りに拘っていれば、社会人を続けられないのも、また事実です。

However, it is also true that I cannot continue to be a member of society if I am obsessed with making things.

一方、人徳もコネもないシニアのエンジニアが、技術力までもなくしたら、一体、何が残るというのか、とも思います。

On the other hand, if senior engineers, who have neither humanity nor connections, lose their technical skills, what will be left?

難しいのは「リソース配分」―― つまり「バランス」です。

The difficult part is "resource allocation" - in other words, "balance"。

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

東京オリンピックがどうなるのか ―― 開催国の国民として興味があります。

As a citizen of the host country, I am interested in where the Tokyo Olympics is going.

現在、世界的なウイルス感染という、未曾有の災害の真っ最中です。

We are currently in the midst of an unprecedented disaster: a global viral outbreak.

歴史的に見れば、国家の一つや二つ、地球上から消滅しても不思議ではなかった、と思えるほどの災厄です。

Historically speaking, it would not have been surprising if a nation or two had been wiped off the face of the earth.

-----

オリンピックは、国家的なイベントです。

The Olympics is a national event.

当然に、開催実施、延期、または中止を含む、いくつかのシナリオがあるに違いない ―― と、多くの人は考えていると思います。

Naturally, there must be several scenarios, including implementation, postponement, or cancellation -- and I think many people are thinking that.

しかし、私は、『2つ目のシナリオは準備されていない』に、一票を投じてみたいと思います。

However, I would like to cast my vote for 'the second scenario is not prepared.

-----

というのは、私が、プロジェクトリーダをやるときは、複数のシナリオなんて考えない、というか、考えられないからです。

This is because when I am a project leader, I don't think about multiple scenarios, or rather, I can't think about them.

複数のシナリオを準備するには、それなりの人材や時間、費用の投入が必要となりますが、基本的に、プロジェクトの現場では、そんな余裕ありません。

Preparing for multiple scenarios requires a considerable investment of human resources, time, and money, but basically, there is no room for that at the project site.

一番怖いのは、現場を理解していない、現場指揮官の投入です ―― だいたいプロジェクトの失敗は、この指揮官から始まります。

The scariest thing is to have a field commander who doesn't understand the field -- -- Most project failures start with this commander.

というのは、燃えている現場に、一流の現場指揮官が割り当てられることは、稀(まれ)だからです。

This is because it is rare that a first-rate field commander is assigned to a burning site.

-----

現場を把握できる指揮官は、どの部署でもエースです。エースはどの部署でも手放そうとはしません。

A commander who can grasp the field is an ace in any department. No department wants to let go of its ace.

そして、エースは、現場の燃え具合を即座に理解できます。そして、全力で逃げを打つはずです。

And that ace can instantly understand the burning condition of the scene. And he/she would refuse to participate at all costs.

その結果、燃えている現場には、「使えない」「手放しても構わない」「どーしようもない」指揮官が割り当てられて、プロジェクトは加速的に崩壊に向かいます。

As a result, a "useless," "unnecessary," and "helpless" commander is assigned to the burning site, and the project is headed for accelerated collapse.

まあ、オリンピックと、民間のプロジェクトを同列に論じるのは、ちょっと乱暴に過ぎるかもしれませんが。

Well, it may be a bit too violent to discuss the Olympics and private projects in the same sentence.

-----

もう一つは、「失敗」には、別段シナリオが必要ありません。

The other thing is that "failure" does not require a specific scenario.

シナリオがあれば、失敗をソフトランディングに導くということもできまます。

With a scenario, it is possible to lead a failure to a soft landing.

しかし、ソフトランディングしようが、ハードランディングしようが、結局のところ「失敗は失敗」です。

However, whether it is a soft landing or a hard landing, in the end, "failure is failure.

失敗のアプローチに目の行く人は少ないです。「失敗に美学を持っている人」は、絶無といっても良いでしょう。

There are few people who have an eye for the approach of failure. The number of people who have an aesthetic appreciation for failure is almost nonexistent.

-----

オリンピックがどうなるかは、私には分かりません。

I don't know where the Tokyo Olympics is going.

ただ、「現場」を押しつけられることが多かった人間の一人として、

But I ,who has been forced to be "in the field" a lot, think that

「批判も、非難も、援護も、賞賛も、助言も、一切せず、ただ"沈黙"し続けよう」

"No criticism, no condemnation, no support, no praise, no advice, just silence"

とは思っています。

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

「数字で救う! 弱小国家」というマンガが面白いです。

The manga whose title is "Saving a Weak Nation by the Numbers!" This is a very interesting comic book.

# パパのkindleで読めるぞ > 娘たち

# You can read this on Dad's Kindle > my daughters

今調べたら、文庫版もあるようでした。購入を検討中です。

I found that there is also a paperback version. I'm considering buying it.

-----

私が、以前「AIシリーズ」で話してきた、

As I've explained in my previous in "AI Series", this books include

■ゲーム理論

- Game Theory

■オークション理論

- Auction Theory

の話が、物語の中で、大変分かりやすいユースケースになっていて、感動しています。

and, I am impressed by the very clear use cases in the story.

それと、私の知らなかった「ホルト・ウィンスタース法」による需要予測計算や「ランチェスターの法則」なども登場します。

Also, "Holt-Winsters method" and "Lanchester's Law", which I have not known about, come to appear in the book.

これらを、WikiPediaで調べながら、マンガを読んでいました。

I was reading the manga while looking these up on WikiPedia.

「ランチェスターの法則」の戦力比較方式など、『いつか、どこかのコラムで使ってやろう』と虎視眈々と考えております。

I've been vigilantly thinking about using the "Lanchester's Law" method of comparing forces in my columns.

この年齢になって、私はようやく「単利計算」と「複利計算」の違いを理解するに至りました。

At this age, I have finally come to understand the difference between "simple interest calculation" and "compound interest calculation".

(でも、これは以前お話した「消費者金融」や「アムウェイ」の話と似ています)

(These are similar to the "consumer finance" and "Amway" stories we talked about before.)

-----

この漫画(文庫)の一貫したポリシーは、「徹底した弱者戦略」です。

The consistent policy of this manga (library) is "thoroughgoing strategy for the weak".

私の立場に置き換えるのであれば、

If I were to put myself in my shoes. I could think,

―― 学閥、人脈、コネ一切なしの、シニアのサラリーマンエンジニアの「ぼっち戦略」

""A lonely strategy" of a senior salaried engineer without any academic cliques, connections, etc."

と考えることができます。

これも以前お話しましたが、

I told you this before, too.

―― 「弱い」は、突き詰めれば「強い」

""Weak" is "strong" when I master it."

に通じるものがあり、大変勉強になります。

I learned a lot from this story.

-----

という訳で、世界に冠たる「数学大嫌い国家、日本」の若者のみなさん。

So, to all the young people of Japan, the world's leading math-phobic nation.

「ぼっち」で、これからの人生を生き抜くには、数学は結構な武器になりそうですよ。

If you are a "loner" and want to survive in the future, math is going to be a great weapon.

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

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

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

 

踊るバズワード ~Behind the Buzzword(11)ブロックチェーン(5):

「ブロックチェーン」に永遠の愛を誓う ~神も法もかなわぬ無敵の与信システム

 

Dancing Buzzword - Behind the Buzzword (10) Blockchain(4)

Pledge Eternal Love to the Blockchain: An Invincible Credit System that Defies God and the Law

-----

今回のブロックチェーンのシリーズで、私は、ビットコインに関してネガティブな批判を繰り広げていますが、実際のところ、私は「私が正しいのか、間違っているのか」には、大して興味がありません。

In this series about blockchain, I'm waging a negative critique of Bitcoin, but the truth is, I'm not really interested in whether I'm right or wrong.

「ビットコインが破綻するか、あるいはネット社会で定着するか」は、いずれ分かることだからです。

The reason is that we will eventually find out whether Bitcoin will fail or become a fixture in the online world.

実際のところ、私は、私の知識とロジックで、持論を展開していますが ―― 結構な頻度で「予測を外してきました」。

As a matter of fact, I've been "missing predictions" quite often -- although I have my own theories, with my own knowledge and logic.

つまり「間違えてきた」。

In other words, I've made a mistake.

そりゃそうでしょう。間違えますよ ―― 私、神様じゃないんだから。

Of course you're right. I'll make a mistake -- I'm not God.

-----

ところが、世の中には「間違いを認めない/認めたがらない人」が、多いようです。

However, it seems that there are many people in the world who are reluctant to admit mistakes.

「沈黙し続ける」とか「開きなおる」とか「無限に言い訳を続ける」とか。

"keep silent," or "reopen," or "make endless excuses", etc.

ぶっちゃけ面倒くせーな、こいつ、と思います。

To be honest, I think this guy is painful.

-----

エンジニアや研究員は、毎日、自分の仮説に裏切られ続けています。

Engineers and researchers are continually betrayed by their hypotheses every day.

自分の作ったシミュレーションによって、自分の作成した回路によって、自分の作成した装置によって、毎日、自分の考えを否定され続けています。

In my case, every day, I am constantly denied my ideas by the simulations I have created, by the circuits I have created , and the devices I have created.

その結果を見て『いや! 私は間違っていない!!』と言い張っても、意味がありません。

After looking at the results, there is a meaningless to say "I am not wrong!"

それは、自分の首を締めるだけですから。

Because that will only tighten my own neck.

----

訓練されたエンジニア/研究員は、自分が「間違っていること」を前提に行動します。

Trained engineers/researchers act on the assumption that they are "wrong".

「間違えること」は、別段、恥かしいことではないからです。

It's not embarrassing to make mistakes.

間違えることは、正しい答に辿りつく最短のアプローチであり、そして、「間違え続けることが、私たちの仕事」であって ――

Making mistakes is the quickest way to get to the right answer, and it's our job to keep making mistakes.

そんでもって、「間違えた原因とその理由を明らかにすること」までが、ワンセットです。

Then, "clarify the cause of the mistake and the reason for it" is a set of steps.

 

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

先日ご紹介した私の著書を読んで頂いている方から、引続き「尊厳死宣言」に関わる事項をさらにご教示頂いております。

The reader of my book, which I introduced the other day, has continued to provide me with further information on matters related to the "Death with Dignity Declaration.

(私の為に)箇条書きにて、概要を記載します。

Here is an overview in bullet points (for me).

■弁護士さんが引き出しできる口座を準備する(入院、葬式用)

- Prepare an account that the lawyer can withdraw from (for hospitalization and funeral).

■上記に関しては、弁護士さんと個別の契約をすることができる

- For the above, you can make an individual contract with a lawyer.

■決済用口座(利子がつかない)を作って、当面のお金を入れておくと良い

- Make a settlement account (interest free) and put money for the time being in it.

■成人後見人制度は、結構面倒くさい

- The requirements for adult guardianship are quite strict.

私も、父が単独で新聞契約をしてしまった時に、私(江端)は、この制度の利用を検討したことがあります。

I (Ebata) have also considered using this system when my father signed up for newspapers on his own.

しかし、その時、介護業務の方から、「姉と私の対応が妥当で迅速」であるという理由で、申請が却下される公算が高いと言われました。

However, at that time, I was told by the care services that my application was highly likely to be rejected because of the "reasonable and prompt" response of my sister and me(Really).

-----

以下は、検討しておくべきチェックリストです

Here is a checklist of things to consider

■Gmail, LINE, facebook 等の ITのアカウント、パスワード、および解約方法

- IT accounts, passwords, and cancellation methods for Gmail, LINE, facebook, etc.

■オンライン口座、FX口座、ビットコイン等の暗号通貨(私もあと600円分ある)の取引所の撤収方法、FX口座

- How to get rid of online accounts, forex accounts, and exchanges for bitcoin and other cryptocurrencies (I have another $600 worth).

■Amazon,楽天等のECポータルの解約方法

- How to cancel an e-commerce portal such as Amazon, Rakuten, etc.

■クラウドサーバ(AWS等)の抹消、解約

- Cancellation or termination of cloud servers (AWS, etc.)

■破壊すべきHDD, USBメモリのITガジェット

- HDD to be Destroyed, USB Memory IT Gadgets

■(本来、存在していないはずの)機密書類や機器の返却または抹消

- Return or erase confidential documents and equipment (that should not exist).

------

以前、IDとパスワードを知らせずに夫が死亡して、妻がスマホ、PC、あらゆる電子デバイスが使えなくなって、孤立してしまったという、知人の話を記載しましたが ――

I once described the story of an acquaintance whose husband died without informing her of his ID and password, leaving his wife isolated with no access to her phone, PC, or any electronic devices.

江端家の場合でも、間違いなく、このような状況が発生すると思います。

I have no doubt that this situation will arise in the case of the Ebata family.

この機会に、いろいろ準備しておこう、と思います。

I think I'll take this opportunity to prepare a lot of things.