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 foo; | |
import io.grpc.Attributes; | |
import io.grpc.EquivalentAddressGroup; | |
import io.grpc.NameResolver; | |
import io.grpc.NameResolverProvider; | |
import java.net.InetSocketAddress; | |
import java.net.URI; | |
import java.util.List; | |
import java.util.stream.Collectors; |
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 | |
for i in $(seq -f "%03g" 1 99) | |
do | |
wget http://downloads.digitalcorpora.org/corpora/files/govdocs1/zipfiles/$i.zip -O $i.zip | |
unzip $i.zip | |
rm $i.zip | |
done |
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 com.lucidworks.fusion.service.connectors.job.fetcher.request; | |
import java.nio.charset.Charset; | |
import java.util.Collection; | |
import java.util.concurrent.ConcurrentSkipListSet; | |
import com.google.common.collect.Lists; | |
import com.google.common.hash.Funnel; | |
import com.google.common.hash.Funnels; | |
import com.google.common.hash.HashFunction; |
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
@Override | |
public WebResponse GET(WebRequest request) throws IOException, InterruptedException { | |
PipedInputStream pipedInputStream = new PipedInputStream(); | |
try { | |
String url = request.getLink().getOriginal().get(); | |
PipedOutputStream pipedOutputStream = new PipedOutputStream(pipedInputStream); | |
BodyDeferringAsyncHandler bodyDeferringAsyncHandler = new BodyDeferringAsyncHandler(pipedOutputStream); | |
BoundRequestBuilder requestBuilder = client.prepareGet(url); | |
ListenableFuture<Response> futureResponse = requestBuilder.execute(bodyDeferringAsyncHandler); | |
try { |
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 com.lucidworks; | |
import java.io.BufferedInputStream; | |
import java.io.BufferedOutputStream; | |
import java.io.ByteArrayInputStream; | |
import java.io.ByteArrayOutputStream; | |
import java.io.FileNotFoundException; | |
import java.io.FileOutputStream; | |
import java.io.IOException; | |
import java.io.InputStream; |
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
// | |
// Start via: phantomjs --load-images=false server.js | |
// Call like: curl 127.0.0.1:8080/https://www.reddit.com/ | |
// The response should be a fully rendered (+JS) page | |
// | |
var webserver = require('webserver'); | |
var server = webserver.create(); | |
var service = server.listen('127.0.0.1:8080', function(request, response) { | |
var page = require('webpage').create(); |
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
(defn gcd [a b] (if (= b 0) a (gcd b (rem a b)))) |
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
public static void main(String[] args[]){ | |
ExecutorService pool = Executors.newFixedThreadPool(5); | |
final BlockingQueue<String> in = new ArrayBlockingQueue<>(1); | |
final BlockingQueue<String> out = new ArrayBlockingQueue<>(1); | |
Random random = new Random(); | |
AtomicInteger count = new AtomicInteger(0); | |
Callable<Runnable> inputProc = () -> { | |
return () -> { |
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 csv | |
bigArray = [] | |
fieldNameArray = [] | |
sampleArray = [] | |
theSize = 4000 | |
for i in range(theSize): | |
fieldNameArray.append('Field_' + str(i)) |
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
function create(){ | |
var observers = {}, | |
locks = {}; | |
var context = { | |
wait: wait, | |
owner: owner, | |
_locks: locks, | |
_observers: observers |