2022/07,江端さんの忘備録

あの、元首相殺害事件以降、「統一教会」 ―― 今は『世界平和統一家庭連合』と改称しているようですが ―― が話題に出ています。

Since the murder of the former prime minister, the "Unification Church", which now seems to have changed the name to "Family Federation for World Peace and Unification", has been in the news.

GoogleMAPで調べたら、自宅の回りに3つの教会が見つかり、真っ青になっていたのですが、もう一度、改称後の名称で入れたら、1つでした。

Checking the church by the Google map, I found the three churches --- I looked pale. After rechecking, I found that there was one church around my house.

だからといって、安心した訳ではありませんが。

However, I could not feel a relief.

-----

私が、大学入学時に、大学、サークル、教授から、徹底的に言われ続けたことは、

When I started my college life, I was thoroughly told by the university authorities, circle activities and teachers was,

『妙な勧誘を受けたら、一言もしゃべらずに、直ぐに逃げろ』

"If you are approached by a strange solicitor, don't say a word, just run away"

でした。

これについては、私が語らずとも、多くのページがありますので、そちらを御参照頂ければと思いますが、私の場合、実際に、友人が被害者になる直前でした。

You can find many information using a search engine, so I don't have to explain about it. In my case, my friend was about to victims against the cult religions.

https://wp2.kobore.net/%e6%b1%9f%e7%ab%af%e3%81%95%e3%82%93%e3%81%ae%e5%bf%98%e5%82%99%e9%8c%b2/post-2908/

二人の娘たちの大学入学時には、最高レベルの警戒体制を敷いていました。

When my two daughters started their college life, I was on the highest lever of alert.

彼女らには、『勧誘を受けたり、どこかに連れていかれそうになったら、直ぐに私に連絡するように』と、再三言い含めていました。

I told them again and again "if you are solicited or are about to be taken to somewhere, call me immediately at any cost"

当時、『統一教会』は、左翼の過激派よりも、恐しい「洗脳カルト団体」として認定されていたのです。

At that time, "Unification Church" is recognized as "brainwashing cult organization" that was more scared than Left-wing extremists

(ちなみに、私、自治寮の寮長やっていたので、「統一教会」から『お前が言うな』と言われそうですが、私は、オルグとか一度もやらない怠けた寮長でしたし、そもそも、私は、寮に住んでいるヤツらが大嫌いでした)

(Incidentally, I was the head of a self-governing dormitory, so the Unification Church might say "You don't say that", But I was a lazy head who had never tried the organizing, moreover I hated people in the dormitory.)

https://wp2.kobore.net/%e6%b1%9f%e7%ab%af%e3%81%95%e3%82%93%e3%81%ae%e5%bf%98%e5%82%99%e9%8c%b2/post-6594/

-----

万一、娘たちが、大学のキャンパスで、右翼系または左翼系の団体に取り込まれたとしても、私は、単身で組織に乗り込んで、論破して、場合によっては力づくで奪還する計画もありました。

Even if my daughters were taken in by a right/left-wing organization, I had a plan to go a hideout, argue and recapture them by force.

暴力受けたら、その場で「私の勝ち」が確定する(刑事事件になる)、という見積りもありました。

I had an estimation that I got to confirm my win (on the spot) as a crime case, if I received violence.

-----

ところが、カルト宗教団体には、基本的に「必勝法がない」のです。

However, frustratingly there is no winning strategy against cult groups basically.

洗脳された人間は、ロジックでは洗脳を解くことができないからです。

This is because brainwashed people cannot be unbrainwashed by logic.

それどころか、私ですら、教団に拉致されたら、簡単に洗脳される自信があります。

On the contrary, I am confident that even I would be easily brainwashed if I were kidnapped by the cult.

そもそも、私は、自分の実験によって、自分の脳のロバスト性が、驚くほど低いことを知っています。

Above all, I know well that the robustness of my brain is surpurisely low.

ダイエット程度のことで、正常な判断ができなくなっていたことからみても、これは明らかです。

This is clear that the fact that I could not make normal decisions during my diet.

ともあれ『一度、拉致されたら、終わり』 ―― これが「統一教会」に対する、当時の認識でした。

"Once kidnapped, that's the end". This was my understanding of the Unification Church at the time.

ちなみに、このあたりの内容については、アニメ「ゴールデンタイム」第3話「ナイトエスケープ」で、上手く描かれています(Youtubeに飛びます。AmazonPrimeでも視聴できるようです)

Incidentally, the content is well depicted in the anime "Golden Time" episode 3, "Night Escape" (jump to YouTube, which is also available on Amazon Prime).

(続く)

https://wp2.kobore.net/%e6%b1%9f%e7%ab%af%e3%81%95%e3%82%93%e3%81%ae%e5%bf%98%e5%82%99%e9%8c%b2/post-6874/

 

2022/07,江端さんの技術メモ

// go get github.com/lib/pq を忘れずに
// go run main12.go

/*
	Channelによるブロックを回避する方法として、Goのタイマー time.Timerで、定期的にブロックを破れるかのテストプログラム
*/

package main

import (
	"fmt"
	"time"

	_ "github.com/lib/pq"
)

var Ch1 chan interface{}

func channel_maker() {
	for {
		time.Sleep(2 * time.Second) // 2秒待つ ()
		Ch1 <- "Ebata is great"
	}
}

func main() {
	Ch1 = make(chan interface{}) // チャネルの初期化
	go channel_maker()

	ping := time.NewTimer(5 * time.Second) // イベントが何もなくても5秒後に発火するようにする
	defer ping.Stop()                      // main()を抜ける前に無効にしておく(なくてもいいかも)

	for {
		select {
		case a := <-Ch1:
			fmt.Println(a)
		case <-ping.C:
			fmt.Println("A ping is coming")
			ping = time.NewTimer(5 * time.Second) // イベントが何もなくても5秒後に発火するようにする
		}
	}
}

うむ・・・ちゃんと動く。困った。

2022/07,江端さんの忘備録

飲み物を取りにリビングに降りていくと、嫁さんと娘がテレビドラマを見ていました。

When I went down to the living room to get a drink, my wife and daughter watch the TV drama.

『ITで、全ての子どもに平等に学べる場所を作りたい』

"I will make a place where all children can study equally by IT"

てなセリフを語っている主人公と思われる役者を見ました。

In the drama, an actress, who seemed to play a main character, was speaking such a line.

-----

シニカルな笑顔を浮べて、私が「何か」を言い出そうとした時、

When I am about to say my comment with scornful smile,

―― 何も言わずに、とっとと自分の部屋に戻れ

"Say nothing and go back to your room soon"

という、圧を感じましたので、そのまま、飲み物を片手に、部屋に戻り戻りました。

I felt the pressure like that form them, so I went back to my room with a cup.

2022/03,江端さんの技術メモ

同じ現象が出て、青冷めていたら、自分の記事がヒットしました。

index.html

http://{s}.tile.osm.org/{z}/{x}/{y}.png → https://{s}.tile.osm.org/{z}/{x}/{y}.png
にしたら、直った

L.tileLayer('https://{s}.tile.osm.org/{z}/{x}/{y}.png', {
detectRetina: true,
maxNativeZoom: 18
}).addTo(map);

すぐに直って、本当によかった。

とは言え、そろそろ地図をローカルに取り込んでおく必要もあるかな・・・

キーワード
tile.osm.org  OSM 表示されない tile

 

2022/07,江端さんの忘備録

BS世界のドキュメンタリー 「インポッシブル・プロジェクト インスタントフィルムを復活させた男」

"BS World Documentary "The Impossible Project: The Man Who Revived Instant Film"

を見ました。

I watched the program.

「楽しかった」―― というか「嬉しかった」。

I enjoyed it, rather I feel happy.

-----

私は、自分の半生を、デジタル技術の先端分野で過してきた、という自覚があります。

I am self-conscious that I have spent half my life on the cutting edge of digital tech.

(ちょっと言い過ぎかもしれませんが、世間一般的には、間違っていないと思う)

(It is a bit of exaggeration, but in general, I don't think it's wrong)

だからこそ、「全てにおいて、デジタルがアナログより良い」と言い切れないことも、良く知っています

Therefore, I know that we should not say that "digital is superiors to analog at any case"

それはさておき。

That's aside.

-----

最近、さまざまな企業で、「創造性を高める為」の『共創空間』なるものが流行っているようです。

Recently many companies are trying t make "co-creation space" to "enhance creativity".

このような空間で、「創造性が高まった」という、客観的な(数値等を使った)報告書は見つけられていませんが、このような『おしゃれ』な空間で仕事をする人が好きな人は、多いのかもしれません。

I could not find the reports that show the effectiveness of "creativity" from objective viewpoint using numbers, however, some people seem to like to work in these fashionable space.

一方、私といえば ―― 「ビビッドな色彩の壁」「奇妙な形の(不安定な)椅子」「多くの仲間」「コーヒーの香り」の中で、特許ネタを捻り出せたことがありません ―― というか、

On the other hand, speaking of me, I have never been able to think of a patent story among the "vividly colored walls," "oddly shaped (unstable) chairs," "many friends," and "the smell of coffee.

むしろ「創作の邪魔」と言い切れるレベルです。

Rather, they are always "obstacles" for my patent work.

私の場合、「暗い」「寒い」「狭い」部屋で、たった一人でホワイトボードと対峙している時に、創造力は最高潮に達します。

In my case, my creativities go to the peak when I am alone in the "dark", "cold", "small" room, facing a whiteboard.

企業研究員で、特許出願100件(分割出願やパリ条約の優先権出願を含む)越えをしている人間(例えば、私(江端))が、それほど多いとは思えません。

I don't think that there are many people who have applied more than 100 patent applications( including "divided" or "priority by Paris treaty") to the patent office, like me.

それ故に、『共創空間』の効果は、個人差が大きいのかもしれませんし、または、私が例外的に「変な奴」なのかもしれません。

Therefore, the effectiveness of the "Co-Creation Space" may vary greatly from person to person, or I may be an exceptionally "weird guy".

まあ、「暗く寒く狭いセピア色の実験室」を、『共創空間』と言い張ったら、企業イメージは悪くなるとも思いますので、そこは、大人の事情として汲み取る必要はあると思っています。

Well, if a company insist that "dark, cold, small, sepia-colored laboratory" is a "co-creation space", the company's image will be in ruin. So I think that I have to understand the background of the company.

-----

最近、私、ホワイトボードの自作に関して、色々公開しています。

Recently, I have opened about a DIY whiteboard.

https://wp2.kobore.net/%e6%9c%aa%e5%88%86%e9%a1%9e/post-6814/

私の研究員人生における創作活動で、もっとも役に立ったものは、「ホワイトボード」です。

The most useful item in my research engineer's life, has been "whiteboard"

PCでもスマホでもプリンタでもスキャナでもなく、そして、多くの有能の同僚ですらも「ホワイトボード」には、敵いません。

It is not PC, smartphone, printer, and scanner. Moreover, even my competent colleagues cannot exceed "whiteboard"

「ホワイトボード」といえば、ブレストでの知識の共有ツールとしての利用が定番ですが、私の場合「自分との対峙」の為のツールです。

"Whiteboard" is a common tool to share knowledges in brain storming, however in my case, it is a tool to "fight me".

つまり、ある種類のアナログは、今もまだ、私にとっての最強ツールなのです。

In short, some of analog are the strongest tools for me still now.

2022/07,江端さんの技術メモ

// go run main3.go

/*
	(1)固定長配列を試してみる
*/

package main

import "fmt"

type LocInfo struct {
	Lon float64
	Lat float64
}

func main() {

	var Li [60]LocInfo // 要素0で初期化されている

	for i := 0; i < 60; i++ {
		Li[i].Lon = float64(i)
		Li[i].Lat = float64(i)
	}

	fmt.Println(Li)

	Li[32].Lon = 0.001
	Li[32].Lat = 0.001

	fmt.Println(Li)

}

未分類

// go get github.com/lib/pq を忘れずに
// go run main5.go

/*
	(1)適当な座標情報を入力して、近くのOpenStreetMapのnodeに強制的に寄せて、ダイクストラ計算を強行する方法
	(ここでは300メートル以内で、もっとも近いノードを見つける、という処理をやっている)
*/
package main

import (
	"database/sql"
	"fmt"
	"log"

	_ "github.com/lib/pq"
)

func main() {
	db, err := sql.Open("postgres",
		"user=postgres password=password host=localhost port=15432 dbname=utsu_db sslmode=disable")
	if err != nil {
		log.Fatal("OpenError: ", err)
	}
	defer db.Close()

	rows, err := db.Query("SELECT source,
	x1 as longitude, y1 as latitude, ST_Distance('SRID=4326;POINT(139.9182893339256 36.573831584767085)'::GEOGRAPHY, the_geom) as dist FROM ways WHERE ST_DWithin(the_geom, ST_GeographyFromText('SRID=4326;POINT(139.9182893339256 36.573831584767085)'), 300.0) ORDER BY dist")
	if err != nil {
		log.Fatal(err)
	}
	defer rows.Close()

	for rows.Next() {
		var source int
		var longitude float64
		var latitude float64
		var dist float64

		if err := rows.Scan(&source, &longitude, &latitude, &dist); err != nil {
			fmt.Println(err)
		}
		fmt.Println(source, longitude, latitude, dist)
	}

	if err := db.Ping(); err != nil { //データベースが繋っているかの確認(らしい)
		log.Fatal("PingError: ", err)
	}
}

2022/07,江端さんの技術メモ

// go get github.com/lib/pq を忘れずに
// go run main9.go

/*
	(1)GolangでOpenStreetMap上にマップマッピングするプリミティブな江端式定番マッピング方法
	(http://kobore.net/over90.jpg参照)
*/

package main

import (
	"database/sql"
	"fmt"
	"log"
	"math"

	_ "github.com/lib/pq"
)

var source int
var longitude float64
var latitude float64
var dist float64

func rad2deg(a float64) float64 {
	return a / math.Pi * 180.0
}

func deg2rad(a float64) float64 {
	return a / 180.0 * math.Pi
}

func distance_km(a_longitude, a_latitude, b_longitude, b_latitude float64) (float64, float64) {
	earth_r := 6378.137

	loRe := deg2rad(b_longitude - a_longitude) // 東西  経度は135度
	laRe := deg2rad(b_latitude - a_latitude)   // 南北  緯度は34度39分

	EWD := math.Cos(deg2rad(a_latitude)) * earth_r * loRe // 東西距離
	NSD := earth_r * laRe                                 //南北距離

	distance_km := math.Sqrt(math.Pow(NSD, 2) + math.Pow(EWD, 2))
	rad_up := math.Atan2(NSD, EWD)

	return distance_km, rad_up
}

func diff_longitude(diff_p_x, latitude float64) float64 {

	earth_r := 6378.137
	// ↓ これが正解だけど、
	loRe := diff_p_x / earth_r / math.Cos(deg2rad(latitude)) // 東西
	// 面倒なので、これで統一しよう(あまり差が出ないしね)
	//loRe := diff_p_x / earth_r / math.Cos(deg2rad(35.700759)) // 東西
	diff_lo := rad2deg(loRe) // 東西

	return diff_lo // 東西
}

func diff_latitude(diff_p_y float64) float64 {
	earth_r := 6378.137
	laRe := diff_p_y / earth_r // 南北
	diff_la := rad2deg(laRe)   // 南北

	return diff_la // 南北
}

func main() {
	db, err := sql.Open("postgres", "user=postgres password=password host=localhost port=15432 dbname=utsu_rail_db sslmode=disable")
	if err != nil {
		log.Fatal("OpenError: ", err)
	}
	defer db.Close()

	rows, err := db.Query("SELECT seq,x1,y1 from lrt")
	if err != nil {
		log.Fatal(err)
	}
	defer rows.Close()

	x1, y1 := -1.0, -1.0
	_x1, _y1, _x2, _y2 := -1.0, -1.0, -1.0, -1.0
	px, py := -1.0, -1.0
	flag := 0
	f_flag := 0
	seq := -1

	for rows.Next() {

		if f_flag == 0 { // 初回だけ2二回入力
			if err := rows.Scan(&seq, &x1, &y1); err != nil {
				fmt.Println(err)
			}
			_x1, _y1 = x1, y1
			//fmt.Println(x1, y1)
			f_flag = 1
			continue
		}

		if err := rows.Scan(&seq, &x1, &y1); err != nil {
			fmt.Println(err)
		}
		//fmt.Println(seq, ",", x1, ",", y1)

		_x2, _y2 = x1, y1

		_, rad_up := distance_km(_x1, _y1, _x2, _y2)

		px, py = _x1, _y1

		for {
			// 5.56m/s → 時速20

			px += diff_longitude(0.00556*2*math.Cos(rad_up), py)
			py += diff_latitude(0.00556 * 2 * math.Sin(rad_up))

			//double rad0 = atan2((end_y - start_y),(end_x - start_x));
			//double rad1 = atan2((end_y - test_person.p_y),(end_x - test_person.p_x));

			rad0 := math.Atan2((_y2 - _y1), (_x2 - _x1))
			rad1 := math.Atan2((_y2 - py), (_x2 - px))
			// ここは、http://kobore.net/over90.jpg で解説してある

			if math.Abs(rad0-rad1) >= math.Pi*0.5 {
				// 終点越えの場合、終点に座標を矯正する
				px, py = _x2, _y2
				flag = 1 // フラグを上げろ
			}

			fmt.Println(px, ",", py)

			if flag == 1 {
				flag = 0
				_x1, _y1 = _x2, _y2
				break
			}
		}

	}

	if err := db.Ping(); err != nil {
		log.Fatal("PingError: ", err)
	}

}

未分類

// go get github.com/lib/pq を忘れずに
// go run main10.go

/*
	(1)golangの中でSQL文を作る時に、てっとり早く数値の部分を文字列にする方法
	(2)golangの可変長配列の作り方と、面倒くさい場所の値をひっぱり出す方法
*/

package main

import (
	"database/sql"
	"fmt"
	"log"
	"math/rand"

	_ "github.com/lib/pq"
)

func transfer_point(origin, destination int) (int, int) {
	// utsu_tram_db3をオープン
	db, err := sql.Open("postgres", "user=postgres password=password host=localhost port=15432 dbname=utsu_tram_db3 sslmode=disable")
	if err != nil {
		log.Fatal("OpenError: ", err)
	}
	defer db.Close()

	// node番号 1200 から 12000 までのダイクストラ計算を行う
	str := "SELECT seq, node, edge FROM pgr_dijkstra('SELECT gid as id, source, target, cost FROM ways'," + fmt.Sprint(origin) + "," + fmt.Sprint(destination) + ", directed:=false)"
	rows, err := db.Query(str)
	if err != nil {
		log.Fatal(err)
	}
	defer rows.Close()

	var seq, node, edge int
	var add_node_num = []int{} // 可変長配列

	for rows.Next() {
		if err := rows.Scan(&seq, &node, &edge); err != nil {
			fmt.Println(err)
		}

		// ルート分離は、0<x<70の値が出てきたら、駅のノードである、とする。
		// 何しろ、私が地図を改ざんしたのだから間違いない
		// で、その値を全部格納する

		if node > 0 && node < 70 {
			add_node_num = append(add_node_num, node)
		}
	}

	if len(add_node_num) >= 4 { // 見つけることができたら最初から2番目と、最後から2番目の番号(0 < X < 70)を取り出す
		first_node := add_node_num[1]
		last_node := add_node_num[len(add_node_num)-2]

		if (first_node > 0 && first_node < 70) || (last_node > 0 && last_node < 70) {
			return first_node, last_node
		} else {
			log.Fatal("wrong node:", err)
		}
		//fmt.Println("first_node:", first_node, "last_node:", last_node)

	} else { // 見つけることができなかったら
		return -1, -1
		//fmt.Println("No node")
	}

	return 0, 0 // ダミー用のリターン(ここには来ないはず)
}

func main() {
	fmt.Println(transfer_point(21509, 11215))

	for i := 0; i < 100; i++ {
		a := rand.Intn(30000)
		b := rand.Intn(30000)

		//fmt.Println(sub_main(2200, 2400))
		fmt.Println(a, b)
		fmt.Println(transfer_point(rand.Intn(a), rand.Intn(b)))
	}
}

2022/07,江端さんの技術メモ

// go get github.com/lib/pq を忘れずに

package main

import (
	"fmt"

	_ "github.com/lib/pq"
)

// GetLoc GetLoc
type GetLoc struct {
	ID    int     `json:"id"`
	Lat   float64 `json:"lat"`
	Lng   float64 `json:"lng"`
	TYPE  string  `json:"type"` // "USER","BUS","CONTROL
	POPUP int     `json:"popup"`
	//Address string  `json:"address"`
}

func person(gl2, gl3 *GetLoc) {

	if gl2.Lng > 0.0 {
		fmt.Println("pass1", gl2)
	} else {
		fmt.Println("pass2", gl2)
	}
}

func person_real() {
	var gl2, gl3 GetLoc

	gl2.Lng = 139.00

	person(&gl2, &gl3)

}

func main() {

	var gl2, gl3 GetLoc

	person(&gl2, &gl3)

	person_real()

}