Edmund 程式設計歷程
此網誌為Edmund程設學習歷程,Code多為網路上與書本轉載而來,如有犯法請告知,必立馬刪除.
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]
閱讀更多 »
2013年1月27日 星期日
在python中把string當成object.name
因為最近有需要用到,碰巧看到人家python有出現這樣的代碼 getattr(... , ...)
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可以互通之文章
閱讀更多 »
2012年7月8日 星期日
如何用Eclipse寫C/C++呢? (CDT的使用)
Eclispe 版本為
Eclipse Classic 4.2
, 182 MB
Windows 7 64 bit
閱讀更多 »
2012年7月5日 星期四
JNI 相關
http://changyy.pixnet.net/blog/post/29437517
教學筆記
http://developer.android.com/tools/sdk/ndk/index.html
android NDK
2012年6月15日 星期五
[Android]介面美化資料
Spinner
http://w2davids.wordpress.com/
2010/09/28/advanced-android-
ui-wheelpicker/
http://code.google.com/p/
android-wheel/
ListView
http://blogingtutorials.
blogspot.tw/2010/12/iphone-
uitable-view-in-android.html
http://www.cnblogs.com/
qianxudetianxia/archive/2011/
09/19/2068760.html
Button
http://pervasivecode.blogspot.
tw/2011/02/iphone-style-
buttons-for-android_3268.html
2012年4月6日 星期五
[TCP/IP HW2] C++ 實作 Ping功能
TCP/IP 第二次作業,實作一個program可以ping某台server
OS:Win 7
Compiler:VC++2010
閱讀更多 »
較新的文章
較舊的文章
首頁
訂閱:
意見 (Atom)