Skip to content

Instantly share code, notes, and snippets.

@gerner
gerner / goap_toy.py
Last active February 15, 2023 17:17
import sys
import logging
import enum
import collections
import math
import time
import pdb
from dataclasses import dataclass
from typing import Sequence, Tuple, List, Mapping, MutableMapping, Any, Set, Collection, Iterator, Optional
import sortedcontainers # type: ignore
@gerner
gerner / badge_link.md
Last active July 9, 2021 00:04
Testing features in GFM
@gerner
gerner / a.cpp
Last active August 29, 2015 14:05
learning about rrefs in c++11
#include <utility>
#include <stdio.h>
#include <vector>
class Foo {
private:
std::vector<int> i;
public:
Foo(std::vector<int> paramI) {
i = paramI;
@gerner
gerner / gfm-test.md
Last active August 29, 2015 13:55
GFM Test

this is a test

{
"here":"is",
"json":"that's",
"not":"got colors"
}
#! /bin/bash
# Kill processes orphaned by Jenkins
# Work around Java's use of SIGTERM rather than SIGKILL and
# Jenkins's lack of any workaroud in the box.
# here is the relevant bug:
# https://issues.jenkins-ci.org/browse/JENKINS-17116
# Suggested usage:
@gerner
gerner / gist:8201345
Created December 31, 2013 19:46
Hex decoding/encoding
public class HexDecoder {
//lower ascii only
private static int[] HEX_TO_INT = new int[] {
-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, //0-15
-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, //16-31
-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, //32-47
0,1,2,3,4,5,6,7,8,9,-1,-1,-1,-1,-1,-1, //48-63
-1,10,11,12,13,14,15,-1,-1,-1,-1,-1,-1,-1,-1,-1, //64-79
-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, //80-95
@gerner
gerner / Test.java
Created April 13, 2011 22:15
how expensive are exceptions in java? why should they be exceptional?
import java.util.List;
import java.util.ArrayList;
public class Test {
public static void main(String [] args) {
int numIterations = Integer.parseInt(args[0]);
int totalS = Integer.parseInt(args[1]);
int numFoo = Integer.parseInt(args[2]);
//String [] s = { "not foo", "foo", "foo", "not foo", "more not foo", "long string that is most definitely not foo", "short", "more strings", "foo", "foo", "there's a lot of foo here", "foo", "foo", "foo"};