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
/******** SETTINGS ********/ | |
const BASE_WAGER = 100; // Initial lowest possible bet to start with. (Satoshis) | |
const BASE_TARGET = 200; // Target payout to chase for. (Actual payout format 2.00x = 2.00) | |
const AUTO_MULTIPLE = false; // Auto calculate and override BET_MULTIPLE for BASE_TARGET. | |
const BET_MULTIPLE = 1.005; // Multiply bet by this value (1 = no increase) after each loss. | |
const BET_INCREASE = 0.1; // Increase bet by this flat amount after each loss. (Satoshis) | |
const TAR_MULTIPLE = 1; // Multiply target by this value (1 = no increase) on each loss. | |
const TAR_INCREASE = 0; // Increase target by this flat amount after each loss. | |
const MAX_WAGER = 5000 // Prevents script from placing bets larger than this amount.(Bits) |
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
// Databricks notebook source | |
// MAGIC %fs | |
// MAGIC rm -r dbfs:/delta/poc/events | |
// COMMAND ---------- | |
case class Data(a:Int,b:String) | |
val first = Seq(Data(1,"a")).toDF |
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 org.apache.spark.sql.types._ | |
import java.security._ | |
val df = sc.parallelize(Seq( | |
(1.0, 2.0), (0.0, -1.0), | |
(3.0, 4.0), (6.0, -2.3))).toDF("x", "y") | |
def mkMD5(text:String) = MessageDigest.getInstance("MD5").digest(text.getBytes).map("%02x".format(_)).mkString | |
def transformRow(row: Row): Row = Row.fromSeq(row.toSeq ++ Array[String](mkMD5(row.mkString(",")))) | |
def transformRows(iter: Iterator[Row]): Iterator[Row] = iter.map(transformRow) |
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
#!/bin/bash | |
set -e | |
sudo wget http://dl.embulk.org/embulk-latest.jar -O /usr/bin/embulk | |
sudo chmod 755 /usr/bin/embulk | |
sudo mkdir -p /opt/embulk | |
sudo chmod 777 /opt/embulk | |
aws s3 cp s3://foo/secret/gcs_secret.json /opt/embulk/gcs_secret.json | |
embulk gem install embulk-decoder-remove_nonstandard_utf8_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
timezone: Asia/Tokyo | |
_export: | |
foo: ${1 + 1} | |
typeOfFoo: ${typeof foo} | |
incr: ${parseInt(foo) + 1} | |
+task: | |
loop>: ${parseInt(incr)} | |
_do: |
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 akka.actor.ActorSystem | |
import akka.stream.{ActorAttributes, ActorMaterializer, FlowShape, Supervision} | |
import akka.stream.scaladsl.{Flow, GraphDSL, Sink, Source} | |
import scala.concurrent.Future | |
/** | |
* StreamFlowWithFuture. | |
*/ | |
object StreamFlowWithFuture { |
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
timezone: UTC | |
_export: | |
abc : efg | |
+show1: | |
sh>: echo ${abc} | |
+override: | |
sh>: echo ${this.abc="hij"} |
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 sys | |
import imp | |
import collections | |
digdag_env_mod = sys.modules['digdag_env'] = imp.new_module('digdag_env') | |
digdag_env_mod.params = {} | |
digdag_env_mod.subtask_config = collections.OrderedDict() | |
digdag_env_mod.export_params = {} | |
digdag_env_mod.store_params = {} |
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
_export: | |
path_prefix: ['abc' , 'efg' , 'hig'] | |
+echo: | |
sh>: echo ${this} |
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
_export: | |
path_prefix: ['abc' , 'efg' , 'hig'] | |
+repeat: | |
loop>: ${path_prefix.length} | |
_do: | |
+step: | |
sh>: echo ${path_prefix[i]} |
NewerOlder