Jon Warbrick, July 2014, V3.2 (for Ansible 1.7)
First one found from of
package controllers | |
import java.nio.charset.StandardCharsets | |
import javax.crypto.Mac | |
import javax.crypto.spec.SecretKeySpec | |
import models.RegisterFacebook | |
import org.apache.commons.codec.binary.Hex | |
import play.api.Logger | |
import play.api.libs.concurrent.Execution.Implicits.defaultContext |
Jon Warbrick, July 2014, V3.2 (for Ansible 1.7)
First one found from of
# The following two commands remove any previously installed H2O packages for R. | |
if ("package:h2o" %in% search()) { detach("package:h2o", unload=TRUE) } | |
if ("h2o" %in% rownames(installed.packages())) { remove.packages("h2o") } | |
# Next, we download packages that H2O depends on. | |
if (! ("methods" %in% rownames(installed.packages()))) { install.packages("methods") } | |
if (! ("statmod" %in% rownames(installed.packages()))) { install.packages("statmod") } | |
if (! ("stats" %in% rownames(installed.packages()))) { install.packages("stats") } | |
if (! ("graphics" %in% rownames(installed.packages()))) { install.packages("graphics") } | |
if (! ("RCurl" %in% rownames(installed.packages()))) { install.packages("RCurl") } |
A primer/refresher on the category theory concepts that most commonly crop up in conversations about Scala or FP. (Because it's embarassing when I forget this stuff!)
I'll be assuming Scalaz imports in code samples, and some of the code may be pseudo-Scala.
A functor is something that supports map
.
/* | |
For any 1<k<=64, let mask=(1<<k)-1. hash_64() is a bijection on [0,1<<k), which means | |
hash_64(x, mask)==hash_64(y, mask) if and only if x==y. hash_64i() is the inversion of | |
hash_64(): hash_64i(hash_64(x, mask), mask) == hash_64(hash_64i(x, mask), mask) == x. | |
*/ | |
// Thomas Wang's integer hash functions. See <https://gist.github.com/lh3/59882d6b96166dfc3d8d> for a snapshot. | |
uint64_t hash_64(uint64_t key, uint64_t mask) | |
{ | |
key = (~key + (key << 21)) & mask; // key = (key << 21) - key - 1; |
#!/bin/sh | |
parse_yaml() { | |
local prefix=$2 | |
local s='[[:space:]]*' w='[a-zA-Z0-9_]*' fs=$(echo @|tr @ '\034') | |
sed -ne "s|^\($s\)\($w\)$s:$s\"\(.*\)\"$s\$|\1$fs\2$fs\3|p" \ | |
-e "s|^\($s\)\($w\)$s:$s\(.*\)$s\$|\1$fs\2$fs\3|p" $1 | | |
awk -F$fs '{ | |
indent = length($1)/2; | |
vname[indent] = $2; | |
for (i in vname) {if (i > indent) {delete vname[i]}} |
Why Should I Care (For Developers)
"Dockerが面白いのはシンプルな環境に隔離性と再現性をもたらしてくれることだ.ランタイムの環境を一度作れば、パッケージにして別のマシンでも再利用することできる.さらに,すべてはホスト内の隔離された環境で行われる(VMのように).最も素晴らしい点は,シンプルかつ高速であることだ."