05 2018 档案
摘要:一,进程控制 1)getpid,getppid——获取进程识别号 #include <sys/types.h> #include <unistd.h> pid_t getpid(void); 获取进程标识号。这可以作为一个独一无二的临时文件名。 pid_t getppid(void); 获取父进程标
阅读全文
摘要:Linux系统内核设置优化tcp网络,# vi /etc/sysctl.conf,添加以下内容 net.ipv4.tcp_syncookies = 1 表示开启SYN Cookies。当出现SYN等待队列溢出时,启用cookies来处理,可防范少量SYN攻击,默认为0,表示关闭; net.ipv4.
阅读全文
摘要:Python版 https://github.com/faif/python-patterns/blob/master/other/hsm/hsm.py """ Implementation of the HSM (hierarchical state machine) or NFSM (neste
阅读全文
摘要:Python版 https://github.com/faif/python-patterns/blob/master/other/graph_search.py #!/usr/bin/env python # -*- coding: utf-8 -*- "" class GraphSearch:
阅读全文
摘要:Python版 https://github.com/faif/python-patterns/blob/master/other/blackboard.py #!/usr/bin/env python # -*- coding: utf-8 -*- """ @author: Eugene Dubo
阅读全文
摘要:Python版 https://github.com/faif/python-patterns/blob/master/fundamental/delegation_pattern.py #!/usr/bin/env python # -*- coding: utf-8 -*- """ Refere
阅读全文
摘要:Python版 https://github.com/faif/python-patterns/blob/master/dft/setter_injection.py #!/usr/bin/python # -*- coding : utf-8 -*- import datetime """ Por
阅读全文
摘要:Python版 https://github.com/faif/python-patterns/blob/master/behavioral/visitor.py #!/usr/bin/env python # -*- coding: utf-8 -*- """ http://peter-hoffm
阅读全文
摘要:Python转载版 https://github.com/faif/python-patterns/blob/master/behavioral/template.py #!/usr/bin/env python # -*- coding: utf-8 -*- """ http://ginstrom
阅读全文
摘要:Python版 https://github.com/faif/python-patterns/blob/master/behavioral/state.py #!/usr/bin/env python # -*- coding: utf-8 -*- """ Implementation of th
阅读全文
摘要:Python版 https://github.com/faif/python-patterns/blob/master/behavioral/specification.py #!/usr/bin/env python # -*- coding: utf-8 -*- """ @author: Gor
阅读全文
摘要:Python版 https://github.com/faif/python-patterns/blob/master/behavioral/registry.py #!/usr/bin/env python # -*- coding: utf-8 -*- class RegistryHolder(
阅读全文
摘要:Python版 https://github.com/faif/python-patterns/blob/master/behavioral/publish_subscribe.py #!/usr/bin/env python # -*- coding: utf-8 -*- """ Referenc
阅读全文
摘要:Python转载版 https://github.com/faif/python-patterns/blob/master/behavioral/observer.py #!/usr/bin/env python # -*- coding: utf-8 -*- """ http://code.act
阅读全文
摘要:Python版 https://github.com/faif/python-patterns/blob/master/behavioral/memento.py #!/usr/bin/env python # -*- coding: utf-8 -*- """ http://code.active
阅读全文
摘要:Python版 https://github.com/faif/python-patterns/blob/master/behavioral/mediator.py #!/usr/bin/env python # -*- coding: utf-8 -*- """ http://web.archiv
阅读全文
摘要:Python版 https://github.com/faif/python-patterns/blob/master/behavioral/iterator.py #!/usr/bin/env python # -*- coding: utf-8 -*- """ http://ginstrom.c
阅读全文
摘要:Python版 https://github.com/faif/python-patterns/blob/master/behavioral/command.py #!/usr/bin/env python # -*- coding: utf-8 -*- """ *TL;DR80 Encapsula
阅读全文
摘要:Python版 https://github.com/faif/python-patterns/blob/master/behavioral/chaining_method.py #!/usr/bin/env python # -*- coding: utf-8 -*- from __future_
阅读全文
摘要:Python版 https://github.com/faif/python-patterns/blob/master/behavioral/catalog.py #!/usr/bin/env python # -*- coding: utf-8 -*- """ A class that uses
阅读全文
摘要:Python版 https://github.com/faif/python-patterns/blob/master/behavioral/chain.py #!/usr/bin/env python # -*- coding: utf-8 -*- """ http://www.dabeaz.co
阅读全文
摘要:Python版 https://github.com/faif/python-patterns/blob/master/structural/proxy.py #!/usr/bin/env python # -*- coding: utf-8 -*- """ *TL;DR80 Provides an
阅读全文
摘要:Python版 https://github.com/faif/python-patterns/blob/master/structural/mvc.py #!/usr/bin/env python # -*- coding: utf-8 -*- """ *TL;DR80 Separates dat
阅读全文
摘要:Python版 https://github.com/faif/python-patterns/blob/master/structural/front_controller.py #!/usr/bin/env python # -*- coding: utf-8 -*- """ @author:
阅读全文
摘要:Python版 https://github.com/faif/python-patterns/blob/master/structural/flyweight.py #!/usr/bin/env python # -*- coding: utf-8 -*- """ *References: htt
阅读全文
摘要:Python版 https://github.com/faif/python-patterns/blob/master/structural/facade.py #!/usr/bin/env python # -*- coding: utf-8 -*- """ *What is this patte
阅读全文
摘要:Python版 https://github.com/faif/python-patterns/blob/master/structural/decorator.py #!/usr/bin/env python # -*- coding: utf-8 -*- """ *What is this pa
阅读全文
摘要:Python版 https://github.com/faif/python-patterns/blob/master/structural/composite.py #!/usr/bin/env python # -*- coding: utf-8 -*- """ *What is this pa
阅读全文
摘要:Python版 https://github.com/faif/python-patterns/blob/master/structural/bridge.py #!/usr/bin/env python # -*- coding: utf-8 -*- """ *References: http:/
阅读全文
摘要:Python版 https://github.com/faif/python-patterns/blob/master/structural/adapter.py #!/usr/bin/env python # -*- coding: utf-8 -*- """ *What is this patt
阅读全文
摘要:Pyhon版 https://github.com/faif/python-patterns/blob/master/structural/3-tier.py #!/usr/bin/env python # -*- coding: utf-8 -*- """ *TL;DR80 Separates p
阅读全文
摘要:Python版 https://github.com/faif/python-patterns/blob/master/creational/prototype.py #!/usr/bin/env python # -*- coding: utf-8 -*- """ *TL;DR80 Creates
阅读全文
摘要:Python版 https://github.com/faif/python-patterns/blob/master/creational/pool.py #!/usr/bin/env python # -*- coding: utf-8 -*- """ *What is this pattern
阅读全文
摘要:Python版 https://github.com/faif/python-patterns/blob/master/creational/lazy_evaluation.py #!/usr/bin/env python # -*- coding: utf-8 -*- """ Lazily-eva
阅读全文
摘要:Python版 https://github.com/faif/python-patterns/blob/master/creational/borg.py #!/usr/bin/env python # -*- coding: utf-8 -*- """ *What is this pattern
阅读全文
摘要:Python版 https://github.com/faif/python-patterns/blob/master/creational/abstract_factory.py #!/usr/bin/env python # -*- coding: utf-8 -*- """ *What is
阅读全文
摘要:Python版 https://github.com/faif/python-patterns/blob/master/creational/builder.py #!/usr/bin/python # -*- coding : utf-8 -*- """ *What is this pattern
阅读全文
摘要:Python版 转自https://github.com/faif/python-patterns/blob/master/behavioral/strategy.py #!/usr/bin/env python # -*- coding: utf-8 -*- """ http://stackove
阅读全文
摘要:Python版 https://github.com/faif/python-patterns/blob/master/creational/factory_method.py #!/usr/bin/env python # -*- coding: utf-8 -*- """*What is thi
阅读全文
浙公网安备 33010602011771号