日常の記録 (2023 年 12月)
前月、翌月 | 一覧 |
トップページ
2023/12/27 (水)
- My Twitter(a.k.a X) accounts were suspended and deleted at half past 10 in the morning.
The reason for account freeze seemed the repetead account creation and deletion
in a short period, and excessive abuse of Twitter API. I may have had a problem with my actions,
but I decided to stop relying on Twitter for recording my daily notes and other information.
- Ref.
2023/12/26 (火)
- The human hand consists of the palm, fingers, and thumb. In US, there's clearly different between a thumb and finger.
The tweet that focuses on this definition difference is buzzed in Japan. This indicates different people have different ways
to cut up the world. Today, with this thought in my mind, I am about to attend a banquet.
2023/12/25 (月)
- Today, I took my 17th DMM English lesson. The DMM system has a lot of English tutors around the world, allowing us a variety of English talk experiences.
For instance, I can hear from them about their country's current situation (Certainly, the best of my English proficiency restricts the scope of questions that I can pose).
Typical Japanese working professionals or common members of society have few opportunities to meet people they don't normally see.
However, if we attend the DMM class every day, being guaranteed to talk with 30 people I would not normally meet.
2023/12/19 (火)
- I think to keep a English diary is one of the best way to master English language.
Therefore, I start to write English senteces for expressing my daily life, here.
4 days ago, I failed to go up the stairs, and hurt my little toe.
The blood inside the part is now black because of internal bleeding.
However, the pain has subsided.
- Changing the subject, I attatch the extended Euclidean algorithm implementation by Python3 below.
# input: x, y (x > y)
# output, a, b, gcd(x, y) s.t. a * x + b * y = gcd(x, y)
def exEuc(x, y):
r0, r1 = x, y
a0, b0 = 1, 0
a1, b1 = 0, 1
while True:
# ユークリッドの互助法
r2 = r0 % r1
q0 = r0 // r1
if r2 == 0:
break
a2 = a0 - a1 * q0
b2 = b0 - b1 * q0
# アップデート
a0, b0 = a1, b1
a1, b1 = a2, b2
r0, r1 = r1, r2
return a1, b1, r1
def main():
print(exEuc(59, 14)) # (5, -21, 1)
print(exEuc(32, 20)) # (2, -3, 4)
print(exEuc(37, 6)) # (1, -6, 1)
main()
I also attach the display image to run the above script.
|
|
プログラムの実行
|