jq is useful to slice, filter, map and transform structured json data.
brew install jq
#!/usr/bin/env bpftrace | |
/* | |
* ralloc - Print allocations of R vectors. | |
* | |
* Copyright 2020 Aaron Jacobs | |
* Licensed under the MIT License or the Apache License, version 2.0. | |
*/ | |
BEGIN | |
{ |
library(data.table) | |
library(dplyr) | |
library(sp) | |
library(rgeos) | |
library(UScensus2000tract) | |
library(geosphere) | |
library(geodist) |
library(data.table) | |
dyn.load('mmap_alloc.dll') | |
## create test ~74GB dataset, similar to | |
## https://github.com/Rdatatable/data.table/wiki/Benchmarks-:-Grouping | |
N=2e9; K=100 | |
set.seed(1) | |
DT = list() | |
# empty mmap columns |
# Takes an ordered vector of numeric values and returns a small bar chart made | |
# out of Unicode block elements. Works well inside dplyr mutate() or summarise() | |
# calls on grouped data frames. | |
sparkbar <- function(values) { | |
span <- max(values) - min(values) | |
if(span > 0 & !is.na(span)) { | |
steps <- round(values / (span / 7)) | |
blocks <- c('▁', '▂', '▃', '▄', '▅', '▆', '▇', '█') | |
paste(sapply(steps - (min(steps) - 1), function(i) blocks[i]), collapse = '') |
sudo yum -y update
sudo yum-config-manager --enable epel
sudo yum -y install make automake gcc gcc-c++ libcurl-devel proj-devel geos-devel
cd /tmp
curl -L http://download.osgeo.org/gdal/2.0.0/gdal-2.0.0.tar.gz | tar zxf -
cd gdal-2.0.0/
./configure --prefix=/usr/local --without-python
make -j4
sudo make install
#include <sys/types.h> | |
#include <sys/stat.h> | |
#include <sys/mman.h> | |
#include <unistd.h> | |
#include <fcntl.h> | |
#include <Rinternals.h> | |
#include <R_ext/Rallocators.h> | |
static void *mmap_alloc(R_allocator_t *allocator, size_t length) { |