2024,江端さんの忘備録

私は興味のある技術は、コストと時間に見合えば、一度試してみたい方です。

I am willing to try any technology that interests me once it is worth the cost and time.

そして、その結果は、会社の秘密情報や会社の不利益になる内容では"ない"と判断すれば、公開することがあります。

The results may be disclosed to the public if we determine that the information is not "confidential" or detrimental to the company.

これは、遵法精神でもなければ、いわんや愛社精神でもありません ―― 約束(契約)です。

This is not a law-abiding spirit or love for the company; it is a promise (contract).

忘れないでください ―― 私は「会社の犬」です。

実際、私の持ちネタは、もっと沢山あって、その中には『墓の中まで持っていく』と決めているものもあります。

I have many more stories, some of which I have decided to 'take to my grave.

それはさておき。

Aside from that.

-----

私は、興味のある技術を試すことは楽しいですが、興味のない技術をやらされることは苦痛です。

I enjoy experimenting with techniques I am interested in, but being forced to do techniques I am not interested in is painful.

実際に、直感的に『この技術はダメだ』と思えるものがあります。

I have a technique that intuitively tells me, 'This technique is no good.

例えば、バズワードと言われているものです。

For example, they are known as buzzwords.

私は、そういう技術には近付かないようにしているのですが、業務命令で、それらに取り組まなければならないこともあります。

I try to avoid those technologies, but sometimes, I have to work on them because of work orders.

予想通り、ダメダメだったこともありますが、しぶしぶ取り組んでいたら、これが意外に面白くなったりすることもあります。

Occasionally, as expected, it was a no-no, but this can be surprisingly interesting if I am reluctant to work on it.

とは言え、ダメダメでも、ダメダメでなくても、業務命令であれば、一定の成果を出さなければなりません。

Nevertheless, if it is a no-no or not, certain results must be achieved if it is a work order.

ダメダメだと思っている技術の仕事を命じられて、予想通りにダメダメな結果を出して、それを理由に上長や幹部から叱責されることがあります ―― これは理不尽で辛いことです。

I may be assigned to work on a technology that I think is no good, produce predictably bad results, and then be reprimanded by my superiors and executives for it -- this is unreasonable and painful.

何が言いたいかというと、

What I'm trying to say is,

―― 私たちは、自分の人生を自分でコントロールできない

"We are not in control of our own lives."

という、ありふれた話です

It is a common story.

今、次女が、絶賛、就活中です。

Right now, my second daughter is job hunting, to great acclaim.

それを見ながら、『彼女も、これから、自分でコントロールできない人生を歩み始めるのだな』と思うと、せつない気持ちになります。

As I watched, I felt sad, thinking, 'She, too, is going to start a life she cannot control.

それはさておき。

Aside from that.

-----

30%:50%:70%の法則 ―― 大学、高校、中学の卒業生が、3年以内に離職する比率です。

The 30%:50%:70% rule is the ratio of college, high school, and secondary school graduates who leave the workforce within three years.

これは、ここ20年間変化がありません。

This has not changed in the last 20 years.

この法則を「悲劇」と見るか、「当然」と見るかは、人によって違うと思います。

Whether one sees this law as "tragic" or "deserved" depends on one's point of view.

しかし、現在の政府の掲げている目標『労働人口の流動化』という観点から見れば、逆の見方ができます。

However, from the perspective of the current government's stated goal of "workforce mobility," the opposite can be seen.

90%:90%:90%の法則 ―― 新入社員の9割が3年以内に離職する世界の実現。これができれば、日本の労働人口の流動は確実になります。

The 90%:90%:90% rule is a world in which 90% of new hires leave their jobs within three years. If this can be achieved, the fluidity of the Japanese workforce will be assured.

もっとも、それで生産性が上がるかどうかは分かりませんが(まあ、下るでしょう。それも劇的に)。

I don't know if it will increase productivity (well, it will decrease...dramatically).

-----

労働人口の流動性は、

The mobility of the workforce is,

(1)新しく生まれた仕事が、誰にとっても楽しい仕事になるわけではない

(1) Not all newly created jobs will be enjoyable for everyone.

(2)新しく生まれた仕事に対応する為には、また最初から勉強をしなおす必要がある

(2) To cope with the newly created work, it is necessary to study all over again from the beginning.

という現実に向き合う必要があります。

We need to face the reality that

どっちにしても、労働人口の流動化は、多くの人の考える気持ち、「面倒くさい」によって阻まれている、というのは事実でしょう。

Either way, it is probably true that the mobility of the workforce is hampered by what many people consider a "hassle.

好きなことであれば、勉強しなおすことも苦痛ではないでしょうが ―― 基本的に、多くの人にとって、勉強は、苦痛です。

If it's something you love, it won't be painful to study again -- but, for many people, studying is painful.

「一度苦労して覚えたことだけを使って、残りの人生をラクして食っていきたい」と思うのは、だれにとっても自然なことなのですから。

It is natural for anyone to want to "make the rest of my life easy, using only what I have learned through hard work.

未分類

組織から「やれ」と言われたら、なんでもやるのがサラリーマンです。

とは言え、『この歳になって、Java(×JavaScript)かぁ』と、少々意外な感じです。

私、C/C++, Go, Python、SQL、JavaScriptは、普通にしゃべれますが、そのすきまを狙ったかのような"Java"とは ―― うん、面倒ですが、仕方ありません。

という訳で、今、VSCodeの環境にJava開発環境を仕込んでいます。

しかし、こんなトラブルが発生していて、ChatGPTと議論をしていました。

public class App {
public static void main(String[] args) throws Exception{
System.out.println("Hello, World!");
}
}
vscodeを使って、F5で実行しようとしたのですが、
Missing artifact org.json:json:jar:20140107
Missing artifact redis.clients:jedis:jar:2.7.2
等がでてきます。
コマンドからはちゃんとコンパイルして実行できるようですが。

色々教えて貰い、他のツールを入れたりしないように言われましたが、VSCodeの拡張機能で、同じような機能入っているようなので、『???』となやんでいました。

で、今回は、こちらが私には当たりでした。

VSCodeでJavaを始める方法(環境構築)

まあ、Javaだろうと、C/C++だろうと、Goだろうと構いません。今回の私の真の目的は、Github Copilotの攻略ですから。

GitHub Copilotが『怖い』件

以前、ChatGPTの登場で、英語の教師が本気でヤバイかもしれない、とか書きました。

私は生れて始めて『AI技術による廃業』の予感を感じました ―― 最初の犠牲者は、語学教師です。

Copilotでは、ソフト外注が ―― というか、今なお、現場でコーディングをやっている、この私(江端)が、本気でヤバい。

しかし、これ、もしかしたら、良い意味で「ヤバい」かもしれません。

ChatGPTやGitHub Copilotと、ガチで語り合えるスキルがあってこそ、彼らを使い倒すことができると思えるからです。

生成AIを使い倒す技能は、場数を踏んできたシニアの方が上手いと思う。

だから、これはチャンスだ ―― と、そう思うことにします、当面の間は。

2024,江端さんの忘備録

私の会社では、公費のやり取りは、全て会社が発行しているクレジットカードで行うことになっています。

At my company, all public expense transactions are to be made with a credit card issued by the company.

領収書でもできなくはないのですが、例外的で、かつ、処理が面倒くさいです。

It is not impossible to do this with receipts, but it is both exceptional and cumbersome.

最近のニュースを見るたびに、

Every time I see the news these days, I think 

『国会議員(とその職員用)の専用のクレジットカードを発行すれば足りだろう』

It would be sufficient to issue a credit card exclusively for members of parliament (and their staff).

って思っています。

もちろん、国会議員の仕事の中には、公にはできない仕事もあるでしょう ―― 例えば、政敵や海外の要人を暗殺する為に、ゴルゴ13を雇う、とか。

Of course, there are some jobs that members of Congress can't do publicly -- for example, hiring Golgo 13 to assassinate political opponents or foreign dignitaries.

ですから、このクレジットカードには、新しい費目を設けることにします。

Therefore, this credit card will be established, including a new expense item.

『秘密業務に関わる事項』

"Matters Related to Secret Services"

を付ければ良いと思います。

私たち国民も、「キレイごとで政治はできない」という度量を見せて、この『秘密業務に関わる事項』の費目を認めましょう。

We, the people, should also show consideration that "politics cannot be done neatly" and approve this "Matters Related to Secret Services" expense item.

私は、『秘密業務に関わる事項』の内容が開示できないのは仕方がないとしても、その規模感(金額のケタ数)だけでも知りたいのです。

I would like to know at least a sense of the scale (number of digits of the amount) of the 'confidential business matters,' even if it is inevitable that the details of the 'Matters Related to Secret Services' cannot be disclosed.

-----

まあ、この提案の一番の問題は、

Well, the main problem with this proposal is,

『ゴルゴ13が、クレジットカード支払いに応じてくれるか』

Will Golgo 13 accept credit card payments?"

という点にあると思います。

しかし、これからは、テロリストも、キャシュレスに対応しなれば、やっていけないと思うのですよね。

However, I think that from now on, terrorists will not be able to do without cashless support.

そういう意味では、<北>の「サイバー攻撃による暗号資産の窃盗」は、なかなか良いケーススタディだと思います。

In that sense, <North>'s "Theft of Crypto Assets through Cyber Attack" is an excellent case study.

『ゴルゴ13が、ある組織(国連軍とか日本国の自衛隊)などに属して、組織に忠誠を誓う』

 

2024,江端さんの忘備録

北朝鮮が、ミサイル発射実験を繰り返しています。

North Korea has repeatedly conducted missile launch tests.

この実験は、国際的(正確には国連加盟国の西側陣営)に批判されています。

The experiment has been criticized internationally (more precisely, by the Western camp of UN member states).

しかし、ミサイル開発技術者の視点からすれば ―― 『実験は、多ければ多いほどよい』というと思うのは当然です。

But from a missile development engineer's point of view -- "the more tests, the better.

基本的に、技術開発とは、失敗の蓄積であり、失敗は『金銭に替えられないほどの価値になる』からです。

Technological development is the accumulation of failures because they become so valuable that money cannot replace them.

-----

で、ふと思ったのですが、今、ウクライナとロシアで、膨大な武器が使われていますが、そのような映像を見るたびに、私は不思議に思っています。

And it occurred to me that every time I see such images of the vast amount of weapons now being used in Ukraine and Russia, I wonder.

―― いったい、これらの兵器は、どこで実験やっているんだ?

"Where on earth are these weapons being tested?"

実験なしに、兵器製造などできるわけありません。

There is no way to manufacture weapons without experimentation.

もちろん、屋内実験も、コンピュータによるシレーションも可能ですが、最終的にはフィールド(屋外)実験なくしては、兵器の信頼性を測ることはできません。

Of course, indoor testing and computerized silation are possible, but a weapon's reliability cannot be measured without field (outdoor) testing.

もちろんニュースになっていない兵器の誤動作の事故もあるでしょうが、そういう兵器は市場価値を失うことになります。

Of course, there will be accidents of malfunctioning weapons that are not in the news, but such weapons will lose their market value.

兵器も、製品である以上、スペック通りに動かせてナンボです。

Weapons, as products, must be able to operate according to specifications.

-----

ところで、現政権は、これまでの政権がやりたくても、どうしてもできなかったことを、サクサクと実現しつつあります。

By the way, the current administration is quickly accomplishing what previous administrations wanted to do but just couldn't.

「防衛装備移転三原則」は、その1つです。

The "Three Principles on Defense Equipment Transfer" is one of them.

私、防衛に関する法律は疎いのですが、これ特許法的に言えば「間接侵害」のアナロジーに似ています(さらに分からなくなったかもしれませんが)。

I'm unfamiliar with defense law, but this is similar to the "indirect infringement" analogy in patent law terms (which may be even more confusing).

で、我が国で、輸出用の大陸弾道弾ミサイルの開発が公に認められたとしたら、『我が国は、そのミサイルをどこでフィールド実験やるのだろう』と、気になります。

So, if the development of a continental ballistic missile for export is publicly approved in our country, I wonder, 'Where is our country going to field test that missile?

世界に冠たる平和憲法を有する我が国において、こんな話は、本当に不愉快に感じる方がいると思いますし、そう信じたい。

In our country, which has a world-class peace constitution, I believe and would like to believe that some people would be uncomfortable with such a story.

ですが、もう、私たちは、今のうちに、腹を括っておいた方がいいかもしれません。

But perhaps we should all be gutted by now.

K君の話

2024,江端さんの忘備録

昨日、「ジョジョ・ラビット(2020)」を『楽しい映画』と称しましたが、訂正します。

Yesterday, I referred to "Jojo Rabbit (2020)" as a "fun movie," but I stand corrected.

で、私は、今日も今日とて、プログラムの量産中です。

あれは、真剣に見なければならない映画 ―― 『凄い映画』でした。

That movie had to be taken seriously -- a "great movie."

私の話を聞いて嫁さんも視聴したのですが、彼女のコメントを聞いて、私はその内容にショックを受けました。

My wife watched it after hearing me speak, and I was shocked at what she said about it.

さらに、映画に関するネットのコメント欄を読んで、5つぐらいの伏線を知って、今、衝撃を受けております。

Furthermore, after reading the online comments section about the movie, I was shocked to learn about five or so foreshadowing lines.

『コメント読みながら、その場面の意味を知って、泣きそうになる』という、訳の分からない感情に押し流されています。

I'm being swept away by an unexplainable feeling of 'I'm about to cry because I know what the scene means as I read the comments.

いずれにしても、

In any case,

―― 私の考察/洞察力は、浅すぎる

"My considerations/insights are too shallow."

と、激しい自己嫌悪に陥っています。

I am in a state of intense self-loathing.

-----

今、私の中では、「ジョジョ・ラビット」が「夢の香り」に追いつく勢いです。

"Jojo Rabbit" is catching up to "Scent of a Woman."

Let me see... It's "Scent of a woman" (セント・オブ・ウーマン(邦名「夢の香り」)

 

2024,江端さんの忘備録

私は、『コーディングしながら映画をななめ見する』という、映画を愛している人から激怒されても仕方がない、という視聴をしています。

I have a viewing practice of 'slumbering through a movie while coding,' which is something that should be infuriated by people who love movies.

それについては、堪忍して頂くととて、今日は2つばかり、映画について書きます。

I will leave it at that and write about two movies today.

(1)ラーゲリより愛を込めて(2022)

(1)"Love from the Camp"

これ、2022年の話題の邦画でした。

This was the hottest Japanese film of 2022.

妙な既視感があり、視聴後にちょっと調べてみたところ やっぱりありました。1993年にテレビで放送されていました。

I had a strange sense of déjà vu, and after watching it, I did a little research. There it was: it was broadcast on TV in 1993.

こっちの方を見たくなって、YouTubeとか探っているのですが、現時点で見つかっていません。

I'd like to see this one, and I've been exploring YouTube and the like, but I haven't found it yet.

私、この時のテレビドラマの方での衝撃がもの凄かったのです ―― 『遺言を記憶で運ぶ』というメソッド(方法)に、驚愕し、そして、深く感動いたしました。

I was shocked by the TV drama at that time -- I was astonished and deeply moved by the method of "carrying the will in memory."

まあ、そういう個人的な背景もあり、映画の方はあまり集中できませんでした(収容所がちょっとキレイすぎるなぁ、とか、いらんことが気にかかってしまいました)。

Because of this personal background, I could not concentrate much on the movie (I was bothered by unnecessary things, like the camps being a bit too beautiful).

ラーゲリーについては、個人的には、船戸与一さんの「満州国演義」がお勧めです(図書館で借りてきたのですが、重い(重量が)本でした。今は文庫になっているようです)。

Regarding Lagerie, I recommend "Manchukuo Engi" by Yoichi Funado (I checked it out from the library, but it was a heavy (weight) book. It seems to be in a library now).

そういえば、先日、実写版の「ゴールデンカムイ」についても語りましたが、私としては「蝦夷地別件」も強くお勧めします。

I recently talked about the live-action version of "Golden Kamui." I would also highly recommend "Ezochi Betsuden."

-----

(2)ジョジョ・ラビット(2020)

(2)Jojo Rabbit(2020)

以前から申し上げているように、私、現存して、公に放映されているアウシュビッツの映像は、全て見たと思っていますし、ドキュメンタリーや映画なども、落さずに見ています。

As I have said before, I believe I have seen all the existing and publicly televised images of Auschwitz, as well as documentaries and films, without dropping them.

で、まあ、

And, well,

―― 江端さんって、ナチズムの信奉者なのですか?

このような誤解もされているのですが ―― 繰り返しますが、私のスタンスは『ファッキン、ナチ』です。

There is also this misunderstanding -- again, my stance is "Fuck, Nazi."

この映画は、ヒトラーユーゲントに入る前の子ども(?)の視点から見た、ナチズムに対するコミカルとシリアスのバランスのれた、楽しい映画でした。

This film was a fun film that balanced the comical and the serious against Nazism from the point of view of a child(?) before he joined the Hitler Youth.

ナチスのコンテンツに疲れていた私には、ほっとした気持ちになれる映画でした。

I was tired of the Nazi content, and this film was a relief to me.

どちらも、アマプラで視聴できます。

Both are available on Amazon Prime.

-----

で、私は、今日も今日とて、プログラムの量産中です。

As of today, I am still in mass production of the program.

2024,江端さんの技術メモ

3次元を取り扱うDBSCANプログラム

このプログラムでは、同一座標は1つの座標として纏められてしまって、異なるユーザの座標として取り扱ってくれません。

これに対応するために修正したプログラムは以下の通りです。

// ~/tomioka_school/src/trip_school/dbscan_3d_2.go



package main

import (
	"fmt"
	"math"
)

// Point represents a 3D point with coordinates x, y, and t
type Point struct {
	User string
	X, Y, T float64
}

// DistanceTo calculates the Euclidean distance between two 3D points
func (p Point) DistanceTo(other Point) float64 {
	dx := p.X - other.X
	dy := p.Y - other.Y
	dt := p.T - other.T
	return math.Sqrt(dx*dx + dy*dy + dt*dt)
}

// Cluster represents a cluster of points
type Cluster struct {
	Points []Point
}

// DBSCAN performs density-based clustering of 3D points
func DBSCAN(points []Point, epsilon float64, minPts int) []Cluster {
	var clusters []Cluster
	var visited = make(map[string]bool)

	for _, point := range points {
		pointKey := fmt.Sprintf("%s,%f,%f,%f", point.User, point.X, point.Y, point.T)
		if visited[pointKey] {
			continue
		}
		visited[pointKey] = true

		neighbours := getNeighbours(points, point, epsilon)
		if len(neighbours) < minPts {
			continue
		}

		var clusterPoints []Point
		expandCluster(&clusterPoints, points, visited, point, neighbours, epsilon, minPts)
		clusters = append(clusters, Cluster{Points: clusterPoints})
	}

	return clusters
}

// getNeighbours returns all points within distance epsilon of the given point
func getNeighbours(points []Point, point Point, epsilon float64) []Point {
	var neighbours []Point
	for _, other := range points {
		if point.DistanceTo(other) <= epsilon {
			neighbours = append(neighbours, other)
		}
	}
	return neighbours
}

// expandCluster expands the cluster from the given point
func expandCluster(cluster *[]Point, points []Point, visited map[string]bool, point Point, neighbours []Point, epsilon float64, minPts int) {
	*cluster = append(*cluster, point)
	for _, neighbour := range neighbours {
		neighbourKey := fmt.Sprintf("%s,%f,%f,%f", neighbour.User, neighbour.X, neighbour.Y, neighbour.T)
		if !visited[neighbourKey] {
			visited[neighbourKey] = true
			neighbourNeighbours := getNeighbours(points, neighbour, epsilon)
			if len(neighbourNeighbours) >= minPts {
				expandCluster(cluster, points, visited, neighbour, neighbourNeighbours, epsilon, minPts)
			}
		}
	}
}

func main() {
	points := []Point{
		{"A", 1, 2, 0},
		{"A", 1.5, 1.8, 1},
		{"A", 5, 8, 2},
		{"A", 8, 8, 3},
		{"A", 1, 0.6, 4},
		{"A", 9, 11, 5},
		{"A", 8, 2, 6},
		{"A", 10, 2, 7},
		{"A", 9, 3, 8},
		{"B", 1, 2, 0},
		{"B", 1.5, 1.8, 1},
		{"B", 5, 8, 2},
		{"B", 8, 8, 3},
		{"B", 1, 0.6, 4},
		{"B", 9, 11, 5},
		{"B", 8, 2, 6},
		{"B", 10, 2, 7},
		{"B", 9, 3, 8},
		{"C", 1, 2, 0},
		{"C", 1.5, 1.8, 1},
		{"C", 5, 8, 2},
		{"C", 8, 8, 3},
		{"C", 1, 0.6, 4},
		{"C", 9, 11, 5},
		{"C", 8, 2, 6},
		{"C", 10, 2, 7},
		{"C", 9, 3, 8},
	}

	// epsilon := 3.0
	// minPts := 5

	epsilon := 2.5
	minPts := 5


	clusters := DBSCAN(points, epsilon, minPts)
	fmt.Println("Combined Clusters:")
	for i, cluster := range clusters {
		fmt.Printf("Cluster %d:\n", i+1)
		for _, point := range cluster.Points {
			fmt.Printf("  (%s, %.2f, %.2f, %.2f)\n", point.User, point.X, point.Y, point.T)
		}
	}
}

出力結果は以下の通りです。
C:\Users\ebata\tomioka_school\src\trip_school>go run dbscan_3d_2.go
Combined Clusters:
Cluster 1:
(A, 1.00, 2.00, 0.00)
(A, 1.50, 1.80, 1.00)
(B, 1.00, 2.00, 0.00)
(B, 1.50, 1.80, 1.00)
(C, 1.00, 2.00, 0.00)
(C, 1.50, 1.80, 1.00)
Cluster 2:
(A, 8.00, 2.00, 6.00)
(A, 10.00, 2.00, 7.00)
(A, 9.00, 3.00, 8.00)
(B, 8.00, 2.00, 6.00)
(B, 10.00, 2.00, 7.00)
(B, 9.00, 3.00, 8.00)
(C, 8.00, 2.00, 6.00)
(C, 10.00, 2.00, 7.00)
(C, 9.00, 3.00, 8.00)

2024,江端さんの技術メモ

// NormalizeCoordinates 京急富岡駅を基準として正規化された緯度と経度を返す関数
// C:\Users\ebata\tomioka_school\src\trip_school\NormalizeCoordinates.go

package main

import (
	"fmt"
	"math"
)


func NormalizeCoordinates(referenceLat, referenceLng, lat, lng float64) (float64, float64) {
	// 1度あたりの緯度経度のメートル換算
	metersPerDegreeLat := 111319.9 // 緯度1度あたりのメートル数
	metersPerDegreeLng := 111319.9 * math.Cos(referenceLat*(math.Pi/180.0)) // 経度1度あたりのメートル数

	// 緯度と経度の差を計算
	deltaLat := lat - referenceLat
	deltaLng := lng - referenceLng

	// 正規化された緯度と経度を計算
	normalizedLat := deltaLat * metersPerDegreeLat / 100.0
	normalizedLng := deltaLng * metersPerDegreeLng / 100.0

	return normalizedLat, normalizedLng
}

func main() {
	// 京急富岡駅の緯度経度

	keikyuTomiokaLat := 35.367131726654705
	keikyuTomiokaLng := 139.62988318023088

	// 確認用の緯度経度(富岡駅のバス停)

	lat := 35.36605614545459
	lng := 139.6295094178281

	// 緯度経度の正規化
	normalizedLat, normalizedLng := NormalizeCoordinates(keikyuTomiokaLat, keikyuTomiokaLng, lat, lng)

	fmt.Printf("正規化された緯度: %.6f\n", normalizedLat)
	fmt.Printf("正規化された経度: %.6f\n", normalizedLng)
}

2024,江端さんの技術メモ

// NormalizeTime 2つの日時文字列の時間差を秒単位で計算し、600秒を1として正規化する関数
// C:\Users\ebata\tomioka_school\src\trip_school\NormalizeTime.go

package main

import (
	"fmt"
	"time"
)

func NormalizeTime(timeStr1, timeStr2 string) float64 {
	layout := "2006-01-02 15:04:05"
	t1, err := time.Parse(layout, timeStr1)
	if err != nil {
		fmt.Println("Error parsing time string 1:", err)
		return 0
	}

	t2, err := time.Parse(layout, timeStr2)
	if err != nil {
		fmt.Println("Error parsing time string 2:", err)
		return 0
	}

	duration := t2.Sub(t1).Seconds()
	normalizedDuration := duration / 600.0

	return normalizedDuration
}

func main() {
	timeStr1 := "2024-01-01 00:00:00"
	timeStr2 := "2024-02-11 23:45:00"

	normalized := NormalizeTime(timeStr1, timeStr2)
	fmt.Println("正規化された時間差:", normalized)
}