library(sparklyr)
sc <- spark_connect(master = "yarn", spark_home = "/usr/lib/spark/", config = list(spark.dynamicAllocation.enabled = FALSE, `sparklyr.shell.executor-cores` = 8, `sparklyr.shell.num-executors` = 3, sparklyr.apply.env.WORKON_HOME = "/tmp/.virtualenvs"))
sdf_len(sc, 3, repartition = 3) %>%
spark_apply(function(df, barrier) {
tryCatch({
library(tensorflow)
library(keras)
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
<html> | |
<body> | |
<script src="https://cdn.jsdelivr.net/npm/@tensorflow/tfjs"></script> | |
<script src="https://cdn.jsdelivr.net/npm/@tensorflow-models/posenet"></script> | |
<img id='pose' src="data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/4gIcSUNDX1BST0ZJTEUAAQEAAAIMbGNtcwIQAABtbnRyUkdCIFhZWiAH3AABABkAAwApADlhY3NwQVBQTAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA9tYAAQAAAADTLWxjbXMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAApkZXNjAAAA/AAAAF5jcHJ0AAABXAAAAAt3dHB0AAABaAAAABRia3B0AAABfAAAABRyWFlaAAABkAAAABRnWFlaAAABpAAAABRiWFlaAAABuAAAABRyVFJDAAABzAAAAEBnVFJDAAABzAAAAEBiVFJDAAABzAAAAEBkZXNjAAAAAAAAAANjMgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB0ZXh0AAAAAEZCAABYWVogAAAAAAAA9tYAAQAAAADTLVhZWiAAAAAAAAADFgAAAzMAAAKkWFlaIAAAAAAAAG+iAAA49QAAA5BYWVogAAAAAAAAYpkAALeFAAAY2lhZWiAAAAAAAAAkoAAAD4QAALbPY3VydgAAAAAAAAAaAAAAywHJA2MFkghrC/YQPxVRGzQh8SmQMhg7kkYFUXdd7WtwegWJsZp8rGm/fdPD6TD////+ACVSZXNpemVkIG9uIGh0dHBzOi8vZXpnaWYuY29tL3Jlc2l6Zf |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<script src="https://cdn.jsdelivr.net/gh/ethereum/[email protected]/dist/web3.min.js"></script> | |
<script> | |
const create = () => { | |
const web3 = new Web3(new Web3.providers.HttpProvider('https://mainnet.infura.io')); | |
let account = web3.eth.accounts.create(web3.utils.randomHex(32)); | |
document.getElementById('address').innerText = account.address; | |
document.getElementById('key').innerText = account.privateKey; |
Using data from RamiKrispin/coronavirus, first plot worldwide new cases for countries with more than a thousand cases:
Why OBS? It's free and Twitch streamers have proven it is quite configurable and reliable.
Configuration
- Download OBS (Mac, Linux, Mac) from: https://obsproject.com/download
- Install and Launch OBS.
- Create an Scene
- Add Display Capture and Audio Capture
- Open the
Settings
window and selectOutput
, thenRecording
, selectmp4
- Still under
Settings
,Hotkeys
tab, I recommend adding a hot key to start and stop recording. - Close
Settings
window.
Create EMR cluster with support for R.
Fix Development Tools
to fix gower
package installation,
sudo yum remove gcc72-c++.x86_64 libgcc72.x86_64
sudo yum groupinstall 'Development Tools'
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 SimpleHTTPServer | |
import BaseHTTPServer | |
def main(): | |
request_handler = SimpleHTTPServer.SimpleHTTPRequestHandler | |
request_handler.server_version = "Jetty(8.y.z-SNAPSHOT)" | |
request_handler.sys_version = "" | |
BaseHTTPServer.test(HandlerClass = request_handler, ServerClass = BaseHTTPServer.HTTPServer) | |
if __name__ == "__main__": |
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
#ifdef _MSC_VER | |
#pragma warning( disable : 4146 ) | |
#endif | |
#include <iostream> | |
#include <torch/torch.h> | |
struct Net : torch::nn::Module { | |
Net(int64_t N, int64_t M) { | |
W = register_parameter("W", torch::randn({ N, M })); |
title | output |
---|---|
Using Spark, Delta Lake and MLflow |
html_notebook |
First we define helper functions,
delta_version <- function(sc, path) {
invoke_static(sc, "io.delta.tables.DeltaTable", "forPath", spark_session(sc), path) %>%
Download and install rtools40-x86_64.exe from https://cran.r-project.org/bin/windows/testing/rtools40.html, then launch RTools MinGW 64-bit
pacman -S mingw-w64-{i686,x86_64}-toolchain
pacman -S mingw-w64-{i686,x86_64}-cmake
git checkout v1.4.0a0
NewerOlder