Skip to content

Instantly share code, notes, and snippets.

@jongiddy
jongiddy / bench.rs
Created January 8, 2022 10:08
Rust sorting benchmark
#![feature(test)]
extern crate test;
use test::Bencher;
const RANDOM: [u32; 991] = [
191, 921, 580, 230, 734, 714, 219, 974, 846, 100, 914, 887, 811, 978, 964, 909, 982, 309, 566, 775,
799, 357, 439, 468, 94, 332, 486, 465, 196, 464, 205, 109, 742, 242, 508, 766, 907, 928, 910, 353,
51, 311, 322, 840, 989, 911, 986, 541, 87, 633, 850, 399, 140, 482, 84, 220, 262, 945, 509, 702,
176, 625, 358, 496, 677, 527, 180, 435, 738, 168, 75, 691, 28, 12, 864, 381, 690, 400, 564, 296,
134, 862, 478, 638, 135, 128, 923, 737, 476, 361, 86, 349, 382, 53, 337, 172, 335, 300, 740, 939,
@jongiddy
jongiddy / server.py
Last active March 6, 2019 03:25 — forked from mildred/server.py
Python 3 http.server with PUT support
#!/usr/bin/env python
import argparse
import http.server
import os
class HTTPRequestHandler(http.server.SimpleHTTPRequestHandler):
def do_PUT(self):
path = self.translate_path(self.path)
if path.endswith('/'):
@jongiddy
jongiddy / BroadcastMatcher.scala
Created June 23, 2017 08:48
BroadcastMatcher modified to use HadoopMapReader
package com.admiral.barefoot_spark
import java.net.URI
import java.util.ArrayList
import java.util.{List => JavaList}
import java.util.Properties
import scala.collection.JavaConverters._
import com.bmwcarit.barefoot.matcher.{Matcher, MatcherKState, MatcherSample}
@jongiddy
jongiddy / HadoopMapReader.scala
Created June 23, 2017 08:44
HDFS Barefoot Map reader
package com.admiral.barefoot_spark
import java.lang.{Short => JShort}
import java.io.ObjectInput
import java.io.ObjectInputStream
import java.io.FileNotFoundException
import java.io.IOException
import java.net.URI
import java.util.{HashSet => JHashSet}
@jongiddy
jongiddy / MakeMap.scala
Created June 23, 2017 08:27
Code to turn a Barefoot road database into a file
import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import org.json.JSONException
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.HashMap;
import java.util.Map;
import java.util.Properties;