最近想練習C++ 所以找了 http://luckycat.kshs.kh.edu.tw/ 此網站的題目來練習
寫出來的解法應該不完美 僅供參考
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日 星期四
2012年6月15日 星期五
訂閱:
文章 (Atom)