Algorithm: Practical Set Reconciliation

《Practical Set Reconciliation》
Yaron Minsky Cornell University
Ari Trachtenberg Boston University

def set_reconcile(src_seq, dst_seq):
    "Return required operations to mutate src_seq into dst_seq"
    src_set= set(src_seq) # no-op if already of type set
    dst_set= set(dst_seq) # ditto

    for item in src_set - dst_set:
        yield 'delete', item

    for item in dst_set - src_set:
        yield 'create', item

for i in set_reconcile([1,2,3,4], [2,3,4,5]):
    print i

$ python 
('delete', 1)
('create', 5)

[转发] 招聘 | 40K – 60K 招资深架构师、资深软件工程师

2017-05-11 CSDN企业招聘


涛思数据(TAOS Data)专注实时大数据的高效采集、存储、查询和分析。其自主开发的核心引擎写入数据的速度比普通数据库快五倍以上,查询速度快十倍以上。技术能广泛运用于物联网和金融行业,能大幅提升大数据系统的性能和容量,并降低运营成本。


Continue reading “[转发] 招聘 | 40K – 60K 招资深架构师、资深软件工程师”

(Python Author) Guido van Rossum on finding his way

Guido van Rossum is the creator and benevolent dictator for life (a.k.a. BDFL) of the Python programming language. Here he reflects on his path and shares what he’s been working on since joining Dropbox. Read on for this and a hint at what’s next for Dropbox, for Python, and for the BDFL himself.

You were an electronics hobbyist before becoming a programmer. How did you get started in electronics?

Okay, we’re going waaaay back. I don’t know exactly why I got into electronics as a kid. I remember that from the last grade in elementary school and probably through my second year in university, electronics kits and my own designs were one of my big passions.

It wasn’t always an easy path. In elementary school, I took one of the first projects I built into class as a show and tell project. There was no one who understood what it was or why it was interesting or cared. It’s a very vague memory. I just know that I took it in, and it fell flat.

Was there a time when you eventually found your people?

In high school, I hung out with a few other guys who had similar hobbies. We were all the geekiest kids in class.

I remember our physics teacher really encouraging us. The three of us worked together to build a large electronic device that was then used in demonstrations in front of the classroom. That was very satisfying.

Throughout high school, I had a very vague idea of what kinds of careers would be open to me. My general idea was that I was good at both sciences and languages and not so good in social areas. I ended up choosing mathematics.

How did you go from electronics to programming? Continue reading “(Python Author) Guido van Rossum on finding his way”



step用来移动对象,默认移动猴子。 “turtle.step 10” 用来移动乌龟10步。
turn 用于转动方向,”turn left”:向左移动90度,”turn -90″: 顺时针移动90度,“turnTo bridge”:移动到bridge所在方向。
3.times -> 实现循环


Screenshot from 2014-08-01 17:56:27 Screenshot from 2014-08-01 17:40:28 Screenshot from 2014-08-01 17:33:19