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
<?xml version="1.0" encoding="UTF-8"?> | |
<project xmlns="http://maven.apache.org/POM/4.0.0" | |
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | |
<modelVersion>4.0.0</modelVersion> | |
<groupId>temp</groupId> | |
<artifactId>temp</artifactId> | |
<version>1.0-SNAPSHOT</version> |
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 io.micrometer.core.instrument.DistributionSummary; | |
import io.micrometer.prometheus.PrometheusConfig; | |
import io.micrometer.prometheus.PrometheusMeterRegistry; | |
public class Demo { | |
public static void main(String[] args) { | |
PrometheusMeterRegistry registry = new PrometheusMeterRegistry( | |
PrometheusConfig.DEFAULT | |
); |
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 java.util.ArrayList; | |
import java.util.HashSet; | |
import java.util.List; | |
import java.util.Set; | |
import org.apache.commons.lang.math.RandomUtils; | |
public class Simulation { | |
static int N = 8000000; | |
static int ROUNDS = 24; |
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 io.github.resilience4j.bulkhead.annotation.Bulkhead; | |
import io.github.resilience4j.bulkhead.annotation.Bulkhead.Type; | |
import io.github.resilience4j.circuitbreaker.annotation.CircuitBreaker; | |
import io.github.resilience4j.retry.annotation.Retry; | |
import io.github.resilience4j.timelimiter.annotation.TimeLimiter; | |
import java.util.Date; | |
import java.util.concurrent.CompletableFuture; | |
import java.util.concurrent.CountDownLatch; | |
import java.util.concurrent.atomic.AtomicInteger; | |
import javax.annotation.PostConstruct; |
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 java.util.concurrent.ConcurrentHashMap; | |
import java.util.concurrent.atomic.AtomicInteger; | |
public class Counter { | |
private final static ConcurrentHashMap<String, AtomicInteger> map=new ConcurrentHashMap<>(); | |
public static int inc(String name){ | |
return map.computeIfAbsent(name, x -> new AtomicInteger()).getAndIncrement(); | |
} |
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
[ | |
{"xOrder":0,"x":"Women", "y0": 0.0, "y1": 0.3, "color":"#e377c2", "id":"0"}, | |
{"xOrder":0,"x":"Women", "y0": 0.3, "y1": 1.0, "color":"#c7c7c7", "id":"1"}, | |
{"xOrder":1,"x":"Men", "y0": 0.0, "y1":0.46, "color":"#1f77b4", "id":"2"}, | |
{"xOrder":1,"x":"Men", "y0": 0.46, "y1": 1.0, "color":"#c7c7c7", "id":"3"} | |
] |
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
[ | |
{"xOrder":0,"x":"Women", "y0": 0.0, "y1": 0.3, "color":"#e377c2", "id":"0"}, | |
{"xOrder":0,"x":"Women", "y0": 0.3, "y1": 1.0, "color":"#c7c7c7", "id":"1"}, | |
{"xOrder":1,"x":"Men", "y0": 0.0, "y1":0.46, "color":"#1f77b4", "id":"2"}, | |
{"xOrder":1,"x":"Men", "y0": 0.46, "y1": 1.0, "color":"#c7c7c7", "id":"3"} | |
] |
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 localStorageKey=prompt('Enter your key'); | |
var localStorageValue = prompt('Enter your value'); | |
localStorage[localStorageKey]=localStorageValue; |
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 n = 4, // number of layers | |
m = 58, // number of samples per layer | |
stack = d3.layout.stack(), | |
layers = stack(d3.range(n).map(function() { return bumpLayer(m, .1); })), | |
yGroupMax = d3.max(layers, function(layer) { return d3.max(layer, function(d) { return d.y; }); }), | |
yStackMax = d3.max(layers, function(layer) { return d3.max(layer, function(d) { return d.y0 + d.y; }); }); | |
var margin = {top: 40, right: 10, bottom: 20, left: 10}, | |
width = 960 - margin.left - margin.right, | |
height = 500 - margin.top - margin.bottom; |
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
package orika; | |
import ma.glasnost.orika.MapperFacade; | |
import ma.glasnost.orika.impl.DefaultMapperFactory; | |
import org.junit.Assert; | |
import org.junit.Before; | |
import org.junit.Test; | |
import java.util.SortedSet; | |
import java.util.TreeSet; |
NewerOlder