Eject

Safely unmounts the partition /dev/sdd1, ensuring that it is not in use.

udisksctl unmount -b /dev/sdd1

udisksctl power-off -b /dev/sdd

Powers off the entire block device /dev/sdd, making it safe to disconnect.

— Me@2024-01-12 06:47:59 PM

.

.

2024.11.22 Friday (c) All rights reserved by ACHK

真話騙子

這段改編自 2021 年 12 月 16 日的對話。

.

Words differently arranged have a different meaning, and meanings differently arranged have a different effect.

— Blaise Pascal

.

有誠信的人,會盡量不講假話;但是要留意,「誠信」並不只是,「講不講真話」的問題,因為,如果有心傷害人,只講真話也可以做到:

1. 說一些不應該提及的事實。

例如,向一位女士指出,她年紀大。

2. 說一些不應該提及的事件。

例如,廿年前我看過,一個電影情節,現在回想起來,發現其十分荒謬:

男角甲暗戀女角乙多年,發覺如果不表達愛意,將會一生抱撼。所以,他最終示了愛:「當年你還單身未婚時,我就已經愛上你了。」

3. 不完整事實,又稱「局部真相」、「偏見」或「斷章取義」等。

例如,「你這次考試的成績差過上次,只有九十七分」這句,如果你只引上半句,會造成誤會。

4. 不當次序。

例如,

雖然你這次考試的成績,差過上次,但是都有九十七分。

雖然你這次考試的成績,有九十七分,但是差過上次。

這兩句事實一樣,但效果不同。

— Me@2024-11-19 07:55:22 PM

.

.

2024.11.20 Wednesday (c) All rights reserved by ACHK

Euler problem 24.2

import Data.List ( delete )

fac :: (Eq t, Num t) => t -> t
fac n = f n 1
  where
    f 0 acc = acc
    f m acc = f (m - 1) (m * acc)

perms :: Eq a => [a] -> Int -> [a] -> [a]
perms [] _ acc = reverse acc
perms xs n acc
  = perms (delete x xs) (mod n m) (x : acc)
  where 
    m = fac $ length xs - 1
    y = div n m
    x = xs !! y

p24 :: [Char]
p24 = perms "0123456789" 999999 []

λ> :set +s
λ> p24
"2783915460"
(0.02 secs, 121,968 bytes)
λ> 

— Me@2024-11-18 07:22:15 PM

.

.

2024.11.19 Tuesday (c) All rights reserved by ACHK

Ex 1.32 Path functions and state functions, 2.2

Structure and Interpretation of Classical Mechanics

.

1. The local-tuple function f is the same as the local-tuple function \bar \Gamma (\bar f) where \bar f[q] = f \circ \Gamma [q].

2. On the other hand, the path function \bar f[q] and the path function \bar \Gamma (\bar f) \circ \Gamma [q] are not necessarily the same. Explain.

~~~

1. …

To summarize:

In theory where a series can have infinite terms, functions f and \bar \Gamma (\bar f) are identical because it is just the definition of \bar \Gamma.

In practice where a series can have only finite terms, they are still identical because their inputs are the same exact local tuples.

2. However, for \bar f [q] and \bar \Gamma (\bar f) \circ \Gamma [q], although they are both path functions with the same path q as input, while the function \bar f processes the path q directly, the function \bar \Gamma (\bar f) \circ \Gamma would first turn the path q into a local tuple \Gamma[q], which in practice would have only a finite number of components.

(define ((GammaBar-fBar-o-Gamma f-bar) q)
  (compose (Gamma-bar f-bar) (Gamma q)))

Then it would use the function osculating-path to generate the path.

(define ((Gamma-bar f-bar) local)
  ((f-bar (osculating-path local)) (time local)))

In other words, the path being used is the osculating path

\displaystyle{\mathcal{O} (t_0, q(t_0), v(t_0), \cdots, q^{(n)}(t_0)))},

instead of the original path q itself. Therefore, functions \bar f [q] and \bar \Gamma (\bar f) \circ \Gamma [q] do not have to be equal. They are identical in the following two cases:

The first case is when

\displaystyle{\mathcal{O} (t_0, q(t_0), v(t_0), \cdots, q^{(n)}(t_0))) \equiv q},

where

\displaystyle{\begin{aligned}   &\mathcal{O} (t_0, q(t_0), v(t_0), \cdots, q^{(n)}(t_0)))(t) \\   &= q_0 + v_0 (t-t_0) + \frac{1}{2} a_0 (t-t_0)^2 + ... +\frac{1}{n!} q^{(n)}_0 (t-t_0)^n \\      \end{aligned}}.

In other words, path q^{(m)} = 0 for all m>n.

The second case is when the path function \bar f [q] requires no derivatives of q with order higher than n. For example:

— Me@2024-10-16 10:34:35 AM

.

.

2024.11.17 Sunday (c) All rights reserved by ACHK

Outlook 2010

<pre style="color: #333333;background-color: #ffffcc;font-size: 12pt;font-family:Calibri">
  <span style='mso-spacerun:yes'>  </span>...
</pre>

— Me@2024-11-15 01:42:34 AM

.

.

2024.11.15 Friday (c) All rights reserved by ACHK

Where are you? 2.5

Utopia | 何有之鄉, 2.5

.

……

不可能遷就到,而為了保命,必須立刻超光速逃離,或者𣊬間轉移的例子有:

……

五、 不可信:

誠信有問題,有兩個版本:

第一種是,會在沒有必要時,說假話,或透過隱瞞等方法,去誤導他人。

第二種是,會在沒有必要時,公開你的私隱,或者他人的秘密。

.

記住,誠信只可能破壞,不可能修補

一旦發現她誠信有問題,千萬不要以為,她可能改過;因為,正正是因為她誠信有問題,她的改過本身,就很可能是,另一個謊言騙局而已。「一次不忠,百次不用」就是這個意思。

留意,誠信有問題,不限於壞人。

遇到好人講大話,即所謂「善意的謊言」時,亦建議不要再相處;因為,「連『我不會再騙你』也很可能是騙你的」這邏輯結構,與壞人版本,沒有分別。

例子一,自己身體有病時,為免別人擔心,宣稱沒有事。那只會引起更大的擔心,因為,下次當她宣稱沒有事時,我不會再知道,她是否真的沒有事。

例子二,她要去見異性朋友;為免我誤會,宣稱去見其他朋友。那只會引起永久的憂慮,因為我不知道,她還隱瞞了什麼,誤導了多少。

這類人不可相處之的主要原因是,他們認為,謊言只要不被發現,就沒有問題。他們覺得,既然受騙者不知道,就不會不開心,不會受傷害。所以,即使騙了他人,那也不算不道德。

這種講法,有兩漏洞。

……

— Me@2024-09-05 03:33:08 PM

.

.

2024.11.14 Thursday (c) All rights reserved by ACHK

Euler problem 24.1.3

(defun fac (n)
  (labels
      ((f (m acc)
         (cond ((= m 0) acc)
               ('t (f (1- m) (* m acc))))))
    (f n 1)))

(defun string-to-list (str)
  (map 'list 'identity str))

(defun perms (ys k)
  (labels
      ((p (xs n acc)
         (if (null xs)
             (reverse acc)
             (let* ((m (fac (1- (length xs))))
                    (y (floor n m))
                    (x (nth y xs)))
               (p (delete x xs)
                  (mod n m)
                  (cons x acc))))))
    (p ys k nil)))

(concatenate 'string
             (perms (string-to-list "0123456789")
                    999999))

CL-USER> 
"2783915460"

— Me@2024-11-12 10:50:23 AM

.

.

2024.11.12 Tuesday (c) All rights reserved by ACHK

Mounting a virtual disk

# In the host OS, if you want to read the contents of a virtual disk file:

mkdir ~/vdi_test_mount

sudo guestmount -a my_virtual_drive.vdi -m /dev/sda1 -o allow_other ~/vdi_test_mount

# After that, unmount the virtual disk:

sudo guestunmount ~/vdi_test_mount

rmdir ~/vdi_test_mount

— Me@2023-11-25 10:03:37 PM

.

.

2024.11.10 Sunday (c) All rights reserved by ACHK

Quantum radar

Four months ago, we were being persuaded that the Chinese have constructed a quantum radar, something that can inform you about an airplane without any actual reflection of any radiation from the airplane. This is obviously impossible by locality, whether you use any quantum subtleties or not.

— Lubos Motl

.

You cannot know the moment of the collapse of the wavefunction by another observer, except when that observer tells you (by a classical channel).

— Me@2017-08-14 01:41:47 PM

.

This point is irrelevant, since quantum radar is possible if there is somehow an interaction between the object and the entangled particle; destruction of the correlation informs the existence of a foreign object; although when exactly the correlation is destroyed, like when exactly the wavefunction collapses, is a physically meaningless question.

You cannot detect the change of correlation in real time. Instead, you need to get the information of the opposite side photons by a classical channel and then compare the photon pairs to get the correlation information.

— Me@2023-02-12 08:05:10 PM

— Me@2017-08-16 02:57:07 PM

.

.

2024.11.09 Saturday (c) All rights reserved by ACHK

腦殘遊記

以直報怨 4 | Punishment 4

這段改編自 2023 年 6 月 23 日的對話。

.

以前試過有精神病人斬人,造成多人死傷。那樣,該精神病人,有沒有罪呢?

重點不是標籤他,有沒有「罪」;重點是,應如何處理?他應否受刑罰?

懲罰的主要目的,並不在報復,而在立刻停止傷害,以及預防再次發生。或者說,報復的真正目的,正正就是制止及阻嚇。

無論標不標籤他為「有罪」,法官都可以判他,永久居住精神病院。而標不標籤他為「有罪」,則視乎你的「罪」字用法,包不包括「動機」。有犯罪動機的話,就應該判處終身監禁;沒有犯罪動機的話,則精神病院。

留意,受不受到懲罰,和有沒有犯罪意圖,並沒有必然關係。對於殺人犯,法官無論是判他死刑、終身監禁,還是無限期居住精神病院,目的也相同——最終也是要令他,沒有機會再傷害人。

極少情況下,服刑多年後,犯人可以假釋。但是,前提必須是,他再傷害人的機會極低。所以,那是極少情況下。

不是「不知者不罪」,而是「不知者最大罪」,因為,遇到壞人,你可以透過法津武力,去制止他;但是,遇到好人、蠢人,或者好蠢之人,你只可以無可奈何。

— Me@2024-10-22 10:56:09 AM

.

.

2024.11.08 Friday (c) All rights reserved by ACHK

Transform recursion into tail recursion

Remove a white dot from the photo | Euler problem 24.1.2

.

(defmacro detailn (fn (n)
                   (if endc
                       b-val
                       (op n (fn (ch n)))))
  (let ((acc (gensym)))
    `(defun ,fn (,n)
       (labels ((fn-iter (,n ,acc)
                  (if ,endc
                      ,acc
                      (fn-iter (,ch ,n)
                               (,op ,n ,acc)))))
         (fn-iter ,n ,b-val)))))

(detailn facn (m)
         (if (<= m 1)
             1
             (* m (facn (1- m)))))

(macroexpand '(detailn fac (m)
               (if (<= m 1)
                   1
                   (* m (fac (1- m))))))

— Fixed by GIMP’s Clone Tool

— Me@2024-10-30 12:42:22 PM

.

.

2024.11.06 Wednesday (c) All rights reserved by ACHK

Ex 1.32 Path functions and state functions, 2.1

Structure and Interpretation of Classical Mechanics

.

1. The local-tuple function f is the same as the local-tuple function \bar \Gamma (\bar f) where \bar f[q] = f \circ \Gamma [q].

2. …

~~~

1. Equation

\displaystyle{\begin{aligned} \bar f &= f \circ \Gamma \\ \end{aligned}}

is the definition of \bar f. And equation

\displaystyle{\begin{aligned} f &= \bar \Gamma (\bar f) \\ \end{aligned}}

is the definition of \bar \Gamma. So, in theory,

\displaystyle{\begin{aligned} f &= \bar \Gamma (\bar f) \\ \end{aligned}}

is just true by definition.

In practice, their initial inputs are both the same local tuple

\displaystyle{\begin{aligned} &(t, q(t), v(t), \cdots, q^{(n)}(t)) \\ \end{aligned}},

which has only a finite number of components. The path q in the process is generated by that initial input:

\displaystyle{\mathcal{O} (t,q,v, \cdots, q^{(n)})}

So the function \Gamma would get you back the exact local tuple from the osculating path:

\displaystyle{(t,q,v,\cdots, q^{(n)}) = \Gamma[\mathcal{O} (t,q,v, \cdots, q^{(n)}](t)}

.

In other words, since for the functions \displaystyle{f} and \displaystyle{\bar \Gamma (\bar f)}, neither input is the path itself, the identity is exact.

Conceptually,

(define (f local)
  (g local)) 
 
(define ((Gamma-bar f-bar) local)
  ((f-bar (osculating-path local)) (time local))) 

(define ((f-bar q) t)
  (f ((Gamma q) t))
 
;; (((f-bar q) 't)
;; == f((Gamma q) 't)
;; == f('t, (v 't), (a 't),...) 

— Me@2024-10-16 10:34:35 AM

.

.

2024.11.04 Monday (c) All rights reserved by ACHK

Mass in general relativity

The concept of mass in general relativity (GR) is more subtle to define than the concept of mass in special relativity. In fact, general relativity does not offer a single definition of the term mass, but offers several different definitions that are applicable under different circumstances. Under some circumstances, the mass of a system in general relativity may not even be defined.

The reason for this subtlety is that the energy and momentum in the gravitational field cannot be unambiguously localized. So, rigorous definitions of the mass in general relativity are not local, as in classical mechanics or special relativity, but make reference to the asymptotic nature of the spacetime. A well defined notion of the mass exists for asymptotically flat spacetimes and for asymptotically Anti-de Sitter space. However, these definitions must be used with care in other settings.

— Wikipedia on Mass in general relativity

.

.

2024.11.03 Sunday ACHK

公關即災難

烹飪事實 2

這段改編自 2021 年 12 月 16 日的對話。

.

鐵甲奇俠有些方面,遠比蝙蝠俠高明。當記者問他時,他直接回應:「我是鋼鐵俠。」

(JC:那一幕十分有型。)

不只有型。那還避免了像蝙蝠俠般,因為隱瞞身份,而導致往後的無數麻煩。那其實就是,現實版鐵甲奇俠,馬斯克的處事風格——有嗰句,講嗰句——在沒有必要時,就不要隱瞞或化妝。即使是最壞情況出現:講錯了被人批評,他也只需認錯和改正。

但是,如果不是坦誠相待,而是故弄玄虛的話,後果則不可預測。

(JC:有很多時,那些公關災難是,怎樣來的呢?其實就是……)

公關形成災難、公關引發災難。

.

留意,蝙蝠俠的錯,不在隱瞞身分本身;因為,有很多高危的任務,必須隱身才能完成。鐵甲奇俠在開始時,也必須隱藏身份。

蝙蝠俠的錯在於,永久隱瞞身分,而又不斷執行,新的任務。他應該在適當時機,公開身分,或者退休。

— Me@2024-10-31 03:11:18 PM

.

.

2024.11.02 Saturday (c) All rights reserved by ACHK