人生 Presentation, 2.3

這段改編自 2010 年 4 月 24 日的對話。

.

那是 Paul Buchheit 講過的,我現在轉述成:

在第一個版本中,最重要賣點以外的優點,都只是雜音。

這個原理翻譯成教學版本的話,就是:

在教授課題時,應只聚焦核心思想,用不同的字眼言辭去覆術它,而斬釘截鐵地,省略其他一切細節,暫時。

主題以外的有趣內容,一律視為敵人,暫時。

.

這和之前那一點「每課只講一點」的分別是:

你不單止要「只講一點」,還要有「主動放棄其他」的心態。

.

為什麼兩人開始情投意合時,不立刻結婚呢?

因為相愛容易,相處很難。

相愛時,你可以選擇只接受,對方優點中,最好的一點。

相處時,你不可以選擇不接受,對方缺點中,最差的一點。

所以,即使開始情投意合,兩人也應先作朋友,不作情侶。

.

可以作朋友的,不一定適合,作情侶。

同理,可以作情侶的,不一定適合作夫妻。

所以,當發覺必定,終不成夫妻時,應立刻終止情侶關係。

.

這和之前那一點「一生只愛一人」的分別是:

你不單止要「只愛一人」,還要有「主動放棄其他」的心態。

.

未來妻子以外的女子,(!)現在(!)就要疏遠,無論她有多好,你有多喜歡。

— Me@2023-02-28 11:16:42 AM

.

.

2023.02.28 Tuesday (c) All rights reserved by ACHK

Euler problem 10.2

Find the sum of all the primes below two million.

removeIf :: (a -> Bool) -> [a] -> [a]
removeIf p = filter (not . p)

sieveIter :: Integral a => [a] -> [a] -> [a]
sieveIter [] (x:xs) = x:xs
sieveIter (x:xs) acc
  | x^2 > last (x:xs) = reverse acc++(x:xs)
  | otherwise = sieveIter xss (x:acc)
  where
    xss = removeIf (\n -> n `mod` x == 0) xs

primeList :: Integral a => [a] -> [a]
primeList xs = sieveIter xs []

pL :: [Integer]
pL = primeList [2..2000000]

f :: Integer
f = sum (takeWhile (< 2000000) pL)

— colorized by palette fm

— Me@2023-02-25 12:35:57 PM

.

.

2023.02.26 Sunday (c) All rights reserved by ACHK

Zsh, 2

To install the Z shell (Zsh):


1. Read my blog post “Zsh” to follow the instructions point 1 and point 2.


2. In the Bash terminal, run

zsh 

once, in order to get the config file generated.


3. Return to my blog post “Zsh” to follow the remaining steps.


— Me@2023-01-19 12:41:56 PM

— Me@2023-02-24 05:19:38 PM

.

.

2023.02.24 Friday (c) All rights reserved by ACHK

Looper, 6

Causal diamonds in time travel, 3

.

Time travel in the absolute sense is logically impossible.

If time travel was logically possible, it still could be logically consistent from the time traveller’s point of view, as long as he cannot see from the perspective of the meta time.

— Me@2016-06-01 07:10:51 AM

— Me@2023-02-23 12:13:20 PM

.

.

2023.02.23 Thursday (c) All rights reserved by ACHK

When physics meets biology

oli5679 on May 15, 2018

There was a really good chapter on his time in a biology lab in his book, “Surely you’re joking Mr. Feynman”. I have always remembered this quote:

When it came time for me to give my talk on the subject, I started off by drawing an outline of the cat and began to name the various muscles.

The other students in the class interrupt me: “We know all that!”

“Oh,” I say, “you do? Then no wonder I can catch up with you so fast after you’ve had four years of biology.” They had wasted all their time memorizing stuff like that, when it could be looked up in fifteen minutes.

sykh on May 15, 2018

Feynman was wrong on his view. The same thing could have been said of him and physicists. Oh, you spent your time memorizing formulas when it could be looked up in 15 minutes.

This is a nonsensical point of view for two reasons. [1] People in areas of their expertise tend to know a lot in that area off the top of their head because they have encountered this stuff so much that it has become memorized. That memorized knowledge comes from experience not a memorization exercise. [2] It’s also nonsensical because if you didn’t have a core set of knowledge memorized in your area of expertise and instead relied on spending 15 minutes looking up each fact necessary to understand a given situation you’d end up wasting your whole day just trying to understand the meaning of the problem.

— Hacker News

.

.

2023.02.22 Wednesday ACHK

Euler problem 10.1

Find the sum of all the primes below two million.

(defmacro sq (x)
  `(* ,x ,x))

(defmacro last-item (lst)
  `(car (last ,lst)))

(defun good-reverse (lst)
  (labels ((rev (lst acc)
         (if (null lst)
         acc
         (rev
          (cdr lst)
          (cons (car lst) acc)))))
    (rev lst nil)))

(defun prime-sieve-a-list (input-lst)
  (labels ((sieve-iter (go-lst acc-list)
         (if (not go-lst) 
         acc-list        
         (if (> (sq (car go-lst))
            (last-item go-lst))

             (append (good-reverse acc-list)
                 go-lst)
             
             (sieve-iter
              (remove-if #'(lambda (x)
                     (=
                      (mod x (car go-lst))
                      0))
                 (cdr go-lst))
              (cons (car go-lst)
                acc-list))))))

    (sieve-iter input-lst '())))

(defun range (max &key (min 0) (step 1))
  (loop :for n :from min :below max :by step
    collect n))

(defmacro prime-sieve (n)
  `(prime-sieve-a-list (cons 2 (range (1+ ,n)
                      :min 3
                      :step 2))))

(defun sum (lst)
  (reduce #'+ lst))

(sum (prime-sieve 2000000))

(time (sum (prime-sieve 2000000)))

— Me@2023-02-16 11:34:49 PM

.

.

2023.02.21 Tuesday (c) All rights reserved by ACHK

G40-70

If you are using SSD, you should turn off the swap file:

1. In command line, run

swapoff --all

2. Backup the file

/etc/fstab

3. Then, in that file, comment out any lines that contain the word “swap”.

— Me@2023-02-14 05:00:26 PM

.

.

2023.02.15 Wednesday (c) All rights reserved by ACHK

Computing Note, 4

08[.]07[.]2002 

1. Use Computer Software to improve/[]upgrade 
your Brain Software  

10[.]07[.]2002 

2. Software Philosophy: 

Use it, enjoy it, but keep your ability 
to live without it. 

<<Conversation with God>>

Enjoy everything, but need nothing! 

(Even people? 
Especially people!) 

.

.

2023.02.11 Saturday (c) All rights reserved by ACHK

大恩養仇人 3

小恩養貴人 3

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

.

那樣,在「有必要、應該幫」時,又應該幫到哪個程度呢?

「幫助別人」就有如「責備別人」,雖然有時必須,但是越小越好,越少越好。

「幫助別人」就有如「服用藥物」,雖然有時必須,但是越小越好,越少越好。

.

助人最小化,效果最大化。

.

壞醫生不會一次過,醫好你的一個病。他會務求,把那個病拖長,令你不斷要光顧他。

好醫生則會透過,以當時醫藥科技,所能達到的最短時間,去治癒你,從而令你在短時間內,毋須再光顧他。

「醫藥治療」雖然有時必須,但是越小越好,越少越好。

醫治最小化,藥效最大化。

.

同理,合理的幫忙別人,目的應是令人,再毋須你的幫助。

助人最小化,效果最大化。

.

助人自助,才是利人利己;

助人不自助,福利主義,害人害己。

.

在不應該幫助人時幫,應立為重罪,因為,那會導致對方心靈傷殘,逐漸失去工作和生活能力。

幫難不幫懶,救急不救窮

助人不自助,即是「福利主義」。額外的東西,才是「福」;應該有的,則為「權」,例如薪金。

「福利主義」的意思,就是把偶然的「福份」,視為必然的「權利」。那是錯的!

.

還有,雖然「恩將仇報」只是偶然,但是恩越大,成仇的機會就越大。原因之一是,你正在破壞自然的規律。

比喻說,人的體內有外來之物時,免疫系統會把其全部,視之為入侵;會盡力移除之。

同理,當你嚴重地幫助他人時,你就其實順帶,干涉著他人的人生。你是他人生的「外來物」。在他人生心靈免疫系統促使下,自然會瘋狂地攻擊你。

小恩養貴人,大恩養仇人

— Me@2022-11-05 12:54:58 PM

— Me@2023-02-09 12:24:10 PM

.

.

2023.02.10 Friday (c) All rights reserved by ACHK