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

先日、ヨーロッパにある店舗に発注手続をして、送金しようとクレジットカードを使おうとしたら、エラーで弾かれ続けて困りました。

The other day, when I tried to use my credit card to send money to a store in Europe after completing the order process, I was troubled by the fact that it kept getting rejected with errors.

店舗の居所は公開されていなかったのですが、もしかしたら、例の『世界中から金融制裁を受けているあの国』だっかもしれません。

The location of the store was not disclosed, but it might have been "that country that is under financial sanctions from all over the world".

「ビットコインでの支払いもできる」と書いてあったので、こちらで試みようとしました。

It said, "You can also pay in Bitcoin," so I attempted the method.

以前、テスト用に5000円程度購入したお金が、まだいくらか残っていたので。

I still had some money left over from a previous purchase of about $5,000 for testing.

ところが、システムから『残金が足りない』と言われました。

However, the system told me, 'The balance is not enough.

変だなー、と思って調べてみたところ、『送金コストが、購入物の値段より高い』ということが分かり、ビックリしました。

I thought this was strange, so I looked into it and was surprised to find that "the cost of remittance was higher than the price of the purchased item.

『ビットコインは送金コストが安い』が、最大のウリだったと思っていたので。

I thought 'Bitcoin has low remittance costs' was the biggest selling point.

もっとも、これは、ビットコインが理由ではなく、取扱い店舗の手数料かもしれませんが、ともあれ、ビットコインの送金もあきらめて、この取引を取り止めました。

This may not have been because of the bitcoin, but because of the fees charged by the store. Anyway, I gave up on the bitcoin transfer and canceled this transaction.

-----

(1)クレジットカードの使用を停止されると、小売店舗なんぞは簡単に干上がりそう

(1) If retail stores are force to stop using credit cards, they are going to dry up easily.

(2)ビットコインは、決済手続の抜け道として、使えそう

(2) Bitcoin could be used as a loophole in payment procedures.

という、現在、ニュースで報道されていることを、実体験することができました。

This was a real experience of what is currently being reported in the news.

-----

先程、お世話になった方に、Amazonギフトを使って御礼を送付しました。

I just sent "a thank you" to the person who helped me with an Amazon gift.

手続30秒でした。

The procedure took 30 seconds.

『本当に、ラクだなぁ』

"It's really, really easy."

と実感しています。

I realize that.

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

プログラムのバグというのは、本当にささいなものです。

A bug in a program is really a small thing.

カリフォルニアの1/3を大停電を発生させた原因のバグが、「たった3行のプログラム」であったことは有名ですが、私は驚きません。

I am not surprised that the bug responsible for causing a major blackout in 1/3 of California was famously "just three lines of programming".

というのは、私は3日間ぶっつづけで、3つのプログラムのトレースを100回以上チェックして、データの読み込みタイミングのズレを見つけて、

Because I spent three days straight checking the traces of three programs over a hundred times to find the timing discrepancies in reading the data, and

―― JavaScriptの1行をコメントアウトしただけで、プログラムはあっさりと動き出しました。

"I commented out one line of JavaScript and the program started working easily."

「PrumeMobileのサーバ化」もどきの実装に目処が立ちました

で、残っているものは、山のようにつけ加えた(全く関係のなかった)変数や、膨大なプリントアウトメッセージが書き込まれている、とても汚ない不様なプログラムリストです。

So, what is left is a very dirty, ugly program list with a mountain of added (and totally unrelated) variables and a huge number of printout messages written on it.

これから、これを、未来の私が読める程度に、キレイにしてサーバにアップするという、あまり楽しくない作業が残っています。

Now I have the not-so-fun task of cleaning it up and uploading it to the server so that future for me.

-----

文部科学省のプログラミング教育というのは、このような、プログラム開発の現状を無視しています。

Programming education by the Ministry of Education, Culture, Sports, Science and Technology (MEXT) ignores this current state of program development.

そして、「プログラム的思考」なるものを教えることができる、と、思っているようです。

And they seem to think that they can teach something that is "programmatic thinking".

ただ、文部科学省としては、『それしか、やりようがない』というのは、私にも理解できます。

However, I understand that the Ministry of Education, Culture, Sports, Science and Technology says, 'That's the only way to do it'.

もし、プログラム開発のフロント現場のリアルを、子どもたちに強いたりしたら、全員が逃げだすことを、私は受けあいます。

I assure you that if the MEXT force children to experience the realities of the front lines of program development, they will all run away.

だから、

So, I think,

―― まあ、そういうこと(「プログラム的思考」)が本当に実現できれば、子どもと文部科学省の両方に、心の底から『おめでとう』と言える

"Well, if such a thing can really happen, I can say 'congratulations' from the bottom of my heart to both the child and the Ministry of Education"

と思っています。

10年後を楽しみに待つとしましょう。

Let's wait and see what happens in 10 years.

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

PrumeMobileのサーバ化

から、1日もあれば、動かせるだろうと思ったのですが、そこから、redisのパブサブ、Golangのmap、JavaScriptの改造、えらい目に会いましたが、ようやく目処が立ちました。

PrumeMobileは、Webのメモリを使うので、単なるWebサーバのようには取り扱えないので、色々工夫をしました。デバッグで苦労しました。

嬉しい気持ちは、直ぐに消えてしまうので、消える前に記録しておきました。

 

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

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

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

世界を「数字」で回してみよう(69)番外編

「それでもコロナワクチンは怖い」という方と一緒に考えたい、11の臨床課題

Let's turn the world by "Number"(69) Extra:

11 Clinical Issues to Consider about those who "still fear of Corona Vaccine"

-----

今回のメインテーマであるところの、「ワクチン接種への恐怖」について、嫁さんと話をしました。

I talked with my wife about the main theme of this issue: fear of vaccination.

江端:「ワクチン接種を怖いとは思わなかった?」

Ebata: "You didn't find the vaccination scary?"

嫁さん:「持病もないし、副反応の話も聞いていたし、なんとなく『私は大丈夫かな』と」

Wife: "I don't have any pre-existing conditions, and I had heard about the side effects, so I kind of thought, 'I'll be fine.'"

江端:「もし、過去に、強いアレルギー反応とか、アナフィラキシーで、救急搬送とかされていたらどうかな?」

Ebata: "How do you think if you had had a strong allergic reaction or anaphylaxis in the past and you had had to go to the emergency room?"

嫁さん:「それなら、絶対に『怖い』と感じると思う。『何もして欲しくない』と思って当然だと思う」

Wife: "Then I would definitely feel 'scared. ' I think it's natural to feel like, 'I don't want me to do anything.'"

------

私の母は、一回目の接種直後に入院して、その後の接種はドクターストップがかかり、その後も入退院、転院を繰替えしていました。

My mother was hospitalized immediately after the first vaccination, and subsequent vaccinations were stopped by the doctor, and she was in and out of the hospital and transferred to other hospitals repeatedly.

そして、今年の1月に、心停止して死去しました。

Then, in January of this year, she died of cardiac arrest.

もしかしたら、おふくろの死因は、『ワクチン接種』だったのかもしれません。

Perhaps the cause of my mother's death was the 'vaccination'.

だが、それでも、私たちは、自分の命と、他人の命の為に、決断しなければならない ―― 今は、そういう時なのです。

もし、私が心筋炎で突然死するようなことがあれば、『コロナワクチン接種』が原因なのかもしれません。

If I were to die suddenly from myocarditis, it might be due to 'corona vaccination'.

あるいは、毎年受けている『インフルエンザワクチン接種』かもしれませんし、週一くらいで摂取している『精神安定剤』かもしれません。

Or it could be the "flu vaccination" that I receive every year, or the "tranquilizers" that I take once a week.

あるいは一月に一回くらい摂取している『睡眠薬』の可能性もあり、あるいは大穴で『北極ラーメン』が原因になるかもしれません。

Or it could be the "sleeping pills" that I take once a month or so, or it could be "Hokkyoku Ramen".

私は、ふざけた話をしようとしているのではないのです。

By the way, I am not trying to be a joke.

今回のコラムで、シバタ先生も論じていますが、

As Dr. Shivata discusses in this column.

(1)ワクチン接種で心筋炎で死亡している人もいれば、

(1) Some people have died of myocarditis because of vaccination

(2)コロナ感染で心筋炎で死亡している人もいれば、

(2) Some people have died of myocarditis due to COVID-19 .

(3)前記(1)(2)と無関係で心筋炎で死亡している人もいます

(3) Some people have died of myocarditis unrelated to the above (1) and (2)

(その比率については、コラムの『CQラストナンバー』をご一読下さい)。

(Please read the column "CQ Last Number" for more information on that ratio.)

ワクチン接種をすれば、その理由は上記(1)(2)(3)のいずれかを特定することができなくなりますが、ワクチン接種をしなければ、少なくとも(1)について考える必要はなくなります。

If you vaccinate, you will not be able to identify any of the reasons for (1), (2), or (3) above, but if you do not vaccinate, you will not have to consider at least (1).

それはそれで、納得できる死に方の一つだとと思います。

I think that is one of the most satisfying ways to die.

『江端という奴のコラムにそそのかされて、ワクチン接種なんぞをしたせいで、私は死ぬのだ』

"I'm going to die because I was seduced into getting vaccinated by a column by a guy named Ebata"

と思い込んで最期を迎える人生は、絶対に悔いの残る人生になるでしょう。

I am sure that the life that ends with the thought, will be a life of regret.

-----

私は、その逆パターンです。

I am the reverse pattern.

『mRNAワクチン接種の日を、遠足を待つような子どものような気持ちで待っていた』

"I waited for the day of the mRNA vaccination like a child waiting for a field trip"

という人間は ―― 国内に10人もいないだろうと思いますが ―― それでも、いるんです、ここに1人。

I doubt there are 10 such people in the country, but still, here is one.

インシリコ(コンピュータを使った設計等)によるワクチンというだけで、ワクワクしていました。

I was excited just by the idea of vaccines by in silico (computer-aided design, etc.).

我が国はコロナワクチン後発組である上に、国内でも医療従事者の次の順番である、という幸運で『バグ出しは完璧』と思っていました。

I thought 'bug out was perfect' with the good fortune that our country is a latecomer to the corona vaccine and is also the next in line of medical professionals in the country.

私たちのフィールドで20年近くも言われてきたフレーズに『アナログとデジタルの融合』がありますが、まさか、こんな形で実現されるとは思いませんでした。

A phrase that has been used in our field for nearly 20 years is "the fusion of analog and digital," but I never thought it would be realized in this way.

それ故、私にとって、『アナログとデジタルの融合は、時期尚早だったか』と思いながら最期を迎える人生は、納得できるものなのです。

Therefore, for me, it is satisfying to end my life thinking, "Was the fusion of analog and digital technology premature?"

-----

よく分かっています ―― 私が、規格外のパラダイムを持っている、ということは。

I am well aware -- that I have an abnormal paradigm.

2022/04,未分類,江端さんの技術メモ

  1. golang内でredis経由でJSONを飛す時
    // パブリッシュ側
    
    type GetLoc struct {
        ID    int     `json:"id"`
        Lat   float64 `json:"lat"`
        Lng   float64 `json:"lng"`
        TYPE  string  `json:"type"` // "PERSON","BUS","CONTROL
        POPUP int     `json:"popup"`
        //Address string  `json:"address"`
    }
    
    		gl.TYPE = "BUS"
    		gl.Lat = 35.654543 + (rand.Float64()-0.5)*0.00001*20
    		gl.Lng = 139.795534 + (rand.Float64()-0.5)*0.00002*20
    		gl.ID = rand.Int() % 5
    
    		json_gl, _ := json.Marshal(gl)
    		r, err := redis.Int(conn.Do("PUBLISH", "channel_1", json_gl))
    
    // サブスクライブ側
    
    	for {
    		switch v := psc.Receive().(type) {
    		case redis.Message:
    			fmt.Printf("%s: message: %s\n", v.Channel, v.Data)
    
    			var gl GetLoc
    			_ = json.Unmarshal(v.Data, &gl)
    			fmt.Println(gl.ID)
  2. golangから直接JavaScriptへJSONを飛す時
    golangから (上記の続き)

    var gl GetLoc
    			_ = json.Unmarshal(v.Data, &gl)
    			fmt.Println(gl.ID)
    
    			//conn.WriteJSON(v.Data)
    			conn.WriteJSON(gl)

    JavaScriptで受けとる

    <script>
            function obj(id, lat, lng, type, popup){
                this.id = id;
                this.lat = lat;
                this.lng = lng;
                this.type = type;
                this.popup = popup;
            }
    
    
            //ws.onmessage = e => console.log(e.data)
            ws.onmessage = function(event) {  // 受信したメッセージはここに飛んでくる
                console.log("RESPONSE",event.data)
                var obj = JSON.parse(event.data);
                console.log("after parse:",obj.id)
            }

ポイントは、Marshal、Unmarshal、parseの使い方

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

入力2、出力1のマップを取扱いたい場合のケースを調べてみました。

Golangは、2次元マップの取扱いは簡単なのですが、N次元は、かなり複雑になるようです。調べたところ、以下のような取扱いができることが分かりました。

package main

import "fmt"

func main() {

	// 2次元マップ
	m := map[string]int{}
	//m := make(map[string]int)

	m["apple"] = 150
	m["banana"] = 200
	m["lemon"] = 300

	fmt.Println("0:", m["apple"])

	// 多次元mapは、2次元マップのように簡単には使えない
	// 比較的面倒のないやり方は、以下のように構造体を使う方法(らしい)
	// https://qiita.com/ruiu/items/476f65e7cec07fd3d4d7

	type key struct {
		id  int
		att string
	}

	// 配列宣言
	m1 := make(map[key]int)

	// レコード追加
	m1[key{0, "BUS"}] = 1
	m1[key{0, "PERSON"}] = 1

	m1[key{1, "BUS"}] = 2
	m1[key{1, "PERSON"}] = 11

	// レコードの一つを表示
	fmt.Println("1:", m1[key{1, "BUS"}])
	// レコードの全部を表示
	fmt.Println("2:", m1)

	// 変数を使う方法
	id0 := 1
	att0 := "PERSON"
	fmt.Println("3:", m1[key{id0, att0}])

	// レコードの削除
	delete(m1, key{1, "BUS"})
	fmt.Println("4:", m1)

	for i := range m1 {
		fmt.Println("5:", i)
	}

	// 変数を使って、キーの存在を確認する
	id0 = 1
	att0 = "PERSON"
	value, isThere := m1[key{id0, att0}]
	fmt.Println("6:", value, isThere)

	id0 = 2
	att0 = "PERSON"

	value, isThere = m1[key{id0, att0}]
	fmt.Println("7:", value, isThere)

	// レコード追加の例

	id0 = 3
	att0 = "BUS"
	new_id0 := 20

	fmt.Println("8:", m1)

	_, isThere = m1[key{id0, att0}]
	if !isThere {
		m1[key{id0, att0}] = new_id0
	}

	fmt.Println("9:", m1)

}

出力結果は以下の通りです。

C:\Users\ebata\goga\1-11\test>go run main.go
0: 150
1: 2
2: map[{0 BUS}:1 {0 PERSON}:1 {1 BUS}:2 {1 PERSON}:11]
3: 11
4: map[{0 BUS}:1 {0 PERSON}:1 {1 PERSON}:11]
5: {1 PERSON}
5: {0 BUS}
5: {0 PERSON}
6: 11 true
7: 0 false
8: map[{0 BUS}:1 {0 PERSON}:1 {1 PERSON}:11]
9: map[{0 BUS}:1 {0 PERSON}:1 {1 PERSON}:11 {3 BUS}:20]

以上

 

 

 

 

 

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

嫁さんが、録画していた、地上波で放送された実写版の「約束のネバーランド」を見ようとしていたのを、すんでのところで止めました。

My wife was about to watch the recorded live-action version of "The Promised Neverland" that aired on terrestrial TV, however I stopped her just in time.

―― あぶなかった。危機一髪のところでした。

"It was a close call"

で、今、強制的にNetFlixで、アニメ版「約束のネバーランド(シーズン1)」を見せています。

So, now, compulsively, I show my wife the animated version of "The Promised Neverland (Season 1)" on NetFlix.

実は、昨日から今朝にかけてのPCの修理の一連の理由は、私が嫁さんに、アニメ版「約束のネバーランド」の視聴をさせようとしたところに、PCの故障が起きたからです。

In fact, the reason for the series of PC repairs from yesterday to this morning is that I was trying to get my wife to watch the animated version of "The Promised Neverland" when the PC malfunctioned.

内蔵電池が切れたPCを、この機会にWindows10にしてしまった件

それ故、私には「修理を急ぐ」理由があったのです。

Hence, I had reason to "rush" the repair.

嫁さんは、「実写版を見てから、アニメも見る」と言ったのですが、「ネタバレした後では、ダメだ」と、私は、その順番(アニメ→実写)を讓りませんでした。

My wife said she would watch the live-action version and then the anime, but I did not allow her the order because of stop spoiling it.

私、シーズン1の最終回とその前の回を、10回以上も見なおしたと思います(ちなみに、シーズン2は未視聴です)

I think I rewatched the last episode and the one before of season 1 at least 10 times (by the way, I have not watched season 2 yet).

-----

ちなみに、次女は、コミック「約束のネバーランド」推しのようです。

Incidentally, my second daughter seems to be a "Neverland of Promises" comic book guesser.

江端家は、メディアダイバーシティに富んだ家族です。

The Ebata family is a media-diverse family.

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

江端家のテレビには、AmazonとNetFlixを視聴する為だけ用のPCが繋っています。
で、昨日、NetFlixを見ようとした嫁さんから「動かない」とクレームを受けました。

「あ、これ、電池切れだ」と当りをつけて、PCの中をのぞいてみました。

で、型番を調べたら、

CR2032でしたが、私の部屋には、その型番のものがなかったので(他の型番はあったのですが)、明日、100均で手に入れようと決めて、別の作業に入りました。
先ずは、Windows10のライセンスキーの購入でした。最近、正規版(リテール版も)が安くなっているようで、私は、https://www.gamivo.com/product/windows-10-professionalから、プロバイダーを一つ選びました。

1500円くらいでした。
VISAカードで支払いを終えたら、直ぐに、ライセンスキーが表示されました。
-----
で、今朝、100均にいってCR2032を3つ/100円を購入して、PCを再起動、
Windows10をインストールして、ライセンスキーを入力して、あとは、あれやこれややって、入れ替えを終えました。
で、そのなんやかんやには、「ライセンス認証を行って下さい」という表示が出てくるなどがありました。

で、電話による認証が必要となりました。
中古ライセンスのリセール品を売りつけられたのかもしれませんが、ともあれ認証されたようです。
以上

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

いわゆる、世界から注目される著名な人は、厳しい自己批判と反省を続けている ―― らしいです。

So-called prominent people who attract worldwide attention continue to engage in severe self-criticism and reflection -- apparently.

確かに、そのような日々の果てに、世界を動かし、世界を感動させる何かを興すことができるのだと思います。

Indeed, I believe that at the end of such days, they can rise something that moves the world and inspires the world.

しかし、そのような人々には、世界は見えていない ―― 彼らにとって、世界は観客ではありません。

But to such people, the world is invisible -- to them, the world is not a spectator.

彼らにとっての観客は、自分自身です。

For them, the audience is themselves.

-----

その観客(自分)は、自分のパフォーマンスに対して、賞賛の言葉はかけてくれません。

That audience (they) will not offer words of praise for their performance.

それどころか、いつでも、自分のパフォーマンスの欠点を捜し続けて、自分に対して、さらなる高みを要求します。

Instead, they continually search for flaws in their own performance and demand higher and higher from themselves.

そのパフォーマンスは、更に、大きく、高く、磨かれ、誰も追いつくこともできないものになっていきます。

The performance will be even greater, higher, and more polished, and no one will be able to catch up to them.

私たちは、彼らからは一顧だにされない、指を加えて眺めるているだけのモブです。

We are just a mob of people who are not given a second thought by them, just adding their fingers and watching.

-----

尊敬に値する行為だと思いますが ―― 私は、そんな生き方はゴメンです。

I think it's a respectful act, however I'm not going to live that way.

そもそも、そんな生き方して、楽しいか? と思います。

In the first place, do I enjoy living that way? I think.

私は、コラムを書き上げた時、自分の思った通りにプログラムが動いた時、発明が頭の中で図面に落ちた時、

When I finish a column, when a program works the way I want it to, when an invention falls into a detailed drawing in my head.

―― 自分の頭の中の発表会場で、たくさんの自分が一斉に満場総立ちになり、万雷の拍手と歓声の嵐が巻き起こります

In the presentation hall in my own head, all of me are standing at the hall with a storm of thunderous applause and cheers

セルフ・スタンディングオベーションです。

It is the self standing ovation.

私は、厳しい自己研鑽の上で、世界に比類なき何かを目指すよりも、自分の手の届く範囲の高みに手が届く度に、簡単に何度でも満足し続ける「安い」自分が好きです。

I like my "cheap" self to continue to be easily satisfied again and again with the heights within my reach, rather than to aim for something unparalleled in the world, based on rigorous self-improvement.

世界から注目される著名な人と私の共通している点があるとすれば、『世界がどう思おうが、知ったことか』という一点のみです。

If there's one thing that I have in common with the world's most notable personalities, I have only one point: 'I don't care what the world thinks.

-----

本日、私は、自力で、スタッドレスタイヤをノーマルタイヤに交換し終えました。

Today, I finished changing the studless tires to normal tires on my own.

今日も、私は『スタンディングオベーション』です。

Today, too, I am in 'standing ovation'.