M♪o 之學習筆記本《寅》井井︰【黑水冬】白馬彩衣

派生碼訊

寅 虎

詠白雪詩‧鲍照

白珪誠自白。不如雪光妍。
工隨物動氣。能逐勢方圓。
無妨玉顏媚。不奪素繒鮮。
投心障苦節。隱跡避榮年。
蘭焚石既斷。何用恃芳堅。

黑水冬︰何事『井谷射鮒』,又不中!反卻『瓮敝漏』?

 

派︰昔有『白馬非馬』論︰

古有『名實』之爭,要如何循名責實,以使名實相符呢?春秋後的戰國時代,平原君門客公孫龍因著『一事』,成為後來稱作『名家』──  邏輯?或詭辯 ?── 的『唯名論』之靈魂人物,與惠施齊名。據說一時趙國地區的戰馬大批死亡,秦國戰馬很多,爲了嚴防馬瘟入國,就在函谷關張貼告示凡趙國的馬不能入關 。一天,公孫龍騎着白馬來到關前。關吏說︰人能入關,但馬不能入關公孫龍辯:白馬非馬,為何不能入關呢關吏道:白馬也是馬公孫龍講:那公孫龍就是龍嗎關吏愣了……,這就是歷史上有名的『白馬非馬』論緣起!雖不知是否『辯贏了』就能『過關』?

想那『公孫龍』不識『法厄同』 ,所騎之白馬,不可號『日光』 ,日光入雲鄉,白馬披彩霞,一時渡雪地,晴光瀰蓋亞。白馬能彩衣方可謂『白馬』,看來並不是『白馬非馬』,反而更應是『此白馬非白馬』的耶??

《 神 》神諭︰

白馬

GustaveMoreau04

400px-Ermitáž_55_cropped

Peter_Paul_Rubens_-_The_Fall_of_Phaeton_(National_Gallery_of_Art)
The Fall of Phaeton
魯本斯‧法厄同之墜

錯覺
錯覺

視覺矛盾
矛盾

法厄同 Phaëton 在希臘神話中一般認為是太陽神阿波羅的兒子。也有說是曙光女神厄俄斯與刻法羅斯的兒子的,後卻被阿佛羅狄忒偷去看護她的神廟 。傳說中,法厄同對人誇耀自己是太陽神的兒子,別人不信。於是他去向父親太陽神請求,得著了父親發誓給他想要的任何東西 。他就此要求:駕駛父親的太陽車一天,從東方日出處到西方日落時。太陽神雖百般勸解的說你還沒這個能力,如此反而會給自身和人類帶來禍害。法厄同不肯聽,結果到了那天,他在慌亂中失去了對拉車白馬的控制,太陽車先是升得太高,大地驟然變冷 ;然後又陡然降低,燒焦了地上的草木,將非洲的大片地方變為沙漠,把衣索比亞居民的皮膚燒了個黑。最後,宙斯不得不親自動手,用閃電把法厄同擊斃 。法厄同的屍體掉進了一條大河【天上的波江座或義大利的波河】。他的密友 Cycnus 悲傷不已,天神同情之下把他變成了一隻天鵝。他的姐妹們也被變成了赤楊樹,其眼淚成了琥珀

弗蘭德畫家『彼得‧保羅‧魯本斯』 Peter Paul Rubens 是『巴洛克』畫派早期的代表人物。過去在巴洛克時期,『調和級數\sum \limits_{k=1}^\infty \frac{1}{k} = 1 + \frac{1}{2} + \frac{1}{3} + \frac{1}{4} + \cdots 很受『建築師』的重視,當時建築師在建造教堂和宮殿時,運用『調和序列』布置樓面以及建立高度『比例』,使得內外的建築細節呈現『和諧』的聯繫,『調和』之『美感』。俗話雖說︰一圖勝千言,然而『視覺』卻常常可能『欺騙』我們,它不但會引發『錯覺』,還能夠產生『矛盾』。就像自然現象裡的『調和級數』或許有時令人『直覺質疑』。

☆ 編者言說明

由於人類早多已不有《春的祭典》中,那樣的

贊曰︰

朝向日頭

不立文字,不分種族,直望北斗,迎來光明。

不得已,只好將《 神 》神諭擬譯成『神話』。

生 ︰若求可多工,彼此鑿井通,須知 Thread (computing)
450px-Multithreaded_process.svg

In computer science, a thread of execution is the smallest sequence of programmed instructions that can be managed independently by a scheduler, which is typically a part of the operating system.[1] The implementation of threads and processes differs between operating systems, but in most cases a thread is a component of a process. Multiple threads can exist within the same process and share resources such as memory, while different processes do not share these resources. In particular, the threads of a process share its instructions (executable code) and its context (the values of its variables at any given moment).

On a single processor, multithreading is generally implemented by time-division multiplexing (as in multitasking), and the central processing unit (CPU) switches between different software threads. This context switching generally happens frequently enough that the user perceives the threads or tasks as running at the same time. On a multiprocessor or multi-core system, threads can be executed in a true concurrent manner, with every processor or core executing a separate thread simultaneously. To implement multiprocessing, the operating system may use hardware threads that exist as a hardware-supported method for better utilization of a particular CPU, and are different from the software threads that are a pure software construct with no CPU-level representation.

Process schedulers of many modern operating systems directly support both time-sliced and multiprocessor threading. The operating system kernel allows programmers to manipulate threads by exposing required functionality through the system call interface. Some threading implementations are called kernel threads, whereas lightweight processes (LWP) are a specific type of kernel thread that share the same state and information.

Programs can have user-space threads when threading with timers, signals, or other methods to interrupt their own execution, performing a sort of ad hoc time-slicing.

 

△ 事件來驅動,常會組織執行緒

 

碼 ︰有 習 。寫一個含有執行緒的程式,用系統上的紅綠 LED ,演示調和交輝。

☿ 答︰ 交 交者,象一人立,兩腳左右交錯。交而輝者,蓋言紅綠『輝數』之『和』不變,合於一輝也。『調和』者,蓋指『輝數』應取『調和數』。又有『執行緒』,或可『演示』成︰

# 
pi@raspberrypi ~ $ sudo -s
root@raspberrypi:/home/pi# echo none > /sys/class/leds/led0/trigger
root@raspberrypi:/home/pi# echo none > /sys/class/leds/led1/trigger
root@raspberrypi:/home/pi# python3
Python 3.2.3 (default, Mar  1 2013, 11:53:50) 
[GCC 4.6.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.

# 載入所需程式庫
>>> import RPi.GPIO as GPIO
>>> from time import sleep

# 選擇 BCM 編號制
>>> GPIO.setmode(GPIO.BCM)
>>> GPIO.setwarnings(False)

# 出控針用母母線以一千導阻井通緒入針
>>> 出控針 = 11
>>> 緒入針 = 9
>>> 紅LED = 35
>>> 綠LED = 47
>>> GPIO.setup(出控針, GPIO.OUT)
>>> GPIO.setup(緒入針, GPIO.IN)
>>> GPIO.setup(紅LED, GPIO.OUT)
>>> GPIO.setup(綠LED, GPIO.OUT)
>>> 

# 測試井通
>>> GPIO.output(出控針, GPIO.HIGH)
>>> GPIO.input(緒入針)
1
>>> GPIO.output(出控針, GPIO.LOW)
>>> GPIO.input(緒入針)
0

# 以頻率數作調和,紅綠之和為交定數 11
>>> 計數 = 1
>>> 紅閃 = GPIO.PWM(紅LED, 1)
>>> 綠閃 = GPIO.PWM(綠LED, 10)
>>> 紅閃.start(50)
>>> 綠閃.start(50)

# 定義執行緒
>>> def 執行緒(針):
...     global 計數
...     紅閃.ChangeFrequency(計數)
...     計數 += 1
...     if 計數 > 10 :
...         計數 = 1       
... 
>>> GPIO.add_event_detect(緒入針, GPIO.FALLING)
>>> GPIO.add_event_callback(緒入針,執行緒)

# 啟動出控針
>>> 出控 = GPIO.PWM(出控針, 0.5)
>>> 出控.start(50)

# 啟動調和主程序
>>> while True:
...     綠閃.ChangeFrequency(11 - 計數)
...     sleep(1)
... 
#

 

行 ︰ ☿ 暈!才剛打『關』,又要『交』輝,分明是『參禪』 !!

 

訊 ︰☿☺ 說來卻也奇怪,條件越少,反倒是越難??