WengQiang's Blog

where there is a will, there is a way!

basic principle

  • SOLID >> S: single resposibility
    O: open-closed: open for extension, closed for modification
    simple shoud not go back to code/modify somthing haveing writtern adn tested L: liskov substitution
    if interface is ok to type A, it should also is ok to its inherited type B I: interface segregation
    D: dependency inversion
    high level module should not depend on low level; absraction should not depend on detail

factory method pattern

  1. Delegation of object creation to factory method
  2. Extensibility by permitting arbitrary many factory methods
  3. Code reuse through runtime polymorphism
  4. Decouple initialization of factories from creating connections
阅读全文 »

下载源码

  1. git clone https://github.com/llvm/llvm-project.git

编译

  1. config&compile
    see llvm GettingStarted
  • 可能缺少的库 sudo apt install swig libedit-dev libxml2-dev ocaml python-pygments python-yaml doxygen

centos 7(64) 系统

  1. 防火墙
  • 查看防火墙是否开启 firewall-cmd --state

  • 重载防火墙,使新规则生效 firewall-cmd --complete-reload

  • 查看打开的端口 firewall-cmd --list-ports

  • 启动&停止 防火墙 sytemctl start firewalld systemctl stop firewalld
    阅读全文 »

gerneral all

storage duration

  • automatic storage duration The storage for the object is allocated at the beginning of the enclosing code block and deallocated at the end. All local objects have this storage duration, except those declared static, extern or thread_local.

  • static storage duration The storage for the object is allocated when the program begins and deallocated when the program ends. Only one instance of the object exists. All objects declared at namespace scope (including global namespace) have this storage duration, plus those declared with static or extern.

  • thread_local storage duration The storage for the object is allocated when the thread begins and deallocated when the thread ends. Each thread has its own instance of the object. Only objects declared thread_local have this storage duration. thread_local can appear together with static or extern to adjust linkage.

  • dynamic storage duration The storage for the object is allocated and deallocated per request by using dynamic memory allocation functions.

阅读全文 »
0%