為了在Safari上列印方便, 將版面也做了些調整...
不過如果是在windows上,使用IE/Firefox瀏覧及列印的網友, 可能要自行將網頁源碼複製到本機,自行調整一下排版.
字首字根1
字首字根2
整理這個比我所估計的還要花工夫.
一堂4小時的課程內容,最少要花到8~12小時,才有辦法整理完成.
從事後的整理中, 就可以瞭解, 補習班的課程密度實在是相當高...
看來, 做補習班的也不好賺啊....
2007年7月13日 星期五
2007年7月6日 星期五
一個防止網頁盜連的Java Script
昨天在檢視sitemeter的資料時, 意外發現一個奇特的訪客, 這位訪客進入本網頁的頁面, 以及離開時的頁面,
都不是本網頁的任何頁面.
而連結到進入點一探究竟時, 竟發現進入點的網頁內容, 與本網頁一致, 然而, 網址列卻全然不同...當下, 很直接的想到--是不是被人盜連了?
於是, 在情況還不明朗的情形下, 決定先找一個方式, 暫時阻擋此類連結.
之前有看過利用網頁內容的座標, 來判斷是否網頁被他人當作嵌入內容, 不過目前的狀況似乎不適合(因為沒有看到任何frame), 在搜尋一陣子後, 發現下面的Java Script可能符合我的需要:
將上面這一段程式碼, 加入Template中後, 每當有人意圖從其他入口進入自己的網頁時, 便會跳出一個警告視窗, 之後, 便將使用者導向正確的入口.
這一段程式碼看來相當方便, 然而卻有相當大的問題...效果太暴力了.
以上程式碼, 不只將盜連擋掉, 連一般的連結也擋掉了. 結果就是不論從任何連結, 想要連到本網頁, 都會先彈出一個警告視窗.
真正要有效果的話, 可能得將條件判斷式改得更精確點...也就是說, 不能只判斷進入點是否是本網頁, 而應判斷連過來的網頁是否合法.
不過還好這只是暫時性的作法, 之後針對連過來的網頁查了一下, 發現那是一個網上代理伺服器的網站, 基本上不會造成什麼危害後, 我也就將之移除了.
都不是本網頁的任何頁面.
而連結到進入點一探究竟時, 竟發現進入點的網頁內容, 與本網頁一致, 然而, 網址列卻全然不同...當下, 很直接的想到--是不是被人盜連了?
於是, 在情況還不明朗的情形下, 決定先找一個方式, 暫時阻擋此類連結.
之前有看過利用網頁內容的座標, 來判斷是否網頁被他人當作嵌入內容, 不過目前的狀況似乎不適合(因為沒有看到任何frame), 在搜尋一陣子後, 發現下面的Java Script可能符合我的需要:
<script type='text/javascript'>
<!--
var who=document.referrer;
if(who && who.indexOf("thedoublee.blogspot.com") == -1 ){
alert("It's an Illegl Link. All Rights reserved by thedoublee.blogspot.com");
top.location.href = "http://thedoublee.blogspot.com";
}
//-->
</script>
將上面這一段程式碼, 加入Template中後, 每當有人意圖從其他入口進入自己的網頁時, 便會跳出一個警告視窗, 之後, 便將使用者導向正確的入口.
這一段程式碼看來相當方便, 然而卻有相當大的問題...效果太暴力了.
以上程式碼, 不只將盜連擋掉, 連一般的連結也擋掉了. 結果就是不論從任何連結, 想要連到本網頁, 都會先彈出一個警告視窗.
真正要有效果的話, 可能得將條件判斷式改得更精確點...也就是說, 不能只判斷進入點是否是本網頁, 而應判斷連過來的網頁是否合法.
不過還好這只是暫時性的作法, 之後針對連過來的網頁查了一下, 發現那是一個網上代理伺服器的網站, 基本上不會造成什麼危害後, 我也就將之移除了.
Labels:
Web相關技術--Web Technique
2007年6月18日 星期一
鍵-值編碼(key-value coding)技術概觀--0.5版
鍵-值相關技術--包含鍵值編碼(key-value coding),鍵-值監看(key-value observing)--可說是目前Mac應用程式開發基礎模式。包括繫結技術(binding),腳本語言支援(scriptable),以及各類UI與應用程式的合作,都是透過鍵值編碼加以實現。
以下文章,參考並改寫自Key-Value Coding Programming Guide以及NSKeyValueCoding Protocol Reference,雖然尚未完全完成,但希望能對有志開發者有所助益。
鍵-值編碼(key-value coding)技術概觀
以下文章,參考並改寫自Key-Value Coding Programming Guide以及NSKeyValueCoding Protocol Reference,雖然尚未完全完成,但希望能對有志開發者有所助益。
鍵-值編碼(key-value coding)技術概觀
Labels:
Mac開發技術
2007年6月10日 星期日
考完了
嗯....要怎麼說呢....
實在不是考得很理想....
第一段的填充還算順利,就是時間不夠,後面的閱讀測驗連猜答案的時間都沒有...
早知道就多練練模考啦....XD
第二段計量還好,可是我好像把一些答案「不確定」的,填成「一樣」了....-_-|||
心裡怕怕的....
第三部分....根本在昏頭中....
唯一沒出錯的好像只有第四部分....
總之...現在擔心也沒用啦...好好準備TOFEL及申請文件,反正目標瞄準MIT跟CMU的話,也不用在意GRE啦...
實在不是考得很理想....
第一段的填充還算順利,就是時間不夠,後面的閱讀測驗連猜答案的時間都沒有...
早知道就多練練模考啦....XD
第二段計量還好,可是我好像把一些答案「不確定」的,填成「一樣」了....-_-|||
心裡怕怕的....
第三部分....根本在昏頭中....
唯一沒出錯的好像只有第四部分....
總之...現在擔心也沒用啦...好好準備TOFEL及申請文件,反正目標瞄準MIT跟CMU的話,也不用在意GRE啦...
Labels:
雜七雜八--Others,
GRE
2007年5月26日 星期六
如何使用NSXMLFamily與XPath
在別的地方發佈了,卻忘了掛到自己的Blog上....XD
其實有空的話,我應該另外弄一個專門放技術文章的....
有空的話..............-_-|||
如何使用NSXMLFamily與XPath
其實有空的話,我應該另外弄一個專門放技術文章的....
有空的話..............-_-|||
如何使用NSXMLFamily與XPath
Labels:
尋孔顏樂處--Learning,
Mac開發技術
2007年4月13日 星期五
2007年4月11日 星期三
Argument分析
之前謝老師所寄送的Argument homework,缺了004~008,趁著考前,當作練習,將其中幾篇照著作業格式分析了一下,希望能有所幫助,同時也算是製作Argument模版前的一個小功課。
編號:004
英文題目:
Milk and dairy products are rich in vitamin D and calcium, substances essential for building and maintaining bones. Many people therefore believe that a diet rich in dairy products can help prevent osteoporosis, a disease in which the bones weaken significantly with age and that is linked to both environmental and genetic factors. But a long-term study of a large number of people has found that those who have consistently consumed dairy products throughout the years of the study have a higher rate of bone fractures than any other participants in the study. Since bone fractures are a symptom of osteoporosis, this study result shows that a diet rich in dairy products may actually increase, rather than decrease, the risk of osteoporosis.
中文題目:
牛奶及乳製品富含維生素D及鈣質等對骨骼建立與維護不可或缺的物質。許多人因此相信富含乳製品的食物能幫助預防骨質疏鬆症,一種骨骼隨年紀增長而明顯弱化的疾病,其成因與環境及基因息息相關。然而一個對大量民眾的長期研究發現,那些持續攝取乳製品的人在多年的研究之後比起其他參與者有更高的骨折比例。既然骨折是骨質疏鬆症的症狀之一,此一研究結果顯示富含乳製品的食品事實上可能增加,而非減少罹患骨質疏鬆症的風險。
邏輯關係:
Fact 1: Milk and dairy products are rich in vitamin D and calcium, substances essential for building and maintaining bones. Many people therefore believe that a diet rich in dairy products can help prevent osteoporosis.
Cause 1: age
Cause 2: environmental factors
Cause 3: genetic factors
Effect 1: osteoporosis
Fact 2: those who have consistently consumed dairy products throughout the years of the study
Fact 3: have a higher rate of bone fractures than any other participants in the study.
Fact 4: bone fractures are a symptom of osteoporosis.
Effect 2: a diet rich in dairy products may actually increase, rather than decrease, the risk of osteoporosis.
.................Cause 1 ↘
.................Cause 2 ➝ Effect 1
.................Cause 3 ↗.........↘
Fact 1 ➝ Fact 2 ➝ Fact 3 ➝ Effect 2
.................................Fact 4 ↗
邏輯謬誤:
Fact 4 ➝ Effect 2: 倒因為果,骨質疏鬆症會導致骨折,而不是骨折導致骨質疏鬆症。
Fact 2 ➝ Fact 3: 另有他因,造成骨折的原因可能有很多,重大意外,運動,工作等等。
Fact 3 ➝ Effect 2: 另有他因,即使是骨質疏鬆,也不一定是乳製品的影響,依據Cause 1, Cause 2, Cause 3, 也可能是遺傳,或年齡所造成的,特別是研究中並未提到骨折者的年齡問題及家族病史。
----------------------------------------------------------
編號:005
The following appeared in the summary of a study on headaches suffered by the residents of Mentia.
"Salicylates are members of the same chemical family as aspirin, a medicine used to treat headaches. Although many foods are naturally rich in salicylates, for the past several decades food-processing companies have also been adding salicylates to foods as preservatives. This rise in the commercial use of salicylates has been found to correlate with a steady decline in the average number of headaches reported by participants in our twenty-year study. Recently, food-processing companies have found that salicylates can also be used as flavor additives for foods. With this new use for salicylates, we can expect a continued steady decline in the number of headaches suffered by the average citizen of Mentia."
中文題目:
以下文章被發表在一個有關於Mentia居民頭痛問題的研究的總結中。
"水楊酸鹽類與用來治療頭痛的阿斯匹靈為同一化學家族的成員。儘管許多食物原本就富含水楊酸鹽類,在過去數十年來,食品加工業者仍然在食物中填加水楊酸鹽做為防腐劑。水楊酸鹽類在商業使用上的增加,已經被發現與我們過去二十年間實驗參與者頭痛報告的數量穩定減少有所關聯。最近,食品加工業者發現水楊酸鹽類也能用以增添食物風味。伴隨著水楊酸鹽的新用途,我們可預期Mentia市民遭受頭痛
的數目將持續穩定的減少。"
邏輯關係:
Fact 1: Salicylates are members of the same chemical family as aspirin.
Fact 2: Aspirin is used to treat headaches.
Cause 1: The rise in the commercial use of salicylates.
Effect 1: A steady decline in the average number of headaches reported by participants in our twenty-year study.
Fact 3: food-processing companies have found that salicylates can also be used as flavor additives for foods.
Effect 2: we can expect a continued steady decline in the number of headaches suffered by the average citizen of Mentia.
Fact 1 ↘
Cause 1 ➝ Effect 1 ➝ Effect 2
Fact 2 ↗.......Fact 3 ↗
邏輯謬誤:
1. Fact 1, Cause 1, Fact 2 ➝ Effect 1 : 另有他因.
a. 同一族系不代表功用相同(Fact 1, Fact 2).
b. 報告的減少不一定表示頭痛人數的減少:
i. 實驗者的減少也有可能導致報告數目的減少: 死亡,外移, 退出實驗.
ii. 基於i, 也有可能報告數目減少, 但比例增加.
c. 無法證明實驗者與加工食品中的水楊酸有必然關聯:
i. 可能Mentia的居民都以天然食品為主.
ii. 整體水楊酸使用的增加,不代表在Mentia的使用增加.
iii.可能是巧合.
2. Effect 1, Fact 3 ➝ Effect 2 : 錯誤類比.
水楊酸鹽類可用做防腐劑,導致商業使用的增加,不代表其做為風味填加劑,也會促使商業使用增加:
i. 許多天然食品已有水楊酸鹽.
ii. 加工食品也已填加水楊酸鹽做為防腐劑,不需要額外的劑量。
iii.就算需要額外的劑量,成本,其他便宜調味料的競爭也可能造成水楊酸鹽不足以成為第一選擇。
編號:004
英文題目:
Milk and dairy products are rich in vitamin D and calcium, substances essential for building and maintaining bones. Many people therefore believe that a diet rich in dairy products can help prevent osteoporosis, a disease in which the bones weaken significantly with age and that is linked to both environmental and genetic factors. But a long-term study of a large number of people has found that those who have consistently consumed dairy products throughout the years of the study have a higher rate of bone fractures than any other participants in the study. Since bone fractures are a symptom of osteoporosis, this study result shows that a diet rich in dairy products may actually increase, rather than decrease, the risk of osteoporosis.
中文題目:
牛奶及乳製品富含維生素D及鈣質等對骨骼建立與維護不可或缺的物質。許多人因此相信富含乳製品的食物能幫助預防骨質疏鬆症,一種骨骼隨年紀增長而明顯弱化的疾病,其成因與環境及基因息息相關。然而一個對大量民眾的長期研究發現,那些持續攝取乳製品的人在多年的研究之後比起其他參與者有更高的骨折比例。既然骨折是骨質疏鬆症的症狀之一,此一研究結果顯示富含乳製品的食品事實上可能增加,而非減少罹患骨質疏鬆症的風險。
邏輯關係:
Fact 1: Milk and dairy products are rich in vitamin D and calcium, substances essential for building and maintaining bones. Many people therefore believe that a diet rich in dairy products can help prevent osteoporosis.
Cause 1: age
Cause 2: environmental factors
Cause 3: genetic factors
Effect 1: osteoporosis
Fact 2: those who have consistently consumed dairy products throughout the years of the study
Fact 3: have a higher rate of bone fractures than any other participants in the study.
Fact 4: bone fractures are a symptom of osteoporosis.
Effect 2: a diet rich in dairy products may actually increase, rather than decrease, the risk of osteoporosis.
.................Cause 1 ↘
.................Cause 2 ➝ Effect 1
.................Cause 3 ↗.........↘
Fact 1 ➝ Fact 2 ➝ Fact 3 ➝ Effect 2
.................................Fact 4 ↗
邏輯謬誤:
Fact 4 ➝ Effect 2: 倒因為果,骨質疏鬆症會導致骨折,而不是骨折導致骨質疏鬆症。
Fact 2 ➝ Fact 3: 另有他因,造成骨折的原因可能有很多,重大意外,運動,工作等等。
Fact 3 ➝ Effect 2: 另有他因,即使是骨質疏鬆,也不一定是乳製品的影響,依據Cause 1, Cause 2, Cause 3, 也可能是遺傳,或年齡所造成的,特別是研究中並未提到骨折者的年齡問題及家族病史。
----------------------------------------------------------
編號:005
The following appeared in the summary of a study on headaches suffered by the residents of Mentia.
"Salicylates are members of the same chemical family as aspirin, a medicine used to treat headaches. Although many foods are naturally rich in salicylates, for the past several decades food-processing companies have also been adding salicylates to foods as preservatives. This rise in the commercial use of salicylates has been found to correlate with a steady decline in the average number of headaches reported by participants in our twenty-year study. Recently, food-processing companies have found that salicylates can also be used as flavor additives for foods. With this new use for salicylates, we can expect a continued steady decline in the number of headaches suffered by the average citizen of Mentia."
中文題目:
以下文章被發表在一個有關於Mentia居民頭痛問題的研究的總結中。
"水楊酸鹽類與用來治療頭痛的阿斯匹靈為同一化學家族的成員。儘管許多食物原本就富含水楊酸鹽類,在過去數十年來,食品加工業者仍然在食物中填加水楊酸鹽做為防腐劑。水楊酸鹽類在商業使用上的增加,已經被發現與我們過去二十年間實驗參與者頭痛報告的數量穩定減少有所關聯。最近,食品加工業者發現水楊酸鹽類也能用以增添食物風味。伴隨著水楊酸鹽的新用途,我們可預期Mentia市民遭受頭痛
的數目將持續穩定的減少。"
邏輯關係:
Fact 1: Salicylates are members of the same chemical family as aspirin.
Fact 2: Aspirin is used to treat headaches.
Cause 1: The rise in the commercial use of salicylates.
Effect 1: A steady decline in the average number of headaches reported by participants in our twenty-year study.
Fact 3: food-processing companies have found that salicylates can also be used as flavor additives for foods.
Effect 2: we can expect a continued steady decline in the number of headaches suffered by the average citizen of Mentia.
Fact 1 ↘
Cause 1 ➝ Effect 1 ➝ Effect 2
Fact 2 ↗.......Fact 3 ↗
邏輯謬誤:
1. Fact 1, Cause 1, Fact 2 ➝ Effect 1 : 另有他因.
a. 同一族系不代表功用相同(Fact 1, Fact 2).
b. 報告的減少不一定表示頭痛人數的減少:
i. 實驗者的減少也有可能導致報告數目的減少: 死亡,外移, 退出實驗.
ii. 基於i, 也有可能報告數目減少, 但比例增加.
c. 無法證明實驗者與加工食品中的水楊酸有必然關聯:
i. 可能Mentia的居民都以天然食品為主.
ii. 整體水楊酸使用的增加,不代表在Mentia的使用增加.
iii.可能是巧合.
2. Effect 1, Fact 3 ➝ Effect 2 : 錯誤類比.
水楊酸鹽類可用做防腐劑,導致商業使用的增加,不代表其做為風味填加劑,也會促使商業使用增加:
i. 許多天然食品已有水楊酸鹽.
ii. 加工食品也已填加水楊酸鹽做為防腐劑,不需要額外的劑量。
iii.就算需要額外的劑量,成本,其他便宜調味料的競爭也可能造成水楊酸鹽不足以成為第一選擇。
Labels:
文章千古事--writing,
尋孔顏樂處--Learning,
邏輯--Logic,
GRE
訂閱:
意見 (Atom)