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) | |
library(MASS) | |
setwd('~/Downloads/jtls_and_more/') | |
jtl <- read_csv("~/Downloads/jtls_and_more/sample.jtl.csv") | |
df <- subset(jtl, jtl$lb == 'HomePage_01') | |
ggplot(jtl, aes(t)) + | |
facet_wrap( ~ lb, ncol = 3) + | |
geom_histogram(bins = 75) + |
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
<?php | |
use Yosymfony\Toml\Toml; | |
ini_set('display_errors', false); | |
ini_set('display_startup_errors', true); | |
ini_set('newrelic.appname', 'gilad-dev'); | |
error_reporting(E_ALL ^ E_STRICT ^ E_NOTICE ^ E_DEPRECATED ^ E_WARNING); |
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
- name: create a local temp directory | |
local_action: | |
module: command mktemp -d "{{ lookup('env', 'TMPDIR') | default('/tmp/') }}ansible.XXXX" | |
register: mktemp_output |
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
var path = require('path'); | |
var gulp = require('gulp'); | |
var streamqueue = require('streamqueue'); | |
var $gulp = require('gulp-load-plugins')({ | |
lazy: false | |
}); | |
var prependBowerPath = function (package) { | |
return path.join('./src/bower_components/', 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
export class Request { | |
ajax = $.ajax; | |
baseURL = API_BASE_URL; | |
contentType = 'application/json'; | |
data = null; | |
dataType = 'json'; | |
global = true; | |
method = 'GET'; | |
params = null; | |
paramsSerializer = defaultParamsSerializer; |
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 Data.List | |
import qualified Data.Map.Strict as Map | |
import Data.Ord (comparing) | |
wordFrequency :: (Ord a) => [a] -> Map.Map a Int | |
wordFrequency xs = foldr (\word acc -> Map.insertWith (+) word 1 acc) Map.empty xs | |
nBiggest :: Int -> Map.Map a Int -> [(a, Int)] | |
nBiggest n m = take n $ sortBy (comparing $ negate . snd) $ Map.toList m |
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
u <- c(0.1, 0.3, 0.5) | |
chi_df <- 3 | |
target_power <- 0.9 | |
chi_base <- qchisq(0.95, chi_df) | |
get_power <- function(n) { | |
return (pchisq(q = chi_base, df = chi_df, ncp = n * u %*% u, lower.tail = FALSE)) | |
} | |
get_power(20) |
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
cols <- c( | |
c(3, 9, 2, 3, 2), | |
c(8, 8, 1, 9, 0), | |
c(1, 9, 5, 9, 8), | |
c(8, 10, 7, 5, 3), | |
c(5, 8, 8, 0, 8), | |
c(5, 10, 4, 7, 2)) | |
# prepare column vectors matrix | |
mat <- matrix(cols, byrow = FALSE, nrow = 5) |
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
buildscript { | |
ext { | |
springBootVersion = '2.0.2.RELEASE' | |
} | |
repositories { | |
mavenCentral() | |
} | |
dependencies { | |
classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}") | |
} |
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
@GetMapping("/percentiles-distribution") | |
public Flux<PercentilesDistribution> getAggregatePercentiles( | |
@RequestParam @Positive long masterId, | |
@RequestParam(defaultValue = "0") @Min(-1) long from, | |
@RequestParam(defaultValue = "0") @Min(-1) long to, | |
@RequestParam(defaultValue = "ALL") @Size(max = Constants.MAX_LOCATIONS) ArrayList<String> locationId, | |
@RequestParam(defaultValue = "") @Size(max = Constants.MAX_SCENARIOS) ArrayList<String> scenarioId, | |
@RequestParam(defaultValue = "") ArrayList<String> labelIds | |
) { | |
final int interval = 60; |