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
#!/usr/bin/env ruby | |
module Enumerable | |
# sum of an array of numbers | |
def sum | |
return self.inject(0){|acc,i|acc +i} | |
end | |
# average of an array of numbers | |
def average |
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
Running official cassandra 1.1.0 binary | |
======================================= | |
at org.apache.cassandra.db.columniterator.SSTableSliceIterator.<init>(SSTableSliceIterator.java:58) | |
at org.apache.cassandra.db.filter.SliceQueryFilter.getSSTableColumnIterator(SliceQueryFilter.java:66) | |
at org.apache.cassandra.db.filter.QueryFilter.getSSTableColumnIterator(QueryFilter.java:78) | |
at org.apache.cassandra.db.CollationController.collectAllData(CollationController.java:233) | |
at org.apache.cassandra.db.CollationController.getTopLevelColumns(CollationController.java:61) | |
at org.apache.cassandra.db.ColumnFamilyStore.getTopLevelColumns(ColumnFamilyStore.java:1273) | |
at org.apache.cassandra.db.ColumnFamilyStore.getColumnFamily(ColumnFamilyStore.java:1155) |
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
/opt/ruby/ruby-1.9.2-p290/lib/ruby/gems/1.9.1/gems/thrift-0.8.0/lib/thrift/transport/socket.rb:109:in `read': CassandraThrift::Cassandra::Client::TransportException | |
from /opt/ruby/ruby-1.9.2-p290/lib/ruby/gems/1.9.1/gems/thrift-0.8.0/lib/thrift/transport/base_transport.rb:87:in `read_all' | |
from /opt/ruby/ruby-1.9.2-p290/lib/ruby/gems/1.9.1/gems/thrift-0.8.0/lib/thrift/transport/framed_transport.rb:104:in `read_frame' | |
from /opt/ruby/ruby-1.9.2-p290/lib/ruby/gems/1.9.1/gems/thrift-0.8.0/lib/thrift/transport/framed_transport.rb:69:in `read_into_buffer' | |
from /opt/ruby/ruby-1.9.2-p290/lib/ruby/gems/1.9.1/gems/thrift-0.8.0/lib/thrift/protocol/binary_protocol.rb:190:in `read_i32' | |
from /opt/ruby/ruby-1.9.2-p290/lib/ruby/gems/1.9.1/gems/thrift-0.8.0/lib/thrift/protocol/binary_protocol.rb:116:in `read_message_begin' | |
from /opt/ruby/ruby-1.9.2-p290/lib/ruby/gems/1.9.1/gems/thrift-0.8.0/lib/thrift/client.rb:45:in `receive_message' | |
from /home/paul/.bundler/ruby/1.9.1/c |
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
Retrieving com/google/guava/guava-collections/r03/guava-collections-r03.pom (1k) | |
from http://repo1.maven.org/maven2/ | |
Checksum validation failed, expected eaa856fdfbf53342d48d9e48e09bb7056151beb5 but is 4542f475c395917cb2b572549e0804f23695a648 | |
Retrieving com/google/guava/guava-collections/r03/guava-collections-r03.pom (1k) | |
from http://repo1.maven.org/maven2/ | |
Could not transfer artifact com.google.guava:guava-collections:pom:r03 from/to central (http://repo1.maven.org/maven2): Checksum validation failed, expected eaa856fdfbf53342d48d9e48e09bb7056151beb5 but is 4542f475c395917cb2b572549e0804f23695a648 | |
Could not find artifact com.google.guava:guava-collections:pom:r03 in clojars (https://clojars.org/repo/) |
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
irb(main):001:0> nil.foobar | |
NoMethodError: undefined method `foobar' for nil:NilClass | |
from (irb):1:in `evaluate' | |
from org/jruby/RubyKernel.java:1083:in `eval' | |
from /opt/ruby/jruby-1.6.7.2/lib/ruby/1.8/irb.rb:158:in `eval_input' | |
from /opt/ruby/jruby-1.6.7.2/lib/ruby/1.8/irb.rb:271:in `signal_status' | |
from /opt/ruby/jruby-1.6.7.2/lib/ruby/1.8/irb.rb:155:in `eval_input' | |
from org/jruby/RubyKernel.java:1410:in `loop' | |
from org/jruby/RubyKernel.java:1183:in `catch' | |
from /opt/ruby/jruby-1.6.7.2/lib/ruby/1.8/irb.rb:154:in `eval_input' |
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
If nodetool repair has not been run often enough to the point that GCGraceSeconds has passed, you | |
risk forgotten deletes (see DistributedDeletes). In addition to data popping up that has been deleted, | |
you may see inconsistencies in data return from different nodes that will not self-heal by read-repair | |
or further nodetool repair. Some further details on this latter effect is documented in CASSANDRA-1316. |
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
#!/bin/bash | |
current_branch=`git rev-parse --abbrev-ref HEAD` | |
if [ "$1" != "" ] && [ "$current_branch" != "$1" ]; then | |
# not syncing current branch | |
git fetch upstream && git push `whoami` upstream/$1:$1 | |
else |
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
$ ruby types_usage.rb | |
Fermenting the cheese for 5 days! | |
Fermenting the cheddar for 0.5 days! | |
./types.rb:7:in `types': Expected #<Walrus:0x7f7e71bb4328> to be a Cheese, but was a Walrus (ArgumentError) | |
from types_usage.rb:1:in `each' | |
from types_usage.rb:1:in `each_slice' | |
from ./types.rb:5:in `each' | |
from ./types.rb:5:in `each_slice' | |
from ./types.rb:5:in `each' | |
from ./types.rb:5:in `types' |
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
#!/usr/bin/ruby | |
current_dir = File.expand_path(File.dirname(__FILE__)) | |
files_dir = File.join(current_dir, "files") | |
files = Dir[File.join(files_dir, "*")] + Dir[File.join(files_dir, ".[^\.]*")] | |
files.each do |file| | |
command = "ln -sfF #{file} $HOME/." | |
puts command | |
`#{command}` |
We can make this file beautiful and searchable if this error is corrected: Illegal quoting in line 2.
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
{ | |
"title":"foo", | |
"version":"1.0.0", | |
"tags":[ | |
"Tag1", | |
"Tag2" | |
], | |
"location":{ | |
"disposition":"fixed", | |
"ele":"23.0", |
OlderNewer