覺知悟行 斷離捨
抱一守中 常清靜
生活中的點點事
2018年4月18日 星期三
2013年12月31日 星期二
開放硬體
Arduino - 單晶片/ARM Yun
http://learn.adafruit.com/category/learn-arduino
Raspberry Pi -ARM 32 bit chip
http://life-of-raspberrypi.blogspot.tw/p/blog-page.html
Parallella - Supercomupter parallel computing
2013年7月14日 星期日
2013年1月16日 星期三
TCPIP LISTNER+pathsend in C solution
TCPIP LISTNER+pathsend in C solution
https://docs.google.com/document/d/1CRfRC-_mepvoy8-72ewIrJpgqq3W3gkgRXDAbrD8pJ4/pub
https://docs.google.com/document/d/1CRfRC-_mepvoy8-72ewIrJpgqq3W3gkgRXDAbrD8pJ4/pub
2012年12月14日 星期五
Python 執行檔產生方式
之前使用過py2exe 去產生 python 程式的 單一執行檔(click here),後來我安裝了pythonxy 去開發GUI 程式,我程式有用到 Enthought 的Traits UI/Traits 套件,雖然開發GUI 程式很快,我也從中學到MVC 的概念,不過我想要用 py2exe 去產生有引用 Traits UI/Traits 的執行檔時,一直無法成功,enthought 也回答我的疑問,我是有看沒有懂,所以只好去另找方法後來,
到 用Python 科學計算中文版 問了作者,他介紹與教我 用 bbfreeze 去產生執行檔,這個bbfreeze 產生的東西,應該算是建立一個環境給你寫的程式執行,所以會產生一個很大的Folder,不過可以用就好。
以下介紹方法:
1.bbfreeze 的setup 寫法:
#This script is for bbfreeze
#It generate execute file.
#Usage : python setup.py
from bbfreeze import Freezer
f = Freezer("Base64gui-1.0")
f.addScript("base64gui.py",gui_only=True)
f() # starts the freezing process
2.py2exe 要引用pyqt4 的setup 寫法:
#This script is for py2exe module
#It generate execute file.
#Usage : python setup.py py2exe
from distutils.core import setup
import py2exe
setup(windows=[{"script" : "d:/base64gui/py2exe/findandreplacedlg.py"}], options={"py2exe" : {"includes" : ["sip", "PyQt4"]}})
-----2012/12/14 update --------
另一個 產生 stand-alone executables 工具- PyInstaller (我測試的OS 是 windows xp)
要先裝 pywin32,使用方法
python pyinstaller.py yourpgm.py
它會產生 yourpgm folder,理面有個 dist 目錄 ,就會找到 yourpgm.exe 檔
到 用Python 科學計算中文版 問了作者,他介紹與教我 用 bbfreeze 去產生執行檔,這個bbfreeze 產生的東西,應該算是建立一個環境給你寫的程式執行,所以會產生一個很大的Folder,不過可以用就好。
以下介紹方法:
1.bbfreeze 的setup 寫法:
#This script is for bbfreeze
#It generate execute file.
#Usage : python setup.py
from bbfreeze import Freezer
f = Freezer("Base64gui-1.0")
f.addScript("base64gui.py",gui_only=True)
f() # starts the freezing process
2.py2exe 要引用pyqt4 的setup 寫法:
#This script is for py2exe module
#It generate execute file.
#Usage : python setup.py py2exe
from distutils.core import setup
import py2exe
setup(windows=[{"script" : "d:/base64gui/py2exe/findandreplacedlg.py"}], options={"py2exe" : {"includes" : ["sip", "PyQt4"]}})
-----2012/12/14 update --------
另一個 產生 stand-alone executables 工具- PyInstaller (我測試的OS 是 windows xp)
要先裝 pywin32,使用方法
python pyinstaller.py yourpgm.py
它會產生 yourpgm folder,理面有個 dist 目錄 ,就會找到 yourpgm.exe 檔
2012年12月11日 星期二
2012年11月22日 星期四
HTTP Server ,socketserver,Acess enscribe file.
1.Python 提供 HTTP server,socketserver for http server and tcpip server.
2.Nonstop server 可以執行 ptyhon HTTP server.
Usage : python -m SimpleHTTPServer 8000
Note : -m : module , port number:8000
執行後, open web browser , "http://192.168.110.93:8000/ ,可以看到 Nonstop 的目錄
3.Python 可以 I/O Nonstop Guardian file.
READ Enscribe file (code 101,180) 沒問題
Write file ,File code 是 180 (ASCII C edit file).
可以使用 CTOEDIT 轉成 code 100. Usage: CTOEDIT C-file,EDIT-file.
同理, Edit file(Code 100) 也可以轉成 Code 180.Usage:EDITTOC Edit-file,C-file.
2.Nonstop server 可以執行 ptyhon HTTP server.
Usage : python -m SimpleHTTPServer 8000
Note : -m : module , port number:8000
執行後, open web browser , "http://192.168.110.93:8000/ ,可以看到 Nonstop 的目錄
3.Python 可以 I/O Nonstop Guardian file.
READ Enscribe file (code 101,180) 沒問題
Write file ,File code 是 180 (ASCII C edit file).
可以使用 CTOEDIT 轉成 code 100. Usage: CTOEDIT C-file,EDIT-file.
同理, Edit file(Code 100) 也可以轉成 Code 180.Usage:EDITTOC Edit-file,C-file.
2012年6月4日 星期一
97~ 99年綜所納稅額及稅率級距-稅收分擔
資料來源:財政部財稅資料中心
聲明:本項統計資料來源為各年度最新綜合所得稅申報核定資料,不含分離課稅、免稅及非課稅所得,本統計表不宜作為貧富差距之比較;相關數據以行政院主計總處公布資料為準。
可以看看中華民國綜所稅,各級距繳稅的百分比,順便打某財政立委的臉
2012年4月30日 星期一
分期付款公式
利息 = amt *r *[n/n+ (n-1/n)+ (n-2/n)+ …. + (2/n)+(1/n)]
= amt*r*1/n [n+(n-1)+(n-2)+....+2+1]
= amt*r*1/n *(nx(n+1)/2)
= amtr{[n(n+1)2]/n}
利息 = amt *r *[n/n+ (n-1/n)+ (n-2/n)+ …. + (2/n)+(1/n)]
= amt*r*1/n [n+(n-1)+(n-2)+....+2+1]
= amt*r*1/n *(nx(n+1)/2)
= amtr{[n(n+1)2]/n}
訂閱:
文章 (Atom)