由於最近在網路上找了許多的資料 每個資料都說得不清不楚不然就是很長一大串
下面給一個絕對能跑的範例 .java 檔 有問題可以提出來 並且關鍵點會用紅色標示
IDE: Eclispse
使用方法: 開啟你的IDE(這邊使用Eclipse) , 新增一個project> 在src 新增一個class > 把文章底下
////代碼開始//// 到 ////代碼結束//// 中間的code 全部 "複製貼上"! 就可以執行了 然後再慢慢trace 各代碼的意義 寫得滿簡陋的了 有問題可以留言唷
簡介: 代碼分為三個部分 主要的Main 框架 還有自訂義的Dialog 最後是 自訂義Class
2013年9月4日 星期三
2013年9月3日 星期二
2013年1月28日 星期一
在python 中 使用mongoDB 像mysql 一樣取出陣列資料
最近遇到的問題, python 中直接直接使用mysql querry 出來的資料可以用陣列的方式取得, 那 mongo呢?
直接來看代碼
...
...
...
accounts = accounts.find_one({'username':'axdc11239@yahoo.com.hk'})
print accounts
print list(accounts)
print list(accounts)[0]
直接來看代碼
...
...
...
accounts = accounts.find_one({'username':'axdc11239@yahoo.com.hk'})
print accounts
print list(accounts)
print list(accounts)[0]
2013年1月27日 星期日
在python中把string當成object.name
因為最近有需要用到,碰巧看到人家python有出現這樣的代碼 getattr(... , ...)
http://blog.csdn.net/wzm112/article/details/6444668
http://blog.csdn.net/wzm112/article/details/6444668
- def query():
- conn = Connection('127.0.0.1',27017)
- db = getattr(conn,'dbname')
- coll = getattr(db,'collname')
- #使用正则查询
- import re
- q = rs.compile(r'add') #完成正则 r'.*' ,r'[a-z]+'
- rst = coll.find({'field' : { '$regex' : q } })
- print rst.count() #打印查询结果
- #查询方式2
- rst = coll.find({'field' : { '$regex' : r '[a-z]+'} })
- print rst.count()
2012年7月14日 星期六
[Asterisk] AMI ,Asterisk manager Interface ,如何從外網,內網連接AMI的端口呢?
Server環境: Asterisk 1.8 架設在一個 中華電信租來的小server上
測試電腦環境: Win 7 64bit ,浮動IP
使用軟體:Putty
SoftPhone: LinPhone 3.5.2 此為安裝在電腦上的
另外一個測試機台為手機: HTC ONE X 安裝軟體一樣為 Playstore 提供之 Linphone Android
以下為,設置AMI 與 使用"遠端"電腦console連上server之AMI並對asterisk下command使得電腦端的linphone與手機端的linphone可以互通之文章
測試電腦環境: Win 7 64bit ,浮動IP
使用軟體:Putty
SoftPhone: LinPhone 3.5.2 此為安裝在電腦上的
另外一個測試機台為手機: HTC ONE X 安裝軟體一樣為 Playstore 提供之 Linphone Android
以下為,設置AMI 與 使用"遠端"電腦console連上server之AMI並對asterisk下command使得電腦端的linphone與手機端的linphone可以互通之文章
2012年7月8日 星期日
2012年7月5日 星期四
訂閱:
文章 (Atom)