【技术性】OO语言知识

持续更新。
--------------------C++篇------------------------分布式

  1. 分布计算提升效率的库及库函数,好比FB的folly库就有folly::gen一大堆函数,e.g.
auto results = from(ids) | get<0>() | as<vector>();

本质上和e.g.Pyspark的分布式计算的底层思想是一致的。函数

--------------------Python篇-----------------------spa

  1. Python特别适用于搭data pipeline,好比FB的Dataswarm repo(用于run hive&presto tasks)和在Zillow用的Pyspark,其实根本上都是用了Python的脚本特性,串联起tasks来。
  2. dict的4种常见操做
    增:d['key1'] = 4
    删:d.pop('key1')
    找key:if 'key1' in d
    get值:d.get('key1')
  3. subprocess:
    Popen, e.g.rest

    process = Popen(['cat', 'test.py'], stdout=PIPE, stderr=PIPE)

    至关于执行了cat test.py这个命令
    而后能够用communicate函数来read,e.g. stdout, stderr = process.communicate(); print stdoutcode

  4. yield & generators
    e.g.ip

    def foo():
        for i in range(0,100):
            yield i*i
    generator = foo()
    for i in generator:
        print(i)
  5. eee
相关文章
相关标签/搜索