(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
author "Sonu Kr. Meena" | |
description "upstart script for AWS Data Pipeline Task Runner" | |
start on runlevel [2345] | |
stop on runlevel [!2345] | |
# respawn the job up to 5 times within a 10 second period. | |
# If the job exceeds these values, it will be stopped and | |
# marked as failed. | |
respawn |
#!/usr/bin/bash | |
# prints in CSV format for import into visualization tools | |
hextodec () | |
{ | |
hci_test_device_batterylevel=$((16#$1)) | |
} | |
if [ -z "$1" ] |
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
Producer | |
Setup | |
bin/kafka-topics.sh --zookeeper esv4-hcl197.grid.linkedin.com:2181 --create --topic test-rep-one --partitions 6 --replication-factor 1 | |
bin/kafka-topics.sh --zookeeper esv4-hcl197.grid.linkedin.com:2181 --create --topic test --partitions 6 --replication-factor 3 | |
Single thread, no replication | |
bin/kafka-run-class.sh org.apache.kafka.clients.tools.ProducerPerformance test7 50000000 100 -1 acks=1 bootstrap.servers=esv4-hcl198.grid.linkedin.com:9092 buffer.memory=67108864 batch.size=8196 |
git rebase --interactive HEAD~2 | |
# we are going to squash c into b | |
pick b76d157 b | |
pick a931ac7 c | |
# squash c into b | |
pick b76d157 b | |
s a931ac7 c |
//Copyright (c) 2011 ashelly.myopenid.com under <http://www.opensource.org/licenses/mit-license> | |
#include <stdlib.h> | |
//Customize for your data Item type | |
typedef int Item; | |
#define ItemLess(a,b) ((a)<(b)) | |
#define ItemMean(a,b) (((a)+(b))/2) | |
typedef struct Mediator_t |
"Adapted from http://www.slideshare.net/nourybouraqadi/pharo-networking-by-example | |
$! denotes the end of a message | |
" | |
| connectionSock interactSock request stream | | |
connectionSock := Socket newTCP. | |
[ | |
connectionSock listenOn: 8888 backlogSize: 10. | |
interactSock := connectionSock waitForAcceptFor: 15. | |
stream := SocketStream on: interactSock. |
import math | |
class Welford(object): | |
""" Implements Welford's algorithm for computing a running mean | |
and standard deviation as described at: | |
http://www.johndcook.com/standard_deviation.html | |
can take single values or iterables | |
Properties: | |
mean - returns the mean |