2024,江端さんの技術メモ

/*
	c:\Users\ebata\tomioka3b\others\main42.go
	指定されたファイルから時刻表を読み込み、最も近い未来の時刻を取得します。
*/
package main

import (
	"bufio"
	"fmt"
	"os"
	"strings"
	"time"
)

func main() {
	// 指定されたファイル名
	fileName := "To_Sengakuzi_weekdays.csv" // ここにファイル名を入力してください

	// 指定されたファイルから時刻表を読み込む
	schedule, err := readScheduleFromFile(fileName)
	if err != nil {
		fmt.Println("Error:", err)
		return
	}
	//fmt.Println("時刻表:", schedule)

	// 現在時刻を取得
	now := time.Now().Format("15:04:05")
	now = "12:29:00"

	// 最も近い未来の時刻を取得
	nextTime := getNextTime(schedule, now)

	// 結果を出力
	fmt.Println("最も近い未来の時刻:", nextTime)
}

func readScheduleFromFile(fileName string) ([]time.Time, error) {
	// ファイルを開く
	file, err := os.Open(fileName)
	if err != nil {
		return nil, err
	}
	defer file.Close()

	var schedule []time.Time

	// ファイルから時刻を読み取る
	scanner := bufio.NewScanner(file)
	for scanner.Scan() {
		line := scanner.Text()
		times := strings.Split(line, ",")
		for _, t := range times {
			//fmt.Println("時刻:", t)
			t1, err := time.Parse("15:04:05", t)
			if err != nil {
				fmt.Println("時刻のパースに失敗しました:", err)
				return nil, err
			}
			schedule = append(schedule, t1)
		}
	}

	// fmt.Println("pass4")
	// fmt.Println("schedule: ", schedule)

	return schedule, nil
}

// 指定された時刻表から最も近い未来の時刻を取得する関数
func getNextTime(schedule []time.Time, inputTime string) string {
	// 入力時刻のパース
	input, err := time.Parse("15:04:05", inputTime)
	if err != nil {
		panic(err)
	}

	// 時刻表の各時刻との差を計算し、最小の差を見つける
	minDiff := time.Hour * 24
	var nextTime string
	for _, t := range schedule {
		// 時刻の差を計算
		diff := t.Sub(input)

		// 負の差(過去の時刻)を無視
		if diff < 0 {
			continue
		}

		// 最小の差を更新
		if diff < minDiff {
			minDiff = diff
			nextTime = t.Format("15:04:05")
		}
	}

	return nextTime
}

To_Sengakuzi_weekdays.csv

4:53:00
5:08:00,5:23:00,5:32:00,5:44:00,5:55:00
6:03:00,6:14:00,6:26:00,6:33:00,6:40:00,6:44:00,6:49:00,6:53:00,6:59:00
7:04:00,7:09:00,7:14:00,7:19:00,7:26:00,7:30:00,7:37:00,7:46:00,7:52:00,7:58:00
8:06:00,8:14:00,8:21:00,8:26:00,8:33:00,8:41:00,8:47:00,8:54:00
9:02:00,9:10:00,9:21:00,9:31:00,9:41:00,9:53:00
10:03:00,10:13:00,10:24:00,10:33:00,10:44:00,10:53:00
11:04:00,11:13:00,11:24:00,11:32:00,11:44:00,11:53:00
12:04:00,12:13:00,12:24:00,12:33:00,12:44:00,12:53:00
13:04:00,13:13:00,13:24:00,13:33:00,13:44:00,13:53:00
14:04:00,14:13:00,14:24:00,14:33:00,14:43:00,14:52:00
15:02:00,15:12:00,15:22:00,15:31:00,15:41:00,15:52:00
16:01:00,16:10:00,16:20:00,16:31:00,16:42:00,16:53:00
17:02:00,17:13:00,17:23:00,17:34:00,17:43:00,17:53:00,17:59:00
18:12:00,18:19:00,18:28:00,18:38:00,18:48:00,18:57:00
19:08:00,19:18:00,19:26:00,19:36:00,19:46:00,19:55:00
20:06:00,20:16:00,20:27:00,20:36:00,20:46:00,20:56:00
21:08:00,21:15:00,21:18:00,21:29:00,21:39:00,21:50:00
22:01:00,22:11:00,22:21:00,22:26:00,22:38:00,22:53:00
23:12:00,23:33:00,23:54:00

 

2024,江端さんの技術メモ

/*
	c:\users\ebata\tomioka3b\src\others\main41.go
	2次元スプライン関数を使用して、緯度と経度のペアに対応する目的地までの時間を計算します。
*/

package main

import (
	"fmt"
	"sort"
)

// スプライン補間用の関数
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 main() {
	// データ点の定義
	dataSet := [][]float64{
		{35.7281578, 139.7680665, 73},
		{35.7214573, 139.7754384, 63},
		{35.7141672, 139.7748342, 57},
		{35.7075171, 139.7564025, 67},
		{35.698383, 139.7704968, 65},
		{35.6997175, 139.7618655, 61},
		{35.7020484, 139.7509267, 66},
		{35.6918216, 139.7683569, 63},
		{35.6812362, 139.7645499, 57},
		{35.6750133, 139.7604455, 59},
		{35.666379, 139.7557649, 55},
		{35.6553809, 139.754554, 54},
		{35.6457361, 139.7449875, 54},
		{35.6284713, 139.7361848, 43},
		{35.6208763, 139.7405387, 50},
		{35.6147448, 139.7412068, 49},
		{35.6086671, 139.7426731, 45},
		{35.6052508, 139.7421627, 50},
		{35.5983959, 139.7391046, 50},
		{35.58754, 139.7355111, 51},
		{35.5788485, 139.7348961, 40},
		{35.5721351, 139.7318494, 53},
		{35.5666392, 139.7281759, 53},
		{35.5613144, 139.7215761, 33},
		{35.5446458, 139.7493338, 46},
		{35.5329877, 139.6982966, 30},
		{35.5348941, 139.7449763, 42},
		{35.5229857, 139.6889874, 41},
		{35.5179115, 139.6811867, 40},
		{35.5071467, 139.677526, 34},
		{35.4998507, 139.6713032, 31},
		{35.4923606, 139.6622968, 30},
		{35.4852628, 139.6544734, 29},
		{35.4846744, 139.6452731, 32},
		{35.4808759, 139.6394986, 26},
		{35.4763238, 139.631979, 30},
		{35.4688634, 139.6268306, 32},
		{35.4659811, 139.6194871, 20},
		{35.4571602, 139.6199226, 27},
		{35.4464751, 139.6235656, 25},
		{35.436673, 139.6217708, 24},
		{35.4334892, 139.6206713, 18},
		{35.4314711, 139.6030542, 16},
		{35.424238, 139.5927802, 17},
		{35.4201765, 139.586678, 14},
		{35.413768, 139.582819, 10},
		{35.3819518, 139.6165374, 3},
		{35.4091204, 139.5781752, 7},
		{35.3966138, 139.6051573, 4},
		{35.3645904, 139.6267988, 1},
		{35.3428573, 139.6190711, 3},
		{35.3314185, 139.6176347, 6},
		{35.330416, 139.6295796, 17},
		{35.3337822, 139.630869, 18},
		{35.3407534, 139.6332478, 18},
		{35.3400425, 139.6390968, 20},
		{35.323276, 139.6151587, 13},
		{35.2973885, 139.5758056, 31},
		{35.3158184, 139.6222558, 15},
		{35.312573, 139.6250891, 16},
		{35.308405, 139.628248, 17},
		{35.2825803, 139.6405151, 19},
		{35.2916167, 139.6283632, 17},
		{35.277848, 139.6379121, 21},
		{35.2802815, 139.6599103, 19},
		{35.2786985, 139.6674653, 20},
		{35.2616259, 139.6679659, 26},
		{35.2635438, 139.6841348, 23},
		{35.2482969, 139.6775595, 25},
		{35.2509382, 139.712402, 30},
		{35.2315701, 139.699661, 29},
		{35.2120725, 139.6824547, 33},
		{35.2055645, 139.671602, 44},
		{35.1986888, 139.663162, 37},
		{35.1880928, 139.6507295, 39},
		{35.1775554, 139.6306392, 42},
	}

	// スプライン補間関数を作成
	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,江端さんの忘備録

先日の夜の次女との会話です。

Here is a conversation I had with my second daughter the other night.

私:「『理系』とか『文系』という言葉は残っていると思うが、まだ、この両者は、対立関係にあるのか」

Me: "I think the terms 'science' and 'liberal arts' are still around, but are the two still at odds with each other?"

次女:「『多様化』という言葉で、曖昧にされつつあるけど、『理系の大学生』が『地獄の中で生きている』であることは変わりはないと思う」

Second daughter: "The word 'diversification' is getting blurred, but I don't think it changes the fact that 'science college students' are 'living in hell.'"

私:「まあ、私が大学生だったころも理系の学生は『文系=バカ』と思っていたし、文系の学生は『理系=専門バカ』と公言してたからなぁ」

Me: "Well, even when I was a college student, science students thought 'liberal arts = stupid,' and liberal arts students professed that 'science = professional stupid.'"

次女:「『理系の人間が留年もなく普通に進級することが、いかに凄いことか』を文系の人間は理解していない」

Second daughter: "People in the humanities don't understand 'how great it is for a person in the sciences to advance to the next grade normally without any retention.'"

私:「まあ、当時は、『理系の人間は、文系たちの卒論レベルの作業を、隔週で実験とレポートでやっている』という地獄を、全く分かっていない、とは思っていたな」

Me: "Well, at the time, I thought they didn't know that 'science majors are doing bi-weekly experiments and reports on the thesis-level work of humanities majors.'"

-----

かつて、私が大学在学時代、文系の友人(女性)との会話で、

Once, in college, I conversed with a humanities friend (female).

友人:「卒論仕上げるのに、3日間徹夜しちゃったよー」

"I stayed up all night for three days to finish my thesis!"

というフレーズに、何と答えるのが正解なのか、分からなくなったことを覚えています。

But I remember I didn't know what to say to this phrase.

(1)『ヘー、それはラクでいいね』

(1) "Heh, that's easy and nice"

(2)『えー、それは大変だったね』

(2) "Well, that was tough"

なにしろ、その程度の徹夜作業、工学部では、隔週で発生する通常イベントだったからです。

After all, that kind of all-night work was a regular occurrence every other week in the Faculty of Engineering.

江端:「何・・・だと・・・? 今、"SPSS"と言ったか?」

-----

「結論としては、

In conclusion, I guess that's what I'm saying, 

(1)理系とか文系とかの対立概念は消されようとしている

(1) The opposing concepts of science and humanities are about to be erased

が、

but,

(2)理系の地獄は残存している

(2) the hell of the sciences remains,

それ故

Therefore

(3)理系に対する世間の理解は以前よりも悪化している

(3) The public's understanding of the sciences is worse than before.

ということになるかな」

と、次女は纏めました。

The second daughter summed it up.

-----

ちなみに、現在の江端家の理系、文系構成は、こんな感じです。

Incidentally, the current science and humanities composition of the Ebata family looks like this.

私: 理系(工学部出身)

Me: Science (Master of Engineering)

嫁さん:文系(英文学部出身)

Wife: Humanities (English Literature)

長女:文系(心理学部出身)

Eldest daughter: liberal arts (in the Faculty of Psychology)

次女:理系(建築学部在籍)

Second daughter: Science (in the School of Architecture)

(但し、心理学は、統計学の学問でもあるので、理系に近い文系かな、と思っています。)

(However, psychology is also the study of statistics, so I think I have a liberal arts background similar to a science background.)

2024,江端さんの技術メモ

作業中のプロジェクト: ないしょ
番号: ないしょ
ID: ないしょ
自分のAPIキー AXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXE

困っていたこと

Google MAP Directions APIを使いたいのですが、自分のAPIキーを使っても、以下のようになります。
https://maps.googleapis.com/maps/api/directions/json?origin=Disneyland&destination=Universal+Studios+Hollywood&key=AXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXE
{
   "error_message" : "This API project is not authorized to use this API.",
   "routes" : [],
   "status" : "REQUEST_DENIED"
}
対策を教えて下さい。
意外なところで解決しました。

で、再度実行したら、こうなりました。

ところが、鉄道の情報が出てこない。

 

うまくいっていない理由確定

 

Google Maps Platform FAQ  |  Google for Developers

https://developers.google.com

Google マップのルートサービスでは、交通機関の対象リストに記載されているすべての交通機関(日本を除く)をサポートしています。

ということで、日本で使用できるのは walking と driving の2モードのみのようです。

あかんやんか・・・

2024,江端さんの忘備録

恋愛において、第一印象は大切だと言われます。

Many people say that first impressions are important in love.

私も、これには同意します。

I, too, agree with this.

女性:「では、先ず、ダイエットをしましょうか」

ただ、恋愛だけでなく、どんな場面においても、第一印象は、とても大切だと思っています。

However, I believe that first impressions are significant, not only in love but in any situation.

私の場合、最初にしゃべった時の印象で、私は『これから、この人に対して、どのペルソナを使おうか』と考えます。

Based on the impression I get from the first talk, I think, 'Which persona shall I use for this person from now on?

同一人物に対しても、必要に応じて、別のペルソナを発動させることもあります。

I use several personas for the same person if necessary.

スタックしている会議や、飲み会などでは、私は全く異なる人格として振る舞い、その場を切り抜けることにしています(切り抜けれないこともありますが)。

In stacked meetings, drinking parties, etc., I try to act as a completely different persona to get through the situation (although sometimes I can't).

―― アルコール摂取量に応じた、人格の崩壊の有様

-----

大学の自治寮の入寮選考の時に、私は「ラディカルな運動家」として振る舞いました。

I acted as a "radical activist" when I attended for admission to the university's self-governing dormitory.

初音ミクの「インターナショナル」

しかし、実際は、それまで一度も『運動』に関わったことがなく、その後も、普通に勉強する一般的な大学生でした。

In reality, however, I had never been a "radical activist" before, and even after that, I was just an ordinary college student studying usually.

ですので、寮では「嘘吐き」と呼ばれていました。

Therefore, I was called a "liar" in the dormitory.

まあ、「リモコン起爆装置」を作って遊んだり、「水素の燃焼」の検証していたくらいです。

I even played with making a "remote-controlled detonator" and verifying "hydrogen combustion."

まだ覚えている

 

会社の入社面接の時は、『実験で、仮説と実証の違いに悩み続けた大学院生』のペルソナを出しました。

When I did job interviews, I portrayed myself as a graduate student who kept struggling with the difference between hypothesis and proof in an experiment.

このペルソナは、エンジニアの会社ではウケるはずだ、という高度な計算(下心)がありました。

I had a highly calculated (ulterior motive) that this persona should be attractive in the engineering company.

とは言え、どのペルソナも、私であることには違いはありません。

Nevertheless, every persona is still me.

私は、状況に応じて、ペルスナのスイッチとボリュームを変えているだけです。

I change the switch and volume of the persona depending on the situation.

-----

ご存知の通り、コラムの中の私と、会社での私は、完全に別人です。

As you know, I am completely different in the column than in the office.

「自分どうしで、殴り合いの喧嘩をしても不思議ではない」というレベルです。

It is at the level of, "I wouldn't be surprised if we got into a fistfight in my mind.

でも、「複数のペルソナを使い分ける」って、普通の人間の普通の行為です。

But "using multiple personas" is a normal act of a normal person.

と、いうことを、

I remember the above when I remembered seeing and hearing

『ノートPCに向かって、就活のリモート面接をしている、次女の声や表情』

"the voice and expression on my second daughter's face as she was doing a remote job interview on her laptop."

を見聞きして、思い出していました。

In other words,

―― 娘に、別の娘が憑依している

"Another daughter is possessing my daughter."

という感じです。

2024,江端さんの忘備録

今年の確定申告は終ったのですが、我が家は、医療費控除の申請を忘れていました。

Although this year's tax return has finished, our family forgot to apply for a deduction for medical expenses.

で、昨日、無理矢理、e-Taxから申請しました。

So, yesterday, I forced myself to apply for the E-Tax System.

(医療費は、5年間くらいは遡って申請できるらしいですが、まあ、提出できたのでよしとします)。

(I heard that you can apply for medical expenses retroactively for about five years, but I was able to use it, so that's good.)

家族全員分のマイナンバーカードの情報で、1年間の医療費が一瞬で出てきたので驚きました。

I was surprised that the information on my number card for my entire family instantly gave me a year's worth of medical expenses.

これまで、嫁さんが領収書をまとめて、私がエクセルでちまちまと記載して提出していたので、非常にラクになりました。

This service has made it very easy, as my wife used to compile the receipts, and I used to submit them in Excel with a few minor entries.

ただ、交通費の申請を別途行わなければならず、それがxml形式とかになっていました。

However, I had to apply separately for transportation expenses in XML format or something.

excelシートをxml変換してシステムに喰わせたりしていたのですが、予想通り、システムから弾かれました。

I had been converting Excel sheets to XML and feeding them into the system, but the system rejected them as expected.

仕方がないので、交通費の方は、1年間分を合算して手入力しました(といっても4件でしたが)。

I had to manually enter the transportation expenses combined for the year (though there were 4 cases).

相変わらず、政府の作るシステムは、便利と不便が同居しています。

As always, the system created by the government is convenient and inconvenient in equal parts.

まあ、今回は、その面倒に見合わない金額(家族で、昼食のランチを食べにいける程度の金額)の還付金が得られましたが。

This time, I got a refund that was not worth the hassle (enough for my family to go out for lunch).

-----

ところで、税金と言えば、与党の政治パーティのキャッシュバック事件、いわゆる裏金事件ですが、昨日、党員の処分が決まったようですね。

Speaking of taxes, the party members in the ruling party's cashback case, the so-called back taxes case, seem to have been punished yesterday.

今回の処分の基準となった「500万円」が、どこから出てきたのか分かりません。

I do not know where the "5 million yen" that was the basis for this disposition came from.

私たちなら、「20万円」を超えらたら課税対象になりますが、500万円は、この25倍です。

In our cases, we would be subject to taxation if the amount exceeded 200,000 yen, but 5 million yen is 25 times this amount.

ふーん、20万円どころか、1000万円を越えても、納税しないでいいんだぁ~

まあ、基準金額を「20万円」にしたら、政権与党(もしかしたら、野党も)が機能停止になるのかもしれませんが、なんか釈然としないものがあります。

If the standard amount is "200,000 yen," the ruling party (and possibly the opposition party) may cease functioning, but there is something unexplainable.

-----

私、国益に資する人であれば、その人の人格には目をつぶりますが、国益に資さない人であれば攻撃します。

I will not pay attention to a person's character if it serves the national interest, but if it does not, I will attack them.

そういう人物は、私(江端)の利益(と気分)を害するからです。

Because such a person harms my (Ebata's) interests (and mood).

「政治家の臍(へそ)から下のことは記事にしない」

私は、政治家が何を信条としているのか、興味がありません(軽蔑はするかもしれないけど)。

I am not interested in politicians' beliefs (although I may despise them).

(旧統一教会のような)霊感商法をやるようなカルトでなければ、どんな宗教を信じていようとも構いません(バカにするかもしれないけど)。

I don't care what religion they believe in as long as it is not a cult that does psychic work (like the old Unification Church) (though I may make them look foolish).

ただ、

However, 

―― 金(カネ)だけはダメ

"I don't forgive them about the money scandal."

これは、理屈抜きで、(私の)心が許さない。

My heart will not accept it except for the logic.

-----

私が、お金持ちを羨しいと思えるのは、「お金を持っているから」ではありません。

I do not envy rich people because they have money.

私は、お金があることによる「安心」が羨しいのです。

I envy the "peace of mind" that comes with having money.

金(カネ)というのは、「安心の源泉」です。

Money is a "source of security."

その「安心」が、特権的な身分(政治家)と結びついているのであれば、私は、『最大級の僻(ひが)み』で、その「安心」を引き剥がして、地面に叩きつけて、ぶち壊してやりたいのです。

Suppose "security" is tied to a privileged status (politician). In that case, I want to rip that "security" away, smash it to the ground, and destroy it with the "greatest backhandedness" I can muster.

-----

今回の裏金事件、与党の党員39名の処分が確定し、その中には、執行部の決定に猛反発している議員もいるそうです。

In this case of back taxes, I heard the 39 party members of the ruling party have been confirmed for punishment, and some vehemently oppose the executive branch's decision.

39名 ―― これは、なかなか良い人数です。

"39" -- This is a good number of people.

ここは、39人が一斉に離党し、新党を立ち上げるべきです。

These 39 people should leave the party altogether and start a new party.

新党の名称は、やはりこれで決まりでしょう ―― 「新党"脱税"」または「新党"裏金"」

The new party's name should be "New Party for Tax Evasion" or "New Party for Cashback."

党名は、結党後に変更すればよいので、立ち上げ時は、これくらい目立った方が良いです。

The party can change its name afterward, so it is better to be as conspicuous as possible when launched.

党是は「倒閣」または「報復」でOK。

The Party policy can be "overthrow" or "retaliation".

運用資金は、ここまで貯めてきた"裏金"をファンドにしましょう。

For investment funds, use the "slush fund" they have saved up to this point as a fund.

多分、我が国だけでなく、世界が驚きます。

Perhaps not only our country but the world will be surprised.

各国でトップニュースです。

It will be top news in many countries.

2024,江端さんの技術メモ

SSHキーペアは、通常はローカルマシンで生成され、その後、公開鍵がリモートサーバーに配置されます。以下が一般的な手順です:

  1. id_rsa.pub (公開鍵):
    • ローカルマシンで生成されます
    • ssh-keygenなどのツールを使用して、ローカルマシン上でSSHキーペアを生成すると、id_rsa.pubという名前のファイルが生成されます。このファイルが公開鍵であり、リモートサーバーに登録されます。
  2. id_rsa (秘密鍵):
    • ローカルマシンで生成されます
    • 同様に、SSHキーペアを生成すると、id_rsaという名前のファイルが生成されます。このファイルが秘密鍵であり、クライアント側で認証に使用されます。この秘密鍵は、厳重に保管される必要があります。
  3. authorized_keys:
    • リモートサーバーに配置されます
    • リモートサーバーには、認証を許可する公開鍵が含まれるauthorized_keysファイルが存在します。このファイルには、リモートサーバーにアクセスを許可するために、クライアント側から送信された公開鍵が追加されます。

したがって、SSHキーペアの生成と配置の一般的なパターンは、ローカルマシンで生成された公開鍵がリモートサーバーに配置され、秘密鍵はクライアント側のローカルマシンに残されることです。

未分類

WindowsのDockerでFlutter for Web(開発環境構築)

https://qiita.com/toshibe/items/e05ebe152e579ad39a58

で、色々問題がでてくるけど、

Flutter

https://qiita.com/tiri/items/5ad8d173df2c3823a265

の記載の内容で対応できました。

動かし方

1. Dockerfileからイメージを作成する

docker-compose build

 2. イメージからコンテナを作成し、起動する

docker-compose up -d

 3. 起動したコンテナに入る

docker exec -it flutter bash

4. フラッターアプリを作成する

cd workspace
flutter create .

5. サーバーを立ち上げる

flutter run -d web-server --web-port=${WEB_SERVER_PORT} --web-hostname 0.0.0.0

さて、これでサンプルは動かせたんだけど、さて、コーディングはどうやるのかな?


docker exec -it flutter bash でシェルに入った後、

root@0c0fd167601e:/usr/local# ls
Android bin etc flutter games include lib man sbin share src workspace
root@0c0fd167601e:/usr/local# cd workspace/
root@0c0fd167601e:/usr/local/workspace# ls
README.md android ios linux pubspec.lock test windows
analysis_options.yaml build lib macos pubspec.yaml web workspace.iml
root@0c0fd167601e:/usr/local/workspace# cd test
root@0c0fd167601e:/usr/local/workspace/test# ls
widget_test.dart ← これがターゲットのソース(だと思う)

root@0c0fd167601e:/usr/local/workspace/test#more widget_test.dart

 

// This is a basic Flutter widget test.
//
// To perform an interaction with a widget in your test, use the WidgetTester
// utility in the flutter_test package. For example, you can send tap and scroll
// gestures. You can also use WidgetTester to find child widgets in the widget
// tree, read text, and verify that the values of widget properties are correct.

import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';

import 'package:workspace/main.dart';

void main() {
  testWidgets('Counter increments smoke test', (WidgetTester tester) async {
    // Build our app and trigger a frame.
    await tester.pumpWidget(const MyApp());

    // Verify that our counter starts at 0.
    expect(find.text('0'), findsOneWidget);
    expect(find.text('1'), findsNothing);

    // Tap the '+' icon and trigger a frame.
    await tester.tap(find.byIcon(Icons.add));
    await tester.pump();

    // Verify that our counter has incremented.
    expect(find.text('0'), findsNothing);
    expect(find.text('1'), findsOneWidget);
  });
}

という記載が見える。
とりあえず、ここを書き換えれば、最初のアプリが作れるのかな、とアタリを付けています。

https://docs.flutter.dev/get-started/test-drive

ざっくり、翻訳してみておく

Test drive

What you'll learn

#

  1. How to create a new Flutter app from a sample template.
    サンプルテンプレートから新しいFlutterアプリを作成する方法。
  2. How to run the new Flutter app.
    新しいFlutterアプリの実行方法。
  3. How to use "hot reload" after you make changes to the app.
    アプリに変更を加えた後に「ホットリロード」を使用する方法。

Guide depends on your IDE
ガイドはあなたのIDEに依存します。

#

These tasks depend on which integrated development environment (IDE) you use.
これらの作業は、どの統合開発環境(IDE)を使うかによって異なる。

  • Option 1 explains how to code with Visual Studio Code and its Flutter extension.
    オプション1では、Visual Studio CodeとそのFlutter拡張機能を使ってコーディングする方法を説明する。
  • Option 2 explains how to code with Android Studio or IntelliJ IDEA with its Flutter plugin.
    オプション2では、Android StudioまたはIntelliJ IDEAのFlutterプラグインを使ってコーディングする方法を説明する。Flutter supports IntelliJ IDEA Community, Educational, and Ultimate editions.
    FlutterはIntelliJ IDEA Community版、Educational版、Ultimate版をサポートしています。
  • Option 3 explains how to code with an editor of your choice and use the terminal to compile and debug your code.
    オプション3では、好きなエディターを使ってコードを書き、ターミナルを使ってコンパイルとデバッグを行う方法を説明する。

Choose your IDE
IDEを選ぶ

#

Select your preferred IDE for Flutter apps.
Flutterアプリに適したIDEを選択する。

Create your sample Flutter app

#

  1. Open the Command Palette.
    コマンドパレットを開く。Go to View > Command Palette or press Shift + P.
    表示 > コマンドパレットに移動するか、+ Shift + Pを押します。
  2. Type flutter
    fluter
    とタイプする
  3. Select the Flutter: New Project.
    Flutter: New Projectを選択する
  4. When prompted for Which Flutter Project, select Application.
    どのFlutterプロジェクトかを聞かれたら、Applicationを選択する。
  5. Create or select the parent directory for the new project folder.
    新しいプロジェクトフォルダの親ディレクトリを作成または選択します。
  6. When prompted for a Project Name, enter test_drive.
    プロジェクト名の入力を求められたら、test_driveと入力する。
  7. Press Enter.
    Enterを押す。
  8. Wait for project creation to complete.
    プロジェクトの作成が完了するまで待つ。
  9. Open the lib directory, then the main.dart.
    libディレクトリを開き、次にmain.dartを開く。To learn what each code block does, check out the comments in that Dart file.
    各コードブロックが何をするのかを知るには、そのDartファイルのコメントをチェックしてほしい。

The previous commands create a Flutter project directory called test_drive that contains a simple demo app that uses Material Components.
先ほどのコマンドでtest_driveというFlutterプロジェクトディレクトリが作成され、Material Componentsを使ったシンプルなデモアプリが含まれる。

Run your sample Flutter app
サンプルのFlutterアプリを実行する

#

Run your example application on your desktop platform, in the Chrome web browser, in an iOS simulator, or Android emulator.
デスクトップ・プラットフォーム、Chromeウェブ・ブラウザ、iOSシミュレータ、Androidエミュレータでサンプル・アプリケーションを実行してください。

  1. Open the Command Palette.
    コマンドパレットを開く。Go to View > Command Palette or press Shift + P.
  2. Type flutter
    fluterとタイプする
  3. Select the Flutter: Select Device.
    Flutter: New Projectを選択するIf no devices are running, this command prompts you to enable a device.
    実行中のデバイスがない場合、このコマンドはデバイスを有効にするよう促します。
  4. Select a target device from Select Device prompt.
    Select Deviceプロンプトからターゲットデバイスを選択します。
  5. After you select a target, start the app. Go to Run > Start Debugging or press F5.
    ターゲットを選択したら、アプリを起動する。Run > Start Debuggingに進むか、F5を押す。
  6. Wait for the app to launch.
    アプリが起動するのを待つ。You can watch the launch progress in the Debug Console view.
    起動の進行状況は、デバッグコンソールビューで確認できます。

After the app build completes, your device displays your app.
アプリのビルドが完了すると、デバイスにアプリが表示されます。

Starter app on macOS
Starter app
スターターアプリ

Try hot reload
ホットリロードを試す

#

Flutter offers a fast development cycle with Stateful Hot Reload, the ability to reload the code of a live running app without restarting or losing app state.
Flutterは、ステートフルホットリロード(Stateful Hot Reload)、つまりアプリを再起動したりアプリの状態を失ったりすることなく、実行中のアプリのコードをリロードする機能によって、高速な開発サイクルを提供します。

You can change your app source code, run the hot reload command in VS Code, and see the change in your target device.
アプリのソースコードを変更し、VS Codeでホット・リロード・コマンドを実行すれば、ターゲット・デバイスで変更を確認できる。

  1. Open lib/main.dart.
    lib/main.dartを開く。
  2. Change the word pushed to clicked in the following string. It is on line 109 of the main.dart file as of this writing.
    以下の文字列のpushedをclickedに変更する。これを書いている時点では、main.dartファイルの109行目にある。

    Original New
    'You have pushed the button this many times:' , 'You have clicked the button this many times:' ,
  3. Save your changes: invoke Save All, or click Hot Reload lightning bolt .

Your app updates the string as you watch.
変更を保存する:すべて保存を実行するか、ホットリロードをクリックします。

Starter app after hot reload on macOS
Starter app after hot reload

2024,江端さんの忘備録

松本人志さんの事件について、私は、今後も、その事件そのものについては、コメントはしないつもりです。

I will not comment on the case of Mr. Matsumoto's case itself.

私は、1981年の「ロス疑惑事件」を覚えているからです。

Because I remember the "Los scandal" of 1981.

この事件、当時も今も、私には整理できないほど複雑で、今も理解できておりません。

This case was then and still is too complicated for me to understand.

興味のある人は、こちらをどうぞ。

For those interested, click here.

当時、私はティーンエイジャでしたが、この事件にあまり関心はありませんでした。

I was a teenager then and did not pay much attention to the case.

ただ、世間とマスコミの加熱ぶりは、よく覚えております。

However, I remember how heated the public and the media were.

-----

私が、今でもはっきり覚えているのが、

I still remember it clearly,

「その事件で、その人物を呼び捨てにして、散々犯人扱いしてきた週刊誌が、最高裁での無罪の確定後に、『さん』づけで呼び、そして、『犯人扱いされてきたことに』に『同情的』な記事を掲載した」

The weekly magazine, which had called the person out in the case and treated him like a criminal, called him "Mr." after his acquittal by the Supreme Court and published an article that was "sympathetic" to "what he experimented treatment as a criminal."

ということです。

確か、"女性"という単語を含む週刊誌だったと思います。

It was a weekly magazine that included the word "women."

私は、その週刊誌に対して、"無知性"、"無能力"、"無責任"、"無教養"、"無信念"、"無品性"、"無羞恥" ―― と、ありとあらゆる罵詈雑言を付くしても、なお足りないと思えるほど罵倒したことを覚えています。

I remember cursing the weekly magazine for its "ignorance," "incompetence," "irresponsibility," "illiteracy," "unbelief," "lack of character," "shamelessness," and a host of other abuses that would have been inadequate.

今も、その気持ちを消し去ることはできず、その手の週刊誌を読んでいる人を見ると(以下省略)。

Even now, I can't erase that feeling when I see people reading those weekly magazines (Omitted below).

-----

私も、物書きの端くれとして、批判や非難を受けることがあります。

As a writer, I am also subject to criticism and condemnation.

それは仕方がないことと思っていますが、少なくとも「"無羞恥"と罵倒されることはしないようにしよう」と思っています。

I don't blame them; however, I try not to be abused as "shameless.

間違ったことを書いてしまって、それが間違っていたと自分が納得したなら、『私が、間違っていました。ごめんなさい』とちゃんと言えるように心掛け、これからも、そうしたいと思っています。

If I write something wrong and am convinced it is wrong, I can say, 'I was wrong. I am sorry,' and I will continue to do so.

というか、私にとって、「"私"が正しいかどうか」は比較的どーでもいいのです。

It is relatively unimportant to me whether "I" am right or not.

私は、自分が間違っていることに納得できれば、3秒以内に考え方を変えることができるように訓練された、研究員&エンジニアですから。

I am a researcher & engineer trained to change my mind within 3 seconds if I am convinced I am wrong.

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

未分類

https://suumo.jp/article/oyakudachi/oyaku/chintai/fr_room/tsuukinjikan_heikin/

https://toyokeizai.net/articles/-/140017?display=b

https://prtimes.jp/main/html/rd/p/000000286.000000624.html