Skip to content

Instantly share code, notes, and snippets.

View devinrsmith's full-sized avatar

Devin Smith devinrsmith

  • Deephaven Data Labs
View GitHub Profile
@devinrsmith
devinrsmith / SimpleProducer.java
Created August 6, 2015 02:23
Trying to create simple producer with new KafkaProducer
import org.apache.kafka.clients.producer.KafkaProducer;
import org.apache.kafka.clients.producer.Producer;
import org.apache.kafka.clients.producer.ProducerRecord;
import java.util.Properties;
import java.util.concurrent.ExecutionException;
/**
* Created by dsmith on 8/5/15.
*/

Keybase proof

I hereby claim:

  • I am devinrsmith on github.
  • I am thundza (https://keybase.io/thundza) on keybase.
  • I have a public key ASAlSaR_IWYFj5wrQStDmkdbokcE2XRud33tT8jBjO-npgo

To claim this, I am signing this object:

@devinrsmith
devinrsmith / CQCompoundIssue.java
Created August 5, 2016 14:43
issue describing CQ compound class cast exception
import com.googlecode.cqengine.ConcurrentIndexedCollection;
import com.googlecode.cqengine.IndexedCollection;
import com.googlecode.cqengine.attribute.SimpleAttribute;
import com.googlecode.cqengine.index.compound.CompoundIndex;
import com.googlecode.cqengine.query.option.QueryOptions;
import com.googlecode.cqengine.resultset.ResultSet;
import static com.googlecode.cqengine.query.QueryFactory.and;
import static com.googlecode.cqengine.query.QueryFactory.equal;
import static com.googlecode.cqengine.query.QueryFactory.in;
@devinrsmith
devinrsmith / UnicodeTest.java
Last active February 2, 2017 23:13
Unicode testing w/ jackson
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import java.io.IOException;
import java.nio.charset.Charset;
import java.nio.charset.StandardCharsets;
import org.junit.Test;
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.fail;
@devinrsmith
devinrsmith / LMDBIntKey.java
Last active April 19, 2017 14:31
MDB_INTEGERKEY
import java.io.File;
import java.io.IOException;
import java.nio.ByteBuffer;
import java.nio.ByteOrder;
import java.nio.file.Files;
import org.lmdbjava.Cursor;
import org.lmdbjava.Dbi;
import org.lmdbjava.DbiFlags;
import org.lmdbjava.Env;
import org.lmdbjava.Txn;
@devinrsmith
devinrsmith / elgamal_test_vectors.csv
Last active May 24, 2019 09:29
Randomly generated elgamal test vectors
p g x k m a b
11 3 2 2 0 9 0
23 6 7 6 9 12 6
47 24 6 16 0 34 0
83 28 29 11 34 10 76
167 88 21 69 82 42 135
359 292 11 3 272 79 79
983 368 39 253 457 489 239
1283 269 375 604 1260 940 334
2903 1697 762 133 311 2339 826
@devinrsmith
devinrsmith / found_elgamal_test_vectors.csv
Created September 2, 2017 14:18
Various elgamal "test" vectors that I found online, either through simple examples or existing implementations
p g x k m a b
71 33 62 31 15 62 18
23 11 6 3 10 20 22
809 3 68 89 100 345 517
17 6 5 10 13 15 9
84265675725482892459719348378630146162719620409152809167814480007059199482163 5 2799014790424892046701478888900891009403869701173893426 23517683968368899022119256606644551548285683288848885921 87521618088882658227876453 22954586883013884818653063688294540134886732496160582262267014428782771199687 56046128113101346099694619669629128017849277484825379502821514323706183544424
12658517083168187407924345155971956101250996576825115113297001855799796437288935576230034157578333666497170430505565580165565829633685607504706642034926119 7 2001688878140630728014209681954697141876038523595247208 5446024688717452254835115775456957961297236108858862823 87521618088882658227876453 2150519483988769855483983776372336742288374425191291528256965705108393490638750082340115568718132372731853110762124400441550538499580316268601341087676203 1540471266850557563382406324432354117072109094950140952195099581066490559252112349492583688225692526
@devinrsmith
devinrsmith / PermutationEncoding.java
Created October 3, 2017 04:37
PermutationEncoding.java
import java.util.Arrays;
import java.util.NoSuchElementException;
import java.util.PrimitiveIterator;
import java.util.function.IntConsumer;
/**
* @author Devin Smith
*/
public class PermutationEncoding {
Verifying my Blockstack ID is secured with the address 19mEBDHwqMnWdZru6Bkg39WaL3EyrvkvKD https://explorer.blockstack.org/address/19mEBDHwqMnWdZru6Bkg39WaL3EyrvkvKD
@devinrsmith
devinrsmith / classgraph-benchmark-1.md
Last active November 6, 2019 01:30
classgraph-benchmark-1
$ ./build/install/classgraph-benchmark/invoke.sh
Running a classgraph benchmark focused on startup speed
For more information, see https://github.com/devinrsmith/classgraph-benchmark

classloader META-INF/maven/com.google.guava/guava/pom.xml 2 84a3ee12 17 56
real 0.10
user 0.13
sys 0.03
classgraph META-INF/maven/com.google.guava/guava/pom.xml 2 84a3ee12 122 162