Skip to content

Instantly share code, notes, and snippets.

Introduction

This gist started with a collection of resources I was maintaining on stream data processing — also known as distributed logs, data pipelines, event sourcing, CQRS, and other names.

Over time the set of resources grew quite large and I received some interest in a more guided, opinionated path for learning about stream data processing. So I added the reading list.

Please send me feedback!

用python写一个将中缀表达式转换为逆波兰表达式的程序,并用unittest模块为它配上单元测试
## Notes:
## Version 1: I submitted solution failed last time. And copied my local code again into this box. (Called Huang Xiaomao already. :-))
## Version 2: Add code to handle operators * and /, which with high priority.
## Version 3: Add code to handle parentheses. (Test Failed)
## Version 4: Fix test failure about handling parentheses, add test case. (Failed to submit code agian, so copied the local code. )
## Version 5: #TODO: Do refactor about logic, and code paths. (Too busy on current working staff, will not do this any more. :-))
#!/usr/bin/python
@alexband
alexband / pr.md
Created January 21, 2013 23:46 — forked from piscisaureus/pr.md

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url = git@github.com:joyent/node.git

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:

@alexband
alexband / jobs.py
Created December 18, 2012 01:43
test gist
f = open('jobs.txt', 'r')
num = int(f.readline().strip())
jobs = []
for l in f:
l = l.strip().split()
jobs.append((long(l[0]), long(l[1])))
jobs.sort(key=lambda x:x[0])
def keyfun1(a, b):
val1 = a[0] - a[1]