一、螢幕校色後測試

應該用幾千塊買台硬體校色器的,不過沒$$只好請辨色力比較好的朋友幫我透過Windows7控制台內建校色和Calibrize軟體作視覺校色。

辨色力線上測驗(簡單版)

辨色力線上測驗(進階版)

二、色盲分類

紅色盲(protanopia)[ˌprəutəˈnəupɪə]
綠色盲(deuteranopia)[ˌdjutərəˈnəupɪə]
藍色盲(tritanopia)[ˌtraɪtəˈnəupɪə]

紅色弱(protanomaly)
綠色弱(deuteranomaly)
藍色弱(tritanomaly)

語源

古希臘語第一、第二、第三
protos (πρῶτος)
deuteros (δεύτερος)
tritos (τρίτος)
轉為英文前綴語
prot(o)-
deuter(o)-
trito(o)-

-opia
古希臘語 ōps (ὤψ) 指眼睛,-ōpia (ωπία) 指眼睛相關的疾病或特殊狀況
光的三原色分別為紅、綠、藍

anomalous
異常的、不合規則的
(aberrant、deviant、heteroclite、preternatural)

三、機制

人類視網膜透過「感光受器細胞」(photoreceptor cells)將光波轉換成生物訊號:感光受器細胞中的感光蛋白(photoreceptor protein)在接收到光之後,會改變該細胞的膜電位(membrane potential)。

人類視網膜主要有兩種感光受器細胞:錐狀細胞(cone cells)和桿狀細胞(rod cells)。錐狀細胞感光度較桿狀細胞低,但有較好的細節和動態變化感知能力。1 對此處討論較重要的是,不同的錐狀細胞對不同波長的不同色光有感光度的差別,因此錐狀細胞是人類可以擁有區辨顏色能力的重要受器細胞。

不同細胞之所以會對不同的色光有不同的敏感度,主要是因為它們各自含有不同的色素(pigment),專業一點的說法是「感光分子」(photosensitive molecule)。2 而不同的感光分子是由不同的視蛋白質(opsins, a kind of G-protein-coupled receptors)3、發色化合物(chromophore)、視黃醛(retinene)等組成。

例如,人眼中錐狀細胞主要區分為三種,各自擁有不同的感光分子「視紫藍質」(iodopsins)erythrolabe、chlorolabe和cyanolabe。而這三種感光分子,又具有不同的主要「視蛋白」photopsin I、II、III。

錐狀細胞 iodopsins opsins peak wavelength 異常(色弱)
L-ong erythrolabe photopsin I 564 nm (紅) protanomaly
M-edium chlorolabe photopsin II 534 nm (綠) deuteranomaly
S-hort cyanolabe photopsin III 420 nm (藍) tritanomaly

由於內含的主要視蛋白的不同,三種錐狀細胞對不同波長的光有不同的敏感度:L-Cone對紅光(長波長可見光)很敏感,M-Cone對綠光(中長波長可見光)很敏感,S-Cone對藍光(短波長可見光)較敏感。(下圖的敏感度已標準化為最大值=100)

有這些瞭解,就可以大概知道人類「看到」顏色的原理:每個特定波長的光進到視網膜,就會得到三種細胞各自的反應大小,由此大腦可以綜合起來解讀出一個對顏色的認知。而如果有不同波長的光同時(極小的時間差)進來,大腦也很神奇的地能計算出其疊加起來的顏色。4

舉例來說,有一道波長約580nm的純黃光射入眼睛,L-Cone反應最大,M-Cone會有一些反應,S-Cone則幾乎沒有反應,這三個反應大小的訊號結合起來送到大腦就判讀為我們看到「黃色」。然而,如果這時候有一道700nm的純紅光和510nm的純綠光,以以特定的強度同時入眼睛,同時激發細胞訊息,傳到大腦後大腦會產生對580nm的純黃光激發的訊息相同的判斷。物理上來說兩個獨立的電磁波是不會混合成一個的,那麼有趣的問題是,「純黃光」和「純紅光+純綠光」在從眼睛到大腦的哪個階段開始是一樣的反應?究竟是從錐細胞的接收光線做出的生化反應就已經一致,還是大腦快速地計算出兩種生化反應都應該判讀為黃色,又或者相同的反應是出現在從錐細胞傳遞到大腦的過程中?

「錐細胞和桿細胞接收到刺激以後,把這些刺激轉成訊號交給水平細胞和兩極細胞接手,奇蹟就在這裡發生了,訊號在這裡被重新排列組合......(就像我們用 RGB 色碼一樣,FF0000 紅色加上 00FF00 綠色則變成了 FFFF00 黃色)」5

附帶一提,一般人一顆眼睛中有600萬到700萬個錐狀細胞,主要分布在視網膜黃斑部(macula)上一個稱為「中央小凹」(fovea centralis)的位置。絕大多數錐狀細胞集中在一個直徑約0.3mm大小,沒有桿狀細胞分布的區域。而藍錐狀細胞(S-Cones)相對於紅錐狀細胞(L-Cones)和綠錐狀細胞(M-Cones)要少,也較隨意分布。同樣有正常視覺的不同個人,紅錐狀細胞和綠錐狀細胞的比例也不盡相同。6

之所以會有色弱或色盲,就是因為前述人體的辨色過程中出了一些狀況。一般認為是因為特定的錐狀細胞敏感度較低,也就是在同樣的光線刺激下,辨色力異常者的特定錐狀細胞反應較低(例如綠色弱者的M-Cones較不敏感),造成他的大腦運作無法區辨顏色。反過來說,如果一般人和辨色力異常者在知覺上要看到相同的黃色(假設是紅+綠的情況),紅色弱者需要更多紅光,綠色弱者需要更多綠光。 7

要檢測自己的辨色能力,可以透過一些色彩比較測驗,例如:Farnsworth-Munsell 100 Hue Color Vision Test。我檢測出來是中度的綠色弱 Q口Q

要提醒的是,如果要用電腦作這些測驗,螢幕一定要先經過校色,不然實際上顯示出來的根本就不是程式設定的顏色。即使是用實體的顏色積木作排列,環境光源也會有所影響。

最後再附一張強者我女友的超高分圖(左邊那個圓也太正了吧 O_Q):


  1. 因為椎狀細胞和桿狀細胞神經傳導路徑不同:http://i.imgur.com/kWfehES.png Christine Lea, Pauline Lowrie, Siobhan McGuigan (2001) Biology for AQA Specification B. Heinemann. 

  2. 感光分子是由蛋白質部分「opsins」和無蛋白質部分「chromophore retinal」所構成。「視紫藍質」(iodopsins)是一種感光分子(photosensitive molecule),主要分布在錐狀細胞中。 http://en.wikipedia.org/wiki/Rhodopsin 柱狀細胞中的感光分子則主要為「視紫紅質」(rhodopsin),和「視紫藍質」是類似化合物(analogue)。「視紫紅質」的視蛋白主要吸收綠藍光,因此呈紫紅色。 http://en.wikipedia.org/wiki/Photopsin 

  3. Opsins are a group of light-sensitive 35–55 kDa membrane-bound "G protein-coupled receptors"(G蛋白偶聯受體) of the "retinylidene protein family" found in "photoreceptor cells" of the retina. http://en.wikipedia.org/wiki/Opsin 基於分子演化分析(molecular phylogenetic analyses)和功能分類(functional classifications),opsins可以區分為以下七類:1. the vertebrate visual (transducin-coupled) and non-visual opsin subfamily 2. the encephalopsin/tmt-opsin subfamily 3. the Gq-coupled opsin/melanopsin subfamily 4. the Go-coupled opsin subfamily 5. the neuropsin subfamily 6. the peropsin subfamily7. the retinal photoisomerase subfamily. http://genomebiology.com/2005/6/3/213  

  4. Timothy H. Goldsmith:「我先前的學生巴特勒(Byron K. Butler)與我決定利用配色技術,來探討這四種錐細胞對視覺的作用。想知道什麼是配色,就先來看看我們自己的色覺。黃光可以同時刺激人類的兩種長波長錐細胞。我們也可以將紅光與綠光以不同比率加以混合,使其對這兩種錐細胞造成的興奮程度與黃光所造成的一模一樣,如此一來,人類受測者就無法分辨出是純黃光還是紅綠的混合光。換言之,兩種物理特性不同的光可以得到相同的顏色;這提醒我們:色覺是腦子的產物,而腦子之所以能夠分辨光譜波段中的不同顏色,則是因為比較了這兩種長波長錐細胞的輸出結果。」(翻譯:黃榮棋於《科學人》2006年8月號)http://rdd.me/holpkxwq 

  5. Taco Chen,〈低解析度的人類視網膜?〉 

  6. Roorda A., Williams D.R. (1999). "The arrangement of the three cone classes in the living human eye". Nature 397 (6719): 520–522. doi:10.1038/17383. PMID 10028967. 分布圖 http://en.wikipedia.org/wiki/File:Human_photoreceptor_distribution.svg 

  7. http://en.wikipedia.org/wiki/Color_blindness#Anomalous_trichromacy 

一、用PHP定時執行特定任務

1. Windows排程執行BAT檔

參考資料:在WINDOWS中設置計畫任務執行PHP文件的方法

寫一個.bat檔案
D:\php\php.exe -q D:\website\test.php
建立WINDOWS排程工作:
(WIN7)開始→控制台→系統管理工具→排程工作
瀏覽文件夾選擇上面的bat文件
設置時間和密碼(登錄WINDOWS的)
保存即可。

2. Linux crontab排程執行(手邊無LINUX系統跳過)

3. PHP檔

參考資料:PHP定時執行計畫任務的多種方法小結

因為PHP是設計為伺服端工作,定時任務要解決三個問題:
(1)PHP腳本執行時間預設最長限制30mins,解決辦法:set_time_limit();或者修改PHP.ini 設置max_execution_time時間(不推薦)
(2) 如果客戶端瀏覽器關閉,程序可能就被迫終止,解決辦法:ignore_user_abort即使關閉頁面依然繼續執行
(3) 如果程序一直執行很有可能會消耗大量的資源,解決辦法使用sleep使用程序休眠一會,然後再執行

範例如下

<?php 
ignore_user_abort();//關掉瀏覽器,PHP腳本也可以繼續執行. 
set_time_limit(3000);// 通過set_time_limit(0)可以讓程序無限制的執行下去 
$interval=5;// 每隔5s運行 

//方法1--死循環 
do{ 
echo '測試'.time().'<br/>'; 
sleep($interval);// 等待5s 
}while(true); 

//方法2---sleep 定時執行 
require_once './curlClass.php';//引入文件 

$curl = new httpCurl();//實例化 
$stime = $curl->getmicrotime(); 
for($i=0;$i<=10;$i++){ 

echo '測試'.time().'<br/>'; 
sleep($interval);// 等待5s 

} 
ob_flush(); 
flush(); 
$etime = $curl->getmicrotime(); 
echo '<hr>'; 
echo round(($etime-stime),4);//程序執行時間 

二、用PHP爬資料

範例:經濟部工業局爬工廠資料程式


三、Facebook FQL & PHP SDK

I'm sorry, but I don't want to be an emperor. That's not my business. I don't want to rule or conquer anyone. I should like to help everyone if possible - Jew, Gentile - black man - white.

We all want to help one another. Human beings are like that. We want to live by each other's happiness - not by each other's misery. We don't want to hate and despise one another. In this world there's room for everyone and the good earth is rich and can provide for everyone.

The way of life can be free and beautiful, but we have lost the way. Greed has poisoned men's souls - has barricaded the world with hate - has goose-stepped us into misery and bloodshed. We have developed speed, but we have shut ourselves in. Machinery that gives abundance has left us in want. Our knowledge has made us cynical; our cleverness, hard and unkind. We think too much and feel too little. More than machinery we need humanity. More than cleverness, we need kindness and gentleness. Without these qualities, life will be violent and all will be lost.

The aeroplane and the radio have brought us closer together. The very nature of these inventions cries out for the goodness in man - cries for universal brotherhood - for the unity of us all. Even now my voice is reaching millions throughout the world - millions of despairing men, women, and little children - victims of a system that makes men torture and imprison innocent people. To those who can hear me, I say: 'Do not despair.' The misery that is now upon us is but the passing of greed - the bitterness of men who fear the way of human progress. The hate of men will pass, and dictators die, and the power they took from the people will return to the people. And so long as men die, liberty will never perish.

Soldiers! Don't give yourselves to brutes - men who despise you and enslave you - who regiment your lives - tell you what to do - what to think and what to feel! Who drill you - diet you - treat you like cattle, use you as cannon fodder. Don't give yourselves to these unnatural men - machine men with machine minds and machine hearts! You are not machines! You are not cattle! You are men! You have the love of humanity in your hearts. You don't hate, only the unloved hate - the unloved and the unnatural!

Soldiers! Don't fight for slavery! Fight for liberty! In the seventeenth chapter of St Luke, it is written the kingdom of God is within man not one man nor a group of men, but in all men! In you! You, the people, have the power - the power to create machines. The power to create happiness! You, the people, have the power to make this life free and beautiful - to make this life a wonderful adventure. Then in the name of democracy - let us use that power - let us all unite. Let us fight for a new world - a decent world that will give men a chance to work - that will give youth a future and old age a security.

By the promise of these things, brutes have risen to power. But they lie! They do not fulfil that promise. They never will! Dictators free themselves but they enslave the people. Now let us fight to fulfil that promise! Let us fight to free the world - to do away with national barriers - to do away with greed, with hate and intolerance. Let us fight for a world of reason - a world where science and progress will lead to all men's happiness. Soldiers, in the name of democracy, let us unite!

好用功能
多重選取 ctrl + d

(中文) Sublime Text 手冊

http://docs.sublimetext.tw/
排版好看,教學易懂,可惜[編輯]部分沒寫完。以MAC版為主,把command換成ctrl就是Windows的快捷鍵。

(中文) Sublime Text 2 小技巧

http://kevintsengtw.blogspot.tw/p/sublime-text-2.html#.UojjUPkUh8F
Google搜尋第一頁

(英文) Sublime Text 2 教學影片

https://tutsplus.com/course/improve-workflow-in-sublime-text-2/
也有人推薦,還沒看。

字型推薦

http://edenyeh.com/sublimetext/sublime-text-firstclass/
http://akr.tw/2012/09/inconsolata-sublime-text-2/

CSS同步編輯套件

http://livestyle.emmet.io/
http://edenyeh.com/sublimetext/sublime-text-emmet-livestyle/

I am proud to come to this city as the guest of your distinguished mayor, who has symbolized throughout the world the fighting spirit of West Berlin. And I am proud to visit the Federal Republic with your distinguished chancellor, who for so many years has committed Germany to democracy and freedom and progress, and to come here in the company of my fellow American, General Clay, who has been in this city during its great moments of crisis and will come again if ever needed.

Two thousand years ago, the proudest boast was "civis romanus sum." Today, in the world of freedom, the proudest boast is "Ich bin ein Berliner."

I appreciate my interpreter translating my German!

There are many people in the world who really don't understand, or say they don't, what is the great issue between the free world and the communist world. Let them come to Berlin. There are some who say that communism is the wave of the future. Let them come to Berlin. And there are some who say in Europe and elsewhere we can work with the communists. Let them come to Berlin. And there are even a few who say that it is true that communism is an evil system, but it permits us to make economic progress. Lasst sie nach Berlin kommen. Let them come to Berlin.

Freedom has many difficulties and democracy is not perfect, but we have never had to put a wall up to keep our people in, to prevent them from leaving us. I want to say, on behalf of my countrymen, who live many miles away on the other side of the Atlantic, who are far distant from you, that they take the greatest pride that they have been able to share with you, even from a distance, the story of the last 18 years. I know of no town, no city, that has been besieged for 18 years that still lives with the vitality and the force and the hope and the determination of the city of West Berlin. While the wall is the most obvious and vivid demonstration of the failures of the communist system, for all the world to see, we take no satisfaction in it, for it is, as your mayor has said, an offense not only against history but an offense against humanity, separating families, dividing husbands and wives and brothers and sisters, and dividing a people who wish to be joined together.

What is true of this city is true of Germany--real, lasting peace in Europe can never be assured as long as one German out of four is denied the elementary right of free men, and that is to make a free choice. In 18 years of peace and good faith, this generation of Germans has earned the right to be free, including the right to unite their families and their nation in lasting peace, with good will to all people. You live in a defended island of freedom, but your life is part of the main. So let me ask you as I close, to lift your eyes beyond the dangers of today, to the hopes of tomorrow, beyond the freedom merely of this city of Berlin, or your country of Germany, to the advance of freedom everywhere, beyond the wall to the day of peace with justice, beyond yourselves and ourselves to all mankind.

Freedom is indivisible, and when one man is enslaved, all are not free. When all are free, then we can look forward to that day when this city will be joined as one and this country and this great Continent of Europe in a peaceful and hopeful globe. When that day finally comes, as it will, the people of West Berlin can take sober satisfaction in the fact that they were in the front lines for almost two decades.

All free men, wherever they may live, are citizens of Berlin, and therefore, as a free man, I take pride in the words "Ich bin ein Berliner."