I think I better resume working on the competitive-programming… If I have a nice, kind, and smart friend who can share time with me and study algorithms, it would be super helpful for me. Though, I think it's one in a million to have someone like Steve Wozniak. Steve Jobs is so lucky to have him in his life.
I tried to update my Mastodon instance with the latest version, but there are 66 (!) files that have conflicts. I don't want to deal with them. Why are there so many conflicts though I didn't touch them :angry:
$ git merge v4.3.0
$ git status --short | grep -E -c '^(UU|AA)'
66
It's been a year since I (as a moron) deployed the Mastodon server, and it seems many tech debts accumulated along the way.
It would be much easier to create a new instance and move my account to it. Still, on second thought, account migration is also a headache, and I want to maintain the domain if possible, as I built some friendships on it.
And now, my Mastodon server is running with v4.3.0! Yay!
git checkout --theirs .
Today I learned that I can use git checkout --theirs .
to accept all incoming changes when resolving merge conflicts. Git is a
very genius tool, but sometimes it shows me too many diffs even though I
didn't touch the code. This option is convenient in that case.
$ git merge v4.3.0
(shows a bunch of conflicts)
$ git checkout --theirs .
$ git add .
$ git commit
Git - git-checkout Documentation
When checking out paths from the index, check out stage #2 (ours) or #3 (theirs) for unmerged paths.
Note that during
git rebase
andgit pull --rebase
, ours and theirs may appear swapped;--ours
gives the version from the branch the changes are rebased onto, while--theirs
gives the version from the branch that holds your work that is being rebased.
I think I should remember this, as I frequently use
git rebase
.
I failed to explain the Unix epoch to my friend the other day.
Unix Tick Tocks to a Billion | WIRED
Unix time - Wikipedia (I know it's not right to cite Wikipedia, but I would make an excuse that this page is not something academic or official.)
Unix time is a date and time representation widely used in computing. It measures time by the number of non-leap seconds that have elapsed since 00:00:00 UTC on 1 January 1970, the Unix epoch. In modern computing, values are sometimes stored with higher granularity, such as microseconds or nanoseconds.
Unix time originated as the system time of Unix operation systems. It has come to be widely used in other computer operating systems, file systems, programming languages, and databases.
File Times - Win32 apps | Microsoft Learn
A file time is a 64-bit value that represents the number of 100-nanosecond intervals that have elapsed since 12:00 A.M. January 1, 1601 Coordinated Universal Time (UTC). The system records file times when applications create, access, and write to files.
It seems the Windows NTFS file system uses a different time representation than Unix time, and there are also some that don't use it.
from datetime import datetime
= datetime.now()
now = now.isoformat()
iso_string = datetime.timestamp(now)
unix_time print(f"datetime.now(): {now}")
print(f"ISO 8601 string: {iso_string}")
print(f"Unix timestamp: {unix_time}")
datetime.now(): 2024-10-21 19:36:24.755281
ISO 8601 string: 2024-10-21T19:36:24.755281
Unix timestamp: 1729564584.755281
Sprouts salad 300 Protein shake 300 Pasta 600 Mashed potatos 300 Rice 300
Total 1800 kcal
push-ups
MUST:
TODO: