原创 Implement Deque with Python list
# Completed implementation of a deque ADT class Deque: def __init__(self): self.data = [] def is_empty
原创 使用OpenCover生成單元測試覆蓋率報告
在單元測試實踐中經常會需要查看代碼覆蓋率,大多生成單元測試覆蓋率的軟件都是收費的。 開源的Coverage Tool不多,OpenCover是一個不錯的選擇。 參考:http://stackoverflow.com/questions/2
原创 Python 裝飾器
原文鏈接:Python Decorator Python有一個有趣的特徵叫做裝飾器,可以向已存在的代碼添加功能。這也被稱作元編程(metaprogramming, 編寫操縱其它程序的程序,企圖在運行時完成部分本應在編譯時完成的工作) Re
原创 Python 編碼風格
原文:https://code.google.com/p/zhong-wiki/wiki/PEP8 Python 編碼風格指南 Horin|賀勤 Email: [email protected] Blog: http://blog.
原创 Implement stack with Pyhon list
class Stack: '''Implement a stack using list''' def __init__(self, L=[]): self.data = L def push(s
原创 列舉本地所有網絡的活動進程
任務: 列舉本機所有網絡活動的進程信息,包括協議類型、進程ID及其名稱、本地地址及對應端口、遠程地址及對應端口、當前連接狀態信息。 環境: Win7 + VC++2010 注:(1)本例程適用於Windows Vista / 7, VS2
原创 What does PEP stand for in Python
PEP stands for Python Enhancement Proposal. A PEP is a design document providing information to the Python community,
原创 牛頓法求根
轉載自: http://www.nowamagic.net/librarys/veda/detail/2268 牛頓迭代法(Newton's method)又稱爲牛頓-拉夫遜方法(Newton-Raphson method),它是牛頓
原创 Python 中的常見陷阱
原文:http://docs.python-guide.org/en/latest/writing/gotchas/ 大多數情況下,Python旨在寫出乾淨,一致的代碼,避免奇怪的做法。但是,對新手來說有時卻不是這樣。 可變的(Mutab
原创 目前見到的最Make Sense的Python Guide
Github上Python板塊排名第一的大神寫的: http://docs.python-guide.org/en/latest/
原创 爲什麼我在scrapy shell中沒有看到hxs和xxs
如題,其中一個可能的原因是使用的scrapy版本問題: 在0.16下: 參考:http://doc.scrapy.org/en/0.16/intro/tutorial.html scrapy shell http://www.dmoz.o
原创 Python 閉包
原文:http://www.programiz.com/python-programming/closure 一個函數定義在另一個函數內部叫做嵌套函數。嵌套的函數能夠訪問enclosing scope作用域的變量。在Python中,非局
原创 comparison of four ways to generating a list
from time import time def timeit(func): '''Use this decorator to measure execution time of a function. eg.
原创 Implement queue with Python list
# Completed implementation of a queue ADT class Queue: def __init__(self): self.data = [] def is_empty
原创 IIS32位,64位模式下切換
一、32位模式 1、cscript %systemdrive%\inetpub\adminscripts\adsutil.vbs set w3svc/appPools/enable32bitapponwin64 1 首先在命令提示符(CM