Skip to content

Instantly share code, notes, and snippets.

View jiangplus's full-sized avatar

jiangplus jiangplus

View GitHub Profile
var values = {
friction: 0.8,
timeStep: 0.01,
amount: 15,
mass: 2,
count: 0
};
values.invMass = 1 / values.mass;

The introduction to Reactive Programming you've been missing

(by @andrestaltz)

So you're curious in learning this new thing called (Functional) Reactive Programming (FRP).

Learning it is hard, even harder by the lack of good material. When I started, I tried looking for tutorials. I found only a handful of practical guides, but they just scratched the surface and never tackled the challenge of building the whole architecture around it. Library documentations often don't help when you're trying to understand some function. I mean, honestly, look at this:

Rx.Observable.prototype.flatMapLatest(selector, [thisArg])

Projects each element of an observable sequence into a new sequence of observable sequences by incorporating the element's index and then transforms an observable sequence of observable sequences into an observable sequence producing values only from the most recent observable sequence.

@jiangplus
jiangplus / introrx.md
Last active August 29, 2015 14:06 — forked from staltz/introrx.md

The introduction to Reactive Programming you've been missing

(by @andrestaltz)

So you're curious in learning this new thing called (Functional) Reactive Programming (FRP).

Learning it is hard, even harder by the lack of good material. When I started, I tried looking for tutorials. I found only a handful of practical guides, but they just scratched the surface and never tackled the challenge of building the whole architecture around it. Library documentations often don't help when you're trying to understand some function. I mean, honestly, look at this:

Rx.Observable.prototype.flatMapLatest(selector, [thisArg])

Projects each element of an observable sequence into a new sequence of observable sequences by incorporating the element's index and then transforms an observable sequence of observable sequences into an observable sequence producing values only from the most recent observable sequence.

@jiangplus
jiangplus / population_dynamics.rb
Created April 19, 2015 09:21
population_dynamics
# testing the 'rand' function
# sum = 0
# 10000.times {
# sum += rand(2)
# }
# puts sum
list = []
100000.times do
family = []

这是根据 @mafintoshbitcoin-for-laypeople 翻译的一份比特币工作原理简介,起源是他写给父亲解释比特币的文章,最早的丹麦语版可以在这里看到。

比特币是没有中央权威的数字货币。这是一种你不必依靠任何人知道这它具有相应价值的货币。概念上,它类似于黄金,黄金本身就有价值。相反对于美元,如果说美国政府说它有价值,那么它就是有价值的。而比特币的意义是他们的价值在于自身。

让我们试着了解比特币是如何工作的。

比特币或多或少地是一个全球性的计算机网络,它不断努力就交易列表达成一致。

例如,一笔交易就是“马蒂亚斯将100比特币转给马丁”,就像正规银行在内部工作一样。