Skip to content

Instantly share code, notes, and snippets.

@ddbs
ddbs / Rperf.sh
Created January 2, 2017 15:45 — forked from mbacou/Rperf.sh
Benchmarking FastRWeb and OpenCPU
## Comparing execution times between OpenCPU (RApache) and FastRWeb (Rserve and HTTP).
## Same requests and same code. Note that FastRWeb is up to 13 times faster on the 2nd call.
# OpenCPU: summarize 2 layers across districts for the whole of SSA, return json of summary table
# and then json of all pixel values for mapping
$ time curl http://127.0.0.1/ocpu/library/hcapi3/R/getLayer/json \
-d '{"var" : ["whea_h", "AEZ16_CLAS"], "by" : "ADM2_NAME_ALT"}' -X POST -H "Content-Type:application/json"
[...]
{
@ddbs
ddbs / deployment-tool-ansible-puppet-chef-salt.md
Created March 4, 2017 10:29 — forked from jaceklaskowski/deployment-tool-ansible-puppet-chef-salt.md
Choosing a deployment tool - ansible vs puppet vs chef vs salt

Requirements

  • no upfront installation/agents on remote/slave machines - ssh should be enough
  • application components should use third-party software, e.g. HDFS, Spark's cluster, deployed separately
  • configuration templating
  • environment requires/asserts, i.e. we need a JVM in a given version before doing deployment
  • deployment process run from Jenkins

Solution

@ddbs
ddbs / metaprogramming.R
Created April 17, 2018 09:47 — forked from wjhopper/metaprogramming.R
Metaprogramming in R
# Create a function programmatically by creating its constituents:
# an argument list, a function body of expressions, and an enclosing environment
args <- alist(x=,y=)
exps <- expression(z <- x^2 + y^2, z <- sqrt(z), return(z))
body <- as.call(c(as.name("{"), exps))
f <- as.function(x = c(args,body), envir = parent.frame())
f(x=1,y=1)
@ddbs
ddbs / Recipes - Entity Extraction.ipynb
Created May 1, 2019 20:01 — forked from psychemedia/Recipes - Entity Extraction.ipynb
Examples of tagging and fuzzy matchings items in txt docs using python
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.