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

現代天皇制は違うと思いますが、従来、暦を変更することができるのは、天皇の専権事項と聞いたことがあります。

Different from the current Emperor system, I heard that it was only an emperor who can have a right to change calendar.

「暦を支配する = 日本を支配する」と同義という意味だそうです。

This seems to be that "Ruling calendar is equal to ruling Japan".

これと同じように、地図の編集権も、政府の独占事項だったそうです。

Like the above, editorial right to map of nation is exclusive right of the government.

まあ、GoogleMapのある今の時代では、ちょっと思いもよりませんが、地図は国防上の最高機密でしたから。

It is hard for us to image the background, however, nation map was one of the top secret for national defense.

-----

―― 地図を自分に都合よく改竄(かいざん)している私は、何者だろう?

So, thinking "What I am to falsify maps for my work",

てなことを考えながら、地図の改竄手順を試みています ―― もちろん、その地図は私のパソコンの中でのみ有効ですが。

I am try to falsify maps. Of course the map is valid in only my own PC.

街の中に道路を作って、ダイクストラ計算ができるか試してみた件 ―― JOSMを使った道路追加の方法を試す

改竄地図をサーバをアップなどしたら、世界中に迷惑をかけることになりますから、そこは、注意しています。

If I upload the falsified maps, many people are in trouble in the world, so I take care of it seriously.

-----

OpenStreetMapは、誰でも自由に地図を使えるよう、みんなでオープンデータの地理情報を作るプロジェクトです。

OpenStreetMap is a project to make open data geographic information by everyone to use it for everyone.

誰でも自由に参加して、誰でも自由に地図を編集して、誰でも自由に地図を利用することが出来ます。

Anyone join it freely, edit the map freely、 and use the map freely.

私も、一回だけ、地図情報を変更して、アップロードしたことがあります。

Once I modified the map information and uploaded it.

―― 私の過失、または、悪意で、地図を改竄(かいざん)してしてしまったらどうするんだ?

-----

OpenStreetMapの情報って、サポーターの性格が出て、面白いんですよね。

The OpenStreetMap information is interesting, because the supporter's character will be expressed.

例えば、

For example,

■まだ開通もしていない芳賀・宇都宮レールウェイについては、しっかり記載されているのに("建設中"のタグはついていましたが)、

The information of Haga-Utsunomiya LRT has been provisioned, even the service is not started( "construction" tag is added), however,

■すでに開通している道路についての記載がない(実際に私が通ってきた)とか。

Some roadway information that has already started, has not yet added in the map.

そんでもって、

In addition.

『一体、どこの誰が、こんな地図情報 ―― どう考えたって"内部情報"だよなぁ ―― を入手して、OpenStreetMapに展開したんだろう』

"Who was to get the map information and provision it to OpenStreetMap, even it is obviously "confidential information""

とか、そういう野暮なことを口にしない ―― というところも好きです。

"Nobody say senseless things", I like it.

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

wayを取るには、以下のコマンドを使う

utsu_tram_db=# select * from ways where name = '(仮称)宇都宮ライトレール';

で、宇都宮ライトレールのwayが取れることが分かったので(誰か知らないけど、コメント入れてくれた人、ありがとう)、あとは、updateコマンドで、costとreverse_costを、小さく(1/3くらい?)すればいけそう。

SQL文の書き方を調べよう。


いちいちDockerの中に入るのが面倒なので、windows10からpsqlでログインします。

C:\Users\ebata>psql -U postgres -p 15432
Password for user postgres:
psql (13.4, server 12.5 (Debian 12.5-1.pgdg100+1))
Type "help" for help.

で、江端が変態的改造した宇都宮ライトレールのテーブルにコネクションします。

さあ、道から乗って、LRTに乗って、橋を渡って、道に下りられるか?(道路と鉄道の強制マージの件)

postgres=# \c utsu_tram_db
psql (13.4, server 12.5 (Debian 12.5-1.pgdg100+1))
You are now connected to database "utsu_tram_db" as user "postgres".

utsu_tram_dbに直接改造を加えるのは怖いので、utsu_tram_db2 というレプリカを作っておきましょう。

Dockerの中にある、postgreSQLのpostGISのDBを、丸ごとコピーする方法

でも、できるのですけど、面倒なのでWindows10から直接できないか、試してみました。

【PostgreSQL】Windows に psql コマンドだけをインストールする手順

C:\Users\ebata>createdb -U postgres -p 15432 utsu_tram_db2
Password:

で、

utsu_tram_db=# \l
List of databases
Name | Owner | Encoding | Collate | Ctype | Access privileges
---------------+----------+----------+------------+------------+-----------------------
utsu_tram_db | postgres | UTF8 | en_US.utf8 | en_US.utf8 |
utsu_tram_db2 | postgres | UTF8 | en_US.utf8 | en_US.utf8 |
(12 rows)

あ、できている。凄い。(というか、createdbが使えた、といのも驚いたが)

で、MinGWのシェルから、

$ pg_dump -U postgres -p 15432 -Ft utsu_tram_db | pg_restore -U postgres -p 15432 -d utsu_tram_db2

Password:
Password:

を実施したら、passwordを2回聞かれました(珍しい)。確認したらレプリカ(utsu_tram_db2)が、できていました。こっちで、色々テストします。ちなみに、command.comではパイプ"|"が使えないみたいです。(ちなみに、pg_dump, pg_restoreが使えたことにも驚いたが)


さて、utsu_tram_db2を使って、costと、reverse_costの値を変えてみます。

現在は、こんな感じ。

utsu_tram_db2=# select cost, reverse_cost from ways where name = '(仮称)宇都宮ライトレール';
cost         |        reverse_cost
------------------------+------------------------
0.007490415761689246 | 0.007490415761689246
0.00040536575640007835 | 0.00040536575640007835
0.01932049990115761 | 0.01932049990115761
0.008712540173673398 | 0.008712540173673398
0.007102267864215258 | 0.007102267864215258
0.00684623081981901 | 0.00684623081981901
0.004139533878435676 | 0.004139533878435676
0.005101717091578247 | 0.005101717091578247
0.004405341713757751 | 0.004405341713757751
0.004776545712421741 | 0.004776545712421741

コスト値を小さくすると、ダイクストラで宇都宮ライトレールが選ばれやすくなる(はず)だけど、いくつくらいがいいかなぁ。1/3か 1/5か。とりあえず、効果が見たいから、1/5くらいで書き換えやってみよう。

utsu_tram_db2=# update ways set cost = cost * 0.2 where name = '(仮称)宇都宮ライトレール';
UPDATE 129

さて、どうなっているかな

utsu_tram_db2=# select cost, reverse_cost from ways where name = '(仮称)宇都宮ライトレール';
cost | reverse_cost
------------------------+------------------------
0.0014980831523378492 | 0.007490415761689246
8.107315128001567e-05 | 0.00040536575640007835

まだ、reverse_costの方には手を出していないので比較ができるはず。

0.0014980831523378492  ÷ 0.007490415761689246 = 0.2

おお、できている。

では、reverse_costの方も変えてしまおう。

utsu_tram_db2=# update ways set reverse_cost = reverse_cost * 0.2 where name = '(仮称)宇都宮ライトレール';
UPDATE 129

よし、これにて、cost, reverse_costの強制変換処理を完了

ちょっと問題はあるようですが、動いているようです。

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

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

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

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

自作の「金融商品自動売買ツール」をGo言語で作ってみる

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

I am starting to make a DIY "automatic stock trading system" by Go language.

 

-----

―― ふむ、そう来たか

"Hmm, did they think so ?"

と、思いながらWeb原稿のタイトルを見ています。

I look at the title of the column.

私のコラムのタイトルを付けるのは、EE Times Japan編集部の専権事項ですので、基本的に私はお任せしています。

The EE Times Japan has an exclusive prerogative to name my column a title, and basically I don't care of it.

たまに、私が、『こういうタイトルにして欲しい』という時には、原稿脱稿時に、希望のタイトル案を提出することもあります。

I sometimes ask them "how do you think this title "'XXXXX' ?", and submit the draft version with suggested title of my choice.

過去に、私が、タイトル案を出したものといえば、

In the past, I can remember that I submitted the following titles. like

これ

this

や、

or

これ

this

が、思い出せます。

他にもあったと思いますが、忘れました。

I think there were others, but I forget them.

-----

今回は、「自動売買ツール」の方でタイトルが出されていますが ―― 見る人が見れば分かりますが ―― ぶっちゃけ、スタートラインにすら、辿りついていないような内容です。

This time, the title includes "automatic stock trading system", however, the contents are poor. If you are a professional of this field, you can notice that soon.

ソフトウェア関連の方は、あまり期待しないで、読んで下さい。

People in software field might not except the contents.

-----

で、この件について、サポートして頂ける方を募集しています。

So now I a recruiting a support person about the system.

条件は、『Go言語使い』であり、トレーディングシステムに手を出して、そして可能であれば、

The condition is "Golang" programmer, experiments of trading system and if possible,

―― 自作システムで、派手に失敗した方(100万単位でお金を失った人)

"a person who largely failed investment with their DIY trading system ( and lost money in the amount of 1 million yen)"

ならば、大歓迎です。

is welcome.

ご連絡をお待ちします。

I am looking forward to your apply.

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

記事に誘導するために、(読者の誤解を招くこともある)タイトルを『キャッチー』と形容します。

A title to lead readers to an article is called "Catchy"

私、このタイトルを読んだ時、びっくりしました。

I was surprised when I read the following title.

『「都の時短命令は違法」 賠償請求は棄却 コロナ対応で東京地裁判決』

Tokyo District Court Ruling: "Tokyo's Order to Shorten Hours Illegal" Dismissing Claims for Compensation for Corona.

-----

記事を読めば分かることですが、

Whoever read the article, could understand the following.

(1)コロナ対応の東京都の時短命令は、違法ではない

(1)Tokyo Metropolitan Government's order to shorten hours in response to Corona is not illegal.

(2)ただし、時短命令に逆らって、Webで東京都に対する抗議を行った会社を「みせしめ」とした事実を認定し、これを違法とした。

(2)However, the court admitted the fact that "a company that protest the decision of Tokyo Metropolitan Government, was punished", and decided that it was illegal.

-----

―― 結局、東京都の命令は妥当なの? 不当なの?

"In the end, is the Tokyo Metropolitan Government's order reasonable ? or not?"

が、記事を読んでいるだけでは、全く訳が分からないのです。

I didn't know it at all even reading the article.

やっぱり判決文を読まないと、なんとも言えません。

It is difficult fo me to say with reading the judgment paper.

しかし、まだ裁判所の検索エンジンでは出ていないようです(私が見落していれば、教えて下さい)。

However, the judgement paper seems not to be opened now( If I miss it, please tell me)

というか、判決文は、結審直後にWebサイトでリリースして、ニュースサイトはそれをリンクすれば、私を含め、多くの人が助かると思うのですが ――

I think even if it is opened just after closing the court, and news sites link the judgement paper, many people including me, will be helped.

なぜ、その程度のことができないのだろう?

I wonder the court didn't do such activity.

『裁判の判決文は、下手な小説よりよっぽど面白い』ので、早く読みたいのです。

Most judgement papers are interesting, so I want to read them as soon as possible.

「同性婚できないのは憲法違反」札幌地裁が日本初の判断 ―― このニュースが流れた時、私の取った行動は、裁判所の判例DBの検索をすることでした。

 

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

package main

import (
	"fmt"

	"github.com/PuerkitoBio/goquery"
)

func main() {

	q, err := goquery.NewDocument("https://kabutan.jp/stock/?code=6501")
	if err != nil {
		fmt.Println("get html NG")
	}

	name := q.Find("div.company_block > h3").Text()
	fmt.Println(name)

	code_short_name := q.Find("#stockinfo_i1 > div.si_i1_1 > h2").Text()
	fmt.Println(code_short_name)

	market := q.Find("span.market").Text()
	fmt.Println(market)

	unit_str := q.Find("#kobetsu_left > table:nth-child(4) > tbody > tr:nth-child(6) > td").Text()
	fmt.Println(unit_str)

	sector := q.Find("#stockinfo_i2 > div > a").Text()
	fmt.Println(sector)

}

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

package main

import (
	"fmt"
	"log"
	"net/http"

	"github.com/PuerkitoBio/goquery"
)

func main() {
	// Request the HTML page.
	res, err := http.Get("http://kobore.net")
	if err != nil {
		log.Fatal(err)
	}
	defer res.Body.Close()
	if res.StatusCode != 200 {
		log.Fatalf("status code error: %d %s", res.StatusCode, res.Status)
	}
	// Load the HTML document
	doc, err := goquery.NewDocumentFromReader(res.Body)
	if err != nil {
		log.Fatal(err)
	}
	doc.Find("input").Each(func(i int, s *goquery.Selection) {
		// For each item found, get the title
		title, _ := s.Attr("type")
		fmt.Printf("Review %d: %s\n", i, title)
	})
}

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

嫁さんは、いわゆるレストランで接客のパートをしています ―― 私には絶対にできない職業の一つです。

My wife works part time in customer service in restaurant --- one of those professions I could never do.

『無礼な客は、許さない』と確信できるからです。

I am convince that I never forgive an arrogant customer.

-----

今や、飲食店におけるタブレットを使ったオーダーシステムが、普通になりつつあります。

Now an order system using a tablet seems to be ordinally in the food and beverage field.

このシステムは、人件費やオーダーミスを減らす観点からメリットもありますし、お客にとってもオーダー取りがこなくてイライラすることもないというメリットがあります。

This system has merits that decreasing labor costs and order errors, and less frustration when an order is not picked up for customers.

もっとも、このようなシステムに慣れていない人にとっては、不便です。

Of course, it is inconvenience for customers who are not familiar with this tablet system.

-----

最近、タブレットが使えない高齢者が問題になっているようです。

Recently, old-agers who cannot use a tablet become social problems.

タブレットが使えない高齢者は、当然に支援すべきですが、タブレットで注文するようにお願いすると、怒鳴りつける客(ジジイに多い)が結構頻発しているらしいのです。

Of course, we have to support theses old-agers who cannot use a tablet, however, my wife said that some old-agers who got angry when she asked them to use the tablet, are increasing.

嫁さんから話を聞いていると、私の方がキレてしまいます。

Hearing wife's story, it is me who come to angry.

―― 店員は当店の大切なアセット(資産)です。店員を怒鳴りつけるお客様はお帰り頂きます。またのご来店を「拒否」します。

"Our clerks are our most important asset. Any customer who yell at our clerks will be asked to leave. We will "refuse" next your visit.

って、言えないのかな、と言ったら、『それは無理だ』と言われました。

When asking her, she said "it is impossible".

(実は、これ(出禁)は法律的に可能です(民法第521条「契約の自由」))

(Actually, this (banning) is legally possible (Civil Code Article 521 "Freedom of Contract").

さて、これから「マスクをしない方は、入店を御遠慮下さい」が、「ワクチン接種を終えていない方は、入店を御遠慮下さい」に変化していくに際して、『これは、"差別"なのか?』という純粋な疑問です。

-----

これは、インタフェースの問題だと思うのですよ ―― タブレットではなく、ジジイの方の。

This is a interface problem of old-agers not tables.

(1)『お前がオーダーを取れ!』と怒鳴るジジイと、

(1) The old man who yell "You take the order"

(2)『何度も済まないけど、教えて下さらないか』と頭を下げるジジイ

(2) The old man who bows his head and says, "I'm sorry to repeat some questions again, but could you please teach me?"

私たちの社会は、(1)のジジイを切り捨てて、その労力を(2)のジジイの支援に注ぎたい、と思うものです。

Our society think that we cut out the the above (1) old man, and want to support the above (2) old man.

私は、この感情をシステム化する ――「ジジイ選別システム」を作っている、と自負しております。

Now I am systematizing this emotion, and creating "the system that cut arrogant customer off"

-----

『お客様は神様です』の旧態依然の価値観で生きているジジイたちに告ぐ。

I will tell the old-agers who live by the old-fashioned value system of "the customer is God".

私は、この価値観を破壊します。

I destroy this values.

いずれ、私のシステムが、そのようなジジイたちを排除するようになるでしょう。

Eventually, my system will be designed to eliminate those old-agers.

今からでも、自分のインターフェースを変更して、「私のシステム」にチューニングした方がいいです。

I think that they should change their interface, and tune them into "the Ebata's system".

未分類

https://tutorialmore.com/questions-2093576.htm

lengthとlength_mの違いは何ですか?また、それぞれの単位距離は何ですか?

length  度単位であり、それほど意味はありません。

緯度・経度の 1度はどれくらいの長さがあるのか

143.48731327191777 ÷ 0.0016025174726055347 = 89538.688797334365001365036280371 となり、概ねあっている様子。

length_m  メートル単位です。

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

utsu_tram_db=# select * from ways where source =0
;
gid | osm_id | tag_id | length | length_m | name | source | target | source_osm | target_osm | cost | reverse_cost | cost_s | reverse_cost_s | rule | one_way | oneway | x1 | y1 | x2 | y2 | maxspeed_forward | maxspeed_backward | priority
| the_geom

gid | osm_id | tag_id | length | length_m | name |

source: 始点ノードの識別子

target : 始点ノードの識別子

| source_osm | target_osm |

costcost : エッジにかかる重み(負の重みは、エッジがグラフに挿入されるのを防ぎます)

reverse_cost: エッジの反対方向のためのコスト。

| cost_s | reverse_cost_s | rule | one_way | oneway |

x1 : エッジの始点のx座標

y1 : エッジの始点のy座標

x2 : エッジの終点のx座標

y2 : エッジの終点のy座標

| maxspeed_forward | maxspeed_backward | priority
| the_geom

 

・id : エッジの識別子 [int4] ・・・・source : 始点ノードの識別子 [int4] ・・・・target : 終点ノードの識別子 [int4] ・・・・cost : エッジにかかる重み(負の重みは、エッジがグラフに挿入されるのを防ぎます)。 [float8] ・・・・reverse_cost(オプション) : エッジの反対方向のためのコスト。

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

以前、何度かアニメ「氷菓」の話をしました。

Previously, I often told the animation "Hyouka".

私なりの「氷菓」シリーズの解釈は、

What I understand the contents of "Hyouka" series, are

(1)『努力は天才に勝てない』と

(1) "Hard work is no match for genius."

(2)『天才は幸せではない』という、

(2) "Genius is not happy".

私がティーンの時代の言語化できなかった事実を、等身大の若者たちの姿で、納得できる描写で描いている点にあります。

This animation show us the above realties that I had not reached in my teenager, appearing life-size young people.

-----

その続編となる米澤 穂信さんの小説「いまさら翼といわれても」についても、何度も書きましたが、今、改めて読み直しています。

I often wrote about the sequel novel "Even if you give me my wings now", by Honobu Yonezawa, and I am reading it again now.

こちらでは、上記(1)(2)のテーゼに加えて、『高校の部活動の無意味さ』についても記載されています。

In this novel, 'insignificance of high school club activities' are described, in addition to the above (1) and (2) themes.

友人同士で派閥を作り、目標もなく、ただ時間を消費し続けるだけの高校の部活動について、厳しい批判と思われる短編が登場します。

There is a story that is a harsh criticism of high school activities that has no purpose, waste time and just make factions with friends.

比して、そのような部活動などに目もくれずに、ハイスクールに入る前から、自分のできること、好きなことのみに注力し、今や、世界を動かしている、2大オペレーティングシステムの礎を作った人たちもいます。

In comparison with, there are persons who completed two world-wide computer operating systems. Even before entering high school, they focused on what they did and what they wanted, without paying attention to such club activities, etc.

もちろん、そのような「成功体験」がある例はレアなケースですし ―― ぶっちゃけ「成功」なんてどうでもいいのです。

Of course I know such "success experiments" are rare. Moreover I don't care about "success" to be frank,

あの高校時代の時間を、もっと『狂ったように過す』ことはできたと思います ―― 友人という名のグループに安住して、無為な時間を浪費することなく。

I think I could have spent the time for 'going crazy' during those high school years.

つまり「昔の私」です。

In other words, "It was me as young".

-----

もっとも、私を含む多くの凡庸な人間にとって、このような「狂ったように過す」ことのできる対象に巡り合うことは難しいです。

However, for many people including me, it is difficult to find such an object of "going crazy".

加えて、ティーンの共通の"貨幣"が、"友人"という奇妙なものであるからです。

In addition, the common "currency" of teenager is a strange thing that called "friends".

そして、彼等は、その"貨幣"の多少、つまり"友人数"という価値の呪縛から逃れられないからです。

And they cannot escape from the spell of the value of "currency", called "numbers of friends".

この"友人"という名の"貨幣"は、ティーンの時代を越えても、価値あるものと見なされることがあります。

The "currency" called "friend" is often treated to be valuable beyond the teenager.

-----

来週リリースされるコラムでは、この"友人"という名の"貨幣"について論じる予定です。

In the column of this month, I will argue the "currency", called "friends"