posts | comments | archives | sites | create
(reminder: all quotes here are fiddled, probably.)

Das Röslein, das ich meine


Das Röslein, das ich meine,
davon Isaias sagt,
ist Maria die reine,
die uns das Blümlein bracht.
Aus Gottes ew'gem Rat
hat sie ein Kind geboren
Welches uns selig macht.

The Rose which I am singing,
Whereof Isaiah said,
Is from its sweet root springing
In Mary, purest Maid;
For through our God's great love and might
The blessed babe she bare us
In a cold, cold winter's night.

貞女必懷孕生子,
那玫瑰孕育出小花,
以賽亞得應驗,在貞靜謙遜
聖母瑪利亞。
按上主永恆的計劃,
有一嬰孩為我們而生,
救主要從她 腹中誕下。

Is 7:14
(思) 因此,吾主要親自給你們一個徵兆:看,有位貞女要懷孕生子,給他起名叫厄瑪奴耳。
(和) 因此,主自己要給你們一個兆頭,必有童女懷孕生子,給他起名叫以馬內利。

Mt 1:23
(思) 看,一位貞女,將懷孕生子,人將稱他的名字為厄瑪奴耳,意思是:天主與我們同在。
(和) 必有童女懷孕生子,人要稱他的名為以馬內利。(「以馬內利」翻出來就是「上帝與我們同在」。)

Is 9:5/6
(思) 因為有一嬰孩為我們誕生了,有一個兒子賜給了我們;他肩上擔負著王權,他的名字要稱為神奇的謀士、強有力的天主、永遠之父、和平之王。
(和) 因有一嬰孩為我們而生,有一子賜給我們,政權必擔在他的肩頭上。他名稱為奇妙、策士、全能的神、永在的父、和平的君。

xor swap


The operation xor has dual functions,
as opposite checker or as conditional flipper.

a b | xor
---------
0 0 | 0
0 1 | 1
1 0 | 1
1 1 | 0

So, a clever swap method can be done by

# produce a flag indicating whether
# the two are opposite (1) or equal (0)
a' = a xor b

# re-create a based on flag and orig b, and store it in b
b = a' xor b

# re-create b based on flag and orig a, and store it in a
a = a' xor b

After statement 1, the orig a is no longer in use.
So, in practice, to be more space-saving, use a for a'

a = a xor b
b = a xor b
a = a xor b

何以名之?姑名之曰:三儍對調法.
xor swap 雖然工巧, 但對於當代的 CPU 而言,
標準的 temp swap 不涉及運算, 比它更為迅速, .

tmp = a
a = b
b = tmp

編碼用意也更為明確.

誤己為鼠


昔有人, 誤己為鼠. 為人所訓乃悟. 後見貓於市而懼. 人怪之, 答曰: 吾為人所訓, 始悟己之非鼠, 貓從市來, 焉知吾非鼠耶 ?

* * *

鳥困於籠, 恨關羽不能張飛
人生在世, 需悟空更需悟淨

Labels: