2018,江端さんの忘備録

父は、5月頃から食欲が激減し、7月には、栄養補給飲料を、一日で湯呑み一杯飲むのがやっとという状態になっていました。

My father has drunk appetite since May, and In July, he had the utmost to drink a cup of nutritional supplement in a day.

その後、父が、ヘルパーさんに、無理矢理に、お粥を食べさせられている姿をみて、私は、ショックを受けました。

After that, I was shocked, looking at my father forcing the helper to eat porridge.

姉に、そのことを告げたら『世の中の介護の現場のほとんどは、そんなもんだ』と言われて、さらにショックを受けたのを覚えています。

When I told my sister about the situation, she said, "Most of the care of the world is like that."I remember being more shocked.

-----

父は、7月に食物摂取ができなくなり、病院に入院したのですが、7月下旬、病院から電話があり、

My father was unable to consume food in July and was hospitalized. However, in late July, the hospital called me,

「父が、食事、水はもとより、点滴ですら、苦しむようになってきた」

"Your father has begun to suffer not only for meals and water but also for infusions."

と、報告してきました。

私は、父の入院時に、主治医の先生に、しつこいくらい

I said persistently to my doctor when my father was hospitalized.

『1mmでも苦痛がある、または、苦痛が発生する恐れのある医療行為は、全て止めて欲しい』

"I want you to stop all medical practices that are painful, even if my father has a pair of 1 mm or there is a risk of suffering."

と、念を押し続けていたのですが、それでも、病院は、最期の判断を私に求めてきました。

Still, the hospital has asked me for the final judgment.

私は、

I answered on the spot.

『水、食事はもとより、点滴も中止してよい』

"Please stop the drip, not only water and meals."

と、その場で返事をしました。

その後、姉は、私の決断を支持してくれましたが、私の家族はビックリしていたようです。

After that, my sister backed my decision, but my family seemed surprised.

「『それ』って、『そう』いうこと?」

"Does that mean "that" ?"

「『そう』いうことだ」

"That's right."

-----

父は、生前から、自分の最期について、自分の意思を明かにせず、「全てを私(江端智一)に任せる」と言っていました

My father did not reveal his intention for his last term and said, "I will leave everything to my son(Tomoichi Ebata)."

これは、ある意味、他人に人生の決定を丸投げする「卑怯」な言動とも言えるかもしれません。

In a sense, this may be called "cowardice" behavior that entrusts the decision of life to others.

しかし、父には、私に対して、「私(江端智一)なら、その状況に応じた最適戦略を実行できるハズである」という信頼もあったと思っています

However, my father thought that he had the trust that "if I (Tomoichi Ebata) do, I can execute the optimal strategy according to the situation."

-----

そして、私は、この父の言葉を

And I think that this father's words mean that I will think

「私(江端智一)が父と同じ状況になったら、私(江端智一)なら何を望むか」

"When I (Tomoichi Ebata) comes to the same situation as my father, what will I (Tomoichi Ebata)want ?"

を考え、それを

my father orders me that

「回りの意見に左右されることなく、自分(江端智一)の意思で、その望みを実施しろ」

"Do not be influenced by the opinions of the surroundings; do your wishes with your will (of Tomoichi Ebata)."

と語っていると、解釈しました。

-----

「病気」も「法律」も「制度」も「医師」も、父を『楽』にさせて上げることができない、この社会システムの中で、息子である私ができることは、

Neither "sick," "law," "institution," nor "doctor" can make my father "easy" in this social system. What I can do as his son are

―― 例え『父殺し』の罪の意識を、一生引き摺っていくことになろうとも、

"Even though I will keep my consciousness of "father killer" guilty for the rest of my life,"

―― 父を『殺す』決断を下すこと

"I have to decide to "kill" my father."

-----

これが、私が導き出した答えです。

This is the answer I derived.

2024,江端さんの忘備録

先日、「チ。-地球の運動について」に関してコメントを記載しました。

The other day, I commented on “Chi: About the Movement of the Earth.”

―― アニメ「チ。-地球の運動について」を、アメリカ合衆国で放送したら、何が起こるだろうか

この物語のテーゼである「天動説 v.s 地動説」の歴史については、私は、是非とも、サイモン・シンさんの著書『宇宙創成』(原題:Big Bang: The Origin of the Universe)をお勧めしたいのです。

As for the history of the thesis of this story, “Ptolemaic theory vs. Copernican theory,” I recommend Simon Singh's book “The Big Bang: The Origin of the Universe.”

この本は、以下にも記載していますが、

As mentioned below, I have already written about this book.

―― 自分が良いと思うものが、他人が良いと思うとは限らない

で、実はこの話、まだ、続きがあります。

And I also continued the story.

―― 「コンテンツエバンジェリスト(コンテンツ伝道者)」

このように、先生の『宇宙創成』という本に対する熱い思いは、娘には伝わらず、私に間接的に伝わったのみです。

In this way, my daughter did not understand her teacher's passion for the bookBig Bang: The Origin of the Universe" I only understood it indirectly.

先生、あきらめましょう。私たちの宇宙に対する熱い思いは、子どもたちには伝わらないんですよ。

Let's give up, Sensei. Our passion for space won't be conveyed to the children.

それはさておき

Leaving that aside

-----

最新の「チ。-地球の運動について」の第9話、『きっとそれが、何かを知るということだ』では、天動説の完成に至らなかった老天文学者がこう語る場面があります。

In the latest episode of “Chi: About the Movement of the Earth”, Episode 9, “I'm sure that's what it means to know something”, there is a scene where an astronomer who did not complete the geocentric theory says this.

―― 天動説が誤っていたとしたら、天動説に命を捧げてきた過去1000年間の天文学者達の挑戦は一体何だったのだ? その挑戦には、何の意味もなかったのか?

If the geocentric theory was wrong, what was the point of the astronomers who had devoted their lives to it over the past 1000 years? Was their challenge meaningless?

私はこの問いに答えを持ち合わせていませんが、論理的に考えれば、『何の意味もなかった』という結論になるでしょう。血も涙もない絶対零度の解答ですが。

I don't have an answer to this question, but if you think about it logically, you'll probably conclude that it 'didn't mean anything.' It's a heartless, bloodless answer.

さて、ここから本題に入ります。

Now, let's get down to the main topic.

この『宇宙創成』には、天動説(※地動説ではなく天動説)を完成させるために様々な挑戦が行われてきた記録が数多く紹介されています。そして、これが本当に面白いのです。

ThisBig Bang: The Origin of the Universe introduces many records of the challenges to perfecting geocentric theory (not heliocentric theory). And this is interesting.

これだけの資料を目にすれば、『もしかすると、天動説って正しいのでは?』と思わせるほどの迫力と説得力を持ったロジックが次々と登場します。

When you see all this material, you can't help but think, “Maybe the geocentric theory is correct?” as the logic that appears one after another is so powerful and convincing.

しかし、限られた天文観測情報と絶対的価値観(キリスト教信仰)が支配していた時代において、命を懸けて「宇宙の真理を明らかにしようとした人たちの闘い」に思いを馳せると、たとえ『何の意味もなかった』という結論に達してしまうとしても、私は胸が熱くなるのです。

However, when I think about the struggles of those who risked their lives to “reveal the truth of the universe” in an era when limited astronomical observation information and absolute values (Christian beliefs) dominated, even if I conclude that “it was meaningless,” my heart still fills with emotion.

-----

私が現在進めている研究は、現時点では評価されていません。未来においても評価される可能性は低いでしょう。また、近い未来には、私のアプローチよりも簡単な方法が見つかるかもしれません。それは、私自身、既に理解していることです。

The research I am currently pursuing is not valued and is unlikely to be valued in the future. In addition, it is possible that a simpler method than my approach will be found soon. I already understand this.

それでも私は、自分の研究をやめるつもりはありません。

Even so, I have no intention of stopping my research.

では、私は何のために研究を続けているのか ――

So, what am I continuing my research for?

私は、世の中を1mmでも動かしたいとか、誰かの踏み台になれれば良い、といった野望があるわけではありません

I don't have any ambitions to move the world by even 1mm or to be someone's stepping stone.

私は、私の人生の中でやれることの最後をただ確認するためだけに、研究を続けているのです。

I continue my research to confirm the end of what I can do in my life.

2018,江端さんの忘備録

(昨日の続きです)

(Continuation from yesterday)

しかし、ここに「コンテンツハラスメント」という形と取らずに、「話題の共有」ひいては「価値観の共有」に至る道を示してくれた、稀有なユースケースを紹介したいと思います。

However, I will introduce you to an example, "to realize a rare use-case of "sharing a topic and a value," not by using "contents harassment."

私の娘の学校の先生は、自分の気にいった文庫本を、自腹を切って、クラス人数分購入して配布したそうです。

I heard that a teacher of my daughter's bought his favorite books for all the students in her class at his own expense.

That is one of the books of "Mr. Simon Lehna Singh."

私、(見たことがありませんが)この先生と親しく語れる気がしています。

I don't know her teacher, but I think I can talk with him familiarly.

その先生が娘に買い与えた本は、私にとっても、魂のレベルで感動した、本当に最高の本でしたから。

The book was also the best for me; it left me with an impression from the bottom of my heart.

ただ、当然ながら、生徒の殆どに、この「最高」は届きませんし、実際に届いていないようです

Of course, "the best" will not reach most of them and cannot really reach them.

実際、娘は、かなり最初のページでドロップしたようです(そこそこ高いレベルの物理学と数学の知識とセンスが必要))。

My daughter dropped out of the book at the initial step. The book needs high intelligence in physical science and math.

このように、この本のほとんどは、ゴミ箱行きです。

Thus, most of the books are going to a trash box.

ただ、この先生は、『この「最高」が、クラスのたった一人だけでも届けば目的は達成される』 ―― と考えたと思うのです。

However, I think the teacher thought his purpose would be completed, even if only one of the students was impressed by "the best."

-----

その、いるかいないか分からない「たった一人」の為に、クラス全員分の文庫本を購入する ―― この覚悟こそが、本物と呼べるものです。

For only one person nobody knows, the preparation of purchasing the books for all students of his class is a real one.

これこそが、「コンテンツハラスメント」の対極にある理想の姿、

That is an ideal figure that is antithetical to "content harassment,"

―― 「コンテンツエバンジェリスト(コンテンツ伝道者)」

"Contents evangelist"

です。

2017,江端さんの忘備録

以前、私は嫁さんに、高村薫さんの「神の火」を読んで感激し、その本を嫁さんに強く勧めました。

About ten years ago, I was moved to the book titled "God Fire." The author is Takamura Kaoru-san, and I strongly recommend the book to my wife.

嫁さんは、「最後までガマンして読んだけど、最後まで何の感慨もなかった」と言われて、かなりショックを受けました。

She said, "I accepted your recommendation without complaining, and I could not have any emotion about this book," I was shocked to hear her comment.

―― 自分が良いと思うものが、他人が良いと思うとは限らない

"Things that I think are good are not always good for others."

これは、ティーンエイジャが最初に学ぶ通過儀礼の一つですが、それでも、私は、

That is a typical "rite of passage" for teenagers; however, I thought

―― 自分が「熱狂的に良い」と思うものであれば、それは客観的に「良い」ものも含んでいて、自分の想いの1/100くらいは伝わるんじゃないないかな

"Things that I think are good fanatically may include some objective good things. So, the hundredth part of my illusion will get the point across to others."

という仮説があったのですが、これが「バラバラ」に壊れた瞬間でした。

This hypothesis of mine was broken all to pieces at the moment,

-----

今、中学3年生の次女には、課題図書として、サイモン・シンさんの「宇宙創成」が出ているようです。

Now, my junior daughter has a homework assignment on a "book report" for "space creation," the author of which is Mr.Simon Lehna Singh.

宇宙の創成を解明していく科学者たちの闘いを描いた、科学ドキュメントの本です。

It is a book of scientific documents that depicts the battle of scientists who clarify the creation of the universe.

私は、サイモン・シンさんの本は、全て読んでいます。

I read all the books of Mr.Simon Lehna Singh.

家族旅行でバリにいったとき、「暗号解読」に夢中になってしまい、そのバリの旅程を想い出せないほどです。

When I went to Bali on my family trip, I became infatuated with the book, whose title was "Decryption," and I could not remember Bali's itinerary.

ですから、この「宇宙創成」の素晴しさも、当然に理解しています。

So, of course, I understand the wonderfulness of this "space creation" as well.

この課題図書を出した<次女>の教諭とは、多分、良い友人になれると思っています。

I think I can probably become a good friend with the teacher of "junior daughter," who submitted this assignment book.

-----

ですが、

However, I am quite doubtful

―― この教諭と私が「熱狂的に良い」と思うこの本への想いの1/100でも、次女にも伝わるか

"whether 1/100 of this book's value will also be transmitted to the second daughter, even if both this teacher and I feel that this book is 'enthusiastic good'"

というのは、かなり疑わしいと思っています。

「サイモン・シンさんの本は、人を選ぶ」と思うのです。

I think that the books of Mr.Simon Lehna Singh will choose a person.

未分類

GStreamerにおけるkeep-listeningの機能は、主にSRTプロトコルの特性に基づいて設計されています。SRTはストリーミング中のネットワーク障害や接続の一時的な切断に対して高い耐障害性を持ち、再接続をプロトコルレベルでサポートしています。このため、GStreamerのSRTプラグインにはkeep-listeningオプションが実装されており、再接続処理が標準で可能となっています。

一方で、RTSPプロトコルは再接続に対する標準的なメカニズムを持っておらず、ストリーミング接続が切断された場合にはアプリケーション側で再接続処理を実装する必要があります。この理由は以下の通りです:

  1. プロトコルの設計思想の違い
    SRTはリアルタイムのビデオ伝送を想定し、途切れた接続を回復するための仕組み(例:パケットの再送や接続の再試行)が組み込まれています。一方、RTSPは主にコントロールプロトコルとして設計されており、接続の維持や再接続は仕様の範囲外です。
  2. GStreamerプラグインの実装方針
    GStreamerのRTSPプラグイン(rtspsrc)は、RTSPプロトコルの標準に忠実であり、アプリケーション側で自由に再接続ロジックを実装できるよう設計されています。このため、keep-listeningのようなオプションはRTSPプラグインに含まれていません。
  3. 運用環境での要件
    RTSPストリームの中断や切断が発生する状況は、ネットワーク環境やストリーミングサーバーの設定に依存するため、再接続の実装はユーザーごとの要件に基づいてカスタマイズされることが一般的です。

これらの理由から、RTSPでkeep-listeningを実現するには、アプリケーション側でエラー検知と再接続処理を実装する必要があります。これは、RTSPの特性に起因する設計上の制約であり、プロトコルやGStreamerプラグインの動作仕様によるものです。

------

今回の質問は、
『GStreamerでSRTはKeep-listening が使えるのですが、RTSPではkeep-listeningが使えません。この理由を上司に説明できる文章として作成して下さい』
としました。

我ながら、色々なChatGPTの姑息な使い方ができるようになってきたものだと、自分に感心しています。

2024,江端さんの技術メモ

エクスプローラで、ファイルをコピーする場合、同じファイル名の場合には時刻が新しい場合のみ上書きしたいですがどうすれば良いですか
ChatGPT
ChatGPT
Windowsエクスプローラでファイルをコピーする際、同じファイル名の場合は時刻が新しい場合のみ上書きするという機能は標準では提供されていません。しかし、以下の方法でこの操作を実現できます。

方法1: コマンドプロンプトでrobocopyを使用
Windowsにはrobocopyという強力なコマンドラインツールがあり、これを使用してファイルのコピーを行うと、指定した条件に基づいてファイルを上書きできます。

以下の手順で行います。

コマンドプロンプトを管理者権限で開く

以下のrobocopyコマンドを実行

cmd
コードをコピーする
robocopy "コピー元フォルダのパス" "コピー先フォルダのパス" /XO
ここで、/XOオプションは古いファイルを除外します。これにより、コピー元フォルダのファイルがコピー先フォルダのファイルより新しい場合にのみ上書きされます。


コピー元フォルダがC:\source、コピー先フォルダがD:\destinationの場合、次のように入力します。

cmd
コードをコピーする
robocopy "C:\source" "D:\destination" /XO


cmd.exeを管理者モードで立ち上げ

C:\WINDOWS\system32>robocopy "f:\しゅらばしゅう" "\\192.168.0.23\ynu-share\しゅらばしゅう_フルバックアップ" /XO /E /Z

C:\WINDOWS\system32>robocopy "\\192.168.0.10\usb_mount" "\\192.168.0.23\ynu-share\usb_mount_フルバックアップ" /XO /E /Z

C:\WINDOWS\system32>robocopy "g:home\ebata\tomioka3B\src" "\\192.168.0.9\share\tomioka3B\src" /XO /E /Z
C:\WINDOWS\system32>robocopy "g:home\ebata\hakata" "\\192.168.0.9\share\hakata" /XO /E /Z

======

robocopy "f:\しゅらばしゅう" "\\192.168.0.23\ynu-share\しゅらばしゅう_フルバックアップ" /XO /E /Z

 

robocopy "\\192.168.0.10\usb_mount" "\\192.168.0.23\ynu-share\usb_mount_フルバックアップ" /XO /E /Z

 

robocopy "g:home\ebata\tomioka3B\src" "\\192.168.0.9\share\tomioka3B\src" /XO /E /Z

 

robocopy "g:home\ebata\hakata" "\\192.168.0.9\share\hakata" /XO /E /Z

 

echo

======

-------------------------------------------------------------------------------
   ROBOCOPY     ::     Windows の堅牢性の高いファイル コピー
-------------------------------------------------------------------------------
  開始: 2024年6月23日 10:23:39
   コピー元 : G:\home\ebata\tomioka3B\src\
     コピー先 : \\192.168.0.9\share\tomioka3B\src\
    ファイル: *.*
  オプション: *.* /S /E /DCOPY:DA /COPY:DAT /Z /XO /R:1000000 /W:30
------------------------------------------------------------------------------
                           4    G:\home\ebata\tomioka3B\src\
                           2    G:\home\ebata\tomioka3B\src\.vscode\
                          20    G:\home\ebata\tomioka3B\src\Agent\
                           4    G:\home\ebata\tomioka3B\src\Agent\ldarp\
                           2    G:\home\ebata\tomioka3B\src\Agent\old\
                          14    G:\home\ebata\tomioka3B\src\Agent - kese09161446\
                           2    G:\home\ebata\tomioka3B\src\Agent - kese09161446\ldarp\
                           2    G:\home\ebata\tomioka3B\src\Agent - kese09161446\old\
                          14    G:\home\ebata\tomioka3B\src\Agent-kese-09161400\
                           2    G:\home\ebata\tomioka3B\src\Agent-kese-09161400\ldarp\
                           2    G:\home\ebata\tomioka3B\src\Agent-kese-09161400\old\
                           1    G:\home\ebata\tomioka3B\src\agent_db\
                          14    G:\home\ebata\tomioka3B\src\CartはAgentに併合\
                           1    G:\home\ebata\tomioka3B\src\CartはAgentに併合\ldarp\
                           2    G:\home\ebata\tomioka3B\src\CartはAgentに併合\old\
                           1    G:\home\ebata\tomioka3B\src\inc\
                           5    G:\home\ebata\tomioka3B\src\Join\
                           1    G:\home\ebata\tomioka3B\src\Join\ldarp\
                           3    G:\home\ebata\tomioka3B\src\ldarp\
                           4    G:\home\ebata\tomioka3B\src\old\
                          22    G:\home\ebata\tomioka3B\src\old\doc\
                         253    G:\home\ebata\tomioka3B\src\others\
                           1    G:\home\ebata\tomioka3B\src\others\.vscode\
                           8    G:\home\ebata\tomioka3B\src\others\chart\
                         105    G:\home\ebata\tomioka3B\src\others\csvファイルのバックアップ\
                           1    G:\home\ebata\tomioka3B\src\others\main49\
                           1    G:\home\ebata\tomioka3B\src\others\main50\
                           8    G:\home\ebata\tomioka3B\src\PrumeMobile\
                          10    G:\home\ebata\tomioka3B\src\PrumeMobile\chart\
                           9    G:\home\ebata\tomioka3B\src\PrumeMobile\chart2\
                           8    G:\home\ebata\tomioka3B\src\PrumeMobile\old\
                          12    G:\home\ebata\tomioka3B\src\PrumeMobile\static\
                          25    G:\home\ebata\tomioka3B\src\trip_cluster\
100%      新しいファイル                     105        #robocopy#
100%            新しい              7540        main.go
                          12    G:\home\ebata\tomioka3B\src\trip_cluster\bic\
100%      新しいファイル                     858        plot_cluster7.gnuplot
                           4    G:\home\ebata\tomioka3B\src\trip_cluster\bus\
100%      新しいファイル                     357        plot_cluster2.gnuplot
100%      新しいファイル                     858        plot_cluster2.gnuplot~
                          56    G:\home\ebata\tomioka3B\src\trip_cluster\data(最初に手動で作成)\
                           9    G:\home\ebata\tomioka3B\src\trip_cluster\walk\
100%      新しいファイル                     775        plot_cluster7.gnuplot
100%      新しいファイル                     858        plot_cluster7.gnuplot~
                        2001    G:\home\ebata\tomioka3B\src\trip_normalization\
100%            新しい              4466        main.go
100%      新しいファイル                    3678        main.go~
                          73    G:\home\ebata\tomioka3B\src\trip_test\
                          75    G:\home\ebata\tomioka3B\src\trip_test_tomioka2018\
100%            新しい             23276        main.go
100%      新しいファイル                     124        robocopy
                           0    G:\home\ebata\tomioka3B\src\trip_test_tomioka2018\main copy.go(5\
                          75    G:\home\ebata\tomioka3B\src\trip_test_tomioka2018_harugakkai\
                           6    G:\home\ebata\tomioka3B\src\trip_test_tomioka2018_harugakkai\others\
                           4    G:\home\ebata\tomioka3B\src\trip_tomioka2018\
                           4    G:\home\ebata\tomioka3B\src\trip_tomioka2018\others\
100%      新しいファイル                     587        dummy.txt
100%      新しいファイル                      58        dummy.txt~
100%            新しい              3272        main.go
        新しいディレクトリ       4      G:\home\ebata\tomioka3B\src\trip_tomioka2018_harugakkai\
100%      新しいファイル                  162161        agent_od_test.csv
100%      新しいファイル                    9022        libdarp.go
100%      新しいファイル                   15470        main.go
100%      新しいファイル                   18255        tools.go
        新しいディレクトリ       4      G:\home\ebata\tomioka3B\src\trip_tomioka2018_harugakkai\others\
100%      新しいファイル                  162161        agent_od_test.csv
100%      新しいファイル                     587        dummy.txt
100%      新しいファイル                      58        dummy.txt~
100%      新しいファイル                    3272        main.go
------------------------------------------------------------------------------
                  合計     コピー済み      スキップ       不一致        失敗    Extras
   ディレクトリ:        47         2        45         0         0         0
     ファイル:      2890        22      2868         0         0         0
      バイト:   35.39 m   408.0 k   34.99 m         0         0         0
       時刻:   0:00:02   0:00:01                       0:00:00   0:00:01
       速度:              278161 バイト/秒
       速度:              15.916 MB/分
   終了: 2024年6月23日 10:23:42

 

未分類

Amazon Primeで「深夜食堂」を流しながらコーディングしています。

「深夜食堂」について調べてみたら、原作本については世界中で翻訳されているみたいですが、ドラマのリメイクも、中国、台湾、韓国でされていて、放映されているようです。

舞台などにもなっているそうです ―― で、情報のウラは取れなかったのですが「フランス」でリメイクだか、舞台だかが、あったとかなかったとか。

「フランス版深夜食堂」。うん、なんか、凄く見たい。

「ドイツ版深夜食堂」「ロシア版深夜食堂」はイメージできる。

北欧もイメージできる。

西欧であれば、スペイン版とかイタリア版とかも見てみたい。

イスラム圏の深夜食堂 ―― アルコール抜きバージョンも、可能なら見てみたいです。

未分類

select * from ways where name LIKE '%Dummy Railway Line%'; で選ばれたnode とwayを全部削除するにはどうしたら良いですか

ways テーブルにおける name 列の内容が '%Dummy Railway Line%' に一致する way と、それに関連する node を削除するには、以下の手順を実行します。ways テーブルと ways_vertices_pgr テーブルのリレーションを考慮した方法です。


手順

1. name 列が空か確認

name 列の値がすべて NULL または予期しない値かもしれません。以下のクエリで name 列の値を確認します。

SELECT DISTINCT name FROM ways WHERE name IS NOT NULL;

 


2. 削除対象の gid を確認

対象となる gid を取得します。もし name が NULL である場合には以下のように NULL 対応を追加してください。

SELECT gid FROM ways WHERE name LIKE '%Dummy Railway Line%' AND name IS NOT NULL;

 

もし上記クエリに結果がない場合、代わりに以下を確認します。

  • tag_idrule 列など他の列に対象の特徴があるか確認する。
  • 該当の値を直接確認する(例: IS NOT NULL を使う)。

3. 関連する node を特定

sourcetarget のノードが ways_vertices_pgr テーブルに存在する場合、それを削除します。

以下のクエリで関連する sourcetarget を確認します。

SELECT source, target FROM ways WHERE name LIKE '%Dummy Railway Line%' AND name IS NOT NULL;

 

これにより、削除対象のノード sourcetarget を特定できます。


4. 関連する ways_vertices_pgr の削除

取得した source および target に基づき、ways_vertices_pgr テーブルからノードを削除します。

DELETE FROM ways_vertices_pgr WHERE id IN ( SELECT source FROM ways WHERE name LIKE '%Dummy Railway Line%' AND name IS NOT NULL UNION SELECT target FROM ways WHERE name LIKE '%Dummy Railway Line%' AND name IS NOT NULL );

 


5. ways テーブルの削除

最後に ways テーブルから該当する行を削除します。

DELETE FROM ways WHERE name LIKE '%Dummy Railway Line%' AND name IS NOT NULL;

 


注意事項

  • バックアップを作成: データ削除は不可逆操作です。削除前にバックアップを必ず取得してください。
  • インデックスを活用: クエリ性能を向上させるため、適切なインデックスがあるか確認します(ways_pkey など)。
  • 依存関係: 外部キー制約があるため、削除の順序(ノード懼ウェイ)を守る必要があります。

これにより、name LIKE '%Dummy Railway Line%' に該当するデータを完全に削除できます。

この方法だと関連のあるnodeも消してしまうような気がします。wayだけ消せれば良いのです。

関連のある node を削除せずに、ways テーブルだけから特定の way を削除する場合、以下の手順で進めることができます。


方法

1. 削除対象の gid を確認

name に基づいて削除対象の waygid を確認します。

SELECT gid FROM ways WHERE name LIKE '%Dummy Railway Line%';

 


2. ways テーブルから対象の行を削除

特定した gid を使って ways テーブルから削除します。関連ノードは削除されません。

DELETE FROM ways WHERE name LIKE '%Dummy Railway Line%';

 


外部キー制約について

ways テーブルには外部キー制約が設定されていますが、ways テーブル自体からの削除では関連ノード(sourcetarget)を削除する必要はありません。外部キー制約は、通常、ノードが削除される際に ways のデータが参照整合性を保つようにするためのものです。

この方法であれば、ways_vertices_pgr テーブルやその他の関連ノードはそのまま維持されます。


確認

削除後にデータが正しく削除されたかを確認するには、以下を実行してください。

SELECT * FROM ways WHERE name LIKE '%Dummy Railway Line%';

 

結果が空であれば、対象の way が正しく削除されています。

コスト付き(hakata_ex_cost_db)とコストなし(hakata_no_dummy_db)の地図を2種類作れました。

2024,江端さんの忘備録

『ダイクストラ計算を行った結果を、(1)'Dummy Rail Line'が連続するリスト、(2)(1)'Dummy Bus Line'が連続するリスト、(3)その他のリストに分割するプログラムに改造しつつ、(1)(2)(3)はその順番通りにリストを作成し、(1)(2)(3)が、2度以上出てくる場合は、別のリストとして取得するには、どうコーディングすれば良いのか?』(読まなくていいです)

'How should I code to create lists (1) 'Dummy Rail Line' in succession, (2) 'Dummy Bus Line' in succession, and (3) other lists while modifying the program to divide the results of the Dijkstra calculation into these three lists, and to obtain a separate list if (1), (2), or (3) appears more than once? (You don't need to read this.)

上記のコーディング方法について、今朝の深夜までもんもんと考え続けていました。

I kept thinking about the coding method above until late this morning.

ところが、朝方、夢の中で、この方法が、天からの啓示のごとく突如閃きました。

However, this method suddenly flashed into my mind in the morning like a revelation from heaven.

『ChatGPTにプログラム作成してもらおう』

“Let's have ChatGPT create a program for us.”

-----

先程、ChatGPTが作ってくれたプログラムの稼動を確認しました。

I just checked to see if the program ChatGPT created is working.

ようやくホッとしていますが(今から少し寝ます)、同時に『問題を考えなくなっていく自分の頭が、どんどん悪くなっている』を痛感しています。

I'm finally feeling relieved (I'm going to sleep for a bit now), but at the same time, I'm acutely aware that 'my brain, which is no longer thinking about problems, is getting worse and worse.'

これは、これで、かなり恐しいことだと思っています。

I think this is quite a frightening thing.

-----

すでに、この業界では、この問題の弊害が出ているそうです ―― かなり広範囲に、しかも相当に深刻な弊害です。

I hear that the harmful effects of this problem are already being seen in the industry - quite severe and widespread.

ソフト外注に発注した人が、発注したプログラムの内容について開発者に質問しているうちに、

While the person who ordered the software was asking the developer questions about the content of the program they ordered, it turned out that -

- そのプログラム開発者が、プログラマとして働き始めて、1年のキャリアもないこと

- the program developer had only been working as a programmer for less than a year

- そのプログラム開発者が、"サブルーチン"とは何かを知らなかったこと(注: サブルーチンという概念を知らなかった)

- the program developer did not know what a “subroutine” was (Note: He did not know the concept of a subroutine)

ことが、分かったそうです。

今、世界中で、そういう開発者たちが作成するプログラムが、大量生産されていると考えて間違いないでしょう。

It might be possible to assume that such developers mass-produce programs worldwide.

これも、これで、かなり恐しいことだと思っています。

I think this is also quite a frightening thing.

何が言いたいのかというと、「こういうプログラムを組める『私』には、市場価値があるのか、それとも、ないのか」、です。