/*
C:\Users\ebata>psql -U postgres -h 192.168.0.23 -p 15432
Password for user postgres:
psql (13.4, server 12.5 (Debian 12.5-1.pgdg100+1))
Type "help" for help.
postgres=# \l
List of databases
Name | Owner | Encoding | Collate | Ctype | Access privileges
-----------+----------+----------+------------+------------+-----------------------
agent_db | postgres | UTF8 | en_US.utf8 | en_US.utf8 |
postgres | postgres | UTF8 | en_US.utf8 | en_US.utf8 |
template0 | postgres | UTF8 | en_US.utf8 | en_US.utf8 | =c/postgres +
| | | | | postgres=CTc/postgres
template1 | postgres | UTF8 | en_US.utf8 | en_US.utf8 | =c/postgres +
| | | | | postgres=CTc/postgres
yama_db | postgres | UTF8 | en_US.utf8 | en_US.utf8 |
(5 rows)
postgres=# \c agent_db
psql (13.4, server 12.5 (Debian 12.5-1.pgdg100+1))
You are now connected to database "agent_db" as user "postgres".
agent_db=# \dt
List of relations
Schema | Name | Type | Owner
--------+-----------+-------+----------
public | user_list | table | postgres
public | user_log | table | postgres
(2 rows)
agent_db=# select * from user_list;
id | age | type | departure_name | departure_number | departure_lat | departure_lng | arrival_name | arrival_number | arrival_lat | arrival_lng
-----+-----+----------+----------------+------------------+---------------+---------------+----------------------+----------------+-------------+-------------
0 | 51 | tourist | 山口駅 | 9324 | 131.4815191 | 34.172788 | 藩庁門 | 1396 | 34.18463 | 131.471535
1 | 59 | tourist | 山口駅 | 9324 | 131.4815191 | 34.172788 | 五重塔 | 7136 | 34.190132 | 131.4734607
*/
package main
import (
"database/sql"
"fmt"
"log"
_ "github.com/lib/pq" // ←これを追記
)
func main() {
db, err := sql.Open("postgres",
"user=postgres password=password host=192.168.0.23 port=15432 dbname=agent_db sslmode=disable")
if err != nil {
log.Fatal("OpenError: ", err)
}
defer db.Close()
//rows, err := db.Query("select * from user_list")
rows, err := db.Query("select id, age, type, departure_name, departure_number, departure_lat, departure_lng, arrival_name, arrival_number, arrival_lat, arrival_lng from user_list")
if err != nil {
log.Fatal(err)
}
defer rows.Close()
var id, age, departure_number, arrival_number int
var type1, departure_name, arrival_name string
var departure_lat, departure_lng, arrival_lat, arrival_lng float64
for rows.Next() {
//if err := rows.Scan(&dt); err != nil {
if err := rows.Scan(&id, &age, &type1, &departure_name, &departure_number, &departure_lat, &departure_lng, &arrival_name, &arrival_number, &arrival_lat, &arrival_lng); err != nil {
fmt.Println(err)
}
fmt.Println(id, age, type1, departure_name, departure_number, departure_lat, departure_lng, arrival_name, arrival_number, arrival_lat, arrival_lng)
}
}
/*
出力結果
C:\Users\ebata\yamaguchi\src_try1\others>go run .
0 51 tourist 山口駅 9324 131.4815191 34.172788 藩庁門 1396 34.18463 131.471535
1 59 tourist 山口駅 9324 131.4815191 34.172788 五重塔 7136 34.190132 131.4734607
2 55 tourist 湯田温泉駅 7247 131.4606901 34.1597909 ザビエル記念聖堂 2570 34.1796352 131.4728818
3 60 tourist 湯田温泉駅 7247 131.4606901 34.1597909 ザビエル記念聖堂 2570 34.1796352 131.4728818
4 42 tourist 山口駅 9324 131.4815191 34.172788 五重塔 7136 34.190132 131.4734607
*/
postgresqlのデータベースから、golangで、データを何もかも取り込む
時間の経過を調べる golang
package main
import (
"fmt"
"time"
)
func main() {
now := time.Now() //
time.Sleep(time.Second * 3)
a := time.Since(now).Milliseconds()
fmt.Printf("経過: %vms\n", a) //
}
C:\Users\ebata\yamaguchi\src_try1\others>go run .
経過: 3008ms
―― 喪中の為、ディズニーランド、忘年会、および学会講演発表等の、アクティビティ参加をご遠慮申し上げます
昨日、喪中はがきを掲載しました。
Yesterday, I posted a mourning postcard.
"喪"という発想は、どの時代のどの地域においてもありますが、日本においては、孔子(BC55l~479)の儒教の影響が大きいようです。
The idea of "mourning" has existed in every region of every time period, but in Japan, the influence of Confucius (55l-479 BC) seems to have been significant.
が、その中身が凄かった。
But the contents were amazing.
『父母が亡くなったときには3年間の喪に服することが決められていた』
'When the parents died, we should be a three-year mourning period.'
『父母の墓の横にテントを立てて、そこでひたすら3年間、決められた喪中ルールの生活を続ける』
'We should set up a tent next to my parents' gravesite and lived there for three years under a set rule of mourning'
I remember the contents like that.
さすがに、弟子が「3年間はやりすぎです」「経済活動に影響を与えます」と苦言を呈したそうです。
As expected, a disciple complained that three years was too much and that it would affect economic activity.
そうしたら、孔子は『なら、"お前"はそうしろ』と弟子に言い放ったそうです。
However, Confucius then told his disciple, "Then you should do what you want"
パワハラですよね。
It was typical power harassment.
それはさておき。
That aside.
----
―― 喪中の為、ディズニーランド、忘年会、および学会講演発表等の、アクティビティ参加をご遠慮申し上げます
"Due to the mourning period, I will not be able to participate in activities such as Disneyland, year-end parties, and presentations at academic conferences"
という、"喪"の"活用"ができるるといいなぁ、とは思っています。
I hope that we can "utilize" mourning in such a way.
『第三次世界大戦が発生して、世界が滅びればいいのに』
何十年の前に、ゼミの後輩(女子)が
I suddenly remembered that decades ago, a junior (female) in my seminar said
『私、こんなもんじゃないと思うんです。もっと"できる"と思うんです』
"I don't think I'm like this. I think I can do more."
と言っていたことを、ふと、思い出しました。
2年くらい前に、長女も、同じようなことを言っていたなぁ、と思い出しました。
I remember my senior daughter was also saying something similar about two years ago.
一方、私と言えば、
Speaking of me,
―― そんなこと、一度も思ったことない
"I've never thought that"
と、断言できます。
As such, I can assure you.
--- Excerpts from past columns ---
私は単に、与えられたミッション(私の力量をはるかに超えた、難しくて面倒くさいミッション)を、泣きべそをかきながら遂行し続けてきただけです。
I have simply continued to carry out the mission I was given (a difficult and troublesome mission that was far beyond my capabilities), crying my eyes out.
具体的に言うとですね、「くっそー! こんなところで負けるもんかあぁぁぁ!」という力強い前向きな一生懸命ではなく、「うえーん! なんとか早く終わって、日本に帰りたいよおぉぉ~」という、負け犬の一生懸命です。
To be more specific: "Damn! I'm not going to lose in a place like this!" --- It's not that kind of powerful, positive, hard work. "I want to go back to Japan as soon as possible! I can't wait to get it over with and go back to Japan!" --- It is the hard work of a loser.
===== 抜粋ここまで =====
===== Excerpt here =====
で、今回、その原因を考えてみました。
And now I have considered the cause of the problem.
私は、第一に『自分のスキルやリソースを、冷静に判断する能力に欠けている』のだと思うのです。
I believe that firstly, 'I lack the ability to make dispassionate judgments about my skills and resources.
で、正確な予測計算ができないまま、物事を開始してしまって、後になって『どえらい後悔や失敗』をするようです。
And then, without being able to make accurate predictive calculations, they start to do things, and later on they seem to have "terrible regrets and failures".
そして、第二に、その『どえらい後悔や失敗』を、比較的短い期間で忘れてしまう "学習能力がない"ようです。
And second, I seem to have "no learning ability" to forget their "terrible regrets and failures" in a relatively short period of time.
そんでもって、似たような『後悔や失敗』を繰り返す、と。
And then I repeat similar regrets and failures.
------
会社で2つのプロジェクトのコードと、講義とレポート提出と目の前に積み上がった膨大な論文の山を眺めながら
While looking out codes for two projects at work, lectures and report submissions and a huge pile of papers piled up, in front of me,
『第三次世界大戦が発生して、世界が滅びればいいのに』
'I hope World War III breaks out and the world is destroyed.'
と ―― 今、かなり本気で考えます。
now I am quite serious about it.
こんなことが、毎年2~3回くらいの割合で発生します。
This happens about two or three times each year.
-----
ロシアや北朝鮮の為政者が、私のような『根性なし』でないことを、祈っています。
I hope that the rulers of Russia and North Korea are not 'gutless' like me.
江端さんのひとりごと「ドキュメント『停滞党崩壊』」をリリースしたのが、2002年。
江端さんのひとりごと「ドキュメント『停滞党崩壊』」をリリースしたのが、2002年。
It was in 2002 thatI released 'Stagnation Party Collapse' in the serise of 'Mr.Ebata's Small Talk'.
日韓共同ワールドカップ開催年でした。
It was the year of the Japan-Korea Joint World Cup.
―― あれから、もう20年かぁ
"It's been 20 years since then, huh?"
と思うと、自分でも、かなり驚いています。
I am quite surprised, myself, when I think about it.
ついに、「サマータイムレンダ」が、Amazonに来た。
ついに、「サマータイムレンダ」が、Amazonに来た。
Finally, "Summer Time Rendering" has come to Amazon.
よし、再履修開始だ。
Okay, let the retraining begin.
サッカーファンの人にとって、このような手に汗握るゲームの観戦は『一種の拷問』だろうなぁ、と思うことがあります。
昨日、ワールドカップの日本-ドイツ戦の最中の時間に、例の後輩からコラムのレビューの電話がかかってきました。
Yesterday, in the middle of the World Cup match between Japan and Germany, I received a call from a junior colleague of mine to review my column.
彼は、いわゆる、サッカーファンだったので、『なんで、わざわざ、こんな時間に?』と首をかしげました。
He is a soccer fan, so to speak, so I asked him, 'For What?', I wondered.
「ゲーム観戦に集中できんだろうから、レビューは後日でいい」といったのですが、『こういう緊張状態では、人と話している方が落ち着く』のだそうです。
I told him, "You won't be able to concentrate on watching the game, so you can review it later," but he said, "In a tense situation like this, I feel more comfortable talking to other people".
まあ、時々、レビューの反応が、1分くらい戻ってこないこともありましたが。
Well, sometimes the response to the review did not come back for a minute or so.
-----
サッカーファンの人にとって、このような手に汗握るゲームの観戦は『一種の拷問』だろうなぁ、と思うことがあります。
I sometimes think that for soccer fans, watching such a sweaty game in their hands must be 'a kind of torture.
しかし、サッカーを詳しく理解している人ほど、ゲーム全体を俯瞰して見ることができて、長所と同時に短所も見えて、それ故にイライラすることもあると思うのです。
However, I believe that the more one understands soccer in detail, the more one can look at the whole game from a bird's eye view and see its strengths as well as its weaknesses, and hence the more frustrating it can be.
私は、アスリートの素晴しいプレイに、賞賛の声を上げるだけで良いので、全体が見える人に比べれば、ずっと心理的負荷は小さくて済みます。
I only have to shout out my admiration for an athlete's fine play, so the psychological load is much smaller than for someone who can see the whole picture.
-----
この話を書いていて思い出したのですが ――
Writing this story reminded me of--
米国赴任中に知り合った米国人の友人の一人は、日本に数年滞在してたことがあったのですが、日本語を完璧に習得しようとは思わなかったそうです。
One of my American friends whom I met during my assignment in the U.S. said that when he stayed in Japan for several years, he never thought about learning Japanese perfectly.
彼は、有能な人物だったので、私は、不思議に思って、その理由を尋ねたところ、
He was a capable man, and I wondered, and asked him why, and he said
―― 日本語を理解しないことで、日本滞在中の心の平安を維持するため
"To maintain peace of mind while in Japan by not understanding Japanese"
と、言っていました。
なるほど、そういう考え方もあるのか、と感心しました。
Well, I was impressed with that way of thinking.
-----
日本-ドイツ戦が終った頃にリビングに降りていったら、テレビの前で嫁さんが泣いていました。
When I came down to the living room at the end of the Japan-Germany game, my wife was crying in front of the TV.
嫁さんが喜んでいるのを見て、私も嬉しくなりました。
I was happy to see my wife happy.
■江端一夫・瑤子 納骨供養のご案内
今日は、激しい雨の中、樹木葬の納骨を行ってきました。
Today, in the midst of a heavy rain, we held a tree burial ceremony.
寒かったです。
It was cold.
=====
■江端一夫・瑤子 納骨供養のご案内
- Kazuo Ebata and Yohko Memorial Service
拝啓 処暑の候、まだまだ暑さは続いておりますが、皆様にはますますご健勝のこととお喜び申し上げます。
Dear Sir or Madam, In this summer season, the heat is still on, and I hope that you are all doing well.
父と母の葬儀の折には大変お世話になり有難うございました。
Thank you very much for your help at the time of my father's and mother's funeral.
この度、父と母の納骨をする運びとなりました。
We are pleased to announce that we will be laying the ashes of our father and mother.
ご都合がよろしければ、平服にて御気軽にお立ち寄りをご検討頂ければ幸いです(私(智一)は、ジーパンとスニーカーと数珠持参で参加予定です)。
If you are able to make it, please feel free to drop by in plain clothes. I will be there with jeans, sneakers, and prayer beads).
コロナ禍の状況下、身内のみ、屋外、短時間(30分以内)、小人数(10人以下)の催しとさせて頂きたく、何卒ご協力のほどよろしくお願い致します。
Due to the Corona Disaster, I would like to ask for your cooperation in keeping the event intimate, outdoors, short (30 minutes or less), and small (10 people or less).
敬具
Yours sincerely
日時: 2022年11月23日(水・祝日) 12:00-
Date: Wednesday, November 23, 2022 (National Holiday) 12:00-
場所: XXXXXX
Location: XXXXXXXX
=====
■会食のご案内
- Dining
納骨後、ささやかながら会食の席も設けております。
After the burial of the ashes, a small dinner will be served.
お車にてのご移動(20分程度)になるかと存じますが、ご出席をご検討頂けましたら幸いです(移動手段につきましては、ご相談下さい)。
We would appreciate it if you would consider attending the meeting, although it will be a 20-minute drive (please consult with us regarding the means of transportation).
日時: 2022年11月23日(水・祝日) 13:30-
Date: Wednesday, November 23, 2022 (National Holiday) 13:30-
場所: XXXXXX
Location: XXXXXXXX