[Forward][python]How do I pass a variable by reference?

    http://stackoverflow.com/questions/986006/python-how-do-i-pass-a-variable-by-reference Question The Python documentation seems unclear about whether parameters are passed by reference or value, and the following code produces the unchanged value ‘Original’ class PassByReference:     def __init__(self):         self.variable = 'Original'         sel...阅读全文
    作者:bettermanlu | 分类:python | 阅读: |

    [python]time.clock vs time.time

    Recently I need to calculate the time cost for some test cases running on Linux.  After searching online, I got an answer: using time.clock or time.time. And I did a sample test on Windows with time.clock which works well. But when running it under Linux. The result is totally different. My code as below which is quite simple by calling time.clock or time.time...阅读全文
    作者:bettermanlu | 分类:python | 阅读: |

    [FW]Software Testing to Software Engineering

    Software Testing to Software Engineering Full article is here: http://www.logigear.com/september-issue-2011/1110-vipul-gupta.html 读后感 当前离岸软件测试的变化:不再是之前的简单执行测试用例,而是要尽可能早的投入到软件的各个生命周期中,对测试软件做更深入的分析,使用更多的测试工具/平台及不同的测试策略(有哪些策略呢?),进行有针对的、多维度(功能,性能,安全等)...阅读全文
    作者:bettermanlu | 分类:software testing | 阅读: |

    [python]How to implement Singleton in Python

    Unlike other OOP language, such as C++/Java, which provides private access mechanism to prevent its constructor be accessed and then be instanced, Python doesn’t have such mechanism, i.e, “Private” instance variables that cannot be accessed except from inside an object don’t exist in Python. So how to implement Singleton in Python without “Private&...阅读全文
    作者:bettermanlu | 分类:python | 阅读: |

    [python]datetime tip

    Below code is to get the current date and the following one month date, then covert them to a string. =====mydate.py===== import datetime today = datetime.datetime.now() nextMonth = today + datetime.timedelta( days=30 ) startDate = today.strftime(“%Y-%m-%d”) endDate = nextMonth.strftime(“%Y-%m-%d”) print startDate, endDate.   阅读全文
    作者:bettermanlu | 分类:python | 阅读: |

    [php]How to print SOAP requests/response?

    If you are working with PHP’s SOAPClient, and need to print out SOAP requests/response,  below is the simple way. 1. Enable SOAP trace option. client = SOAPClient(“www.xxx.com/soap?wsdl”, array(‘trace’ => 1) ); 2. Then calls …. client.__soapCall(xxx) … echo “REQUEST: “. htmlentities(client.__getLastReque...阅读全文
    作者:bettermanlu | 分类:php | 阅读: |

    [http]HTTP GET and POST with Python

    There are several modules provided by python you can use to send HTTP GET/POST requests: httplib/urllib/urllib2. In general, httplib module defines classes which implement the client side of the HTTP and HTTPS protocols.  It is normally not used directly — the module urllib uses it to handle URLs that use HTTP and HTTPS. urllib module provides a high-lev...阅读全文
    作者:bettermanlu | 分类:HTTP, python | 阅读: |

    [python] third-party python packages

    Today I’d like share several third-party python packages. 1. Py2Exe http://www.py2exe.org/ py2exe converts Python scripts into executable Windows programs, able to run without requiring a Python installation. The usage is quite simple, please refer to http://www.py2exe.org/index.cgi/Tutorial. 2.PyWin32 http://sourceforge.net/projects/pywin32/ Win32 API W...阅读全文
    作者:bettermanlu | 分类:python | 阅读: |

    Static Linking and Dynamic Linking

    Recently I was stucked by a question as what a “.LIB” file is for.  Two concepts  came into my mind, “static linking” and “dynamic linking”.  Is “.LIB” file for static linking? But I remembered that one type of dynamic linking also requires a “.LIB” file.  Are the two “.LIB” files the same...阅读全文
    作者:bettermanlu | 分类:Link, windows internals | 阅读: | 标签:,