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

こちらに、2015年の夏、鹿児島県の県知事が『女子高生は、三角関数より花や草の名前を教えた方がいい』と発言して大問題に発展した話題を書きました。

Here, I wrote about a story that developed into a big problem in the summer of 2015 when the prefectural governor of Kagoshima Prefecture said, 'High school girls should be taught the names of flowers and grasses rather than trigonometric functions'.

また、

In addition,

こちらの「リカレント教育【前編】 三角関数不要論と個性の壊し方」というコラムでは、

In this column, "Recurrent Education [Part 1]: Trigonometric Functions Unnecessary and How to Destroy Individuality," I raised the following issues.

■古典は必要か → 使う場面ないじゃんか?

Do we need the 'classics' → Why don't we use them?

■歴史は必要か → 昔の話を持ちだしてどうする?

Do we need 'history' → When do we use the story?

■英語は必要か → (江端試算では)4%の日本人しか使っていないぞ?

Do we need 'English' → (Ebata's estimate) only 4% of Japanese use it?

■現国は必要か → 文庫本が読める程度の漢字を知っていればいいんじゃないの?

Do we need to study 'Japanese'? → It's enough if we know enough kanji to read a paperback book.

■体育は必要か → 日常生活で、走ったり跳んだり泳いだりする必要性はあるか?

Do we need 'physical' → Do we need to run, jump, or swim in daily life?

■理科は必要か → リトマス試験紙が何色になるかが、そんなに重要か?

Do we need 'science' → Is it really that important what color the litmus test paper turns?

と問いつめれば、「畢竟(ひっきょう)、全ての学校教育は否定される」という結論に至るはずだ、という論を展開しました。

I argued that if we look at it this way, wewill come to the conclusion that "in the end, all schooling will be rejected.

-----

で、現在、ミャンマーで発生している「軍部によるクーデター事件」について語る時に、

So, when we talk about the "military coup d'etat incident" that is currently occurring in Myanmar.

『ああ、あれは、ざっくり言って、"2.26事件"と同じだよ』

"Yeah, that's roughly the same as the 2.26 incident"

と言った時に、

When I replied that way,

「ああ、なるほどね」

"Oh, I see"

と答える国民が、多数派の国になるか、

Will the people who answer this way become the majority? or,

「はあ? 何それ?」

"What? What's that?"

と答える国民が、多数派の国になるか、

Will the people who answer this way become the majority?

の、違いなのだろう、と思っています。

At the end of the day, this is what makes the difference, I believe.

-----

『国民の知的レベルは低いままにしておく方が統治しやすい』といったのは、毛沢東です。

It was Mao Zedong who said, "It is easier to rule if the intellectual level of the people is kept low.

私は、『国民の知的レベルを低いままにしておくと、感染症で国が滅びる』と思っています。

I believe that 'if the intellectual level of the people is kept low, infectious diseases will destroy the country.

-----

「毛沢東?はあ?それ誰?」と答える国民が・・・(以下省略)。

"Mao Zedong? Huh? Who is that? The people answered....(Omitted below)

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

これが出ると、流石にパニックになる。

なんどリスタートしても状況が改善されないことがある。

コンピュータの再起動もやったし、

を繰り返したりした。

しかし状況が改善されない。

そして、世界には、「これ」に関する情報がほとんどない。

現状、Dockerなしでの仕事は考えられないので、かなり青ざめた。

ところが、これが意味不明に「突然直る」ことがある

ということで、私から私への提案であるが、

何か別の仕事をしながら、時々、"Restart Docker" を試してみる

を、提案する(エンジニアとしては、かなり腹立たしい対応であることは分かっているが)

焦って再インストールしたり、

https://github.com/docker/for-win/issues/7677 に記載されているような

I have made the following steps and was able to start docker successfully:
1)run "cmd" with administrator rights
2) type Regedit and enter
3)In registry editor find this folder Computer\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Policies\Microsoft\FVE
4)inside this folder you can find "FDVDenyWriteAccess" this rule click on it choose modify and replace value data 1 with 0 , then restart docker and wait for it.

のような方法は、少なくとも1日待って、駄目だったら、試すくらいの気持ちでいよう。

合言葉は、

Docker Desktop for Windows は馬鹿

で、行こう。

========

続編

Docker Desktop for Windowsのメモリ管理やら、面倒なことを弄って、そして、論文やら報告書やらで、1月近く放っておいたら、全く動かなくなった。こいつは、構ってやらないと動かなくなるらしいです。

このアイコンの帆の部分が出なくなって、「docker desktop is runnning」の状態のまま続いて、もうウンともスンとも言わないらしいです。

ここのところ、Windows10を軽量化する為に、色々カルトな設定をしていたので、その中の一つが、Dockerのご機嫌を損ねた可能性があります

Hyper-V 周りがあやしい、と思って、管理者モードで立ち上げた、PowerShellから、

Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Hyper-V -All

なんぞを打ち来んで、待つこと10分。

無事終って再起動したのだけど、全く改善がありません。

ずっとこんな感じ。

『再インストールするしかないのかな』と暗い気持ちになっているところに、この記事を見付けました。

macでdocker desktopが起動しないときのシンプルな対処方法

要するに、

対処方法「Reset to factory defaults」の実行

というのをやればいいらしいようです。色々失うものがありそうですが、(間違いなく、Dockerのイメージは消えるだろうが)、この際『かまわん』と腹をくくって、Windows10でのやり方を試みました。

からSetttingで、てんとうむしみたいなアイコンをクリックします。

すると、「Reset to factory defaults」というのがあるので、これを押下します。

まあ、結果的に、これでdocker for Windowsは動き出すようです(前述のHyper-Vとかも関係あるかもしれません)。

ただ、

ディスクスペースを開けるのに"docker system prune"は便利だが、濫用しないこと。docker-compose buildが再び上手く動くという保障はないぞ

みたいに、何もかも「真っ白」になるので、その覚悟はして下さい。

まあ、「Dockerを再インストールするよりはいいよね」というくらいに追い込まれた時の最後の手段として使って下さい。

========

パソコンを立ち上げ直すたびに、"Reset to factory defaults"をしないと動かないので、Dockerを再インストールしましたが、状況が改善されません。

ほとほと困っていますが、Docker  Imageを毎回作り直している訳にもいきません。

で、この問題を解決する手段として、経験的に分かったことを書き下します。

(1)Docker Desktopはまともに起動するのに、PC起動後10分程度かかる(ような)気がします。

(2)もし「エントツの出てこないクジラ」のアイコンが出てきて手が打てないような状況になっていれば、[タスクマネージャ]→[詳細]→Docker Desktop.exe、その他 Dockerと名前のついているのを全部殺す

(3)メニューから、手動で、"Docker Desktop"を起動する。

これで動き出すことがあるようです。もう、「良い悪い」といっている場合ではないので、私は、Docker desktopの自動起動のオプションを外して、手動で立ち上げることにしました。なお、手動で立ち上げても、上記の対応が必要となることがあります。

まあ、何かの拍子に直ることを期待しましょう。

 

 

 

 

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

特許権は、出願から20年で満了します。そして、特許権の維持費は、満了近づくにつれ高額になります。

Patent rights expire 20 years after filing. And the cost of maintaining a patent becomes more and more expensive as it approaches expiration.

ですので、権利行使の予定のない特許権に対しては、「放棄」という手続をすることがあります。

Therefore, if we do not plan to exercise our patent rights, I may have to go through a procedure called "abandonment".

最近、この放棄手続の問い合わせが、私のところにくるのですよ、頻繁に。

Lately, I've been getting inquiries about this "abandonment" procedure, frequently.

まあ、私が主筆発明者であるのなら当然なのですが、そうでない場合にも問い合わせが来ます。

Well, it is natural if I am the lead inventor, but I get inquiries even when I am not.

今日なんて、共同発明者でもない特許の「放棄」の判断の問い合わせが来ました。

Today, I received an inquiry about a decision to "abandon" a patent that I was not a co-inventor on.

しかし、特許権の放棄というのは、結構、気の重い決断です。

However, the decision to abandon a patent is quite a daunting one.

万が一、放棄後に、どっかの会社が特許技術を行使したとしても、特許料をせしめることができなくなります。

Even if some other company exercises the patented technology after the abandonment, we will not be able to collect the patent fee.

放棄後に、億の単位のお金を取り損ねることが「絶対にない」とは言えないからです。

This is because we can never be sure that we will not miss out on hundreds of millions of dollars after the abandonment.

-----

しかし、技術の世界において20年前と今は、ほとんど別世界といってもいいです。

However, in the world of technology, it is almost a different world today than it was 20 years ago.

特許権が行使できる可能性は絶望的に低いです。

It is hopelessly unlikely that a patent can be enforced.

加えて、私は「自分の発明」以外は、愛せないのです。

In addition, I can't love patent of others.

他人の特許発明の価値を判断する場合、そこに「愛」はありません。

When judging the value of someone else's patented invention, there is no "love" in it.

「金(の計算)」があるのみです。

There is only "money (calculation)".

-----

という訳で、最近の私は、

So, lately, I've been a

―― 特許権の死刑執行人

"Death Penalty Executioners of patent right"

をやっています。

まあ、法務大臣の死刑執行命令書の署名に比べれば、気楽なものですが。

Well, it's a piece of cake compared to the Justice Minister's signature on the death penalty order.

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,江端さんの忘備録

(昨日の続きです)

(Continuation from yesterday)

次女:「私は、パパの新型コロナに関する情報が徹底しているから、同級生の中では「コロナリテラシー」は高い方だよ」

Junior Daughter: "I'm more 'Corona literate' than most of my classmates because I'm thoroughly informed about Dad's new Corona.

江端:「でも、結構頻繁に友人と外出しているよね」

Ebata: "But you go out with your friends quite often, don't you?

次女:「まあ、高校生活、最後の一ヶ月だし」

JD: "Well, it's my last month of high school.

江端:「では、同級生のコロナリテラシーを10段階として、自分のリテラシーは、いくつだと思う」

E: "So, on a scale of one to ten, how would you rate your corona literacy in comparison to your classmates?

次女:「"9"かな」

JD: "I think it's a nine."

次女の話を聞いた家族が、全員ビックリしていました。

All the family members who heard my junior daughter's story were surprised.

私は、次女の状況分析力をそれなりに信頼しているので、この値は"真"であると認定することができます。

I have a fair amount of faith in my second daughter's ability to analyze situations, so I can qualify this value as "true".

とすれば、

If that's the case,

―― ティーンエイジャの、コロナリテラシーは、私たちの想像を絶するほど『低い』

"Teenagers' corona literacy is 'low' beyond our imagination"

という可能性は『高い』です。

This possibility is 'high'.

しかし、若者の多くは、ちゃんと感染対策をしていると思います。

However, I believe that most young people are taking proper measures to prevent infection.

飲食店で大声で会話している低能なオヤジたちよりは、本当に真面目に取り組んでいると信じています。

I believe they are really more serious than the lowly old men who are talking loudly in restaurants.

しかし、そこには「死の影」が全く感じられないのです。

However, there is no sense of "shadow of death" there at all.

-----

現時点で、16歳以下の若者の新型コロナによる死亡者数は0で、ワクチン接種対象外です。

At this time, there have been zero deaths from the new coronavirus in young people under the age of 16, and they are not eligible for vaccination.

これで、『死の恐怖と隣り合わせの高齢者』と意識を共有しろ、というのは、かなり無茶だと思います。

I think it's quite absurd to ask people to share their consciousness with "elderly people who live with the fear of death".

「全世代で等しい死亡率」であるとか、逆に「子どもを集中的に襲うウイルス」なら、状況は変わっていたでしょう。

The situation would have been different if the virus had "equal mortality in all generations" and "concentrated on children.

いわゆるスペイン風邪のように「乳幼児を直撃」「若者から重症化」という特性を持っていたのであれば ――

If, like the so-called Spanish flu, it would have been the characteristics of "hitting infants directly" and "severe disease in young people" --

今回の緊急事態宣言の中において「緩み」などという言葉は出てこなかっただろうなぁ、と思うのです。

I don't think the word "loosening" would have been used in the declaration of the state of emergency this time.

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

緊急事態宣言 ―― というからには、戒厳令がセットメニューでなければならないと思うのです。

When it comes to declaring a state of emergency, I think "martial law" should be on the menu.

「戒厳令」ということになれば、当然、新宿や渋谷のスクランブル交差点に、戦車と小火器を携帯した自衛隊隊員が、仁王立ちで、街行く市民を睨めつけていなければならない、と思うのです。

If "martial law" were to be declared, of course there would have to be Self-Defense Forces personnel with tanks and small arms at the scramble intersections of Shinjuku and Shibuya, standing on their heads and glaring at the citizens on the street.

自衛隊 ―― となると、治安出動となりますが、

The Self-Defense Forces -- that would mean mobilizing security forces, however,

我が国では、『実際に治安出動が発令されたことは一度もない』です。

In Japan, there has never been a "security mobilization" actually issued.

これが発動されるためには、大手町あたりが火の海になっているか、自衛隊基地がミサイル攻撃を受けている、くらいのレベルでないとダメでしょう。

In order for this to be triggered, it would have to be at a level where Otemachi is on fire or the SDF base is under missile attack.

内閣として安易に切れるカードではありません。

This is not a card that the Cabinet can easily play.

―― 感染症ごときで、治安出動できるか

"I don't know if I can mobilize security for an infectious disease"

と、私でも思います。

I think that.

-----

街行く人が、インタビューで「緩んできていますね」と語るのは、なんというか違和感を感じます。

When people on the street talk about "loosening up" in interviews, I feel somewhat uncomfortable.

そもそも、テレビ局の人間は、インタビューする相手を間違っているし、インタビューに応じている人もどうかしていると思う。

In the first place, I think the people at the TV station are interviewing the wrong people, and I think the people being interviewed are nonsense.

私なら、この手のインタビューが近寄ってきたら、直ぐに逃げます。

For me, I would run away immediately if this kind of interview approached me.

もし、逃げないで、受け答えするのであれば、

If I don't run away and answer...

『うん! 私は、緩んでいます。だから、ここにいるんですよ。あなたも、下らない質問をしないで下さいね!!』

"Yes! I'm loose. That's why I'm here. You don't have to ask me any lame questions either!

と応答して、夕方のニュースの映像に出てきて、名前と住所を晒されて、炎上を喰らう覚悟があります。

I will respond as such. And I'm ready to appear in the evening news footage, have my name and address exposed, and go to the flames.

というか、インタビューするなら、一日15時間以上、自宅のPCで、シミュレーションとコーディングをやっている、この私に聞くのが筋だろうが、と思うのです。

I mean, if they're going to interview someone, it's me, I think, who spends more than 15 hours a day doing simulations and coding on my PC at home.

我が家において、「緩んできていますね」とか「緩んできてはいませんね」とコメントできるのは、この私くらいです。

In my family, I am the only one who can comment that things are loosening up or that things are not loosening up.

(続く)

(To be continued)

未分類

このコンテンツはパスワードで保護されています。閲覧するには以下にパスワードを入力してください。

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

シミュレータの対象人数が増えると、シミュレータがフリーズしてしまう、という問題が生じたので、まずは、手っ取り早く、Dockerコンテナのメモリとスワップを倍にしてみる処理をしてみた。

起動開始までの時間が恐ろしく長い(5分以上。なんでだ?)が、とりあえず、シミュレーション人数500人(実行時間4分弱)→3000人(22分)→4000人(16分? なんで減っている)→での稼動を確認。

しかし、5000人は失敗、4500人も失敗。では、メモリをもう2G増量。

そこで、6GBまで上げてみた。

うん、こうしても、4500人は落ちるなぁ。

websocketコネクション数の問題かなぁ?

それより、多分、これは私のPCの物理メモリが16GBしかないので、Dockerの設定を大きくしても効果が出てこないのだろう、と推測しています。

ならば、逆に6GBで設定してしたままにしておいて、コンテナの方でメモリ制限するというのは、どうかな、と思いやってみました。

以下、docker-compose.ymlで改造した部分。今回は、controlのコンテナだけメモリ増量できれば良い(それ以外のコンテナは1GBで縛る)、という方針としました。

# docker-compose のバージョン
version: '3'
# 各コンテナの情報
services:
  # postgres サービス
  postgres:
    image:  pamtrak06/postgis-pgrouting-osm:latest
    # コンテナの名前
    # container_name: postgres_db
    # Dockerfile のディレクトリパス
    build:
      context: .
      dockerfile: ./docker/postgres/Dockerfile
    # postgres 設定
    environment:
      - POSTGRES_HOST_AUTH_METHOD=trust
      - POSTGRES_USER=postgres
      - POSTGRES_PASSWORD=XXXXXXX
      - POSTGRES_DB=XXXXXX
    volumes:
      - db_data
      - ./control:/go/src/work # マウントディレクトリ指定
    expose:
      - 5432 # 兄弟コンテナから5432でアクセスできるようにする
    ports:
      - "8910-8911:5432"
    tty: true # コンテナの起動永続化
    mem_limit: 1g # メモリを1Gに制限
  db_data:
    image: busybox
    volumes:
      - /data/db
    mem_limit: 1g # メモリを1Gに制限
  app_control: # service名
    build: . # ビルドに使用するDockerfileがあるディレクトリ指定
    tty: true # コンテナの起動永続化
    volumes:
      - ./control:/go/src/work # マウントディレクトリ指定
    expose:
      - 8900
    ports:
      - "8900-8901:8900"
    image: control_agent
    # container_name: control_agent_app
    # restart: always  # ログイン時に自動起動
    # ここだけメモリの制限をしない
  app_user: # service名
    build: . # ビルドに使用するDockerfileがあるディレクトリ指定
    tty: true # コンテナの起動永続化
    volumes:
      - ./user:/go/src/work # マウントディレクトリ指定
    expose:
      - 8920
    ports:
      - "8920-8921:8920"
    image: user_agent
    # container_name: user_agent_app
    # restart: always  # ログイン時に自動起動
    mem_limit: 1g # メモリを1Gに制限
  app_bus: # service名
    build: . # ビルドに使用するDockerfileがあるディレクトリ指定
    tty: true # コンテナの起動永続化
    volumes:
      - ./bus:/go/src/work # マウントディレクトリ指定
    expose:
      - 8930
    ports:
      - "8930-8931:8930"
    image: bus_agent
    # container_name: bus_agent_app
    # restart: always  # ログイン時に自動起動
    mem_limit: 1g # メモリを1Gに制限

 

5000人は失敗したけど、4500人まで増やすことに成功しました。

それと、controlコンテナのスピードが物凄く上がっているような気がします(比較計測できませんが)。

 

 

 

 

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

E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?

がでてきたら、

とりあえず、

sudo apt-get update

sudo apt-get install

だな。

 

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

私は、菓子の製造方法について、全く知見がありませんが、通常の加工食品より、緻密な制御が必要である、ということくらいは知っています。

I don't have any knowledge about how to make confectioneries, but I do know that they require more precise control than normal processed foods.

特に重要なのが、材料の量。グラム単位で緻密に計測する必要があるそうです。

What is especially important is the amount of material, which they says should be measured precisely in grams.

また、わずかな温度や時間によって、できあがるお菓子の味が全く変わってくるのだそうです。

Also, the slightest change in temperature or time can completely change the taste of the finished pastry.

さまざまなお菓子の中でも、「マカロン」は、超絶難しい ―― という話を、次女から聞かさました。

My junior daughter told me that among the various sweets, "macarons" are extremely difficult to make.

私の聞いたところでは、マカロンの味を左右するパラメータは、軽く10を越え、そのパラメータが独立変数でないようです。

From what I've heard, there are lightly more than 10 parameters that affect the taste of macarons, and it seems that these parameters are not independent variables.

「独立変数ではない」とは、変数どうしが影響し合うということで、つまるところ、最適解が線形に求められない、ということで ――

The term "not independent variables" means that the variables influence each other, and in short, the optimal solution cannot be obtained linearly.

つまり、これは、マカロンを最高の状態で完成させる、材料の量、混合比、燃焼温度、放熱時間、外気温や湿度その他もろもろが、簡易に求められない、という難問であるということで、

This means that the amount of ingredients, mixing ratio, combustion temperature, heat release time, outside temperature and humidity, and other factors that make macarons perfect are not easily determined.

―― マカロンの作り方は、数学で言うところのNP困難問題と同じである

"Making macaroons is like an NP-hard problem in mathematics"

と、(私なりの解釈ですが)次女はそのような話をしていました。

(That's my interpretation) my junior daughter talked about it that way.

『しかるに、バレンタインに「手作りマカロン」を平気で要求してくる、あの男は馬鹿か?』

"And yet, that guy who insists on homemade macaroons for Valentine's Day is an idiot?"

と、娘は、自分の彼氏を罵倒しまくっていました。

She was cursing her boyfriend all the time.

-----

ええ、今の私は、次女の憤りが手に取るように分かります。

Yes, now I understand my second daughter's indignation.

江端:「絶対的にお前が正しい。課題の困難さを理解していない上に、気楽に人に要求するやつはだなぁ、「極刑」に値するといっても良いであろう」

Ebata: "You are absolutely right. Those who don't understand the difficulty of the task, and who comfortably make demands of others, deserve the ultimate punishment.

江端:「『NP困難であるDial-A-Ride問題に、人間の心理状態を加えて上で、リアルタイムで解くことを「簡単」のように言う奴は、馬鹿なのか?』って思っているぞ!」

Ebata: "I'm also thinking, 'Is that guy stupid enough to think that adding human psychological states to an NP-hard Dial-A-Ride problem, and then solving it in real time, is 'easy'? That's what I'm thinking!

と、親子二人で、世の中の理不尽に対して、怒りの雄叫びを上げ続けていました。

The two of us, father and daughter, continued to scream in anger at the unreasonableness of the world.