This file contains hidden or 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
require(graphics) | |
# get first group result | |
x <- round(rnorm(100, 150, 10)) | |
# get second group result (20% better mean) | |
y <- sample(c(round(rnorm(80, 150, 10)), round(rnorm(20, 180, 10)))) | |
groups <- c(rep(1, length(x)), rep(2, length(y))) | |
data <- c(x, y) | |
# make an observation (difference in mean) |
This file contains hidden or 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
public static long[] sortIterative(long[] data) { | |
Queue<long[]> q = new LinkedList<>(); | |
for (long elt : data) { | |
q.add(new long[]{elt}); | |
} | |
while (q.size() > 1) { | |
long[] res = mergeSorted(q.poll(), q.poll()); | |
q.add(res); | |
} |
This file contains hidden or 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
CompletableFuture.<Void>runAsync(replicationTask, replicationTaskExecutor) | |
.thenAcceptAsync(aVoid -> { | |
log.info("Repair of disk {} finished on node {}", diskId, membershipService.getSelfNode()); | |
semaphore.release(); | |
}) | |
.exceptionally(throwable -> { | |
log.error("Can't repair cluster", throwable); | |
semaphore.release(); | |
return null; | |
}); |
This file contains hidden or 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
new Function<FunctionParameters, Optional<QsDeploymentResult>>() { | |
@Override | |
public Optional<QsDeploymentResult> apply(@Nullable FunctionParameters parameters) { | |
assert null != parameters; | |
return from(ImmutableList.of(parameters.result)).filter( | |
or( | |
// status ok | |
not(redeployStrategies.statusIsFailed()), | |
// failed iteration was too long time ago |
This file contains hidden or 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 | |
set_time_limit (0); | |
$address = 'localhost'; | |
$port = 9999; | |
$socket = socket_create(AF_INET, SOCK_STREAM, 0); | |
socket_get_option($socket, SOL_SOCKET, SO_LINGER); | |
socket_bind($socket, $address, $port) or die('Could not bind to address'); | |
socket_listen($socket); |
This file contains hidden or 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 e623f4d152f175cd804d063543b848471fa422f5 Mon Sep 17 00:00:00 2001 | |
From: "d.gabaydulin" <[email protected]> | |
Date: Fri, 1 Mar 2013 15:01:33 +0400 | |
Subject: [PATCH] * support handling of HTTP 307 (repost to the given | |
location) | |
--- | |
src/client.c | 12 ++++++++++++ | |
1 file changed, 12 insertions(+) |
This file contains hidden or 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
multipleClientQueriesTestTemplate( | |
ImmutableList.<Pair<Node, Pair<BaseWebSocket, List<String>>>>of( | |
Pair.<Node, Pair<BaseWebSocket, List<String>>>of( | |
node1, | |
Pair.<BaseWebSocket, List<String>>of( | |
new BaseWebSocket() { | |
@Override | |
public void onMessage(String message) { | |
log.info("answer:" + message); | |
latch.countDown(); |
This file contains hidden or 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
new JsonDeserializer<NativeObject>() { | |
@Override | |
public NativeObject deserialize( | |
JsonElement json, | |
Type type, | |
JsonDeserializationContext context | |
) { | |
NativeObject object = RhinoUtils.createJsObject(globalCtx); |
This file contains hidden or 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 | |
while : | |
do | |
clear | |
git --no-pager log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%ci) %C(bold blue)<%an>%Creset' --abbrev-commit --date=relative --all | |
sleep 1 | |
done |
This file contains hidden or 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
commit e560ef1ac4be1fada8efba54e75f9bc70fb5b70a | |
Author: Denis M. Gabaidulin <[email protected]> | |
Date: Thu Sep 6 22:21:29 2012 +0400 | |
+ exit when no activity | |
****.cs | 16 +++++++++++++++- | |
1 files changed, 15 insertions(+), 1 deletions(-) |