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

最近、Web広告で、「異世界転生のマンガ」が良く出てきます。

Lately, I've been seeing a lot of "cross-world reincarnation manga" in web ads.

なぜ、そのような広告が出てくるかというと、私は律儀に広告を読んできるからです。

The reason why such ads appear is because I can read the ads in a disciplined manner.

「異世界転生」のコンテンツは、現実逃避心理の具現化 ―― などとヤボなことを言うのは止めましょう。

The content of "reincarnation" is an embodiment of the psychology of escaping from reality -- however, let's not say that it's a bad thing.

夢を見る/見せるのが、創作者と創作物の仕事です。

Dreaming/showing is the job of the creator and the creations.

―― 今の知識を持ったまま、小学生になって、大人(教師)をやりこめてやりたい

"I want to be an elementary school student with the knowledge I have now, and I want to beat up the adults (teachers)"

なんていうのも、まあ、現実逃避の一態様と言えましょう。

It is also a form of escapism.

(こちらで書いた内容と、ほぼ同旨です)

(This is almost the same as what I wrote here.)

-----

私は、どんな世界に、転生したいのだろう、と考えてみました。

I wondered what kind of world I would like to be reincarnated in.

しかし、これが、どうにも、具体的にイメージできないのです。

However, I can't seem to visualize this in any concrete way.

「異世界転生」のコンテンツから考えてみるに、

I'm thinking in terms of the content of "Reincarnation"

転生先は、

■未来のできごとを知っている過去の世界

- A world in the past that we know the events of the future.

■医学や科学が発展していない中世の世界

- A medieval world where medicine and science have not yet developed

■現世では使えない魔法やら超能力が使える世界

- A world where magic and supernatural powers that cannot be used in this world

という設定であることが多いことから、

These worlds often appear. So I think I want to be reincarnated,

―― 現世界で、苦労しながら培ってきた知識や技術を生かせる世界

"A world where I can use the knowledge and skills I have cultivated through hard work in the current world"

に、私は転生したいと思っているようです。

-----

ということは、「異世界転生」の世界を楽しく生きる為には、「現世界」において、苦労やら、努力やら、嫌な目に合い続けることが前提条件となる、ということになります(確認)。

This means that in order to live happily in the world of "otherworld reincarnation", I must continue to face hardships, efforts, and unpleasant experiences in the "present world" (checked).

ということは、私たちは、「現世界」において、「苦労をしない」「努力をしない」「嫌な目に合わない」ための努力はせずに、努力の必要のない「異世界」の方を夢見ていたい、ということです(確認)。

This means that I want to dream about the "other world" where we don't have to make any effort in order not to have any hardship, not to make any effort, and not to get into any trouble in the "present world", and I want to dream about the "other world" where we don't need to make any effort (checked).

-----

―― なんだ、これなら、「幸せな来世の為に、現世で功徳を尽くせ」と主張している宗教(カルトを含む)の方が、まだマシじゃねーか

"In this case, religions (including cults) that insist on "doing meritorious deeds in this life for a happy next life" are still better"

などと、思ったりしています。

I am afraid that I noticed that.

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

コロナ禍における在宅勤務の重要なミッションは、「体重管理」と「定期的な運動」です。

The key missions of telecommuting in Corona disaster are weight control and regular exercise.

最近、分かってきたのですが、体重計をストーブの前に置いておくと、体重が200gほど軽く表示されます。

Recently, I have come to understand that if I leave the scale in front of the stove, it will show my weight about 200 grams lighter.

という訳で、ここのところ、体重測定の前には、体重計をストーブで十分に温めています。

So, these days, before weighing myself, I warm up the scale sufficiently on the stove.

-----

ちなみに、嫁さんには『何、考えているのか分からん』と言われています。

By the way, my wife says to me, "I don't know what you're thinking.

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

安定剤を飲もうが、睡眠薬投与しようが、疲れが取れなくなってきたので、久々に駅前のスーパー銭湯のサウナに入ってきました。

I took a sauna at the super public bath in front of the station for the first time in a long time, since I couldn't get rid of the tiredness no matter if I took stabilizers or sleeping pills.

緊急事態宣言の最中ですが、銭湯には、結構なお客が入っていました。

Although we are in the middle of declaring a state of emergency, there were quite a few customers in the public bath.

まあ、それはさておき。

Well, that's beside the point.

----

定員20人程度のサウナの中には、10人くらいの人が入っていて、みんな黙々と正面のテレビ画面を見ていました。

There were about ten people in the sauna, which had a capacity of about twenty, and they were all silently watching the TV screen in front of them.

バラエティ番組の中で、尾道のジーンズの話題が出ていました。

In one of the variety shows, the topic of jeans in Onomichi came up.

―― 実際にジーンズを尾道の人に履いてもらって、ダメージジーンズを作る

"Making damaged jeans by having people in Onomichi actually wear the jeans"

とか、聞いて驚いたのですが、さらに驚いたことに、それが原価の2~3倍の値段で売れる、という話でした。

I was surprised to hear that, and even more surprised to hear that it could be sold for two to three times the cost.

-----

私、ダメージジーンズに対して1mmも価値を見い出せない、ジーンズ使用者です。

I'm a jeans user who doesn't see even 1mm value in damaged jeans.

しかし、私は、

However,

「Amazonで格安ジーンズを購入して、破れるまで履き潰し、破れても木工用ボンドで修繕する」

"I buy cheap jeans from Amazon, wear them down until they rip, and when they do, I repair them with wood glue"

という人間なので、「ダメージジーンズ」の価値を共有することは、そもそも無理なのです。

So, it's impossible for me to share the value of "damaged jeans".

-----

ちなみに、

Incidentally,

―― ITエンジニアが、在宅期間中に、自宅で1年間履き続けたジーンズは、おいくらになるのでしょうか?

"How much would you pay for a pair of jeans that an IT engineer wore at home for a year while he was at home?"

と、下らないことを考えていました。

I was thinking about something trivial in the sauna.

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

長女:「世の中には、『正義と悪』という基準と『好きと嫌い』という基準の2つがある、って、誰かが言っていた」

Daughter: "Someone once told me that there are two standards in the world: 'justice and evil' and 'like and dislike'"

江端:「それは違うな。『好きと嫌い』という基準が1つあるだけだ」

Ebata: "That's not true. There is only one standard, 'like and dislike'"

長女:「『正義と悪』はないの?」

Daughter: "Isn't there a 'Justice and evil'?

江端:「『正義と悪』は、所詮は相対的な概念だ。立ち位置によって、簡単に180度ひっくり返るものであるから、私は、あまり重要とは思っていない」

Ebata: "'Justice and evil' is just a relative concept. It can be easily turned 180 degrees depending on where we stand, so I don't think it's very important.

-----

まあ、もっとも『絶対的正義』というものを求めて、古今東西多くの哲学者が死ぬほど考えて抜いてきたことは、私も知っています。

Well, I know that many philosophers in the past and the present have thought to death in search of the most 'absolute justice'.

しかし、死ぬほど考えなければ分からないものであるなら、それを共通の価値基準に置くのは、酷く面倒くさい上に、逆に「危い」とさえ思っています。

But if it's something we have to think about to death to understand, I think it's terribly tedious and even "dangerous" to put "absolute justice" as a common value standard.

-----

江端:「そもそも、法治国家における法治 ―― まあ、裁判はその一例だが ―― この運用がどのように行われるかしっているか?」

Ebata: "To begin with, do you know how the operation of the rule of law in a country under the rule of law is carried out? Well, the trial is just one example"

長女:「『主観を排して、証拠と法に基いてのみ人間を裁くこと』でしょう?」

Daughter: "To judge a person only on the basis of evidence and law, without 'subjectivity' right?

江端:「それは建前だ。この話は、法学ゼミで教えて貰って、私自身も仰天したことだが ――」

Ebata: "That's a pretext. This story was taught to me in law seminar, and I myself was astonished...."

といって、私は裁判のプロセスを語り出しました。

Then I started to talk about the process of a trial.

-----

(Step.1) 裁判官は、主観で被告の「好きと嫌い」を決めて、有罪/無罪および、その刑量をざっくり思い浮かべる。

(Step.1) The judge decides on the subjective "likes and dislikes" of the defendant and comes up with a rough idea of guilt/innocence and the amount of the sentence.

(Step.2) 次に裁判官は、この有罪/無罪、および刑量を導き出すための、複数の法律の条文を頭の中で並べる

(Step.2) The judge then lays out in his or her mind the multiple articles of law from which to derive this guilt/innocence and sentence amount.

(Step.3) 裁判官は、これらの条文を、担当事件の内容に当てはめられるかどうかを検討する。上手くはまれば、判決に適用する

(Step.3) The judge considers whether these articles can be applied to the case in question. If it works, they apply it to the judgment.

-----

江端:「でもって、上記(Step.1)~(Step.3)は、裁判官だけでなく、検察、弁護人も共通認識として共有している。そんでもって、この3者の関係者が、判決の落とし所を擦り合わせていく ―― これが、基本的な裁判のアプローチだ」

Ebata: "The above (Step.1) to (Step.3) are shared by not only judges but also prosecutors and defense attorneys. Then, these three parties work together to reach a decision. This is the basic trial approach.

長女:「うそ・・・」

Daughter: "No way..."

江端:「勿論、上記は、状況証拠も物的証拠も明らかであって、かつ、民事裁判のケースの話になるけど、ここに情状酌量の余地とか、世論の動向とか、社会通念とかをつっこんで、『この被告を、どこまで許せるか』という主観的基準で判決はされるんだよ」

Ebata: "Of course, the above is a civil case with clear circumstantial and physical evidence, however, they can add extenuating circumstances, trends in public opinion, and social norms. And finally, the judgment is made based on the subjective standard of "How much can I forgive this defendant?""

長女:「『正義と悪』が基準ではないんだ・・・」

Daughter: "'Justice and evil' is not the standard...

江端:「『正義と悪』は、『好きと嫌い』の理由付けとして存在している『道具概念』だ」

Ebata: "'Justice and evil' is a 'tool concept' that exists as a rationale for 'like and dislike'."

長女:「ならば、法律の存在意義がないじゃんか?」

Daughter: "Then what is the point of the law's existence?

江端:「いやいや、大切なのは「たとえ『好きと嫌い』から出発しても『好きと嫌い』だけを理由には判決はできない」、という、この一点にある」

Ebata: "No, no, the important point is this: 'Even if they start from 'like and dislike', they can't make a judgment based only on 'like and dislike'".

長女:「?」

Daughter: "?

江端:「どんな法律でもいいけど、必ず明文化された法律に基づいて論理的に(見せかけて)判決を出さなければならない ―― これが法治の理念で、最後の砦でもある」

Ebata: "It doesn't matter what kind of law they use, but they must always make a logical (pretend) judgment based on a clearly stated law -- this is the principle of the rule of law, and it is also the last resort."

-----

まあ、そういう意味において、「遠山の金さん」は、『好きと嫌い』だけで、しかも独断で判決をしていた訳ですから、考えてみれば、背筋の凍るような恐しい裁判方法だった訳ですよ。

In that sense, "Toyama no Kin-san" made judgments based on "likes and dislikes" alone, and at his own discretion.

私としては、「遠山の金さん」は、間違いなく「冤罪製造システム」として機能してきたと思んです。

As for me, I think that "Toyama no Kin-san" has definitely functioned as a "false accusation manufacturing system".

そんな訳で、私は、

That's why I want to watch a TV drama whose title is

―― 「遠山の金さん "冤罪"捕物帳」

"Tozan no Kin-san, the 'False Accusation' Catcher's Notebook"

というドラマを見たいんですよね。

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

今放送されている「天地創造デザイン部」というアニメが面白いです。

There is an interesting anime currently airing called "Tenchi Sozo Design Club(Creation Design Department)".

動物や植物が、「今の形態に『進化』」している ―― まあ、進化論を信じない人にとっては「神が『設計』」した理由が、コメディちっく、かつ、ロジカルに説明されていて、面白い。

The reason why animals and plants have "evolved" into their current forms, for those who don't believe in the theory of evolution, it's "God's 'design'", is explained in a comedic and logical manner.

このアニメのコンセプトが、イケています。

This anime has a cool concept.

―― 天地を創造した神は天地や水を造った時点で面倒になって、生き物を造るのは"下請け"に任せることにした

"God, who created the heavens and the earth, got tired of creating the heavens and the earth and the water, and decided to leave the creation of living things to "subcontractors""

クライアント(神)が、中途半端でアバウトな生き物の要求仕様(例:「可愛くないけど、可愛い動物」)を出しては、適当にボツにを連発される様子とか ―― 涙なくしては見られないです。

I can't watch this anime without crying, when the client (God) gives a half-hearted, out-of-the-box specification for a creature (e.g., "not cute, but cute animal"), and the client rejects the designs at random.

また、デザイン通りに、実際に生物の試作を作っては、問題点を明確に指摘する「火口(ひぐち)さん(*)」に、非常に共感しています。

I also have a great deal of sympathy for Ms. Higuchi(*), who actually makes prototypes of living things according to the design and clearly points out the problems.

(*)動物部試作室にいる唯一のエンジニアの女性

(*)The only female engineer in the Prototype Room of the Animal Department.

-----

このコンセプトは、私の日常では、こう読み換えることができます。

In my daily life, this concept can be read the following way.

―― ITプラットフォームを創造した総合電機メーカはAPIを設計した時点で面倒になって、アプリケーションやサービスを造るのは“下請け”に任せることにした

"The general electronics company that created the IT platform got tired of designing APIs and decided to leave the creation of applications and services to "subcontractors"."

あるいは、こう読み換えることもできます。

Or I can read it this way.

―― 次世代社会インフラのコンセプトをぶちあげた幹部は、コンセプトを発表した時点で面倒になって、実装や実証実験や特許出願を、"研究部"に丸投げすることにした

"The executives of the company that came up with the concept for the next generation social infrastructure got tired of the concept once it was announced, and decided to throw the implementation, demonstration tests, and patent applications to the "research department"."

-----

私は、これまで、加害者(クライアント)と、被害者(ホスト)の両方の当事者になってきたと思います。

I think I've been both the perpetrator (client) and the victim (host).

当然のことながら、加害者としての自分は認識しにくいですが、被害者視点なら言えることは山ほどありそうです。

Naturally, it's hard to recognize myself as a perpetrator, but there's a lot I can say from a victim's perspective.

例えば、

For example, I am likely to say that

『フィールド実験をやれというのであれば、まず、お前が先頭にたって、システムチューンのために、極寒の真冬の夜の街の中を走り回って見せろ』

"If you want me to do a field experiment, you're going to have to take the lead and run around the city on a sub-zero night in the middle of winter to tune the experiment system"

くらいのことは、いつも思っています。

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

できるだけ手を抜いて、目の前の課題を、コンピュータでちゃっちゃと解いてしまいたい、とあるIT研究員のメモを公開します。

This is a memo of an IT researcher who wants to cut corners as much as possible and use a computer to quickly solve the task at hand.

医院までの徒歩の時間と待合室の待ち時間で、書き殴ったものです。

I described this down in the time to walk to the doctor's office and wait in the waiting room.

このメモだけで、3つほど発明(といってもアルゴリズムだし、到底「特許発明」にはなりませんが)が入っています。

This memo alone contains about three inventions (although they are algorithms and hardly "patentable inventions").

もし、この中に何が書いてあるか、理解できる人がいたら、是非ご一報下さい。

If anyone can understand what is written in this memo, please let me know.

このメモは、江端が「ものぐさ」で「字が汚い」だけのもの、と思われている人もいると思いますが ――

Some people may think that this memo is only for Ebata, who is "lazy" and has "dirty handwriting, however,

世の中の研究員が「モノを考えている時のメモ」って、みんな、こんな感じです(本当)。

This is what all the researchers in the world write down when they are thinking about something (really).

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

 

 

■2点間の距離の算出

 

float ST_Distance(geometry g1, geometry g2);

float ST_Distance(geography gg1, geography gg2);

 

============

139.46383010 35.6078055 と 139.48004430 35.58936550 の距離を求めろ

============

 

SELECT ST_Distance('SRID=4326;POINT(139.46383010 35.6078055)'::GEOGRAPHY,'SRID=4326;POINT(139.48004430 35.58936550)'::GEOGRAPHY);

 

st_distance

---------------

2518.87992511 (単位はメートル)

(1 行)

 

 

SELECT ST_Distance(ST_Transform(ST_GeomFromText('POINT(139.46383010 35.6078055)',4326),26986),ST_Transform(ST_GeomFromText('POINT(139.48004430 35.58936550)',4326),26986));

 

st_distance

-----------------

2534.9890933572 (単位はメートル)

(1 行)

 

============

点(139.46507, 35.59577)と source 608 の距離を求めろ

============

 

SELECT ST_Distance('SRID=4326;POINT(139.46507 35.59577)'::GEOGRAPHY, the_geom) from ways where source = 608;

 

st_distance

-------------

48.64958043 (単位はメートル)

(1 行)

 

 

■点と線の最短距離の算出

 

===================

点(139.46383010 35.6078055) と

線(139.47364070 35.59500190),(139.47500790 35.59561250),(139.47618950 35.59667510) の # 3点は繋がっている

最短距離を求めろ

===================

 

SELECT ST_Distance('SRID=4326;POINT(139.46383010 35.6078055)'::GEOGRAPHY,'SRID=4326;LINESTRING(139.47364070 35.59500190,139.47500790 35.59561250, 139.47618950 35.59667510)'::GEOGRAPHY);

 

st_distance

---------------

1667.13188667 (単位はメートル)

(1 行)

■任意の座標に近いノードを1つ抽出

SELECT source, x1 as longitude, y1 as latitude, ST_Distance('SRID=4326;POINT(139.78468208 35.64553503)'::GEOGRAPHY, the_geom) as dist FROM ways ORDER BY dist limit 1;
;
source | longitude | latitude | dist
--------+-------------+------------+-------------
742 | 139.7831864 | 35.6469072 | 20.44846388
(1 row)

 

■任意の座標に近いノードを抽出

 

boolean ST_DWithin(geometry g1, geometry g2, double precision distance_of_srid);

boolean ST_DWithin(geography gg1, geography gg2, double precision distance_meters);

 

===============

点(139.47500790 35.59561250)から半径300メートル以内の全部のノードを、近い順に出せ

===============

 

SELECT source, x1 as longitude, y1 as latitude, ST_Distance('SRID=4326;POINT(139.47500790 35.59561250)'::GEOGRAPHY, the_geom) as dist FROM ways WHERE ST_DWithin(the_geom, ST_GeographyFromText('SRID=4326;POINT(139.47500790 35.59561250)'), 300.0) ORDER BY dist;

 

 

source | longitude | latitude | dist

--------+-------------+------------+--------------

277 | 139.4742202 | 35.5952626 | 0

342 | 139.4737614 | 35.5960846 | 0

554 | 139.4750079 | 35.5956125 | 0

554 | 139.4750079 | 35.5956125 | 0

465 | 139.4756076 | 35.5956018 | 54.35238655

465 | 139.4756076 | 35.5956018 | 54.35883189

148 | 139.4753681 | 35.5942035 | 62.47683957

488 | 139.4755625 | 35.595278 | 62.47683957

277 | 139.4742202 | 35.5952626 | 78.20859781

309 | 139.4758617 | 35.5957534 | 78.9363046

309 | 139.4758617 | 35.5957534 | 78.9363046

163 | 139.4736407 | 35.5950019 | 81.2567669

597 | 139.4728928 | 35.5961536 | 81.2567669

406 | 139.4760808 | 35.5958841 | 101.79071989

211 | 139.4761077 | 35.5959027 | 104.73755527

580 | 139.4761706 | 35.5959419 | 111.52418485

201 | 139.4762056 | 35.5959637 | 115.32014973

(単位はメートル)

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

『市場の評価は・・・』というセリフをニュースで良く聞きます。

I often hear the line, "Market valuation is..." in the news.

しかし、最近の株価を見てみると、その『市場』と呼ばれる奴は、実際のところ『バカ』なんじゃないかと思うことがあります。

However, when I look at recent stock prices, I sometimes think that this so called "market" is actually "stupid".

実際に、不動産の適正価格を算出できず、我が国を20年も回復不能な不景気に貶めたのは『市場』という奴でした。

In fact, it was the "market" guy who failed to calculate a fair price for real estate and plunged our country into an unrecoverable recession for 20 years.

米国から発生した、リーマンショックだって同様です。

The Lehman Shock that originated in the United States is same.

大体、私、証券も株券も国債も、ありとあらゆる債券を持っていないです。故に売買もできません。

I don't own any securities, stock certificates, government bonds, or any other bonds. Therefore, I can't buy or sell them.

私は、この『市場』って奴の構成員ではないのです。

I am not a member of this "market" guy.

つまり、『市場』の中には、当初から私は入っていません。

In other words, I have not been included in the 'market' from the beginning.

-----

『市場の評価』とか言う奴が、なんでそんなに頻用されているのか ――

I don't know why guys like "market valuation" are used so often.

多分、世間の「空気」を数値で評価する方法が、それくらいしかないんだろうなぁ、と思っています。

I think that's probably the only way to evaluate the "atmosphere" of the world in numerical terms.

2021/02,未分類,江端さんの技術メモ

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

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

/*
  google Mapの座標値から距離を求めるルーチン
  2018-03-21(水) 14:41:31  
 
  gcc -c location_calc.cpp
*/
 
#include <math.h>
 
 
typedef struct location{
  // ちなみに X,Y 軸座標は、→に+  ↑に+
  double longitude; // 経度 東経 139.691 X軸  
  double latitude;  // 緯度 北緯 35.698  Y軸 
} LOCATION;
 
 
#define rad2deg(a) ((a)/M_PI * 180.0) /* rad を deg に換算するマクロ関数 */
#define deg2rad(a) ((a)/180.0 * M_PI) /* deg を rad に換算するマクロ関数 */
 
double distance_km(LOCATION* A, LOCATION* B, double *rad_up)
{
  double earth_r = 6378.137;
 
  double loRe = deg2rad(B->longitude - A->longitude); // 東西
  double laRe = deg2rad(B->latitude - A->latitude); // 南北
 
  double EWD = cos(deg2rad(A->latitude))*earth_r*loRe; // 東西距離
  double NSD = earth_r*laRe; //南北距離
 
  double distance = sqrt(pow(NSD,2)+pow(EWD,2));  
  *rad_up = atan2(NSD, EWD);
 
  return distance;
}
 
LOCATION* new_location(LOCATION* D, double diff_p_x, double diff_p_y) 
{
  double earth_r = 6378.137;
 
  double loRe = diff_p_x / earth_r / cos(deg2rad(D->latitude)); // 東西
  double laRe = diff_p_y / earth_r;  // 南北
  
  double diff_lo = rad2deg(loRe); // 東西
  double diff_la = rad2deg(laRe); // 南北
 
  static LOCATION C;
 
  C.longitude = D->longitude + diff_lo; // 東西
  C.latitude = D->latitude + diff_la; // 南北
  
  return &C;
}
  
double diff_longitude(double diff_p_x, double latitude) 
{
  double earth_r = 6378.137;
  // ↓ これが正解だけど、
  double loRe = diff_p_x / earth_r / cos(deg2rad(latitude)); // 東西
  // 面倒なので、これで統一しよう(あまり差が出ないしね)
  //double loRe = diff_p_x / earth_r / cos(deg2rad(35.700759)); // 東西
  double diff_lo = rad2deg(loRe); // 東西
 
  return diff_lo; // 東西
}
  
double diff_latitude(double diff_p_y) 
{
  double earth_r = 6378.137;
  double laRe = diff_p_y / earth_r;  // 南北
  double diff_la = rad2deg(laRe); // 南北
  
  return diff_la; // 南北
}