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
from aws_xray_sdk.core import xray_recorder | |
##HIDE @xray_recorder.capture('transfer_funds') | |
def money_transfer(from_acc_id, to_acc_id, value): | |
##HIDE xray_recorder.begin_subsegment('lock_funds') | |
money_locked = enough_and_lock(from_acc_id, value) | |
##HIDE xray_recorder.end_subsegment() | |
if money_locked: | |
##HIDE xray_recorder.begin_subsegment('transfer funds via ' + money_locked.payment_gateway) |
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
from aws_xray_sdk.core import xray_recorder | |
@xray_recorder.capture('transfer_funds') | |
def money_transfer(from_acc_id, to_acc_id, value): | |
xray_recorder.begin_subsegment('lock_funds') | |
money_locked = enough_and_lock(from_acc_id, value) | |
xray_recorder.end_subsegment() | |
if money_locked: | |
xray_recorder.begin_subsegment('transfer funds via ' + money_locked.payment_gateway) |
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
from aws_xray_sdk.core import xray_recorder | |
@xray_recorder.capture("get_balance") | |
def get_balance(user_acc_id): | |
""" ... """ | |
... |
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 tensorflow as tf | |
import numpy as np | |
print(tf.__version__) | |
def calc_fx1(fx, x): | |
return tf.gradients(fx, x)[0] | |
def calc_fx2(fx, x): | |
return tf.gradients(tf.gradients(fx, x)[0], x)[0] |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 random | |
import datetime | |
TNX_NUM = int(sys.argv[1]) | |
ACCOUNT_NUM = int(sys.argv[2]) | |
RATES_NUM = int(sys.argv[3]) | |
PAR_ID = int(sys.argv[4]) | |
def get_random(top_limit): |
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
# Spark scala project | |
mvn archetype:generate -B -DarchetypeGroupId=net.alchim31.maven -DarchetypeArtifactId=scala-archetype-simple -DarchetypeVersion=1.5 -DgroupId=org.apache.spark -DartifactId=<Project name> -Dversion=0.1-SNAPSHOT -Dpackage=org.apache.spark | |
# flink project | |
mvn archetype:generate \ | |
-DarchetypeGroupId=org.apache.flink \ | |
-DarchetypeArtifactId=flink-quickstart-scala \ | |
-DarchetypeVersion=0.9.1 \ | |
-DgroupId=org.apache.flink.quickstart \ | |
-DartifactId=flink-scala-project \ |
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(rmr2) | |
rmr.options(backend = "local") | |
#hdfs.init() | |
lm.map = | |
function(., line) { | |
keyval( line[[1]], paste(line[[2]], line[[3]], sep="|")) | |
} |
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
@Grab(group="org.seleniumhq.selenium", module="selenium-java", version="2.42.2") | |
import org.openqa.selenium.*; | |
import org.openqa.selenium.chrome.*; | |
System.setProperty("webdriver.chrome.driver", "/Users/kostya/Downloads/chromedriver"); | |
ChromeOptions chromeOptions = new ChromeOptions(); | |
chromeOptions.addArguments("--verbose", "--ignore-certificate-errors"); | |
WebDriver driver = new ChromeDriver(); |
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(ggplot2) | |
# read dataset from local file | |
abalone <- read.csv("/Users/kostya/Downloads/abalone.data.csv", header=F) | |
# set names for dataframe columns | |
colnames(abalone) <- c('Sex', 'Length', 'Diameter', 'Height', 'WholeWeight', 'ShuckedWeight', | |
'VisceraWeight', 'ShellWeight', 'Rings') | |
# plot histogram |
NewerOlder