Skip to content

Instantly share code, notes, and snippets.

Russell Jurney rjurney

Block or report user

Report or block rjurney

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View gist:188661
{"type":"date-time-series","values":[{"type":"simple-date-value","seriesName":"series Monthly","timestamp":"2008-09-01T00:00:00.000Z","value":},{"type":"simple-date-value","seriesName":"series Monthly","timestamp":"2008-10-01T00:00:00.000Z","value":},{"type":"simple-date-value","seriesName":"series Monthly","timestamp":"2008-11-01T00:00:00.000Z","value":},{"type":"simple-date-value","seriesName":"series Monthly","timestamp":"2008-12-01T00:00:00.000Z","value":},{"type":"simple-date-value","seriesName":"series Monthly","timestamp":"2009-01-01T00:00:00.000Z","value":},{"type":"simple-date-value","seriesName":"series Monthly","timestamp":"2009-02-01T00:00:00.000Z","value":},{"type":"simple-date-value","seriesName":"series Monthly","timestamp":"2009-03-01T00:00:00.000Z","value":},{"type":"simple-date-value","seriesName":"series Monthly","timestamp":"2009-04-01T00:00:00.000Z","value":},{"type":"simple-date-value","seriesName":"series Monthly","timestamp":"2009-05-01T00:00:00.000Z","value":},{"type":"simple-date-val
@rjurney
rjurney / gist:671889
Created Nov 11, 2010
How do I one-liner fill this hash in, so that there are no missing "start_years" ?
View gist:671889
irb(main):168:0> records = experience_client.get('principal designer')['by_years']
=> [{"total"=>13, "start_years"=>0}, {"total"=>12, "start_years"=>1}, {"total"=>18, "start_years"=>2}, {"total"=>13, "start_years"=>3}, {"total"=>17, "start_years"=>4}, {"total"=>19, "start_years"=>5}, {"total"=>16, "start_years"=>6}, {"total"=>17, "start_years"=>7}, {"total"=>14, "start_years"=>8}, {"total"=>16, "start_years"=>9}, {"total"=>14, "start_years"=>10}, {"total"=>11, "start_years"=>11}, {"total"=>8, "start_years"=>12}, {"total"=>11, "start_years"=>13}, {"total"=>9, "start_years"=>14}, {"total"=>11, "start_years"=>15}, {"total"=>9, "start_years"=>16}, {"total"=>8, "start_years"=>17}, {"total"=>8, "start_years"=>18}, {"total"=>6, "start_years"=>19}, {"total"=>7, "start_years"=>20}, {"total"=>3, "start_years"=>21}, {"total"=>5, "start_years"=>22}, {"total"=>6, "start_years"=>23}, {"total"=>2, "start_years"=>24}, {"total"=>1, "start_years"=>27}, {"total"=>1, "start_years"=>28}, {"total"=>1, "start_years"=>29}, {"total"=
@rjurney
rjurney / pacer_rewrite_test.rb
Created May 10, 2011
Creating a new summary graph from an old one...
View pacer_rewrite_test.rb
#
# The purpose of this script is to experiment with Pacer/Tinkerpop stack for
# graph transformation. In it we will summarize a much larger graph to produce
# a new, smaller graph that can fit into RAM via TinkerGraph for more rapid,
# real-time analysis.
#
require 'rubygems'
require 'pacer'
require 'pacer-neo4j'
@rjurney
rjurney / enron_summarize.rb
Created May 13, 2011
Summarizing the Enron Data
View enron_summarize.rb
#!`which jruby`
#
# The purpose of this script is to experiment with Pacer/Tinkerpop stack for
# graph transformation. In it we will summarize a much larger graph to produce
# a new, smaller graph that can fit into RAM via TinkerGraph for more rapid,
# real-time analysis.
#
require 'rubygems'
@rjurney
rjurney / enron_summarize.rb
Created May 13, 2011
Summarizing the Enron Data
View enron_summarize.rb
#!`which jruby`
#
# The purpose of this script is to experiment with Pacer/Tinkerpop stack for
# graph transformation. In it we will summarize a much larger graph to produce
# a new, smaller graph that can fit into RAM via TinkerGraph for more rapid,
# real-time analysis.
#
require 'rubygems'
@rjurney
rjurney / enron_play.rb
Created May 13, 2011
Playing with Enron Summaries
View enron_play.rb
#!`which jruby`
require 'rubygems'
require 'pacer'
graph = Pacer.tg
graph.import("/tmp/enron_summary.xml")
# Focus on one email address, that of Tim Belden
sender = graph.get_vertices.filter(:address => 'tim.belden@enron.com')
@rjurney
rjurney / works.rb
Created May 13, 2011
Playing with Pacer
View works.rb
#!`which jruby`
require 'rubygems'
require 'pacer'
graph = Pacer.tg
graph.import("/tmp/enron_summary.xml")
# Focus on one email address, that of Tim Belden
sender = graph.v.filter(:address => 'louise.kitchen@enron.com')
View Reults of JRuby --profile -S test_subgraph.rb
tinkergraph[vertices:317 edges:11520]
main thread profile results:
Total time: 55.92
total self children calls method
----------------------------------------------------------------
46.08 0.00 46.08 1 Pacer::Core::Graph::ElementRoute#subgraph
46.08 0.00 46.08 1 Pacer::Routes::PathsRoute#subgraph
46.08 0.00 46.08 1 Pacer::Routes::BulkOperations#bulk_job
@rjurney
rjurney / Fast-k-cores
Created Jun 5, 2011
Solution to slow subgraph problem :)
View Fast-k-cores
require 'graph_client'
require 'pacer'
client = GraphClient.new
k = 16
graph = client.get "louise.kitchen@enron.com"
#k_nodes = graph.v.filter{|v| v.out_e.count > k}.result
#subgraph = k_nodes.out_e.in_v.only(k_nodes).subgraph
@rjurney
rjurney / bash_profile
Created Dec 3, 2011
Adding Avro jars to CLASSPATH
View bash_profile
pig_version=0.9.1
export CLASSPATH=$CLASSPATH:~/pig-${pig_version}/build/ivy/lib/Pig/avro-1.4.1.jar:~/pig-${pig_version}/build/ivy/lib/Pig/json-simple-1.1.jar:~/pig-${pig_version}/contrib/piggybank/java/piggybank.jar:~/pig-${pig_version}/build/ivy/lib/Pig/jackson-core-asl-1.6.0.jar:~/pig-${pig_version}/build/ivy/lib/Pig/jackson-mapper-asl-1.6.0.jar
You can’t perform that action at this time.