(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Ant sim ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | |
; Copyright (c) Rich Hickey. All rights reserved. | |
; The use and distribution terms for this software are covered by the | |
; Common Public License 1.0 (http://opensource.org/licenses/cpl.php) | |
; which can be found in the file CPL.TXT at the root of this distribution. | |
; By using this software in any fashion, you are agreeing to be bound by | |
; the terms of this license. | |
; You must not remove this notice, or any other, from this software. | |
;dimensions of square world |
{-# LANGUAGE BangPatterns, ScopedTypeVariables #-} | |
-- Stuff taken from the RSA module for now | |
module Primes where | |
import Data.Bits | |
import Data.Int | |
import Data.Word | |
import Data.ByteString.Lazy (ByteString) |
/*************************************************** | |
* Simple and elegant, no code complexity | |
* Disadvantages: Requires warming all data into server memory (could take a long time for MBs of data or millions of records) | |
* (This disadvantage should go away as we add optimizations to the core product) | |
***************************************************/ | |
var fb = firebase.database.ref(); | |
/** | |
* @param {string} emailAddress |
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
/* | |
This file is a brief example of how to use angularfire to authenticate a user, save that user's public profile to firebase, then | |
ensure that both the authenticated and public user are available in your controllers. | |
The route configuration uses angular-ui-router: https://github.com/angular-ui/ui-router | |
*/ | |
/* | |
******************************************************************************** | |
Golang - Asterisk and Ampersand Cheatsheet | |
******************************************************************************** | |
Also available at: https://play.golang.org/p/lNpnS9j1ma | |
Allowed: | |
-------- | |
p := Person{"Steve", 28} stores the value |
function *fibonacci(n) { | |
const infinite = !n && n !== 0; | |
let current = 0; | |
let next = 1; | |
while (infinite || n--) { | |
yield current; | |
[current, next] = [next, current + next]; | |
} | |
} |
var Promise = require('bluebird'); | |
var funcs = Promise.resolve([500, 100, 400, 200].map((n) => makeWait(n))); | |
funcs | |
.each(iterator) // logs: 500, 100, 400, 200 | |
.then(console.log) // logs: [ [Function], [Function], [Function], [Function] ] | |
funcs | |
.mapSeries(iterator) // logs: 500, 100, 400, 200 |
The idea to use the global financial network of daily transactions, and to link these transactions together into a web, is a bit similar to Tim Berners Lee's idea to link all documents on the internet together with the Hypertext Transfer Protocol (HTTP), which gave us the world wide web. When Tim Berners Lee had the idea for the world wide web in the 80s, there were already documents on the internet. He did not have to invent the internet, and his contribution was instead that he saw a way to harness the information on the internet in a new way.
The same goes for the Resilience protocol. The world is electrified with millions, or billions, of financial transactions happening every single day. The global financial network is part of our infrastructure already. What Resilience aims to
-- | Fold over the input, folding left or right depending on the element. | |
origami :: (s -> l -> s) -> (r -> s -> s) -> s -> [Either l r] -> s | |
origami _ _ nil [] = nil | |
origami fl fr nil (x:xs) = | |
case x of | |
Left l -> origami fl fr (fl nil l) xs | |
Right r -> fr r (origami fl fr nil xs) |