人生 Presentation, 2.2

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

.

我在之前的工作,訓練了表達技巧。我在中學教書時,需要每天講學三個多小時。講了一年半載後,說話才通順,可以完成完整句子而不「跳線」。

之後,我說話時就好像,口部自己有思想,內容自己有舖排,而毋須經過大腦的思考。

要鍊成這個「說話內容思路大致清晰」,唯有靠大規模的練習。

.

第二,要本身是很熱愛講授知識,才會願意花,那極超大量的心思時間,作那大規摸的練習。所以,更核心的要點是,自己如果不熱愛,就不要從事這行業。

.

第三,則是「每一節課應該只有一個重點」的補充。

If your product is Great, it doesn’t need to be Good.

By focusing on only a few core features in the first version, you are forced to find the true essence and value of the product.

Making the iPad successful is Apple’s problem though, not yours. If you’re creating a new product, what are the three (or fewer) key features that will make it so great that you can cut or half-ass everything else? Are you focusing at least 80% of your effort on getting those three things right?

Disclaimer: This advice probably only applies to consumer products (ones where the purchaser is also the user — this includes some business products). For markets that have purchasing processes with long lists of feature requirements, you should probably just crank out as many features as possible and not waste time on simplicity or usability.

— If your product is Great, it doesn’t need to be Good.

— Paul Buchheit

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

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

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

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

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

— Me@2023.01.27 07:46:40 PM

.

.

2023.01.28 Saturday (c) All rights reserved by ACHK

FF7R

Crucial MX500 1TB 3D NAND SATA SSD

.

Final Fantasy 7 Remake Steam version testing result:

1. With GTX 1050 Ti as the GPU, the bottleneck is the GPU, not the CPU, even though my CPU itself was weak.

2. However, once the GPU got upgraded, the CPU became the bottleneck.

The following settings can make the game smoother:

3. Set the Texture to Low. However, I do not recommend that.

4. Set the Shadow to Low.

5. Set the number of background people to be zero.

6. Set the resolution to 720p.

.

The following are the less obvious steps to release some CPU pressure:

7. Turn Steam into offline mode.

8. Turn off as many as other programs as possible.

9. In the controller setting, change the controller from the default “XInput” to “XBox 360“. However, I do not recommend that because that would disable the game’s rumble function.

.

After these settings, the game should be able to load Cloud’s headache memory cinematic scenes.

— Me@2023-01-11 12:39:59 AM

.

10. If not, start to repeat pressing the pause button every one second when a scene starts to load.

— Me@2023.01.23 05:17:38 PM

.

.

2023.01.24 Tuesday (c) All rights reserved by ACHK

htmlize

is an Emacs app for exporting syntax-highlighted buffers to html files. This post is about how to install it.

1. In the Bash terminal, get htmlize by the following command:

sudo apt-get install elpa-htmlize

2.0 Change the value of the variable htmlize-output-type to inline-css by the following steps:

2.1 In Emacs, run the function describe-variable by the hotkey:

Ctrl-h v

2.2 When you are asked to describe variable, type

htmlize-output-type

2.3 Click “customize“.

2.4 Click “Value Menu“.

2.5 Select “inline-css“.

2.6 Click “Apply and Save“.

.

3.1 Then whenever you want to turn the Emacs buffer into html, run the command

M-x htmlize-buffer

The buffer will show the generated html code.

3.2 Save the buffer as an html file. The html code itself will get syntax-highlighted.

.

4.1 In the output html file, delete everything before

<body style="color: #333333; background-color: #FFFFFF;">

4.2 Then replace these 2 lines

<body style="color: #333333; background-color: #FFFFFF;">
    <pre>

with

<pre style="color: #333333;background-color: #FFFFFF">

4.3 Delete everything after

</pre>

— Me@2023-01-15 03:39:29 PM

.

.

2023.01.22 Sunday (c) All rights reserved by ACHK

MSI RTX 3060 Ti VENTUS 2X 8G OCV1 LHR

Visualizing higher dimensions, 2.2 | Remove time from physics, 2

.

Mathematics is local (left brain).

Physics is global (right brain).

— Me@2017-06-22 06:16:59 PM

.

Mathematical processes, i.e. the calculations, are local.

Physical intuitions before a calculation and the interpretations after are global.

— Me@2023-01-13 07:45:24 PM

.

However, in an opposite sense, physics is local and mathematics is global.

— Me@2023-01-14 08:13:17 PM

.

Geometry is global.

Space is what we can see at once.

Dynamics is local.

Time is what we cannot see at once.

— Me@2017-02-07 10:11:34 PM

.

… math is what you get when you remove time from physics.

.

.

2023.01.14 Saturday (c) All rights reserved by ACHK

Factorio

Factorio is a construction and management simulation game developed by the Czech studio Wube Software.

— Wikipedia on Factorio

— Me@2016-03-13 07:43:04 AM

— Me@2023-01-10 09:28:18 AM

.

.

2023.01.10 Tuesday ACHK

KDE Chinese

This post is about how to enable Traditional Chinese keyboard in KDE Plasma desktop in Ubuntu 22.10.

1. In the Bash terminal, get the Cangjie input method (倉頡輸入法) by the following command:

sudo apt-get install ibus-cangjie

2. Then, get also the the following packages

sudo apt-get install \
ibus-data \
ibus-gtk \
ibus-gtk3 \
ibus-gtk4 \
ibus-table-cangjie3 \
ibus-table-cangjie5 \
ibus-table-cantonese \
ibus-table-quick-classic \
python3-ibus-1.0

3. Log out KDE and then log in again.

4. In KDE, open the application IBus Preferences. Add the language Chinese.

5. Select Cangjie3.

6. Change the language switch hotkey from Super-Space to Ctrl-Space.

7. Then in any text editor, press Ctrl-Space to switch input language.

— Me@2023-01-01 11:52:09 AM

.

.

2023.01.07 Saturday (c) All rights reserved by ACHK

Zsh

To install Z shell (Zsh):

1. In the Bash terminal, get zsh by the following command:

sudo apt-get install zsh

2. Then, apt-get also the following 3 packages:

sudo apt-get install zsh-syntax-highlighting

sudo apt-get install zsh-autosuggestions

sudo apt-get install zsh-theme-powerlevel9k

.

3. Read my blog post “Haskell mode“.

Follow the instructions point 0 and point 1 to install the Nix package manager.

.

4. Then, use the Nix package manager to install the Powerlevel10k theme.

nix-env -iA nixpkgs.zsh-powerlevel10k

5. Also, install the Meslo Nerd Font.

nix-env -iA nixpkgs.meslo-lgs-nf

The font would be located at

~/.nix-profile/share/fonts/truetype/

6. Use, for example, the KDE Plasma Font Management program to install the font.

.

7. Open the text file

~/.zshrc

Add the following 3 lines onto it:

source /usr/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh

source /usr/share/zsh-autosuggestions/zsh-autosuggestions.zsh

source ~/.nix-profile/share/zsh-powerlevel10k/powerlevel10k.zsh-theme

8. Run the command

chsh --shell /usr/bin/zsh

9. Reboot the computer.

.

— Me@2022-12-21 01:29:17 PM

— Me@2023-01-05 10:43:10 PM

.

.

2023.01.06 Friday (c) All rights reserved by ACHK

MSI RTX 3060 VENTUS 2X 12G OC

Meta numbers 2.1 | Zeno’s paradox 5

.

Infinity is not a number. Instead, it is a meta number.

Numbers are for counting things. Infinity cannot be used for counting things. Infinity is for counting natural numbers. It is a number of numbers.

Numbers represent what there are. But infinity cannot do so. Infinity is only meaningful as a potential one.

Infinity and infinitesimal are processes, not states. Numbers are points on the number line. Infinity is not a point, but an arrow pointing to the right.

An infinite set is a set with an infinite number of elements. An infinite set is defined as a set that contains a subset which is as large as the set itself. In other words, the elements of the subset can have one-one correspondence to those of the origin set. The whole can have one-one mapping to the part because it is not a state of finished mappings, but a process.

Processes are meta states. Processes describe how an object changes its states. Processes describe not the states, but the changes.

— Me@2016-06-13 11:43:36 AM

— Me@2023-01-04 10:36:53 PM

.

.

2023.01.05 Thursday (c) All rights reserved by ACHK

Powermaster Optimus Prime


18[.]06[.]2003

Diary: [W]hen I teach taught [E]rg maths, I have had new 
ideas[. B]ut I have no new ideas in research now. 

09[.]07[.]2003

Yesterday, I went to Shatin [T]oys[R][U]s to buy a 
[robot] model for brother. But finally, I saw a 
[PowerMaster] Opimus [P]rime which I wanted to buy when 
I was small. 

Consider [whether to buy or not] for several some 
moment. [And then bought it.]

[.]

At home, we discovered that the small person-robot had 
been stolen. 

[So s]uddenly, I gave up my happiness. 

Luckily, after playing the robot with brother, instead 
of blaming me for not buying a model for him to 
construct, he loved the robot. I was very happy too as 
I discussed "the Transformers generation one" with him. 

.

.

2023.01.03 Tuesday (c) All rights reserved by ACHK

搜神記 4

守護神 3 | Futurama 3.2

.

只要敢遠飛 亦能自創我的煙花紀
神是我自己 若然目光高過聚散分離
奉承你 因往日雙眼無珠不停放大你

想快樂不靠神跡 才懂創世紀

— 搜神記

— 林夕

.

發乎情 止乎禮

你的守護神,就是你自己,亦只有你自己。

擅自要求他人,做你的守護神,是冒犯;

貿然自封為,他人的守護神,是無禮。

.

禮者,人與人間之距離也。

— Me@2022-12-09 12:19:31 PM

— Me@2022-12-27 12:14:50 PM

.

Nobody is coming to save you. Get up. Be your own hero.

— Wealth Director

.

Doctors won’t make you healthy. Teachers won’t make you smart.

Ultimately, you have to take responsibility. Save yourself.

— @naval

.

.

2022.12.27 Tuesday (c) All rights reserved by ACHK

cmu-infix

is

a library for writing infix mathematical notation in Common Lisp.

To install it:

1. In the Bash terminal, get Quicklisp by the following command:

sudo apt-get install cl-quicklisp

The file quicklisp.lisp will be created at

/usr/share/common-lisp/source/quicklisp/quicklisp.lisp

.

2. Run the command

sbcl --load /usr/share/common-lisp/source/quicklisp/quicklisp.lisp

3. Follow the install instructions:

(quicklisp-quickstart:install)

(ql:add-to-init-file)

.

4. To enable the library, in the Common Lisp REPL, run the code:

(ql:quickload :cmu-infix)

5. And then run:

(named-readtables:in-readtable cmu-infix:syntax)

.

6. To test the library, run:

(defmacro add (x y)
  `(let ((a ,x)
         (b ,y))
     #I(a+b)))

(add 2 3)

(macroexpand-1 '(add 2 3))

(macroexpand-1 '#I(1+2-3*5^^6))

(eval (macroexpand-1 '#I(1+2-3*5^^6)))

— Me@2022-12-25 10:13:04 AM

.

.

2022.12.25 Sunday (c) All rights reserved by ACHK

Euler problem 11.4


recursive function max_e11(a2d, i, j, acc) result(a)

  integer, dimension(20, 20) :: a2d
  integer :: i, j, acc, a, accm = 0
  integer :: dia_l = 0, dia_r = 0, hori = 0, vert = 0
  integer :: k = 0, x = 1, y = 1
  integer :: lenx = 20, leny = 20

  if (i <= (lenx - 3)) then 
     hori = 1
     do k = 0, 3 
        hori = hori*a2d(i+k, j)
     end do
  end if

  if (j <= (leny - 3)) then
     vert = 1
     do k = 0, 3 
        vert = vert*a2d(i, j+k)
     end do
  end if

  if ((i <= (lenx - 3)) .and. (j <= (leny - 3))) then
     dia_r = 1
     do k = 0, 3 
        dia_r = dia_r*a2d(i+k, j+k)
     end do
  end if

  if ((i >= 4) .and. (j <= (leny - 3))) then
     dia_l = 1
     do k = 0, 3
        dia_l = dia_l*a2d(i-k, j+k)
     end do
  end if

  if ((i == lenx) .and. (j == leny)) then 
     a = acc
  else 
     accm = max(acc, hori, vert, dia_l, dia_r)

     if (i == lenx) then
        x = 1
        y = j + 1
     else 
        x = i + 1
        y = j
     end if

     a = max_e11(a2d, x, y, accm)
  end if
end function max_e11

program main

  implicit none

  integer :: p_max, p_count, i, j
  integer(kind = 16) :: p_sum
  logical, ALLOCATABLE, DIMENSION(:) :: is_prime
  character(len=128) :: currentDir
  integer, dimension(20, 20) :: D, M
  integer :: max_e11

  call GET_ENVIRONMENT_VARIABLE('PWD', currentDir)

  print *, "dir == ", trim(currentDir)

  open(1, file = "t.txt", status = "old")
  read(1, *) D
  close(1)

  M = transpose(D)

  write(*, *) M(1, 1)
  write(*, *) max_e11(M, 1, 1, 0) 
  write(*, *) M(1, 1)

end program main

— Me@2022-12-24 11:50:15 AM

.

.

2022.12.24 Saturday (c) All rights reserved by ACHK

Feynman looking

NickRandom 3 days ago | next [–]

I have been in true ‘life or death’ situations (in other words, I’m alive because others were slower or less able to draw their weapons and fire).

In those sorts of situations time truly does slow down. I replay those times endlessly in my dreams/nightmares but either way it seemed like both at the time and in my mental replaying of the events that time slowed down to a crawl.

During endless sessions with various mental health professionals it seems that people involved in car crashes have the same slowing down of time. Based on what I’ve learnt, the time differential boils down to muscle memory (much like a batter hits a fast ball) that can and does initiate a response before the brain processes the event and that the mind catches up afterwards and is able to replay the events in a somewhat coherent way.

retrac 3 days ago | parent | next [–]

I once found a loved one in grave condition, without a pulse. What followed was like a surreal movie that has its frames out of order. I remember a thought of surprise at basically flinging furniture out of the way. Very much a passenger in my body at that point. I began CPR. Muscle memory is right. I was not really conscious throughout most of it.

One of the few things that resembles a thought during the entire episode is something like “you cannot think about this right now if you do you will collapse”. A jumble of eternal instants. It dragged on. And on. And on. Eventually, very eventually, the paramedics arrived. I had another thing resembling a thought. I can collapse now. I can look away now. I have no basically no memory until the next day when I saw her, awake, in the hospital.

I know the day and time it happened. I checked the logs after. The paramedics took less than 5 minutes to arrive. But it was outside the normal linearity of my experience. It doesn’t fit between the day before and the day after. For a while, the jumbled movie would play in my head, involuntarily. I think I was trying to make sense of it, fit it in, when it really doesn’t fit. Experiences and memories I couldn’t easily process because I didn’t really experience them consciously when they occurred? Maybe something like that. It went away with time, and does not bother me these days, but descriptions of PTSD do make a lot more sense to me now.

— Richard Feynman on looking at the world from another point of view (1973)

— Hacker News

.

.

2022.12.22 Thursday ACHK

Chasing

Dear men,

Don’t be afraid to lose a girl.

Be afraid of losing yourself while chasing her.

— Lovers’ Guide

— guideforlovers

.

.

2022.12.21 Wednesday ACHK

Ex 2.1-1 Particle in a Box

Remove["Global`*"]

hbar := \[HBar]

H[V_] @ psi_  := -hbar^2/(2m) D[psi,{x,2}] + V psi

SchD[V_] @  psi_ := H[V] @ psi - En psi

SchD[V[x]] @ psi[x] == 0 // TeXForm

\displaystyle{-\text{En} \psi (x)-\frac{\hbar ^2 \psi ''(x)}{2 m}+\psi (x) V(x)=0}

phi[n_, x_] := Cn Sin[n Pi x/L]

SchD[0] @ phi[n,x] == 0 // ExpandAll

SchD[0] @ phi[n,x] / phi[n,x] == 0 // Simplify // TeXForm

\displaystyle{2 \text{En} L=\frac{\pi ^2 n^2 \hbar ^2}{L m}}

Starting with a linear superposition A E^(Ikx) + B E^(-Ikx) of independent plane waves, where A and B are constants, verify the box eigen-functions and eigen-energies given above.

Thus, show that this superposition is a solution of the Schrodinger equation and, by invoking the boundary condition, that k -> n Pi/L.

— Quantum Methods with Mathematica

phi[k_, x_] := A E^(I k x) + B E^(- I k x)

eq1 := SchD[0] @ phi[k,x]/phi[k,x] == 0 // Simplify

Ek[k_] := En /. Solve[eq1, En] [[1]]

Ek[k] // TeXForm

\displaystyle{\frac{k^2 \hbar ^2}{2 m}}

.

The boundary conditions are \displaystyle{\phi_{x=0} = \phi_{x=L} = 0}.

\displaystyle{  \begin{aligned}  A+B&=0 \\   A e^{i k L}+B e^{-i k L}&=0 \\  \end{aligned}}

So

\displaystyle{  \begin{aligned}  e^{i k L} - e^{-i k L}&=0 \\  \end{aligned}}

Solve[E^(I k L) - E^(-I k L) == 0, k] // Simplify

\displaystyle{  \left\{k\to -\frac{2 \pi  c_1}{L}\text{ if }c_1\in \mathbb{Z}, ~~~k\to -\frac{2 \pi  c_1+\pi }{L}\text{ if }c_1\in \mathbb{Z} \right\}}

\displaystyle{  =\left\{k\to \frac{n \pi }{L}\text{ if }n \in \mathbb{Z}\right\}}

.

phi[n_, x_] := Cn Sin[n Pi x/L]

norm[n_] = Cn /.
    Solve[
        Integrate[ phi[n,x]^2, {x,0,L}] == 1 /.
            Sin[m_Integer n Pi] -> 0, 
        Cn
    ] [[1]] // TeXForm

\displaystyle{  -\frac{\sqrt{2}}{\sqrt{L}}  }

It’s interesting to note in passing that the 1D box eigenfunctions are also classically the eigenfunctions of a taut string. However, whereas the quantum mechanical energies scale as n^2, the classical eigenfrequencies of the string’s normal modes are linear in n. This is a consequence of the classical wave equation being second order in time in contrast to the quantum wave equation being first order.

— Quantum Methods with Mathematica

— Me@2022-12-16 10:23:45 AM

.

.

2022.12.17 Saturday (c) All rights reserved by ACHK

Euler problem 11.5

A project created by using Lazarus on one platform can be compiled on any other one which Free Pascal compiler supports. For desktop applications a single source can target macOS, Linux, and Windows, with little or no modification. An example is the Lazarus IDE itself, created from a single code base and available on all major platforms including the Raspberry Pi.

— Wikipedia on Lazarus (software)

.

.

What is the greatest product of four adjacent numbers in the same direction (up, down, left, right, or diagonally) in the 20×20 grid?

program e11;          

uses
   SysUtils, math;

type
   T2d_int_array = array of array of integer;

const
   filename = 't.txt';

var
   current_dir: string;
   ptext: TextFile;
   
   line_string: string;
   s: string = '';
   lines: array of string;
   array_string_2d: array of array of string;
   array_int_2d: T2d_int_array;
   
   isbegin: boolean = true;
   i: integer;
   j: integer;
   lenx: integer = 0;
   leny: integer = 0;
   c: integer = 0;


function max4_iter(a2d: T2d_int_array;
                  i, j: integer;
                   acc: longint): integer;
var
   dia_l: longint = 0;
   dia_r: longint = 0;
   hori: longint = 0;
   vert: longint = 0;
   k: integer = 0;
   accm: longint = 0;
   x: integer = 0;
   y: integer = 0;

begin
   if i <= (lenx - 4) then begin
      hori := 1;
      for k := 0 to 3 do begin
         hori := hori*a2d[i+k, j];
      end;
   end;

   if j <= (leny - 4) then begin
      vert := 1;
      for k := 0 to 3 do begin
         vert := vert*a2d[i, j+k];
      end;
   end;

   if (i <= (lenx - 4)) and (j <= (leny - 4)) then
   begin
      dia_r := 1;
      for k := 0 to 3 do begin
         dia_r := dia_r*a2d[i+k, j+k];
      end;
   end;

   if (i >= 3) and (j <= (leny - 4)) then begin
      dia_l := 1;
      for k := 0 to 3 do begin
         dia_l := dia_l*a2d[i-k, j+k];
      end;
   end;

   if (i = (lenx - 1)) and (j = (leny - 1)) then
   begin
      max4_iter := acc;
   end else begin
      accm := max(acc,
                  max(hori,
                      max(vert,
                          max(dia_l, dia_r))));
      
      if i = lenx - 1 then begin
         x := 0;
         y := j + 1;
      end else begin
         x := i + 1;
         y := j;
      end;
      max4_iter := max4_iter(a2d, x, y, accm);
   end;
end;

begin

   current_dir := GetCurrentDir;

   writeln(filename, ':');
   writeln('==================================');

   if not FileExists(filename) then begin
      writeln(filename, ' does not exist.');
      exit;
   end;

   assign(ptext, filename);
   reset(ptext);

   setLength(lines, 0);
   s := '';
   isbegin := true;
   while not eof(ptext) do begin
      readln(ptext, line_string);
      if isbegin then begin
         s := s + line_string;
         isbegin := false;
      end else begin
         s := s + LineEnding + line_string;
      end;
   end;
   close(ptext);

   lines := s.split(LineEnding);
   lenx := length(lines);
   setLength(array_string_2d, lenx);

   for i := 0 to (lenx - 1) do begin
      array_string_2d[i] := lines[i].split(' ');
   end;
   leny := length(array_string_2d[0]);

   setLength(array_int_2d, lenx);
   for i := 0 to (lenx - 1) do begin
      setLength(array_int_2d[i], leny);
   end;

   for i := 0 to (lenx - 1) do begin
      for j := 0 to (leny - 1) do begin
         val(array_string_2d[i][j],
             array_int_2d[i][j],
             c);
      end;
   end;

   writeln(max4_iter(array_int_2d, 0, 0, 0));
   writeln('==================================');
end.

— Me@2022-12-14 03:56:23 PM

.

.

2022.12.14 Wednesday (c) All rights reserved by ACHK

Light-like

Spacetime interval, 3 | How far away is tomorrow?, 2

.

Any two events in a spacelike region are not causally related.

Any two events in a timelike region can be causally related.

How about two events on the boundary (light-like)?

— Me@2016-06-30 06:38:06 PM

.

Their spacetime distance is zero, meaning that the communication signals/particles between the two events would have to travel at the speed of light.

In other words, the two events can only be marginally causally related.

— Me@2022-12-14 10:55:20 AM

.

.

2022.12.14 Wednesday (c) All rights reserved by ACHK