This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <v8.h> | |
#include <libplatform/libplatform.h> | |
using v8::HandleScope; | |
using v8::Isolate; | |
using v8::MemorySpan; | |
using v8::WasmModuleObject; | |
using v8::Context; | |
using v8::Local; | |
using v8::Value; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(V8) | |
ctx <- v8() | |
ctx$eval(" | |
let bytes = new Uint8Array([ | |
0x00, 0x61, 0x73, 0x6d, 0x01, 0x00, 0x00, 0x00, 0x01, 0x07, 0x01, | |
0x60, 0x02, 0x7f, 0x7f, 0x01, 0x7f, 0x03, 0x02, 0x01, 0x00, 0x07, | |
0x07, 0x01, 0x03, 0x61, 0x64, 0x64, 0x00, 0x00, 0x0a, 0x09, 0x01, | |
0x07, 0x00, 0x20, 0x00, 0x20, 0x01, 0x6a, 0x0b | |
]); | |
let module = new WebAssembly.Module(bytes); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Import the GPG key | |
wget https://dist.apache.org/repos/dist/dev/arrow/KEYS | |
apt-key add < KEYS | |
# Install libarrow | |
DISTRO=$(lsb_release --codename --short) | |
add-apt-repository "deb [arch=amd64] http://dl.bintray.com/apache/arrow/ubuntu $DISTRO main" | |
apt-get install libarrow-dev libparquet-dev | |
# Install the R package |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# To start the docker container | |
docker run -it wch1/r-debug | |
# Run this inside docker: | |
cd ~ | |
wget https://dist.apache.org/repos/dist/dev/arrow/KEYS | |
apt-key add < KEYS | |
add-apt-repository 'deb [arch=amd64] http://dl.bintray.com/apache/arrow/ubuntu bionic main' | |
apt-get install libarrow-dev libparquet-dev |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Attaching package: ‘arrow’ | |
The following object is masked from ‘package:testthat’: | |
matches | |
The following object is masked from ‘package:utils’: | |
timestamp |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Determining if the pthread_create exist failed with the following output: | |
Change Dir: /root/poppler-0.74.0/obj-x86_64-linux-gnu/CMakeFiles/CMakeTmp | |
Run Build Command:"/usr/bin/make" "cmTC_aa88c/fast" | |
make[2]: Entering directory '/root/poppler-0.74.0/obj-x86_64-linux-gnu/CMakeFiles/CMakeTmp' | |
/usr/bin/make -f CMakeFiles/cmTC_aa88c.dir/build.make CMakeFiles/cmTC_aa88c.dir/build | |
make[3]: Entering directory '/root/poppler-0.74.0/obj-x86_64-linux-gnu/CMakeFiles/CMakeTmp' | |
Building C object CMakeFiles/cmTC_aa88c.dir/CheckSymbolExists.c.o | |
/usr/bin/cc -std=c99 -D_DEFAULT_SOURCE -o CMakeFiles/cmTC_aa88c.dir/CheckSymbolExists.c.o -c /root/poppler-0.74.0/obj-x86_64-linux-gnu/CMakeFiles/CMakeTmp/CheckSymbolExists.c | |
Linking C executable cmTC_aa88c |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
parse_streamer <- function(url, cb = print){ | |
con <- curl::curl(url = url) | |
open(con) | |
on.exit(close(con)) | |
repeat{ | |
txt <- readLines(con, 1) | |
if(!length(txt)){ | |
print("All done!") | |
cb(NULL) | |
break; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Test program to verify that CURLMOPT_MAX_TOTAL_CONNECTIONS works as expected */ | |
#include <stdio.h> | |
#include <string.h> | |
#include <sys/time.h> | |
#include <unistd.h> | |
#include <math.h> | |
#include <curl/curl.h> | |
/* Configure max concurrent connections */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# install.packages(c("magick", "tesseract")) | |
stopifnot(packageVersion('magick') >= 2.0) | |
stopifnot(packageVersion('tesseract') >= 4.0) | |
# Use in rstudio to see captcha images | |
rate_captcha <- function(n = 10){ | |
success <- rep(NA, n) | |
for(i in seq_len(n)){ | |
repeat{ | |
img <- magick::image_read('https://issues.apache.org/jira/captcha') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Run as user opencpu!! sudo su opencpu | |
dir.create('/tmp/ocpu-temp') | |
tmp <- tempfile('session', tmpdir = '/tmp/ocpu-temp') | |
dir.create(tmp, recursive = TRUE) | |
sys:::set_tempdir(tmp) | |
setwd(tempdir()) | |
Sys.setenv(TMPDIR=tempdir(), HOME=tempdir()) | |
# Load Sandbox | |
sys:::aa_change_profile("opencpu-main") |