2023,江端さんの技術メモ

https://development.relaxes.jp/windows11にwsl2+ubuntu20-04をインストールする/

これまで、VMWareやら、VirtualBoxやら、(Dockerも、)仮想環境というのは基本的に面倒くさい思い出ばかりなの(特に通信I/F回り)で、Windows10/11をインストールする時も、意図してWSLは弾いてきたのですが ―― そのツケが回ってきました。

Golangは、Windowsで実行するより、WSL on Windows10/11の方が実行速度が速い 

という驚愕の情報をデータ付きで教えて頂き、現在、WSLの環境構築と、Golangのインストールを実行しています。

以外に簡単でしたし、通信I/F回りも今のところ、あまり問題になっていないようです。


さて、wslのインストールがコマンドプロンプトから、

>wsl -d Ubuntu-20.04

の環境を立ち上げて、

>sudo apt update
>sudo apt install golang-go

をしました。これでgolangは動くようになりました。

で、実際のプロウラムを動かしてみると、

# m/AgentSimulation
./db_util.go:280:24: undefined: sql.NullInt16
note: module requires Go 1.17

というエラーが出て止まります。

Go 1.17にモジュールが必要と言われているようですが、

$ go version
go version go1.13.8 linux/amd64

と出てきます。全然足りないようです。

ここからは、めんどくないGoのバージョンアップ を参考にして作業を進めました。

$sudo apt install golang-go

では、失敗するようです。

やっぱり

$sudo add-apt-repository ppa:longsleep/golang-backports

が重要なようでした。

定番の

$sudo apt autoremove
$sudo apt update
$sudo apt install
$sudo apt upgrade
をやって、再度
$sudo apt install golang-go
を実施したら、
$ go version
go version go1.20.2 linux/amd64
となりました。
-----

2023,江端さんの忘備録

今日も「立証責任」シリーズです。

Today, I continue our "burden of proof" series too.

でまあ、最近、高市早苗経済安全保障担当相と、立憲民主党の小西洋之参院議員の間で、この「立証責任」についての論争があるようです。

私が、過去に、自腹切って法学ゼミに通っていた、という話は何度かしましたが、その中でも驚いた話の一つに

I have mentioned several times in the past that I used to attend law seminars at my own expense, and one of the most surprising stories I heard was

『刑事事件裁判における、原告と被告の立証責任の違い』があります。

"The difference between the burden of proof for the plaintiff and the defendant in a criminal case trial"

民事事件裁判というのを、乱暴に一言で言えば、「個人 v.s. 個人」の争いです。

To put a civil case trial in a nutshell, it is a "personal v.s. personal" dispute.

比して、刑事事件裁判というのは、「国家 v.s. 個人」の争いになります。

In contrast, a criminal trial is a "state v. individual" dispute.

これでは、最初から勝負になりません。

This is not a good start to the game.

なぜなら、刑事事件においては、国家(検察側)が圧倒的に強いからです。

This is because the state (the prosecution) is by far the strongest party in criminal cases.

-----

国家:「プロフェッショナルな捜査集団(警察)」、「攻撃専門の法律専門家の集団(検察)」、「最新鋭の科学的調査手段や、それらの人材を確保できるだけの潤沢な資金」

State: "a professional investigative team (police)," "a group of legal experts specializing in attacks (prosecutors)," "state-of-the-art scientific means of investigation, and ample funds to staff them."

個人: 基本的に自分の「個人的な私財」くらい

Personal: Basically, "personal private property".

いわば、「核ミサイル v.s. 被告個人の竹槍での特攻」みたいなものなのです。

It is like a "nuclear missile v.s. defendant's personal suicide attack with a bamboo spear," so to speak.

-----

それ故、刑事事件裁判においては、「検察側の圧倒的有利」を前提として、以下のようなルールがあります。

Hence, in criminal trials, the following rules are based on the "overwhelming advantage of the prosecution".

検察側は、事件の全貌を、

The procesution must complete the followings,

(1) 完全かつ無矛盾に、

(1) without contradiction,

(2) 1mmのスキもなく、

(2) perfectly,

(3) どこからどう攻められても絶対に崩れない磐石の証拠とロジックによって完成させて、

(3) with rock-solid evidence and login that will never be broken, no matter how they is attacked, and

(4) それを法廷で明らかにしなければならない

(4) the responsibility to make it clear in court.

という責務があります。

検察は、これだけの仕事を完遂しなければ、裁判に勝てません。

The prosecution must complete so much work to win the case.

それに対して、被告側は、上記の全容のほんの僅かな、かすかな部分、例えば、"1%"、あるいは "0.01%" の矛盾や齟齬を指摘できれば、それで、"勝ち"となります。

On the other hand, if the defendant can point out a tiny fraction of the above, say "1%" or "0.01%" of discrepancies or discrepancies, then they "win".

これを、法学ゼミでは、

In the law seminar, this was explained with the phrase,

『検察が組み立てたロジックを、わずか1mmでも"揺らす"ことができれば、被告の勝ち』

"The defendant wins if he or she can 'shake' the logic constructed by the prosecution, even by just 1mm"

というフレーズで説明していました。

これでは、被告が凄く有利のように思えるかもしれませんが、思い出してください ―― 被告が相手にしているものは、国家という"核ミサイル"なのです。

This may seem like a huge advantage for the defendant, but remember - the defendant is dealing with a "nuclear missile" called the state.

つまり、今回の袴田事件の再審は、その"1%"、あるいは"0.01%"によって、検察のロジックが"揺らされた"ということなのです。

In other words, the retrial in the Hakamada case was "shaked" the logic of the prosecution by the "1%" or "0.01%"

(なお、本日は、この事件の是非については言及しません)

(Note that I will not address the merits of this case today.)

-----

国家権力をバックとしている検察は、その気になれば「捏造」など朝飯前です。

As prosecutors backed by state power, "fabricate" is a piece of cake.

それゆえ、検察側には、高いモラルが必要とされているのですが、所詮、人間のやることには限界があります。

Therefore, high moral standards are required on the part of prosecutors, but there are limits to what human beings can do after all.

『あいつが犯人で間違いない』という思い込みは、必ず発生します。

The assumption that 'he is definitely the culprit' is bound to occur.

そもそも、日本の刑事裁判の有罪率は、99.9%です。

To begin with, the conviction rate in Japanese criminal trials is 99.9%.

これは統計的に見なくても、十分に気持ち悪い数字です。

This is a sickening enough number without looking at it statistically.

つまり刑事裁判で起訴されたら、ほぼ確実に有罪になるのです。

In other words, if you are charged in a criminal court, you will almost certainly be convicted.

-----

という訳で、このような無力な私たちに必要とされてることは、

So, what we need to do, in such a helpless way, is

―― 国家権力に目をつけられない様な『小市民』であり続けること

"To continue to be a "small citizen" who does not attract the attention of state power"

この一択です。

This is the only choice.

-----

私が飲み会などで「"小市民"を心掛けて生きてきました」と自己紹介しているのは、単に『笑いを取る』ためだけではないのです。

The reason I introduce myself at drinking parties by saying, "I have been trying to be a 'small citizen' my whole life," is not just to get a laugh.

神さま

神は沈黙せず

 

2023,江端さんの忘備録

この本を見つけた時に思いました。

When I found this book, I thought,

―― これは、私のために書かれた本である

"this is a book written for me"

と。

『「キューバ危機」を「マルチエージェントシミュレータ」で検証する』

"Examining the 'Cuban Crisis' with a 'Multi-Agent Simulator'"

この本に相応わしい読者が、この世に「私」以外にいようか。

Who else in the world would be a suitable reader for this book but me?

映画「Fukushima 50」を見た結果が、「13デイズ」と同じようなこになったら、どうしよう ――

ただ心配だったのが、「マルチエージェントシミュレータ」に関する技術的内容でした。

The only concern was the technical content regarding the "multi-agent simulator.

-----

例えば ――

For, example,

■『AI』とか『人工知能』とかを表題に含む書籍の多くが、AI技術に関して恐しいほどのデタラメを記載していること

- Many books with "AI" or "Artificial Intelligence" in the title contain frightening bullshit about AI technology.

■そのような本の著者の「AI技術に対する理解」が、お話にならないものほど杜撰(ずさん)なものであること

The author's "understanding of AI technology" of such books is so sloppy that it is hard to talk about it.

を、私はよく知っているからです。

-----

とは言え、この本を購入しなければ、それを確認することもできませんので、購入ボタンを押しました。

However, without purchasing the book, I would not be able to check it out, so I pressed the buy button.

到着したばかりの本を、手当たりしだい眺めていたのですが ―― 安心しました。

I was looking at a handful of books that had just arrived -- a relief.

一目で、『この本は、ガチだ』と分かりました。

At first glance, I knew, 'This book is the real deal'.

この本、これから時間をかけて、大切に読んでいこうと思っています。

I am going to take the time to read this book with great care.

2023,江端さんの忘備録

物事を最速で片付ける方法は、

The fastest way to get things done is to that

『デタラメ、適当、いい加減でも全然構わないので、とりあえず1度、最後まで完成させる。絶対に"完璧"を目指さない』

"It doesn't matter if it's a bullshit, appropriate, and lax job, just complete it once, and never aim for perfection"

です。



英語の文書作成は“コピペ”で構わない

で、今、その『デタラメ、適当、いい加減』なペーパー(論文)の初版を完成させました。

And now, I have just completed the first edition of that "bullshit, appropriate, and lax" paper (thesis).

午後からは『デタラメ、適当、いい加減』なプログラムの作成に着手します。

In the afternoon, we will start working on a "bullshit, appropriate, and lax" program.

今夜は、『デタラメ、適当、いい加減』な内容の、期末の報告書のドラフト作成を予定しています。

Tonight, I plan to draft a report for the end of the term, which will be "bullshit, appropriate, and lax".

―― 今の私の周りは『デタラメ、適当、いい加減』だらけだ

I'm surrounded by "bullshit, appropriate, and lax" right now.

と実感します。

I realize that.

-----

でも、まあ、これで、いいんです。

But, well, it is O.K.

自分の手を動かして、自力でモノを作り出す奴が、一番エラいのです。

Those who create things on their own, using their own hands, are the greatest.

完璧を目指し、理想を叫び、自分で汗もかかずに、どこかの誰かがやってくれることを期待しているだけのヤツより、ずっとマシです。

It is much better than the guy who strives for perfection, cries for ideals, and just expects someone else to do it for him/her without even breaking a sweat themselves.

2023,江端さんの忘備録

ガンダムがそんなにいいかなぁ・・・、絶対にヘヴィーオブジェクトの方がいいだろう?

I wonder if "Gundam" would be that much better...definitely "Heavy Objects" is better than "Gundam"?

と思いながら、『ヘヴィーオブジェクト』を見直しながら、コーディングしています。

I am coding while reviewing "Heavy Objects" with the thought.

ちょっと調べたら、このネタ既出でした ―― というか「頻出」。

I did a little research and found that this story has already appeared -- or rather, "frequently appears".

"YOASOBI"のラインナップに、"ハルシオン"という曲を見つけて、驚いています。

島の領有権を争う多国間の思惑を取り扱うアニメ

「宇宙戦艦ヤマト」= 「詐欺」という構図の完成

これは、「同じ話を何度も繰り返す高齢者」の兆候と思います。

I think this is a sign of "elderly people repeating the same story over and over again".

―― いずれ、こうなる私を、あまり冷たく扱うな

-----

最近分かってきたのですが、コーディングのようなトライアンドエラーの作業(私にとっては、トライアンドエラーなんです)には、音楽やアニメを流しながら作業ができます。

As I've recently discovered, I can work with music or animation playing while I work on a trial-and-error task (for me, it's trial-and-error) such as coding.

しかし、コラム、報告書、特許明細書はまったくダメです。こちらは、クラッシックとか、環境音楽が良いようです。

But columns, reports, and patent specifications are not good for that. Classical or environmental music seems to be better.

しかし、どちらも長時間の作業になります。

However, both are long hours of work.

意外に思われるかもしれませんが、この手の仕事で重要なことは、

It may come as a surprise to you, but the key to this kind of work is

―― 集中せずに、ダラダラとやること

-- To be lazy, not focused.

です。

集中モードで仕事を連続すると、確実に翌日に疲労が伝搬して、蓄積して、いずれ破綻します(最悪、入院)。

If I work continuously in intensive mode, fatigue will surely be conveyed to the next day, be accumulated, and eventually collapsed (or worse, hospitalization).

これが「シニア」というものの正体です。

This is what a "senior" is.

-----

だから、私は声を大にして言いたい。

So I want to say this out loud.

結婚なんてしてもしなくてもいいけど、もし結婚すると決めているのであれば、できるだけ早い段階で(泥の中で土下座をする覚悟で)パートナーを探した方がいいぞ、と ――

You may or may not get married, but if you do decide to get married, you'd better find a partner as early as possible (and be prepared to get down on your knees in the mud).

出産も、(と書きかけて、この問題はあまりにデリケートに過ぎるので省略)、と、

Births, also (I was about to write, but this issue is too sensitive, so I omitted it), and

そして、もし、社会人やりながらリカレント教育を目指すのであれば、できるだけそのスタートは早い方がいいぞ、と。

And if you are going to pursue recurrent education while working, you should start as early as possible.

-----

18~22歳あたりでの学問と、シニアの学問は、決定的に違います。

There is a definite difference between the study around 18-22 years old and the study of seniors.

スケジュールの中に「疲労」を組込まなければならない日々は、なかなか「せつない」ものです。

It is quite "painful" to have to incorporate "fatigue" into my schedule every day.

2023,江端さんの技術メモ

現在時刻を入れた、agoopデータ形式のcsvファイルをGolangで作る

// C:\Users\ebata\yamaguchi\src_try2\others\main9.csv

/*
	このデータ形式のcsvを作成する

	Dailyid,Year,Month,Day,Hour,Minute,Second,Latitude,Longitude
	14,2017,12,1,8,17,5,33.749583,132.709375
*/

package main

import (
	"encoding/csv"
	"fmt"
	"log"
	"os"
	"time"
)

func main() {

	const STATIONS_PATH string = "test.csv"

	// csvファイル
	csvFile, err := os.Create(STATIONS_PATH)
	if err != nil {
		log.Fatal(err)
	}
	defer csvFile.Close()

	// CSVファイルの中身を読み込み
	w := csv.NewWriter(csvFile)

	//str := "Dailyid,Year,Day,Hour,Minute,Second,Latitude,Longitude"
	str := []string{"Dailyid", "Year", "Day", "Hour", "Minute", "Second", "Latitude", "Longitude"}
	fmt.Println(str)

	if err = w.Write(str); err != nil {
		log.Fatal(err)
	}

	/////

	id := 1
	dt := time.Now()
	year := dt.Year()
	day := dt.Day()
	hour := dt.Hour()
	minute := dt.Minute()
	second := dt.Second()
	latitude := 33.749583
	longitude := 132.709375

	str = []string{fmt.Sprint(id), fmt.Sprint(year), fmt.Sprint(day), fmt.Sprint(hour), fmt.Sprint(minute), fmt.Sprint(second), fmt.Sprint(latitude), fmt.Sprint(longitude)}

	if err = w.Write(str); err != nil {
		log.Fatal(err)
	}

	w.Flush() // バッファに残っているデータを書き込む

}

2023,江端さんの忘備録

未だによく分からないもの

Something I still don't understand.

■「中国の全国人民代表大会」における議事決定システム

- Method of deciding the agenda at the National People's Congress of China

具体的に、どういう議論が、どういうやり方でされているのか、さっぱり分からない。

I have no idea what exactly is being discussed and in what manner.

そもそも、この大会での「否決決議」というものがあるのか?

To begin with, is there such a thing as a "resolution of rejection" at this convention?

私は、ニュースなどで見たことがありません。

I have never seen them on the Japanese news.

WikiPediaなどを見ても、よく分かりません。

I'm not sure what to look up on WikiPedia, etc.

どなたか、良い資料や書籍をご紹介頂ければ幸いです。

I would appreciate it if you could point me to some good resources or books.

■「米国の一般教書演説」における、連続のスタンディングオペーション

- Continuous standing ovation in the "U.S. General State of the Union Address"

はっきりいって『気持ちが悪い』。

It is clearly 'weird'.

純度の高い「忖度」を見せつけられているかのような不快感です。

It is uncomfortable as if I am being shown pure "flattery".

どのくらい気持が悪いかと言えば、『北朝鮮の軍事パレードの前席あたりで、狂ったように喜び踊り狂う人々(の演技)』くらいに、気持ち悪いです。

To put it another way, it is as sickening as "people dancing around in the front seats of a North Korean military parade, acting like crazy and joyful people.

-----

私には、「国会開会時」の「首相所信表明演説」くらいが丁度良いです。

For me, "Prime Minister's policy speech" at the opening of the Diet is just right.

品のない大声のヤジを放つ奴は低能だと思うけど、スタンディングオーベーションよりは、ずっとマシだと思います。

I think anyone who unleashes a loud, ungraceful yell is a lowlife, but it's a lot better than a standing ovation.

2023,江端さんの忘備録

私の所属している研究所では、PCやデバイスの使用者の研究員が管理責任者となっています。

In my institute, the researcher who uses the PCs and devices is responsible for their management.

ですので、資産の棚卸しがある度に、機材が紛失していないかドキドキします。

So every time there is an inventory of assets, I get nervous to see if any equipment is missing.

私の場合、かなり小さな機材、例えば、GPSロガーやボードコンピュータ、小型カメラなどを持っており、これらの置き場所を忘れてしまうことがあるのです。

In my case, I have fairly small pieces of equipment, such as GPS loggers, board computers, and small cameras, and I sometimes forget where I put these things.

この「置き場所を忘れる」というのは、相当に怖いです。

This "forgetting where to put it" is quite scary.

研究所の中を探し回ることになるからです。

This is because I will have to search all over the institute.

本日、これらの小さなデバイス等を含む、多くの機材を一斉に廃棄処理をしてきました。

Today, I have disposed of many pieces of equipment, including these small devices and others, all at once.

-----

「持っていると怖い」を回避するには、「紛失する前に捨てて(廃棄)しまえば良い」のです。

To avoid the "fear of having it," I should "throw it away (dispose of it) before I lose it.

加えて、手に入れたいデバイスがあったとしても「購入せずにガマンする」です。

In addition, it is important to "hold off on buying" any device that I want to acquire.

これを、ここ2~3年間実施してきたおかげで、一時期は100近くあった資産が、現在十数個まで減りました。

Thanks to the implementation of this over the past two to three years, the number of assets that were at one time close to 100 has been reduced to a dozen or so at present.

かなり心理的にラクになりつつあります。

It is becoming much easier psychologically.

-----

まあ、これは「広義の"終活"」と言えるかな、と思っています。

Well, I think this can be called "end-of-life" in the broad sense of the word.

今、私の回りでは、学生のみなさんが、「必死の"就活"」で多いに盛り上がっています。

Right now, I am surrounded by students who are excitedly engaged in "frantic job hunting".

ちょっと申し訳ない気がします。

I feel a little sorry for them.