2018,江端さんの忘備録

最近、ある理由があって、現在、アルコール摂取を完全に止めています。1ミリリットルも口にしていません。

Recently, there are certain reasons, I am completely stopping alcohol consumption now. I do not even mention 1 milliliter.

ところが、4月は飲み会が多くて、正直困っています。

However, in April there are many drinking party and I am embarrassed to be honest.

飲み会の席で、

At the drinking party 's seat,

同僚:「江端さん。ドクターストップですか?」

Colleague: "Mr. Ebata, the doctor stooped it?"

と言われる度に、

Every time I responded

江端:「はっはっは、この私を『医者』ごときが止められると思います?」

Ebata: "Ha-ha, do you think that even a doctor can stop me?"

とニッコリ笑って応えると、『いろいろ察して』貰えるようで、この話題には誰も触れなくなります。

with smiling, nobody comes to touch this topic to be recognized something.

それはさておき。

Set it aside.

-----

酒が飲めなくなると、色々と見えてくるものがあります。

When I do not drink, I can see something various.

―― アルコール摂取量に応じた、人格の崩壊の有様

"Personal collapse presumably according to alcohol sumption"

が、はっきりと見えて、正直、本当に「怖い」です。

To me, it is clearly visible, honestly, it's really "scary."

飲み会の開始時の、前や隣りの席の人間が、どんどん、異様・・・もとい、別な人格(あるいは、隠れていた人格)に変化している様を、まざまざと「観測」することになるからです。

Because I will "observe" a lot about people at the next seats, who is changing to a different personality (or hidden personality) from the start time of the drinking party.

今まで、「怖い」と感じなかったのは、私もアルコールを摂取して、同じ世界線を生きていたからだろうと考えています(要するに、自分も同じように「酔っぱらって」、「人格崩壊・・・もとい、人格変化」をしていた、ということ)

I have not able to be feel "fear" since now. I think the reason is that I also change the my personality with drinking, and start to live in the another world.

気分は、岡部の「リーディングシュタイナー」です。

The feeling is, ... let me think... " Okabe's Reading Steiner"

-----

私の嫁さんは、生まれながらにして、アルコール分解能力を持たない、いわゆる「下戸」です。

My wife is a so-called "Geko" who has no alcohol decomposing ability by nature.

ですので、私は、嫁さんに、

So I asked her

「今まで、ずっとこんな怖い人生を生きてきたのか?」

"Have you ever lived such a scary life until now?"

と尋ねたところ、嫁さんは、『特に、これといった感想はないなぁ』と応えました。

However she responded, "I never thought of scary, in particular"

こんな身近に、『孤独の観測者』がいたのかと、感慨ひとしおでした。

I felt a deep emotion that there was an "observer of loneliness" close to me.

2018,江端さんの忘備録

元アイドルグループのメンバが、飲酒によるトラブルを起こしたとかで、騒ぎになっています。

One of the members of the former idol group caused a trouble due to drinking, and it became a fuss.

It is very unlikely for me to make such a rush at this timing.

『江端も、か・・・』と妙な納得をされないよう、お願い致します。

I don't hope you will be convinced saying "Ebata, too ...".

それはさておき。

Apart from that.

-----

―― ノンアルコールビールが、死ぬほど旨い

"Non-alcoholic beer is delicious enough"

と感じます。

I feel that.

もちろん、アルコール入りのビールの方が美味しいはずです。

Of course, alcohol beer should be more delicious.

しかし、アルコールを摂取できない身の上では、ノンアルコールビールは、ソフトドリンクよりも、ずっと美味しいのです。

However, I can not consume alcohol now, non-alcoholic beer is much more delicious than soft drink.

居酒屋には、ノンアルコールビールのサーバがあっても良いと思うんですよ ―― どこかにないかな、そんな居酒屋。

I think that some drink-bars should have a non alcoholic beer server. I wonder if there is something, such a bar.

-----

業界の人には、是非、以下の商品開発を試みて見て頂きたいのです。

I would like engineer to try to develop the following product by all means.

●ノンアルコール日本酒

- Non alcoholic sake

●ノンアルコールワイン

- Non alcohol wine

ここで、ちょっとググってみたら、あるんですね、ちゃんとそういう製品って。

Here, I use a search engine, I found the products like that.

ちょっと感激しました。

I was deeply moved.

でも、

However,

●ノンアルコールウイスキー

- Non alcoholic whiskey

は、さすがにないだろうと思ったら、これもありました。

has not been, but I could find it.

(以下が説明書の内容)

(The description below)

■イスラムの戒律ではアルコールの摂取が禁止されており、通常ムスリムは飲酒できず酒類はノンハラル(非合法)食品とされています。

Under Islamic precepts, alcohol intake is prohibited, Usually, Muslim can not drink alcohol and any alcohol is regarded as nonhalal (illegal) food.

■しかし、このウイスキーに関しては、イスラム食品&栄養評議会によってハラル(合法)食品の認定を受けており、ムスリムが教義的罪を背負わずに楽しめる飲料となっています。

However, regarding this whiskey, it is certified by Halal (legal) food by the Islamic Food & Nutrition Council, and It is a beverage that Muslims can enjoy without carrying doctrinal sins.

-----

思わず、「アッラーアクバル!」と叫びそうになりました。

I was almost to cry "Allah Akbar!"

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

以下の記述は間違っているようですので、参照にしないで下さい(現在検証中)。
(昨日、ソフト外注会社の方に教えて貰いました)

 

Golangで、http.HandleFunc と http.Handleについて、ずっと混乱しつづけています。

というか、私は、使い方が分かればよくて、その理屈なんぞ1mmも興味がないので、コードを書きながら理解しています(結局、遅くなっているような気がしますが)。

1. http.Handle()は、index.htmlをベースとしたサーバを立てるもの

// main16.go 現在の居場所は、c:\Users\ebata\hirohakama\199A2\others
/*
.
├── main16.go
├── index.html (A)
└── chart            # chartフォルダに静的ファイルがある
    └── index.html (B)
*/

package main

import (
	"net/http"
)

func main() {

	// 静的ファイル配信.
	// ディレクトリ名をURLパスに使う場合
	// 例:http://localhost:8080/chart/で index.html (B) の方を表示
	http.Handle("/chart/", http.FileServer(http.Dir("./")))

	// 例:http://localhost:8080/で index.html (A) の方を表示
	http.Handle("/", http.FileServer(http.Dir("./")))

	// ディレクトリ名とURLパスを変える場合
	// 例:http://localhost:8080/mysecret/sample1.txt
	// http.Handle("/mysecret/", http.StripPrefix("/mysecret/", http.FileServer(http.Dir("./contents"))))

// 例:http://localhost:8080/で index.html (A) の方を表示
	http.Handle("/", http.FileServer(http.Dir("./")))
	// 8080ポートで起動
	http.ListenAndServe(":8080", nil)
}

これで、main16.goが置いている場所が、基準点となります(それだけです)。

で、色々考えずに、基本は、

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

としておきましょう(というか、これがデフォルトなら、記載すらしなくてもいい)

2. http.HandleFunc()は、ソースコードで書いたものをサーバとするもの

// main15.go 現在の場所はc:\Users\ebata\hirohakama\199A2\others

/*
.
└── main15.go

*/

package main

import (
	"io"
	"log"
	"net/http"
)

func h1(w http.ResponseWriter, _ *http.Request) {
	io.WriteString(w, "Hello from a HandleFunc #1!\n")
}

func h2(w http.ResponseWriter, _ *http.Request) {
	io.WriteString(w, "Hello from a HandleFunc #2!\n")
}

func main() {

	// http://localhost:8080/ で h1の内容を表示 (プログラムの内容を)
	http.HandleFunc("/", h1)

	// http://localhost:8080/endpoint で h2の内容を表示
	http.HandleFunc("/endpoint", h2)

	log.Fatal(http.ListenAndServe(":8080", nil))
}

3. http.Handle()1つとhttp.handleFunc()1つが混在しているものは、それぞれサーバが2つある、ということ

// main13.go

package main

import (
	"fmt"
	"log"
	"math/rand"
	"net/http"
	"time"

	"github.com/gorilla/websocket"
)

var upgrader = websocket.Upgrader{}

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"`
}

func echo3(w http.ResponseWriter, r *http.Request) {
	upgrader.CheckOrigin = func(r *http.Request) bool { return true } // おまじない
	conn2, err := upgrader.Upgrade(w, r, nil) //conn2でwebsocketを作成
	if err != nil {
		log.Println("websocket connection err:", err)
		return
	}
	defer conn2.Close()

	for {
		gl2 := new(GetLoc)
		gl2.ID = rand.Intn(20) // ここで乱数を発生されて、javascriptで受信させる
		gl2.Lat = 181.0
		gl2.Lng = 181.0
		gl2.TYPE = "BUS"
		gl2.POPUP = 101

		err := conn2.WriteJSON(&gl2)
		if err != nil {
			log.Println("ReadJSON:", err)
			break
		}
		fmt.Println("echo3:", gl2)
		time.Sleep(time.Second * 1)
	}

}

//var addr = flag.String("addr", "0.0.0.0:5000", "http service address") // テスト

func main() {

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

	http.HandleFunc("/echo3", echo3)

	//log.Println("server starting...", "http://localhost:8080")
	//log.Fatal(http.ListenAndServe("localhost:8080", nil))
	log.Fatal(http.ListenAndServe(":8080", nil))
}

index.html

<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>test</title>

</head>

<script type="text/javascript" src="moment.js"></script>
<script type="text/javascript" src="Chart.js"></script>
<script type="text/javascript" src="chartjs-plugin-streaming.js"></script> 



<script>  
    var ws;

    // websocketのオープン(この段階で接続完了)
    ws = new WebSocket('ws://localhost:8080/echo3')  // ユーザ登録画面

    ws.onopen = function (event) {
    }

    ws.onmessage = function (event) {
        // 送られてきたデータを受信して、JSON形式に変更
        var obj = JSON.parse(event.data);
        console.log("obj:",obj);
        console.log("obj.id:",obj.id);
        aa = obj.id;
    }
</script>  

<body BGCOLOR="black" text="white"  STYLE="overflow: hidden;">

	<center>
	  <font size="5">Waking Time(min.) <br></font> <!--- 意味のない表示 -->
	  <font size="5"> 歩行時間(分)</font> <!--- 意味のない表示 -->
	</center>
	
    <canvas id="myChart" width="100" height="85"></canvas>


<script>  
    var ctx = document.getElementById('myChart').getContext('2d');
			var chart = new Chart(ctx, {
				type: 'line',
				data: {
					datasets: [{
                        data: [],  // 1つめ
                        borderColor: "rgba(255,0,0,1)",
                        backgroundColor: "rgba(0,0,0,0)",  
                        lineTension: 0,
                        label: 'Time',
					}]
				},
				options: {
					scales: {
						xAxes: [{
                            type: 'realtime',
                            realtime: {
                                duration: 30000, // 300000ミリ秒(5分)のデータを表示 (コメントアウトすると早く動く)
                                onRefresh: function(chart) {
                                    chart.data.datasets.forEach(function(dataset) {
                                        dataset.data.push({
                                            x: Date.now(),
                                            //y: (Math.floor(Math.random()*16)+30) //30-45の乱数(整数)
                                            y: aa, // この"aa"が、送られてきたデータ
                                        });
                                    });
                                }
                            }

                        }],
                        yAxes: [{
					        ticks: {
					        	max: 20,
					        	min: 0
        					}
                        }]
					}
				}
			});

</script>

</body>
</html>

 

この場合、

  • /chart/index.htmlをベースとするサーバと、
  • echo3()が作るサーバ

の2つがある、ということ。

実際のところ、echo3は、/chart/index.html のクライアント(データの送信元)でもあるんだけど、要求があれば、ポコポコ作り出される、という点ではサーバでもある、という形になっています。

―― という説明を、次に私が頭を抱えた時に、私が思い出せるのかが、不安です

 

2023,江端さんの忘備録

『今のパーソナルコンピュータ(PC)の性能は、20年前のスーパーコンピュータ(スパコン)の性能と同じである』

"The performance of a personal computer (PC) today is the same as that of a supercomputer 20 years ago"

という話を聞いて、ちょっと計算してみました。

After hearing the story, I did some calculations.

- 2000年以降、PCとスパコンの性能差は、ざっくり1万倍になる

(引用先を失念しました。どなたか教えて頂ければ、記載いたします)

- After 2000, the performance difference between PCs and supercomputers have been roughly 10,000 times

- ムーアの法則「18ヶ月で性能が倍になる」

- Moore's Law "doubles performance in 18 months."

から考えると、

Given that from the information,

2^(x/1.5)= 10000 を解けばいい。

Solve 2^(x/1.5) = 10000.

x = 19.93 年

x = 19.93 years

なるほど、『私たちは、みんな、20年前のスパコンを使っている』ことになる訳です。

I see, 'We are all using 20-year-old supercomputers'.

つまり、理屈上、2003年の段階で、スパコンで計算していた天気予報や地震予測計算は、自分の部屋でもできます。

In other words, in theory, as of 2003, weather forecasts and earthquake prediction calculations that were being calculated on supercomputers can be done in your own room.

私から見れば『20年間待ち続ければいい』のです。

From my point of view, 'I just have to wait for 20 years'.

逆に言えば、スパコンへの開発や投資コスト(約1300億円、保守コスト抜き)は、この『20年間の先行』にあると言うことです。

Conversely, the cost of development and investment in supercomputers (about 130 billion yen, not including maintenance costs) is in this '20-year leading'.

皆さんが、どう考えるのは分かりませんが、私は、概ね妥当なコストだと思います。

I don't know what you all think, but I think the cost is generally reasonable.

2023,江端さんの忘備録

NHKスペシャル 「ナチス 科学者たちの罪と罰」を見ました。

I watched NHK Special "Crime and Punishment of Nazi Scientists".

まあ、題目からも明らかなように、ナチス・ドイツの様々な非人道的な政策に対して、科学的根拠(お墨付き)を与えるだけに留まらず、積極的に協力してきた科学者たちの話です。

Well, as is clear from the title, this is a story about scientists who have not only provided scientific evidence (endorsement) but have actively cooperated with Nazi Germany's various inhumane policies.

この番組を見て思ったことは、『科学者が"正義"を持つと、ろくなことにならん』というあたりまえの感想ではありません。

What I thought when I watched this program was not the obvious impression that "it is not good when scientists have "justice". It was, that

―― ああ、私だって、簡単に、そっち側になる

"Yeah, I could easily be on your side, too."

ということでした。

そもそも、今でこそ"ナチズム"は、完全否定される"悪"として断罪されていますが、当時のドイツ国内では"正義"であったし、いまでもナチズムの信奉者は少なからず存在します。

To begin with, "Nazism" is now condemned as an "evil" that is completely denied, but at that time it was "righteous" in Germany, and even now there are not a few adherents of Nazism.

そもそも"正義"と"悪"の概念は、時代と環境に応じて変化するものです。

To begin with, the concepts of "justice" and "evil" change with the times and the environment.

特に『権力サイドに忖度しなければ、殺されてしまう』という状況では、"正義"や"悪"などの概念を易々と越えてしまいます。

Especially in a situation where "if you don't give the power side the benefit of the doubt, you will be killed," the concepts of "justice" and "evil" are easily transcended.

-----

という話、これまでもいくつも書いてきたなぁ、と思い、同じことを繰り返して言う「認知症的症状」が顕著になってきているので、この話はここまでにしておきましょう。

I have written about this many times in the past, I thought. I have recently been suffering from "dementia-like symptoms" of repeating the same thing over and over again, so I will leave this story at this point.

―― 江端さんって、ナチズムの信奉者なのですか?

とは言え、私が録画している番組の多くに、「ヒトラー」「ナチス」「ナチズム」が入っています。

Nevertheless, many of the programs I record have "Hitler," "Nazis," and "Nazism" in them.

案外、私の家族が、私のことを『ナチス党員』または『ネオナチのシンパ』と思っているかもしれんなぁ、と心配になることがあります。

I sometimes worry that my family might think I am a 'Nazi Party member' or a 'neo-Nazi sympathizer.

------

念に為に、繰り返し申し上げておきますが、

Just to be sure, let me reiterate,

―― 「逆だよ! 逆! 私は『ファッキン、ナチ』の側だよ」

"It's the other way around. I am standing on the side of "Fucking Nazi!""

です。

2014,江端さんの忘備録

めずらしく、海外のSF小説を読んでいました。

After a long time, I have finished reading a foreign book of science fiction.

「ナチの亡霊」という本なのですが、科学ネタが多くて、それなりに面白かったです。

The title was "Black order” that includes a lot of science tips. I enjoyed it.

私は、「ナチ」とか「ヒトラー」とかが含まれている本に、フラフラと近寄っていく性癖があるようです。

I seem to be disposed to approach books whose title includes "Nazi" or "Hitler".

それを見た、私の後輩が、

My junior coworker, who know the above, asked me that

―― 江端さんって、ナチズムの信奉者なのですか?

"Ebata-san. Are you a believer of Nazism?"

と質問してきたことがありました。

「逆だよ! 逆! 私は『ファッキン、ナチ』の側だよ」

"It's the other way around. I am standing on the side of "Fucking Nazi!""

-----

やっぱり「夜と霧」は、影響大きかったかなぁ。

Actually "…trotzdem Ja zum Leben sagen: Ein Psychologe erlebt das Konzentrationslager (Kosel-Verlag, Munchen 1977)" impressed me deeply with pain.

最近では「ヒトラーの贋札」(映画でなくて本の方)も、―― ゲッソリしながらも ―― 読了しましたが。

Recently, I managed to finished reading "Die Falscher" (not movie but book) with pinch-faced.

-----

私は、変な力(反動勢力とか)が蔓延ってきたら、真っ先に、テロの対象になる自信があるのです。

I am confident that I am going to become a victim against terrorist of reactionary forces easily.

だって、結構、「反権力的」とも読めるコラムを、いくつもリリースしてしまっていますからね。

I have already released several columns, that some person might believe that I am an ant establishmentarian.

もう取り消せないし。

Also, I could not erase the facts.

ですから、いつでも逃げ出す準備を怠らないように、こういう本で、自分を「オレンジアラート」の状態にしているのです。

Therefore I keep giving me an "Orange alert" caution, because I could always run away as soon as possible.

2023,江端さんの忘備録

ここ1週間ほど、横浜市交通局バス関連リアルタイム情報の取得手段と、それを使ったビューアを作っていました。

「Protocol Buffersって何? 」から、「公共交通オープンデータ」を攻略する

For the past week or so, I have been working on a means of obtaining real-time information related to Yokohama City Transportation Bureau buses and a viewer that uses this information.

昨日1日で、基盤のコードを差し替えて、AWSにアップして、TLS対応して、最終的にサーバ化に成功しました。

Yesterday in one day, I replaced the code of the infrastructure, uploaded it to AWS, TLS support, and finally succeeded in making it a server.

しかし、私ですら、これがたった1日で完了するとは思っていなかったので、驚いています(大抵の場合、完工までは、見積の3~10倍になります)

But even I was surprised, as I did not expect this to be completed in just one day(In most cases, the estimated cost will be 3 to 10 times the estimated cost until completion).

どうして、こんなミラクルができたのか?

How was this miracle possible?

―― 過去の私が助けてくれたから

"Because my past helped me"

です。

-----

私、2020年5月に、自分のホームページのプラットフォームをWordPressに置き替えました。

I, in May 2020, replaced my website platform with WordPress.

で、そこに、ジャンル無視で、メモを書きまくり、無節操に公開してきました ―― よくご存知だとは思いますが。

And there I have been writing notes all over the place, ignoring genres, and publishing them in an uncontrolled manner -- as I'm sure you are well aware.

もちろん、そのメモは『私だけが分かれば良い』というものであって、前提条件や構築環境や指定するディレクトリなどは、全部無記載のままです。

Of course, the notes are 'only for me to know', and all the prerequisites, construction environment, and directories to be specified are left undocumented.

正直『私以外の他人が読んでも、まったく分からんだろう』と思います。

I honestly think, 'If someone else other than me reads it, they won't understand it at all.

しかし、書いてきた私にだけには『分かる』。

But only I, who have been writing, 'get it'.

これ、結構、重要です。

This is pretty important.

-----

このようなメモであれば、別にブログで公開しなくても良いと思いますよね。

If it is a memo like this, it doesn't needs to be published on a blog.

しかし「ブログ」にすると、『置き場所が分からなくなること』を防止できるのです。

However, "blogging" prevents 'misplacing'.

WordPressで一元管理すると、私がどこにいようが(会社、実家、大学、その他)、キーワード一発で、過去もメモを探し出すことができるのです。

When I centralize my notes in WordPress, no matter where I am (office, parents' house, university, etc.), I can find my past notes with a single keyword shot.

そして、WordPressは、コードを綺麗に表示したり、情報を貼り付けたりするのに、とても便利なのです。後日の追記も簡単です。

And WordPress is a great way to display code nicely and paste information. It is also easy to add later.

これに慣れてしまうと、メモ作りなんぞ、アホらしくてやってられません。

Once I get used to this, making memos is just plain stupid.

-----

もちろん、私のプライベートに関わるものもあるのですが、そのような情報は非公開にしています。

Of course, some of the information concerns my personal life, but I keep such information private.

ところが、WordPressは、この「非公開機能」が、あまり当てにならない。

WordPress, however, is not so trustworthy with this "private" feature.

で、今日、セキュリティ上の深刻な問題点を見つけてしまったので、大慌てて対応していました(本日の4時間を持っていかれてしまいました。まだ完了していません)。

So, today I found a serious security issue and was in a big hurry to deal with it (it took 4 hours of my day. It has not been completed yet).

-----

私、分からないことがあると、Googleよりも、自分のブログで検索をします。

When I don't know something, I search on my blog rather than Google.

相当高い確率で、私のブログは、私の疑問に応えてくれます。

At a fairly high rate, my blog answers my questions.

私自身は、『情報発信』なんぞは比較的どーでもよく、『過去の私に助けて貰う』という視点からブログを使い倒しています。

I myself am relatively unconcerned about "information dissemination" and use blogs from the perspective of "getting help from the past me.

そのツールとしてWordPressはお勧めです。

I recommend WordPress as a tool for this purpose.

まあ、私、ブログのプラットフォームとしては、ベタベタなhtmlとWordpressしか知らないので、比較のしようがありませんが。

Well, I only know sticky html and WordPress as blogging platforms, so I have no way to compare them.

未分類

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

2023,江端さんの技術メモ

公開回、秘密鍵の対応

log.Fatal(http.ListenAndServeTLS(*addr, "./cert.pem", "./key.pem", nil)) // localhost:8080で起動をセット

if httpErr = http.ListenAndServeTLS(*addr, "./fullchain.pem", "./privkey.pem", nil);

ということで、 cert.pem = fullchain.pem  key.pem = privkey.pem で良いのだろう

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