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

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

さて、昨日の「統一教会」ですが、私が学生の頃のキャンパスでは「原理(げんり)」または「原理研(げんりけん)」と呼ばれていました(今は、CARPと称しているようです)。

About the "Unification Church" of yesterday's diary, they were called "Genri" or "Genri-Ken" in the college campus. (Now they seem to call them "CARP")

この2つの関係については、各論あるようですが、私にとって両方とも同じ"カルト"です。

There seems to be several arguments about the relationship between them, however, I think that they are both "cult".

これまで、この認識を変える必要を感じたことは、一度もありません(すっかり、忘れてはいましたが)。

I have not felt the necessary to change my recognition at all (though I have forgotten them for a long time).

-----

京都は、学園都市だったので、街中に「原理」がうじゃうじゃいました。

Kyoto has been a sort of college town, so there were a lot of swarming "Genri" around the town.

やつらは、なれなれしく話かけてきて、大体、切り口は、いつも同じ、

They talked to me in an over-familiar manner, and the start of talking was always

『あなたは、今、幸せですか』

"Are you happy now?"

でした。

ただ、私も、『普通の学生』と言い切れない身の上でしたので、この手の奴等をあしらうことは、造作もないことでした。

On the other hand, I didn't think that "I am an normal student". So it was easy to handle these guys.

「怒号のやりとり」くらい、普通にできなければ、自治寮では生活できません。

"Angry shouts" in the public streets, was a piece of cake for a student who was living in a self-governed dormitory.

―― で、実際に、往来で怒鳴り返してくることのできる学生(私)に、驚いていたようですが。

They seemed to be surprised at a student who could counter-attack with angry shouts in public space.

-----

で、そのうち、私も面倒になってきて、

After those days, I felt to be annoyed by them. So I changed the strategy.

『あなたは、今、幸せですか』

"Are you happy now?"

『ええ、毎日、目が眩むほど幸せです。あなたは違うのですか?』

"Of course, Yes, I am dazzlingly happy every day. Are you not?"

と、気の毒そうな顔をして相手を見てやれば、大体、呆然として立ちすくんでいました。

with looking at them with a concerned expression. Mostly they stood there stunned.

覚えている限り、勝率100%でした。

As far as I remember, the win rate was 100%.

-----

ふと、今思い出したのですが ――

Suddenly, I remember now--

下宿に入り込んできたカルトグループに対して、下宿の中に「部外者は出ていけ!」というビラを数十枚張りまくって、排除を始めたことがあります。

I once started to eliminate a cult group that had entered my boarding house by putting up dozens of flyers "Outsiders, get out!

さらに、部屋にやって来た奴と、下宿の全員に聞こえるように、夜中の2時頃に1時間近く、怒号の応酬を行い続けたこともあります。

In addition, I was loud shouting match with a guy who came to my room for nearly one hour around 2:00 AM, to make the group members keep hearing the rage contents.

私は、下宿から全員を追い出すまで、攻撃の手を緩めませんでした。

I did not relent in my attack until I had removed everyone from the boarding house.

今思えば、やつらは「原理」ではなく「オウム」だったような気がします(そんな服装していた)。

Looking back, I think they were "Ome" not "Genri" (they were dressed like that).

-----

この時の成功体験が、

I think that the successes of this time, became a method of mine, like

―― 何かの問題が発生した場合は、「鎮火」ではなく「炎上」に持ち込む

"If something goes wrong, make it to 'flame-out' instead of 'extinguish'"

という、私のメソッドとして確立したような気がします。

-----

大学のカルトサークルについては、

As for college cult circles,

『四畳半神話大系』の第5話も、参考になります(YouTubeに飛びます)。

the Episode 5 of "Shijohan Shinwa Taikei" is also a good reference (jump to YouTube).

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,江端さんの技術メモ

// 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/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.

自作ホワイトボード ―― 完結編

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

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()

}