2023,江端さんの技術メモ

This program is based on the following page
https://qiita.com/ufoo68/items/9e4ca04578ba0f5fa5ff

This program solves the XOR problem using MLP with one hidden layer.

#include <stdio.h>
#include <math.h>
#include <time.h>
#include <stdlib.h>
//num of units
#define NUM_INPUT 2
//#define NUM_HIDDEN 20
#define NUM_HIDDEN 2

double sigmoid(double x) {
    return 1/(1+exp(-x));
}

//derivative of sigmoid function
double d_sigmoid(double x) {
    double a = 0.1;
    return a*x*(1-x);
}

int main(void) {
    srand((unsigned)time(NULL));
//train data
    double train_x[4][NUM_INPUT+1] = {{0, 0, -1},{0, 1, -1},{1, 0, -1},{1, 1, -1}};
    double d[4] = {0, 1, 1, 0};
//net
    double w[NUM_HIDDEN+1][NUM_INPUT+1];
    double v[NUM_HIDDEN+1];
    double y[4][NUM_HIDDEN+1];
    double z[4];
    double eta = 0.1;
    int epoch = 1000000;
//other
    int i, j, k, l;
    double tmp = 0;

//update weights using rand()
    for(l=0; l<NUM_HIDDEN+1; l++) {
        for(i=0; i<NUM_INPUT+1; i++) {
            w[l][i] = ((double)rand() / ((double)RAND_MAX + 1));
        }
    }
    for(i=0; i<NUM_HIDDEN+1; i++) {
        v[i] = ((double)rand() / ((double)RAND_MAX + 1));
    }

//tain
    for(k=0; k<epoch; k++) {
        //feedforward
        for(j=0; j<4; j++) {
            //hidden
            for(l=0; l<NUM_HIDDEN; l++) {
                for(i=0; i<NUM_INPUT+1; i++) {
                    tmp += train_x[j][i] * w[l][i];
                }
                y[j][l] = sigmoid(tmp);
                tmp = 0;
            }
            y[j][NUM_HIDDEN] = -1;
            //output
            for(i=0; i<NUM_HIDDEN+1; i++) {
                tmp += y[j][i] * v[i];
            }
            z[j] = sigmoid(tmp);
            tmp = 0;

        //backward
            //output
            for(i=0; i<NUM_HIDDEN+1; i++) {
                v[i] = v[i] - eta * y[j][i] * d_sigmoid(z[j]) * (z[j] - d[j]);
            }

            //hidden
            for(l=0; l<NUM_INPUT+1; l++) {
                for(i=0; i<NUM_HIDDEN+1; i++) {
                    w[i][l] = w[i][l] - eta * train_x[j][l] * d_sigmoid(y[j][i]) * d_sigmoid(z[j]) * (z[j] - d[j]) * v[i];
                }
            }
        }

		/*
        //print detail
        printf("z=");
        for(i=0; i<4; i++) {
            printf("%f ", z[i]);
        }
        printf("epoch:%d\n",k);
		*/
    }

//predict
    for(j=0; j<4; j++) {
        //hidden
        for(l=0; l<NUM_HIDDEN; l++) {
            for(i=0; i<NUM_INPUT+1; i++) {
                tmp += train_x[j][i] * w[l][i];
            }
            y[j][l] = sigmoid(tmp);
            tmp = 0;
        }
        y[j][NUM_HIDDEN] = -1;
        //output
        for(i=0; i<NUM_HIDDEN+1; i++) {
            tmp += y[j][i] * v[i];
        }
        z[j] = sigmoid(tmp);
        tmp = 0;
    }

//print result
    printf("z=");
    for(i=0; i<4; i++) {
        printf("%f ", z[i]);
    }
    printf("epoch:%d\n",k);


    for(i=0; i<NUM_INPUT+1; i++) {
        for(l=0; l<NUM_HIDDEN+1; l++) {
		  printf("w[%d][%d]:%f\n", i, l, w[i][l]);
        }
    }

    for(i=0; i<NUM_HIDDEN+1; i++) {
	  printf("v[%d]:%f\n",i, v[i]);
    }


    return 0;
}

Save this program as a name "mlp.c", compile ">gcc mlp.c" and execute ">./a.exe"

2023,江端さんの忘備録

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

Today's diary is taken off, as the new column has been released.

------

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━……‥‥・・・
連載記事アラート《アイティメディアID》 ………………………… 2023/02/25

Serial Article Alert 《Itimedia ID》 ........................ 2023/02/25

・・・‥‥……━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

「「お金に愛されないエンジニア」のための新行動論」の最新記事が掲載されました。

The latest article on "New Behavioral Theory for 'Engineers Not Loved by Money'" has been published.

■最新記事

- Latest Articles

1日1回の外出は2000円の価値? 「孤独」がもたらす損失を試算してみる

Is going out once a day worth 2,000 Yen? Let's estimate the loss that "loneliness" brings.

(イラストをクリックすると、記事に飛びます)

(Click on the figure to jump to the article)

今回は、「移動」と「ウェルビーイング」を解析した論文を読み解いてみました。

In this issue, I read a paper analyzing "mobility" and "wellbeing".

そこで得た結論は、「孤独を回避して幸せになりたいのなら、毎日外へ出ろ」というものです。

The conclusion I came to was, "If you want to avoid loneliness and be happy, go outside every day".

2023,江端さんの忘備録

こちらにも記載しましたが、3月に、大学生の学生の講義のコマを3つ持つ旨、担当指導教授から指示を受けました。

私の業務経歴は、「成果」ではなくて「怒り」で記載可能のようです。

In March, I have been instructed by my supervisor to have three lecture sessions for university students.

各種のネタは持っているのですが、まあ、最近なら『"AI"がウケがいいだろう』と思って、その旨を教授に返事をしました。

I had a variety of ideas, but I thought, well, "'AI' would be popular these days," I replied to the professor.

―― で、今、講義の準備に頭を抱えています。

Now, the "preparation for lectures" is giving me a headache.

-----

講義だけなら、1時間程度くらい、デタラメな英語をしゃべる続けることはできると思うのです。

I think I can keep speaking bullshit English for about an hour of the lecture.

その訓練は、20年前に完了しています。

That training was completed 20 years ago.

問題は「練習問題」です。

The problem is "practice problems".

AIというのは、基本的には『コンピュータプログラムを使った、暴力的な力まかせの計算の強行』です。

AI is basically 'violent forced computation' using computer programs.

―― プログラミングを知らない学生に、「座学」で「手計算」で「計算用紙」を使って、AIの計算プロセスを練習させる

"How to have students who do not know programming practice the AI calculation process in a "classroom" setting, using "hand calculations" and "calculation paper"

これが、想像を絶するほど難しいのです。

This is unimaginably difficult.

正直、どこから手をつけたら良いのか分からない、という感じです。

Frankly, I don't know where to start.

加えて、『講義の時間がわずか1時間』という制約が、私を苦しめています。

In addition, the restriction of 'only one hour of lecture time' has been a pain for me.

例えば、ベイズ推論、ファジィ推論、それぞれのAI技術の解説に、最低「5時間」は欲しいのですが、現状、それぞれ15分しかありません。

For example, I would like at least "5 hours" to explain the AI techniques of Bayesian and fuzzy reasoning, but currently I have only 15 minutes each.

このまま講義に突入すれば、『想像を絶するほど、つまらない講義になるだろう』と予感しています。

I have a feeling that if I go into the lecture as it is, 'it will be the most boring lecture imaginable'.

という訳で、ここ数日、ずっと頭を抱え続けています。

This is why I have been keeping my head in the sand for the past few days.

-----

「数学教育が、なぜ、あれほどつまらないものになるか」の断片を、理解したような気がします。

I think I understand a piece of "why math education can be so boring".

ここに至って、私は『数学教育を楽しいものにするには、少なくとも、今のコマの5~10倍以上の時間が必要だ』ということに、気がつきました。

It was here that I came to the realization that 'to make math education fun, we need at least five to ten times as much time as we have in our current frames.

2023,江端さんの技術メモ

Golang 文字列を数値に変換する方法で、文字列→実数なら、これが一番てっとり早そう

dest_lat, err := strconv.ParseFloat(row[2], 64)

strconv.ParseIntstrconv.ParseUnitは、文字列を解析して整数型を返す関数
それぞれ符号付き整数型と符号なし整数型に対応している。

 

2023,江端さんの技術メモ

I hope you could understand the min-max method of Fuzzy reasoning, using the following Go programming list.

package main

import (
	"fmt"
	"os"
)

func max_2(a, b float64) float64 {
	if a > b {
		return a
	} else {
		return b
	}
}

func min_2(a, b float64) float64 {
	if a > b {
		return b
	} else {
		return a
	}
}

type condition_MF3 struct { // Base class for condition_MF3
	center  float64
	width   float64
	express string
}

func new_condition_MF3(_center, _width float64, _express string) *condition_MF3 {
	c3 := new(condition_MF3)
	c3.center = _center
	c3.width = _width
	c3.express = _express
	return c3
}

// Class for the membership function (3 mountains) of the former case
func (c3 *condition_MF3) func_X(_x float64) float64 {
		// x,y denote coordinates on the membership function
	x := _x
	y := 0.0 // The value of y is always greater than or equal to 0 and less than or equal to 1

	if c3.express == "LESS" {
		if x <= c3.center-c3.width {
			y = 1.0
		} else if x <= c3.center {
			y = -1.0 / c3.width * (x - c3.center)
		} else {
			y = 0.0
		}
	} else if c3.express == "COMMON" {
		if x <= c3.center-c3.width {
			y = 0.0
		} else if x <= c3.center {
			y = 1.0/c3.width*(x-c3.center) + 1.0
		} else if x <= c3.center+c3.width {
			y = -1.0/c3.width*(x-c3.center) + 1.0
		} else {
			y = 0.0
		}
	} else if c3.express == "MORE" {
		if x <= c3.center {
			y = 0.0
		} else if x <= c3.center+c3.width {
			y = 1.0 / c3.width * (x - c3.center)
		} else {
			y = 1.0
		}
	} else {
		fmt.Println("MF3: wrong expression")
		os.Exit(1)
	}
	return y
}

type condition_MF5 struct { // Base class for condition_MF5
	center  float64
	width   float64
	express string
}

func new_condition_MF5(_center, _width float64, _express string) *condition_MF5 {
	c5 := new(condition_MF5)
	c5.center = _center
	c5.width = _width
	c5.express = _express
	return c5
}

func (c5 *condition_MF5) func_X(_x float64) float64 {
	// Class for the former membership function (5 mountains)
	// x,y are the coordinates on the membership function

	x := _x
	y := 0.0 // The value of y is always greater than or equal to 0 and less than or equal to 1

	if c5.express == "LESSLESS" {
		if x <= c5.center-2.0*c5.width {
			y = 1.0
		} else if x <= c5.center-c5.width {
			y = -1.0/c5.width*(x-(c5.center-2.0*c5.width)) + 1.0
		} else {
			y = 0.0
		}
	} else if c5.express == "LESS" {
		if x <= c5.center-2.0*c5.width {
			y = 0.0
		} else if x <= c5.center-c5.width {
			y = 1.0/c5.width*(x-(c5.center-c5.width)) + 1.0
		} else if x <= c5.center {
			y = -1.0/c5.width*(x-(c5.center-c5.width)) + 1.0
		} else {
			y = 0.0
		}
	} else if c5.express == "COMMON" {
		if x <= c5.center-c5.width {
			y = 0.0
		} else if x <= c5.center {
			y = 1.0/c5.width*(x-c5.center) + 1.0
		} else if x <= c5.center+c5.width {
			y = -1.0/c5.width*(x-c5.center) + 1.0
		} else {
			y = 0.0
		}
	} else if c5.express == "MORE" {
		if x <= c5.center {
			y = 0.0
		} else if x <= c5.center+c5.width {
			y = 1.0/c5.width*(x-(c5.center+c5.width)) + 1.0
		} else if x <= c5.center+2.0*c5.width {
			y = -1.0/c5.width*(x-(c5.center+c5.width)) + 1.0
		} else {
			y = 0.0
		}
	} else if c5.express == "MOREMORE" {
		if x <= c5.center+c5.width {
			y = 0.0
		} else if x <= c5.center+2.0*c5.width {
			y = 1.0/c5.width*(x-(c5.center+2.0*c5.width)) + 1.0
		} else {
			y = 1.0
		}
	} else {
		fmt.Println("MF5 func_X(): wrong expression")
		os.Exit(1)
	}

	return y
}

/////////////////////////////

type action_MF5 struct { // Base class for action_MF5
	center  float64
	width   float64
	express string
	x       float64
	y       float64
}

type action_MF3 struct { // Base class for action_MF3
	center  float64
	width   float64
	express string
	x       float64
	y       float64
}


func new_action_MF5(_center, _width float64, _express string) *action_MF5 {
	a5 := new(action_MF5)
	a5.center = _center
	a5.width = _width
	a5.express = _express

	if a5.express == "LESSLESS" {
		a5.x = a5.center - 2.0*a5.width
	} else if a5.express == "LESS" {
		a5.x = a5.center - a5.width
	} else if a5.express == "COMMON" {
		a5.x = a5.center
	} else if a5.express == "MORE" {
		a5.x = a5.center + a5.width
	} else if a5.express == "MOREMORE" {
		a5.x = a5.center + 2.0*a5.width
	} else {
		fmt.Println("new_action_MF5: wrong scale expression")
		os.Exit(-1)
	}

	a5.y = 0.0

	return a5
}

func new_action_MF3(_center, _width float64, _express string) *action_MF3 {
	a3 := new(action_MF3)
	a3.center = _center
	a3.width = _width
	a3.express = _express

	if a3.express == "LESS" {
		a3.x = a3.center - a3.width
	} else if a3.express == "COMMON" {
		a3.x = a3.center
	} else if a3.express == "MORE" {
		a3.x = a3.center + a3.width
	} else {
		fmt.Println("new_action_MF3: wrong scale expression")
		os.Exit(-1)
	}

	a3.y = 0.0

	return a3
}


// The latter membership function (5 mountains) class
func (a5 *action_MF5) func_Y() float64 {
	return a5.y
}

// The latter membership function (3 mountains) class
func (a3 *action_MF3) func_Y() float64 {
	return a3.y
}

func (a5 *action_MF5) func_Max(b float64) {
	a5.y = max_2(b, a5.y)
}


func (a3 *action_MF3) func_Max(b float64) {
	a3.y = max_2(b, a3.y)
}


func (a5 *action_MF5) func_X() float64 {
	return a5.x
}

func (a3 *action_MF3) func_X() float64 {
	return a3.x
}


func fuzzy_reasoning(temp, humi float64) float64 {

	// Temperature(former)
	Temp_Less := new_condition_MF3(20, 10, "LESS")
	Temp_Common := new_condition_MF3(20, 10, "COMMON")
	Temp_More := new_condition_MF3(20, 10, "MORE")

	// Humidity(former)
	Humi_Less := new_condition_MF3(50, 20, "LESS")
	Humi_Common := new_condition_MF3(50, 20, "COMMON")
	Humi_More := new_condition_MF3(50, 20, "MORE")

	// Switch(前件部)
	Switch_Less := new_action_MF3(0,1,"LESS")
	Switch_Common := new_action_MF3(0,1,"COMMON")
	Switch_More := new_action_MF3(0,1,"MORE")

	// [Rule 01] 
	Rule01 := min_2(Temp_More.func_X(temp), Humi_More.func_X(humi))
	Switch_Less.func_Max(Rule01) // the latters values are overwritten if the value is large enough.
	fmt.Println("Rule01", Rule01)

	// [Rule 02] 
	Rule02 := min_2(Temp_Common.func_X(temp), Humi_More.func_X(humi))
	Switch_Common.func_Max(Rule02) // the latters values are overwritten if the value is large enough.
	fmt.Println("Rule02", Rule02)

	// [Rule 03] 
	Rule03 := min_2(Temp_More.func_X(temp), Humi_Common.func_X(humi))
	Switch_Less.func_Max(Rule03) // the latters values are overwritten if the value is large enough.
	fmt.Println("Rule03", Rule03)

	// [Rule 04] 
	Rule04 := min_2(Temp_Less.func_X(temp), Humi_Less.func_X(humi))
	Switch_More.func_Max(Rule04) // the latters values are overwritten if the value is large enough.
	fmt.Println("Rule04", Rule04)


	// Reasoning calculations
	numerator :=
			Switch_Less.func_X()*Switch_Less.func_Y() +
			Switch_Common.func_X()*Switch_Common.func_Y() +
			Switch_More.func_X()*Switch_More.func_Y() 

	denominator :=
			Switch_Less.func_Y() +
			Switch_Common.func_Y() +
			Switch_More.func_Y() 


	reasoning := numerator / denominator

	return reasoning

}

func main(){

	 fmt.Println(fuzzy_reasoning(27.0, 67.0))
}

2023,江端さんの忘備録

という訳で、本日、私、40年ぶりくらいに「丸刈り」にしてきました。

昨日から、鏡の前に立つたびに、東条英機元首相が登場して、ビックリしています。

Since yesterday, every time I stand in front of the mirror, I am surprised to see former Prime Minister Hideki Tojo appear.

しかし、これはチャンスかもしれない。

But this could be an chance.

コスプレか・・・、コスプレいいかも!

Cosplay..., cosplay sounds good!

-----

江端:「・・・という訳で、丸メガネの老眼鏡と、軍服を買いたい。特別予算の申請をします」

Ebata: "I want to buy reading glasses with round glasses and a military uniform. I will apply for a special budget."

嫁さん:「却下」

Wife: "Rejected."

2023,江端さんの忘備録

私が床屋に行くタイミングは ―― 「頭髪がうっとうしく感じた時」の一択です。

The only time I go to the barber is -- "when I feel my head of hair is annoying".

「容姿を気にする」というフェーズは、とうの昔に終っています。

The phase of "caring about appearance" has long since ended.

今の私の頭髪基準は『社会人として許される限界まで短く』です。

My current hair style standard is 'short to the limit allowed for working people'.

目的は、頭髪時間とコストの削減です。

The objective is to reduce headcount time and costs.

-----

『なるべく短く。髪の毛が逆立ってもOK。できるだけ髪を軽くするために梳いて』

"Keep it as short as possible. Combed as much as possible"

と、10年近く言い続けてきたのですが、私の希望するドンピシャの短髪にしてくれる理容師さんが少ない。

I have been saying this for almost 10 years, but there are not many barbers who can give me the don't-short hair I want.

特に女性の理容師さんは、『バッサリとやって欲しい』という私のニーズと合わないことが多いようです。

Especially female barbers often don't seem to match my need for a 'buzz off'.

これは、理髪に関する男女の価値観の相違 ―― ではなく、「理髪に1mmも価値を持たない人間」を相手にしなけばならない、女性理容師さんとのミスマッチと言うべきかもしれません。

This is not a difference in values between men and women regarding barbering, but rather a mismatch with female barbers who have to deal with "people who do not value barbering even a millimeter".

『自分のことは自分で』が正論ですが、残念ながら、理髪と病気の2つは、自己実施が難しいのです。

The correct answer is 'take care of yourself,' but unfortunately, hairdressing and illness are two of the most difficult things to self-implement.

そんなわけで、ここ数年は、「スポーツ刈り」というものを選んできました。

That is why I have chosen to use "crew cut" for the past few years.

しかし、その「スポーツ刈り」ですら、私が選ばなければならないパラメタがいくつもあるのです。

But even that "crew cut" has a number of parameters that I have to choose from.

例えば、「もみあげ」「かりあげ」「トップ」「サイド」「襟足」など、うっとうしいことこの上もありません。

For example, "fir," "kariage," "top," "side," "collar," etc., are nothing short of annoying.

-----

今になって思えば ―― 『目の前にあることにすら、全く気がつななかった』 ―― と感じです。

Looking back on it now, I feel like, "I didn't even notice what was right in front of me".

あるじゃないですか。リクエストパラメータ"ゼロ"の、究極の、そして、私と理容師さん両方にとってのWin-Winの最高のヘアースタイルが。

There is, isn't there? The ultimate, best hair style with "zero" request parameters, and a win-win situation for both me and the barber.

―― 丸刈り

It is "buzz cut".

です。

いや、早かった。

It was quick.

あっという間に終わりました。

It was over in a matter of minutes.

駅ナカの理容室で、作業時間は4分間でした。

The work took 4 minutes at the station barber shop.

理容師さんには、鏡を見せられて『これでいいですか?』と言われましたが、「丸刈り」のリカバリーって、可能なのでしょうか?

The barber showed me a mirror and said, 'Is this okay?' but is it possible to recover a "buzz cut"?

-----

という訳で、本日、私、40年ぶりくらいに「丸刈り」にしてきました。

So, today, for the first time in about 40 years, I have had a "buzz cut".

家族がギョっとしないように、理髪直後に家族SNSで写真を送っておいたのですが、嫁さんは、写真を見ていなかったようで ―― 言葉を失っていました。

I had sent a picture of it on the family social networking site right after the haircut so that the family wouldn't be giddy, but the wife didn't see the picture -- she was speechless.

嫁さん:「それ、気にいっているの?」

Wife: "Do you like that?"

江端:「うむ、これで半年近くは理髪にいかなくて良いかと思うと、嬉しい」

Ebata: "Well, I'm glad I won't have to go to the barber for almost six months now.

嫁さん:「ずっと『丸刈り』を続けるという訳ではないんだ。安心したよ」

Wife: "You are not going to keep the 'buzz cut' . That's a relief."

-----

ちなみに、私、「丸刈り」については、中学生のころ、(生徒会会長の職権を使った)全校を巻き込むような事件を起こしかけたことがあります。

Incidentally, as for "buzz cut", when I was in junior high school, I almost caused an incident (using my authority as president of the student council) that would have involved the entire school.

私の動向を察知した生徒会顧問の教諭に、直前に阻止されましたが ―― 今も、忸怩たる悔悟の思いです。

The advisor of the student council, who was aware of my movements, stopped me just before I left. Even now, I still feel ashamed and regretful.

後日、この話をしたいと思います。

I would like to discuss this later.

2023,江端さんの忘備録

3月に、大学生の学生の講義のコマを3つ持つ旨、担当指導教官から指示を受けています。

In March, I have been instructed by my supervisor to have three lecture sessions for university students.

これも、履修単位の為の必要な要件らしいです。

This also seems to be a necessary requirement for course credit.

で、今、その準備として業務履歴の日本語を、英語に変換する作業をしているのですが、

And now, I'm working on converting the Japanese of the business history into English as a preparation for that.

―― 昔のことを思い出す度に、怒りが甦ってきます。

"Every time I remember the old days, my anger comes back"

『あの時は、滅茶苦茶な日程でプレゼン資料を作らされたなぁ』

"I remember that time when they made me work on a presentation with a crazy schedule"

『あの国のあの野郎(研究者)は、1mmも動いていないのに、研究成果報告書に記載された私の名前を消して、自分の名前に置きかえやがったなぁ』

"I remember that "The bastard (researcher) in that country has not moved a millimeter, and yet he erased my name from the research report and replaced it with his own name"

などなど。

e.t.c

-----

私の業務経歴は、「成果」ではなくて「怒り」で記載可能のようです。

My work history seems to be able to be listed under "anger" instead of "results".

2023,江端さんの技術メモ

A社 CSVファイルパース用テストコード (用事が終わったら消すこと)

package main

import (
	"encoding/csv"
	"fmt"
	"log"
	"os"
	"regexp"
	"strings"
)

func main() {

	file, err := os.Open("tracking_data.csv") 
	if err != nil {
		log.Fatal(err)
	}
	defer file.Close()

	r := csv.NewReader(file)
	rows, err := r.ReadAll() // csvを一度に全て読み込む
	if err != nil {
		log.Fatal(err)
	}

	lat := [10000]string{}
	lng := [10000]string{}
	speed := [10000]string{}

	// [][]stringなのでループする
	for j, v := range rows {

		if j == 0 {
			continue // CSVのヘッダー行を無視
		}

		//fmt.Println(v[3])
		// v[3]をバラバラに分解する
		// v3 := regexp.MustCompile("[() ,]").Split(v[3], -1)
		v3 := regexp.MustCompile("}, {").Split(v[3], -1)

		for i, s := range v3 { // i: 数
			//fmt.Printf("%s\n", s)
			v31 := strings.Replace(s, "\"lat\": ", "", -1)
			v32 := strings.Replace(v31, "\"lng\": ", "", -1)
			v33 := strings.Replace(v32, "[{", "", -1)
			v34 := strings.Replace(v33, "}]", "", -1)

			v35 := regexp.MustCompile(",").Split(v34, -1)

			for k, s5 := range v35 {

				//f64, _ := strconv.ParseFloat(s5, 64)
				//fmt.Println("string", i, s5)
				if k == 0 {
					lat[i] = s5
				} else {
					lng[i] = s5
				}
			}

		}

		//fmt.Println(lat[0], lng[0], lat[19], lng[19])
		//fmt.Println()

		// v[4]をバラバラに分解する
		v41 := strings.Replace(v[4], "[", "", -1)
		v42 := strings.Replace(v41, "]", "", -1)
		v43 := regexp.MustCompile(",").Split(v42, -1)

		for k4, s4 := range v43 {
			speed[k4] = s4

			fmt.Println(k4, ",", lat[k4], ",", lng[k4], ",", speed[k4])

		}

	}
}

2023,江端さんの忘備録

先日、家族で金沢旅行に行ってきました。

I recently took a trip to Kanazawa with my family.

もはや、めったなことでは家族全員での集合の機会はありません。

The whole family can no longer gather together on rare occasions.

今回の旅行がファイナルかもしれませんが、まあ、そういうものでしょう。

This trip may be the final one, but that's okay.

-----

もはや、全員が成人になっていますので、居酒屋でのネタにも制限はありません。

Since we are all adults now, there are no longer any restrictions on the stories we can tell in the pub.

マッチングアプリの活用方法などを含め、赤裸々な話を聞かされました。

I heard some naked stories about how to use matching apps.

まあ、私は、ノンアルコールビールを飲みながら、だまって聞き流していました(体調が悪く、ノドも潰していたので)。

Well, I just sat back and listened while drinking my non-alcoholic beer (I was sick and my throat was crushed).

-----

話題が『人生で、目もくらむほどの幸福感に浸ったことがあるか』というネタになった時です。

This is when the topic turned to a story about 'Have you ever been dazzlingly happy in your life?'

私は「大学院で自分の好きな研究を続けていたとき、ときどき幸せを感じていた」という話をしたのですが、

I told them that I sometimes felt happy when I was in graduate school continuing my own favorite research, however,

嫁さんと長女は、「恋愛一択」でした。

My wife and senior daughter chose "love affair" only and said,

―― 道行く人々の全てに声をかけて、この幸せを分けてやりたいと思うほどの幸せな気持ちになった

"They felt so happy that they wanted to call out to all the people on the street and share this happiness with them"

のだそうです。

二人で『そう!そうだよ!!』と盛り上がっていたので、客観的な事実であるようです。

They both said, 'Yes! Yes!!!' ' and they were so excited, so it seems to be an objective fact.

次女は、「よく分からん」といった風だったようですし、私に至っては、全く分かりませんでしたが。

My junior daughter seemed to be "I don't really understand," and I didn't understand at all either.

-----

で、ふと思い出したのが、これ、です。

And then I suddenly remembered this

『ええ、毎日、目が眩むほど幸せです。あなたは違うのですか?』と、気の毒そうな顔をして相手を見てやれば、大体、呆然として立ちすくんでいました。

カルト宗教が、『道行く人々の全てに声をかけて、この幸せを分けてやりたいと思うほどの幸せな気持ち』になれるものであるなら、その価値はあるのかもしれない ――

If a cult is something that makes them 'so happy that they want to call out to all the people on the street and share this happiness with them', then maybe it's worth it....

と、一瞬、思いかけましたが、直ぐに取り下げました。

For a moment, I almost thought that, but I immediately withdrew the idea.

嫁さんと長女の、大切な思い出を『汚された』ような気になったからです。

I felt like I was 'tarnishing' the precious memories of my wife and senior daughter.

-----

今度、街で『あなたは、今、幸せですか』と尋ねられたら、

The next time someone on the street asks me, 'Are you happy right now?'

―― 間髪入れずに、顔面パンチを食らわせてやろう

"I'll punch him/her in the face in no time"

という気持ちになっています。

I have come to think that.