發表文章

目前顯示的是 2011的文章

數學符號

對於一個自學資料結構和演算法的人來說(不才在下)似乎最頭痛的就是多年沒碰的一些數學符號比如說" 級數 " 啊,,還有 " 對數 ",,,等的這些,,,太久沒碰,都忘了這些是什麼意思了.

演算法

想學一下演算法,所以去買了一本約300頁的中文入門書了^ ^,還買了一本用Python實作的演算法英文書,本書作者跟Beginning Python的作者是同一位.

`gets' function is dangerous

圖片
最近在讀蔡明志老師的C語言入門書,讀到字串那一段程式的實作發生一些情況,我是使用gcc為編譯器,使用`gets' function會出現`gets' function is dangerous,,,.的訊息,但是程式還是可以執行,後來改用fgets就ok了參考了 Hsian 兄的blog

使用python寫cgi網頁

圖片
作業系統 ubuntu 11.10 網頁伺服器 Apache HTTP Server 如何使用python 在 ubuntu linux上跑cgi 網頁呢?以下是我參考 Sheng Bao 兄 的實做 首先進入 /etc/apache2/sites-available/default 進入後下指令打開default這檔案#sudo vi default 打開default後找到這一段      ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/     <Directory "/usr/lib/cgi-bin">         AllowOverride None         Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch         Order allow,deny         Allow from all      把它修改成如下圖反白處  記住:當你修改時,我假設你的apache http server 是還未啟動的狀態 修改完後:wq 接下來cd進入/usr/lib/cgi-bin 進入之後並sudo vi hello.py<----開始編寫python cgi 網頁 這是一個python cgi 網頁的例子 hello.py完成後一定要再下sudo chmod 775 hello.py, 這樣hello.py才能執行  hello.py 完成後啟動 apache http server 接下來點擊 firefox 並在網址處打上localhost/cgi-bin/hello.py localhost/cgi-bin/hello.py 這網址的/cgi-bin/就是當我們設定 default 時的...

the pointer in C programing

圖片
研究指標這東西可以打發無聊的星期六晚上

老歌

圖片
老歌讓人回味無窮,回味往事有時讓人感傷的,,哈哈,人還是要活在當下,展望未來 : )

kindle

圖片
在 amazon 買的 kindle 4 等了一個星期終於寄來了 開箱 充電 終於可以在kindle上讀我買的pdf電子書了,之前都是直接在電腦上讀,amazon是用ups寄貨的,kindle到之前ups會傳真一些報關文件給買家,然後買家要回傳一些ups要的文件,這樣買家才能收到kindle,如果有疑問可以打電話給ups的0800客服問清楚. 剛開機充電的時候還發生一些問題,usb線插了kindle燈號也亮黃燈了但kindle整個沒反應,最後壓住kindle的電源鈕20秒,讓它reset重啟才能動,,目前一切正常,開心的用著e-ink電子書閱讀了

向C語言之父Dennis Ritchie致敬 R.I.P

圖片
向C語言之父Dennis Ritchie致敬 R.I.P

RIP Steve Jobs

圖片
This 1982 portrait by Diana Walker can be seen on the Portrait Gallery’s first floor.

install Mysql server in ubuntu 11.04

圖片
~$ sudo apt-get install mysql-server /* during the installing it will ask you mysql server's password,,just type the password you want */ ~$ sudo mysql -u root -p /*enter the password */ mysql>

Beginning Python page.486 練習用python + scoket 做ㄧ個小型聊天室 ubuntu11.04

圖片
首先寫一段shell script 把防火牆從5005 port打開 從一台用opensuse的電腦telnet 過去                                                                 

Beginning Python page.486 練習用python + scoket 做ㄧ個小型聊天室

圖片
                              

in Beginning python page 354,the test code,,see within the docstring the angle ">>>" with the green color,,you must leave one empty space,then the test code just can run .在python 測試程式裡,代碼要 跟 ">>>"(保持一個空格)square(2),,,,,程式才能跑(請看綠色部分)

圖片

beginning python p318, install twisted and test it by telnet in ubuntu 11.04

圖片
  first install twisted --->#apt-get install python-twisted                                                                coding                                      test use telnet! in book beginning python page 318, there is an example for the twisted python programming. However, I do not know how to use telnet to test it,, here is what I discover,,.

install vim in ubuntu 11.04, because vi in ubuntu is so hard to use!!!

for example I am in root --># #apt-get install vim -->yes ok!!!

linux command chown and gid uid practice

圖片

beginning python page 270,want to read this "filename" in /home/joe must put ' ' in code, see the picture

圖片

check the python document file in Linux (opensuse 11.3)

圖片
                                                              in the help(re),you can use /compile to search the "compile",and then enter q to quit

head first python, chapter 7 the webapp for python3 path in windows7

圖片

import re module and use it

圖片
                                               in the book beginning python(apress 2008) page 246, you should import re first and just can use it.

shell script expr

圖片

linux copy指令範例:從user copy "s1.sh"檔 到root下 linux copy command example: in opensuse 11.3 linux ,copy this "s1.sh" from user to root

圖片

python 在ubuntu 和opensuse import的路徑例子 python in ubuntu and opensuse import path example

圖片
ubuntu 11.04                                                                                                            opensuse 11.3