Skip to content

Instantly share code, notes, and snippets.

View alienrobotwizard's full-sized avatar

Esme Mora alienrobotwizard

  • BetterLesson
  • California
View GitHub Profile
#!/usr/bin/env ruby
#
# Installing rsruby gem:
#
# sudo apt-get install r-base
# sudo gem install rsruby -- --with-R-dir=/usr/lib/R --with-R-include=/usr/share/R/include
# sudo ln -s /usr/lib/R/lib/libR.so /usr/lib/libR.so
# export R_HOME=/usr/lib/R
#
g++ -I XOPSupport -l Madlib.dll XOPStandardHeaders.h MCL_ScanningStage.h Madlib.h MCL_ScanningStage.c MCL_ScanningStageWinCustom.rc MCL_ScanningStage.rc
<Keyspace Name="UserIDCache">
<KeysCachedFraction>0.01</KeysCachedFraction>
<ColumnFamily CompareWith="UTF8Type" Name="UserID"/>
<ColumnFamily CompareWith="UTF8Type" Name="UserSearchID"/>
<ColumnFamily CompareWith="UTF8Type" Name="UserScreenName"/>
<ReplicaPlacementStrategy>org.apache.cassandra.locator.RackUnawareStrategy</ReplicaPlacementStrategy>
<ReplicationFactor>1</ReplicationFactor>
<EndPointSnitch>org.apache.cassandra.locator.EndPointSnitch</EndPointSnitch>
</Keyspace>
#!/usr/bin/env ruby
require 'rubygems'
require 'wukong'
class LetterMapper < Wukong::Streamer::LineStreamer
def map_text text
h = { }
idx = 0
case
when options[:map]
mapper_klass.new(self.options).stream
+ when options[:reduce] && options[:reduce_command]
+ system options[:reduce_command]
when options[:reduce]
reducer_klass.new(self.options).stream
when options[:run]
cat /data/anal/ford/ford_tweets| cut -f 3 | egrep -i "((FORD|MERCURY).*(FIESTA|MUSTANG|FUSION|TAURUS|FLEX|EDGE|ESCAPE|EXPEDITION|SPORT.*TRAC|EXPLORER|MILAN|MARINER|MOUNTAINEER|GRANDE?.*MARQUIS|TRACER)|#MAZDA|#FORDDRIVE|(@|#)?WEDDINGROADTRIP|(@|#)?INVISIBLEPEOPLE|(@|#)?PLAIDNATION)" | wc -l