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

くだんの「轢断のシバタ先生」から、くだんの「衝撃のメール」を頂いた時から、一年が経過しました。

It's been a year since I received that shocking email from my "Dr. Shibata of the Run-Over".

あのメールを読んだのが、日帰り一人スキーのスキー場のロッジで、ランチを食べている時でした。

I was eating lunch at the lodge of a ski resort for a one-day solo skiing trip when I read that e-mail.

夢中で読み続けて、スプーンからおかずを落としたことに気がつかないくらいでした。

I was so engrossed in reading that I didn't even notice that I dropped a side dish from my spoon.

私にとっては、あのメールが、「新型コロナ」と関わるターニングポイントとなりました。

For me, that e-mail was the turning point in my involvement with the "new Corona".

-----

なんか、日々のニュースに追い立てられる感じで、全体像がぼやけてきている気がしますので、新型コロナに関する大きな動きを、月単位で纏めてみました。

I feel like I'm being overwhelmed by the daily news, and the whole picture is getting blurry. So, here is a monthly summary of the major developments related to the new Corona.

2019/12 中国武漢で原因不明の肺炎患者の発生

2019/12 Outbreak of pneumonia patients with unknown cause in Wuhan, China

2020/01

2020/01

2020/02 ダイヤモンド・プリンセス号事件、小中高休校要請

2020/02 Diamond Princess incident, request to close elementary, junior high and high schools

2020/03 WHOパンデミック宣言、マスク騒動

2020/03 WHO Pandemic Declaration, Mask Riots

2020/04 緊急事態宣言発令

2020/04 Emergency Declaration Order

2020/05 緊急事態宣言延長→解除

2020/05 Emergency declaration extended→released

2020/06 移動自粛要請解除、新規感染者100人越え(国内(×東京都))

2020/06 Request for voluntary restraint on movement lifted, over 100 newly infected (Japan (not only Tokyo))

2020/07 「Go Toトラベル」キャンペーン開始、新規感染者1000人越え(国内(×東京都))

2020/07 "Go To Travel" campaign started, more than 1,000 newly infected people (domestic (not only Tokyo))

2020/08

2020/08

2020/09

2020/09

2020/10 「Go Toトラベル」東京を追加

2020/10 "Go To Travel" Tokyo added.

2020/11 "Go To"札幌・大阪停止、東京都、飲食店時短要請再開

2020/11 "Go To" Sapporo and Osaka suspended; Tokyo Metropolitan Government resumes request for shorter hours at restaurants.

2020/12 医療体制が逼迫、ファイザーワクチン申請、変異株国内発見

2020/12 Healthcare system strained, Pfizer vaccine application filed, mutant strain found in Japan

2021/01 緊急事態宣言再発令、「Go Toトラベル」全面停止

2021/01 Recurrence of emergency declaration, complete suspension of "Go To Travel".

2021/02 緊急事態宣言延長、ワクチン接種開始

2021/02 Emergency declaration extended, vaccination started

2021/03 緊急事態宣言解除

2021/03 Emergency declaration lifted

-----

こうやって俯瞰してみると、2020年の1月と、8~9月に、大きな動きがなかったことが分かります。

Looking at it this way, we can see that there was no significant movement in January and August-September of 2020.

そして、1月の"油断"のツケを4~5月に、8~9月の"甘い見積り"のツケを11~12月に支払っていることが明白です。

And it is clear that the "carelessness" of January is being paid for in April and May, and the "loose estimates" of August and September are being paid for in November and December.

しかし、政府の対応は、システム屋の私から見れば、概ね妥当です。

However, the government's response is generally reasonable from my point of view as a system engineer.

スイッチのON/OFFを行いながら、系(システム)の全滅を防ぐのは、自宅のクーラー、産業用ロボット、交通管制システムに至るまで、制御システムの基本です。

Preventing the annihilation of a system while switching it on and off is the basis of control systems, from home air conditioners to industrial robots to traffic control systems.

そして、国家というのは国民というシステム要素からなる巨大システムです。

And a nation is a huge system made up of system elements called "citizens".

-----

2月17日から本日までのワクチン接種者(1回目)の最大は人数は、7万人/日です。

The maximum number of people vaccinated (1st dose) from Feb. 17 to today is 70,000/day.

これを、"3倍"程度まで増やせる(1日20万人)として、1億2600万人の一回目接種が完了するのに必要な日数は、630日、21ヶ月、1年9ヶ月必要です。

Assuming that this number can be increased to "triple" (200,000 people per day), the number of days required to complete the first round of vaccination for 126 million people would be 630 days, 21 months, or 1 year and 9 months.

ちなみに、政府は"6倍"と見積っているようです。『高齢者約3600万人の接種を、2カ月と3週間の完了』ということから、3600÷83日= = 43.3万人となるからです。

Incidentally, the government seems to be estimating a six-fold increase. This is because "the vaccination of 36 million elderly people will be completed in 2 months and 3 weeks", which means 3600/83 days = 433,000 people.

米国では200万人/日になっているようですので、もっとペースは上がるかもしれません。

In the U.S., it seems to be 2 million people/day, so the pace may be even higher.

----

年内の、国民の全員(希望者のみ)第1回のワクチン接種は可能かもしれませんが ――

It may be possible to vaccinate the entire population (only those who wish to be vaccinated) with the first vaccine before the end of the year, but--

オリンピックに間に合わないことだけは確実です。

The only thing we can be sure of is that we won't make it to the Tokyo Olympics.

-----

今回の緊急事態宣言の解除"OFF"のリバウンドが、いつ、どこに、やってくるのか。

When and where will the rebound from the "off" of the emergency declaration come?

こればかりは、誰にも分かりません。

No one can know this much.

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

https://www.meti.go.jp/meti_lib/report/H30FY/000677.pdf

 

マイクロトランジッド

 

Chariot (サンフランシスコ周辺など)
• フォードが買収した通勤者向けの乗合バスサービス
• 利用者数に基づく柔軟なルート設定に特徴
• 14人乗りのシャトルバスを利用し、1日当たり100を超える路線
でサービス提供
出所: Tech Crunch, Chariot
Via (ニューヨーク、ワシントン、シカゴ 等)
• 乗客と車両の座席とをリアルタイムに関連づけ、同一ルートで
移動できる乗客をグループ化して配車する乗合バスサービス
• 車両の最適なルートに合わせて、利用者の乗降車スポットを
自動的に指定する仕組み
• テキサス州アーリントン市と提携。市の補助で運賃3ドルで運行

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

コールバックを作ることは、そんなに難しくないんですよ。同じ言語でしたらね。

It's not that difficult to create a callback. As long as it's in the same language.

でもね、GOとC++の間で共通するトリガーイベントを作る方法が ―― 今日、一日、世界中を探し回ったんですけど ―― 見つけられないんですよ。

But you know, I can't find a way to make trigger events common between GO and C++ -- I've been looking all over the world today -- and I can't find it.

ならば、UDPとかTCPとかで待ち受けすれば良い、と。うん、まあ、それは分かるのですけどね。実際にライブラリも作っちゃったし。

So, why don't I just use UDP or TCP to listen in? Yeah, well, I understand that. I've actually made a library for it.

でもね、稼動オブジェクト1万個を同時に接続するUDPなんぞをやったら、一瞬でソケットリソースが使い尽されてしまうでしょう。実際、先月、これでプログラムを落したし。

But I know, if I do a UDP connection with 10,000 active objects at the same time, I'll run out of socket resources in an instant. In fact, I had a program go down last month because of this.

で、一番いいのが、GOのチャネルを使う方法なんですけど、これを、C++に連携させる方法が ―― ない。

So, the best way to do this is to use the GO channel, but there is no way to link this to C++.

GOのライブラリをリンクしたC++のライブラリをリンクした、GOプログラムを動かせればいいんだけど、昨日の試作では、ことごとく失敗した訳です。

It would be nice to be able to run a GO program with a C++ library linked to the GO library, but yesterday's prototype failed at every step.

もちろん、ポーリングすればいいだけのことですよ。サンプリング1秒でも、大した負荷にはならないでしょう。

Of course, I will use "polling" methods. One second of sampling won't be much of a load.

でも、それって『かっこ悪い』よね?

But that's not 'cool', is it?

プログラムのコールをどう実装しようが、私以外の人は知り得ないことですよ ―― でも、『この私』が納得していないんです。

No one but me can know how to implement the calls in the program -- but 'I' am not convinced.

ここ重要です。

This is important.

-----

という訳で、昨日は、朝から深夜に至るまで、この機能を実現する為に、頭を抱え続けて、そして失敗しました。

So yesterday, from morning till late at night, I kept trying to figure out how to make this work, and I failed.

今日は、仕上げなければならない論文ドラフトがあるので、この問題を考えることは一旦中止します。

I have a draft paper I need to finish today, so I will stop thinking about this issue for now.

悔しいので、メモだけ残しておいて、後日の復讐戦に備えます。

It's frustrating, so I'll just leave a note and prepare for the revenge battle later.

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

GO 1.5 と C++ を SWIG でブリッジさせる方法

を試してみたのですが、私は上手く動かすことができませんでした。

で、こんな風にしてみたら動いたので、記録を残しておきます。

ebata@DESKTOP-P6KREM0 MINGW64 ~/kese/swig
$ tree
.
├── main1.go
└── sc1
    ├── nop.go
    ├── sc1.h
    └── sc1.swigcxx

1 directory, 4 files
// main1.go

package main

import (
	"fmt"

	"./sc1"
)

func Dump(p interface{}) {
	fmt.Printf("%v:%T\n", p, p)
}

func main() {
	Dump(sc1.EchoIntN(8))
	Dump(sc1.EchoDoubleN(9))
}

でもって、nop.go

package sc1

sc1.h

#pragma once 

inline  int
EchoIntN( int p ) {
    return p;
}

inline  double
EchoDoubleN( double p ) {
    return p;
}

sc1.swigcxx

%module sc1
%{
#include    "sc1.h"
%}

%include    "sc1.h"

ちなみに、sc1.hのインラインをやめて、sc1.hとsc1.cに分けて実施したら、こうなった

$ go build main1.go
# _/C_/Users/ebata/kese/swig2/sc1
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.2.0/../../../../x86_64-w6
4-mingw32/bin/ld.exe: $WORK\b002\_x004.o:/tmp/go-build/sc1_wrap.cxx:279: undefin
ed reference to `EchoIntN(int)'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.2.0/../../../../x86_64-w6
4-mingw32/bin/ld.exe: $WORK\b002\_x004.o:/tmp/go-build/sc1_wrap.cxx:292: undefin
ed reference to `EchoDoubleN(double)'
collect2.exe: error: ld returned 1 exit status

ずいぶん悩んだが、もしかしたらと思い、sc1.c → sc1.cpp   にリネームしたら、あっさり通った

sc1.hは以下の通り

#pragma once 

int EchoIntN(int);

double EchoDoubleN(double);

sc1.cppは以下の通り

//#pragma once
#include "sc1.h"

int EchoIntN( int p ) {
    return p;
}

double EchoDoubleN( double p ) {
    return p;
}

以上

 

 

 

 

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

C 言語から GO 言語の関数を呼ぶ方法

を参考にさせて頂いて、実験中です。

大変申し訳ありませんが、ほぼ丸パクりさせて下さい。これから、頻繁に見る必要があり、万一ページがexpiredされたら青冷めますので。

hoge.goというファイル名のPrintHoge関数を C 言語から呼べるようにします。

  1. Cをインポートする
  2. C 言語から呼びたい関数に//export XXXXを書く (普通、//とするとコメントなんだけどなぁ)
  3. コンパイルする
package main

import (
    "C"
    "fmt"
)

//export PrintHoge
func PrintHoge() {
    fmt.Println("hoge")
}

func main() {}

main関数がないとエラーになるので、空で良いので書いておきます。

-buildmode=c-archiveオプションをつけてgo buildします。

$ go build -buildmode=c-archive hoge.go

すると、hoge.aアーカイブとhoge.hヘッダが生成されます。

生成されたヘッダをインクルードして、Go 言語の関数を呼びます。

#include <stdio.h>
#include "hoge.h"

int main() {
    PrintHoge();
    return 0;    
}

生成されたアーカイブと一緒にコンパイルします。

$ gcc -o hoge hoge.a main.c

ところが、

$ gcc -o hoge hoge.a main.c
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.2.0/../../../../x86_64-w6
4-mingw32/bin/ld.exe: C:\Users\ebata\AppData\Local\Temp\cc1F3Mbe.o:main.c:(.text
+0xe): undefined reference to `PrintHoge'
collect2.exe: error: ld returned 1 exit status

が出てきて、「変だなー」と思いつつ、色々調べてみたのですが、hoge.aを一番最後にしたら、動きました。

$ gcc -o hoge main.c hoge.a
$ ./hoge
hoge
以上

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

Go言語をVSCodeを使ってデバッグをしようとするとすると以下のメッセージが出てきて、困っていました。

"Failed to continue: Check the debug console for details."

が消えなくて、困っていたのですが、

// +build ignore
package main

の "// +build ignore"を消したら、消えました。

 

 

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

BS世界のドキュメンタリー「ヒトラーの子どもたち」を見ました。

I watched the BS World Documentary "Hitler's Children".

一言で言えば、「特定人種(アーリア民族)の子ども量産計画」です。

In a word, it is a "plan to mass-produce children of a specific race (Aryan race).

かの独裁者の理念『第三帝国の千年王国』に基づく(特定民族の絶滅計画と同時に実施された)計画の一つです。

This is one of the plans (implemented at the same time as the plan for the extermination of certain ethnic groups) based on the dictator's idea of the "Thousand Year Kingdom of the Third Reich.

-----

かなり前に、このようなイラストを描きましたが、その番組では、本当にこのイラストそっくりの映像が出てきて、軽い嘔吐感を覚えました。

A long time ago, I drew an illustration like this one, and in that program, I really saw an image that looked exactly like this illustration, which made me feel mildly nauseous.

もちろん、1940年の当時は、「試験管ベイビー」も「クローン」の技術もありませんでした。

Of course, back in 1940, there were no "test tube babies" or "cloning" technology.

ですので、、生身の男女を生殖させる場所「レーベンスボルン(生命の泉)」をドイツ国内、そしてフランスに設けて、子どもを「生産」していました。

Therefore, "Ravensborn" (fountain of life) were established in Germany and France to "produce" children, where reproduction took place between living men and women.

-----

日本でも、戦前・戦中の出産数は多いです。

In Japan, the number of births before and during the war is also high.

衛生、社会インフラ、医療技術で死亡リスクが高く、また、「富国強兵」の観点から、出産が「産めよ、殖やせよ」と国策的に奨励されていたことが要因です。

This was due to the high risk of mortality in terms of sanitation, social infrastructure, and medical technology, as well as the fact that childbirth was encouraged by national policy to "give birth and reproduce" from the perspective of a "wealthy nation with a strong military.

『平均5児以上をもうける』("平均"というところが凄い)

"Have an average of five or more children" (the "average" part is amazing)

という、現在では「夢物語か?」というようなことが政策として組込まれ、そして、律儀な日本国民は、これを達成していました。

"Is this a pipe dream?" of today, was incorporated as a policy, and the Japanese people, who were disciplined, had accomplished this.

そして、当時の政府は、多子家庭に対しての優遇策を、無子家庭や独身者には冷遇策を課していました。

And the government at that time imposed preferential treatment for families with many children, and cold treatment for families with no children and single people.

-----

正直、「レーベンスボルン(生命の泉)」も「産めよ、殖やせよ」も、私はゴメンです。

To be honest, I like neither "Ravensborn" (the fountain of life) nor "Give birth, breed.

「国家権力の圧力で、子どもを量産する社会」なんぞを目にするくらいなら ――

I don't want to see a society that mass-produces children under the pressure of state power.

「個人の自由意志で、少子高齢化で朽ちていく国家」に立合い続ける方が、私はいいです。

I would rather continue to watch the nation decay with declining birthrates and aging population at the free will of individuals.

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

今日は、長女の卒業式ですが、保護者は会場に入れませんでしたので、近くの公園で写真撮影をしました。

Today is my senior daughter's graduation ceremony, but parents were not allowed in the hall, so we took pictures at a nearby park.

次女が、袴で装った長女とその家族を写した枚数は、現時点で確認されているだけで、251枚です。

The junior daughter took 251 photos of the senior daughter dressed in hakama and her family dressed as of now.

-----

私が、30年前に、20日間、中国大陸を放浪した時の写真は、フイルム6巻、合計 96枚

When I wandered around mainland China for 20 days 30 years ago, I took 6 rolls of film with a total of 96 photos.

15日間、ネパールとインドを移動していた時の枚数も、ほぼ同数でした。

The number of picture during the 15 days I was traveling between Nepal and India was almost the same.

私の35日間分の写真枚数(約200枚)を、次女は、1時間弱で軽く越えました。

In less than an hour, my junior daughter took more photos than I did in 35 days (about 200).

-----

空港のセキュリティチェックでX線によってフィルムが感光するのを防ぐために、これらのフィルムは鉛入りの袋に入れて運びました。

In order to prevent the film from being sensitized by x-ray rays at airport security checks, these films were packed in leaded bags and transported.

当時の中国では、写真撮影をする場所(軍事施設の近くとか)にも、随分気を使ったものです(今も、かもしれませんが)

In China at that time, I was very careful about where I took photos (near military facilities, etc.) (although this may still be the case).

-----

今では、膨大な写真の中から、手元に残す「ベストショット」を選ぶ作業が大変そうです(特に、嫁さんが)

Nowadays, it seems to be a difficult task to choose the "best shot" to keep in hand from the huge number of photos (especially for my wife).