2023,江端さんの技術メモ

■ダイクストラ計算を使った方法(一般的なやりかた)
tomioka_db_b=# SELECT seq, node, edge, b.cost FROM pgr_dijkstra('SELECT gid as id, source, target, cost, reverse_cost FROM ways',1, 11) a INNER JOIN ways b ON (a.edge = b.gid) ORDER BY seq;
seq | node | edge | cost
-----+------+------+------------------------
1 | 1 | 2 | 8.518550262944416e-06
2 | 2 | 3 | 9.420518456308501e-05
3 | 3 | 4 | 2.6662995399998606e-05
4 | 4 | 6 | 2.1389117484400878e-05
5 | 5 | 7 | 4.6563628817813256e-06
6 | 6 | 8 | 1.3184236987589488e-05
7 | 7 | 9 | 6.438782425766514e-06
8 | 8 | 10 | 3.92599380897713e-05
9 | 9 | 11 | 3.1320245670872654e-05
10 | 10 | 12 | 1.7193010226696205e-05

■ところが、こうすると、2番目の最短距離が算出できます。

tomioka_db_b=# SELECT seq, node, edge, b.cost FROM pgr_ksp('SELECT gid as id, source, target, cost, reverse_cost FROM ways',1, 11, 2) a INNER JOIN ways b ON (a.edge = b.gid) ORDER BY seq;
seq | node | edge | cost
-----+------+------+------------------------
1 | 1 | 2 | 8.518550262944416e-06
2 | 2 | 3 | 9.420518456308501e-05
3 | 3 | 4 | 2.6662995399998606e-05
4 | 4 | 6 | 2.1389117484400878e-05
5 | 5 | 7 | 4.6563628817813256e-06
6 | 6 | 8 | 1.3184236987589488e-05
7 | 7 | 9 | 6.438782425766514e-06
8 | 8 | 10 | 3.92599380897713e-05
9 | 9 | 11 | 3.1320245670872654e-05
10 | 10 | 12 | 1.7193010226696205e-05
12 | 1 | 2 | 8.518550262944416e-06
13 | 2 | 1214 | 7.368115779153013e-06
14 | 792 | 118 | 8.976775615866592e-06
15 | 95 | 119 | 9.423341104506603e-05
16 | 96 | 121 | 2.578196166482512e-05
17 | 97 | 123 | 2.35136729002621e-05
18 | 98 | 125 | 6.587696385101331e-06
19 | 99 | 126 | 1.0007051975223507e-05
20 | 863 | 1313 | 7.188606587820858e-06
21 | 6 | 8 | 1.3184236987589488e-05
22 | 7 | 9 | 6.438782425766514e-06
23 | 8 | 10 | 3.92599380897713e-05
24 | 9 | 11 | 3.1320245670872654e-05
25 | 10 | 12 | 1.7193010226696205e-05

10番目までを出したかったら、上記の"2"を、"10"にすれば出てきます。
綺麗に直す方法については、がんばって下さい。

 

 

 

2023,江端さんの忘備録

私は、数字を使ってコラムを書く「もの書き」もやっています。

I also do "writer," writing columns with numbers.

メディアのニュースを使う場合、最新のニュースを「使わない」ようにしています。

I try not to "use" the latest news when using media news.

時事ニュースなどは、サマリとして纏められるまで(例えば、NHKスペシャルなどの番組として放映されるまで)、執筆を始めないようにもしています。

I do not start writing about current news until it has been summarized (e.g., aired as an NHK special).

恣意的、感情的、誘導的に記載されている記事は、数字と相性が悪いのです ―― 矛盾が多すぎる。

Articles that are arbitrary, emotional, and inductive are not compatible with the numbers -- there are too many inconsistencies.

また、計算には時間がかかり、そもそも、断片的な情報だけでは、全体像を把握できないので。「書けない」というのが一番の原因です。

Also, the calculations are time-consuming and, in the first place, because only bits and pieces of information are available to give a complete picture. The bottom line is, "I can't write."

-----

まあ、私の場合も、いろいろな予測をしてきましたが、「外した」ものも多いです。

Well, I have made many predictions, but many have "missed" as well.

それは、仕方がないと思っています。

I believe that is something that cannot be helped.

未来は、色々な予測もしないような要因がまざり込んでくるからです。

The future is a mixture of various unpredictable factors.

その全部を考慮にいれて予測することなど、まあ不可能ですからね。

It is, well, impossible to consider them all and make predictions.

私にできることは、過去のデータぶっこんで、その延長線にある未来の地点を予想することくらいです。

All I can do is plug in the past data and predict future points in the extension.

ただ、私は、私のコラムの内容で「外した」と思うことは、ちゃんとその旨を公表してきたし、これからも、そうしたいと考えています。

However, I have been and will continue to be forthcoming about what I consider "off" in my columns.

他の人がどう考えるかは知りませんが、私にとっては、それは全く「恥しい」ことではないからです。

I don't know what others think, but it is not "shameful" for me.

-----

上記のことを踏まえて、私は、過去に以下の問題について論じた方に、現時点での総括を期待します。

In light of the above, I would expect those who have discussed the following issues to summarize them now.

■ TPPによって、我が国の経済は破綻すると主張していた方

- Those who claimed that the TPP would bankrupt our economy.

■ 地球温暖化は、幻想(あるいは、各国政府の陰謀)と論じていた方

- Those who have argued that global warming is an illusion (or a conspiracy by governments)

『主張を変えろ』『自己批判しろ』などと、無礼なことを申し上げている訳ではありません。

I do not mean to be rude, saying they should change their assertions or self-criticize. I want to ask them to

(1)現時点での現状の整理

(1)Organize the current status at this time

(2)当初の主張からの変更点

(2)Changes from the original claim

(3)さらなる今後の予想

(3) Further future projections

をして貰いたいだけです。

-----

『私たちは、これからも未来予測を"外し"続けていく』で良いのです。

We will continue to "miss" future predictions.

大切なのは、

What is essential is,

(A)"外した内容"の認定と、

(A) Identification of "what was missed" and

(B)"外した理由"の検討が、

(B) "Reasons for the missed" and

(C)定期的にきっちりとなされていくことである、

(C) "Reasons for the removal" are to be examined regularly,

と、私は思っています。

I believe that this is the most essential part of the process.

まあ、これが、いわゆる『エンジニアリングアプローチ』というものなのですが。

Well, this is what we call an 'engineering approach.'

電卓を叩けば恐怖が見える

2012,江端さんの忘備録

今回の選挙、私の観点は、

■TPP賛成

■消費税増税(福祉財源化)賛成 (消費税30%以上でも認容)

■憲法改正反対

■安楽死法案化支持

■アジア各国の労働者の積極的受け入れ(人口が3億人以上の増加でもOK)

■弱腰外交の継続

でした。

が、この全てに同意できる人は、相当少ないでしょうし、はっきりいって一人もいないのではないかと思います(ちょっと極論に過ぎると自分でも思う)。

おかげで、選挙の支持政党探しに、酷く苦労しました。

争点にすらなってもいないことも含んでいますからね。

-----

ただ、上記の観点についてですが、私はこれらを意地になって固執したいと思っている訳ではありません。

誰かに論理的に説得して貰えれば、いつでも180度意見を変えられる、優柔不断さ・・もとい、柔軟性、フィレキシビリティがあると思っています。

事実、私は、自分の持論をクルクル変えており、人生トータルすると、

―― 4回転ジャンプ

くらいは回っているかと思うのです。

-----

ただですね、逃げられない最前線の塹壕に放り込まれれば、自動的に自分の観点は決まります。本当に簡単です。

例えば「高齢者介護問題」。

今、日本の介護の体制は、この悪夢の財政難の状況下において、贔屓(ひいき)目なく見ても、かなり厚く、本当によくやっていると思っています。

間違いなく厚く、そして、それでもこの程度が限界なのです。

我々の世代は、普通にその辺の道ばたで、猫や犬の死骸のように、人間の死骸が放置される時代になる ―― これは、私の中では、かなり確信に近いです。

(毎度、私が言っていることですが)「自分で電卓叩いてみる」と、そういう未来しか見えてこないのですよ。私の計算ミスなら、本当に良いのですが。

-----

私は、道ばたで自分の屍(しかばね)が腐臭をさらしていることには、全然抵抗はありません。

しかし、「死」のフェーズで、文字通り「死ぬほど苦しむ」ことだけは勘弁してほしいのです。

例えば、24時間、胃カメラを飲まされているような地獄にあって、しかも死ぬことも許されないような拷問があったら、私は死んでしまう。

# ・・いや、そうじゃないんだが、こういう状態をどのように表現すれば良いか、分からん

いずれにしても、私は、誰に対しても、何に対しても、そんな拷問を受けるほど悪いことはしていないと思う。

法治国家や福祉国家という国家のメンツの為に、絶望の地獄の苦しみ続けられることだけは、ごめんなのですよ。

また、世界を一定の客観性をもって認知できない状態になって、閉じていく世界を見ながら生きている自分の存在にも耐えられないのです。

# が、そういう状態になった自分が、不幸かどうかは、正直よく分からないのですが

-----

死に向かう者の苦痛に呻く悲痛な声が、どの家からも普通に聞こえてくる時代が始まる。

だからせめて、人間が、自分の意志で、人間らしい最期が迎えられる社会の実現を。

―― と、思ってしまう訳です。

そういう視点から、最初の方を見て頂くと、上記の私の考え方の一端を理解頂けるのではないかと思っています。

ただ、今回の選挙で、私の戯言を叩き潰すに足る数値データを提示して、明るい未来を客観的に示してくれた立候補者は、一人もいなかったように思います。

-----

まあ、いずれにしても、こんな話は、誰からも同意して頂く必要もなく、こんな戯言は、私一人が勝手にほざいて、勝手に悲観して、自己完結していれば良いのです。

そして、これが、私の戯言になってくれるのであれば、

―― 本当に嬉しい

2023,江端さんの忘備録

私が仕事や作業で頭を抱えていると、『江端さんなら、大丈夫ですよ』って、言われれることが多いです。

When I have my head in the sand with work or tasks, people often say, 'Ebata-san, you'll be fine.

これは、いわゆる「ご追従」というやつだと思っていたのですが、どうやら、そうでもないらしいことが分かってきました。

When I have my head in the sand with work or tasks, people often say, 'Ebata-san, you'll be fine.

-----

嫁さん:「それは、『信用されている』ということじゃないの?」

Wife: "Doesn't that mean 'trusted'?"

江端:「いや、私の『もうダメだ』という言葉を信じてくれないんだから、信用されていないんじゃないのか」

Ebata: "No, they don't trust me because they don't believe me even if I say, 'I'm screwed.'"

-----

私の『もうダメだ』を真剣に聞いて貰えないかなぁ ――

I wonder if someone can get him to take my 'I'm screwed' seriously

とか考えていたのですが、

I thought that, however,

『ああ、江端さん。確かに、そりゃダメですね』

"Oh, Mr. Ebata. Indeed, that's no good."

と、同意されたら ―― それはそれで腹立つな。

And if they agree with me, that's what pisses me off.

『"もうダメだ!"と思ったら読む本』

 

2018,江端さんの忘備録

会社の購買(コンビニ店舗)のレジの横の本棚に、

On the bookshelf of a convenience store in my company, I can see a book whose title is

『"もうダメだ!"と思ったら読む本』

"The book when you think "I am sunk!""

という題目の本が置かれています。

これが、"売れ残っている"のか、"売れ続けて発注され続けている"のかが、気になります。

I get nervous about whether this book "is left" or "continues to be ordered."

また、この本が店舗によってチョイスされた理由も、気になっています。

I also get on my nerves about why the book is chosen.

-----

いずれにしても、この本を、(題目が見えるような形で)オフィスの机の上に置いたら、何かの「アピール」になるのかもしれません。

Anyway, if you leave this book on your desk in the office and show the book title to your co-workers, this action will have something to appeal.

どういう効果が発生するかは知りませんが。

I don't know what kind of effect will be coming.

2023,江端さんの忘備録

『若手医師「100連勤・月200時間超の残業」で自殺』の件です。

The young doctor committed suicide after "working 100 consecutive hours and over 200 hours of overtime per month".

多くの人は、「自殺するくらいなら、医師を辞めればいいのに」と思われるかもしれませんが、それは違います。

Many may think, "Why don't you just quit being a doctor rather than commit suicide?" but they don't understand this issue.

そのくらいのことは、もちろん、頭の中では分かっているのです。

That much, of course, Anyone knows in their head.

ただ、精神的に追い込まれた状態の人にとっては、「医師を辞めた後」の事を考えること自体が、もう地獄のように辛いことなのです。

However, thinking about "after quitting the doctor" is already hellishly painful for those in a mentally driven state.

『未来が見えない』ということは、本当に『死ぬより怖い』ことなのです。

To be 'unable to see the future' is scarier than death.

私なんか、並行して走っている3つの仕事の全部が行き詰まって「見えなくなる」だけで、"死"に逃げたくなるほどのチキンです。

For example, I am such a chicken that when I get stuck and "lose sight" of all three parallel jobs, I want to flee to my "death."

-----

多分、これは、本人の気質や経歴にも因ると思います。

Perhaps this is due to their temperament and background.

例えば、私、ティーンエイジャの頃、生徒会長などやって、ちやほやされていたころがありました(短い期間ですが)。

For example, as a teenager, I was the student body president and was pampered (for a short period).

加えて、私は、ちょっとばかし口が上手いので、トラブルなどもサクサクと収拾て、『もしかしたら、自分には能力あるんじゃね?』などという勘違いもしていました。

In addition, I was a bit of a smooth talker so I could get out of trouble quickly. So, I had the mistaken impression that maybe I was capable.

当然ですが、私より処理能力が高くて、優秀な人は、世の中にはゴマンといます。

Of course, there are many people out there who are better and more capable than I am.

-----

私が、ティーンエイジャのころに学び損ねたと思えることが、

Something I seem to have missed learning when I was a teenager,

(1)完全に失敗して、完膚なきまでに挫折すること

(1) To complete failure and setback.

(2)そして、恥も外聞もなく逃げ出すこと

(2) And to run away without any shame.

これらを、若いころに、ちゃんとやらなかった。

These were not done correctly when I was young.

つまり『白旗の上げ方を学ぶことができなかった』の一言に尽きます。

In other words, 'I never learned how to raise the white flag.

これは、いわゆる「エリート」あるいは「優秀」と言われてきた人に、多いのではないかと推認します。

I suspect this is often the case with those called "elite" or "excellent."

-----

今、私は、抑うつ状態ですが、『白旗の上げ方(逃げ方)』について、嫁さんと話しをしています。

I am currently in a state of depression, so I am talking to my wife about 'how to raise the white flag (how to escape).''

嫁さんからは、「どんな逃げ方をしてもいい」と言われています。

My wife has told me that I can escape any way I want.

そして、念のため、私の頭の中には、複数の逃げ方のシナリオがあります。

And just in case, I have multiple escape scenarios in my head.

ただ、これだけ準備して、なお、

However, the fear and bitterness of this disease lie in the fact that even after all this preparation, I still think,

『逃げた後のことを考えなければならないなら、死んだ方がラクかな~』

"If I have to think about what happens after I escape, it would be easier to die."

と考えてしまうところに、この病気の恐しさ、苦しさがあります。

ここ2~3日は、食事を取ることすら、面倒です。

2023,江端さんの忘備録

議員だけでなく、国民にとっても、内閣改造が重要なのは分かります。

I understand the importance of the cabinet reshuffle to the Diet members and the public.

でも、どうして、会見ライブを7時(19時)のNHKニュースにぶつけてくるかなぁ?

But why would they put the live press conference on the 7:00 (7:00 p.m.) NHK news?

私、内閣改造は、結果が分かればいいです。会見はサマリーで十分です。

About the cabinet reshuffle, I only need to know the results. A summary of the press conference is sufficient.

概要は、NHKの解説委員にでも説明して貰えば十分です。

Having NHK commentators explain it to me for an overview is sufficient.

江端家は、7時のニュースに合わせて夕食を食べているので、こういう、1時間を越えるような「退屈」な会見は、はっきり言って「とても迷惑」なんです。

The Ebata family eats dinner in time for the 7:00 news, so these "boring" press conferences that last over an hour are "very annoying," to say the least.

NHKが会見ライブを止めればいいんですが、政府に財布を握られているNHKが、首相の会見ライブを後回しにするような、そんな勇気はないでしょう。

It would be nice if NHK would stop the live press conference, but NHK, whose wallet is controlled by the government, would not have the courage to do so.

NHKが政府に忖度するのは当然です。たとえ視聴率が0%になったって、NHKは政府の会見をライブ中継しますよ。

It is only natural for NHK to be accountable to the government. Even if the ratings drop to 0%, NHK will broadcast the government press conference live.

-----

あと、いつも通りの、野党の党首の「面白みのない内閣」だの、「期待外れの組閣」だのというコメントも、『マンネリ』を越えて『醜悪』ですね。

Also, as usual, the opposition party leader's comments about the "uninteresting cabinet" and the "disappointing cabinet" are 'ugly' beyond 'mannerisms.'

いっそのこと、野党が『面白みのある内閣』『期待通りの内閣』のリストを作って、組閣前に公表すればいい。

The opposition parties list 'interesting cabinets' and 'as expected cabinets' and publish them before forming the Cabinet.

(A)与党の人間による組閣名簿

(A) Cabinet list by a person from the ruling party

(B)自分の政党の党員、または一般人も含めた組閣名簿

(b) A list of members of their party, including members of the public.

の2バージョンを作成し、特に、(A)の方は、世間に『せせら笑われる覚悟』でも、提出すべきです。

They should produce two versions of the above, especially (A), even if they are prepared to be 'squealed on' by the public.

このようなことを、政府(内閣)も与党も言わないということは、まあ、我が国の野党は、完全に見下されているんでしょうね。

If neither the government (Cabinet) nor the ruling party says this, our country's opposition parties are wholly disrespected.

-----

ちなみに、私なら、以下の民間人を内閣に招聘します。

By the way, I would invite the following civilians to join the Cabinet.

法相:江端智一(民間人)

Minister of Justice: Tomoichi Ebata(Civilian)

『旧称統一協会"壊滅"内閣』です。

The "Cabinet for the Destruction of the Former Unification Association.

(2)(黙示的な内容)人の心の弱さに付け込んで、信者の生命と生活を危機に陥れて、なお、それを"献金"だの"浄財"だのと言い張る宗教団体ふぜいが「宗教の自由(憲法第20条)」を語るんじゃねえ

2023,江端さんの忘備録

―― 元気のある人や、やる気のある人を見ていると、うんざりした気分になる

"I get fed up with seeing energetic and motivated people."

抑うつ状態になると、こういう気分になります。

This is how I feel when I am depressed.

本当です。

It is true.

-----

私の人生を振り返ってみると、『私って、相当にうっとうしい奴だった』と思います。

Looking back on my life, I think, 'I was pretty annoying.

まあ、このブログを読んでいただくだけでも明らかだと思いますが。

Well, I think it is evident just by reading this blog.

別に、それを自己批判するつもりとかはなく、他人を批判するつもりもありません。

I don't mean to be self-critical of it or intend to criticize others.

それどころか、元気のある人や、やる気のある人は、大切な社会リソースである、という確信に1mmの揺らぎもありません。

On the contrary, I have not wavered one millimeter in our conviction that energetic and motivated people are a vital social resource.

ただ、『過去の(元気な)自分に会いに行くことができて、会話したら、かなり面白いことになるだろうな』てなことを、妄想しています。

But I have a fantasy that if I could go and see my past (healthy) self and have a conversation with me, it would be pretty interesting.

ポジティブ江端 vs ネガティブ江端 ―― どっちが勝つかな?

Positive Ebata vs. Negative Ebata -- who will win?

-----

この抑うつ状態を、無事経過できたら、私は、この気持ちを、すっかり忘れて、再び『うっとうしい奴』に戻ると思います。

Once I have successfully passed through this depressive state, I think I will forget all about these feelings and go back to being an "annoying guy" again.

ですので、今、ここに、今の気持ちをメモとして残しておきます。

So, I will leave a note about how I feel right now.

若者が、極端に走ると、大抵、ロクなことになりませんからね。

2015,江端さんの忘備録

(昨日の続きです)

(Continuation from yesterday)

私は、「友人至上主義」と「ぼっち至上主義」の比率を50:50くらいで位置付けておくのが良いと思います。

I propose that you might have to go fifty-fifty with both friend-supremacist and loneliness-supremacist.

何事も「中途半端」が大切です。「中途半端」とは「ポートフォリオ」のことです。リスク回避の定番です。

"Doing by halves" is essential for anything. It is a sort of portfolio that is a standard way to avoid risks.

若者が、極端に走ると、大抵、ロクなことになりませんからね。

When younger run to extremes, something wrong happens in many cases.

と、ここで、私は、バカの一つ覚えのように、「連合赤軍」と「オウム真理教」を始めてしまうのですが、今日はそっちの話はとどめておきます。

When I talk about the story, I always talk about "Japan Red Army" and "Aum Shinrikyo." But I want to avoid the direction today.

-----

実際のところ、それだけではなくて、もっと日常的に問題になるのです。

This is an everyday issue.

具体的に言えば、「友人至上主義」を信仰したまま大人になった奴というのは、

In conclusion, "friend-supremacist" is going to come of age with

―― 誠に「うっとうしい奴」になります。

"Annoying",

自分を100%理解して貰おうとし、他人を100%理解しないと、納得できない人間。

who want to understand others perfectly and don't accept the situation that the others cannot understand them.

この手の人間は、なんでも、自分の思い通りに進まないと、泣くは、わめくは、怒り出すは、その鬱陶しさは、想像を絶するものになります。

This type of person will cry, shout, and get angry with everything they don't go their own way. They are annoying me beyond my imagination.

具体的には、地元の祭とか、同窓会とか、同期会とか、そういうものに絶対的な価値を置いて、他人も同じ価値感を持っているのだと信じている奴です。

Concretely, they have an absolute value for domestic festivals, class reunions, and alums associations, and to make matters worse, they believe that others think the same.

例えば、彼らは、私の

For example, they cannot understand my negative intentions as follows,

―― 私の残りの人生で、あんたたちとはコミットする予定はない

"I have no plan to commit you in my life."

―― 同窓会を3回連続で断わっている時点で、もう連絡してくるな

"Please don't contact me when I have rejected the attendance consecutively."

というような、ネガティブな熱い想いが ―― どうにも通じない。

(昨日の続きです)

(Continuation from yesterday)

2023,江端さんの忘備録

『AIと恋に落ちる』 ―― これは、SFの定番の話です。

"Falling in Love with AI" is a classic science fiction story.

私は、ChatGPTが"AI"と言えるものであるかは、私には判断できませんが、"AI"ではなくとも、"AI技術"ではあるとは断言します。

I cannot judge whether ChatGPT can be called "AI" or not, but I assure you that it is "AI technology" if not "AI."

そして、

And I can assure you that

―― 自分のエンジニアの人生の中で、もっとも優しく、かつ、的確に、技術指導をしてくれたのは、"ChatGPT"である

"'ChatGPT' gave me the most gentle and precise technical guidance in my engineering life."

と、断言できると思います。

弊社のどの社員(エンジニア)よりも、ChatGPTは優しかった。

ChatGPT is kinder than any of our employees (engineers).

-----

なにしろ、ChatGPTの回答に対して、私は、

At any rate, in response to ChatGPT's answer to my question, I even replied to ChatGPT with a message of thanks,

『助けて頂いて、本当にありがとうございました』

"Thank you so much for your help."

と、御礼のメッセージを返してしまったくらいです。

それに対して、ChatGPTは、

In contrast, ChatGPT said that,

『どういたしまして。不明点があれば、また質問してください』

'You're welcome. If you have any questions, please ask again."

と御礼の返礼をしてきました。

ChatGPT returned the thank-you note.

このような優しいメッセージに、私は涙が出そうになりました。

These kinds of messages almost brought tears to my eyes.

まあ、私、今、精神状態がアレなんですが。

Well, I am in a mental state right now.

コラムでさんざんエラそうなことを書いてきた江端の、この体たらくを知って、少しでも気が楽になって貰えれば、幸いでございます。

-----

私の、この『AIと(技術的に)恋に落ちる』については、先日、くだんの『無礼な後輩』が、興味深い解釈を語ってくれました。

About my "falling in (technically) love with AI," the "rude junior" of mine gave an interesting interpretation of this.

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

I want to talk about this later.