Arduino library writer guide and specification

Arduino Style Guide for Writing Libraries – Arduino Reference

http://arduino.cc/en/Reference/APIStyleGuide

This is a style guide to writing library APIs in an Arduino style.

Some of these run counter to professional programming practice. We’re aware of that, but it’s what’s made it possible for so many beginners to get started with Arduino easily.

So please code with these principles in mind. If you have suggestions on how to make Arduino libraries clearer for that core audience, please jump in the discussion. This is a work in progress.

Be kind to the end user.

Assume you are writing an API for an intelligent person who has not programmed before. Come up with a clear mental model of the concept you’re working with, and the terms and functions you will use.

Match your API to the underlying capabilities. You don’t want to expose implementation details to the user but you also don’t want an API that suggests an inaccurate mental model of the possibilities. For example, if there are only a few possible options for a particular setting, don’t use a function that takes an int, as it implies you can use any value you want.

Organize your public functions around the data and functionality that the user wants.

Quite often, the command set for a particular electronic module is overly complicated for the most common uses, or can be re-organized around higher level functionality.

Think about what the average person thinks the thing does, and try to organise your API functions around that.

Adafruit’s BMP085 library is a good example. The readPressure() command performs all the necessary steps to get the final pressure.

The library wraps this commonly executed series of functions into a high-level single command which returns the value the user’s looking for in a format she expects.

It abstracts away not only the low-level I2C commands, but also the mid-level temperature and pressure calculations, while still offering those mid-level functions as public functions for those who want them.

Use full, everyday words.

Don’t be terse with your function names or variables.

Use everyday terms instead of technical ones.

Pick terms that correspond to popular perception of the concept at hand. Don’t assume specialized knowledge.

For example, this is why we used analogWrite() rather than pwm().

Abbreviations are acceptable, though, if they’re in common use or are the primary name for something.

For example, “HTML” is relatively common and “SPI” is effectively the name of that protocol (“serial-peripheral interface” is probably too long). (“Wire” was probably a mistake, as the protocol it uses is typically called “TWI” or “I2C”.)

Avoid words that have different meanings to the general public. For example, to programmers, an error is a notification that something happened. To the general public, errors are bad things.

When you have to use a domain-specific term, write a sentence or two describing it to the general public FIRST. You’ll likely come across a better term, and if not, you’ll have started the documentation on your library.

Document and comment as you go. When writing examples and documentation, follow this style guide:

http://arduino.cc/en/Reference/StyleGuide

Use the established core libraries and styles.

Use read() to read inputs, and write() to write to outputs, e.g. digitalRead(), analogWrite(), etc.

Use the Stream.h and Print.h libraries when dealing with byte streams. If it’s not appropriate, at least try to use its API as a model.

For more on this, see below

For network applications, use the Client and Server libraries as the basis.

Use begin() to initialize a library instance, usually with some settings. Use end() to stop it.

Use camel case function names, not underscore.

For example, analogRead, not analog_read.

Or myNewFunction, not my_new_function. We’ve adopted this from Processing.org for readability’s sake.

LONG_CONSTANT_NAMES_FULL_OF_CAPS are hard to read. Try to simplify when possible, without being terse.

Try to avoid boolean arguments.

Instead, consider providing two different functions with names the describe the differences between them.

Don’t assume knowledge of pointers.

Beginning users of C find this the biggest roadblock, and get very confused by & and *, so whenever you can avoid having them hanging out in the API, do so.

One way is to pass by reference using array notation rather than * notation,

for example.

void printArray( char* array);

can be replaced by

void printArray(char[ ] array);

Though there are some libraries where we pass pointers by using structures like const chars, avoid anything that requires the user to pass them. For example,rather than:

foo.readAccel(&x, &y, &z);

use something like this:

xAxis = adxl.readX();

yAxis = adxl.readY();

zAxis = adxl.readZ();

When using serial communication, allow the user to specify any Stream object, rather than hard-coding “Serial”.

This will make your library compatible all serial ports on Mega and the Due, and can also use alternate interfaces like SoftwareSerial.

The Stream object can be passed to your library’s constructor or to a begin() function (as a reference, not a pointer). See Firmata 2.3 or XBee 0.4 for examples of each approach.

When writing a library that provides byte-stream communication, inherit Arduino’s Stream class, so your library can be used with all other libraries that accept Stream objects.

If possible, buffer incoming data, so that read() immediately accesses data the buffer but does not wait for more data to arrive.

If possible, your write() method should store data to a transmit buffer, but write() must wait if the buffer does not have enough space to immediately store all outgoing data.

The yield() function should be called while waiting.

Here are a few libraries that are exemplary from Adafruit.

She breaks the functions of the devices down into their high-level activities really well.

https://github.com/adafruit/Adafruit-BMP085-Library 
https://github.com/adafruit/DHT-sensor-library

This does a nice job of abstracting from the Wire (I2C) library: https://github.com/adafruit/RTClib Reference Home

Corrections, suggestions, and new documentation should be posted to the Forum.

The text of the Arduino reference is licensed under a Creative Commons Attribution-ShareAlike 3.0 License. Code samples in the reference are released into the public domain.


Arduino IDE 1.5: Library specification – Arduino

https://github.com/arduino/Arduino/wiki/Arduino-IDE-1.5:-Library-specification

Cristian Maglie edited this page on Feb 26 · 24 revisions Pages 4

Arduino IDE 1.5 3rd party Hardware specification

Arduino IDE 1.5 from command line

Arduino IDE 1.5: Library specification

Home

Clone this wiki locally

Clone in Desktop

The updated (rev. 2) 1.5.x library format is implemented from IDE 1.5.6. We don’t expect to make any major changes but it may be tweaked while the 1.5.x releases remain in beta.

If you want to join the conversation subscribe to the Arduino developers list: https://groups.google.com/a/arduino.cc/forum/#!forum/developers

This specification is a proposal for a new 3rd party library format to be used in the Arduino IDE 1.5.x series.

rev.1 has been implemented starting with version 1.5.3 (now suprseded by rev.2)
rev.2 will be implemented starting from version 1.5.6.
This new library format is intended to be used in tandem with an automatic Library Manager, that will be implemented in future versions of the Arduino IDE. The Library Manager will allow users to automatically download and install the libraries needed in their projects, taking care of dependencies between libraries, with an easy to use graphic interface. Eventually, there will be an online centralized repository, provided by Arduino, where contributed libraries will reside.

Arduino 1.5.x supports multiple microcontroller architectures (e.g. AVR, SAM, etc), meaning that libraries may need to work on multiple architectures. The new 1.5.x library format doesn’t contain special support for cross-architecture libraries, but it does provide a pre-processor based mechanism for libraries to target sections of code to specific architectures.

See also

The Arduino library style guide is here : http://arduino.cc/en/Reference/APIStyleGuide

The style guide for examples is here : http://arduino.cc/en/Reference/StyleGuide

1.5 library format (rev. 2)
Library metadata

The most significant addition to the format is the ability to add information about the library itself through a properties file called library.properties.

This file will allow the future Library Manager to search and install a library and its dependencies in an easy and automated way.

library.properties file format

The library.properties file is a key=value properties list. Every field in this file is UTF-8 encoded. The available fields are:

name – the name of the library
version – version of the library
author – name/nickname of the authors and their email addresses (not mandatory) separated by comma “,”
maintainer – name and email of the maintainer
sentence – a sentence explaining the purpose of the library
paragraph – a longer description of the library. The value of sentence always will be prepended, so you should start by writing the second sentence here
url – the URL of the library project, for a person to visit. Can be a github or similar page as well
architectures – a comma separated list of architectures supported by the library. If the library doesn’t contain architecture specific code use “*” to match all architectures

Example:

name=WebServer
version=1.0
author=Cristian Maglie <c.maglie@example.com>, Pippo Pluto <pippo@example.com>
maintainer=Cristian Maglie <c.maglie@example.com>
sentence=A library that makes coding a Webserver a breeze.
paragraph=Supports HTTP1.1 and you can do GET and POST.
url=http://example.com/
architectures=avr
Layout of folders and files

Arduino libraries will be composed of a number of folders. Each folder has a specific purpose (sources, examples, documentation, etc). Folders not covered in this specification may be added as needed to future revisions.

Source code

For 1.5.x-only libraries, the source code resides in the src folder. For example:

Servo/src/Servo.h

Servo/src/Servo.cpp

The source code found in src folder and all its subfolders is compiled and linked in the user’s sketch. Only the src folder is added to the include search path (both when compiling the sketch and the library). When the user imports a library into their sketch (from the “Tools > Import Library” menu), an #include statement will be added for all header (.h) files in the src/ directory (but not its sub-folders). As a result, these header files form something of a de-facto interface to your library; in general, the only header files in the root src/ folder should be those that you want to expose to the user’s sketch and plan to maintain compatibility with in future versions of the library. Place internal header files in a sub-folder of the src/ folder.

For backward compatibility with Arduino 1.0.x, the library author may opt to not place source code into a folder called src. In this case the 1.0 library format is applied and the source code is searched from the library root folder and the utility folder, for example:

Servo/Servo.h

Servo/Servo.cpp

Servo/utility/ServoTimers.h

Servo/utility/ServoTimers.cpp

This will allow existing 1.0.x libraries to compile under 1.5.x as well and vice-versa. If a library only needs to run on 1.5.x, we recommend placing all source code in the src/ folder. If a library requires recursive compilation of nested source folders, its code must be in the src/ folder (since 1.0.x doesn’t support recursive compilation, backwards compatibility wouldn’t be possible anyway).

Library Examples

Library examples must be placed in the examples folder. Note that the examples folder must be written exactly like that (with lower case letters).

Servo/examples/…

Sketches contained inside the examples folder will be shown in the Examples menu of the IDE.

Extra documentation

An extras folder can be used by the developer to put documentation or other items to be bundled with the library. Remember that files placed inside this folder will increase the size of the library, so putting a 20MB PDF in a library that weights a few kilobytes may be not a good idea.

The content of the extras folder is totally ignored by the IDE; you are free to put anything inside such as supporting documentation, etc.

Keywords

The list of highlighted keywords must be placed in a file called keywords.txt. The format of this file is the same as the 1.0 libraries

Servo/keywords.txt
A complete example

A hypothetical library named “Servo” that adheres to the specification follows:

Servo/

Servo/library.properties

Servo/keywords.txt

Servo/src/

Servo/src/Servo.h

Servo/src/Servo.cpp

Servo/src/ServoTimers.h

Servo/examples/

Servo/examples/Sweep/Sweep.ino

Servo/examples/Pot/Pot.ino

Servo/extras/

Servo/extras/Servo_Connectors.pdf

Working with multiple architectures

In 1.5.x, libraries placed in the user’s sketchbook folder (in the libraries/ sub-folder) will be made available for all boards, which may include multiple different processor architectures. To provide architecture-specific code or optimizations, library authors can use the ARDUINO_ARCH_XXX preprocessor macro (#define), where XXX is the name of the architecture (as determined by the name of the folder containing it), e.g. ARDUINO_ARCH_AVR will be defined when compiling for AVR-based boards. For example,

#if defined(ARDUINO_ARCH_AVR)
// AVR-specific code
#elif defined(ARDUINO_ARCH_SAM)
// SAM-specific code
#else
// generic, non-platform specific code
#endif
Alternatively, if a library only works on certain architectures, you can provide an explicit error message (instead of allowing the compilation to fail in an difficult to understand way):

#if defined(ARDUINO_ARCH_AVR)
// AVR-specific code
#elif defined(ARDUINO_ARCH_SAM)
// SAM-specific code
#else
#error “This library only supports boards with an AVR or SAM processor.”
#endif
Old library format (pre-1.5)
In order to support old libraries (from Arduino 1.0.x), the Arduino 1.5.x will also compile libraries missing a library.properties metadata file. As a result, these libraries should behave as they did in Arduino 1.0.x, although they will be available for all boards, including non-AVR ones (which wouldn’t have been present in 1.0.x).

.END

Leave a comment

Filed under Electronics DIY Project

大家對這個荒謬的社會還可以存有甚麼幻想?- 陳文敏

後佔領時代的香港年輕人 – 李怡 Apple 2014nov26

執達吏在警方協助下昨天在旺角清場,過程並不順利。估計下一波會輪到銅鑼灣金鐘。佔中三子擬於12月5日自首,同時退出佔領行動。但學聯認為若運動未有方向就貿然自首,以此作為退場理由「講唔過去」。學聯常委張秀賢表示會與佔領者交流意見,商討運動如何繼續下去。也就是說,年輕人不認為退場就是運動結束。

而三子退出後,運動就肯定由年輕人主場。

怎麼評估後佔領時代的年輕人呢?中共在「佔領運動」後期已透過多個渠道表明,特區政府須重點做好「青年工作」。特府遵從北京指令,據報道將視青年政策為來年施政重點,會由林鄭月娥統籌,聯同各政策局商擬對策,如房屋、就業、培訓教育等方面。

前幾天,行政會議成員羅范椒芬說近來移民的人多了,不是因為怕共產黨,而是「怕了現在的年輕人」。

她這個說法儘管許多人都覺得滑稽,但大概反映了官意,中共港共害怕與雙學的年輕人面對面溝通,連他們上京都要阻攔,不是事實麼?

中共所謂做青年工作,不外兩手,一是誘之以實利,比如說要創造給青年向上流動的機會,讓他們較易置業,又或者搞點舞會、男女交誼等活動讓青年發洩精力,梁振英周六參加研討會,建議開放中環海濱的摩天輪一段時間,讓市民免費乘坐,讓青年人可以 Relax & Enjoy。掌權者以己之心度年輕人之腹,認為利益取向就能解決問題,年輕人有利益就不會抗爭了。

另一手是洗腦「教育」,比如把年輕人的抗爭歸咎於中學的通識科,先前有取消通識作為必修科之議,最近教育局就高中課程展開諮詢,

建議刪除通識科探討香港青少年參與社區事務的部份。似把學生參加社運歸咎於通識科教育

當然,當局認為更根本的是要加強「愛國主義教育」。2007年胡錦濤來香港就提出要重視對青少年進行國民教育,「使香港同胞愛國愛港的光榮傳統薪火相傳」,

接着特區政府在連年施政報告都講國民教育,又資助中小學生參加北上洗腦交流團。

而結果,卻釀出一個反國教大風暴

實利和意識形態洗腦看似是兩回事,但其實的一體兩面。因為現在講愛國,憑藉的已不是救國建國的理想,而是因愛國而獲利也。

這兩手可以解決社會問題乎?且看大陸。經濟起飛了,GDP 居世界第二位,人民生活也改善了些,而

愛國教育更強力推行了六十多年,教成怎樣的國民呢?

據報道,這一代中國人已形成一個互害生態鏈:農民用過量農藥種菜,自己不吃,賣給別人;添加激素養殖,自己不吃,賣給人;餐館用地溝油,餐館老闆員工不吃,吃自家飯;製衣業者在衣服中加了甲醛、致癌染料,自己不穿……造橋、建屋、醫療都如此,整個社會就這樣形成了互害生態鏈。

幾年前,大陸有一個電視節目,訪問六歲孩子長大想做甚麼,其中一個孩子回答:我想做貪官,可以有很多禮物。孩子說了實話,既得利益的大人就口說愛國,實際行動則把財產家屬移往外國啦。

中大畢業禮學生撐黃傘,校長沈祖堯表示尊重學生表達自由,勉勵學生重建香港未來;樹仁頒榮譽學位給包致金,他表示自己百分百支持民主,參與佔領行動的學生是社會的未來。彭定康說為香港佔領的孩子感驕傲,誣衊他們獲外國勢力支持是對他們的侮辱。其實,

中共港共以實利和愛國利去誘惑學生,也是對他們高尚情操的侮辱。

現在香港年輕人關切的問題是甚麼?有一本公教報出版、講舊日社會的《香港故事》,作者楊志強在最後一篇引述波士頓美術館一幅高更的畫作,畫題叫:「我們從哪裏來?我們是甚麼?我們往何處去?」有人說,這問句概括了所有人活在世上的一切疑惑。作者說:「香港往何處去?沒有人能回答。但,我猜,若你對前兩個問號心中有數,面對最後那個誰都不會有答案的問號時,心裏便踏實得多。」

我們從哪裏來?香港大多數居民來自中國大陸,但年輕一代的大陸聯繫已疏離了,回歸後中共對香港政治干預,大陸經濟起飛後對香港的經濟侵凌,開放自由行後,大陸人在香港造成的空間壓力和文化衝擊,民調顯示香港人對「我們是甚麼」有了與上一代完全不同的觀念。不錯,我們是香港人,「我們往何處去?」不用說就是對命運自主義無反顧的追求了。

特區政府所設想的青年工作,不僅不是青年人所想的所要的,而且是對立的觀念。只有對年輕人真正的愛港鬆綁,才能爭取到他們認同的未來。

李怡


「後佔中」青年政策倒退50年 – 吳志森 2014nov26

■ 政府對青年不滿的真正原因視而不見,以為只要讓青年發洩精力就可解決問題。資料圖片

1966年,天星小輪加價五仙,引發騷亂,造成一人死亡,近廿人受傷,千多人被捕。事隔一年,香港又發生更大規模的左派暴動,歷時近半年,規模更大,死傷被捕人數更多。六六騷亂,發自本土,六七暴動,則受大陸極左思潮影響,兩者本來不可相提並論。但近似之處,接連兩次騷亂的參加者,年輕人為數眾多。

暴動過後,殖民地政府着手推行青年政策,其中一項至今仍為人「津津樂道」的,就是舉辦露天新潮舞會,所費無幾,狂歌熱舞,結識異性,發洩精力。殖民官員以為,年輕人對社會的不滿和叛逆,隨着樂與怒身體搖擺,就可化解於無形。

經過近半世紀,久不久就有傳聞,說特區官員想參照當年新潮舞會的做法,使年輕人過剩的精力得以宣洩,令他們重回正軌,不再參加反政府的街頭運動。

都甚麼年代了?這些傳聞,只能當笑話來聽。

佔領運動至今近兩個月,政府對佔領者沒有絲毫讓步,以不聞不問的態度以拖待變。

政制問題沒有寸進,特區政府自恃勝券在握,已開始處理「後佔中」問題。

高官們的分析是:佔領運動的參與者以年輕人為主,是香港的青年政策出了問題,政務司長林鄭月娥着手籌組跨部門的青年政策委員會,涉及房屋、就業、福利、培訓教育等政策部門,重點研究如何加強工作。政府的主流意見一直認為,年輕人對政府不滿,是因為缺乏向上流動機會、工資低、買不到樓,思路與董建華梁錦松新成立的智庫相當接近。

年輕人的經濟問題是重點,然後就是教育。最近有建制人士不停批評通識過於政治化,使學生批判意識氾濫。國民教育科胎死腹中,學生對祖國的認識過於負面,要多做國情教育。公民抗命教學生不守法,要加強法律,特別是對《基本法》的教育。

推廣就業、推地建屋、加強教育,三大重點,成為「後佔中」青年政策的主軸,更會是明年一月梁振英施政報告的重中之重。

梁振英政府面對政治動盪社會不安,思維方式和處理手法,與半世紀前的殖民地總督戴麟趾何其相似。先用催淚彈警棍盾牌鎮壓,然後將年輕人的不滿,歸結為社會沒有提供他們所需。50年前,用新潮舞會讓他們發洩精力,50年後,用就業買樓向上流動這些物質手段,讓他們不再叛逆,安於現狀。

當年的新潮舞會對年輕人成效如何,不知殖民政府有沒有科學評估。但必須注意的是,讓年輕人發洩精力,不是殖民政府「後暴動」青年政策的全部。這個幾乎被土共趕出香港,失掉政權的殖民政府,了解北京無意立刻收回香港後,痛定思痛,推出一系列勞工、社福、教育和房屋政策,由戴麟趾一直延續到麥理浩,連串社會改革,特別是十年建屋計劃,成立廉政公署,把香港帶入長治久安經濟飛升的八十年代,奠定了香港國際都會的基礎和地位。

香港發生佔領運動,梁振英政府視為青年政策失效,不但失去焦點,更比殖民政府的水平、全局觀念相差何止十萬八千里。特區政府內部不會全都是無能之輩,他們也應該知道,問題的癥結,不是經濟而是政治,不在政策的修補而在制度的建立。梁振英也不是不知道問題的關鍵,而是把頭埋在沙堆,視而不見。即使運動以清場告終,但制度的矛盾,將沒完沒了。


區家麟﹕如何失去一代人 – 明報 2014nov26

有些印象,近年愈發鮮明︰網上有關中國的評論文章,like 數少,點擊率愈來愈低,維權人士的遭遇,年輕一代開始不太關心;大學課堂上,談中國採訪,相對數年前,同學們不只不感興趣,作為老師,感覺到一種對牛彈琴的冷漠;有個別同學關心祖國,算是「大中華膠」,卻於友儕中感到格格不入,知心者少;大學裏的講座,有關國家時政的,多是內地生出席,關心的本地同學比例出奇地低,發問也不積極。

種種印象,最近得到印證,不同學術機構做的民意調查都顯示,香港人,尤其是年輕一代,身分認同感愈來愈傾向以「香港人」為先,而非「中國人」為先。

為何如此?由「人心未回歸」到「人心不回歸」,大趨勢的確立,應是大政策大環境的影響。自由行內地旅客近年大增,文化差異每天體驗,老一輩香港人或能較包容明白,但對「國情」認識較淺的年輕一代,自然衝擊最大;強國崛起,以恩主姿態指點江山的氣焰,再目睹內地的龐大財富與積極進取的姿態,加深了香港人被邊緣化的危機感;面對急變的競爭環境,初出茅廬的年輕人,猶豫迷茫,自然感受更深。

掌權者連環出招 加速失去一代人

此乃大背景,掌權者要丟失一代人,還有以下方法甚奏效︰

撥龐大資源,資助學生參加祖國交流團,體驗內地互聯網的完善管理,讓每一位學生親身經歷被拒上facebook 與高登的驚愕;一過羅湖橋,就明白翻牆軟件與自由之可貴;原來,在祖國懷抱中,上網,不是理所當然的。

縱容日日夜夜重播的電視台繼續享有寶貴的大氣電波,借勢讓一台獨大、不思進取,把有心有創意的競爭者拒諸門外。香港電視啟播以來,可見年輕一代渴求「煲劇」之激情,網絡不暢廣告又多,竟然願意忍受兼毫無怨言。特區政府有識之士,最近忽然醒覺,要做「青年工作」,想多搞活動「麻醉」青年人的活力;他們忘了,電視劇正是麻醉人心的王牌,他們親手丟棄這張好牌,拒絕引入真正競爭,更把新一代推向對立面、推向充滿「負面中國新聞」的互聯網。

繼續縱容一位信譽低落,不得民心的特首,讓他不停呼籲年輕人北望神州,開闊眼界,找尋機會。對年輕一代而言,由他來「勸勉」,每講一次,就等同趕客一次,只會適得其反。無公信力的人說話,只有策反之效。

雨傘運動以來,掌權者更連環出招,加速失去一代人。

國家隨便拒絕人民回國,香港人見怪不怪,習以為常;但注銷受愛戴學生領袖的回鄉證,對年輕一代,是切身新體驗;

祖國再示範株連之法,大批黑名單裏的學生,北上買書也不准,爭取公平選舉被視作威脅國家安全。

再看看田北俊只說了句「請梁振英考慮是否辭職」,即被開除政協職位;藝人歌手們,說了些平凡不過的人話,也遭內地部門封殺,活脫脫地示範,在這國度,忠於自己的下場。

高官賢達,卻只懂埋怨通識科教得不好,無視掌權者左摑一巴掌叫你愛國,右摑一巴掌又叫你愛國的荒唐與虛偽。

網絡新一代,掌握資訊快而多;網絡文化,則人人平等,沒有權威。你以為腰纏萬貫,能鎮伏四方,這一套,失去香港一代人。


王慧麟 :發洩精力論 – am730 2014年11月26日

響北方一間大學工作嗰陣,查實全年無休。暑假期間,老師返鄉下,我等依然要北上工作。到咗近開學日子,就會全校都動起來。最令人感到一種清新嘅氣息,就係新生入學。

新生入學唔奇怪。但大學開學之前,就會有軍訓。大概十幾日左右。有時候,坐車經過,一班年輕人穿好制服鍛鍊,個個樣子都好鬼辛苦。

有老鬼話,其實依家啲部隊都知道,軍訓方面,個個都講到個訓練好辛苦云云,實際上都係走過場。因為依家幾乎全部都係一孩政策長大嘅小朋友,自小屋企萬千寵愛,有啲比較疏於強身健體,有啲就因為家長對於細路相當緊張,都怕軍訓期間,新生會出現身體不適等情況。

響呢個情況下,好多教官其實已經調整咗強度,訓練期間都盡量照顧學生,例如佢地會挑選樹蔭底下訓練,讓新生冇咁辛苦,另外又響時間上有彈性,等班新生唔會長年累月咁樣鍛鍊而唔會太過勞累。

聽完老鬼講,軍訓真係有啲似中學體育2.0版。當然,嗰邊之老鬼,又點會知香港嘅中學體育係點樣?只不過,有時走過呢班新生之隊伍,有啲戴著眼鏡,有啲神情唔係咁鍾意,冇辦法也。如果打仗靠呢班新生,真係要打贏菲律賓軍隊都冇可能。

上面如此處理青年,要佢地受軍訓究竟為乜呢?當然,有好多理由啦,例如畀新生理解軍事訓練,同當年老毛年代的全民學軍,防避美帝進攻嘅心態相似;又例如有人會認為,依家上面一孩政策,個個家長當孩子係寶,查實都係應該響入學嗰陣吃下苦,等細路有啲紀律性同服從性云云。當然,亦有講法係,青年往往係反對政府聲音之溫床,透過軍訓,等佢地之思想,導向比較正面及務實,唔好一味走向負面,同埋發洩一下多餘之精力云云。

我都好少聽到,一個政府會懼怕青年,或者有人會覺得,移民會因為青年人之問題。

香港之青年,同其他發達國家之青年 (即係所謂後物質時代) 嘅成長背景,社會形態,家庭狀況都有相似之處。

不過,香港同其他發達國家最大嘅分別,就係香江青年面對嘅,係一個不民主之政制,以及長期管治失當之社會形態,咁樣,香江青年之憤怒,有更多人係關心埋香江之政治發展。

但係,同西方國家之青年一樣,即使青年非常關心社會及政治,呢班青年之中,激進到日日上街兼長期抗爭嘅,都唔慌係主流,始終都係小部分嘅青年,大部分嘅,係,佢地係關心社會,反對不民主政制,但亦好顧及手上之學業,關心自己之將來。

所以,學生運動固然要走入群眾,但可能更要先動員自己身邊嘅同學。


王永平 :羅范與之鋒 – hkej 2014年11月26日

http://www.am730.com.hk/column-237881

羅范椒芬是前教育官員、現任行政會議成員、港區人大代表。

黃之鋒是學民思潮召集人,前年組織示威抗議成功推翻國民教育,現積極參與佔領行動。

羅范椒芬是50後,今年61歲;黃之鋒是90後,剛滿18歲。

把兩位名人拉在一起談,是因為羅范椒芬說最近移民的人多了,很多她認識的朋友移民的原因是他們怕了現時香港的年輕人不聽別人意見,擔心他們日後當權後,香港不知會變成甚麼樣子。不過她覺得問題不是在年輕人身上,而是成年人,包括父母、教師、社會人士沒有好好引導他們。

黃之鋒在 Facebook 回應,「請羅范轉告那位朋友,他可以移民到一個沒有共產黨的地方,但不能移民到一個沒有年輕人的地方」。這個回應,半日內有萬名網民 like。

佔領行動令社會嚴重分化是事實。我聽過不少埋怨學生搞搞震、累人累物的聲音。但我沒聽過有人因此移民。所以我希望羅范椒芬下次有機會澄清究竟她認識多少個朋友是因為怕了香港的年輕人而真的申請移民。我也希望她以行會成員身份要求政府做個客觀的港人移民意見調查,或以港區人大代表身份聯合其他代表進行相類調查,供中央和特區政府參考。

羅范椒芬指香港的成年人 (應該包括特首和一眾政府官員及行會成員) 沒有好好引導香港的年輕人。她用「引導」一詞正好反映問題所在。合理假設是政府很想引導年輕人思想正確,但為甚麼他們不接受,例如在人大的普選決定上?政府內的成年人是否需要逆向思維,嘗試接受年輕人的「引導」。

聽聞政府正在思考新青年政策。新政策是否包括教育成年人如何引導年輕人?或是像近年政府面對問題時,新政策只有派錢一招。


港青不是跳廣場舞的大媽 – 林夕 Apple 2014nov26

權貴大叔,你們提供絕橋,如何防範雨傘再運動,竟然靠另一種運動:讓青少年跳舞,舞吧舞吧舞吧,再把愛情進行到底,這樣就……

我幫你們意淫聯想下去吧,這樣就精盡而人忘,忘了參與社會運動了嗎?

鼓勵青少年跳舞拍拖,有沒有諮詢過村民意見、想過怪獸家長的反應?你政府帶頭鼓勵我們子女跳舞拍拖?那功課呢考試呢學鋼琴呢芭蕾舞呢朗誦呢?

港青不是大陸早午晚大跳廣場舞的大媽,亦非開個舉手大會就要打瞌睡的權貴大叔;在如此豐富的課內課外活動下,依然還有時間體能坐臥街頭,可見那批「廢青」不廢,精力比你們旺盛多了。

權貴大叔,想廢去港青武功,失去運動精力,要知彼知己才能百戰不殆。首先要承認,後生仔的事,你哋識條鐵咩,識得條鐵,又識條毛咩,毛主席萬歲就識,毛語錄卻也未必夠文青熟。

好吧,若是有心終身學習,想識青少年條毛,也不必看100毛了,省得真要找人翻譯,何況在兩種語言之間,實在不存在可供對譯的空間。

如果你們不像心虛議員,肯虛心路過佔領區,跟學生對話深談,又怕你們真帶了紅酒,打算摸着杯底談心,到時話你戇修怕你嬲。方丈們,別小器,不入虎穴焉得虎子,想知青少年為何物,不妨小家點,潛水到社交網站與討論區看看,那裏是他們精力主要集散地,很可惜,在那裏,他們越玩越嗨,越關心社會事務,取消整個通識課程,都磨不掉他們的熱情。

大家心照,你們其實只是想撈個委員會之類扮服務社會,大家都是搞搞陣,嫌這個難搞,不妨大搞打遊戲、玩手機或者自拍大賽,那是個貼近地球,又有效消耗精力的玩意,最起碼能令後生仔頸椎提早出現毛病,即使未能抹掉他們思考能力,也可以降低他們的睡眠質素,折損隨街瞓的耐力,間接縮短佔領時間。後生之事,自問也只是識條杉,我比你們這班青年工作者卻知道多一點,凡是標籤青少年,以青少年為名的活動,驚死人唔知為青年而搞的,青少年肯定不肯輕易埋身,尤其是以政府名義主辦。你們看,主打年輕人的雜誌,有幾本有青年乜乜物的?有,年青人周報、青年週報,那已經是接近四十年前的事了,你們有看過吧?


羅范大媽,移民埋便 – 陳也 apple 2014nov26

http://hk.apple.nextmedia.com/realtime/supplement/20141125/53165694

比起金鐘叫囂拆大台、解散糾察的盲動派,學生深入社區,在二十區擺下街站應戰,是聖公會大公關說的「行到最前」,跟群眾沒有路障之隔,人鏈保衛,這才是遍地開花的運動升級!

面向四方八面殺埋身的衝擊,隨時是高空擲水彈,連雨傘眼罩也阻不了的粗口辱罵。還有索性動粗,將你推翻在地!沒有雨傘廣場的光環,雙學和大專關注組那些後生仔女已走上了落區這條不歸路。

走出帳篷區迎面而來的,是樂富市民怨毒的詛咒,寶琳市民深藍的民憤,旺角住戶毒罵送上門的年輕人「爛仔」、「假如我個仔似你,我跳樓死咗好過」。

年青人語塞,在重重的關門聲中思索,難道這就是羅范說的「最近有很多朋友移民,唔係怕共產黨,係怕咗年輕人?」年輕人佔領了幾條馬路比共產黨更可怕?這要不是恭維,就是貶損了偉大到神一樣的共產黨65年政權!這點留待梁振英同志去澄清。

年輕人,吃着閉門羹,行到最前,破開民心這道路障,不屈不撓。將鐵馬搬來搬去衝向玻璃,好威嗎?年輕人把力度轉移放到民心中的鐵馬,頂住攻擊謾罵,自主打造黃金時代,而這個黃金時代不是在籠子裏的。

這樣的年輕人,比人大政協堅揪N次方。明捧實踩共產黨的羅范大媽,一語成讖,移民埋便,一驚好走。


區家麟: 移民的理由 – 2014nov26

行政會議成員、前教統局局長羅范椒芬謂,朋友間聽聞,近來移民人數增加,「不是怕共產黨,而是怕年輕人。」

既然「聽聞」也能大書一番,我又說說一位朋友的真實移民故事。他們一家四口,有穩定工作,半年前匆匆賣樓,移民加拿大,全副身家剛夠買一幢平房安頓;人生路不熟,一切重頭開始,忍受最低工資都不如的兼職時薪。

為何如此決絕?都是為了小朋友學業。在香港,頻頻撲撲,始終找不到心儀學校,再加上國民洗腦教育陰魂不散,於是把心一橫,放棄香港的優差,冒險一回,到彼邦找尋新生活。

同輩中產一族,幾十歲人,有甚麼風浪未見過,聽到的移民理由,都同孩子前途有關。近來常聽到的講法,是世道昏亂,在上位者顛倒是非,亂噏廿四,「日日睇電視,唔知點教仔」。

常聞網民批評高官,為何都把自己的子女送到外國讀書,卻不讓他們留港接受本地優質教育?筆者從不參與批評,因為,稍有遠見又能負擔又捨得子女獨自生活的家長,這是應有之義,高官也是家長,也是人。

籌備經年的中學通識科,據說已「異化」要大改;翻雲覆雨的教育改革,又留不住新一代港孩,又應該找誰問責?

今時的局面,是共業。要把責任集中在一位前局長身上,也許並不適合,不過,聽到羅范椒芬談移民的理由、由她來批評通識科,我覺得好好笑。

至於移民是怕甚麼?

我又記起一位往美國深造的內地同學的感嘆︰

「我所有到美國讀書的朋友,讀完後,沒有一個回國,一個都沒有。」

他們也許不是怕,只是人同此心,正常人,還是有基本的鑑賞能力。

至於那些移民「不是怕共產黨,而是怕年輕人」的香港人,如果真的存在,那是個人選擇,不需苛責。

但是,在香港,有為數不少的一群,不去質疑那些離港棄港又往往把「愛國」掛在口邊的人,卻去埋怨那些留港建港,努力爭取的年輕人,這叫本末倒置。


你害怕的東西 – 高慧然 apple 2014nov26

某一天開始,香港某些人、某些機構開始害怕一把雨傘,害怕到無比可笑的程度,有校長見到學生在畢業禮打傘,甚至失心瘋有不合邏輯之聯想,並暴露出缺乏通識的弱點。

某一天開始,香港某些人據說非常害怕年輕人,害怕到甚麼程度呢?害怕到不惜移民逃避年輕人。

移民到甚麼地方才能完全避開年輕人呢?移民又會不會帶上自己的年輕子女呢?一般情況下,上了年紀的人大多喜歡與年輕人交往,年輕人的活力、熱情、初生之犢不怕虎的勇毅,令前者彷彿看到數十年前的自己,感覺親切。是甚麼樣的人會害怕年輕人,認為年輕人比共產黨更可怕的?

每個人都有自己害怕的東西,我問過在加拿大認識的朋友,有人害怕黑暗,有人害怕蛇、蜘蛛、蟑螂等等,也有人畏高。沒有人說害怕強權,因為他們生活在自由國度,不太明白強權為何物。但你可以暫時不記得強權,卻絕對不會有人享受強權的。喜歡強權者,往往是強權一部分。他們與自由意志對立,故此害怕、憎厭追求自由的年輕人。

至於我,我最害怕失去我在乎的人,因為非我個人努力可以阻止,唯有享受當下,享受與自己喜歡的、在乎的人相聚的每一刻。人,若可以用自己的意志、自己的雙手決定自己的命運,你說多好!


陳文敏:國民和歷史教育 – 明報 2014nov26

近年身邊的確多了朋友考慮移民,但原因並不是羅范椒芬所說的懼怕年輕人,而是對現政府管治的不滿和對香港前景的失望。

中央將大量年輕人參與佔中行動定性為青少年工作不足,需要加強國民教育和青少年工作。當權者不去思考管治,卻將問題歸咎於通識教育並建議取締,

大家對這個荒謬的社會還可以存有甚麼幻想?

對從事教育的人而言,我們均希望培育出有獨立思考、能客觀分析和對社會有承擔的下一代。在佔中一役中,大家對同學的堅持可能有不同看法,但不能不承認一點,同學的表現、他們的思考與演辯能力,組織與應變能力均令各方讚歎,香港的教育制度能夠培養出這一批年輕人,其實是值得我們慶幸的。

我並不反對國民教育,問題是怎樣的國民教育。

國民教育須建基於對國家歷史的認識,前一陣子曾走遍大小書局,想找一本介紹中國歷史的入門書籍,但坊間的書本,不是太過專門便是文筆相當枯燥乏味,就是流於人民無產階級鬥爭論的單一分析。最後找到幾本較像樣的書籍,但都在1949年前便結束,1949年後的歷史是一片空白,偶爾一兩本關於文革的著作,但大多缺乏客觀,更諷刺的是西方反倒對近六十年的中國有大量的研究和著作。

一個國家不能嚴肅對待自己的歷史時,國民教育又從何談起?

曾看過一齣介紹美國獨立戰爭的短片,當中以四個平民作主角,一名年輕人放棄家族生意為理想參加獨立戰爭,一個來自英國的中產家庭擔心獨立後的生活比前更差,他們支持英國鎮壓這場獨立運動,其餘兩人的立場並不鮮明,有擔心家人安危,有擔心事業發展,短片展現了在那大時代中不同人的不同抉擇,亦同時展現不同的觀點與取態,短片結束時向觀眾提問,假如你生於那個年代你又會如何抉擇?這是上佳的國民教育材料,呈現客觀事實和不同論據,讓觀眾自行分析與體會,沒有「大國崛起」那種歌功頌德的宣傳,但這會是中央所想像的國民教育嗎?


蕭少滔: 滬港通改不了中國靠香港集資的格局 – 2014nov26

還是滬港通…..算是恨鐵不成鋼吧,中國要是認真想找金融改革的出路,就別再閉門造車。

一味繼續狂踩香港,吃虧的還是中國。鬍鬚曾還要替滬港通這個「扶不起的阿斗」開脫,謂「沒有盲目入市不是壞事」…不知是攞景還是贈慶噢

不過就在滬港通「出閘脫腳」之後,「中廣核」H 股在香港招股,還是賣個滿堂紅。集資額預算增加到36億美元。這是香港全年最大的一宗上市個案。而先前的中廣核美亞核電,也集資了超過30億美元、之後還要股價再漲50%。雖然先前阿里由董建華親自摻扶跑到美國去上市 (大家可以看看董事名單)[1],算是搶了香港一大塊肥肉,但基本的格局還是改不了:中國的主要股權資金融資,還是由香港和美國包辦。至於董老……還是…..非常愛國。

以下是 Dealogic 2014年11月11日刊登的「中國跨境股權融資」統計,大家可以看個清楚:

http://www.dealogic.com/media/market-insights/ecm-statshot/

中國跨境在國外(包括香港) 發行的股票,在2014年首三季度,金額接近700億美元,宗數為235宗。其中阿里巴巴單一項目集資就超過250億美元。和香港相比,亞洲其他市場都在「食塵」。

其實如果不是因為阿里巴巴的單一案例,香港在過去多年,一直都是中國吸納外國股權資金的主要平台! 即使是國際金融風暴最風高浪急的幾年,香港仍然撐起了中國的集資需要。

即使是梁粉自己搭台的「金融發展局」,也有相同的結論。大家可以看看2014年6月出版的報告[2]。

不過搞笑的是,中國的企業也非常懂得如何投靠「外國勢力」。

金融發展局的統計顯示:在港上市集資的主要是「中國企業或基地在中國的企業」,但同時,只是12%在上市時仍然以「中國企業」身份上市,反而是86% 是以「開曼群島註冊公司」的方式上市!

對於法律和稅務不太熟識的讀者可能有點奇怪,但只要明白一個很簡單的道理就夠:沒有人會做蝕本生意。不做中國的企業、反而投靠「外國勢力」來香港圈錢的,還是「整體看好」的!

反而在中國大陸,在滬港通未開通之前,股市的集資功能經已「大削」一半! 到2014按統計2014年上半年只是352億人民幣,大約57億美元。算盡全年俾一個 double, 都是114億美元。跌出全球主要排名榜[3]。中國股市的「後繼無力」早已不是新聞,因此從個角度去想想,到底滬港通的通與不通:於港何損? 真正着緊的中國,不是香港。

反觀香港市場,截至2014年10月的交易所統計,單是主板市場 IPO 的集資金額已經超過176億美元[4],還未計算最後一季的上市,例如中廣核的36億美元上市個案。由於經已超額多倍,並且有40% 由基石投資者認購,相信這個上市個案會將香港的金融市場地位再向上提升。

但這些又算不算是「惠港措施」? 還是在商言商,只是市場行為?

早前已有說明,實在香港的市場仍是國際資金主導70%以上[5]。中國企業來港上市,很簡單一個原因就是尋求「外國勢力」的金錢資助嘛,又何必老是好像仇人一般看待?

其實看看梁振英的「金融發展局」,看看顧問和成員名單:Blackrock, Citi, McKenzie, Morgan Stanley, Mapletree… 擺明是歡迎外國勢力介入香港的金融政策制訂啦! [6]

香港是不是扶不起的阿斗,數字上真的看不出來。不過孟子就有講過有這樣一個故事:【齊人有一妻一妾】….有看過個故事的,對於這種「驕其妻妾」的所謂「富貴利達」排場,真是越看越唏噓。因為阿斗和麥兜差不多,一樣傻頭傻腦自得其樂不會害人,更加不會故作精明,末了像齊人一樣,被千夫所指「你呃人」!

[1] http://www.ejinsight.com/20140616-tung-chee-hwa-to-join-alibaba-board/

[2] http://www.fsdc.org.hk/sites/default/files/IPO4-2%20%28Final%2017-6-2014%29.pdf

[3] http://pwccn.com/home/printeng/pr_020714_2.html

[4] http://www.hkex.com.hk/chi/stat/smstat/Documents/fun_type_c.pdf

[5] 網誌 2014年7月18日【為什麼中共怕佔中:金融數據的啟示】http://alexstshiu.blogspot.hk/2014/07/2014-6-15-httpwww.html

[6] http://www.fsdc.org.hk/tc/about/council_membership


林行止:安倍贏面甚大 日圓滙價插水 – hkej 2014年11月26日

一、

說日本經濟何去何從,一定會被「沉日派」(日本經濟病癌,藥石無靈)責罵,在他們的想像與言詞中,日本經濟只有「下行」一途,不會回升,「何去何從」便是廢話;不過,看完「沉日派」健者的論述(包括若干本報作者),筆者仍然認為日本有起死回生的一日,而且這一天不在「不可見的未來」,而在「可望可即的未來」。

這得從日本首相安倍晉三為挽經濟衰退狂瀾而宣布提前大選說起;對於有論者認為安倍此舉是一場政治賭博,筆者深有同感,以選舉勝負不能選前決定,結果未明、贏虧未卜,是為「賭博」;然而,筆者以為安倍賭勝的機會遠遠大於輸光離場,那肯定不是說這句話者的原意。

安倍內閣的民望持續向下,從組閣期初的二○一二年年底,日本放送協會的民調支持率百分之六十跌至本月十五日的百分之四十四,適足以顯示對「安倍經濟學」不滿的民意正在升溫;面對這種逆境,安倍卻選擇於本月二十一日宣布解散國會,定期十二月十四日進行投票。安倍作出這項決定的說詞,真的冠冕堂皇,他說「自(民)公(明)聯盟」必須獲大多數民意支持,才能落實「三矢之本」的經濟政策;而在民調中落後,「自公聯盟」應該通過選票把民調具體化。那即是說,如果選民與民調同調,他便恭敬下台;若投票結果「自公聯盟」仍是大多數黨,他便會把「第三支箭」—改革金融結構貫徹。他深信一旦獲國民授權,在他的領導下,日本經濟便能創新天。筆者的看法則是,如果安倍連任,沽日圓購日股的投資大方向不變。

本報網站作者假才子,二十四日在免費報章 am730 發表《在野黨混亂有利安倍》的特稿,顧題思義,作者是從在野黨各有議題、群龍無首以至互相攻訐,推斷安倍即使民望趨下游亦能取勝。此非泛泛之論而有具體內涵,非熟悉日本政情者無法命筆,確是佳構。不過,筆者從日本國會實際情況看,亦見安倍勝算較高。一共有四百八十席的國會(下議院)被解散前,「自公聯盟」合共佔三百二十五席(自民黨二百九十四席,公明黨三十一席),即執政聯盟的席位比半數多達八十五席;在這種情形下,即使自民黨在十二月選舉中失五十席,仍能與公明黨組成穩穩控制國會的聯合政府。

除了「數字遊戲」,筆者認為當前日本的政治氛圍對「自公聯盟」絕非不利。首先是,在宣布提前選舉同日公布的競選政綱,包括新政府將削減日常食用品的稅率(及其他與民生有關的稅務寬減措施),有利爭取低下階層的選票;其次是,十一月十日安倍「終於」與中國(也許是亞洲)新強人習近平主席握手,以習大大拉長黑面,這次簡短之會不能說中日領袖「相見歡」,但自從去年十二月安倍參拜靖國神社觸怒北京因而被北京公開宣布他是不受中國歡迎的人物,至今未足一年,安倍便以貴賓身份抵達北京,「習安會」打破此一「詛咒」,會談(?)的氣氛如何以至有否成果,在日本人心中已不重要,這從日本輿情有安倍外交政策頗為成功的共識可見。過去數月,安倍對北京真是低聲下氣,求見習主席之意拳拳,路人皆見,所以如此,皆因配合美國「無暇東顧」的外交政策;事實擺明,美國為「中東北非」(MENA)局勢所困(昨天無力解困的國防部長「被辭職」,可知問題之嚴重),不希望與其有國防協約的日本和中國「擦槍走火」,而雙方對話是避免突生意外的不二途徑。安倍終於和習主席碰頭握手如儀了,這雖不意味中、日及中、美外交關係步上坦途,但中、日之間會商解決雙方關注的問題,大於兵戎相見分勝負,這種情況,正是國防經費捉襟見肘的美國目前最樂見的發展。當然,筆者不排除安倍真的希望和中國「重修舊好」,因為中國內銷市場龐大和對外購買力世界最 強,均為頹疲已久的日本經濟所急需。

二、

如果十二月中旬「自公聯盟」勝出,安倍晉三連任(從二○一二至二○一八年〔不計○六年至○七年的一整年〕),他便成為日本現代史上任期第二長的首相(最長的是在位八年的佐藤榮作〔一 九六四—一九七二年〕),假如期間「安倍經濟學」收到預期效果,日本經濟脫離懸崖,則二○一八年自民黨再度勝出的可能性甚高。

為了取悅選民,安倍晉三聽從諾獎得主、時評家克魯明(P.Krugman)的力勸(十一月六日彭博新聞:《克魯明說服安倍延後加銷售稅》,時克魯明在日本參加學術會議),把原定明年十月的加稅(百分之八加至百分之十)順延至二○一七年四月;日本財赤比天高,本擬加銷售稅增加稅入以稍紓財赤,如今「此計不行」,財赤的削減無期,不但如此,安倍去周還向國人「承諾」至二○二○年,政府便能制訂平衡預算。安倍並非口出狂言,而是他對「安倍經濟學」的「第三支箭」有無比信心。

日本經濟「命懸一線」,反映在「國民毛產值與負債比率」(debt-to-GDPratio)高達百分之二百五十(負債總額約為GDP二倍半)以上,如果利率為二厘,債券孳息便佔常年稅入百分之八十,即派息後政府無錢運作!

這種情況令政府不得不想盡辦法壓低利率,在試過諸種正道和旁門方法而無法收效之後,安倍終於定出一項革命性的策略,那便是「第三支箭」通過央行吸納國庫券 (JGB),這即是說,財政部過去多年(以及今後)發行的債券,過往主要由企業和儲蓄率冠全球的個人認購,在通縮的年頭,債券持有人的進賬雖然似有若無,但購買力總算未被通脹這頭怪獸蠶食,因此債權人和債務人相安無事、和平共處;可是,安倍上台後為使經濟脫離退縮的宿命,定下通脹百分之二的目標,惟當局如何理順兩者的關係,大費躊躇。提高利率(孳息),政府吃不消;原地踏步,持有者會因不吃眼前虧(利息低於通脹率等於負收入)而拋售。

有異於世上大多數人, 日本人有為國家好而不惜啞忍吃虧(必須全民人人平等同受此苦)的「天性」,那是何以過去十多二十年,面對幾乎零實質收入的債券而持債者無怨尤的底因;但購買力受侵蝕,威脅日人的退休養老,便是另一回事……。十月底,央行以五對四票通過「雙化寬鬆」的額度由每年五十萬億(日圓.下同)提升至八十萬億(見十二日本欄),此變動十九日經央行「政策委員會」(Policy Board)以十八對一票確認,這可視為較早前公布日本已進行衰退的消息,令貨幣政策決策者只好同意採取極端手段。無論如何,「雙化寬鬆」的目的,在讓央行有財力吸納市上即個人法人(包括政府退休基金的機構投資者)的國庫券,以其可動用的資金大增,意味財政部發行多少債券央行便悉數購入,那明顯是把債務貨 幣化(debt monetization)的手法,但本報網站昨天上午十時許貼出央行委員「擔心擴QE被視為財赤融資」的消息,真是有點不知所謂,因為央行這樣做正正是「財赤融資」(印鈔買債)!

大量印鈔應付赤字(債務),是治標之策,其立竿見影效應是日圓大貶值。日本經濟體積雖早落於新興大國中國之後,但仍是貿易大國,其貨幣大貶值,影響十分深廣;拉近一點看,這對人民幣滙價以至「滬港通」都有不良影響。

這方面的問題,昨 [ ] 天說之。


食屎啦你 – 香港網絡大典

http://evchk.wikia.com/wiki/%E9%A3%9F%E5%B1%8E%E5%95%A6%E4%BD%A0

「食屎啦你」一詞出自1988年的港產片《旺角卡門》,張學友飾演的「烏蠅」與萬梓良飾演的Tony於竹館開片一幕,烏蠅食住Tony,並對Tony說出「着西裝打呔,攞大哥電話有咩用呀?吓!跟啲咁嘅大佬,吔屎丫你!」此句經典對白。

張學友80年代的髮式及古惑仔造型,以及其神態,經歷二十年歲月洗禮仍為人津津樂道,相信今時今日無一MK仔能及。他更以此角色摘下1989年香港電影金像獎的最佳男配角獎。

.END

Leave a comment

Filed under Electronics DIY Project

Maker Shed 3D Printer newsletter 2014nov

Maker Shed 3D Printer newsletter 2014nov

http://newsletter.makezine.com/t/ViewEmail/r/15E1B3CB8941FC882540EF23F30FEDED/71A4CD3C08B0750244D0DD5392A9C75A

.END

Leave a comment

Filed under Electronics DIY Project

Arduino Due delivery record

arduino_due_2015nov2501

arduino_due_delivery_2014nov2601

Arduino Due delivery record

.END

Leave a comment

Filed under Electronics DIY Project

80%的中国富豪送子女出国留学 – 胡润研究院

china_overseas_student_2014nov2601

80%富豪子女留学 大多读商科设计也受宠 – 2014-11-25 新京报 陈璐

http://www.bjnews.com.cn/graphic/2014/11/25/343235.html

胡润研究院的最新调查显示,几乎80%的中国富豪送子女出国留学。让孩子接受国际教育,也是富豪们想要移民的三大原因之一。因此,和其他国家的富二代相比,中国富豪的孩子,最有国际范儿。

子女留学七年,正常支出不到两百万,对亿万富豪来说,这样的数额微不足道。但因为中国留学生队伍庞大,总的支出,对目的地国家来说,真是不小的财富。对于普通国人来说,想要和土豪二代做朋友、甚至做对手,难度恐怕也加大了。


香港圣诞打折季来 内地客逼爆口岸过关花两个小时 – 南方都市报 2014-11-25

南都讯 记者康殷

香港各大名店及百货公司,本月中开始疯狂大减价吸客,刚过去的周末更吸引大批内地客跨境扫货,人潮逼爆罗湖及福田口岸,有内地客过关赴港花逾两小时。福田口岸22日全天出入境旅客数量再创新高,达21.47万人次。

内地客预算花费数万

据了解,本月初内地的香港购物优惠情报网,早已广传香港各大百货公司的减价及圣诞促销信息,不少内地客已蠢蠢欲动,静候时机赴港血拼。大批内地客趁过去的周六、日跨境扫货,人潮拥堵在罗湖及福田口岸。前日早上10时许,数千内地旅客逼爆深圳罗湖口岸,更一度需要实施人流管制疏导人潮,不少内地客怨声载道。

深圳居民王小姐用了两小时才完成过关手续,过关虽苦,但她血拼热情丝毫未减,“本来想到海港城及铜锣湾崇光,但过关花了好多时间,今天应该不够时间逛,下礼拜会再来,顺道欣赏圣诞灯饰。”

香港铜锣湾的崇光百货周年庆本月中开锣,每日早上9时已有近百人排队。

福田口岸人流破纪录

皇岗出入境边防检查站表示,22日该口岸全天出入境旅客数量再创新高,达21.47万人次。这已是11月以来,福田口岸连续第四个周六刷新出入境流量纪录,也是年内第八次创下新高,标志着该口岸周六客流高峰模式的定型,更预示着12月圣诞、元旦旅游购物旺季期出入境客流高峰到来。

据了解,临近岁末,香港各大商场均大力推行折扣优惠促销,吸引了大量内地居民,特别是在高铁沿线内地客,利用便捷的交通和周末时间前往香港观光购物。同时,近两周来天清气爽、温度适宜,令不少香港居民选择到内地进行短途度假休闲。

11月22日,从当天早上8时开始,福田口岸便迎来了出入境旅客双向高峰,并持续了3个多小时。下午4时左右,入境方向再度呈现持续的旅客高峰,直至晚上10时30分香港落马洲支线口岸关闭为止,客流高峰一直未见消减,最终助推了福田口岸出入境旅客流量再创新纪录。

.END

Leave a comment

Filed under Electronics DIY Project

Arduino IDE 1.5.8 installed and tested OK

arduino158_2014nov2501

Arduino IDE 1.5.8 installed and tested OK

.END

Leave a comment

Filed under Electronics DIY Project

Ardunio Due Bootloader Explained – Arduino

Ardunio Due Bootloader Explained – Arduino 

http://playground.arduino.cc/Bootloader/DueBootloaderExplained

The official webpage goes through how one should program their Arduino Due using the Arduino software.

http://arduino.cc/en/Main/ArduinoBoardDue

For those who are going to develop a project without Arduino but with basic g++, one must understand how to program his chip. Apparently, the Due – SAM3X – has a booting process somewhat different from the AVR, and it is not quite the same as firing up the “avrdude” and be done with it. Ardunio has designed the board such that flashing firmware is easier than what the stock SAM3X has offered, here explains the booting process and the tricks that Arduiro implemented.

SAM3X Flashing Explained

The SAM3X comes with a built-in bootloader, called SAM-BA. Standalone SAM-BA tools could be downloaded from the Atmel website. SAM-BA is permanently burned in the chip ROM straight out of factory, and is not using up any of the flash space. This is very different from AVR that AVR doesn’t come with any built-in bootloader.

In addition to SAM-BA, SAM3X could be booted in the middle of the flash, instead of the very beginning of the flash like they normally do. One could code their own userspace bootloader in the 0-256KB, and the real application in the 256KB-512KB.

So in short, there is three boot start points – SAM-BA, Flash 0 and Flash 1, this can be controlled by tweaking the GPNVM bits in EEFC0.

In Arduino, as well as most of the scenarios, the code is flashed with SAM-BA tools. Flash 0/1 userspace bootloader is not used in Arduino.

SAM3X will boot to SAM-BA when:

A) the GPNVM bits have been modified (set to 0) to instruct SAM3X to boot to SAM-BA. It can be done in userspace code.

B) Erasing the chip (Erase button) which will also clear/zeroing the GPNVM bits and leads to the SAM-BA again.

In SAM-BA, firmware could be flashed over the native USB port, which will be put in CDC mode, or through the first UART channel. SAM-BA will wait indefinitely without timeout. In other words, once the GPNVM bit is cleared for SAM-BA booting, it will always be there waiting for flashing, even after power cycling.

Of course, the flash content and the GPNVM bits could be flashed over the JTAG, which will not be discussed here.

Arduino Tweaks

Two things have been done by Ardunio such that users need not to press the ERASE button everytime.

ATMEGA16U2 assistant

The ATMEGA16U2 chip, acting as a USB bridge to expose the UART as USB replacing the FTDI chip, actually does more than that.

If the host is connected to the programming port at baud rate 1200, the ATMEGA16U2 will assert the Erase pin and Reset pin of the SAM3X. Forcing it to the SAM-BA bootloader mode.

At any other baudrate, it will reset the SAM3X. This is done to simulate the behavior of the AVR-based Arduino – connect and reset.

The code, firmware of the ATMEGA16U2, currently lives in ide-1.5.x branch of /hardware/arduino/sam/firmwares/atmega16u2/arduino-usbserial/Arduino-usbserial.c.

On chip 1200 detection

When Arduino uploads the sketch, it will actually wire up some additional C-code. One in particular, is that it configs the native USB port as CDC for serial communication. That specific code has a similar detection of ATMEGA16U2 in place.

When the port is opened with baud rate 1200, it will set the GPNVM bits apporiately for booting to SAM-BA, and reset itself.

The corresponding code lives in ide-1.5.x branch in /hardware/arduino/sam/cores/arduino/USB/CDC.cpp.

After erase.

Everything after erase is just SAM-BA logics, user could connect to the SAM-BA through the SAM3X native USB, which is put into CDC mode by now. Or to the UART, through the Programming port which is also CDC but exposed by ATMEGA16U2.

Conclusion

If someone is going write C from scratch, it’s unlikely that the On-chip CDC 1200 hack would be taken care, hence opening 1200 baud rate on the native port won’t work. One could refer to Arduino’s implementation for keeping the same behavior if wished.

If the native USB port is put into other uses other than CDC, this obviously won’t work. It is a USB 2.0 High Speed 480Mbps port, someone would possibly have made a better use of it other than CDC.

The ATMEGA16U2 would always work. Anyone unhappy of the 1200 tricks of course could modify the firmware themselves, flash it over the ICSP header with AVRISP technique.

For opening the port in 1200, one could use Putty (an open source software commonly used for SSH in Windows) to connect to the corresponding COM port. If this is done over the native USB port, after closing the connection, the port will disappear shortly afterwards, and a new COM port with another identifier will come up, which is the SAM-BA native USB CDC.

.END

Leave a comment

Filed under Electronics DIY Project

FongDuino01 libraries list

fongduino_libraries_2014nov2501

FongDuino01 libraries list

.END

Leave a comment

Filed under Electronics DIY Project

Yellow Dragon Cave – Monk Huikai

yellow_dragon_cave_2014nov2501

How to Visit Yellow Dragon Cave in Hangzhou – China Travel Blogs – Tour-Beijing.com

http://www.tour-beijing.com/blog/zhejiang-travel/hangzhou-travel/how-to-visit-yellow-dragon-cave-in-hangzhou/

Are you going to visit Yellow Dragon Cave during your Hangzhou trip? There are two famous attractions in China in the same name of “Yellow Dragon Cave”. One is in Hangzhou, Zhejiang Province; the other in Zhangjiajie, Hunan Province. The Yellow Dragon Cave in Zhangjiajie is a cave as its name suggests, a karst cave with 2 underground rivers and hundreds of thousands of stalagmites, columns and stalactites while the so called “Yellow Dragon Cave” in Hanghzou is now actually a typical Chinese traditional garden at the foot of Xixia Range of the Northern Hill in Hangzhou.

Historically the Yellow Dragon Cave in Hangzhou used to be a buddhist temple during the Song, Yuan, Ming and Qing Dynasties.

In 1922, the Yellow Dragon Cave turned into a taoist temple.

After 1949, the Yellow Dragon Cave was taken over by Hangzhou Municipal Bureau of Landscape and Cultural Relics. Trees were planted, bridges and pavilions repaired, made into an important attraction of the Northern Hill in Hangzhou.

The name of Yellow Dragon Cave comes from the legend that one day Monk Huikai in Southern Song Dynasty suddenly heard a loud thunder with the coming of a Yellow Dragon who brought ceaseless water gushing from its month, hence the name of “Yellow Dragon Cave”.

Now Yellow Dragon Cave in Hangzhou has less religious atmosphere. It has become a unique Chinese garden as well as a theme park or garden focused on “Good Luck”, a folk and custom of Chinese traditional culture.

So whether you are going to visit Yellow Dragon Cave during your Hangzhou tour largely depends on your person taste. Though it is not a must see sight in Hangzhou, if you are interestd in Chinese gardening or local folk and custom, it is advisable for you to visit this special atrraction in Hangzhou.

Entrance fee: RMB15, thee are several public buses running to the Yellow Dragon Cave in Hangzhou such as Y3, Y4 Y5, No.16, 21, 23, 28, K101, K599. Or you walk from Yuefei Temple up to Xixian range, then walk down to Yellow Dragon Cave, which takes about 1 hour.

Add: Shuguang Road in Hangzhou, Zhejiang Province, China

Admission fee: RMB 15

Opening hours: 8:00 am – 6:00 pm


Yellow Dragon Cave – China Travel Tour Guide > Attractions

http://www.china-travel-tour-guide.com/attractions/yellow-dragon-cave.shtml

The Yellow Dragon Cave situated on the rear hill of Xixialing (Rosy Clouds Hill) in West Lake tourist zone in Hangzhou City. Although called “cave”, it is actually a yard. It is a well-known place of interest in Hangzhou City.

The gate of the Yellow Dragon Cave is very simple, on which inscribed with an antithetical couple.

The scenes in the yard are half-artificial and half natural. The main scenic spot in the yard are Pavilion of Fragrant Snow, Pavilion of Standing Crane, and a dragonhead molded on a cliff.

The dragon’s head is the hero of the yard. Spring water comes out of the dragonhead and flows into the pond below.

Beside the pond stands a stone, on which inscribed with eight Chinese characters meaning, “If there is dragon in the pond, it will be charming. So, the depth of the pond is unimportant”.

The Bamboo Garden, which is opposite the Vermilion Corridor, is unique in the Yellow Dragon Cave. In the garden grows a great variety of bamboo, such as 33-meters high mao bamboo, several-inch-high white bamboo, purple bamboo, green bamboo with golden dots, square bamboo and so on.

While seeing so many kinds of bamboo, you will gasp in admiration for the superlative craftsmanship of the nature.

The Yellow Dragon Cave is simple but elegant yard. It lays out as an antique park by the Hangzhou local government. There are teahouse, wine shop, theater, Terrace of Praying for Rain, and other ancient entertainment.

After visiting the yard, you can also taste the local flavors, such as Tianhua Steamed Stuffed Dumplings, Ten-Flavor Dumpling Soup, Steam Cake, and so on. People said that these flavors were very popular in Song Dynasty (960 ~ 1279A.D.).

You can also listen to the ancient Chinese music in the pavilion. This antique yard can make your travel more interesting.

History

The Yellow Dragon Cave relates with two legendary figures in history. One is Lord Huangshi in Qin Dynasty (248 ~ 207B.C.). The old man saw Zhang Liang coming up and deliberately kick off his shoes and asked Zhang Liang to wear for him. The Cave of Immortal Huang in the yard was specially built for people to commemorate him.

Another figure is the Founder of the Yellow Dragon Cave. According to the legend, the founder was monk Huikai who left Jiangxi Province and came to Xixiashan to expound the Buddhism. Huikai founded the yard so that the devotees to Buddha could come here to listen to him to expound the scriptures of Buddhism.


Yellow Dragon Cave-The entrance of Yellow Dragon Cave – travelking.com

http://www.travelking.com.tw/eng/tourguide/hangzhou/yellow-dragon-cave.html

Yellow Dragon Cave is located at the northern foot of Qixia Ridge in beautiful Zhejiang. The formation of this natural spectacle has a legend that a monk from Yellow Dragon Hill in Jiangxi Province in the Southern Song Dynasty came to the site and decided to build a temple.

One day, a yellow dragon suddenly appeared and hit the ground; then, the place miraculously turned out to be what we see today. In the surrounding of various kinds of bamboo, Yellow Dragon Cave seems to be dressed in Green. And there is also a spring issuing from the mouth of the yellow dragon, the cracked rock.

Beside the spring, the famous quotation was engraved on the rock,

“Regardless of the depth, Divine is the dragon pool.”

In the neighborhood, there are also two lovely pavilions, Fragrant Snow and Crane’s Stopover.

The scenery as a whole becomes one of the Ten Scenes of The West Lake,

Yellow Dragon Cave Dressed in Green.

At times, tourists will have the chance to enjoy the beautiful Chinese music conducted by the orchestra in ancient costumes with the Chinese musical instruments and indulge in the delightful China travel.

For the convenience of your Hangzhou travel in China, below is a selection of nearby hotels. For more sightseeing attractions in Hangzhou, please visit our Hangzhou Tourism website for a map to guide your China tour and to find your ideal China hotel.

.END

Leave a comment

Filed under Electronics DIY Project

Free Memory checking notes

Binary sketch size: 30,260 bytes (of a 258,048 byte maximum) = = 30K of 256K byte flash

At FongTest01::Test01( ) = = 1.5K bytes of 8K SRAM

INIT_GLOBAL_VAR_ISR_SERIAL_PORTS_FONG_SERIAL_POINTER() [0 bytes]
Free Memory = 7374 bytes.

ATTACH_LOCAL_ISR() // Attach local ISR [156 bytes]
Free Memory = 7218 bytes.

CREATE_FONG_SERIAL_OBJECT(Test0, DebugPrint1) [78 bytes]
Free Memory = 7144 bytes.

FongTest01::FongTest01(…)
{

initAll(testNum, debugNum);

Serial.print(“Free Memory = “);
Serial.print(freeMemory());
Serial.println(” bytes.”); [1566 bytes]

test(testNum, debugNum); [5 bytes]
}

Free Memory = 5578 bytes.

else if (selectChar == ‘f’)
{
Serial.print(“Free Memory = “);
Serial.print(freeMemory());
Serial.println(” bytes.”);
selectChar = resetSelectChar();
}

Test01 Menu >>>

f = Free memory. >>> [5 bytes]
m = Menu. >>>
h = Help. >>>
x = Exit. >>>
Main Test Selection (m = print menu, x = exit.) = ? >>>

Free Memory = 5561 bytes.


// *** fongmain2014nov25hkt1156.ino ****
// ********************************************************************
// FongMain01r tlfong01.com 2014nov
// ********************************************************************
#include “Arduino.h”
#include “HardwareSerial.h”
#include “SoftwareSerial.h”
#include <avr/io.h>
#include <avr/interrupt.h>
#include <avr/pgmspace.h>
// #include <PinChangeInt.h>
#include <FongSetup01.h>
#include <FongGlobalIsr01.h>
#include <FongLocalIsr01.h>
#include <FongGlobalVar01.h>
#include <FongInt01.h>
#include <FongSerial01.h>
#include <FongDebug01.h>
#include <FongBuzzer01.h>
#include <FongDigitalIo01.h>
#include <FongDigitalControl01.h>
#include <FongAnalogIo01.h>
#include <FongText01.h>
#include <FongBlueTooth01.h>
#include <FongBtm01.h>
#include <FongPicoNet01.h>
#include <FongTest01.h>
#include <MemoryFree01.h>

INIT_GLOBAL_VAR_ISR_SERIAL_PORTS_FONG_SERIAL_POINTER() // 7218 bytes

void setup()
{
ATTACH_LOCAL_ISR() // Attach local ISR // 7218 bytes
Serial.begin(9600);
}

void loop()
{
CREATE_FONG_SERIAL_OBJECT(Test0, DebugPrint1)
FongTest01 ftest1(&fgisr1, &fserial1, Test0, DebugPrint0); // Select test
// FongTest01 ftest1(&fgisr1, &fserial1, TestBlueTooth, DebugPrint0); // BlueTooth
// FongTest01 ftest1(&fgisr1, &fserial1, TestBtm, DebugPrint0); // Btm (BlueTooth Module)
// FongTest01 ftest1(&fgisr1, &fserial1, TestPicoNet, DebugPrint0); // PicoNet

Serial.print(“Free Memory = “);
Serial.print(freeMemory());
Serial.println(” bytes.”);
while (true) {}; // 7374 bytes
}

// *** End ***

END

Leave a comment

Filed under Electronics DIY Project