M♪o 之學習筆記本《寅》井井︰【黃土長夏】永日炎蒸

派生碼訊

寅 虎

夏夜歎‧杜甫
永日不可暮,炎蒸毒我腸。
安得萬里風,飄飖吹我裳。
昊天出華月,茂林延疏光。
仲夏苦夜短,開軒納微涼。
虛明見纖毫,羽蟲亦飛颺。
物情無巨細,自適固其常。
念彼荷戈士,窮年守邊疆。
何由一洗濯,執熱互相望。
竟夕擊刁鬥,喧聲連萬方。
青紫雖被體,不如早還鄉。
北城悲笳發,鸛鶴號且翔。
況複煩促倦,激烈思時康。

黃土暑雖說《 易 》易有

未濟:亨,小狐汔濟,濡其尾,無攸利。

彖曰:未濟,亨﹔柔得中也。 小狐汔濟,未出中也。 濡其尾,無攸利﹔不續終也。 雖不當位,剛柔應也。

象曰:火在水上,未濟﹔君子以慎辨物居方 。

,既無攸利,小狐何事濡其尾,來汔濟??問前途,恐有大水大火交替!!

無課自習。 ☿☹

 

派︰暑熱難讀文章,炎蒸令人神喪。也不知道誰講︰『心靜自然涼』。莫言永日天光長,遁入自好將己忘。讀得一片清涼︰

木蘭辭》‧佚名

唧唧復唧唧,木蘭當戶織。不聞機杼聲,惟聞女嘆息。
問女何所思?問女何所憶?女亦無所思,女亦無所憶。
昨夜見軍帖,可汗大點兵。軍書十二卷,卷卷有爺名。
阿爺無大兒,木蘭無長兄。願為市鞍馬,從此替爺征。
東市買駿馬,西市買鞍韉,南市買轡頭,北市買長鞭。
朝辭爺孃去,暮宿黃河邊,
不聞爺孃喚女聲,但聞黃河流水聲濺濺。
旦辭黃河去,暮宿黑山頭;
不聞爺孃喚女聲,但聞燕山胡騎聲啾啾。
萬里赴戎機,關山度若飛。朔氣傳金柝,寒光照鐵衣。
將軍百戰死,壯士十年歸。歸來見天子,天子坐明堂。
策勳十二轉,賞賜百千強。可汗問所欲 木蘭不用尚書郎,
願借明駝千里足,送兒還故鄉。
爺孃聞女來,出郭相扶將。阿姊聞妹來,當戶理紅妝。
小弟聞姊來,磨刀霍霍向豬羊。
開我東閣門,坐我西閣床。
脫我戰時袍,著我舊時裳,當窗理雲鬢,對鏡貼花黃。
出門看火伴,火伴皆驚惶:同行十二年,不知木蘭是女郎。
雄兔腳撲朔,雌兔眼迷離,兩兔傍地走,安能辨我是雄雌?

沉思『唧唧』是何聲響?故非機杼響,當真嘆息聲!逐一細點去,水聲寫濺濺, 騎聲用啾啾,皆是形聲法,象物之擬音。玄想曾經『何時』『哪地』人,嘆息聲『唧唧』??還有那『喚女聲』,…『朔氣傳金柝,寒光照鐵衣。』,忽憶

塞下曲》‧盧綸

月黑雁飛高,單于夜遁逃。

欲將輕騎逐,大雪滿弓刀。

,此時『秋蟬』死,不該是『知了』,難不成會是『守宮』!! ☺☺ 一時哈哈大笑,領悟了『讀碼』之 技 技︰天地一指,萬物一 馬 『馬』,同樣是『文』『章』。

 

生 ︰自習無課,勿生法忍!!

 

碼 ︰自 習 。蒸炎日永。

 

行 ︰雲天四季總無語,緣理而行沒對錯。派生禪喜作獅子吼 ,少會輕言放過。正好徇著『錯誤』走,通向『對時』路。原來

pi@raspberrypi ~ python3 miniterm.py -h   File "miniterm.py", line 123     raise NotImplementedError, "Sorry no implementation for your platform (%s) available." % sys.platform                              ^ SyntaxError: invalid syntax  pi@raspberrypi ~ python miniterm.py -h
Usage: miniterm.py [options] [port [baudrate]]

Miniterm - A simple terminal program for the serial port.

Options:
  -h, --help            show this help message and exit
  -p PORT, --port=PORT  port, a number (default 0) or a device name
                        (deprecated option)
  -b BAUDRATE, --baud=BAUDRATE
                        set baud rate, default 9600
  --parity=PARITY       set parity, one of [N, E, O, S, M], default=N
  -e, --echo            enable local echo (default off)
  --rtscts              enable RTS/CTS flow control (default off)
  --xonxoff             enable software flow control (default off)
  --cr                  do not send CR+LF, send CR only
  --lf                  do not send CR+LF, send LF only
  -D, --debug           debug received data (escape non-printable chars)
                        --debug can be given multiple times: 0: just print
                        what is received 1: escape non-printable characters,
                        do newlines as unusual 2: escape non-printable
                        characters, newlines too 3: hex dump everything
  --rts=RTS_STATE       set initial RTS line state (possible values: 0, 1)
  --dtr=DTR_STATE       set initial DTR line state (possible values: 0, 1)
  -q, --quiet           suppress non error messages
  --exit-char=EXIT_CHAR
                        ASCII code of special character that is used to exit
                        the application
  --menu-char=MENU_CHAR
                        ASCII code of special character that is used to
                        control miniterm (menu)
pi@raspberrypi ~ $ 

,它是派生二。雖不解程式之意,用著試誤法嘗試改成派生三。 ☿ 將之命名為『M♪oterm.py』 ☺。或真可逐跡償願,

#!/usr/bin/python3
# -*- coding: utf-8 -*-

import sys, os, serial, threading, getopt

EXITCHARCTER = '\x04'   #ctrl+D


import termios, sys, os
fd = sys.stdin.fileno()
old = termios.tcgetattr(fd)
new = termios.tcgetattr(fd)
new[3] = new[3] & ~termios.ICANON & ~termios.ECHO
new[6][termios.VMIN] = 1
new[6][termios.VTIME] = 0
termios.tcsetattr(fd, termios.TCSANOW, new)
s = ''    # We'll save the characters typed and add them to the pool.

def 讀鍵():
    c = os.read(fd, 1)
    #~ c = sys.stdin.read(1)
    if echo: sys.stdout.buffer.write(c); sys.stdout.flush()
    return c

def clenaup_console():
    termios.tcsetattr(fd, termios.TCSAFLUSH, old)

sys.exitfunc = clenaup_console      #terminal modes have to be restored on exit...


CONVERT_CRLF = 2
CONVERT_CR   = 1
CONVERT_LF   = 0

def 讀口():
    """loop forever and copy serial->console"""
    while 1:
        data = s.read()
        if repr_mode:
            sys.stdout.buffer.write(repr(data)[1:-1])
        else:
            sys.stdout.buffer.write(data)
        sys.stdout.flush()

def 寫口():
    """loop and copy console->serial until EOF character is found"""
    while 1:
        c = 讀鍵()
        if c == EXITCHARCTER: 
            break                       #exit app
        elif c == '\n':
            if convert_outgoing == CONVERT_CRLF:
                s.write('\r\n')         #make it a CR+LF
            elif convert_outgoing == CONVERT_CR:
                s.write('\r')           #make it a CR
            elif convert_outgoing == CONVERT_LF:
                s.write('\n')           #make it a LF
        else:
            s.write(c)                  #send character


#print a short help message
def 用法():
    sys.stderr.write("""用法: %s [options]
    Miniterm - A simple terminal program for the serial port.

    options:
    -p, --port=PORT: port, a number, default = 0 or a device name
    -b, --baud=BAUD: baudrate, default 9600
    -r, --rtscts:    enable RTS/CTS flow control (default off)
    -x, --xonxoff:   enable software flow control (default off)
    -e, --echo:      enable local echo (default off)
    -c, --cr:        do not send CR+LF, send CR only
    -n, --newline:   do not send CR+LF, send LF only
    -D, --debug:     debug received data (escape nonprintable chars)

""" % (sys.argv[0], ))

if __name__ == '__main__':
    #initialize with defaults
    port  = 0
    baudrate = 9600
    echo = 0
    convert_outgoing = CONVERT_CRLF
    rtscts = 0
    xonxoff = 0
    repr_mode = 0
    
    #parse command line options
    try:
        opts, args = getopt.getopt(sys.argv[1:],
            "hp:b:rxecnD",
            ["help", "port=", "baud=", "rtscts", "xonxoff", "echo",
            "cr", "newline", "debug"]
        )
    except getopt.GetoptError:
        # print help information and exit:
        用法()
        sys.exit(2)
    
    for o, a in opts:
        if o in ("-h", "--help"):       #help text
            用法()
            sys.exit()
        elif o in ("-p", "--port"):     #specified port
            try:
                port = int(a)
            except ValueError:
                port = a
        elif o in ("-b", "--baud"):     #specified baudrate
            try:
                baudrate = int(a)
            except ValueError:
                raise ValueError("Baudrate must be a integer number, not %r" % a)
        elif o in ("-r", "--rtscts"):
            rtscts = 1
        elif o in ("-x", "--xonxoff"):
            xonxoff = 1
        elif o in ("-e", "--echo"):
            echo = 1
        elif o in ("-c", "--cr"):
            convert_outgoing = CONVERT_CR
        elif o in ("-n", "--newline"):
            convert_outgoing = CONVERT_LF
        elif o in ("-D", "--debug"):
            repr_mode = 1

    #open the port
    try:
        s = serial.Serial(port, baudrate, rtscts=rtscts, xonxoff=xonxoff)
    except:
        sys.stderr.write("Could not open port\n")
        sys.exit(1)
    sys.stderr.write("--- Miniterm --- type Ctrl-D to quit\n")
    #start serial->console thread
    r = threading.Thread(target=讀口)
    r.setDaemon(1)
    r.start()
    #and enter console->serial loop
    寫口()

    sys.stderr.write("\n--- 離開 ---\n")

,作個仲夏夜之夢。

 

訊 山亭夏日》‧高駢

綠樹陰濃夏日長,樓台倒影入池塘。

水晶廉動微風起,滿架蔷薇一院香。

 

 

 

 

 

 

 

M♪o 之學習筆記本《寅》井井︰【紅火夏】刈麥遺穗

派生碼訊

寅 虎

觀刈麥》白居易

田家少閒月,五月人倍忙。
夜來南風起,小麥覆隴黃。
婦姑荷簞食,童稚攜壺槳。
相隨餉田去,丁壯在南岡。
足蒸暑土氣,背灼炎天光。
力盡不知熱,但惜夏日長。
復有貧婦人,抱子在其旁。
右手秉遺穗,左臂懸敝筐。
聽其相顧言,聞者為悲傷。
家田輸稅盡,拾此充饑腸。
今我何功德?曾不事農桑。
吏祿三百石,歲晏有餘糧。
念此私自愧,盡日不能忘。

紅火夏︰雖然俗話說︰禮尚往來。奈何人間憾事,刈麥遺穗現眼前。莫道夏日炎炎正好眠,還祈盡但惜熱暑時。

 

派︰《 畫 》畫傳︰昔有『米勒』者繪作『拾穗』圖,──

拾穗一詞淵源於舊約聖經路得記-路得與波阿斯的記載,路得在波阿斯田裏撿麥穗,以供養她的婆婆拿俄米,指農民需讓貧苦人撿拾收割後遺留穗粒以求溫飽,而該畫除了描繪3名農婦在金黃色麥田撿拾麥穗情景外,其金黃陽光、彎腰等細節,另外呈現「英雄史詩般的崇高意境」。 畫面上三位年紀不同的女性,表現出勞動家庭的命運 ,且畫面遠處可看到農地監督者坐於馬背上觀看,反映出當時資本主義產生的貧富差距。 畫面因遠方地平線處的教堂而流露出一股近似宗教情操的崇高性。──

Jean-François_Millet_-_Gleaners_-_Google_Art_Project_2

,觀之令人紅眼框。無巧不成書,無事難商量,想那《水滸傳》,真真是,官逼民反作強梁。

雖聞物已至,何故改課鋼,應應昨日事,補過先思量。一時講起了《通訊口》!殊不知早是議論紛紛!!

今天小企鵝學堂上,沸沸揚揚,這時那些小企鵝們正熱鬧的議論著昨天被『駭黑』之事的哩!!

有的主張︰怎麽可能被駭黑了呢 ?一定是誤傳。

有的辯證︰一山還比一山高,這回學長們,可好笑了!

有的議論︰駭客分成素客、灰客 、黑客,你怎知他是哪種?

有的搞笑︰『始』嗨ㄏㄞˋ,『終』嘿ㄏㄟ!不過是一音之轉嘛??

那你可有說法?

哦!我唱給你聽︰ㄍㄨㄥ道駭客我真莫宰羊,……

要是講起盜版,我蓋清楚,實在ㄍㄨㄥˋ

‧ㄍㄢˇ款ㄟ

‧ㄌㄨㄥ有目的

‧Maybe 盜亦有道

駭了□?黑了○的呦!!

一定ㄇㄞˋ甲伊喝一杯咖啡??

BabyTux

graphics-tux-638974

sonictux

starbucks_tux_linux_art-555px

長 長︰同學們請安靜。據聞實習的材料已到,課表將略作調整 ,學長告知此事與駭黑之事無涉!請大家按新表操課。

 

☆ 編者言說明

當真應了 M♪o 的『巧』字,恰巧『樹莓派 SAKS 擴展板』上也有『序列埠』,更巧它還有『教程』,此時 M♪o 正巧寫及《通訊口》 ,果然巧遇巧成七巧的耶!!讀她那一句『學長告知……無涉』,真真是此地無銀三百兩,妙哉!妙哉!按新表操課!!

 

生 ︰《 技 》技引入門之徑︰

假使從 RS-232Null ModemUARTSerial PortSystem Console 之發展與變遷的歷史來看,可以知道許多典型『應用』和週邊『裝置』興替的過程,即使在今天也都還非常『有用』。兩台電腦間簡單的『 null modem 』虛數據機連線,可以構成很好的『軟體學習』環境。事實上只有一個

樹莓派』也可以玩些不一樣的事情。由於我們將談談『序列埠』在『軟體學習』上的一些想法, 在此並不介紹基本的 Serial Port 之點點滴滴,特於此篇列出一些參考鏈結︰

Raspberry Pi Serial Port

RPi Serial Connection

What is AMA in /dev/ttyAMA0

Lesson 5. Using a Console Cable ── Adafruit’s Raspberry Pi

How To: Use Minicom on Linux for Serial Port Comunication

希望讀者能夠自行閱讀。

 

☆ 編者言說明

由於《 Physical computing ︰《四》 Serial Port ︰ 1. 開宗明義》文中之

How To: Use Minicom on Linux for Serial Port Comunication 鏈結已僵,校而改之為

11.7 Using minicom and seyon

,故此記。

 

△ 《 文 》文講程式庫使用之法︰

pySerial

Overview

This module encapsulates the access for the serial port. It provides backends for Python running on Windows, Linux, BSD (possibly any POSIX compliant system), Jython and IronPython (.NET and Mono). The module named “serial” automatically selects the appropriate backend.

It is released under a free software license, see LICENSE for more details.

Copyright (C) 2001-2013 Chris Liechti <cliechti(at)gmx.net>

Other pages (online)

 

△  TTL serial 是什麼哩,還請參造︰

RS-232 vs. TTL Serial Communication


One of the tools we use most when debugging our projects is serial input/output. Serial is very easy to implement, and it allows you to send/receive any data you need from your microcontroller to a computer’s serial port so it can be viewed using a terminal emulator. These two devices are compatible from a software perspective, however you can’t just hook a microcontroller up to a computer because the hardware interfaces are not compatible.

Most microcontrollers these days have built in UARTs (universally asynchronous receiver/transmitter) that can be used to receive and transmit data serially. UARTs transmit one bit at a time at a specified data rate (i.e. 9600bps, 115200bps, etc.). This method of serial communication is sometimes referred to as TTL serial (transistor-transistor logic). Serial communication at a TTL level will always remain between the limits of 0V and Vcc, which is often 5V or 3.3V. A logic high (‘1’) is represented by Vcc, while a logic low (‘0’) is 0V.

The serial port on your computer (if it’s lucky enough to have one, they’re quickly becoming a relic) complies with the RS-232 (Recommended Standard 232) telecommunications standard. RS-232 signals are similar to your microcontroller’s serial signals in that they transmit one bit at a time, at a specific baud rate, with or without parity and/or stop bits. The two differ solely at a hardware level. By the RS-232 standard a logic high (‘1’) is represented by a negative voltage – anywhere from -3 to -25V – while a logic low (‘0’) transmits a positive voltage that can be anywhere from +3 to +25V. On most PCs these signals swing from -13 to +13V.

The more extreme voltages of an RS-232 signal help to make it less susceptible to noise, interference, and degradation. This means that an RS-232 signal can generally travel longer physical distances than their TTL counterparts, while still providing a reliable data transmission.

 

This timing diagram shows both a TTL (bottom) and RS-232 signal sending 0b01010101

 

碼 ︰讀 習 。讀碼練習。

#!/usr/bin/env python

# Very simple serial terminal
# (C)2002-2004 Chris Liechti <cliecht@gmx.net>

# Input characters are sent directly (only LF -> CR/LF/CRLF translation is
# done), received characters are displayed as is (or as trough pythons
# repr, useful for debug purposes)
# Baudrate and echo configuartion is done through globals


import sys, os, serial, threading, getopt

EXITCHARCTER = '\x04'   #ctrl+D

#first choose a platform dependant way to read single characters from the console
if os.name == 'nt':
    import msvcrt
    def getkey():
        while 1:
            if echo:
                z = msvcrt.getche()
            else:
                z = msvcrt.getch()
            if z == '\0' or z == '\xe0':    #functions keys
                msvcrt.getch()
            else:
                if z == '\r':
                    return '\n'
                return z

elif os.name == 'posix':
    import termios, sys, os
    fd = sys.stdin.fileno()
    old = termios.tcgetattr(fd)
    new = termios.tcgetattr(fd)
    new[3] = new[3] & ~termios.ICANON & ~termios.ECHO
    new[6][termios.VMIN] = 1
    new[6][termios.VTIME] = 0
    termios.tcsetattr(fd, termios.TCSANOW, new)
    s = ''    # We'll save the characters typed and add them to the pool.
    def getkey():
        c = os.read(fd, 1)
        #~ c = sys.stdin.read(1)
        if echo: sys.stdout.write(c); sys.stdout.flush()
        return c
    def clenaup_console():
        termios.tcsetattr(fd, termios.TCSAFLUSH, old)
    sys.exitfunc = clenaup_console      #terminal modes have to be restored on exit...

else:
    raise "Sorry no implementation for your platform (%s) available." % sys.platform

CONVERT_CRLF = 2
CONVERT_CR   = 1
CONVERT_LF   = 0

def reader():
    """loop forever and copy serial->console"""
    while 1:
        data = s.read()
        if repr_mode:
            sys.stdout.write(repr(data)[1:-1])
        else:
            sys.stdout.write(data)
        sys.stdout.flush()

def writer():
    """loop and copy console->serial until EOF character is found"""
    while 1:
        c = getkey()
        if c == EXITCHARCTER: 
            break                       #exit app
        elif c == '\n':
            if convert_outgoing == CONVERT_CRLF:
                s.write('\r\n')         #make it a CR+LF
            elif convert_outgoing == CONVERT_CR:
                s.write('\r')           #make it a CR
            elif convert_outgoing == CONVERT_LF:
                s.write('\n')           #make it a LF
        else:
            s.write(c)                  #send character


#print a short help message
def usage():
    sys.stderr.write("""USAGE: %s [options]
    Miniterm - A simple terminal program for the serial port.

    options:
    -p, --port=PORT: port, a number, default = 0 or a device name
    -b, --baud=BAUD: baudrate, default 9600
    -r, --rtscts:    enable RTS/CTS flow control (default off)
    -x, --xonxoff:   enable software flow control (default off)
    -e, --echo:      enable local echo (default off)
    -c, --cr:        do not send CR+LF, send CR only
    -n, --newline:   do not send CR+LF, send LF only
    -D, --debug:     debug received data (escape nonprintable chars)

""" % (sys.argv[0], ))

if __name__ == '__main__':
    #initialize with defaults
    port  = 0
    baudrate = 9600
    echo = 0
    convert_outgoing = CONVERT_CRLF
    rtscts = 0
    xonxoff = 0
    repr_mode = 0
    
    #parse command line options
    try:
        opts, args = getopt.getopt(sys.argv[1:],
            "hp:b:rxecnD",
            ["help", "port=", "baud=", "rtscts", "xonxoff", "echo",
            "cr", "newline", "debug"]
        )
    except getopt.GetoptError:
        # print help information and exit:
        usage()
        sys.exit(2)
    
    for o, a in opts:
        if o in ("-h", "--help"):       #help text
            usage()
            sys.exit()
        elif o in ("-p", "--port"):     #specified port
            try:
                port = int(a)
            except ValueError:
                port = a
        elif o in ("-b", "--baud"):     #specified baudrate
            try:
                baudrate = int(a)
            except ValueError:
                raise ValueError, "Baudrate must be a integer number, not %r" % a
        elif o in ("-r", "--rtscts"):
            rtscts = 1
        elif o in ("-x", "--xonxoff"):
            xonxoff = 1
        elif o in ("-e", "--echo"):
            echo = 1
        elif o in ("-c", "--cr"):
            convert_outgoing = CONVERT_CR
        elif o in ("-n", "--newline"):
            convert_outgoing = CONVERT_LF
        elif o in ("-D", "--debug"):
            repr_mode = 1

    #open the port
    try:
        s = serial.Serial(port, baudrate, rtscts=rtscts, xonxoff=xonxoff)
    except:
        sys.stderr.write("Could not open port\n")
        sys.exit(1)
    sys.stderr.write("--- Miniterm --- type Ctrl-D to quit\n")
    #start serial->console thread
    r = threading.Thread(target=reader)
    r.setDaemon(1)
    r.start()
    #and enter console->serial loop
    writer()

    sys.stderr.write("\n--- exit ---\n")

 

行 ︰就這樣一股腦兒的胡倒,不知是教學,還是學教。☿☹只聽過背書,難不成背碼的耶!☿☹☹ 又沒給安裝之法,不知是要怎麼練哪樣習?咦!東西還沒見到,該裝…… ☿☺☿

 

訊 ︰ ☿ 子曰:『學而不思則罔,. 思而不學則殆』

 

 

 

 

 

 

M♪o 之學習筆記本《寅》井井︰【青木春】驚駭來黑

派生碼訊

寅 虎

《東萊博議》‧吕祖谦

鄭伯克段於鄢

釣者負魚,魚何負於釣?獵者負獸,獸何負於獵。莊公負叔段,叔段何負于莊公。

青木春︰  黑 黑者己沾灰,顏面有塵駭 駭者馬驚鳴,何故自驚驚人。欲問停課之因??

 

派︰聽聞學長說,實習機器故障,所以停課。也常常上課不實習。故不故障、上不上課、實不實習,豈關聯!事出必有因,費疑猜!!

隨詠杜甫《奉先》五百字,準備考試。

<自京赴奉先詠懷五百字>

杜陵有布衣,老大意轉拙。許身一何愚,竊比稷與契。
居然成濩落,白首甘契闊。蓋棺事則已,此志常覬豁。
窮年憂黎元,嘆息腸內熱。取笑同學翁,浩歌彌激烈。
非無江海志,蕭灑送日月。生逢堯舜君,不忍便永訣。
當今廊廟具,構廈豈雲缺 ?葵藿傾太陽,物性固莫奪。
顧惟螻蟻輩,但自求其穴。胡為慕大鯨,輒擬偃溟渤 ?
以茲悟生理,獨恥事幹謁。兀兀遂至今,忍為塵埃沒。
終愧巢與由,未能易其節。沈飲聊自遣,放歌破愁絕。
歲暮百草零,疾風高岡裂。天衢陰崢嶸,客子中夜發。
霜嚴衣帶斷,指直不得結。淩晨過驪山,禦榻在嵽嵲。
蚩尤塞寒空,蹴踏崖谷滑。瑤池氣鬱律,羽林相摩戛。
君臣留歡娛,樂動殷膠葛。賜浴皆長纓,與宴非短褐。
彤庭所分帛,本自寒女出。鞭撻其夫家,聚斂貢城闕。
聖人筐篚恩,實欲邦國活。多士盈朝廷,仁者宜戰栗。
況聞內金盤,盡在衛霍室。中堂有神仙,煙霧蒙玉質。
煖客貂鼠裘,悲管逐清瑟。勸客駝蹄羹,霜橙壓香橘。
朱門酒肉臭,路有凍死骨。榮枯咫尺異,惆悵難再述。
北轅就涇渭,官渡又改轍。群冰從西下,極目高崒兀。
疑是崆峒來,恐觸天柱折。河梁幸未坼,枝撐聲窸窣。
行李相攀援,川廣不可越。老妻寄異縣,十口隔風雪。
誰能久不顧,庶往共飢渴。入門聞號咷,幼子餓已卒。
吾寧舍一哀,裏巷亦嗚咽。所愧為人父,無食致夭折。
豈知秋禾登,貧窶有倉卒。生常免租稅,名不隸征伐。
撫跡猶酸辛,平人固騷屑。默思失業徒,因念遠戍卒。
憂端齊終南,澒洞不可掇。

正吟誦,《 阡 陌 網 》阡陌網有訊來︰

200px-Lamoascii

妳們學堂被駭了

Linu^{H}x 是也

matrix_tux_by_kr3_w

誰說不敢

那些資料就是我黑掉的

想定位我

嗨嘿…

企鵝與派生碼訊0

 

 

你是誰【追跡中】

不敢以真面目示人,很可笑

 

 

 

 

 

 

【已斷線】

 

☆ 編者言說明

阡陌縱橫之網,匪夷所思,強迫而譯,難以釋懷。或想『阡』蓋為『發訊方』吧!苦於無處可考,特以為記。

因此再問學長,得知有人闖入機房,透過《通訊口》駭入,黑除了主機資料,正在搶救中。這事不可多言,以免引起驚慌。云云…

看來是要息事寧人,不了了之的了!?

 

生 Linu^{H}x 不知何許人也?必是如此得知了我之阡陌網的帳號,須細思量個對策。記得《盜亦有道?》上講︰

莊子、外篇『胠篋第十』上有一段文字

故跖之徒問於跖曰:「盜亦有道乎?」跖曰:「何適而無有道邪? 妄意室中之藏,聖也;入先,勇也;出後,義也;知可否,知也;分均,仁也。五者不備而能成大盜者,天下未之有也。」由是觀之 ,善人不得聖人之道不立,跖不 得聖人之道不行;天下之善人少而不善人多,則聖人之利天下也少而害天下也多。

並有雜篇、盜跖第二十九一段故事,讀來令人津津有味,難道義賊廖添丁乃盜跖之傳人乎?東方的『大盜』哲學和西方的『駭客』觀點能否作比較呢?如果要比較,當然得知道 hacker 的源流 。有位 Ben Yagoda 先生寫了一篇『 Hack 簡史』寫的很好。在此簡略的介紹,文中首先引用作者與美國方言學會會長談 “hack” 和 “hacker” 的對話,會長說︰

the earliest examples share a relatively benign sense of “working on” a tech problem in a different, presumably more creative way than what’s outlined in an instruction manual.

也就是說最早所謂駭客是「創造性的使用說明書,用不一樣的辦法解決工程問題的人」。其後作者寫到,“hack” 一字 1955年就在 M.I.T 出現了,到了 1975 年 M.I.T 的電腦行話語詞表開啟了將 hacker 用於對電腦狂熱份子的宣言,並於所謂『八條定義』中開宗明義的說「駭客原指用大刀闊斧作傢俱的人」;其中第八條寫到︰

[deprecated] A malicious meddler who tries to discover sensitive information by poking around. Hence password hacker, network hacker. The correct term for this sense is cracker.

此條中〔勿用〕deprecated 一詞所說的『懷著惡意愛管閑事』者成了今天的黑帽駭客,或乾脆說黑客;相反的『本著活潑創造精神』者則變成今天的白帽駭客,也許簡稱為素客。同時作者論及駭客一詞的詞意變化、應用領域擴大…等等,於此就不多贅敘了。…

,尚且不可任意武斷。

△ 那就從安排閱讀計畫開始︰

Physical computing ︰《四》 Serial Port ︰ 1. 開宗明義

 

碼 ︰無 習

行 ︰☿☹ 還沒準備連接線?☺ 就想玩

Loop Back System Console 系統主控台繞回接法︰

Pin 6 GND黑色線
Pin 8 TXD白色線
Pin 10 RXD綠色線
紅色線 +5V 不接

USB 連接頭接回『樹莓派』。

139_G_1373091551948

,嗯!去找學長借。☺☺

 

訊 ︰ ☿ 孫子曰︰勿恃敵之不來,恃吾有以待之。

 

 

 

 

 

 

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)
... 
#

 

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

 

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

 

 

 

 

 

M♪o 之學習筆記本《寅》井井

派生碼訊

寅 虎

天地相乘數一原,
忽逢甲子又興元;
年華二八乾坤改,

看盡殘花總不言。

寅虎︰ 寅黃黃同源為何故?寅者象以『習射』時用的箭靶,黃色為此靶心之色。坤 ䷁ 土成始位西南,艮 ䷳ 山成終在東北。學作東北 虎虎 ,莫為中山 狼 狼。

 

派︰《 文 》文說︰

《説文解字》:寅,髕也。正月,陽气動,去黃泉,欲上出,陰尚彊,象宀不達,髕寅於下也。凡寅之屬皆从寅。

《説文解字》:虎,山獸之君。从虍,虎足象人足。象形。凡虎之屬皆从虎。虝,古文虎。 古虎 ,亦古文虎。

《説文解字》:井,八家一井。象溝韓形罋之象也。古者伯益初作井。凡井之屬皆從井。

《 易 》易有︰

井 ䷯ :改邑不改井,無喪無得,往來井井。汔至,亦未繘井,羸其瓶,凶。

《 史 》史講『后羿』︰

左傳‧《襄公四年

四年,春,楚師為陳叛故,猶在繁陽,韓獻子患之,言於朝曰,文王帥殷之叛國,以事紂,唯知時也,今我易之,難哉,三月,陳成公卒,楚人將伐陳,聞喪乃止,陳人不聽命,臧武仲聞之曰,陳不服於楚必亡,大國行禮焉而不服,在大猶有咎,而況小乎,夏,楚彭名侵陳,陳無禮故也,穆叔如晉,報知武子之聘也,晉侯享之,金奏肆夏之三,不拜,工歌文王之三,又不拜,歌鹿鳴之三,三拜 ,韓獻子使行人子員問之,曰,子以君命辱於敝邑,先君之禮,藉之以樂,以辱吾子,吾子舍其大而重,拜其細,敢問何禮也,對曰 ,三夏,天子所以享元侯也,使臣弗敢與聞,文王,兩君相見之樂也,臣不敢及,鹿鳴,君所以嘉寡君也,敢不拜嘉,四牡,君所以勞使臣也,敢不重拜,皇皇者華,君教使臣曰,必諮於周,臣聞之 ,訪問於善為咨,咨親為詢,咨禮為度,咨事為諏,咨難為謀,臣獲五善,敢不重拜。

秋,定姒薨,不殯于廟,無櫬,不虞,匠慶謂季文子曰,子為正卿 ,而小君之喪不成,不終君也,君長,誰受其咎,初,季孫為己樹六檟於蒲圃東門之外,匠慶請木,季孫曰,略,匠慶用蒲圃之檟,季孫不御,君子曰,志所謂多行無禮,必自及也,其是之謂乎。

冬,公如晉聽政,晉侯享公,公請屬鄫,晉侯不許,孟獻子曰,以寡君之密邇於仇讎,而願固事君,無失官命,鄫無賦於司馬,為執事朝夕之命敝邑,敝邑褊小,闕而為罪寡君,寡君是以願借助焉,晉侯許之。

楚人使頓間陳,而侵伐之,故陳人圍頓。

無終子嘉父使孟樂如晉,因魏莊子納虎豹之皮,以請和諸戎,晉侯曰,戎狄無親而貪,不如伐之,魏絳曰,諸侯新服,陳新來和,將觀於我,我德則睦,否則攜貳,勞師於戎,而楚伐陳,必弗能救,是棄陳也,諸華必叛,戎禽獸也,獲戎失華,無乃不可乎,夏訓有之曰,有窮后羿,公曰,后羿何如,對曰,昔有夏之方衰也,后羿自鉏遷于窮石,因夏民以代夏政,恃其射也,不脩民事,而淫于原獸,棄武羅,伯困,熊髡,尨圉,而用寒浞,寒浞,伯明氏之讒子弟也,伯明后寒棄之,夷羿收之,信而使之,以為己相,浞行媚于內,而施賂于外,愚弄其民,而虞羿于田,樹之詐慝,以取其國家 ,外內咸服,羿猶不悛,將歸自田,家眾殺而亨之,以食其子,其子不忍食諸,死于窮門,靡奔有鬲氏,浞因羿室,生澆及豷,恃其讒慝詐偽而不德于民,使澆用師,滅斟灌及斟尋氏,處澆于過,處豷于戈,靡自有鬲氏,收二國之燼以滅浞,而立少康,少康滅澆于過,后杼滅豷于戈,有窮由是遂亡,失人故也,昔周辛甲之為大史也,命百官,官箴王闕,於虞人之箴曰,芒芒禹跡,畫為九州,經啟九道,民有寢廟,獸有茂草,各有攸處,德用不擾,在帝夷羿,冒于原獸,忘其國恤,而思其麀牡,武不可重,用不恢于夏家,獸臣司原,取告僕夫,虞箴如是,可不懲乎,於是晉侯好田,故魏絳及之,公曰,然則莫如和戎乎,對曰,和戎有五利焉,戎狄荐居,貴貨易土,土可賈焉,一也,邊鄙不聳,民狎其野,穡人成功,二也,戎狄事晉,四鄰振動,諸侯威懷,三也,以德綏戎,師徒不動 ,甲兵不頓,四也,鑒于后羿,而用德度,遠至邇安,五也,君其圖之,公說,使魏絳盟諸戎,脩民事,田以時。

冬,十月,邾人,莒人,伐鄫,臧紇救鄫,侵邾,敗于狐駘,國人逆喪者皆髽,魯於是乎始髽,國人誦之曰,臧之狐裘,敗我於狐駘 ,我君小子,朱儒是使,朱儒朱儒,使我敗於邾。

 

☆ 編者言說明

由於編者不知 M♪o 所指之《 文 》、《 易 》《 史 》是何物?只能勉為其難,用著『想當然爾』之法,比之擬之一番,尚祈讀者法眼。

 

生 ︰井通地下水,同源之井,彼此互通也,所以井井往來。

IPC 』Inter-process communication 、『  TCP/IP  』、『 IOT  』都有『 I 』,『 Inter- 』表『之間』之意,常用『握手』 Handshake 之『規範』。應該深體《 圖 》演︰

Three-way-handshake-example

 

△ 細究 Handshaking

In information technology, telecommunications, and related fields, handshaking is an automated process of negotiation that dynamically sets parameters of a communications channel established between two entities before normal communication over the channel begins. It follows the physical establishment of the channel and precedes normal information transfer.

It is usually a process that takes place when a computer is about to communicate with a foreign device to establish rules for communication. When a computer communicates with another device like a modem, printer, or network server, it needs to handshake with it to establish a connection.

Handshaking can be used to negotiate parameters that are acceptable to equipment and systems at both ends of the communication channel, including, but not limited to, information transfer rate, coding alphabet, parity, interrupt procedure, and other protocol or hardware features. Handshaking is a technique of communication between two entities. However, within TCP/IP RFCs, the term “handshake” is most commonly used to reference the TCP three-way handshake. For example, the term “handshake” is not present in RFCs covering FTP or SMTP. One exception is Transport Layer Security, TLS, setup, FTP RFC 4217. In place of the term “handshake,” FTP RFC 3659 substitutes the term “conversation” for the passing of commands. [1] [2] [3]

A simple handshaking protocol might only involve the receiver sending a message meaning “I received your last message and I am ready for you to send me another one.” A more complex handshaking protocol might allow the sender to ask the receiver if he is ready to receive or for the receiver to reply with a negative acknowledgement meaning “I did not receive your last message correctly, please resend it” (e.g. if the data was corrupted en route). [4]

Handshaking makes it possible to connect relatively heterogeneous systems or equipment over a communication channel without the need for human intervention to set parameters. One classic example of handshaking is that of modems, which typically negotiate communication parameters for a brief period when a connection is first established, and thereafter use those parameters to provide optimal information transfer over the channel as a function of its quality and capacity. The “squealing” (which is actually a sound that changes in pitch 100 times every second) noises made by some modems with speaker output immediately after a connection is established are in fact the sounds of modems at both ends engaging in a handshaking procedure; once the procedure is completed, the speaker might be silenced, depending on the settings of operating system or the application controlling the modem.

△ 或可試讀香儂?!

 

碼 ︰有 習 。兩根母母線,以一千導阻,井通二四與二六 ,古曰︰西金北水關。用二、二十、二百赫茲均任脈衝發西金,以取北水之數論證,訊通此關之法。

☿ 答︰『西金』數四、九,既『發』當是『出針』;『北水』一與六,以『取』故為『入針』。『均任』者,平責, duty cycle = dc = 50。『脈衝』者, PWM 也。以『數』『證』之者,證『發數』和『取數』相符。『二』、『二十』、『二百』皆『赫茲』者, Hz 也,全是 PWM 之 frequency 。然而『連續』之『訊號』,考之以『離散』之『讀取』,或可『實證』者,僅『 1 』以及『 0 』平均一周期之『比例』而已。故而『訊通此關之法』之要,在於越能『高速』取值越相合。

 

行 ︰每每都用母母線!?不知是『母』好用!還是怕我們『不知』用『公』?!☿☺☺

欲程式『實證』理論,昨兒乏了,何不改日?…… ☺☿

 

訊 ︰☿ 《古訓》︰井中有仁,切勿落井下石。