未分類

「地球から240億キロ、ボイジャー1号システム復旧に成功 5カ月ぶりに解読可能データ受信」

"24 Billion Kilometers from Earth, Voyager 1 System Recovery Successful, Receives First Decipherable Data in Five Months."

という記事を読んで、感極まる人はそれほど多くないかもしれません。

Not many people may be moved to tears when they read an article called

しかし、私は涙が出そうになりました。

However, I almost cried.

『9日間の忍耐』ができるエンジニア ―― これが、SLIMプロジェクトのエンジニアの皆さんと、私の決定的な差です。

はやぶさの映画

"ボイジャー" ―― この一語だけで、私は、もう、思考停止してしまうのです。

"Voyager" -- this one word is enough to make me stop thinking.

■「さよならジュピター」に使われた「VOYAGER~日付のない墓標」

■"VOYAGER - Tombstone without Date" used in "Farewell Jupiter"

1995年の地上波の「ヤシマ作戦」と「MAGIシステム乗っ取り」で止まっていた私の中で、今、何かが動き始めました。

■「秒速5センチメートル」の「コスモナウト」の主人公の邂逅

■A chance encounter with the protagonist of "Cosmonaut" in "5 Centimeters per Second".

"それは本当に、想像も絶するくらい孤独な旅であるはずだ"

"It really must be an unimaginably lonely journey."

"本当の暗闇の中をただひたむきに、一つの水素原子にさえ、めったに出会う事なく、ただただ深淵にあるはずと信じる世界の秘密に近づきたい一心で"

"Just to go on and on through the real darkness, rarely encountering even a single hydrogen atom, just with the single desire to get closer to the secrets of the world that I believe must lie in the abyss."

-----

ネットワークでのリモートホストを行うための"ping"の応答時間は、長くても1秒以内。

The response time for a "ping" to the remote host on the network is less than one second at most.

比して、ボイジャー1号との応答時間は、45時間(162000秒)です。

In comparison, the response time to Voyager 1 is 45 hours (162,000 seconds).

『このチップを修理する手段がなかったことから、同チームはこのチップに保存されていたコードを同システムのメモリーの別の場所に移すことにした。全てのコードを保存できる区画は見つけることができなかったが、コードをセクションに分割して、それぞれ飛行データシステムの別々の場所に保存することに成功した。』

'Since there was no way to repair this chip, the team moved the stored codes to another location in the system's memory. Although they could not find a compartment to store all the codes, they could break them into sections and store each in a separate location in the flight data system.'

―― マジか!

"Really!?"

これは、240億キロの彼方にいる患者の脳の毛細血管のバイパス手術を、目をつむりながら、その状態の一つ一つを45時間ごとに確かめて行うという、想像を絶するオペレーションです。

This operation is unimaginable to bypass the capillaries of a patient's brain, 24 billion kilometers away, with his eyes closed, checking each one of its conditions every 45 hours.

しかも、多分、数ビット/秒通信という中、誤って通信リンクを切断したら、もう永遠にボイジャー1号とは通信ができない、という、最大級のリスクを背負っての、極限の環境下でのオペレーションです。

Moreover, the operation was in an extreme environment with the highest level of risk. If they mistakenly cut the communication link by a few bits per second, the communication with Voyager 1 would be lost forever.

この"もの凄さ"を、どうやったら説明できるだろうか ―― 私には、到底表現しきれない"偉業"で、そして"奇跡"です。

How can I describe the "greatness" of this "feat" and "miracle" that I cannot even begin to describe?

-----

この技術者たちの『もの凄さ』を言語で表現できないので、私は、他の人間に当たり散らすことにします。

Since I can't express in words the 'awesomeness' of these technicians, I'll hit others.

「UFOの呼び方」とかの本を書いている奴、それを信じている奴、実施している奴。

Who writes books like "How to Call UFOs," who believes in them, and who tries them?

お前たちが何を信じているかは、もちろん、お前たちの自由ではある。

What you believe is, of course, up to you.

しかし、「45億キロメートルの彼方の宇宙空間探査」に「応答時間45時間」で、「メモリ上のコード移動」を成し遂げ、そして「再起動」を成し得たエンジニアたちの、気の遠くなるような努力と、その成果に対して、

But for the mind-boggling efforts and accomplishments of the engineers who managed to 'move the code in memory' and 'reboot it' in '45 hours of response time' to 'space exploration 4.5 billion kilometers away', I would like to say a few words,

『お前たちの口から、何か語れることがあるか?』

"What can you tell them about what you do?"

とは、問いたい。

 

2024,江端さんの忘備録

就活面接という名前を借りた、『知財(知的財産権)搾取』があることを、先日、次女から教えられました。

The other day, my second daughter told me that there is "intellectual property (IPR) exploitation" in the name of job interviews.

面接のお題が「次の我が社の新ビジネス」を考えてくる、という内容だそうです。

The subject of the interview was to come up with "the next new business for our company."

このお題は、どの会社も、のたうち苦しみながら、考えて考えて、失敗して、やりなおして、また考えて ―― を、続けている最難関の業務です。

This topic is the most challenging task for any company, as it is a constant struggle, thinking, thinking, failing, redoing, thinking again, and so on.

この最難関の業務を『就活生に考えさせる』というところに、その会社の『いやらしさ』(または、『卑劣』『下劣』『おぞましい』)があります。

The company's "nastiness" (or "meanness," "vileness," or "horror") lies in the fact that it "makes job hunters think" about this most challenging task.

―― これを"知財搾取"と呼ばずに何と呼ぶ?

"What would you call it if you didn't call it "IP exploitation"?"

はっきり言って、私は腹を立てております。

To be clear, I get mad with this company.

『その会社の名前を、ブログで公表したろか』とも思いましたが ―― 次女に類が及んでは意味がありません。

I thought, "Should I publish that company's name on my blog? But it would be meaningless if my second daughter was disadvantaged.

これは、次女の就活が完了した後に、じっくり、ねっとりと、やれば良さそうです。

This issue seems like a good thing to do, slowly and methodically, after the second daughter's job search is complete.

-----

で、まあ、私、次女に頼まれて、そのネタ出しを手伝っていました。

And, well, my second daughter asked me to help her out with the story.

なにしろ、私は、『王禅寺の特許明細書製造装置』ですから。

After all, I am "Ozenji's patent specification manufacturing equipment.

第一ラウンドくらいファイティングポーズを見せないと ―― 『王禅寺の特許明細書製造装置』の名にかけて。

 

2024,江端さんの忘備録

以前、「他の人が忙しいから」と、私に仕事を振ってきた奴がいました。

I once had a guy who gave me a job because "other people were busy."

『死ね、馬鹿野郎』と、私は、今でも腹を立てています。

'Die, you idiot,' I said, still angry.

こんな言い方では、『私が暇そうに見える』と言われているのと同じです。

In this way, it has the same meaning as 'I look bored.

こんな奴の依頼は『拒否』の一択ですが、業務の場合はそれができないこともあります。

The only option for a request from someone like this is to 'refuse,' but that may not be possible in the case of business.

それでも、私が、このような言い方をされたら、私はその人間のことを忘れません ―― 最悪の印象とともに。

Still, I will not forget the guy with the worst possible impression.

この程度の配慮は、年齢を重ねれば、なんとなくできてくるものですが ―― いつまでたっても、それができない人間もいるものです。

This level of consideration comes with age -- but some people can't do it forever.

例えば、「私(江端)」です。

For example, "I (Ebata).

―― プレゼンを見れば、モテるヤツかどうかは、一発で分かる

-----

私は、私の言動(ブログやコラムを含む)で、多くの人を傷つけてきたと思います。

My words and actions have hurt many people (including my blog and columns).

『自分だけは例外』などと思うには、私は、これまで色々なことを『語り過ぎてきた』と思います。

I have "talked too much" about too many things to think I am the exception.

人を傷つけない方法は、

How not to hurt people, are, I think, 

「黙り続けること」「語らないこと」「自分の本心を明らかにしないこと」

To remain silent, not speak, and not reveal one's true feelings.

ぐらいでしょう。

もっとも、これはこれで、かなり難しいです。

However, it is much more difficult to do.

ともあれ『「何かを語る」ということは「誰かを傷付ける」と同義である』ということは、覚えておくべきでしょう。

We should remember that 'talking about something' is synonymous with 'hurting someone.

「いい人」で居続けたいのであれば、黙っていることです。

If you want to remain a "good guy," keep your mouth shut.

ちなみに、上記のフレーズの逆相は、

Incidentally, the reverse phase of the above phrase is,

―― 語れば、必ず「悪い人」になる

"Talking will always make you a "bad person.""

です。

「しゃべれば、ロクな目に合わない」―― これは、もう、人生の帰納的経験則といっても過言ではありません。

-----

ちなみに、上記の「他の人が忙しいから」についてですが、その真偽はどうあれ、この場合に使うべきフレーズは、

By the way, regarding the above "because others are busy," whatever the truth of that, the phrase to use in this case is,

『この件に関しては、江端さんしか頼れる人がいないんです!』

'There is no one else I can turn to but you, Ebata-san, on this matter!

です。

繰り返しますが「真偽はどうあれ」です。

Again, "whatever the truth may be."

2024,江端さんの忘備録

「ロケット 失敗からの再起 技術者たちの348日」を見ました。

I watched "Re-emerging from Rocket Failure: 348 Days of Engineers."

エンジニアたちの真剣な表情に、握りしめたコップが震えました。

The severe expressions on the engineers' faces made my clenched cup tremble.

『プロジェクトX』のような演出なんかなくったって、現場のエンジニアの様子だけで、十分に『心が震えます』。

Even without the production of "Project X," the engineers onsite are enough to "shake their heart.

(7)総じて「プロジェクトX」は、「エンジニアの夢や希望を搾取」して「プロジェクトを完成させた」というストーリで構成されており、現在の若者への「やりがい搾取」と1mmも変わっていないように見える

演出なんかいらない。

I don't need any staging.

音楽もいらない。

I don't even need music.

『プロフェッショナル 仕事の流儀』みたいな、かっこいい台詞も、名言もいらない。

I don't need cool lines or quotes like in "Professional: The Way of Work."

ありのままで、この世界には感動できるものがある、と思います。

As it is, I think something is inspiring in this world.

私、電気工学のマスター(修士)ですので、前回の失敗の原因と考えられていた電気系に関する部分は、大変よく理解できました。

I have a master's in electrical engineering, so I could understand the part about the electrical system that was considered the cause of the previous failure.

そういう内容が含まれていたことも『心が震える』一因になっていたのかもしれません。

The fact that such content may have been one of the reasons for the "shaking of my heart.

-----

規模も期間も全然違いますが、私も、実験の最中に、予想を超える効果が得られて、

The scale and duration are different, but when I also obtained effects that exceeded my expectations during the experiment,

『拳を握りしめて、咆哮を叫びたくなるくらい"嬉しい"』

"It made me want to clench my fists and roar joyfully."

と思える時が ―― 本当に稀ですけど ―― あります。

There are times - rare, really - I feel like the above.

エンジニアには、恋でも、愛でも、金でも、地位でも、権力でもなく、ただ『実験結果が、嬉しい』という時があるのです。

Sometimes, engineers are not in love, money, status, or power but are just 'happy with the experiment's results.

まあ、私には、抱き合ったり、肩を叩き合ったたりして、喜びあう仲間がいませんので、『ヒャッホー』と叫びながら、「部屋の中を駆け足で走り回る」ことしかできません。

However, I don't have any friends to hug or pat each other on the shoulder and rejoice with, so all I can do is "run around the room," shouting, "Hyah-hoo!

残念です。

It's a shame.

それどろか、傍から見ると、私は『怖い人』かもしれません。

I am a scary person from the outside.

-----

以下、コラムから抜粋

The following is an excerpt from the column.

=====

しかし、ようやく10月29日(本当に30分程前に)、EtherCATスレーブでステッピングモーターを回すことに成功しました!

But finally, on October 29 (about 30 minutes ago), I turned a stepper motor with an EtherCAT enslaved person!

嬉しくて、家の中をピョンピョン飛び回っていたのですが、この喜びを共感できる人間が、江端家にはいない。

I was so happy that I was jumping around the house, but no one in the Ebata family could share this joy.

『うん、パパが嬉しいなら、私も嬉しいよ』と、食器を洗う手を止めないで生返事を寄越したのは、

"If you're happy, I'm happy," my lovely wife said, not stopping to wash the dishes, whose aphorisms is 

―― リトマス試験紙が、青になろうが赤になろうが、それが一体何だというの?

" What does it matter if the litmus test paper turns blue or red?"

という名言を残した、私の最愛の妻です。

=====

2024,江端さんの技術メモ

なんでもかんでも、ニューラルネットワークに突っ込む必要はないと思うんですよね。

/*
	c:\users\ebata\tomioka3b\src\others\main41.go

	このプログラムは、与えられた地点の緯度経度情報と京急富岡駅からの電車による移動時間を元に、スプライン補間を行い、特定の座標における移動時間を補間することを目的としています。

	Point 構造体は、地点の名前 (Name)、緯度 (Latitude)、経度 (Longitude)、移動時間 (min2Tomioka) の情報を保持します。
	convertToDataSet 関数は、Point 構造体の配列を受け取り、それを緯度、経度、標高の情報を含む二次元配列データセットに変換します。
	splineInterpolation 関数は、スプライン補間を行うための関数を返します。この関数は、与えられたデータセットを元に、スプライン補間に必要な計算を行います。
	main 関数では、与えられた地点の情報を元に Point 構造体のスライスが定義され、それを convertToDataSet 関数で二次元配列データセットに変換します。
	さらに、splineInterpolation 関数を使用してスプライン補間関数を生成し、特定の座標における移動時間を補間します。
	最後に、補間された値が出力されます。
	このプログラムは、地理空間データの補間処理に利用できる汎用的なスプライン補間関数を提供します。
*/

package main

import (
	"fmt"
	"sort"
)

type Point struct {
	Name        string
	Latitude    float64
	Longitude   float64
	min2Tomioka float64
}

// スプライン補間用の関数
func splineInterpolation(dataSet [][]float64) func(float64, float64) float64 {
	n := len(dataSet)

	// xの値を昇順にソートする
	sort.Slice(dataSet, func(i, j int) bool {
		return dataSet[i][0] < dataSet[j][0]
	})

	// トリディアゴナル行列を作成
	h := make([]float64, n-1)
	for i := 0; i < n-1; i++ {
		h[i] = dataSet[i+1][0] - dataSet[i][0]
	}

	// 2階微分の値を計算
	delta := make([]float64, n)
	for i := 1; i < n-1; i++ {
		delta[i] = (dataSet[i+1][1]-dataSet[i][1])/h[i] - (dataSet[i][1]-dataSet[i-1][1])/h[i-1]
	}

	// トリディアゴナル行列を解く
	m := make([]float64, n)
	l := make([]float64, n)
	zArray := make([]float64, n)
	l[0] = 1
	for i := 1; i < n-1; i++ {
		l[i] = 2*(dataSet[i+1][0]-dataSet[i-1][0]) - h[i-1]*m[i-1]
		m[i] = h[i] / l[i]
		zArray[i] = (delta[i] - h[i-1]*zArray[i-1]) / l[i]
	}
	l[n-1] = 1
	zArray[n-1] = 0

	c := make([]float64, n)
	b := make([]float64, n)
	d := make([]float64, n)
	for j := n - 2; j >= 0; j-- {
		c[j] = zArray[j] - m[j]*c[j+1]
		b[j] = (dataSet[j+1][1]-dataSet[j][1])/h[j] - h[j]*(c[j+1]+2*c[j])/3
		d[j] = (c[j+1] - c[j]) / (3 * h[j])
	}

	// 補間関数を返す
	return func(xVal, yVal float64) float64 {
		// xの範囲を確認
		if xVal < dataSet[0][0] || xVal > dataSet[n-1][0] {
			panic("x value is out of range")
		}

		// 対応するiを探す
		i := 0
		for i < n-1 && dataSet[i+1][0] <= xVal {
			i++
		}

		// スプライン補間を計算
		dx := xVal - dataSet[i][0]
		return dataSet[i][2] + b[i]*dx + c[i]*dx*dx + d[i]*dx*dx*dx
	}
}

func convertToDataSet(points []Point) [][]float64 {
	var dataSet [][]float64

	for _, point := range points {
		data := []float64{point.Latitude, point.Longitude, point.min2Tomioka}
		dataSet = append(dataSet, data)
	}

	return dataSet
}

func main() {
	points := []Point{
		{"日暮里", 35.72810551475649, 139.77065214505967, 73},   // 日暮里
		{"鶯谷", 35.72147285483459, 139.77803484630024, 63},    // 鶯谷
		{"上野", 35.71419330617392, 139.7774413019538, 57},     // 上野
		{"御徒町", 35.70752513412557, 139.7748544863164, 67},    // 御徒町
		{"秋葉原", 35.6983999333567, 139.77290571388025, 65},    // 秋葉原
		{"お茶の水", 35.69977763102643, 139.76447338219248, 61},  // お茶の水
		{"水道橋", 35.7020483726974, 139.75337286940393, 66},    // 水道橋
		{"神田", 35.691843953947895, 139.77075286750426, 63},   // 神田
		{"東京", 35.68127103173912, 139.76691023873528, 57},    // 東京
		{"有楽町", 35.67504451109795, 139.7629009441794, 59},    // 有楽町
		{"新橋", 35.6663876890884, 139.7580715945385, 55},      // 新橋
		{"浜松町", 35.65538959029243, 139.75707527127187, 54},   // 浜松町
		{"田町", 35.64573607270807, 139.7475731442898, 54},     // 田町
		{"品川", 35.628479993237924, 139.73869534241823, 43},   // 品川
		{"北品川", 35.62204337901307, 139.73929378869565, 50},   // 北品川
		{"青物横丁", 35.616530476669595, 139.74147241132803, 49}, // 新馬場
		{"青物横丁", 35.6089113073848, 139.74314516357873, 45},   // 青物横丁
		{"鮫洲", 35.60505014227371, 139.74226998316405, 50},    // 鮫洲
		{"立会川", 35.598565208786674, 139.73893538884946, 50},  // 立会川
		{"大森海岸", 35.58770513004266, 139.73546417819148, 51},  // 大森海岸
		{"平和島", 35.578786612348516, 139.7348957122944, 40},   // 平和島
		{"大森町", 35.572470928220454, 139.73209389290315, 53},  // 大森町
		{"梅屋敷", 35.56680589146817, 139.7282405712228, 53},    // 梅屋敷
		{"京急蒲田", 35.561346378009084, 139.72413782845052, 33}, // 京急蒲田

		{"雑色", 35.549501628543595, 139.71492252305998, 38},   // 雑色
		{"六郷土手", 35.540534565682265, 139.70758227692838, 34}, // 六郷土手

		{"糀谷", 35.55475500818507, 139.72947450479222, 40},   // 糀谷
		{"大鳥居", 35.55230710920823, 139.74016209480337, 45},  // 大鳥居
		{"穴守稲荷", 35.550433498630504, 139.7467475129522, 46}, // 穴守稲荷

		{"天空橋", 35.549323611239814, 139.75367380680967, 46},    // 天空橋
		{"京急川崎", 35.5330130222155, 139.70085261643172, 30},     // 京急川崎
		{"小島新田", 35.53497952289224, 139.74753015189842, 42},    // 小島新田
		{"八丁畷", 35.523294588264044, 139.69182471487903, 41},    // 八丁畷
		{"鶴見市場", 35.51795110131048, 139.68654897642313, 40},    // 鶴見市場
		{"京急鶴見", 35.507313116366205, 139.67793452856546, 34},   // 京急鶴見
		{"花月総持寺", 35.50045335293103, 139.67299835084395, 31},   // 花月総持寺
		{"生麦", 35.49532037586162, 139.66697084291033, 30},      // 生麦
		{"京急新子安", 35.48709301222138, 139.6554644900453, 29},    // 京急新子安
		{"子安", 35.484595747125226, 139.64499414507037, 32},     // 子安
		{"神奈川新町", 35.48089584236831, 139.63961808116608, 26},   // 神奈川新町
		{"京急東神奈川", 35.47728484644749, 139.63437152522133, 30},  // 京急東神奈川
		{"神奈川", 35.471042823081326, 139.62708525622278, 32},    // 神奈川
		{"京急横浜", 35.465974566273886, 139.6218737093478, 20},    // 京急横浜
		{"戸部", 35.45669353999209, 139.61954391949988, 27},      // 戸部
		{"日ノ出町", 35.445535830399635, 139.62677764713118, 25},   // 日ノ出町
		{"黄金町", 35.4398051861557, 139.6228192707623, 24},       // 黄金町
		{"南太田", 35.43704871593425, 139.61413963595152, 18},     // 南太田
		{"井土ヶ谷", 35.434049908914936, 139.6013697675809, 16},    // 井土ヶ谷
		{"弘明寺", 35.424392517088215, 139.59679056178064, 17},    // 弘明寺
		{"上大岡", 35.409119230795824, 139.59658257505384, 14},    // 上大岡
		{"屏風浦", 35.394628914972444, 139.61025512796533, 10},    // 屏風浦
		{"杉田", 35.38359625400674, 139.6158614781421, 3},        // 杉田
		{"京急富岡", 35.36713079862617, 139.6298755067998, 0},      // 京急富岡
		{"能見台", 35.36088096572114, 139.62943901110575, 1},      // 能見台
		{"京急金沢文庫", 35.34283976967888, 139.62161382892742, 3},   // 京急金沢文庫
		{"金沢八景", 35.33143644664979, 139.62019186432977, 6},     // 金沢八景
		{"野島公園", 35.33057520638215, 139.63154448609114, 17},    // 野島公園
		{"海の公園南口", 35.337221851530074, 139.63203843792144, 18}, // 海の公園南口
		{"海の公園芝口", 35.34207978297347, 139.6357948657779, 18},   // 海の公園芝口
		{"八景島", 35.34081263381398, 139.64082413734104, 20},     // 八景島
		{"六浦", 35.32276335943298, 139.61123194142903, 13},      // 六浦
		{"神武寺", 35.306362422782364, 139.59316695868543, 19},    // 神武寺
		{"逗子・葉山", 35.29593435944306, 139.5811992373588, 31},    // 逗子・葉山
		{"追浜", 35.3158514243523, 139.62481670534095, 15},       // 追浜
		{"京急田浦", 35.30091271311823, 139.62553483073157, 16},    // 京急田浦
		{"安針塚", 35.28681218160922, 139.64296751736376, 17},     // 安針塚
		{"逸見", 35.28064334099864, 139.6528184088048, 21},       // 逸見
		{"汐入", 35.280307747849356, 139.6624959442711, 19},      // 汐入
		{"横須賀中央", 35.27868971431925, 139.6700294865965, 20},    // 横須賀中央
		{"県立大学", 35.27046934794596, 139.6765472421848, 26},     // 県立大学
		{"堀ノ内", 35.263578813428, 139.68674190193195, 23},       // 堀ノ内
		{"新大津", 35.25692239324099, 139.69014415109714, 23},     // 新大津
		{"北久里浜", 35.2497686048071, 139.68628696286345, 25},     // 北久里浜
		{"浦賀", 35.250938172839675, 139.71498764424754, 30},     // 浦賀
		{"京急久里浜", 35.231585086558596, 139.7022284815838, 29},   // 京急久里浜
		{"YRP野比", 35.21207247285571, 139.68500815775707, 33},   // YRP野比
		{"京急長沢", 35.20555570645748, 139.67414472893097, 44},    // 京急長沢
		{"津久井浜", 35.19868000571067, 139.66570472891374, 37},    // 津久井浜
		{"三浦海岸", 35.188117336673066, 139.65328211521543, 39},   // 三浦海岸
		{"三崎口", 35.17752001890131, 139.633171976671, 42},       // 三崎口
	}

	dataSet := convertToDataSet(points)

	// スプライン補間関数を作成
	interpolatedFunction := splineInterpolation(dataSet)

	// 特定の座標で補間された値を計算
	xValue := 35.4688634
	yValue := 139.6268306

	xValue, yValue = 35.7214573, 139.7754384

	interpolatedValue := interpolatedFunction(xValue, yValue)

	// 結果の出力
	fmt.Printf("補間された値: %.2f\n", interpolatedValue)
}

 

2024,江端さんの技術メモ

//	c:\users\ebata\tomioka3b\src\others\main45.go

/*
	このプログラムは、与えられた複数の地点の中からランダムに1つを選択し、その地点を中心として半径500メートルの円内にランダムな地点を生成します。

	Point 構造体: 緯度と経度を表す構造体です。
	main 関数:
	与えられた複数の地点のリストを作成します。
	ランダムに1つの地点を選択します。
	選択された地点を中心として、generateRandomPointInCircle 関数を使用して半径500メートルの円内にランダムな地点を生成します。
	生成されたランダムな地点の緯度と経度を出力します。
	generateRandomPointInCircle 関数:
	中心となる地点と半径を受け取ります。
	ランダムな角度と距離を生成し、それらを使用して円内のランダムな地点の緯度と経度を計算します。
	計算された緯度と経度を持つ地点を返します。
	degToRad 関数:
	度をラジアンに変換するためのユーティリティ関数です。
	このプログラムは、与えられた地点の中からランダムに1つを選択し、その地点を中心として半径500メートルの円内にランダムな地点を生成することで、地理空間データを扱うための基本的な方法を示しています。
*/

package main

import (
	"fmt"
	"math"
	"math/rand"
	"time"
)

type Point struct {
	Name        string
	Latitude    float64
	Longitude   float64
	min2Tomioka float64
}

func main() {
	// 与えられた複数の点(駅の座標)
	points := []Point{
		{"日暮里", 35.72810551475649, 139.77065214505967, 73},   // 日暮里
		{"鶯谷", 35.72147285483459, 139.77803484630024, 63},    // 鶯谷
		{"上野", 35.71419330617392, 139.7774413019538, 57},     // 上野
		{"御徒町", 35.70752513412557, 139.7748544863164, 67},    // 御徒町
		{"秋葉原", 35.6983999333567, 139.77290571388025, 65},    // 秋葉原
		{"お茶の水", 35.69977763102643, 139.76447338219248, 61},  // お茶の水
		{"水道橋", 35.7020483726974, 139.75337286940393, 66},    // 水道橋
		{"神田", 35.691843953947895, 139.77075286750426, 63},   // 神田
		{"東京", 35.68127103173912, 139.76691023873528, 57},    // 東京
		{"有楽町", 35.67504451109795, 139.7629009441794, 59},    // 有楽町
		{"新橋", 35.6663876890884, 139.7580715945385, 55},      // 新橋
		{"浜松町", 35.65538959029243, 139.75707527127187, 54},   // 浜松町
		{"田町", 35.64573607270807, 139.7475731442898, 54},     // 田町
		{"品川", 35.628479993237924, 139.73869534241823, 43},   // 品川
		{"北品川", 35.62204337901307, 139.73929378869565, 50},   // 北品川
		{"青物横丁", 35.616530476669595, 139.74147241132803, 49}, // 新馬場
		{"青物横丁", 35.6089113073848, 139.74314516357873, 45},   // 青物横丁
		{"鮫洲", 35.60505014227371, 139.74226998316405, 50},    // 鮫洲
		{"立会川", 35.598565208786674, 139.73893538884946, 50},  // 立会川
		{"大森海岸", 35.58770513004266, 139.73546417819148, 51},  // 大森海岸
		{"平和島", 35.578786612348516, 139.7348957122944, 40},   // 平和島
		{"大森町", 35.572470928220454, 139.73209389290315, 53},  // 大森町
		{"梅屋敷", 35.56680589146817, 139.7282405712228, 53},    // 梅屋敷
		{"京急蒲田", 35.561346378009084, 139.72413782845052, 33}, // 京急蒲田

		{"雑色", 35.549501628543595, 139.71492252305998, 38},   // 雑色
		{"六郷土手", 35.540534565682265, 139.70758227692838, 34}, // 六郷土手

		{"糀谷", 35.55475500818507, 139.72947450479222, 40},   // 糀谷
		{"大鳥居", 35.55230710920823, 139.74016209480337, 45},  // 大鳥居
		{"穴守稲荷", 35.550433498630504, 139.7467475129522, 46}, // 穴守稲荷

		{"天空橋", 35.549323611239814, 139.75367380680967, 46},    // 天空橋
		{"京急川崎", 35.5330130222155, 139.70085261643172, 30},     // 京急川崎
		{"小島新田", 35.53497952289224, 139.74753015189842, 42},    // 小島新田
		{"八丁畷", 35.523294588264044, 139.69182471487903, 41},    // 八丁畷
		{"鶴見市場", 35.51795110131048, 139.68654897642313, 40},    // 鶴見市場
		{"京急鶴見", 35.507313116366205, 139.67793452856546, 34},   // 京急鶴見
		{"花月総持寺", 35.50045335293103, 139.67299835084395, 31},   // 花月総持寺
		{"生麦", 35.49532037586162, 139.66697084291033, 30},      // 生麦
		{"京急新子安", 35.48709301222138, 139.6554644900453, 29},    // 京急新子安
		{"子安", 35.484595747125226, 139.64499414507037, 32},     // 子安
		{"神奈川新町", 35.48089584236831, 139.63961808116608, 26},   // 神奈川新町
		{"京急東神奈川", 35.47728484644749, 139.63437152522133, 30},  // 京急東神奈川
		{"神奈川", 35.471042823081326, 139.62708525622278, 32},    // 神奈川
		{"京急横浜", 35.465974566273886, 139.6218737093478, 20},    // 京急横浜
		{"戸部", 35.45669353999209, 139.61954391949988, 27},      // 戸部
		{"日ノ出町", 35.445535830399635, 139.62677764713118, 25},   // 日ノ出町
		{"黄金町", 35.4398051861557, 139.6228192707623, 24},       // 黄金町
		{"南太田", 35.43704871593425, 139.61413963595152, 18},     // 南太田
		{"井土ヶ谷", 35.434049908914936, 139.6013697675809, 16},    // 井土ヶ谷
		{"弘明寺", 35.424392517088215, 139.59679056178064, 17},    // 弘明寺
		{"上大岡", 35.409119230795824, 139.59658257505384, 14},    // 上大岡
		{"屏風浦", 35.394628914972444, 139.61025512796533, 10},    // 屏風浦
		{"杉田", 35.38359625400674, 139.6158614781421, 3},        // 杉田
		{"京急富岡", 35.36713079862617, 139.6298755067998, 0},      // 京急富岡
		{"能見台", 35.36088096572114, 139.62943901110575, 1},      // 能見台
		{"京急金沢文庫", 35.34283976967888, 139.62161382892742, 3},   // 京急金沢文庫
		{"金沢八景", 35.33143644664979, 139.62019186432977, 6},     // 金沢八景
		{"野島公園", 35.33057520638215, 139.63154448609114, 17},    // 野島公園
		{"海の公園南口", 35.337221851530074, 139.63203843792144, 18}, // 海の公園南口
		{"海の公園芝口", 35.34207978297347, 139.6357948657779, 18},   // 海の公園芝口
		{"八景島", 35.34081263381398, 139.64082413734104, 20},     // 八景島
		{"六浦", 35.32276335943298, 139.61123194142903, 13},      // 六浦
		{"神武寺", 35.306362422782364, 139.59316695868543, 19},    // 神武寺
		{"逗子・葉山", 35.29593435944306, 139.5811992373588, 31},    // 逗子・葉山
		{"追浜", 35.3158514243523, 139.62481670534095, 15},       // 追浜
		{"京急田浦", 35.30091271311823, 139.62553483073157, 16},    // 京急田浦
		{"安針塚", 35.28681218160922, 139.64296751736376, 17},     // 安針塚
		{"逸見", 35.28064334099864, 139.6528184088048, 21},       // 逸見
		{"汐入", 35.280307747849356, 139.6624959442711, 19},      // 汐入
		{"横須賀中央", 35.27868971431925, 139.6700294865965, 20},    // 横須賀中央
		{"県立大学", 35.27046934794596, 139.6765472421848, 26},     // 県立大学
		{"堀ノ内", 35.263578813428, 139.68674190193195, 23},       // 堀ノ内
		{"新大津", 35.25692239324099, 139.69014415109714, 23},     // 新大津
		{"北久里浜", 35.2497686048071, 139.68628696286345, 25},     // 北久里浜
		{"浦賀", 35.250938172839675, 139.71498764424754, 30},     // 浦賀
		{"京急久里浜", 35.231585086558596, 139.7022284815838, 29},   // 京急久里浜
		{"YRP野比", 35.21207247285571, 139.68500815775707, 33},   // YRP野比
		{"京急長沢", 35.20555570645748, 139.67414472893097, 44},    // 京急長沢
		{"津久井浜", 35.19868000571067, 139.66570472891374, 37},    // 津久井浜
		{"三浦海岸", 35.188117336673066, 139.65328211521543, 39},   // 三浦海岸
		{"三崎口", 35.17752001890131, 139.633171976671, 42},       // 三崎口
	}

	// ランダムな点を選択
	rand.Seed(time.Now().UnixNano())

	for i := 0; i < 1000; i++ {

		randomIndex := rand.Intn(len(points))
		center := points[randomIndex]

		// 中心点から半径500メートルの円内にランダムな点を生成
		randomPoint := generateRandomPointInCircle(center, 500)

		//fmt.Printf("Random Point in Circle: Latitude=%f, Longitude=%f\n", randomPoint.Latitude, randomPoint.Longitude)
		fmt.Printf("%f, %f\n", randomPoint.Latitude, randomPoint.Longitude)
	}

}

func generateRandomPointInCircle(center Point, radius float64) Point {
	// ランダムな角度を生成
	randAngle := rand.Float64() * 2 * math.Pi
	//fmt.Printf("randAngle=%f\n", randAngle)

	// ランダムな距離を生成
	randDistance := math.Sqrt(rand.Float64()) * radius
	//fmt.Printf("randDistance=%f\n", randDistance)

	// ランダムな点の座標を計算

	randLat := center.Latitude + (randDistance/6371000.0)*(180/math.Pi)*(math.Cos(randAngle))
	randLon := center.Longitude + (randDistance/6371000.0)*(180/math.Pi)*(math.Sin(randAngle))/(math.Cos(degToRad(center.Latitude)))

	return Point{Latitude: randLat, Longitude: randLon}
}

func degToRad(deg float64) float64 {
	return deg * (math.Pi / 180)
}

2024,江端さんの忘備録

久しぶりに、YouTubeを見ていました。

For the first time in a long time, I was watching YouTube.

酒に関しては、私も再三話題にしてきましたが、私(江端)のデメリットとメリットを羅列するとこんな感じでしょうか。

As for alcohol, I have talked about it again and again, but if I (Ebata) were to list the disadvantages and advantages, it would be something like this.

■お酒をやめたことによる、江端のデメリット

■Disadvantages of Ebata's quitting drinking alcohol

- 『お酒を楽しむことができない』という絶望感(今も絶望している)

- I despair (and still despair) that I will never be able to enjoy alcohol.

- 思い出でしか、"酒"を語れなくなった

- I can only talk about "sake" in my memories.

- 睡眠薬と安定剤が、定常的に必要となった

- I need Sleeping pills and stabilizers on a steady basis.

- 飲み会が、さらに嫌いになった

- I hated drinking even more.

- ノンアルコールビールの消費量がハンパなくなった

- My consumption of non-alcoholic beer has increased

酒を楽しめない人生は、本当につまらないし、辛い。

■お酒をやめたことによる、江端のメリット

■Advantages of Ebata's quitting drinking alcohol

- 体重が落ちた

- Lost weight.

- 肩が凝らなくなった

- Shoulders are no longer stiff.

- 仕事で踏ん張りが効くようになった

- I'm able to stand my ground at work.

- 昼寝が普通にできるようになった

- My naps are now regular.

- 人間ドックからの警告が来なくなった

- No more warnings from the human health inspectors.

『酒を楽しめない人生は、人生の半分を損している』のは事実だと思いますが ―― 大丈夫です。

-----

嫁さんからは、「週末だけ飲む」とか「年末だけ飲む」とか言う『アルコール制御』はできないのか、と尋ねられます。

My wife asks me if I can't 'control alcohol' by saying I only drink on weekends or at the end of the year.

しかし、私は不器用なので、そういう『アナログ制御』が上手くできません。そのため『デジタル制御』とせざるを得ないのです。

However, I am too clumsy to perform such "analog control" well. Therefore, I have no choice but to use digital control.

-----

『「酒は百薬の長」は偽説で「酒は100%毒薬」が真説』という、WHOの主張は正しいのかもしれません。

The WHO may be correct in its assertion that "alcohol is the best of all medicines" is a false theory, and "alcohol is 100% poison" is the true theory.

しかし、酒にモルヒネや覚醒剤や麻薬のような依存性がある薬物であったとしても、法律が認めるのであれば合法です。

However, even if alcohol is an addictive drug like morphine, methamphetamine, or narcotics, it is legal if the law allows it.

タバコも、臭い空気を撒き散らさないのであれば、私は喫煙者を批難しません。

I don't criticize smokers as long as they don't spread stale air.

加えて、逆に酒とタバコが寿命を短くして、社会保障費を抑制する効果があれば、歓迎すらできます。

In addition, if, on the contrary, alcohol and tobacco have the effect of shortening life expectancy and curbing social security costs, this would even be welcome.

実際、酒とタバコの税金は、国家財政的には美味しいです。

Taxes on alcohol and tobacco are delicious from a state fiscal perspective.

私、以前、自分でお酒を作っていたので、お酒の原価コストを知っていますし、タバコについてもざっくり理解しています。

I used to make my alcohol, so I know the cost of alcohol and have a rough understanding of tobacco.

ビールが、水道水+αくらいの値段で作れるということが分かってしまし、結構ショックを受けました(ちなみに、こちらのコラムの内容は、すでに時効が成立しています)。

I was pretty shocked when I found out that beer can be made for about the price of tap water +/- (by the way, the statute of limitations has already passed on the contents of this column).

私には、酒もタバコも、『自分の体を壊しながら、納税し続ける』という観点からは、『国家による霊感商法』の様にも見えますが ―― それでも、合法です。

To me, both alcohol and cigarettes seem to be "state-sponsored psychic sales" from the perspective of "continuing to pay taxes while destroying one's own body" -- but still, they are legal.

こちらに、たばこ会社による、「喫煙者の早世による、年金額の削減効果の話」があります。

あなたの「ウンコの匂い」を嗅がされる人の「苦痛」に想いを馳せましょう。「ウンコ」はトイレで、「タバコ」は分煙室で。 ―― JT

Here is a story by a tobacco company about the effect of reduced pensions due to the premature death of smokers.

-----

WHOや各政府の努力によって、年々喫煙率は下がっています。

Thanks to the efforts of WHO and various governments, the smoking rate is decreasing year by year.

(とは言え、私が思っていた程には減っていない、という感じがします)

(I feel it has not decreased as much as I had hoped.)

政府の次のターゲットは、多分「酒」です。

The government's next target is probably "alcohol".

私は、今、大学生をやっていますが、キャンパスで喫煙している大学生を見たことありません(本当)。

I am a college student and have never seen a college student smoking on campus (true).

「酒」による社会保障費の増大が定量的に明かになれば、政府は国家の存亡をかけて『禁酒キャンペーン』に舵を取るだろうな、と考えています。

I believe that if the increase in social security costs caused by alcohol becomes quantitatively precise, the government will turn to a "prohibition campaign" with the very survival of the nation at stake.

2024,江端さんの忘備録

昨日は、実験装置を詰め込んで鉄の塊のようになった旅行用のキャリーバッグを、ゼイゼイ言いながら運んでいました。

Yesterday, I was carrying a travel carry-on bag stuffed with experimental equipment, which had become like a lump of iron

運び方を間違えれば、『一発で「腰」をやられる』と思ったので、移動中は、全て、障がい&シニア向けの装置(エレベータ、エスカレータ)を使っていました。

I thought that if I made a mistake in carrying the equipment, I would get "strained back in one shot," so I used equipment for people with disabilities & seniors (elevators and escalators) for all of my transportation.

-----

―― 20代のころから、1mmも進歩していない

" I have not progressed one millimeter since my twenties."

と、思わず涙ぐみそうになりました。

I was almost in tears.

私の未来予想図では、『こういう作業は若い部下に命じて、私はちょっと良い服と靴の装いで、お客さまと、にこやかに会話をしている、ダンディなシニア』だったのですが ―― 今の私は『ただのシニア』です。

In my vision of the future, I had envisioned "a dainty senior who orders his younger subordinates to do this kind of work, and I am dressed in a slightly more formal dress and shoes, having a nice conversation with customers" -- but the result was "just senior."

『若者よ、大志を抱くな、後がツラい』

"Boys, don't be ambitious. It's going to be hard later."

来月、北海道大学に行ってくるので、クラーク像の前で、このフレーズを叫んでみたいです。

I am going to Hokkaido University next month and would like to shout this phrase in front of the Clark statue.

(まあ、多分やらないです。会社と大学に迷惑かけそうだから)

(Well, I probably won't do it. I'm afraid I'll get in trouble with the company and the university.)

-----

昨日、駅まで自動車で迎えにきてくれた娘と会話をしました。

Yesterday, I talked with my daughter, who drove me to the train station.

娘:「相変わらずハードだねえ。先日、『パパが倒れたら、驚くよりも前に、"それな"と言う』とママと話ていた」

Daughter: "You are as hard as ever. The other day, my mom and I talked about how when you collapse, we might say, 'We knew it was going to happen,' before we get surprised."

私:「今や、『いつ』『どこで』倒れるか、という予測フェーズに入っていると思う」

Me: "I think I am now in the speculation phase of 'when' and 'where' I will collapse."

娘:「そこまで分かっているなら・・・」

Daughter: "If you know that much..."

私:「でも、じいちゃん(私の亡き父)のハードには、もう、全然届かないよ。父の仕事を手伝っていた時、中学生だった私が『死ぬかもしれない』と思えるほど、キツかった」

Me: "But I can't reach Grandpa's (my late father) "hard" anymore. When I was helping my father with his work, it was so hard that I, as a junior high school student, thought, 'I might die.'"

娘:「じいちゃんは"違う"よ。あの人を基準にしたらダメだよ」

Daughter: "Grandpa is out of scope. We can't hold him to that standard.

-----

一昨年前、私のチームのリーダが、リモート会議中にしゃべらなくなったことがありました。

A year ago, my team leader stopped speaking during a remote meeting.

『通信障害かデバイスの故障だろう』と思っていたところ、翌日、お亡くなりになっていたことが判明し、チームが大パニックに陥りました(私は、そのミーティングには参加していなかったですが)。

They thought, 'It's probably a communication failure or a device malfunction,' but the next day, we found out that he had passed away, and the team was in a panic (I was not at that meeting).

私がつらかった時(フィールド実証実験の最中)に、バックエンドで助けて頂いた方でもありましたので、あの時は、相当なショックを受けました。

He also helped me on the back end when I was going through a tough time (during the field demonstration), so I was pretty shocked then.

―― もう人生で二度と関わりたくない文化祭

私が、その事件について、関係者の一人に具体的に聞き出せたのは、それから半年の後です。私にとって、それくらいの衝撃だったのです。

It was not until six months later that I could ask one of the people involved about the incident specifically. It was such a shock to me.

-----

ただ、このような人生を変えるような衝撃を受けても、結局のところ、私は、自分のライフスタイルに大きな変更を施すことができていません。

However, despite this life-changing impact, I have not been able to make any significant changes to my lifestyle.

そんな自分が「愚か者」であるという自覚はあります。

I am aware that I am such a "fool.

しかし「自分を変える」というのは、それほどに難しいことなのだ、ということも実感しています。

However, I also realize that "changing oneself" is so tricky.

2024,江端さんの技術メモ

sudo apt update

をやったのですが、

E: Release file for http://ports.ubuntu.com/ubuntu-ports/dists/jammy-updates/InRelease is not valid yet (invalid for another 8時間 53分 33秒). Updates for this repository will not be applied.

E: Release file for http://ports.ubuntu.com/ubuntu-ports/dists/jammy-security/InRelease is not valid yet (invalid for another 9時間 9分 22秒). Updates for this repository will not be applied.

などと言われてしまいました。

で、しらべてみたら、

  1. システム時刻を確認する: 時々、システムの時刻が間違っている場合にもこのエラーが発生することがあります。システムの時刻が正しいことを確認してください

てなことをいわれたので、以下の処理で対応しました。

sudo timedatectl set-timezone Asia/Tokyo

sudo apt install ntp

とりあえず、今回は、これで上手く対応できたようです。

2024,江端さんの技術メモ

昨夜、8台目のディスプレイと6台目のカメラが搬入されました。個人デートレーダに匹敵する環境になったような気がします。

気分は、学生のころは、研究室に寝袋持ち込んで、コーディングしたいたものですが −− リタイアを目前としたシニアエンジニアとは思えない状況です(と、この内容を打ち込んでいる最中も、バックエンドで、”sudo apt upgrade”が動き続けています)。

で、

Raspberry Pi 4でUbuntuデスクトップを動かして遊ぶ

を、参考にさせていただいて、vscodeをインストールしてみたのですが、普通に動く。

結構びっくりしています。

これからは、ディスプレイがあるところ(会社とか研究室)なら、ラズパイ4を持ち歩くだけで、十分かもしれません。

とりあえず拡張機能として、当然に

Japanese Language Pack for Visual Studio Code

をインストール。

で、文章作成環境も必須なので、こちらもインストールしておく

江端風、最小コストで電子書籍(PDF)を作ってアプロードする方法

vscodeでMarkdownを使って文章を書いている時、図面のコピペを文書の中にサクっと入れることができるアドイン "Paste Image"

2台目のラズパイ用にメモとして残しています。