Skip to content

Instantly share code, notes, and snippets.

Avatar

Devin Smith devinrsmith

  • Deephaven Data Labs
View GitHub Profile
@devinrsmith
devinrsmith / r_place_uncontested_pixels.py
Last active Apr 9, 2022
Script to create r/place uncontested pixels
View r_place_uncontested_pixels.py
# https://deephaven.io
from deephaven import agg, parquet, empty_table, merge
# Everything pre-whiteout
# https://www.reddit.com/r/place/comments/tzboys/the_rplace_parquet_dataset/
place = parquet.read('2022_place_deephaven.parquet')\
.where("k<155926002")
# 2000 x 2000 grid
all_pixels = empty_table(2000).view(["x1=(short)i"])\
View place_csv_to_parquet.py
#
# Copyright 2022 Deephaven Data Labs
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
@devinrsmith
devinrsmith / BracketOrdering.java
Last active Mar 21, 2022
Optimal single-elimination bracket ordering
View BracketOrdering.java
/*
* Copyright 2022 Deephaven Data Labs
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
View classgraph-benchmark-1.md
$ ./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
View gist:1d48f6bd129afc770e8c99358efecc02
Verifying my Blockstack ID is secured with the address 19mEBDHwqMnWdZru6Bkg39WaL3EyrvkvKD https://explorer.blockstack.org/address/19mEBDHwqMnWdZru6Bkg39WaL3EyrvkvKD
View 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 {
@devinrsmith
devinrsmith / found_elgamal_test_vectors.csv
Created Sep 2, 2017
Various elgamal "test" vectors that I found online, either through simple examples or existing implementations
View found_elgamal_test_vectors.csv
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 / elgamal_test_vectors.csv
Last active May 24, 2019
Randomly generated elgamal test vectors
View elgamal_test_vectors.csv
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
View LMDBIntKey.java
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 / UnicodeTest.java
Last active Feb 2, 2017
Unicode testing w/ jackson
View UnicodeTest.java
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;