2016年8月30日 星期二

ry禮物交換.py

https://dl.dropboxusercontent.com/u/33089565/ryKids/ry%E7%A6%AE%E7%89%A9%E4%BA%A4%E6%8F%9B.py

#
# ry禮物交換.py
#
# 基本題:
# 5人(a,b,c,d,e) 帶來 5 相異禮物(0,1,2,3,4),
# 彼此交換,不會拿到自己帶來禮物的機率 ==> 44/120
#
# 變化題:
# 其中2人,就說是 a,b,所帶之禮物相同(0==1),
# 彼此交換,不會拿到自己帶來禮物的機率 ==> 24/120
#

所用的原理:

Inclusion–exclusion principle


|A\cup B|=|A|+|B|-|A\cap B|,

|A\cup B\cup C|=|A|+|B|+|C|-|A\cap B|-|A\cap C|-|B\cap C|+|A\cap B\cap C|.

  

In its general form,
{\biggl |}\bigcup _{{i=1}}^{n}A_{i}{\biggr |}=\sum _{{i=1}}^{n}\left|A_{i}\right|\;-\sum _{{1\leq i<j\leq n}}\left|A_{i}\cap A_{j}\right|\;+\sum _{{1\leq i<j<k\leq n}}\left|A_{i}\cap A_{j}\cap A_{k}\right|\;-\ \ldots \ +\;\left(-1\right)^{{n-1}}\left|A_{1}\cap \cdots \cap A_{n}\right|.


In applications it is common to see the principle expressed in its complementary form. 
{\biggl |}\bigcap _{{i=1}}^{n}{\bar  {A_{i}}}{\biggr |}={\biggl |}S-\bigcup _{{i=1}}^{n}A_{i}{\biggr |}=\left|S\right|\;-\sum _{{i=1}}^{n}\left|A_{i}\right|\;+\sum _{{1\leq i<j\leq n}}\left|A_{i}\cap A_{j}\right|\;-\;\ldots \ +\;\left(-1\right)^{{n}}\left|A_{1}\cap \cdots \cap A_{n}\right|.

2016年8月19日 星期五

中華電信




*請選擇上網身分: ==> 中華行動門號/會員
*行動門號或會員號碼: ==> 各自手機號碼
*密碼: ==> **



2016年7月15日 星期五

高中物理課程例題與現象實作示範

對物理有興趣的學生,
可以來這裏了解怎麼利用程式,
視覺化加速物理的學習,
並同時學會易讀易懂的Python。

臺大物理系 石明豐教授
https://www.facebook.com/ntuvphysics

國中生都能懂的狹義相對論

時間膨脹原理
 

 長度收縮原理
 

 時間扭曲
 

2016年7月8日 星期五

幾個典型科系之個人申請相關事項


國立臺灣大學 物理學系 105學年度

台大物理系居然有個用 Python 來學 物理的課程,
運用 VPython,
把大一物理及高中物理學到的東西通通用 Python 寫出範例程式,
十分值得看一下。

facebook 粉絲頁
課程示範頁


2016年6月23日 星期四

Steve Jobs

Steve Jobs
delivered 12 June 2005, Palo Alto, CA





----


----

Thank you.
I'm honored to be with you today for your commencement from one of the finest universities in the world. Truth be told, I never graduated from college, and this is the closest I've ever gotten to a college graduation. Today, I want to tell you three stories from my life. That's it. No big deal. Just three stories.

2016年6月22日 星期三

大學入學考試中心

大學入學考試中心

106學年度學科能力測驗: 106年1月20日、21日(星期五、六)考試。new

歷年試題 

105學年度學科能力測驗各科試題

105學年度學科能力測驗各科試題及選擇(填)題答案與非選擇題評分原則
科 目試 題選擇(填)題答案非選擇題評分原則
PDF檔Word檔
國 文試題內容試題內容選擇題答案非選擇題評分原則
英 文試題內容試題內容選擇題答案非選擇題評分原則
數 學試題內容試題內容選擇(填)題答案
社 會試題內容試題內容選擇題答案
自 然試題內容試題內容選擇題答案


國文考科及英文考科作文佳作

原卷01    原卷02

原卷01    原卷02

有關國文及英文之作文準備,
最好的準備方式應是參考同輩的佳作,
看看同年齡的他人,寫出如何的作品,
用什麼樣的單字、片語、來表達其思想。
熟讀、能背一背更好。

其次為背一些經典演講或文章。像是林肯、甘迺迪、馬丁路德金之演講。

歷年學測及指考作文佳作。

http://www.ceec.edu.tw/AbilityExam/AbilityExamInfo.htm

http://www.ceec.edu.tw/AppointExam/AppointExamInfo.htm





2016年6月21日 星期二

Abraham Lincoln Gettysburg Address



----
  
mp4, mp3, pdf
----

  1. Fourscore and seven years ago our fathers brought forth on this continent a new nation, conceived in liberty and dedicated to the proposition that all men are created equal.

2016年6月20日 星期一

Martin Luther King - I Have A Dream Speech



Martin Luther King, Jr.

I Have a Dream



I am happy to join with you today in what will go down in history as the greatest demonstration for freedom in the history of our nation.

2016年6月18日 星期六

President Kennedy 1961 Inaugural Address

And so, my fellow Americans: 
ask not what your country can do for you, 
ask what you can do for your country.
— John F. Kennedy, inauguration address, January 1961.


講稿在此:
http://avalon.law.yale.edu/20th_century/kennedy.asp

CopyPaste 在此:
Inaugural Address of John F. Kennedy

FRIDAY, JANUARY 20, 1961

Vice President Johnson, Mr. Speaker, Mr. Chief Justice, President Eisenhower, Vice President Nixon, President Truman, reverend clergy, fellow citizens, we observe today not a victory of party, but a celebration of freedom--symbolizing an end, as well as a beginning--signifying renewal, as well as change. For I have sworn before you and Almighty God the same solemn oath our forebears prescribed nearly a century and three quarters ago.


2016年2月27日 星期六

附中科學班

http://tigercosmos.blogspot.tw/2015/07/experience-of-science-class-entrance-exam.html

pygame, midi,

Scratch上的midi, 鋼琴, 卡農

http://ryteach.blogspot.tw/2016/02/pachelbels-canon-music-animation-of.html



一段運用pygame 中的 midi 來播放【音符】的小程式。

https://www.dropbox.com/s/cob15g150kktkop/ryMidi001.py?dl=0

酷鋼琴鍵盤

在 C:\Python34\Lib\site-packages\pygame\examples\midi.py

我微小修改: 
https://www.dropbox.com/s/1ez3lbqgy6az34s/ryMidi002_fromPygameExamplesMidi.py?dl=0

https://www.dropbox.com/s/88fv8bxx8nfzfyp/midikeys.png?dl=0



'''
ryMidi001.py
Ref:
1. http://stackoverflow.com/questions/15863534/playing-note-with-pygame-midi

2016/02/28
'''
import pygame.midi
import time

pygame.midi.init()
player= pygame.midi.Output(0)

player.set_instrument(0)

player.note_on(60, 127) # 60 代表 C(中央Do), 127代表 音量
time.sleep(1)
player.note_off(60, 127)

player.set_instrument(10)

for n in range(60,73):
    player.note_on(n, 127)
    time.sleep(1)
    player.note_off(n, 127)

player.set_instrument(20)
    
音階= [60,62,64,65,67,69,71,72]
for n in 音階:
    player.note_on(n, 127)
    time.sleep(1)
    player.note_off(n, 127)
    
del player
pygame.midi.quit()

2016年2月23日 星期二

Google Science Fair

Google Science Fair 

是全球性的線上科學與工程競賽,
開放世界各地 13 到 18 歲的個人或小組報名參加。

https://www.googlesciencefair.com/zh-TW/

辨識攙假商品的新方法:透過分析敲擊聲來辨識液體

敲敲兩瓶不同液體,你會聽到兩種聲音。我們設計的裝置能夠根據聲音的不同,精確地分辨兩種液體,甚至能分辨出混摻其他廉價溶劑的假汽油。不僅如此,我們現在不必開瓶,就能知道玻璃瓶裡裝的是什麼酒。
https://www.googlesciencefair.com/zh-TW/competition/previous-years

https://www.googlesciencefair.com/projects/en/2015/2b3afdfb8dd46733cb8b2e4df2df55a679e85294c371c6f616ef92b389a181ca


https://www.googlesciencefair.com/projects/en/2015/d661b20b206d6e9ff3dfe8df577a31a3e6bbcd3b2eab647179e57baef017490a

2016年2月3日 星期三

Python GUI 更進一步的研究, TK

Python GUI 更進一步的研究,
用 TK inter為基礎。
參考以下網頁當作學習的起點。
這本書我們應該有印出來過。找一下吧。

http://pydoing.blogspot.tw/2012/12/Python-Basic-Concept-of-GUI.html

http://apython.blogspot.tw/2014/07/tkinter.html

Calvin 特別注意一下這個 blog

http://sillygodxd.blogspot.tw/search/label/python


這個 Tkinter 的教學很不錯,
作者還發行電子書,
必要的話可買。

http://zetcode.com/gui/tkinter/