江端さんの忘備録

「XXXXをやっている人に悪い人がいない」という言葉が嫌いです。

I hate a saying "there is no evil person who do XXXX".

そして、こちらにも書いていますが、

I wrote about the topic here

=====

『ある特定の行為または職種に、高いモラルが宿る』という考え方自体が、

I think that the thought of "High ethical standards indwell in a special action or type of work" is

無知性で、狭窄視野的で、自己完結的で、

unenlightened, local outlook, self-contained and

論理的、数理的、統計的という考えが1mmも入り込まない

illogical, nonmathmatica, nonstatistical,

ぶっちゃけて言えば「アホの戯言」 ―― と思っています。

I think that it is "stupid shit", if I speaks quietly.

=====

このような「アホの戯言」は、自分の取り組んでいる仕事や研究、その他のアクティビテイ、そして自分の属しているグループや組織についても、見られます。

I can watch this "stupid shit" in work I am working on, research and other activities, as well as the groups and organizations I belong.

それはさておき。

That aside.

------

ご存知の通り、最近、私は、量子コンピュータの勉強をしています。

As you know, I have recently been studying quantum theory.

この量子という微小な物質の振る舞いが、人間という巨視的な物体の振る舞いに投射することで、なんでもかんでも、"量子"に結びつけて考えることができるように思えて ――

It's as if I can relate everything to the quantum. It means that I can understand the behavior of this quantum matter by projecting it into the behavior of a macroscopic object called a human being.

自分で自分を厳重に見張るようにしています。

Hence, I try to keep myself on high alert.

正直「量子」を使って宗教を作れるんじゃないかなぁー、と思っていたのですが、調べてみたら、本当に

I honestly wondered if I could use "quantum" to create a religion. and I really found that

■量子の振舞いを教義の根拠としているカルト宗教

- A cult that bases its doctrine on quantum behavior.

があり

■量子の振舞いから哲学を展開しているライフハックの本

- A book of life hacks that develops a philosophy from the behavior of the quantum

がありました。

-----

昨夜、「やはり俺の青春ラブコメは間違っている完」の第5話を見ていて、

Last night, while I was watching episode 5 of "My youth romantic comedy is wronte, as I expected -- final", I came to think

『なるほど、彼ら彼女らの言っている「本物」とは、「量子状態にある量子ビット」のようなものか』

"I see, the "real thing" they say is like "a qubit in a quantum state."

などと考えてしまい、その時、ハッと気がつきました。

and that hit me.

私は、

I came to think that my thoughts were same as

■「創作物」の内容を、自分で解釈できる都合のよいメソッド(量子力学)を持ち込んで、解釈しようとしている

- by trying to interpret the content of the "creation" by bringing in a convenient method (quantum mechanics) that I can interpret myself.

■これは、上記の低能カルト宗教や、安易ライフハック本と同じ愚行

- the lowly cult and easy life hack books above.

であり、上記の「アホの戯言」と同じものである、と思い至りました。

- the above "stupid shit".

-----

この思考アプローチは、極端なことを言えば、極右として「ファシズム」とか、極左としての「コミュニズム」とか、カルトとしての「原理主義」とかと同じようなモノであり、

This approach to thinking is the same thing in the extreme as "fascism" as the far right, or "communism" as the far left, or "fundamentalism" as a cult

メソッドと結びついた(特に、論理的に整合性があるものや、あるいは物理法則などに結びついた)考え方は、「極」に走りがちであり、それらが権力や大衆と結びついた時 ―― 数百万から数千万もの人々を殺害してしまう

Ideas tied to methods (especially those that are logically consistent or tied to physical laws, etc.) tend to run to the "extreme", and when that ideas are associated with power and the masses -- it will kill millions to tens of millions of people.

このことを、私は忘れてはならない

I must not forget it,

―― と、いうようなことを、

「やはり俺の青春ラブコメは間違っている完」の第5話を見ながら、考えていました。

I was thinking about this, and so on, while watching episode 5 of "My Youth Romantic Comedy is Wrong, I expexted -- final"

2020/08,江端さんの忘備録

(昨日の続きです)

(Continuation from yesterday)

ところが、直接話しかけなくても、COCOAアプリのインストールを調べる方法はあります。

However there is a way to know whether a person has installed COCOA app, without talking. It is to make

―― 「自分の目の前にいる人が『COCOAアプリをインストールしているか』を確認するアプリ」

"An app that checks to see if the person in front of you has the COCOA app installed"

を作れば良いのです(このアプリを便宜的に「COCOA'」と称呼します)。

(I will call this app COCOA' for convenience)

ポイントは、COCOAアプリが、オープンソースで公開されている点にあります。

The point is that the COCOA app is open source and publicly available.

これは、つまり、「時間」と「能力」と「スキル」と「気力」のある人間であれば、COCOAの派生アプリケーションである、COCOA'を自由に開発できる可能性がある、ということです。

This means that anyone with the time, ability, skills and energy can develop COCOA's derivative application, COCOA'.

ただ、正確に言うと、上記の「自分の目の前にいる人」のスマホを検知することはできません。

However, to be precise, this app cannot detect the contents of the phone of the "person in front of you" mentioned above.

COCOA'は、

The COCOA' can only detect

■あなたのスマホから、約半径10メートルの範囲内で、

- Within a radius of about 10 meters from your phone,

■「COCOAアプリがインストールされているスマホ」の「台数」

- Number of "phones with COCOA installed

を調べることができるだけです。

だから、「自分の目の前にいる人」がインストールしているか否かをを特定する為には、

So, in order to identify whether or not the "person in front of you" has COCOA installed. the condition is given:

■約半径10メートル以内には、その人以外には、誰もいない

"There is no one else within a radius of approximately 10 meters except that person.

ことが必要となります。

-----

COCOA'の動作原理は簡単です。

The principle of operation of 'COCOA' is simple.

COCOA'は、COCOAのBluetoothの電波を発射しているスマホを探すだけです。

The COCOA' tries to find a phone that is transmitting COCOA's Bluetooth signal.

それだけしかできません。

That's all the app can do.

しかも、Bluetoothの電波の中の情報は、個人情報(スマホ固体番号等)と紐付いていないので、個人の特定はできません。

What's more, the information in the Bluetooth radio waves is not tied to personal information (such as the phone's solid number), so it cannot be used to identify an individual.

あなたは、街の中で、FreeのWiFiアクセスポイントを探したことがあると思います。

I'm sure you've looked for free WiFi access points around town.

COCOA'も、これと同じことをするだけです。

COCOA' just does the same thing.

-----

もし私(か、あるいは誰か)が、このCOCOA'を開発したら、ちょっと面白いことができます。

If I (or someone else) develops this COCOA', it could be a bit interesting.

『COCOAをインストールしている人 = コロナリテラシーが高い』という仮説を"真"とした上で、以下のようなこと調査や判断ができるようになります。

If the hypothesis that "people who have COCOA installed = high corona literacy" is true, then the following investigations and judgments can be made.

例えば、

For example,

■COCOA'を、居酒屋やラーメン屋の入口で起動する

- Launching 'COCOA' at the entrance of an izakaya or noodle shop

これによって、その店の中で、何人の人間がCOCOAを起動しているか、一目瞭然です。

This allows you to see at a glance how many people in that store are running COCOA.

店舗に入る前に、ざっくりとした、その店舗内の「コロナリテラシー」の高いお客の人数を、店に入る前に調べることができます。

Before entering a store, you can find out, roughly, the number of "high corona literate" customers in that store before you walk in.

(私なら、10人のお客が入っているラーメン屋の入口で、COCOAが起動しているスマホが3台だけなら、そのラーメン屋には、入りません)

(I wouldn't go into a ramen shop with 10 customers if there were only three phones with COCOA running at the entrance of a ramen shop)

■COCOA'を、職場や、飲み会の会場で起動する

- Launching 'COCOA' at your workplace or at a drinking venue.

自分の属する組織やグループの「コロナリテラシー」を、集団として観測することができます。

You can observe the "corona literacy" of your organization or group as a group.

(私としては、『それを言い訳に、飲み会の出席を拒否する』という切り札としても使えると期待しています)

(For me, I'm hoping it can be used as a trump card to "use that as an excuse to refuse to attend a drinking session".)

これによって、今後、

In the future,

■『COCOAをインストールしたスマホをお持ちでない方の入店はお断りします』という張り紙

A sign that says, "we do not allow people who do not have a smartphone with COCOA installed to enter the store".

が、飲食店のみならず、全ての施設(役所、アミューズメント、学校)の入口の前に張られるようになるかもしれません。

The paper could be put up in front of the entrances of all establishments (government offices, amusements, schools), not just restaurants.

-----

ざっとソースコードを見てみたのですが、この新しいアプリ(COCOA')の開発は、私には、少々敷居が高いように思われます。

I took a quick look at the source code and it seems to me that developing this new app (COCOA') is a bit of a challenge.

スキルも時間も足りませんが、特に時間の要素が大きそうです。

I don't have enough skills or time, but the time factor seems to be particularly significant.

従って、当面の私の仕事としては、

Therefore, for the time being, my work is to to write a column that explains easily

『COCOAによって、個人情報を抜き取られる心配はしなくていいよ』

"You don't have to worry about COCOA extracting your personal information"

を、分かりやすく解説するコラムを執筆する ―― こっちなら役に立てるかもしれません。

I might be able to help you with this work.

2020/08,江端さんの技術メモ

// mail.go

package main
 
import (
    "net/http"
 
    "github.com/labstack/echo"
)
 
func main() {
    e := echo.New()
	e.POST("/save", save)
	e.Logger.Fatal(e.Start(":1323"))
}


func save(c echo.Context) error {
	 name := c.FormValue("name")
	 email := c.FormValue("email")
	 return c.String(http.StatusOK, "name:"+name+", email:"+email)
}

でもって、curlで送ってみた。

ebata@DESKTOP-P6KREM0 MINGW64 ~
$ curl -F "name=ebata" -F "email=mailmail" http://localhost:1323/save

で、出力が、以下のようになった。
name:ebata, email:mailmail

2020/08,江端さんの忘備録

コロナ感染症対策として、マスクが有効か否かついては、こちらで記載しております。

Whether or not masks are effective in fighting corona infection is described here.

また、こちらで記載しているように、感染しているか否かを、"0"と"1"のように考えることができないことも明らかです。

It's also clear that you can't think of being infected or not as a "0" and a "1", as described here.

しかし、その効果がどうであれ、「マスク」が一種のマナーとなっているのは事実です。

But whatever the effect, it is true that "masks" have become a kind of etiquette.

そして、「マスク」は、いわゆる「コロナリテラシー」の初歩の初歩と言えます。

And the "mask" is the first step of steps in so-called "corona literacy".

私としては、このマスクに加えて「COCOA(新型コロナ接触確認アプリ)」を、このマナーに入れることを提言したいと思います。

For me, I would like to suggest that in addition to this mask, the COCOA (new corona contact verification app) be included in this etiquette.

COCOAについては、すでに私、色々書いていますので、参考にして下さい。

I've already written a lot about COCOA, so please refer to it.

■COCOAのインストールは個人の自由ですが、私はインストールをお勧めしたいと思います。

Installing COCOA is a personal choice, but I would recommend that you install it.

■「セキュリティが万全」というよりは、「ハックするコストが全然見合わない」という感じです。

It's not so much "full security" as it is "not at all worth the cost to hack.

私は、「COCOAのインストール」を実施したか/していないかで、その人の「コロナリテラシー」を判断できると思っています。

I believe you can determine a person's "corona literacy" by whether or not they have/don't have implement a "COCOA installation".

-----

やり方は色々あると思いますが、もっとも簡単な方法は、

There are many ways to do this, but the easiest way is to ask a question,

『COCOAインストールしました?』

"Have you installed COCOA?

という質問をすることです。

■「もちろんです」という人は、リテラシー"1"で良いと思います。

If the person says "of course", I think his/her literacy level is "1".

■「ああ、COCOAですね。でも個人情報について不安が・・・」という人は、「リテラシー"0.9"」くらいと判断して良いかと思います。

"Oh, COCOA. But I'm worried about personal information...", I think it's safe to say that he/she have a literacy level of "0.9".

比して、

In comparison to,

■「COCOA? 何ですか、それ?」という人は、「リテラシー"0"」と断定して良いでしょう。

If the person says "COCOA? What's that?", I think his/her literacy level is "0".

いわゆる「自粛警察」をやっている人で、COCOAを知らない人がいたら、あなたは、その「自称警察官」、殴っていいです。

If you're a so-called "self-restraint police" and you don't know COCOA, I will hit you absolutely.

(私は、これに加えて、大声で、"ふざけるな!"と罵ります)。

In addition, I will shout "Do not be silly!" loudly,

(続く)

(To be continued)

2020/08,江端さんの技術メモ

golang ではファイル名が _test.go で終わるファイルを run すると
上記のエラーが表示されて実行できません。

ちなみに、buildだと

$ go build echo_test.go
no packages to build

と表示されて、なんのことやらさっぱり分かりませんでした。

2020/08,江端さんの技術メモ

$ go build echo.go
echo.go:4:5: cannot find package "github.com/trevex/golem" in any of:
        c:\go\src\github.com\trevex\golem (from $GOROOT)
        C:\Users\ebata\go\src\github.com\trevex\golem (from $GOPATH)

ebata@DESKTOP-P6KREM0 MINGW64 ~/go_websocket_test
$ go get -u github.com/trevex/golem

ebata@DESKTOP-P6KREM0 MINGW64 ~/go_websocket_test
$ go build echo.go

2020/08,江端さんの忘備録

(昨日の続きです)

(Continuation from yesterday)

私は、コラムを書くのが好きで、イラストを描くのが好きで、コーディングをするのが好きで、そして ――

I like to write columns, I like to illustrate, I like to code, and

その全てが「下手くそ」です。

I am not good at all of them.

だから、これらを他人に任せるのが、もっとも効率的であり、いわゆる『生産性が上がる』のは間違いないでしょう。

So, I think it's most efficient to leave these things to others, and there is no doubt that it will increase so-called "productivity".

だが、それは「楽しいのか?」

But is it "fun"?

自分の作り出したモノ、自分でやった仕事は、他人のモノや仕事より「愛おしくはないか?」

Do you love what you created and worked, more than other people's creations and works ?

と考えると、私には分からなくなるのです。

I don't know that.

それ故に、私は「私を幸せにするアプローチ」として、

Therefore my "approach to making me happy

(1)ひとりでやる

(1) Do it alone.

(2)ずっとやる

(2) Do it for a long time.

(3)会議に出ない(ここはGoogleと同じで、これまでも、これからも)

(3) Don't attend meetings.(It's the same as Google here, from now and to now)

を続けていくことになると思います。

I think I'll continue to do them.

-----

つまるところ、これは人間のスケール感の問題かもしれないなぁ、とも思います。

As a result, I think that this is about a matter of human scale.

私は「技術」が好きで、特に「小技」が好きですが、その技の集大成である「サービス」や「ビジネス」が好きな人にとっては、「Google式仕事術」は正しいアプローチだと思います。

While I like "technology" and especially the "little tricks, for people who like "service" and "business", the "Google Method of Working" is the right approach.

私は、「他の人」を喜ばせることに幸せを感じられます。

I feel happy to please other people.

しかし、私は、「"多く"の他の人」を喜ばせることが、"多くの幸せ"になるとは、感じることはありません。

However I can't feel many happiness to please many other people.

つまるところ、

In conclusion,

『私は、人間としての器が小さい』

"I don't have what it takes"

この結論で、私は異義ありません。

I have no objection to this conclusion.

2020/08,江端さんの忘備録

「Google式仕事術」では、生産性を上げる為に、以下を提唱しているそうです(読んでいません)。

The "Google Method of Working" advocates the following to increase productivity (I haven't read it)

(1)ひとりでやらない

(1) Don't do it alone.

(2)ずっとやらない

(2) Don't do it for a long time.

(3)会議に出ない

(3) Don't attend meetings.

なるほど「生産性を上げる為」には、これが正解かもしれません。

Okay, maybe this is the right thing to do "to increase productivity".

しかし、「生産性なんぞ知ったことか」と置き換えるだけで、このメソッドはボロボロと崩れていきます。

But simply replacing it with "I don't care of productivity", the method falls apart in tatters.

-----

私、生産性については、かなり徹底的に勉強しました。

Me, I've studied productivity pretty thoroughly.

その結果、「生産性について、合意が取れている定義が存在しない」ということを発見しました。

As a result, I found that "there is no agreed-upon definition of productivity.

そして、「生産性」と「幸福」の間には、強い相関が存在しないことも知りました。

I also learned that there is no strong correlation between "productivity" and "happiness".

-----

「生産性を上げる = 幸福」と「幸福 = 善」から、「生産性を上げる = 善」という三段論法は成立します。

The triadic argument, "Increase productivity = happiness" and "Happiness = goodness," is established from "Increase productivity = goodness.

しかし、

However, it can also be interpreted as,

―― その"生産性"を上げるのは、"私以外の誰か"で良くね?

"Why can't someone other than me make it more productive?"

という解釈が可能です。

さらに、「Google式仕事術」が、"この私"に「楽しさや喜びを与えているのか?」 という点について、私には分からないのです。

Furthermore, I can't know that "Google Method of Working" gives me joy and pleasure of mine.

■自分でコラムを書かなくても、面白いコラムを書いている人がいるから、そのコラムを読めばいい。

- Even if I don't write your own column, someone else writes an interesting column, so I can read it.

■綺麗なイラストを書ける人は、世の中にゴマンといるから、その人に外注すればいい

- There are many people who can draw beautiful illustrations in the world, so I can outsource to them.

■自分でコーディングしなくても、コーディングのプロに頼めばいい

- I can ask a professional to do the coding for me.

まったく、その通りだと思います。

I think these are absolutely right.

(続く)

(To be continued)

2020/08,江端さんの技術メモ

0. メモ

CREATE DATABASE ca_sim0; の逆で、DBの消去方法は DROP DATABASE ca_sim0;

  1. メイン

すでに地図DBは作ってきたが、今のうちに纏めておきます。ここでは東京の豊洲地区を例にして説明します。

なお、Dockerの利用を前提とし、それぞれの地区のDBはバラバラに管理するものとします。地区ごとに取り扱えるようにして、DBを切り替えて利用することを前提とする為です。

(Step1) (to-path)/toyosu というディレクトリを掘る

(Step2) そのディレクトリに、以下のdocker-compose.ymlを作ります。

version: '3.7'

services:
  db:
    image:  postgis-pgrouting:latest
    environment:
      POSTGRES_HOST_AUTH_METHOD: 'trust'
      POSTGRES_PASSWORD: 'postgres'
    expose:
      - 5432
    ports:
    - 15432:5432
    volumes:
      - db_data
      - ./shared:/shared
  db_data:
    image: busybox
    volumes:
      - /data/db

これに対して、

docker-compose up -d
Creating network "toyosu_default" with the default driver
Pulling db (postgis-pgrouting:latest)...
ERROR: The image for the service you're trying to recreate has been removed. If you continue, volume data could be lost. Consider backing up your data before continuing.

Continue with the new image? [yN]y
Pulling db (postgis-pgrouting:latest)...
ERROR: pull access denied for postgis-pgrouting, repository does not exist or may require 'docker login': denied: requested access to the resource is denied
ubuntu@ip-172-26-13-137:~/toyosu$

てなものが出てきた時は、

image: postgis-pgrouting:latest

の代わりに、

image: pgrouting/pgrouting:v3.0.0-dev-postgresql_12

にしたら動いた(理由は不明だが、まあいいか)

DB(PostgreSQL)のアクセス用のポート番号は、15432としています。ローカルにPostgresがある場合にバッティングを避ける為です。

(Step3) そのディレクトリの中で、"docker-compose up -d"を実行する。

(Step4)"$ docker start -a toyosu_db_1"としてコンテナを起動する

(Step5)(winpty) "docker container exec -it toyosu_db_1 bash" でシェルに入る

(Step6) "psql -U postgres" で、DBのコンソールに入る

(Step7)psqlでデータベースを新規作成する(以下、データベース名をca_simとする)。

postgres=#CREATE DATABASE ca_sim

(Step8)次のコマンドを実行する

postgres=# \c ca_sim
postgres=# create extension postgis;
postgres=# create extension pgrouting;

(Step9) ここで、もう一つ、コンソール(2)をたちあげて、(to-path)/toyosuに入っておく

(Step10) https://www.openstreetmap.org/ から、豊洲地区を選んで地図DBをエクスポートする

ファイル名を"toyosu.osm"として、(to-path)/toyosuに保存する。

↓私が使っている、"toyosu.osm"

(Step11) コンソール2で、"toyosu.osm"を、コンテナに放り込む

>docker cp toyosu.osm toyosu_db_1:/db_data

(Step12)コンソール2で、"apt-get update"、"apt-get update" を実施した後、"apt-get install osm2pgrouting"を実施

(Step13)コンソール2で、"osm2pgrouting -f /db_data/toyosu.osm -c /usr/share/osm2pgrouting/mapconfig_for_cars.xml -d ca_sim -U postgres" を実施

これで、地図DBはできているハズだが、多分、一発で成功することはないので、いろいろ試してみて下さい。

(Step14) psqlでログインしているコンロールから、以下の操作をして表示ができれば、成功

postgres=# \c ca_sim
You are now connected to database "ca_sim" as user "postgres".
ca_sim=# \dt
List of relations
Schema | Name | Type | Owner
--------+-------------------+-------+----------
public | configuration | table | postgres
public | pointsofinterest | table | postgres
public | spatial_ref_sys | table | postgres
public | ways | table | postgres
public | ways_vertices_pgr | table | postgres
(5 rows)

ca_sim=# select * from ways;

以下のような表示がでてくれば、(多分)成功

QGIS3で接続すると、こんな感じのものが表示されるはず

以上

江端さんの忘備録

コンテナに、"ebata_db_1" とか、 "ebata_db_data_1"とかの名前ができているんだけど、一体、誰が命名しているのか全然分からなかったけど、たまたま見つけたので記載しておく。

ディレクトリ名 "casim2020"のところに、以下のdocker-compose.yml を作り、

version: '3.7'

services:
  db:
    image:  postgis-pgrouting:latest
    environment:
      POSTGRES_HOST_AUTH_METHOD: 'trust'
      POSTGRES_PASSWORD: 'postgres'
    expose:
      - 5432
    ports:
    - 15432:5432
    volumes:
      - db_data
      - ./shared:/shared
  db_data:
    image: busybox
    volumes:
      - /data/db

ebata@DESKTOP-P6KREM0 MINGW64 ~/casim2020
$ docker-compose up -d
Creating network "casim2020_default" with the default driver
Creating casim2020_db_1 … done
Creating casim2020_db_data_1 … done

というように、ディレクトリの名前が自動的に付与されるらしい。