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.io.IOException; | |
import java.nio.charset.StandardCharsets; | |
import java.nio.file.Files; | |
import java.util.Arrays; | |
import java.util.Iterator; | |
import java.util.Properties; | |
import org.I0Itec.zkclient.ZkClient; | |
import org.apache.kafka.clients.consumer.ConsumerRecord; | |
import org.apache.kafka.clients.consumer.ConsumerRecords; | |
import org.apache.kafka.clients.consumer.KafkaConsumer; |
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.net.InetAddress; | |
import java.net.UnknownHostException; | |
public class IPRangeChecker { | |
public static long ipToLong(InetAddress ip) { | |
byte[] octets = ip.getAddress(); | |
long result = 0; | |
for (byte octet : octets) { | |
result <<= 8; |
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
#!/bin/bash | |
# Set the ROOM_ID & AUTH_TOKEN variables below. | |
# Further instructions at https://www.hipchat.com/docs/apiv2/auth | |
ROOM_ID=XXX | |
AUTH_TOKEN=XXX | |
MESSAGE="Hello world!" | |
curl -H "Content-Type: application/json" \ |
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
Service | Permission | |
---|---|---|
Auto Scaling | CreateAutoScalingGroup | |
Auto Scaling | CreateLaunchConfiguration | |
Auto Scaling | CreateOrUpdateScalingTrigger | |
Auto Scaling | CreateOrUpdateTags | |
Auto Scaling | DeleteAutoScalingGroup | |
Auto Scaling | DeleteLaunchConfiguration | |
Auto Scaling | DeleteNotificationConfiguration | |
Auto Scaling | DeletePolicy | |
Auto Scaling | DeleteScheduledAction |
- Probabilistic Data Structures for Web Analytics and Data Mining : A great overview of the space of probabilistic data structures and how they are used in approximation algorithm implementation.
- Models and Issues in Data Stream Systems
- Philippe Flajolet’s contribution to streaming algorithms : A presentation by Jérémie Lumbroso that visits some of the hostorical perspectives and how it all began with Flajolet
- Approximate Frequency Counts over Data Streams by Gurmeet Singh Manku & Rajeev Motwani : One of the early papers on the subject.
- [Methods for Finding Frequent Items in Data Streams](http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.187.9800&rep=rep1&t
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 dispatch._ | |
import xml._ | |
import concurrent.Future | |
import concurrent.ExecutionContext.Implicits.global | |
/** | |
* Video information of certain video service providers. | |
* Supports Youtube, Vimeo. | |
* Can only get video duration, but easily extensible. |
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
brew install sbt | |
cd /tmp | |
wget http://apache.spd.co.il/kafka/0.8.0/kafka_2.8.0-0.8.0.tar.gz | |
tar -zxvf kafka_2.8.0-0.8.0.tar.gz -C /usr/local/ | |
cd /usr/local/kafka_2.8.0-0.8.0 | |
sbt update | |
sbt 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
package quantity | |
// like Nat, but for integers | |
trait Z | |
// Pos means positive-or-zero, and Neg means negative-or-zero | |
trait Pos extends Z { type P <: Pos } | |
trait Neg extends Z { type N <: Neg } | |
class Zero extends Pos with Neg { type N = Zero } |
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 scala.concurrent.duration._ | |
import scala.concurrent.ExecutionContext | |
import scala.concurrent.Future | |
import akka.pattern.after | |
import akka.actor.Scheduler | |
/** | |
* Given an operation that produces a T, returns a Future containing the result of T, unless an exception is thrown, | |
* in which case the operation will be retried after _delay_ time, if there are more possible retries, which is configured through | |
* the _retries_ parameter. If the operation does not succeed and there is no retries left, the resulting Future will contain the last failure. |