This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'java' | |
require 'jbundler' | |
require 'stunted' | |
%w{ PersistentArrayMap, PersistentHashMap, PersistentHashSet, PersistentList, | |
PersistentQueue, PersistentStructMap, PersistentTreeMap, PersistentTreeSet, | |
PersistentVector }.each do |data_structure| | |
java_import "clojure.lang.#{ data_structure }" | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- mode: ruby -*- | |
# vi: set ft=ruby : | |
Vagrant::Config.run do |config| | |
config.vm.box = "precise32" | |
config.vm.network :hostonly, "33.33.33.10" | |
config.vm.provision :chef_client do |chef| | |
chef.chef_server_url = "https://api.opscode.com/organizations/#{ENV['ORGNAME']}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
map = [ | |
#general | |
{name: "Patient Control ID", value: nil}, | |
{name: "SSN", value: nil}, | |
{name: "Other ID", source: :ldap, source_name: "datatelid"}, | |
{name: "Last Name", source: :ldap, source_name: "sn"}, | |
{name: "First Name", source: :ldap, source_name: "givenName"}, | |
{name: "Middle Initial", source: :ldap, source_name: "initials", mapper: Proc.new {|v| v[0]}}, | |
{name: "Sex", source_name: "gender", source: :ods}, | |
{name: "Address", source: :ods, source_name: ["home_address_line_1","home_address_line_2"], mapper: Proc.new{|v| v.join " "}}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
./rfc101.txt: ISO-8859 English text | |
./rfc1061.txt: ASCII text | |
./rfc1182.txt: ASCII text | |
./rfc1260.txt: ASCII text | |
./rfc1305.txt: ISO-8859 English text | |
./rfc14.txt: ASCII text | |
./rfc1489.txt: ASCII FORTRAN program text | |
./rfc159.txt: ASCII text | |
./rfc16.txt: ASCII text | |
./rfc162.txt: ASCII Pascal program text |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# encoding: utf-8 | |
merged_file = File.open("rfc-all.txt", "w") | |
Dir.entries(".").each do |file| | |
if (file != "rfc-all.txt" and File.extname(file) == ".txt") | |
merged_file.print "#{ file }\t" | |
File.open(file).each do |line| | |
merged_file.print line.chomp.delete "\t" | |
end | |
merged_file.print "\n" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ERROR - caught Throwable, no trap available, rethrowing | |
cascading.pipe.OperatorException: [803c4175-eb65-4168-bec...][cascalog.workflow$buffer$fn__572.invoke(workflow.clj:249)] operator Every failed executing operation: ClojureBuffer[decl:'?minhash-sig'] | |
at cascading.flow.stream.BufferEveryWindow.receive(BufferEveryWindow.java:139) | |
at cascading.flow.stream.BufferEveryWindow.receive(BufferEveryWindow.java:41) | |
at cascading.flow.hadoop.stream.HadoopGroupGate.run(HadoopGroupGate.java:90) | |
at cascading.flow.hadoop.FlowReducer.reduce(FlowReducer.java:129) | |
at org.apache.hadoop.mapred.ReduceTask.runOldReducer(ReduceTask.java:463) | |
at org.apache.hadoop.mapred.ReduceTask.run(ReduceTask.java:411) | |
at org.apache.hadoop.mapred.LocalJobRunner$Job.run(LocalJobRunner.java:215) | |
Caused by: java.lang.StackOverflowError |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defmapcatop [extract-shingles [k]] [line] (shingles k line)) | |
(defmapop [multihash [n]] [shingle] | |
[(map (fn [seed] | |
(.asInt (.hashString (Hashing/murmur3_32 seed) shingle))) | |
(range n))]) | |
(defn merge-vectors | |
[v1 v2] | |
(map #(map min %1 %2) v1 v2)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(def books | |
{{:title "Eloquent Ruby" :tags [:ruby]} | |
{:title "Design Patterns in Ruby" :tags [:ruby :oop]} | |
{:title "Practical Object-Oriented Design in Ruby" :tags [:ruby :oop]} | |
{:title "Let Over Lambda" :tags [:common-lisp :lisp :fp]} | |
{:title "Pearls of Functional Algorithms" :tags [:haskell :fp]} | |
{:title "Functional Data Structures" :tags [:ml :haskell :fp]} | |
{:title "Learn You a Haskell for Great Good" :tags [:haskell :fp]} | |
{:title "The Little MLer" :tags [:ml :fp]} | |
{:title "Hadoop: The Definitive Guide" :tags [:java :hadoop :data]} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; matrix M | |
;; 0 1 2 3 | |
;; ========== | |
;; 0: 1 0 0 1 | |
;; 1: 0 0 1 0 | |
;; 2: 0 1 0 1 | |
;; 3: 1 0 1 1 | |
;; 4: 0 0 1 0 | |
;; index correspond to checking rows of M |