Skip to content

Instantly share code, notes, and snippets.

View jsmorph's full-sized avatar

Jamie Stephens jsmorph

View GitHub Profile
@jsmorph
jsmorph / desc.txt
Last active December 19, 2015 22:28
QCEW Examples
# java -jar qcew.jar desc ENU0603700562441_77Y
{:id "ENU0603700562441_77Y",
:size "0: All establishment sizes",
:owner "5: Private",
:ind "62441: NAICS 62441 Child day care services",
:agg "77: County, NAICS 5-digit -- by ownership sector",
:area "06037: Los Angeles County, California",
:span "Year"}
@jsmorph
jsmorph / MutationHook.java
Last active December 19, 2015 02:09
Accumulo mutation hook that publishes mutations to Redis
package org.apache.accumulo.examples.simple.constraints;
import java.util.Collections;
import java.util.List;
import org.apache.accumulo.core.constraints.Constraint;
import org.apache.accumulo.core.data.Mutation;
public class MutationHook implements Constraint {
@jsmorph
jsmorph / ClojureSeqCombiner.java
Last active December 19, 2015 01:39
A Clojure-driven, seq-based Accumulo Combiner
/*
* 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
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@jsmorph
jsmorph / HistCombiner.java
Last active December 19, 2015 01:09
Histogram Accumulo Combiner
/*
* 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
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@jsmorph
jsmorph / logicrels-fred.clj
Created July 6, 2012 18:50
St. Louis Fed FRED relation for clojure.core.logic
(ns logicrels.fred
(:require [clojure.xml :as xml]
[clojure.core.logic :as logic]))
;; (config :fred-key (do "See http://api.stlouisfed.org/api_key.html" nil))
;; (clojure.pprint/pprint (sort-by :date (fred-test "DGS10" "2012-07-02")))
;; ({:target "1.61", :date "2012-05-31", :value "1.59"}
;; {:target "1.61", :date "2012-06-01", :value "1.47"}
@jsmorph
jsmorph / logicrels-lucene.clj
Created July 6, 2012 14:01
Lucenalog: Datalog interface to Lucene in 10 lines
(ns lucenalog.core
"Lucenalog = Datalog interface to Lucene in 10 lines.
Simple but powerful.
Use
(db/add (index) {:a \"foo\" :b \"bar\"})
to index a map with Lucene. Then you can use the relation