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

β世界線であれば第三次世界大戦が起こる未来に「収束」し、α世界戦であればディストピアに「収束」する。

If it is a beta world line, it "converges" to a future in which World War III occurs, and if it is an alpha world war, it "converges" to a dystopia.

岡部倫太郎が、その「収束」が一切ないシュタインズ・ゲート世界線に到達することで、第3次世界大戦という未来が、阻止されます。

The future of World War III is prevented when Rintaro Okabe reaches the Steins;Gate world line, where there is no such "convergence" at all.

それはさておき。

Aside from that.

-----

今や、現実世界では、本気の第3次世界大戦の危機にあります。

Now, in the real world, we are on the verge of a serious World War III.

これまで人類は世界大戦を2回やってきました。

So far, humanity has fought two world wars.

さらに3回目も「大国のエゴ」で開戦したりしたら、私たち人類は『バカ』の謗りを避けられません。

And if we start another war for the third time because of the "egos of the great powers," we human beings will inevitably be slandered as 'idiots'.

第3次世界大戦は、宇宙戦争すらも超越した、「時空をかけた闘い」の中で語られるべきなのです。

World War III should be told in the context of a "struggle through time and space" that transcends even space wars.

私には、シュタインズゲート・ゼロのオープニングと同じ風景を、現在進行形で地球上に作り出している「あいつ(ら)」を、許す理由はないです。

I have no reason to forgive "those people" who are currently creating the same scenery on earth as the opening of Steins;Gate Zero.

-----

ちなみに「論文が燃えたくらいで、研究がパーになる」てなことは、ないです。

By the way, there is no such thing as "research is not ruined just because a paper is burned".

研究員であれば、自分の論文(or 特許明細書)が、10回燃やされても、11回書き直すことができます。

If you are a researcher, you can rewrite your paper (OR patent specification) 11 times even if it is burned 10 times.

中鉢博士は、自分の娘(牧瀬紅莉栖)の論文の内容の理解はもちろん、剽窃(ひょうせつ)すらできなかった、ということです。

Dr. Nakabachi could not understand or even plagiarize the contents of his daughter's (Kurisu Makise's) paper.

-----

ともあれ、午前0時を過ぎてから、NetFlixから「シュタインズ・ゲート"を"選択」するのは止めましょう。

Anyway, don't "select" Steins;Gate from NetFlix after midnight.

# 「シュタインズ・ゲート"の"選択」ではありません

# It is not Steins;Gate's selection.

結構なディストピア ―― 平日のオールナイト上映会 ―― が待っています。

Quite a dystopia -- all-night weekday screenings -- awaits.

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

golangのプログラムの中でブロードキャストするのであれば、

https://github.com/MicrosoftArchive/redis/releases/tag/win-3.2.100

で、redisサーバをインスールして、

https://github.com/gomodule/redigoを使うという手もありますが、

Redigoを使う(6) パブリッシュ/サブスクライブ

のサンプルプログラムで簡単に試すことができます。

 

 

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

brian-goo/pubsub-go

(1)redisサーバを援用して、(2)golangをサーバにして、(3)websocketでブロードキャストが実現できて、(4)JavaScriptをクライアントとして使える、(5)OSSを捜し出しました。

理由は、複数のWebに同じ地図と車両の移動をリアルタイムを表示しなればならないのですが、Websocketはユニキャスト通信しかできないので、困っていました(UDPとか使えればいいんですが、スマホでUDPが通るとは思えないので)。

WebSocketでブロードキャストを作るのが辛いので、これを援用したいと思います。

これは、http://localhost:5000 でブラウザを立ち上げると、サーバを介してブラウザ→ブラウザにメッセージがechoされます。

redisサーバを立ち上げておいて、main.goと、js/index.htmlだけで動きます。

上記を改造すれば、サーバからパブ(pub)、webブラウザでサブ(sub)が可能になるはずです ―― 多分


実験した結果、subscribeしたオブジェクトに、過去のデータもpublishされることが分かりました。

subscribe以前のデータを取込むと逆に困る(過去のデータは不要な上に、データの表示もバラバラになる)ので、pubsub-goの採用は見送り、redigoの方を使うことにしました。

redisを前提として、golangでPubSubを実現するプログラム

JavaScriptを直接のクライアントとして使いたかったのですが、redigoと連携するJavaScriptが見つけられなかった(かなり捜したつもり)ので、Golangで立ち上げるハンドルの中で、個別に対処することにしました。

 

 

 

 

 

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

C:\Users\ebata\goga\1-10>のI_hate_go_server.md が本体です。

1. Golangのサーバなんか大嫌い

このドキュメントは、絶対的な意味において「無保証」です

Golangで作るサーバは、HandleやらHandlerやら、ハンドル、ハンドルとうるさい! と叫びたくなること、甚しいです。

さすがに、C言語のfork()まで戻りたいとは思えませんが、『あれは、あれで、何をやっているのか分かった』とは言えました。

で、もう正しい理解かどうかは、無視して、もう、誰の話も聞かん! 江端はこういう風に理解すると決めた!! ことを記載しておきます。

2. サーバ側の江端の理解

2.1. http.Handle()は、ブラウザに入力するURLと、index.htmlの場所を教えるものである

http.Handle("/", http.FileServer(http.Dir(".")))

は、https://xxx.xxx/ でアクセスできて(http://xxx.xxx/yyyy のように"yyyy"はない)、index.htmlが、goのサーバのプログラムと同じディレクトリ(".")にいる、と宣言するもの。

http.Handle("/tomo", http.FileServer(http.Dir("./js")))

であれば、https://xxx.xxx/tomo でアクセスできてindex.htmlが、goのサーバのプログラムと同じディレクトリのしたのjs("./js")にいる、と宣言するもの。

2.2. "http.HandleFunc()"は、クライアントがやってくるごにに一つづつ立ち上があるfork()のようなものである→大嘘でした(現在修正検討中) 

具体的には、こちらを読んで頂くと良いと思います。

repeated read on failed websocket connection (一応解決)

要するにwebブラウザ(クライアント)からのアクセスがあれば、この関数がfork()の用に立ち上って、Webブラウザとの面倒を見る。→大嘘でした

面倒見ません。

まず第一に、http.HandleFunc()の誤解がありました。私は、これを、fork()のようにプロセスかスレッドを発生さるものと思っていましたが、これは、一言で言えば、単なるコールバック関数でした。

乱暴に言えば、Webからアクセスがあると、func()というファンクションに吹っ飛ばされる、という現象を発生させる"だけ"で、それ意外のことは何にもしてくれないのです。

これは、index.htmlの内容をクライアントの押しつけるfork()関数と考えれば足る。→大嘘でした

(後で述べるが)これで、

http://localhost:8080 

でアクセスできるようになる

http.ServerFileというのは、実装されているので、わざわざ main.goに書く必要はない。

一方、

http.HandleFunc("/chat", HandleClients)

は、

func HandleClients(w http.ResponseWriter, r *http.Request) { 
    //色々
}

で定義されている、コードをfork()のように立ち上げるものである、と考えれば足る。→大嘘でした(現在修正検討中) 

単にその関数に飛んでいくだけです(但し、ソケット情報を付けてくれます)

"/chat"とは何か?

(後で述べるが)これで、

http://localhost:8080/chat 

でアクセスできるようになる

2.3. "http.ListenAndServe(":8080", nil)"は、「localhost:8080をサーバにするぞ」を実行するものである

上記の関数は、"/"やら、"/chat"やらの(相対的)なパスを指定しているが、これは、サーバのアクセスするアドレスとポートを決定するものである。

err := http.ListenAndServe(":8080", nil)
if err != nil {
	log.Fatal("error starting http server::", err)
	return
}

で、これを宣言することで、サーバとして使えるようになる。

ちなみに、(":8080", nil)の"nil"は、上記のhttp.ServerFile()と、http.HandleFunc()を使うぜ、の意味になる(直接編集することもできるらしい)。

2.4. upgrader.Upgrade(w, r, nil)は、HTTP通信からWebSocket通信に更新してくれるものである

これは"github.com/gorilla/websocket"が提供してくれるもので、HTTP通信(一方通行)からWebSocket通信(相互通行)に更新してくれる便利なものらしい。

websocket, err := upgrader.Upgrade(w, r, nil)
if err != nil {
	log.Fatal("error upgrading GET request to a websocket::", err)
}

こうしてしまえば、websocket.ReadJSON()やら、websocket.WriteHSON()やらが、バカスカ使えるようになる。

2.5. これは何だろう

http.Handle("/static/", http.StripPrefix("/static", http.FileServer(http.Dir("static"))))

まあ、"/static/" は、通信コネクションでいいして、http.StripPrefix("/static", http.FileServer(http.Dir("static")))については、「/static」をhttp.FileServer()が捜索するURLから除く という意味です。

2.6. 乱暴に纏めると

http.HandleFunc()と、http.ListenAndServe()の』2つだけ覚えておけば、いいんじゃない?、と思う。

3. クライアント側の江端の理解

3.1. Dialer構造体のdial関数は、サーバとの接続要求をするものである

一般的にクライアントはWebブラウザなんだけど、これをgolangのプログラムからwebsocketでアクセスしようとする場合は、こんな感じになる。

var addr = flag.String("addr", "0.0.0.0:8080", "http service address")

func bus(bus_num int) {
    var bus BUS

    ///////////// 描画処理ここから ////////////////
    _ = websocket.Upgrader{} // use default options

    flag.Parse()
    log.SetFlags(0)
    u := url.URL{Scheme: "ws", Host: *addr, Path: "/echo2"}
    log.Printf("connecting to %s", u.String())

    c, _, err := websocket.DefaultDialer.Dial(u.String(), nil)
    if err != nil {
        log.Fatal("dial:", err)
    }
    defer c.Close()

まず、グローバルで、以下のようにサーバを場所を書いておく。

var addr = flag.String("addr", "0.0.0.0:8080", "http service address")

(よく分からないんだけど)以下のような書き方でwebsocket(のインスタンス?)が作れるらしい。

 _ = websocket.Upgrader{} // use default options

以下で、/echo2を使うぜ、の宣言

    u := url.URL{Scheme: "ws", Host: *addr, Path: "/echo2"}

で、以下で、websocket用のソケットができるらしい。

    c, _, err := websocket.DefaultDialer.Dial(u.String(), nil)

この後はc.ReadJSON()やら、c.WriteJSON()やらを使い倒す、ことができるようになります。

4. 江端の理解 その他について

4.1. flag.Parse()って何?

var addr = flag.String("addr", "0.0.0.0:8080", "http service address")

を"固定するもの"でいいのかな? → 間違っています。→ golang でコマンドライン引数を使う

4.2. log.SetFlags(0)って何?

import "log"
で、logを使う場合に、logの設定をリセットするもの、で良さそうです。

以上

内容間違っていたら、優しくご指摘下さい。

 

 

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

最近、読者の方からメールを頂きます。

Recently, I received emails from readers.

多くの場合は、礼儀正しいメールで、嬉しいです(ファンレターが多い)。

Often it's a polite email, and I'm happy to receive it (often fan letters).

ただ、私のコラムに反論する人の中には、「失礼な人」がいます。

However, some of the people who argue with the content of my column are "rude".

-----

私に意見(反論)を行う以上、「立証責任の原則(*1~4)」くらいは守って欲しいです。

As long as you are giving me an opinion (rebuttal), I would like you to at least observe the "principle of burden of proof (*1-4)".

(*1)https://www.kobore.net/diary/?date=20160614

(*2)https://www.kobore.net/diary/?date=20180515

(*3)https://www.kobore.net/diary/?date=20191002

(*4)https://www.kobore.net/diary/?date=20201112

特に、『江端さんのXXXという意見には賛成できません。○○を調べてみて下さい』という数行のメールが、私を激怒させています。

In particular, 'I do not agree with Mr. Ebata's opinion of XXX. Please look into XXX.' A few lines of the e-mail infuriated me.

何度も言います。

I will say it again and again.

『私が、私(江端)の意見を否定する論を作るために、なぜ、私(江端)が汗をかかなればならないのですか?』

"Why should I (Ebata) sweat to make an argument that I (Ebata) disagree with?"

-----

あなたが、私(江端)の論に反論するのであれば、

If you are going to refute my (Ebata's) argument, then

(1)あなたが自力で仮説(江端に論対する反論)を立て、

(1) You formulate a hypothesis (a counterargument to Ebata's argument) on your own, and

(2)あなたが自力で調査し、

(2) You investigate on your own, and

(3)あなたが自力で出典を明らかにして、

(3) You identify the source on your own, and

(4)あなたが自力でデータ収集・分析・解析をして、

(4) You collect, analyze, and analyze the data on your own.

(5)あなたの仮説(江端の論に対する反論)が採用される(棄却されない)旨の論を自力で展開して、

(5) You develop an argument on your own to the effect that your hypothesis (refutation of Ebata's argument) is adopted (not rejected), and

(6)上記(1)~(5)の全てを、あなた自身の言葉で記載する

(6) You describe all of the above (1)-(5) in your own words

このプロセスの全てがメールに記載されていることをもって、「立証責任の原則」が満たされた、と、私は判断します。

I would judge that the "Burden of Proof Principle" has been met, with all of this process being described in the email.

少なくとも、最後の『あなた自身の言葉で記載する』は、絶対です。

At least the last one, 'describe in your own words', is absolute.

-----

私はコラムを執筆する時に、膨大な時間と頭とお金(自腹)を使い、多くの人の協力を得ています。

I spend an enormous amount of time, head and money (my own money) when I write my columns, and I have the cooperation of many people.

私に意見(反論)を試みる方に対して、私は、同程度のコスト(負荷)を要求します。

I demand the same level of cost (load) for those who attempt to give me an opinion (rebuttal).

物量的に言えば「最低でも50行以下のメールということはないだろう」という感じです。

In terms of quantity, it's like, "At the very least, it's not going to be less than 50 lines of mail.

その他、コラムに記載していないメールアドレスを使って、連絡を取ってくる人は、論外です。

Other people who contact you using an e-mail address not listed in the column are out of line.

-----

この程度の礼節は、形式的であったとしても、守って下さい。

Please observe this level of civility, however formal it may be.

私は、いきなり、私を『勉強不足』呼ばわりする人と、コミュニケーションする意思も時間もありません。

I have neither the will nor the time to communicate with someone who suddenly calls me 'unlearned'.

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

私、今年度、幸運なことに、国際学会で論文賞を頂くことができました。

I was fortunate to receive a best paper award at an international conference this year.

今でも、『騙されているのでないか』と疑うほどの幸運です。

I am so lucky that even now I wonder, 'Were I being cheated?

正直、論文賞どころか、採択すらされないだろう、と思っていたくらいです。

To be honest, I even thought that the paper would not even be accepted, let alone win the best paper award.

というのは、私、この論文、私がいつも書いているようなコラムのノリで執筆したからです。

This is because I wrote this paper in the same style of the columns I usually write.

-----

つまり、怒りや、不満や、後悔や、そして現場で立て続けに発生する不具合、文句、クレームなどを ―― 、赤裸々に 、しかし、論文の体裁を越えない範囲で ―― 書き殴ったものだからです。

In other words, it is a bare-bones description of anger, frustration, regret, problems, complaints, and claims that keep cropping up in the field, without going beyond the style of a thesis statement.

一言で言えば『フィールド(野外)での実証実験の地雷原一覧』のようなもので、『軽々しく"実証実験"を口にする人々』に対する、抗議の集大成のような論文でした。

In a nutshell, the paper was like a "list of minefields for field trials," and was the culmination of a protest against "those who talk about 'field trials' so casually".

今になって思えば、

In hindsight, I think,

―― そこがウケたのかな?

"Was that what they liked about it?"

と思っています。

論文査読者は、フィールド実証実験で『地獄』を見たことのある人だったのかもしれません。

The paper reviewer may have been someone who had seen 'hell' in a field trial.

そのような方であれば、「内容の精査の前に、感情的に、アクセプト(採択)してしまった」という可能性はあります。

If they are such persons, it is possible that they may have "emotionally accepted (adopted) the paper before examining the content carefully".

私がレビューアなら、そうします(断言)。

If I were a reviewer, I would do so(I assure you).

という訳で、あなたが研究員であれば、『感情を、前面かつ全面に押し出す論文』というのを、一度、試みることをお勧めします。

Therefore, if you are a researcher, I recommend that you try to write a paper that puts emotion not only front but also all.

-----

で、できれば、日本語以外での言語での執筆をお勧めします。

If possible, I strongly recommend writing in a language other than Japanese.

『国内での各所からのツッコミが少なくなる』ことは、経験的に知っています。

I know from experience that there will be fewer claims from various parts of the domestic.

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

PrumeClusterは、Leafletをベースとして動く、スケーラブルオブジェクトビューアです。1万オブジェクトくらいなら軽く表示できます。

しかし、PrumeClusterは、クライアントのブラウザの中にアイコンのオブジェクトを直接作るので、基本的にはサーバとして使うことができません。クライアントとして使うものであて、描画画面は、常に"1つ"です。

で、私が作ったPrumeMobileもベースは、PrumeClusterなので、サーバとして使うことはできないのですが ―― 今週末、Vue.jpとかでスマホクライアント作ろうかと思ったのですが ――『もう新しいこと覚えるのは嫌だ』と思い知り、PrumeMobileのサーバ化を試みています ――ひとえに、考えうる限り、手を抜きたい、という一心からです。

複数のJavaScriptに対して、PrumeClusterがメッセージをブロードキャスト送付してくれるのか、くれないのか、明日調べよう。

 

 

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

私は夜が遅いですが、朝も遅いです。

I am a late night person, but I am also a late morning person.

私が起きてくる時には、家の中には誰もいないことがほとんどです。

Most of the time when I wake up, there is no one in the house.

-----

先日、連続して3日間、嫁さんのベッドの読書灯がつけっぱなしでした。

The other day, the reading light in my wife's bed was left on for three days in a row.

読書灯が消えていた日は、クローゼットの電灯がつけっぱなしでした。

On days when the reading light was off, the closet light was left on.

これ、何かの示唆? 暗喩? 暗号?

Is this an indication of something? A metaphor? A code?

―― 何か、マズいことしたっけ?

"Did I do something wrong?"

と、青冷めてきました。

I was getting blue cold.

何気ない風を装い、嫁さんに尋ねてみたところ、『単なる消し忘れが続いただけ』だそうです。

I pretended to be casual and asked my wife about it, and she said, 'I just kept forgetting to turn it off.

-----

ところで、これ、信じていいんですよね?

By the way, I believe this, don't I?

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

最近"https"縛りがきつくて、ローカルのindex.htmlを叩くだけでは、画面が出てこなくなりました。正直、面倒くさいなぁ、と思っています。

こちらは、表示画面でブラウザを使いたいだけなのに、ブラウザ(特にchrome)が煩いことこの上もない

これも時代の流れか、と諦めて、index.htmlを書いているディレクトリの内容で、サクッとサーバを立てる方法を、色々やってみましたので、メモを残しておきます。

まず、node.jsをインストールしてnpmを使えるようにしておきます。

面倒なので、私の環境に合わせて説明しますね(このディレクトリを隠す人、多いですけど、はっきり言って読み難い上に、あまり意味ない(外部から、ディレクトリに入れるところまでハックされたら、何をしても無駄))

という訳で、私の作業ディレクトリは、ここ→ ~/kese/leaflet です。

$ npm install -g http-server
$ http-server

と、これだけで、

ebata@DESKTOP-P6KREM0 MINGW64 ~/kese/leaflet
$ http-server
Starting up http-server, serving ./
http-server version: 14.1.0
http-server settings:
CORS: disabled
Cache: 3600 seconds
Connection Timeout: 120 seconds
Directory Listings: visible
AutoIndex: visible
Serve GZIP Files: false
Serve Brotli Files: false
Default File Extension: none
Available on:
  http://192.168.0.8:8080
  http://127.0.0.1:8080
  http://172.28.64.1:8080
  http://172.21.112.1:8080
Hit CTRL-C to stop the server
と、即、Web(http)サーバが立ち上がります。
が、当然これだと、https://localhost:8081 などは使えないので、公開鍵を作る必要があります。
まず、mkcertで、オレオレ証明書を作ります。
ちなみに、ちゃんとアプリを作ろうとする人は、mkcert では問題が発生しますので、注意です。

iPhoneは「オレオレ証明書」では騙せないのかな?

Let's encrypt を試してみた件(整理は明日)

mkcertの入手方法ですが、https://github.com/FiloSottile/mkcertを除いてみたら、バイナリがダウンロードできそうことが分かりました。

でもって、ここから、Windows10で使えそうなバイナリをダウンロードしました。

ダウンロードしたところから、直接叩いてみたら、C:\Users\Ebata\AppData\Local\mkcert の中に、鍵ができていましたが、最初に、mkcer -installしろ、と言われています。

本当はmkcertにリネームした方が良いのでしょうが、面倒なので、そのまま mkcert-v1.4.1-windows-amd64.exe -install を強行しました。
その後、mkcert-v1.4.1-windows-amd64.exe localhost 127.0.0.1 と入力すると、"localhost" と "127.0.0.1"を含む鍵が、カレントディレクトリにできるようです。

で、"localhost+1-key.pem"を "key.pem"とリネームして、"localhost+1.pem"を"cert.pem"とリネームして、~/kese/leafletに放り込みます。

そんでもって、~/kese/leaflet から

$ http-server -S -C cert.pem -o -p 8081

とすると、https 対応のサーバが立ち上がります。

ebata@DESKTOP-P6KREM0 MINGW64 ~/kese/leaflet
$ http-server -S -C cert.pem -o -p 8081
Starting up http-server, serving ./ through https
http-server version: 14.1.0
http-server settings:
CORS: disabled
Cache: 3600 seconds
Connection Timeout: 120 seconds
Directory Listings: visible
AutoIndex: visible
Serve GZIP Files: false
Serve Brotli Files: false
Default File Extension: none
Available on:
  https://192.168.0.8:8081
  https://127.0.0.1:8081
  https://172.28.64.1:8081
  https://172.21.112.1:8081
Hit CTRL-C to stop the server
Open: https://127.0.0.1:8081
 あと、CORSで、問題が発生したら、
$ http-server -cors -S -C cert.pem -o -p 8081
で、何とかなるかもしれません。
https://localhost:8081/
で、やっと出てきてくれました。

index.htmlは以下の通りです。
<!DOCTYPE html>
<html lang="ja">
<head>
  <meta charset="utf-8">
  <title>Open Street Map Test</title>
  <style type="text/css">
    html,body{ margin: 0px; }
  </style>
  <!--
  <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
  -->

  
  
  <script type="text/javascript" src="https://code.jquery.com/jquery-2.2.1.min.js"></script>
  <script type="text/javascript" src="https://openlayers.org/api/2.13.1/OpenLayers.js"></script>


  <script type="text/javascript">
    // グーローバル変数の定義 
    var od;
    var des_lonlat;
    var arr_lonlat;
  </script>

  <script>
    function MapInit(){
 
      map = new OpenLayers.Map("MapCanvas");

      var mapnik = new OpenLayers.Layer.OSM();
      map.addLayer(mapnik);
    
      //var lonLat = new OpenLayers.LonLat(139.47552, 35.59857)
      var lonLat = new OpenLayers.LonLat(139.796182, 35.654285)
        .transform(
          new OpenLayers.Projection("EPSG:4326"), 
          new OpenLayers.Projection("EPSG:900913")
        );
      map.setCenter(lonLat, 17); 

      OpenLayers.Control.Click = OpenLayers.Class(OpenLayers.Control, {
        initialize: function(options) {
          this.handler = new OpenLayers.Handler.Click(
            this, {
              'click': this.onClick
            }, this.handlerOptions
          );
        }, 

        onClick: function(e) {
          var lonlat = map.getLonLatFromPixel(e.xy);
          lonlat.transform(
            new OpenLayers.Projection("EPSG:900913"), 
            new OpenLayers.Projection("EPSG:4326")
          );

          var markers = new OpenLayers.Layer.Markers("Markers");
          map.addLayer(markers);
          var marker = new OpenLayers.Marker(
            new OpenLayers.LonLat(lonlat.lon, lonlat.lat)
            .transform(
              new OpenLayers.Projection("EPSG:4326"), 
              new OpenLayers.Projection("EPSG:900913")
            )
          );
          markers.addMarker(marker);
          $("#LonLat").html("lon:" +lonlat.lon+ "  lat:" +lonlat.lat);

          if (od == "arrival"){
            arr_lonlat = lonlat;
            alert("arr_lonlatが設定されました" +  arr_lonlat.lon +" " + arr_lonlat.lat);
          } else if (od == "destination"){
            des_lonlat = lonlat;
            alert("des_lonlatが設定されました" +  des_lonlat.lon +" " + des_lonlat.lat);
          }
        }
      });

      var click = new OpenLayers.Control.Click();
      map.addControl(click);
      click.activate();
    }
  </script>

<script type="text/javascript">
    $(document).ready(function () {
    $("#button01").on('click', function () {
      od = "destination";
      alert(od + "  ボタン1がクリックされました。");
    });
    $("#button02").on('click', function () {
      od = "arrival";
      alert(od + "  ボタン2がクリックされました。");      
    });
    $("#button03").on('click', function () {
      od = "confirmed"
      alert(od + "  ボタン3がクリックされました。");
      // 
    });

  })
</script>


</head>

<body>
  <div id="MapCanvas" style="width:700px;height:700px;"></div>
  <div id="LonLat"></div>
  <input id="button01" type="button" value="Button1"/>
  <input id="button02" type="button" value="Button2" />
  <input id="button03" type="button" value="Button3" />

  <script type="text/javascript">MapInit();</script>



</body>

</html>

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

米国の前大統領、トランプ大統領に関して、日本のマスコミは、連日、

With regard to the former U.S. President, President Trump, the Japanese media has been reporting the following news day after day.

―― 明日にでもトランプ大統領が罷免・弾劾される

"President Trump will be removed from office and impeached tomorrow"

てなニュースを流し続けていました。

結局、彼は罷免も弾劾もされず、司法による起訴もされていません(民事に関しては知らんが)。

After all, he has not been removed from office, impeached, or prosecuted by the judiciary (Though I don't know about the civil trial).

つまり、日本のマスコミが流していたニュースは、ことごとく、的を外していた ―― というよりは、

In other words, the news that the Japanese press was spreading was, at every turn, missing the point -- or rather,

『日本人にウケの良いニュースを流し続けていた』

"They kept on releasing news that was popular with the Japanese"

ということのようです。

なぜなら、トランプ大統領は、日本人(私を含み)に、評判良くなかったですから。

Because President Trump was not well-received by the Japanese people (including myself).

ちなみに、マスコミが、これらのニュースの内容や結果に対して『自己批判をした』という話は、寡聞にして知りません。

Incidentally, I don't know of any story of the media 'self-criticism' of the content or results of these news items.

-----

ですので、今回の、ロシアによるウクライナ侵攻についても、『日本人にウケの良いニュースを、優先的に流し続けているかもしれない』と考えておいた方が良いかもしれません。

Therefore, it may be a good idea to consider that "news that is popular with the Japanese people may continue to be broadcast on a priority basis" with regard to the Russian invasion of Ukraine.

特に、「ウクライナ軍優勢」の話は、特に注意した方が良いと思います。

In particular, we should pay special attention to the "Ukrainian military superiority" story.

そのニュースは、私たち日本人に「ウケが良い」からです。

This is because the news is "popular" among us Japanese.

-----

私は、後で恥をかくのが嫌いなので、あまり政治的な発言はしないようにしています。

I try not to make too many political statements because I don't like to be embarrassed later.

政治的な発言をすると決めるときは、後になって他人のせい(例:ネットニュース等)にすることがないように、自分なりの判断基準を決めておきます。

When I decide to make a political statement, I set my own criteria so that I do not later blame others (e.g., Internet news, etc.) for my decision.

自分なりの判断基準とは、例えば、利己主義とか、あるいはニュースソースの発信場所の比較です。

もし、あなたの人道主義に訴えないのであれば、私は、あなたの利己主義に訴えます:ウクライナ市民の未来は、Leafletの未来です

My own criteria are, for example, self-interest or a comparison of where the news source originates.

-----

『BS世界のドキュメンタリー「女王とクーデター」』を見ました。

I watched "BS World Documentary 'The Queen and the Coup'".

めちゃくちゃ面白かったです。

It was so much fun.

米国政府が、英国政府に黙って『エリザベス2世の名前を使って、当時のパーレビ国王の国外脱出を思い留まらせた』という陰謀が、丁寧に説明されていました。

The conspiracy, in which the U.S. government, without telling the British government, "used the name of Elizabeth II to discourage the then King Pahlavi from fleeing the country," was carefully explained.

政敵を倒す為に、賄賂を使って、偽情報(今で言うとこのフェイクニュース)をバラまくという話などが満載で、『映画より面白い』と思いました。

I thought it was 'more interesting than the movie' because it was full of stories about bribes and spreading disinformation (now called this fake news) in order to defeat political opponents.

-----

米国のインテリジェンスによる国家転覆の話は、パっと思い出せるものでは、グアテマラ、キューバ、チリ、ニカラグアがあります。

Stories of state overthrow by U.S. intelligence that I can quickly recall include Guatemala, Cuba, Chile, and Nicaragua.

ベトナムの軍事侵攻で派手に転けてから、米国は表立っては、軍事侵攻はやらず(思い出したようにやっていますが(例 湾岸戦争、イラク戦争))、基本的には、インテリジェンスで、近隣国家に、ちょっかいをかけ続けています。

Since its spectacular military invasion of Vietnam, the U.S. has not overtly launched military invasions (although it does so when it remembers (e.g., the Gulf War and Iraq War)), but has basically continued to meddle with neighboring countries through intelligence.

ロシアだって、相当な規模と能力を持つインテリジェンスを持っているだろうし、サイバー攻撃では世界トップクラスでしょう。

Even Russia would have intelligence of considerable size and capability, and would be one of the best in the world at cyber intrusion.

ですから、

So I think,

―― 何やってんだ?

"What is Russia doing?"

と思います。

インテリジェンスでもサイバー攻撃もやらずに、いきなり他国に武力で流れ込んだのだとしたら ―― もう文句のつけようのないほどの『バカ』だと思います。

If they suddenly flowed into another country by force of arms without doing any intelligence or cyber attacks -- I think they are now unquestionably 'stupid'.

多分、試みたけど、上手くいかなったのかな、と思っています。

Maybe they tried, but it didn't work out, I think.

-----

『1940年のヨーロッパの戦争映画』のような酷い風景や人々の境遇を、2022年の現在に再現する―― その前世代的なアプローチに、私は、心底うんざりして、腹を立てています。

I am truly disgusted and offended by the pre-generational approach of recreating the terrible landscapes and conditions of people in the present day, in 2022, as in "European war movies of 1940."

あの「無礼な後輩」が、言っていましたが、

As that "rude junior" said...

―― 『宇宙戦争』とまでは言わないまでも、『サイバー戦争』くらいのことが、できんかったのか

"Couldn't they have done something more like "cyber warfare", if not "space warfare"?"

本当にその通りだと思いました。

I do agree with him.