Skip to content

Instantly share code, notes, and snippets.

View seanjensengrey's full-sized avatar

Sean Jensen-Grey seanjensengrey

View GitHub Profile
#include <functional>
#include <iostream>
// g++ -std=c++11 quad.cpp
int main(int argc,char** argv) {
auto d = [](double x){ return (x * x - 0.5); };
auto adder = [](int x) {
return [=](int y) {
@seanjensengrey
seanjensengrey / CiteSeerRepro.py
Created March 20, 2014 18:40
Content-Disposition for CiteSeerX
import SimpleHTTPServer
import SocketServer
import BaseHTTPServer
import re
import os
import os.path
import shutil
__doc__ = """
@seanjensengrey
seanjensengrey / 1-cat.js
Created March 21, 2014 20:04
async read of a file
/* open a file and print its contents */
var fs = require('fs');
var cat_file = function(path,stream,completion_callback) {
fs.open(path,'rs',function(err,fd) {
var buf_size = 4096;
var buf = new Buffer(buf_size);
t = {}
t[0,0] = lambda x: x
t[1,0] = lambda x: "Fizz"
t[0,1] = lambda x: "Buzz"
t[1,1] = lambda x: "FizzBuzz"
def tests(x):
return (x % 3 == 0, x % 5 == 0)
for x in range(1,101):
@seanjensengrey
seanjensengrey / fizzbuzz.lua
Created April 9, 2014 23:01
If free FizzBuzz in Lua
t = { [true] = {} , [false] = {}}
t[false][false] = function(x) return x end
t[true][false] = function(x) return "Fizz" end
t[false][true] = function(x) return "Buzz" end
t[true][true] = function(x) return "FizzBuzz" end
for i = 1, 100 do
print(t[i % 3 == 0][i % 5 == 0](i))
end
@seanjensengrey
seanjensengrey / lray1.lua
Created April 9, 2014 23:20
simplistic lua raytracer, a single sphere
DELTA = 1.5e-8
_INFINITY = math.huge
__tostring_vec = function(vec)
return string.format("Vec(%f,%f,%f)",vec.x,vec.y,vec.z)
end
vec_mt = {}
vec_mt.__tostring = __tostring_vec
@seanjensengrey
seanjensengrey / pybloomfiltermmap_segfault.txt
Created April 21, 2014 18:15
pybloomfiltermmap segfaults when passing in large <error_rate>
(py.env)zen:temp zen$ ipython
Python 2.7.6 (default, Feb 19 2014, 00:46:08)
Type "copyright", "credits" or "license" for more information.
IPython 2.0.0 -- An enhanced Interactive Python.
? -> Introduction and overview of IPython's features.
%quickref -> Quick reference.
help -> Python's own help system.
object? -> Details about 'object', use 'object??' for extra details.
@seanjensengrey
seanjensengrey / append2.py
Created May 1, 2014 03:11
100 threads that append a random number to a list 20000 times
import thread
import time
import random
big_list = []
thread_status = {}
def appendo(n):
thread_status[thread.get_ident()] = "running"
for x in xrange(n):
@seanjensengrey
seanjensengrey / microtest.py
Created May 4, 2014 16:27
minimal test harness for python (nose like)
import types
def test_foo():
assert 1 == 2, '1 must equal 2'
def test_bar():
pass
if __name__ == "__main__":
test_funcs = []

Java and Spatialite on Centos 6.5

All instructions/links/version are valid as of Oct 15, 2014

Here is how I got up-and running with the Xerial JDBC driver and libspatialite on a Centos 6.5 x86_64 box. This was tested on a instance of the Hortonworks Sandbox

Getting the “Native Libraries” (sqlite3/libspatialite)

Installing required YUM Repositories