Provides a visualization similar to google analytics shopper behavior analytics.
- d3js
- underscorejs
package com.mallo64.dataflow | |
import com.google.api.client.json.GenericJson; | |
import com.google.api.services.bigquery.model.TableCell; | |
import com.google.api.services.bigquery.model.TableFieldSchema; | |
import com.google.api.services.bigquery.model.TableRow; | |
import com.google.api.services.bigquery.model.TableSchema; | |
import com.google.cloud.dataflow.sdk.transforms.DoFn; | |
import org.apache.avro.Schema; | |
import org.apache.avro.specific.SpecificRecord; |
/* | |
Copyright (c) 2015-2025 Alessandro Diaferia | |
Permission is hereby granted, free of charge, to any person obtaining a copy | |
of this software and associated documentation files (the "Software"), to deal | |
in the Software without restriction, including without limitation the rights | |
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
copies of the Software, and to permit persons to whom the Software is | |
furnished to do so, subject to the following conditions: |
'use strict'; | |
/* | |
Instructions: | |
1 - Should execute 'npm run prepare' | |
before the very first run, it will install and symlink all dependencies. | |
2 - Choose between production 'npm start' and development 'npm run start-dev' modes | |
(watcher will run immediately after initial run). |
import java.util.ArrayList; | |
import java.util.Collection; | |
import java.util.List; | |
import org.apache.commons.lang3.SerializationUtils; | |
import org.springframework.beans.factory.annotation.Autowired; | |
import org.springframework.security.jwt.JwtHelper; | |
import org.springframework.security.oauth2.common.OAuth2AccessToken; | |
import org.springframework.security.oauth2.common.OAuth2RefreshToken; | |
import org.springframework.security.oauth2.common.exceptions.InvalidTokenException; |
# http://cran.r-project.org/web/packages/markovchain/vignettes/an_introduction_to_markovchain_package.pdf | |
library(markovchain) | |
initialState <- c(0,1,0) | |
weatherStates <- c("sunny", "cloudy", "rain") | |
byRow <- TRUE | |
trans.probs <- matrix(data=c(0.7, 0.2, 0.1, | |
0.3, 0.4, 0.3, | |
0.2, 0.45, 0.35), byrow=TRUE, nrow=3, | |
dimnames = list(weatherStates, weatherStates)) |
Since many deployments may start out with 3 nodes and so little is known about how to grow a cluster from 3 memebrs to 5 members without losing the existing Quorum, here is an example of how this might be achieved.
In this example, all 5 nodes will be running on the same Vagrant host for the purpose of illustration, running on distinct configurations (ports and data directories) without the actual load of clients.
YMMV. Caveat usufructuarius.
package bench; | |
import java.util.Arrays; | |
import java.util.concurrent.TimeUnit; | |
import org.openjdk.jmh.annotations.BenchmarkType; | |
import org.openjdk.jmh.annotations.GenerateMicroBenchmark; | |
import org.openjdk.jmh.annotations.OutputTimeUnit; | |
import org.openjdk.jmh.annotations.State; |
for (int p = 10; p < 18; p++) | |
{ | |
HyperLogLogPlus hyperLogLogPlus = new HyperLogLogPlus(p, 25); | |
int count = 4200000; | |
for (int i = 0; i < count; i++) | |
{ | |
hyperLogLogPlus.offer("i" + i); | |
} | |
long estimate = hyperLogLogPlus.cardinality(); | |
double se = count * (1.04 / Math.sqrt(Math.pow(2, p))); |