Archive

Archive for the ‘Python’ Category

觀察實驗資料和畫圖表的小技巧

February 10th, 2010

之前在《減少操作實驗浪費的時間》提到一些做實驗的小技巧,方便自動化重覆實驗、觀察結果和產生圖表。最近實驗做得比以前更多,意外發覺更好用的方式 。有需求就會進步,這是工程師的宿命啊!

( Read more… )

fcamel All, Programming, Python, Research, System, Tips, Tool

學 Python 的入門書

February 5th, 2010

常看到有人問這問題,想說來寫篇心得,省得重覆回一樣的問題。

( Read more… )

fcamel All, Programming, Python

Python 加速的方法

January 5th, 2010

這一年來用 Python 開發滿爽的,用久後發覺 Python 真的是不夠快啊。雖說這就是 trade-off,拿 CPU 執行時間換工程師開發的時間,但關鍵時刻跑得不夠快,還是得投入時間研究如何加速。程式開發就是一連串的 trade-off,人生也是如此啊!…………………還是少嘴炮,切入正題吧。

( Read more… )

fcamel All, Programming, Python

賀!Python 寫破萬行記念!

October 29th, 2009

這是我獨力寫過最大的專案了,從八月初開始寫,不知不覺寫到破萬行啊,而且其中有四千多行是測試碼,貫徹當初 TDD 到底的決心。

( Read more… )

fcamel All, Programming, Python, Testing

寫 Python 測試碼的好幫手

September 22nd, 2009

前陣子用 TDD 寫了個六千多行的工具,這篇記錄一下過程中惠我良多的好幫手。

( Read more… )

fcamel All, Programming, Python, Testing

學程式語言的樂趣

July 22nd, 2009

國三時為了做北市數學科展,實習老師教我使用 Microsoft Word,這是我首次體會到電腦在遊戲之外的樂趣。為了學會怎麼灌 Windows,高一時參加了社團,結果社團學長 Scott 說:「灌 Windows 太簡單了,你來學 C 吧。不過我們這裡只有 Red Hat Linux,就邊學 C 邊學 Linux 吧。」傻傻的我,以為 Linux 裡只有 Vi,就四處翻 Linux 入門書,看完各本書裡 Vi 部份,還寫了篇 Vi 的教學。日漸熟悉 Vi、bash 指令後,覺得玩系統、寫程式真有趣。於是上課無聊就偷看電腦書,下課耍自閉繼續看書,中午放學都跑去社團混,就這樣渡過我的高一。不知不覺,我打下日後學習能力最重要的基礎。

( Read more… )

fcamel All, Java, Programming, Python, Ruby

Python 排序的技巧

May 1st, 2009

用 Python 排序時相較於 C、Java 多了效率議題。由於 Python 內建函數 (built-in function) 是用 C 實作的,排序時盡可能用內建函數效率會快上不少,詳細的數據比較可以參見 Python Cookbook,這篇做個簡單的整理。

( Read more… )

fcamel All, Programming, Python

寫 Blog 好幫手 TD-Post!

April 25th, 2009

為了方便寫 Blog,寫了個小程式讀 wiki code 產生 WordPress 吃的格式,順便藉機練習 TDD,沒想到寫了十小時才完成。剛好最近在看虎x龍的動畫,就將它命名為TD-Post (Tiger x Dragon Post) 吧。

( Read more… )

fcamel All, Blog, Programming, Python, Testing, Web, Wiki

強化 Python 在 Vim 裡的顏色

April 22nd, 2009

我習慣用 putty 連 Unix server 開 screen,再用 vim 寫 Python。這篇記錄如何改善 Python 的顏色。

( Read more… )

fcamel All, Programming, Python, System, VIM

最近用 Python + TDD 心得(與 Java 做對照)

April 19th, 2009

最近又用 Python 寫了些程式,剛好和之前用 Java 進行 TDD 做個對照。

( Read more… )

fcamel Programming, Python, Refactoring, Testing