3 ** 4 = 9
4 ** 3 = 9
where
x ** 2 = x
x // x = 2
Q = require 'q' | |
promisize = (fn, args... ) -> | |
promises = [] | |
getpromises = ( p ) -> | |
promises.push( p ) |
/* | |
uber simple ad hoc prototype inheritance | |
advantages: | |
- simple to use, construct inheritance on the fly or apply multiple inheritace | |
- perserve super methods with custom namespace | |
- flat prototype layer improves performance (no deep tree searches) | |
- prototyped methods save memory (even though each instance has it's own prototype object, each method is only defined once) |
A Stone Behemoth Gate costs [900 stone, 900 wood, and 900 thatch for the gateway][1] and [450 stone, 450 wood, and 450 thatch for the gate itself][2] for a total of 1350 stone, 1350 wood, and 1350 thatch. A Stone Behemoth Gate is [7 units wide and 12 units high][1] giving a total area of 84 wall units. Stone walls cost [40 stone, 20 wood, and 15 thatch][3]. Stone Walls must be placed on foundations. Stone Fence Foundations cost [15 stone, 10 wood, and 10 thatch][4]. So a 7 unit wide and 12 unit high section made from stone walls would cost 7 * (F + 12 * W)
where F
is the resources for the foundation and W
is the resources for the wall. This comes out to 3465 stone, 1750 wood, 1330 thatch for the same area of wall. The Behemoth Gate approach saves 2115 stone, 400 wood, and only cost 20 more thatch vs the normal wall approach. Therefore the Behemoth Gate is a more economical way to build a wall.
Not so fast...
0 # zero order identity element
N_1 = O -> N
I_1 = O -> I # first order identity element
N_2 = I_1 -> N_1
E_2 = I_1 -> E_1 # second order identity element
N_3 = E_2 -> N_2
#!/bin/bash | |
# make dummy certs | |
mkdir ssl/ | |
cd ssl/ | |
# CA key | |
openssl genrsa -passout pass:1111 -des3 -out ca.key 4096 | |
# CA cert | |
openssl req -passin pass:1111 -new -x509 -days 365 -key ca.key -out ca.crt -subj '/C=US/ST=Oregon/L=Portland/O=Test/OU=CertAuthority/CN=localhost' | |
# server key | |
openssl genrsa -passout pass:1111 -des3 -out server.key 4096 |
const _ = require('highland') | |
const JSONstream = require('JSONstream') | |
require('isomorphic-fetch') | |
const highlandFetch = require('highland-fetch') | |
Response.prototype.highland = highlandFetch.highlandResponse |
I hereby claim:
To claim this, I am signing this object:
const { | |
queryDatabaseSync, | |
httpGetSync, | |
writeFileSync, | |
queryDatabase, | |
httpGet, | |
writeFile | |
} = require('./mocks.js') | |
// synchronous: |