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

選挙で行われる候補者の「握手」ですが、あれ、多分、効果あります。

I think that "handshake" from the candidate on election campaign might be effective.

私、以前、とある漫画家の方にインタビューさせて頂いたことがあります。

Previously I went to interview to a cartoonist

濃厚な時間を過ごさせて頂いた記憶があります ―― たぶん 、「握手」よりも、強い「何か」だったと思います。

I remember that we could spend an intense time, which was stronger than "handshake".

今回は、この漫画家の方が、初めて出馬されると聞き及び、『是非、当選して貰いたい』という気持ちがあります。

I heard that He is running for the House of Councillors, and I hope him to win the election.

-----

自分の恥を晒すようで、正直恥しいのですが ――

To be honest, I am shamed to open my ignorance, however, this time I know the following.

(1)比例区の投票では、政党名を書くのが一般ですが、『個人名を書く』ことができます

(1) In proportional district voting, it is common to write the name of the political party, but you can "write the name of the individual".

(2)で、『個人名で書く』ことで、その人を比例区名簿の上位に押し上げることになります

(2) and 'writing in the individual's name' will push that person to the top of the proportional district list

参議院選挙は、「比例名簿の順位を事前に決めない」という「非拘束名簿式」を採用しているからです。

Because, at the House of Councillors election, they use "non-binding list system", which means "the order of the proportional list is not decided in advance"

つまり、政党名ではなく、個人名で書くことで、その人が当選確率が高くなるのです。

In short, writing "individual name" not "party name", increase the person's change of being elected.

比例区でありながら、事実上の個人を指定した投票ができるのです。

Even in proportional district voting, we can vote the person directly.

いや、本当に、恥しいんですけど、私、このことを知らなかったのです(さっきまで)。

Though It was very shameful for me, I have not known the method just now.

------

この漫画家の方が、著作権問題に、どれほど真面目に、かつ、奇抜なアイデアを持ち込んで取り組んできたか、私は知っています。

I know the cartoonist has dealt with copyright problems seriously, and brought me amazing ideas to us for a long time.

ですので、

Therefore, today I will go to vote on the day before the deadline and write,

(1)選挙区には、先日検討して「除外されなかった」なかの1人の名前を、

―― とまあ、候補者の考え方や戦略を読み取る上で、選挙公報は、それなりに、楽しい読み物です。

(1) the name of the candidates who have not excluded by me for Electoral district elections

(2)比例区には、この漫画家の方の名前を、

(2) the name of cartoonist for proportional district elections

本日、期日前投票で、記載してくる予定です。

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

「ようこそ実力主義の教室へ」というアニメの第2期が始まっているようです。

It seems that the second season of the anime "Welcome to the Meritocracy Classroom" has started.

-----

「ようこそ縁故主義の教室へ」―― 族長が率いる一族のクラス。始終他のクラスと抗争していそう。

"Welcome to the Edenic Classroom" families led by a chief, seems to be in constant conflict with other classes.

「ようこそ血縁主義の教室へ」―― 全員親戚のクラス。気が滅入る。

"Welcome to the kinship classroom", all classes of relatives. Depressing.

「ようこそカルト主義の教室へ」―― 全員が目がすわっている狂信者のクラス。怖い。

"Welcome to the Cultism Classroom" fanatics who all have crazy eyes. Scary.

「ようこそ人格主義の教室へ」―― 全員が人格者のクラス。息苦しそう。

"Welcome to the personalism classroom", everyone is a person of integrity. It's suffocating.

と考えると、

Coming to think of it, we could agree that

「ようこそ偏差値至上主義の教室へ」という学習塾が、いかに健全であるかが良く分かります。

"Welcome to the classroom of deviation supremacy", like prep schools are wholesomeness.

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

(昨日の続きです)

(Continuation from yesterday)

今回、私を引きつけたのは「沖縄米軍基地を東京へ引き取る」でした。

This time, what attract me is the party whose name is "Get the U.S. bases in Okinawa Pref. to Tokyo".

地理的な問題を無視して論じていいなら、これがいい。

This is good policy, if we can ignore the geographic problem.

ここに「東京に原発を」も加えて貰えれば、ほぼ満点です。

Adding "Get nuclear power plants in Japan to Tokyo", it will be almost full score.

-----

今回の公報では、「コロナ」が争点になっていないようです(一応、検索はかけてみました)。

In this election, "the new coronavirus disaster" seems to be out of scope. (I tried use a search engine just to be sure)

反ワクチンで、立候補する人がいないのは、ちょっと意外な感じがします。

I am not sure why no one who has a policy of "anti-vaccine" candidate.

もしピークが終焉していると仮定しても、『ワクチン犠牲者への補償』とかを掲げることはできると思うのですが、なんで行動しないのかなぁ、と。

Even if they think the disaster become peak out, they can say about "compensation to harmful side effects of vaccines". So I wonder that they have not done any activity.

ウイズコロナが成果を上げているので、争点にならないと判断したのかもしれません。

I think that they decided that it was not a contentious issue because of the effectiveness of "with corona" methods.

私は、政府のコロナ対策に、立候補者のほとんどが「文句がつけられなかった」のだろう、と推測しています。

I estimate that most of the candidate could not blame for the government about the "with corona" method.

「防衛費」については、何人かがヘッドラインで出しています。

According to the defense spending, some candidates show that in the headline.

しかし、「託児所」の文字も見えない。「LGBT」「同性婚」も少ない。

However, I could not find the phrase "day nursery". Fewer "LGBT" and "same-sex marriage."

―― とまあ、候補者の考え方や戦略を読み取る上で、選挙公報は、それなりに、楽しい読み物です。

Anyway, the election PR is enjoyable in order to estimate the thoughts and strategies of each candidates.

-----

先日、ロシアのウクライナ侵攻(侵略)のニュースを見ながら、長女がボソっといいました。

The other say, my daughter said to herself, while watching the news of Russia's invasion to Ukraine

―― 結局、『力』が全てなんだよねぇ・・・

"In the end, it's all about 'power'"

と。

私の20代には、まだこの観念はありませんでした。

When I was the 20's, I had no thought of it.

少なくとも、そういうことを語る大人に対して、歯向かう気力はあったと思います。

At least I had the energy to stand up to the adult who talked it like that.

今の若者は、「力の支配のない平和な世界」の理想(夢想)を持つことすら、許されていないのか、と思うと ―― なんだか可哀想に思えてきました。

The youth in the present cannot allow to have a dream of "a peaceful world without restriction by the power". Coming to think of it, I think they are pitiful.

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

今回の参議院選挙、保守一択かな、と思っていたのですが、今回は「改憲に"王手"がかかる可能性」を考慮しています。

I think I might choose a ruling party for the election for the House of Councilors, however, at this election, "the constitutional change" might be a big issue.

私、憲法に関する(1)国民投票の実現と、(2)改憲否決、を同時に見てみたいという、変な有権者です。

I am aware that I am a funny voter who hope both (1) the nation voting for Constitution to be realized and (2) the amendment to be rejected at the same time.

憲法はもっと自由に変更される機会があるべきで、その上で、賛成と反対が激論を交せる環境が良い、と思っています。

I believe that the Constitution should be changed more freely, and that it would be good to have an environment where pro and con sides can engage in heated debate.

-----

やっと、選挙広報が届きました。

Today, I received the election PR.

前回は、市役所まで取りに行き、翌日配送されるという、イタい経験をしましたので、今回はじっと到着を待っていました。

In the previous election, I felt pain that I went to the city hall to get it, and the next day, it were delivered at the next day. So this time, I just waited it.

今回、「数字を使って政策を語っている候補者、0人」ということで、江端のシード枠を取れた候補者はいませんでした。

In the PR, there is no candidate who uses numbers or charts, so they could not get Ebata's seed slot.

(1) 平文だけで選挙広報書いている人 ―― プレゼン能力"0"と判断して除外

(1) The person who use characters only, is no presentation ability.

(2) NHKのスクランブル放送から、NHK存続を前提とした高齢者の支払い免除へと、姑息な主旨変更をしている党も除外

(2) The party which changed their policy from scrambling broadcasts to exempting the elderly from paying.

(3) 父系天皇は、医学的根拠(私から見れば、興味のない根拠ではありますが)から論じている人がいないので、これも除外

(3) No person who argues the reasons for patrilineal emperors on medical grounds (In my opinion, I don't care of it at all).

(4) スパコンについて「世界で2番目ではダメですか」と言った人は、私からの票は絶対に得られない ―― 私は忘れない

(4) The person who said "What is a problem, even if the super-computer performance is the second in the world?" I never forgive her.

(5) 量子コンピュータやmRANについて論じている人は、私よりも理解ができていない(か、表現がなっていない)ので除外

(5) The persons who argue about quantum computers and mRAN is less understandable that me.

(6)最低賃金はバイトにも適用されるので(ちゃんと調べた)、 最低賃金を1500円まで上昇させれば小売商店や個人経営の飲食店はバタバタと潰れていくと思う

(6)Since the minimum wage apply for the albite, small retailers and restaurant will be bankrupt easily if the wage is risen at 1500 yen.

まあ、そういう店舗を潰して、日本のリストラをしたいなら、それでも良いとは思いますが(私は、小売業は保護した方が良いと思います)。

If they hope the wide restriction of Japan to lead to bankrupt, I can consider it (However I think the small retailers should be continued)

(6) 「消費税廃止」は試してみる価値があると思う。だが、具体的な数値を使った机上シミュレーション or コンピュータシミュレーションの結果(コードも合わせて)も公開していないのは、何故だ?

(6) I think that "the consumption tax should be abort" is a good policy. On the other hand, I don't know the reason why they don't open their simulations result on desk or on computer to us.

シミュレーションもなく、いきなり社会を使った実証実験をするには、危険すぎると思う

I am afraid that it is too danger to start the social and field experiments without any simulation.

(もし、シミュレーション結果があるなら、誰か私に教え下さい。そのネタで、コラム一本書きます)。

(If they have the results of the simulation, please let me know. I'll write a whole column on it).

(7) 芸術は守る価値はあると思うが、老後の心配(年金や国防)に比べれば、私には瑣末に過ぎる

(7) I think the arts are worth protecting, but they are too trivial for me compared to the concerns of old age (pensions and national defense).

(8) 『信仰でコロナ感染を防ぐ』とか唄っていたアホな教祖の党の候補者は、論外

むしろ、このような教祖や信徒は、「テロリスト」と認定してもよいのではないかと思います。

(8) The person of the party which the idiot guru who sang about "preventing corona infection through faith" are out of the question.

(続く)

(To be continued)

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

『なんでバスが鉄道の鉄橋の上を走るんだーー!』 で、頭を抱えて週末を潰している江端です。

"Why is the bus running on the bridge of railway!?" This phenomenon is annoying me this weekend.

バスが宇都宮ライトレールの上を驀進している ―― 宇都宮ライトレールの利用を拒否させるような、ダイクストラをどうやって作ろうか

昨夜は、夢の中でデバッグが出てきて、4回目が覚めて、疲労困憊です。

Last night, I woke up for the debugging in my dream four times, and I was exhausted.

先程、ダイクストラ関数で使っているコストパラメーを未修正であることに気がつきました。

Just now, I noticed that I didn't modify the cost parameter of the Dijkstra function.

ようやく、バスの暴走が防げるこを確認しました。

Finally I confirmed that I could prevent the bus from running out of control.

さあ、今日は、「乗り換え」の実装を完了するぞ。

Well, today, I am going to complete to implement "transferring at the station".

-----

最近、分かってきたのですが、私の不眠症は、コーディング(デバッグ)が佳境に入っている時と、強い相関関係があるようです。

Recently, I come to know that my insomnia is strongly related to heavy coding(debugging).

一方、コラム執筆とは、強い相関はないようです。

On the other hand, it seems to have nothing to do with writing columns.

不眠症発祥時に見る夢の中に出てくるものは、大体「プログラムのコード」か「データベースのリスト」です。

What appears in my dream during my insomnia are "programming code" and "lists of database" in many cases.

-----

まあ、要するに、ですね

In short,

「コーディングの悪夢で不眠症にならないような人の語る人工知能(技術)」

"the opinions that a person says about Artificial Intelligence without insomnia by coding"

など、私は、1mmも信じていないわけです。

is absolutely not believed.

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

の後で、「一体、江端は何を考えているんだ」と思われるかもしれませんが、『宇都宮ライトレールの利用を拒否させるような、ダイクストラをどうやって作ろうか』と考えています ―― しかも、できるだけ手を抜いて。https://wp.kobore.net/%e6%b1%9f%e7%ab%af%e3%81%95%e3%82%93%e3%81%ae%e6%8a%80%e8%a1%93%e3%83%a1%e3%83%a2/post-6473/

ところで、今、いくつかDBを作っていますが、混乱しかけているので、メモを残しておきます。

utsu_tram_db  : 道路と鉄道の強制結合
utsu_tram_db2: 鉄道のコストを下げて、宇都宮ライトレールを優先的に選ばれるようにした
utsu_tram_db3: 宇都宮ライトレールを単線にして、取り扱いをラクにした

ただ、今、ここで、バスが宇都宮ライトレールの上を驀進するようになってきましたので、これを何とかしないといけなくなりました。

ここで逆転の発想で、

utsu_tram_db4: 宇都宮ライトレールを誰も使いたくなくなるくらいに、コストを爆上げしてやればいい

と気がつきました。

で、utsu_tram_db3と、utsu_tram_db4を併用してやれば良い、と気がつきました。


この続きを記載したのですが、反映に失敗したようです。

という訳で簡単に説明しますと、utsu_tram_db3のコスト(現在0.2倍)を、逆に100倍にしたものをutsu_tram_db4として作成しました。現在上手く動いています(色々失敗もしましたが、それを書き残す気力は、もうありません。この週末、20時間以上コーディングしていて、フラフラです)


ちなみに、上記の作業で作ったデータベースを、他の人に渡す為に、以下の作業を行いました。

# pg_dump -U postgres -p 15432 utsu_tram_db3 > utsu_tram_db3.sql
# pg_dump -U postgres -p 15432 utsu_tram_db4 > utsu_tram_db4.sql

で作った、2つのデータベースのダンプ(utsu_tram_db3.sqlと、utsu_tram_db4.sql)を圧縮したのが、こちら。

utsu_tram_db.zip

まず、
create database utsu_tram_db3;
\c utsu_tram_db3
create extension postgis;
create extension pgrouting;
(utsu_tram_db4についても同じ)

としておいてから

これをutsu_tram_db.zipを解凍して、

# psql -U postgres -p 15432 utsu_tram_db3 < utsu_tram_db3.sql
# psql -U postgres -p 15432 utsu_tram_db4 < utsu_tram_db4.sql

で、PostgreSQLにインポートできます(source番号なども完全一致する(はず))。

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

我が家のトイレには、消し忘れ対策に、人感センサライトを使っています。

We use a motion sensor light in our restroom to prevent forgetting to turn of the light.

が、ここ数日、人感センサライトが全く反応しなくなりました。

However, the light has not worked well theses day..

ちょっと考えてみたのですが、多分、原因は、これです。

After thinking it a little, I noticed the reason.

人感センサライトは、体の移動による、赤外線放射の変化を検知して、ライトを付けいます。

The motion sensor light detect a changes in infrared radiation with moving human body, and turn on the light.

ならば、トイレの室温が体温以上であったとすれば ―― 当然、センサは赤外線を検知できません。

Then the tempterture of the restroom is higher than those of human-body, the sensor cannot detect any infrared radiation.

36度を越える気温が発生する場所と時間では、赤外線センサ付きの防犯ライト等は、完全に無力化します。

Therefore wherever and whenever the temperature is higher than 36 degrees Celsius, the effect of security lighting with infrared radiation sensors is missing perfectly.

-----

夜間に36度を越える熱帯夜 ―― 考えるだけで悪夢です。

Tropical nights with temperatures exceeding 36 degrees Celsius at night -- just thinking about it is a nightmare.

でも、数年前には『日中に40度を越える』という猛暑日の連続など、誰も想定していなかったはずです。

However we must remember that nobody could predict a series of extremely hot days (more than 40 degrees Celsius) a few years ago.

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

私、高校での体育の授業がなくなってから、スポーツが好きになりました。

After graduation from high school and losing gym class, I came to life sports.

(ちなみに、私が、絶望的な運動音痴だったお話は、こちらです)

正直に言いますけどね、本当に『みじめ』でしたよ。

(Here is a story that I was hopeless klutz)

大学ではスキーにはまり、就職後はテニスを始めました。

I was enthusiastic about skiing in college, and I started playing tennis in company,

-----

私、TOEICや英検などのことを、意図的に忘れるようになってから、英語を使うことに抵抗がなくなりました。

After forgetting TOEIC and Eiken intentionally, I was no longer afraid to use English.

自分の好きなように英語をしゃべり、英文のコラムや論文を書きまくるようになりました。

I used to speak English in my way, and I came to write my columns and papers in English.

-----

訳あって、今、またTOEICの勉強をしているのですが ―― 今ならはっきり言えますが

With some private reasons, now I begin to study about TOEIC. And now I can say clearly,

「このテスト、心底下らない」

"This test is ridiculous and meaningless"

です。

例えば、TOEICでの単語の選択肢の問題ですが、『正解が2つ、下手すると3つある問題があります』。

For example, about the word choice questions, I know that some questions have more than two correct answers.

名詞は形容詞的に使ったって問題ないし、副詞なんぞ、文章のどこに出てきたって、意味は通じます。

Nouns can be used adjectivally without any problem, and adverbs can make sense wherever they appear in a sentence.

会話問題に至っては、「会話の目的をexplicitに語れないこいつらは、なんて低能なんだ」と思います(本当)。

About the conversation question, I really think that "how low they are that they can't EXPLICITLY talk about the purpose of the conversation" (I think it is true).

こんなものに費やす時間で、海外に行けますし、英語の論文も書けて、運がよければ論文賞を貰えます ―― 断言します。

With the time you spend on this ridiculous and meaningless test, you can go abroad and write a paper in English, and if you are lucky, you get an award. I assure you.

-----

英語を本気で使いたければ、TOEICなんぞは忘れてしまう ―― これが正解です。

If you want to use English seriously, you should forget the existence of TOEIC. This is a correct answer.

しかし、日本というシステムは、どうしても「ものさし」を求めるものです。

However, the system of called "Japan" needs a "measure" for your English ability.

英語力を評価できる人材がいないからです。悪循環です。

There are few people to judge your ability correctly, This is a typical negative feedback system.

それ故、我が国には、TOEICから逃げられないというシステム上の問題がありますが、これを、いくら批判しても仕方ありません。

Therefore, in Japan system, we cannot run away from English Test like TOEIC because of the defect of the system. It is no use to blame this system with loud voice.

-----

「TOEICは、人生の脇に置いて、不真面目に勉強する」が肝要です。

The conclusion is that "Don't study TOEIC seriously, and set it aside from your life".

真面目にやったら、本来の目的を失いかねません。

If you do it seriously, you might lose the purpose of your life.

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

まず基本形

utsu_db=# SELECT seq, node, edge, cost, agg_cost FROM pgr_dijkstra('SELECT gid as id, source, target,length_m as cost FROM ways',100, 600, false);

seq | node | edge | cost | agg_cost
-----+-------+-------+--------------------+--------------------
1 | 100 | 41 | 27.7006591508524 | 0
2 | 18996 | 21479 | 63.36986127215735 | 27.7006591508524
3 | 6119 | 24518 | 17.68514641657604 | 91.07052042300975

"node"を、"source"というキーで扱えるようにする

utsu_db=# SELECT node as source FROM pgr_dijkstra('SELECT gid as id, source, target,length_m as cost FROM ways',100, 600, false);
source
--------
100
18996
6119

さらに、"source"を検索キーとして、座標x1, y1を出力する

utsu_db=# select x1,y1 from ways where source in (SELECT node as source FROM pgr_dijkstra('SELECT gid as id, source, target,length_m as cost FROM ways',100, 600, false));
x1 | y1
-------------+------------
139.8867509 | 36.5570485
139.8842018 | 36.5574191
139.9070779 | 36.5521857

と思ったけど、この最後のやつ、ダイクストラの順番が壊れることが分かりました。
今、修正の検討中です。


なんとかSQL1文で片付けたかったのですが、どうにも上手くいきませんので、こういうコードで対応するこにしました。

//rows, err = db.Query("select x1,y1 from ways where source in (SELECT node as source FROM pgr_dijkstra('SELECT gid as id, source, target,length_m as cost FROM ways', $1::bigint , $2::bigint , false))", o_source, d_source)
	rows, err = db.Query("SELECT node as source FROM pgr_dijkstra('SELECT gid as id, source, target,length_m as cost FROM ways', 100 , 600 , false)")
	if err != nil {
		log.Fatal(err)
	}
	defer rows.Close()

	x1, y1 := -1.0, -1.0

	for rows.Next() {

		if err := rows.Scan(&source); err != nil {
			fmt.Println(err)
		}
		// 同じ内容の緯度軽度が2行以上表示される場合があるので、"limit 1"で1行に制限
		rows2, err := db.Query("SELECT source, x1, y1 from ways where source = $1::bigint limit 1", source)
		if err != nil {
			log.Fatal(err)
		}

		for rows2.Next() {
			if err := rows2.Scan(&source, &x1, &y1); err != nil {
				fmt.Println(err)
			}
			fmt.Println(source, x1, y1)
		}

	}

まあ、これでダイクストラの順番は守られるようです。

100 139.9308613 36.5364704
18996 139.9305846 36.536582
6119 139.9299632 36.5368549
19331 139.9297872 36.5369272
18976 139.9287925 36.5373735
6120 139.9285284 36.5375426
2595 139.9284283 36.5376435
(中略)
13510 139.8719095 36.558477
13495 139.8713668 36.5586478
556 139.8699614 36.5584908
548 139.868783 36.5585636
600 139.8683731 36.5585918

不細工ですが、仕方ないですね。
(どなたか、"where in" "order by seq" 等で対処する方法を思いつかれた方は、ご連絡下さい) 

SQL文で、ずっと悩んでいるわけにもいきませんので

------

その後、この本のことを思い出して、p.34の記載を参考にして、やってみました。

utsu_tram_db3=# SELECT seq, node, ST_AsText(b.the_geom) AS "Coordinates" FROM pgr_dijkstra('SELECT gid as id, source, target, cost FROM ways', 2, 59, directed:=false) a INNER JOIN ways b ON (a.node = b.gid) ORDER BY seq;

1 | 2 | LINESTRING(140.01202169824 36.57871025496,140.01210960589 36.57850940596)
2 | 3 | LINESTRING(140.01210960589 36.57850940596,140.0145021 36.5730429,140.0146136 36.5727757,140.0147074 36.5725284,140.01472847292 36.57242810487)
3 | 6 | LINESTRING(140.01472847292 36.57242810487,140.01474259746 36.57236088004)
4 | 7 | LINESTRING(140.01474259746 36.57236088004,140.0147498 36.5723266,140.01474930095 36.57229596036,140.0147445 36.5720012,140.0147357 36.5718519,140.0147215 36.5716942,140.0146525 36.5713687,140.0146383 36.5712934,140.0142569 36.5705335,140.0132318 36.5684315,140.0125081 36.5670258,140.0114588 36.5649136)
5 | 41995 | LINESTRING(140.0114588 36.5649136,140.0113901 36.5648283,140.0112966 36.5647907,140.0112113 36.5647891,140.0109652 36.5648276,140.01083814578 36.56486337469)
6 | 10 | LINESTRING(140.01083814578 36.56486337469,140.01068264711 36.56490715847)

(攻略)

というところまでできました。
で、これを参考にして、

utsu_tram_db3=# SELECT seq, source, edge, x1, y1 FROM pgr_dijkstra('SELECT gid as id, source, target, cost FROM ways', 2, 59, directed:=false) a INNER JOIN ways b ON (a.edge = b.gid) ORDER BY seq;
seq | source | edge | x1 | y1
-----+--------+-------+-----------------+----------------
1 | 2 | 39626 | 140.01202169824 | 36.57871025496
2 | 3 | 39627 | 140.01210960589 | 36.57850940596
3 | 6 | 42190 | 140.01472847292 | 36.57242810487
4 | 7 | 58678 | 140.01474259746 | 36.57236088004
5 | 41995 | 48370 | 140.0114588 | 36.5649136
6 | 10 | 42191 | 140.01083814578 | 36.56486337469
7 | 11 | 42192 | 140.01068264711 | 36.56490715847
8 | 14 | 39629 | 140.00672391747 | 36.56601660123
9 | 16 | 42193 | 140.00534360203 | 36.56639931881
10 | 18 | 39631 | 139.99881746427 | 36.56760356174
11 | 20 | 42194 | 139.99785322163 | 36.56762649318
12 | 22 | 42195 | 139.99322640365 | 36.56769789956
13 | 23 | 42197 | 139.99279862059 | 36.56770561742
14 | 26 | 39632 | 139.9873020073 | 36.56744076372
15 | 27 | 58694 | 139.98637655778 | 36.56719243017
16 | 42011 | 58693 | 139.9849076 | 36.5669615
17 | 42010 | 59395 | 139.9834987 | 36.5659784
18 | 42653 | 58677 | 139.9833653 | 36.5651397
19 | 41994 | 58676 | 139.9831305 | 36.5639836
20 | 41993 | 58675 | 139.9828407 | 36.5628279
21 | 41992 | 48369 | 139.9823791 | 36.5562514
22 | 30 | 58674 | 139.98257030036 | 36.55573422149
23 | 41991 | 48368 | 139.9826931 | 36.5551828
24 | 31 | 39646 | 139.98315132981 | 36.55393844125
25 | 62 | 39633 | 139.98318348014 | 36.55383009795
26 | 34 | 39634 | 139.98429467116 | 36.5475784165
27 | 36 | 44770 | 139.97637588623 | 36.54492018008
28 | 33441 | 59396 | 139.9758737 | 36.5448171
29 | 42654 | 58691 | 139.97571 | 36.5447853
30 | 42008 | 58673 | 139.9727346 | 36.5443785
31 | 41990 | 58692 | 139.9723398 | 36.5443964
32 | 42009 | 58689 | 139.9719943 | 36.5444584
33 | 42006 | 58690 | 139.9688728 | 36.5456984
34 | 42007 | 58683 | 139.9684653 | 36.5458879
35 | 42000 | 58682 | 139.9656822 | 36.5472156
36 | 41999 | 58688 | 139.9644358 | 36.5478259
37 | 42005 | 48960 | 139.9641365 | 36.5479761
38 | 33444 | 58681 | 139.96349045574 | 36.54828227973
39 | 41998 | 58672 | 139.9619295 | 36.5490366
40 | 41989 | 58671 | 139.9600165 | 36.5499581
41 | 41988 | 58846 | 139.9540272 | 36.5527689
42 | 42143 | 59676 | 139.9519912 | 36.5538036
43 | 42943 | 59406 | 139.9492115 | 36.5546546
44 | 42665 | 48588 | 139.9490753 | 36.5546663
45 | 38 | 58685 | 139.94481625362 | 36.5547848398
46 | 42002 | 58684 | 139.9412636 | 36.5548806
47 | 42001 | 58680 | 139.940733 | 36.5548939
48 | 41997 | 48373 | 139.9399581 | 36.5549218
49 | 39 | 58669 | 139.93905845231 | 36.55494655098
50 | 41986 | 59675 | 139.9384363 | 36.5549609
51 | 42942 | 59674 | 139.9380896 | 36.5549625
52 | 42941 | 58687 | 139.9368167 | 36.5558301
53 | 42004 | 58686 | 139.936282 | 36.5567211
54 | 42003 | 48374 | 139.9353468 | 36.5569036
55 | 41 | 39637 | 139.92919004082 | 36.55704773078
56 | 44 | 39639 | 139.92333810575 | 36.55725460701
57 | 46 | 44769 | 139.9223235539 | 36.55728625609
58 | 33440 | 39640 | 139.9182188 | 36.5574198
59 | 48 | 39641 | 139.91623289881 | 36.55749040041
60 | 49 | 60589 | 139.9150276012 | 36.55753526085
61 | 43716 | 60590 | 139.9137825 | 36.5575688
62 | 43717 | 48847 | 139.9092969 | 36.5578313
63 | 52 | 39643 | 139.90814263916 | 36.55792109617
64 | 54 | 39644 | 139.90721660195 | 36.55798632222
65 | 56 | 42199 | 139.90390213698 | 36.55824095683
66 | 57 | 39645 | 139.90305460077 | 36.55830618413
(66 rows)

で、やっとできました。soruceのところは、nodeだのedgeだの入れてみましたが、sourceが正解のようです。なお最後のnode 59は出てきません。edgeなので、終端は表示されない、ということでしょう。

エクセルで、x1,y1を表示してみました。

このSQL文の意味ですが、こんな感じです。

SELECT
seq, # ダイクストラの計算結果"a"から出てくる"seq" ("a.seq"と記載してもいい)
source, # ダイクストラの計算結果"a"から出てくる"source"("a.source"と記載してもいい)
edge, # ダイクストラの計算結果"a"から出てくる"edge"("a.edge"と記載してもいい)
x1, # ダイクストラの計算結果"a"から出てくる"x1"("a.x1"と記載してもいい)
y1, # ダイクストラの計算結果"a"から出てくる"y1"("a.y1"と記載してもいい)
# の4つを表示してね
FROM
pgr_dijkstra('SELECT gid as id, source, target, cost FROM ways', 2, 59) a
# ダイクストラの計算結果(テーブル扱い)を"a"とする
INNER JOIN ways b
# "ways"のテーブルを"b"とする
ON
(a.edge = b.gid)
# "a"の"node"の値と、"b"の"gid"の値が一緒の場合
ORDER BY
seq;
# 出力結果をseqの値でソートする

で、注意ですが、上記のedgeとnodeを取り違えると、こんな感じになってしまいますので、注意して下さい。

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

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

Today, new my column is released, so I take a day off.

「お金に愛されないエンジニア」のための新行動論(4)

株価データベースを「Docker」で作ってみる

"A New Theory of Action for Engineers Who Are Not Loved by Money(4)"

Let's try to make a stock database by "docker"

------

後輩からのレビューを受けている時に、Dockerの概念の説明について、コンプライアンス的な観点から指摘を受けました。

When I got a review about this column from the junior colleagues, he pointed out the explanation of the concept of Docker, from the viewpoint of compliance.

昨今、「愛人」なる表現が問題になるのは、よく分かっていましたし、変な炎上を回避する観点からも、インモラルな表現は避けるべきです。

These day, the expression of "Mistress" might to be a problem, I know. And in order to avoid annoying flame, I should not use immoral expressions.

(ちなみに、オリジナルは「妾宅」でした)

(Incidentally, the original expression was "concubine house")

-----

で、その後輩の指摘を受けて、私、かなり考えたのですが ―― 良い表現が思いつきませんでした。

After getting the argue, I thought it again deeply, however, I could not come to a good one.

というか、Dockerを、もっと正確に表現しようとすると、

On the contrary, if I try to express it exactly,

『双子の姉妹を、同じマンションの別の戸に囲う』

"Twin sisters are enclosed in separate units in the same apartment building."

になってしまい ―― もっと印象が悪い。

I can agree that this expression become worse.

Dockerは、全く同じアプリケーションを小さなサービス(マイクロサービス)として、同じコンピュータに矛盾なく同居させれるもので、さらに言えば、

Docker works as a micro-service including same application at the same time with no contradiction. If I try to express these micro-services,

『双子の姉妹と同時にXXXX』は、さらに正確です。

"can do something with the twin sisters simultaneously" is more accurate.

Dockerのアクセスポート番号を変えれば、2つ以上のデータベースを同時に扱うことができ、で、実際、私、そういう使い方しています。

Using different port numbers of each Docker, you can use more than two database simultaneously. I really use docker containers like the way.

まあ、「総じて、江端の発想には品がない」と言われれば、私自身が率先して同意できるくらいです。

Well, even I can agree with you, if you say "Ebata's imagination is vulgar"

-----

「江端=下品」については、こちらの記事で、そのような指摘をしている人がいましたが、

According to the "Ebata's imagination is vulgar", a people said that in this column,

私としては、

However, I wanted to say,

―― それなら、この内容を「上品」に書いたものを、私に見せてくれ

"Rewrite it elegant and show me it"

と言いたかったです。