2023,江端さんの忘備録

最近、映画「八甲田山」と「二百三高地」を見直したのですが、『もの凄い映画だなぁ』と感嘆しました。

I recently reviewed the movies "Hakkoudasan" and "Nihyaku san Kochi" and marveled at what a great movie they are.

アナログ実写の迫力もさることながら、おそらくはロケ地の劣悪な環境下での疲労困憊の役者やエキストラの血を吐くような演技が ―― ぶっちゃけ『怖い』。

The power of the analog live action, as well as the blood-curdling performances of the exhausted actors and extras, probably under the poor conditions of the location, are honestly 'scary'.

最近の映画が、今一つ面白くないのは、映像のデジタル化かのためかなぁ、と思うのですよね。

I wonder if the reason why movies these days are not as interesting as they used to be is because of the digitalization of images.

―― というのが、一つの仮説です。

-- is one hypothesis.

ところが、私には、もう一つの仮説があります。

However, I have another hypothesis.

それは、『単に、私が若い頃に慣れ親しんでいる映像に、私が洗脳されているだけ』というものです。

It is, 'I am simply brainwashed by the images I am familiar with from my youth.

-----

『ションコネリー以外の007はカスだ』といっていた著名人がいましたが、私は『ロジャームーアの007』の方が面白いと思っています。

There was a celebrity who said, "007 other than Shon Connery is scum," but I think "Roger Moore's 007" is more interesting.

また、私が実家に帰省した時に、父は、私に1950-60年代のハリッド映画を見せようとしていましたが、私には、その面白みが全く伝わってきませんでした。

Also, when I went back home, my father tried to show me halid films from the 1950s and 1960s, but I never found them interesting.

つまり、「その人間にとって、特に多感な時代に刷り込まれた(映画の)記憶が、その後の価値基準になる」、つまり『すりこみ』です。

"The memories (of films) imprinted on a person, especially during his or her impressionable years, become the standard of value thereafter", in other words, "slip-in".

『自分にとって最上と思っているモノやコトが、他の人にとっては論外である』ということは、普通にあると思います。

It is common for people to say, "What I consider to be the best thing for me is out of the question for others".

-----

20年後に、私の孫が存在するどうかは分かりませんが ―― その孫に『シュタインズ・ゲート』を見せたら、どういう感想を持つのだろうか、と考えると、ドキドキします。

I don't know if my grandchildren will exist 20 years from now -- but I get nervous thinking about what they will think of "Steins;Gate" when I show it to them.

もし、孫が『面白い』と言ったら、私は孫にお年玉を沢山渡すだろうと思います。

If my grandson says 'that's great' I will probably give him a lot of New Year's money.

2023,江端さんの忘備録

現在、私は3つのプロジェクトに属していますが、3つのプロジェクトリーダーの全員が女性です。

Currently I am part of three projects and all three project leaders are women.

―― ということに、今さらながら、気がつきました。

I realize that now.

当然ですが、全員が年下です ―― というか、単に私が"シニア"というだけのことですが。

Of course, they are all younger than me -- or rather, I am simply a "senior".

仕事に関して『問題がない』というか『問題を認識できない』です。

I don't have a problem with my work, or rather, I can't recognize a problem.

私が不当に忖度(そんたく)されているという可能性 ―― いや、それは、"ない"と思う。

The possibility that I am being unfairly given careful consideration -- no, I don't think so.

私には人事権などの裁量が全くないですから。

I have absolutely no discretionary authority over personnel matters.

-----

ちなみに、私は、私を気持ちよく働かせてくれるのであれば、リーダーの性別や年齢に興味はなく、機械(AI?)に指示されたって、一向に構いません。

By the way, I am not interested in the gender or age of the leader, as long as they make me feel good about working for them. I don't mind being directed by a machine (AI?).

2023,江端さんの忘備録

私、瀬戸口みづきさんの著書が好きなのですが、その中でも「ローカル女子の遠吠え」は特に好きです。

I like Mizuki Setoguchi's books, especially "Howl of a Local Girl".


第9巻に記載されていた番外編の以下のセリフは、胸を打ちました。

The following lines from the extra edition listed in Volume 9 struck a chord.

======

『海外で貧困の現実を知りました』

"I learned about the reality of poverty overseas"

「それ国内でわかんなかったの? いいね押す代わりに、目玉に親指入れてやろうか」

"You didn't get that in Japan? I'll put my thumb in your eyeball instead of hitting the 'good' button"

======

少なくとも、私のティーンエイジャは、『目玉に親指入れらても文句は言えなかった』と思います。

At least, I think my teenager 'couldn't complain about having his thumb in his eyeball.

そして、"今ごろ"になって、その現実を(資料やデータから)知り、呆然とし、そして、そこから『目を背ける大人』になりました。

Then, "around this time", I learned of the reality (from data and documents), was stunned, and became an adult who "turned away" from the serious problem.

子ども達が、私のような大人にならないよう、また、私の大人を量産しないような教育を ―― (私以外のエラい人に)期待しています。

I hope that my children will be educated -- (by great other than myself) so that they will not become adults like me and not mass produce adults like me.

----

それと、以下のセリフも好きです。

And I also like the following lines.

======

「うーん・・・ 左右とか上下とかじゃなくて、人生ってもっと3Dじゃない?」

"Ummm... isn't life more 3D, not just left to right or up and down?"

======

うん、人生の次元は3Dどころか、もっとあると思います。

Yeah, I agree that there are more dimensions to life than just 3D.

ただ、私の場合は、極端に次元数が少ない気がします ―― 「パソコンの前に座っている/座っていない」の軸があるだけです。

However, I feel that I have an extremely low number of dimensions -- I just have a "sitting/not sitting in front of a computer" axis.

-----

ちなみに、現在、物理学において定説となっている理論(超弦理論)では、宇宙は少なくとも11次元あるそうです。

Incidentally, the currently accepted theory in physics (superstring theory) says that the universe has at least 11 dimensions.

いつか、きちんと勉強して、コラムのネタにしてみたいです。

Someday I would like to study it properly and use it as fodder for a column.

2023,江端さんの技術メモ

strconv.FormatFloatだの、strconv.FormatIntだの、色々あるけど、

fmt.Sprint(x)  xは、整数でも実数でも可

で十分だと思う。

2023,江端さんの忘備録

今年の下半期からの忙しさは凄かったと思います。

I think I have been very busy since the second half of this year.

それでも、なんとか凌げていたので『なんとかなるもんだなぁ』とか思っていました。

Still, I managed to get by, so I thought, 'I guess I can get by'.

しかし、歯痛→腰痛→風邪による全身疲労が、ここ2週間くらい立て続けで発生し、予定通りに物事が進んでいません。

However, things have not been going as planned due to a series of dental pain, back pain, and general fatigue caused by a cold that has been occurring in rapid succession for the past two weeks.

「パフォーマンスが発揮できない」 → 「予定した仕事が進まない」 → 「焦る」 という段階までは、よくあるのですが、今は、

I have often experienced the "I can't perform" → "I can't get the work done" → "I'm in a hurry" phase. However Now the situation is as follows.

『何か考えようとすると、吐き気がする』

'I get nauseous when I try to think about anything'

という状況です。

こうなると、もう、何もできなくなります

When this happens, there is nothing more that can be done.

こういう状況になって、普段の自分を俯瞰すると、

In situations like this, when I look down on my normal,

―― 私、一体、何のために、毎日あんなに頑張っていたんだっけ?

"What in the world was I working so hard every day for?"

という気持ちになってきます。

This is the feeling I have now

-----

多分、私は、この状態が回復したら、こんなことを忘れたかのように、自分のことや、他人のことを言い始めると思います。

Maybe when I recover from this condition, I will start talking about myself and others as if I have forgotten all this.

しかし、今の『弱っていて、何もできないこの状態の自分がデフォルト』である、ということを覚えておくために、この日記を残しておきます。

However, I leave this diary to remember that I am now 'weak and unable to do anything about this situation', which is my default.

被災して、罹患して、心が壊れて、疲れ果てて、立ち上がることもできない人々に、『がんばれ』とだけ言い放つ人間にだけは決してなるまい、と、再度、自分に言い聞かせるためにも。

To remind myself once again that I will never make me a person who only says, "Hang in there," to people who have been affected by the disaster, who have been afflicted, who are broken, exhausted, and unable to stand up.

今は頑張らなくていいんですよ

 

2011,江端さんの忘備録

命からがら逃げてきて、今日の命を生きているのがやっとの人たちに、

電気があって、御飯が食べられて、ゆっくり寝られる人達が、

よくもまあ、あれほど簡単に、

「がんばれ」

を連発できるものだと思っています。

「かならず復興する。日本人は強い。信じている」

復興する為に、被災地の人は、がんばらなければならないのか?

アンタが信じていたら、それが一体何の役に立つというのか?

-----

違うだろう。

「がんばる」のは被災地の人ではない。

幸いにして被災地にいなかった人だ。

『いままで本当に大変でしたね。当面、私達にやらせて下さい。今は頑張らなくていいんですよ』

『もう帰ってこない人もいて辛いと思うけど、でも、できるだけ早く、また同じように生活できるように、私達ができることはするから。途中で逃げたりしないから』

と、なぜ言ってあげられない。

-----

13年前、私が被災地に入って、ほんの少し(3日間)だけボランティアで働かせて貰った時のことです。

被災地のレポートを開示したのですが、その時に貰ったリプライへの「すさまじい違和感」を今でも覚えています。

例えば、――『被災地のハザードマップを組み込んだGPSを開発して、被災地に送ってはどうか』

あるいは、―― 『通信インフラを確保する、自律型の通信中継器を開発して、提供してはどうか』

この意見は、誠に建設的かつ実用的、加えて有用な提言ではありますし、私も、被災地に出かけていかなかったら、間違いなく同じことを言っていたと思うのです。

でも違うんです。

-----

『違うんだ!今、本当に必要なのは、「水」「食い物」そして「屋根」だ!』

と、叫びそうになって ―― でも、黙っていましたけど。

そんなことを言ったら、誰もが萎縮してしまって、何も言わなくなってしまうと思ってしまったからです。

それは良くないことだと思いました。

-----

そして、残念ながら、今私が毎日書いている日記が、上記と同じような、的外れなことを言っているのだろうことを――

そして、また、命を守る為の日々を生き、また、命を賭けて闘っている最前線の多くの人を、無造作に傷つけているのだろうことを――

どこに向かって申し上げれば良いのか分からないまま、今、天を仰いで、お詫びしたい、と思っています。

2023,江端さんの忘備録

■日中、倦怠感でだるさを感じる

- Feels tired throughout the day

■夜中に咳で目がさめる。

- Wake up at night with a cough.

■喉にタンが絡む。タンを切る時に痛みがある

- Phlegm in throat. Pain when cutting phlegm.

■夜寝る前に猛烈な悪寒がある

- Violent chills before going to bed at night.

■夜中にぐっしょりの汗をかく

- Sweating profusely at night

■水は定期的に摂取している。

- Water is consumed regularly.

■市販薬は、「改源」と「コンタックEX」を摂取したが、改善は見られない

- Over-the-counter medications were ingested "Kaigen" and "Contac EX", but no improvement was seen

-----

というメモを作って、本日クリニックに行ってきました。

I went to the clinic today after making the note.

コロナかインフルエンザか、とも思ったのですが、熱が36.6度なので、どっちでもないだろうなと思いました。

I thought it might be corona or influenza, but since my fever was 36.6 degrees, I thought it could be neither.

それでも、発熱者扱いとして、診察室の外で待たされました ―― 窓が開けっぱなしの廊下は寒かったです。

Still, I was treated as a fever patient and made to wait outside the examination room -- it was cold in the hallway with the windows left open.

-----

薬を貰って、早速飲みました。

I got the medicine and took it immediately.

その一時間後ですが、さっきまで指一本動かせない倦怠感の中にいたのですが、、現在は、この文章を書ける状態になっています(まだ、倦怠感はあります)。

An hour later, I was in a state of fatigue where I could not move a finger, but now I am able to write this sentence (I still have the fatigue).

やっぱり処方薬は凄いなぁ、と思いました、

I knew that prescription drugs were great.

2023,江端さんの忘備録

■自分の魅力や能力を、過去の実績で語っても無駄

- Talking about one's attractiveness and abilities in terms of past achievements is useless.

■自分の魅力や能力をを主張したいのであれば、まさに"今"の、"現在進行形"の自分の仕事や学業で見(魅)せなければならない

- If you want to assert your attractiveness and abilities, you must show them through your work and studies in the "present" and "ongoing" state.

―― と。

以前、私の娘に、自分の過去の経歴をメールで送ってきたおっさん(定年後)のことを思い出していました。

I was reminded of an old man (retired) who once emailed my daughter about his past career.

仕事やら海外赴任や自分の職歴やらの情報が書かれていて ―― この私ですら、その内容に"ドン引き"しました。

It contained information about my job, overseas assignments, his work history, etc. - even I was "taken aback" by the contents.

本件、娘から相談されたので、私が穏便な対応策(個人情報保護に関する事項)を娘にアドバイスして、事なきに至ったようですが。

Since my daughter consulted me on this matter, I advised her on how to deal with the matter (matters related to the protection of personal information) in a calm manner. After that it seemed to be resolved.

シニアの『"昔の武勇伝"ハラスメント』を叩き壊すのに、十分な、脅威(恐怖)だっただろうと思います。

-----

―― 自分のシニアを放置し続けると、どんどん自分を見苦しくすることになる

"If you continue to neglect "your old", you will make yourself look worse and worse"

ということを、私に実感させてくれた事件でした。

This was an matter who made me realize that.

しかし、『シニアになると、ジュニアの頃のパフォーマンス』が発揮できなくなるのは、本当です。

However, it is true that 'as you become a senior, you cannot perform as well as you did as a junior.

ですから、『過去の自分の栄光にすがりつきたい』『他の人に、過去の自分のスゴさを理解して貰いたい』というシニアの気持ちは、よく分かるのです。

Therefore, I understand the senior's desire to 'hang on to his past glory' and 'have others understand how great he was in the past.

-----

その点、私は、コラムなどで『過去の自分の栄光』を語れるフィールドがあって、かなり幸せだなぁ、と思っています。

In that respect, I am quite happy to have a field where I can talk about my 'past glory' in my columns and so on.

故に、今、私は、最大の感謝と忖度(そんたく)を込めて叫びます。

Therefore, I now want to exclaim with the utmost gratitude and condescension.

『EE Times Japan 編集部 万歳 !』

"Long live the editors of EE Times Japan!"

2023,江端さんの忘備録

私が自分のブログで、頻繁に、短いプログラムをアップロードしているのは、マニュアル読んだって、APIの使い方が分からないからです。

I frequently upload short programs on my blog because I don't know how to use the API even after reading the manual.

このようなマニュアル読んでもさっぱり分からないし、サンプルプログラムは、私のやりたいこととズレています。

I have no idea what I'm doing by reading these manuals, and the sample programs are out of sync with what I want to do.

ですので、以下のように、

So, as shown in the following

golangによるcsvファイルのライン単位での書き出し方法

実際に、自分で書いて動いたコードを、小まめに残するようにしています。

In reality, I try to keep a small code that I have written and worked with.

他の人の役に立つかどうかは、二の次です。

Whether it is useful to others is secondary.

この方法に名前をつけるとすれば「具体例ベース」というのかもしれません。

If I had to give a name to this method, it might be called "concrete example-based".

それはさておき。

Aside from that.

-----

イベントの招待状などで、『平服にてご参加下さい』という文言が入っていることがありますが ――

In invitations to events, you may see the phrase, "Please attend in plain clothes.

私に言われれば、これは、最低最悪のホスピタリティです。

If you ask me, this is hospitality at its worst.

つまり『礼服はやめてね』と言っているだけで、カジュアルのレベルの判断をゲストに押しつける、無責任極まりない要求であるからです。

In other words, he/she is simply saying, 'Please don't wear formal wear,' and you are forced to judge the level of casual wear. This is an extremely irresponsible request.

ゲスト(招待客)は、カジュアルのレベルを間違えて、会場で恥しい思いをするかもしれません ―― しかし、そういう配慮をするホスト(主催者)には、滅多にお目にかかることができません。

Guests (invitees) may be embarrassed at the venue because of the wrong level of casualness -- but I rarely see a host (organizer) who takes such considerations into account.

-----

先日、父と母の納骨供養の案内を出しました。

I recently sent out information about the event laying their ashes to rest for my father and mother.

江端一夫・瑤子 納骨供養のご案内(公開版)

その中で、私は、ドレスコードを以下のような文章で、正確に規定しました。

In it, I have defined the dress code precisely in the following sentence.

『ご都合がよろしければ、平服にて御気軽にお立ち寄りをご検討頂ければ幸いです』

I hope you will consider stopping by in plain clothes if it is convenient for you.

『(私(智一)は、ジーパンとスニーカーと数珠持参で参加予定です)』

I (Tomoichi) will wear jeans, sneakers and prayer beads.

このように、ホストが、ホスト自身のドレスコードを具体的に提示することで、ゲストの負担を減らすことができます。

In this way, the host can reduce the burden on the guests by providing them with a specific dress code for themselves.

これが、「具体例ベース」です。

It is "concrete example-based".

-----

今後、「平服」を具体例で示さないホストには、このブログのURLをメールで送りつけようと考えています。

In the future, I will email the URL of this blog to hosts who do not provide specific examples of "plain clothes".

2023,江端さんの技術メモ

Keyword: golang csv write 書き出し ライン

package main

import (
	"database/sql"
	"encoding/csv"
	"fmt"
	"log"
	"os"

	_ "github.com/lib/pq"
)

func main() {
	file, err := os.Open("yamaguchi_area.csv")
	if err != nil {
		log.Fatal(err)
	}
	defer file.Close()

	r := csv.NewReader(file)
	rows, err := r.ReadAll() // csvを一度に全て読み込む
	if err != nil {
		log.Fatal(err)
	}

	str := "SELECT ST_Covers(st_geomfromtext('POLYGON(("

	// 行ごとに
	for i, row := range rows {
		if i == 0 {
			continue // CSVのヘッダー行を無視
		}

		str += row[1] + " " + row[2] + ", " // rowのままで取り出せば、文字列になっている

	}
	str1 := str[:len(str)-2] + "))'),st_geomfromtext('LINESTRING(" // 上記の最後の", "を削除して、文字列を追加

	dbMap, err := sql.Open("postgres",
		"user=postgres password=password host=192.168.0.23 port=15432 dbname=yama_db sslmode=disable")
	log.Println("------------------ map db open ------------------")
	if err != nil {
		log.Fatal("OpenError: ", err)
	}
	defer dbMap.Close()

	///////////////////////////////////////

	file2, err2 := os.Open("20220518weekday.csv")
	if err2 != nil {
		log.Fatal(err2)
	}
	defer file2.Close()

	r2 := csv.NewReader(file2)
	rows2, err2 := r2.ReadAll() // csvを一度に全て読み込む
	if err != nil {
		log.Fatal(err2)
	}

	file3, err3 := os.Create("testtest.csv")
	if err3 != nil {
		panic(err)
	}
	w := csv.NewWriter(file3)

	for _, row := range rows2 {
		//if i == 0 {
		//	continue // CSVのヘッダー行を無視
		//}

		str2 := str1 + row[0] + " " + row[1] + ", " + row[2] + " " + row[3]

		str2 += ")'))"

		//fmt.Println(str2)

		rows1, err := dbMap.Query(str2)
		if err != nil {
			log.Fatal(err)
		}
		defer rows1.Close()

		//var dt string
		var dt bool

		for rows1.Next() {
			if err := rows1.Scan(&dt); err != nil {
				fmt.Println(err)
			}
			// fmt.Println(dt)
			if dt {
				output := []string{row[0], row[1], row[2], row[3], row[4]}
				//fmt.Println("output:", output)

				if err = w.Write(output); err != nil {
					log.Fatal(err)
				}
			}
		}

		err = rows1.Err()
		if err != nil {
			panic(err)
		}

		defer w.Flush()

		if err := w.Error(); err != nil {
			log.Fatal(err)
		}

	}
}

重要なのは、以下のコード

file3, err3 := os.Create("testtest.csv")
if err3 != nil {
panic(err)
}

w := csv.NewWriter(file3)

output := []string{row[0], row[1], row[2], row[3], row[4]}
//fmt.Println("output:", output)

if err = w.Write(output); err != nil {
log.Fatal(err)
}

defer w.Flush()