原创 tail recursion

traditional recursion: perform recursion first, then take the return value of the recursive call and calculate t

原创 stack overflow[part2]

Target program: // vulnerable.c #include <stdio.h> #include <stdlib.h> int main(int argc, char *argv[]) { cha

原创 python state of nested function

def maker(N): def action(X): return X ** N return action # nonlocal def maker1(N): state = 1

原创 python descriptor

reference: https://docs.python.org/3/howto/descriptor.html http://www.cs.utexas.edu/~cannata/cs345/Class%20Notes/15%2

原创 python descriptor

reference: https://docs.python.org/3/howto/descriptor.html http://www.cs.utexas.edu/~cannata/cs345/Class%20Notes/15%2

原创 python descriptor

reference: https://docs.python.org/3/howto/descriptor.html http://www.cs.utexas.edu/~cannata/cs345/Class%20Notes/15%2

原创 python descriptor

reference: https://docs.python.org/3/howto/descriptor.html http://www.cs.utexas.edu/~cannata/cs345/Class%20Notes/15%2

原创 python descriptor

reference: https://docs.python.org/3/howto/descriptor.html http://www.cs.utexas.edu/~cannata/cs345/Class%20Notes/15%2

原创 python learning notes

PART I in new-style class, implicit attribute fetch starts at class instead of instance. X[I] is equivalent to X.__ge

原创 [python] co_lnotab

co_lnotab is the mapping from bytecode to code line number. # python3.6 Python 3.6.5 (default, Apr 16 2018, 16:19:06)

原创 [python] closure

closure is often used as function factory, one example being: >>> def maker(N): ... def action(X): ...

原创 [python] decorator implemented with class to wrap class method

# python2 Python 2.7.5 (default, Dec 8 2017, 16:39:59) [GCC 4.8.5 20150623 (Red Hat 4.8.5-25)] on linux2 Type "help",

原创 [python] __get__ of descriptor

class Property: def __init__(self, fget=None, fset=None, fdel=None, doc=None): self.fget = fget sel

原创 learning avocado [simple test]

use avocado list to get tests list. # avocado list Error running method "configure" of plugin "vt": argument --vt-co

原创 execution of Linux commands in Python.

1. os.system out = os.system(command_to_use) This is implemented by calling the Standard C function system(), and has t