2011年11月17日 星期四

Python 開發環境

1.eclipse

2.vim

因為工作上的需求大多使用VIM,我用vim 也用得很熟了。當然以vim為首選。

不過又看到一個人,花了老半天還是回去用eclipse + pydev,

而且同時又整合Google APP engine。

在ericksk的教學

中有提到由eclipse中安裝pydev的安裝連結http://nightly.aptana.com/pydev/site.xml

要更新為下面這個連結

http://pydev.org/updates

--

找到一些exlipse的記錄

victor 的教學 由簡入繁的教學當然也包含一些IDE的安裝。

ericksk 的教學 主要是集中在Google APP engine。

2011年10月14日 星期五

test_blog on internet

Vim 的標籤頁功能 來自 FPGA,ASIC學習園地-與非網博客

undefined

上篇文章介紹了vim的智能補全(omni補全),本篇主要介紹vim提供的其它補全方式。

除智能補全外,最常用的補全方式應該是CTRL-NCTRL-P補全了。它們會在當前緩衝區、其它緩衝區,以及當前文件所包含的頭文件中查找以光標前關鍵字開始的單詞。智能補全不能對局部變量進行補全,而CTRL-NCTRL-P補全則可以很好的勝任。

2011年9月30日 星期五

test_blog on internet

Vim 的標籤頁功能 來自 FPGA,ASIC學習園地-與非網博客

undefined

上篇文章介紹了vim的智能補全(omni補全),本篇主要介紹vim提供的其它補全方式。

除智能補全外,最常用的補全方式應該是CTRL-NCTRL-P補全了。它們會在當前緩衝區、其它緩衝區,以及當前文件所包含的頭文件中查找以光標前關鍵字開始的單詞。智能補全不能對局部變量進行補全,而CTRL-NCTRL-P補全則可以很好的勝任。

2011年9月11日 星期日

GOOGLE APP ENGINE SDK

for Python 的版本只有支援到2.5,3.0之後的語法不支援。讓我吃了一點小苦頭~不過裝起來之後還蠻好玩的!現在目標是把yahoo 網頁擷取的範例程式, 移植到GOOGLE上。希望可以聊解Python上HTML的運作方式。至少離擷取stack info 要接進一步!

說實在的google還真是佛心來著,給了個GAE的教學,還有基本的hellw world +guest book example for SDK。有興趣的人真的可以來玩玩。

2011年8月28日 星期日

Teach Yourself Programming in Ten Years -Peter Norvig

原文摘自 http://norvig.com/21-days.html

 

Why is everyone in such a rush?

作者在amazon, power serach 去尋找"teach yourself”', “days” 甚至"hours”等關鍵字,發覺這種速成的書籍96%都是教computer sicense.

在這麼短的時間內學到的可能學到的只是語法(syntax),而無法真正了解這個語言的優點/缺點。

作者引用了下面這段話。

Alan Perlis once said: "A language that doesn't affect the way you think about programming, is not worth knowing".

"一種語言是不值得去了解,如果他無法影響你思考程式的方式" –alan perlis.

小的從會寫verilog 到真的用電路去思考也花了1~2年

但大家為什麼這麼快的要去學習一種語言,有可能你需要了解如何引用一些現成的tool chain, 來完成你自己的任務。

Teach Yourself Programming in Ten Years

"The key is deliberative practice: not just doing it again and again, but challenging yourself with a task that is just beyond your current ability, trying it, analyzing your performance while and after doing it, and correcting any mistakes.Then repeat. And repeat again. There appear to be no real shortcuts"

"關鍵是用心的練習:並不只是重複的練習,而是以一種自我挑戰的態度來進行嘗試,並在執行的過程中,與執行完成後,分析並更正自己的做法。然後一再的自我挑戰。在這不斷挑戰的過程中是沒有任何捷徑的。"

作者首先引用了一些papar,來說明為什麼是10年來成為一個專家。舉了許多的例子,演奏鋼琴,游泳,打網球等,然後他提出了上面的關鍵。並以莫札特(Mozart)為例他花了13年來成為音樂神童。再舉披頭四的例子,他們在1964年發行了一炮而紅的專輯。然而他們在1957起就在Liverpool 和 Hamburg 的小酒吧演奏了。然後舉出了最頂尖的演奏家總共會練習100,000小時,而一半的音樂老師大概只有練習4,000小時的量。當然這與他們獲得的回饋有關係。

這與異數這本書提到的好像(必須要有超過100,000小時的練習,才可以成為專家)

之後提了一些要窮盡一生,吃苦耐勞,一心一意等的要件來成為專家。(Samuel Johnson (1709-1784) thought it took even longer: "Excellence in any department can be attained only by the labor of a lifetime; it is not to be purchased at a lesser price.")就不討論了,但我記得在其他地方也看過類似的論點。

Here's my recipe for programming success:(這是作者寫的,我覺得這邊的資訊比較重要)

  • Get interested in programming, and do some because it is fun. Make sure that it keeps being enough fun so that you will be willing to put in ten years.
  • 你要對於寫程式有興趣而且因為有趣而作。而且要確認這件事情夠有趣,有趣到你可以做十年。
  • Talk to other programmers; read other programs. This is more important than any book or training course.
  • 跟其他程式設計者交流,閱讀相關的程式,這比你去看書或者上訓練課程要重要多了
  • Program. The best kind of learning is learning by doing. To put it more technically, "the maximal level of performance for individuals in a given domain is not attained automatically as a function of extended experience, but the level of performance can be increased even by highly experienced individuals as a result of deliberate efforts to improve." (p. 366) and "the most effective learning requires a well-defined task with an appropriate difficulty level for the particular individual, informative feedback, and opportunities for repetition and corrections of errors." (p. 20-21) The book Cognition in Practice: Mind, Mathematics, and Culture in Everyday Life is an interesting reference for this viewpoint.
  • 成是最好的學習方法是邊學邊做。換個技術一點的說法"…, 最有效的學習需要一個被完整定義的任務,當然他要對於練習者有適當的難度。並且在完成任務後可以得到一些有教育意義的回饋,最好還有機會可以再做一次並更新一些錯誤。"
  • If you want, put in four years at a college (or more at a graduate school). This will give you access to some jobs that require credentials, and it will give you a deeper understanding of the field, but if you don't enjoy school, you can (with some dedication) get similar experience on the job. In any case, book learning alone won't be enough. "Computer science education cannot make anybody an expert programmer any more than studying brushes and pigment can make somebody an expert painter" says Eric Raymond, author of The New Hacker's Dictionary. One of the best programmers I ever hired had only a High School degree; he's produced a lot of great software, has his own news group, and made enough in stock options to buy his own nightclub.
  • Work on projects with other programmers. Be the best programmer on some projects; be the worst on some others. When you're the best, you get to test your abilities to lead a project, and to inspire others with your vision. When you're the worst, you learn what the masters do, and you learn what they don't like to do (because they make you do it for them).
  • 參加一些專案並與他人合作。試著在某些專案中當一個最好的程式設計者,也試圖去當一個最不熟練的程式設計者。並且試圖去帶領整個專案,而且透過你的觀點給予他人啟發。如果你是最不熟練的工程師,去模仿比較有經驗的人的程式寫法,並且理解他們有禁忌(恩為你要為他們工作)。tw>禁忌翻的或許不夠好,翻成習慣也不錯。
  • Work on projects after other programmers. Be involved in understanding a program written by someone else. See what it takes to understand and fix it when the original programmers are not around. Think about how to design your programs to make it easier for those who will maintain it after you.
  • 加入一個已經開發完成的專案,試圖去理解其他人完成的程式。看要花多少的工夫去理解並且修正其中的問題。最好原作者並不在旁邊。並且思考如何讓下一個接手的人更容易理解這份程式。
  • Learn at least a half dozen programming languages. Include one language that supports class abstractions (like Java or C++), one that supports functional abstraction (like Lisp or ML), one that supports syntactic abstraction (like Lisp), one that supports declarative specifications (like Prolog or C++ templates), one that supports coroutines (like Icon or Scheme), and one that supports parallelism (like Sisal).
  • 卻至少六種語言,至少一種語言支援型別,剩下的我不太行了..
  • Remember that there is a "computer" in "computer science". Know how long it takes your computer to execute an instruction, fetch a word from memory (with and without a cache miss), read consecutive words from disk, and seek to a new location on disk. (Answers here.)
  • 作者提醒既然電腦科學中有"電腦"兩字,你就必須要對他有所了解,你要了解每個指令要花多久的時間執行,與資料在記憶體中與在硬碟中你去取用時所需花的時間。
  • Get involved in a language standardization effort. It could be the ANSI C++ committee, or it could be deciding if your local coding style will have 2 or 4 space indentation levels. Either way, you learn about what other people like in a language, how deeply they feel so, and perhaps even a little about why they feel so.
  • 最好可以參與語言的制定,可能可以參加ANSI C++的委員會,或許你可以參與討論一些coding sytle。你可以學習到其他人為什麼喜歡這個語言,也可以體會到他們對於這個語言的感覺。
  • Have the good sense to get off the language standardization effort as quickly as possible.
  • 盡快的有一個感覺去擺脫???(不太懂了)

Fred Brooks, in his essay No Silver Bullet identified a three-part plan for finding great software designers:

  1. Systematically identify top designers as early as possible.
  2. Assign a career mentor to be responsible for the development of the prospect and carefully keep a career file.
  3. Provide opportunities for growing designers to interact and stimulate each other.
This assumes that some people already have the qualities necessary for being a great designer; the job is to properly coax them along. Alan Perlis put it more succinctly: "Everyone can be taught to sculpt: Michelangelo would have had to be taught how not to. So it is with the great programmers".

muji CD player…(新竹muji的服務真是好)

IMG_2135 

從剛搬進來文教開始,就會覺得在客廳(飯廳)活動的時候沒有什麼音樂聽。

因為在客廳的空間不大,如果要擺個音響實在有點占位子

在某次上台北做產檢的時候(記得好像是去台兒,做高層次超音波)

在台北的無印良品看到 muji CD PLAYer 

記得在以前大學的時候(5年前了,唉),就有看過這個產品,就覺得好有趣

再次看到這個產品,他仍然打動了我。

所以這個周末(2011/08/27)就殺去新竹遠百把他帶回來。

只是帶回來安裝完成之後發覺,怎麼撥出來的聲音破音破的好…嚴重。

雖然早在之前就耳聞他的音效不甚好,但也太離譜了。

隨便放個tony robinson的演講CD就可以一直聽到破音的聲音。

好吧,只好聯絡新竹muji….

一開始接電話是個小女生,我就問他該怎麼辦阿…壁架要不要拆之類的。

他就說要拆,通通都要帶回來我們幫你檢查!(檢查壁架幹嘛…)

我就覺得他在推諉,就只好請問她怎麼稱呼,免得到時候被晃點也不知道。

這一問可好了…馬上說等一下

過了約莫一分鐘就換了個(主管)接電話了(後來到現場有看到本人,還蠻nice的)

 

故事就變成帶壁架來要辦理退貨比較方便,帶來與否自然是由我自己決定的。

(要知道壁架我們後面黏了兩塊輝柏無痕黏膠,還有3M的無痕膠帶最大的X3

是不是要拆下來真的是要好好想一下的)

所以我就跟小佳把壁架拆下來帶去遠百(今天可是颱風天)

到了現場,找了個服務人員,林小姐也出來了。

接下來就交叉測試,在家裡那些破音的聲音,在現場是有點難聽得出來,但是靠著佳穎的交響樂CD測試

還是可以聽得清楚有破音的情形。

把demo機也拿出來給我們聽聽,聽起來還OK,沒有破音(但我的心理有點忐忑,畢竟現場實在太吵雜了。)

而且我在家裡已經跟佳穎達成協議,如果也不行我們就去買ipod的doc。

所以完全沒預期到聲音聽起來還OK。

不過這樣就可以證明是機器的問題,接下來就是換新機測試,然後把他帶回家了。

在寫這篇文章的時候,壁架已經又被黏上去了。

感謝新竹Muji的協助,讓我們的客廳有舒服的音樂可以聽。

IMG_2134

2011年6月6日 星期一

PS5, 去背練習。

今天在家裡打混的時候

因為吃了好吃的西瓜,想要把西瓜的照片放到網路上祝大家端午節快樂

但是拍的時候因為沒有把背景清乾淨。(事實上是以為用50mm的5.6F景深就夠)

只好拿24mm的照片來用。

夏天就是要吃西瓜!

但是雜物又太多只好作作去背的練習。

素聞CS5的去背相當有一套,但是網路上的教學有點片段。

youtube上的影片只有使用魔術棒(http://www.youtube.com/v/dXLsxpid87Q&hl=zh_TW&fs=1&)

梅干的部落格教我們用畫的(http://www.minwt.com/?p=2120)

 DSC08199_

學藝不精的下場就變成上圖!

所以我就打算融合兩家之長

首先用[魔術棒]選取西瓜周圍的圖形省去描邊之苦

再來

“ctrl + shift + i “的反向選取。

就可以再採用梅干的作法[快速遮色片],下圖(1),下圖是從(梅干的部落格借來的)

梅問題-Photoshop教學-決戰60秒-photoshop CS5新增去背的新功能

我們就會看到在反轉之後要選取的地方變成紅紅的。(西瓜本來就是紅的有點難看or2)

再用上圖中的點2作補強的動作,當然可以塗,就可以擦,所以橡皮擦是可以使用的

同時配合快速鍵”[”,”]”,切換筆刷大小

“ctrl" + "+"還有“ctrl" + "-"縮放圖片就可以搞定

tab則可以切換要不要出現使用範圍

image

然後在魔術棒的情況下可以做的事情很多,你可以

1.”儲存選取範圍":可以將辛苦做出來的範圍存下來,如果不小心弄掉了也可以在步驟筆記中撈回來,別擔心‧

2."拷貝的圖層":就變成一個獨立的塗層可以自由的配合上背景了

當然上述的的兩個教學中,主要是針對髮絲的部分可以再作調整,至於西瓜應該是不用了。

在做完拷貝的圖層之後,我們已經有了西瓜跟盤子了

接下來就是加上背景

插入一個空白圖層之後使用[油漆桶]工具,變行成建層工具即可拉出漂亮的建層

然後就可以輸出成漂亮的西瓜圖摟

DSC08199_final

flow整理

魔術棒

反向選取

快速遮色片

拷貝圖層