I hereby claim:
- I am banker on github.
- I am hwaet (https://keybase.io/hwaet) on keybase.
- I have a public key ASAz4KeG_T7Aeq6EJ727hEqaMlBSGzGBzx1iwJEONZLoQwo
To claim this, I am signing this object:
var customerAggregations = provider.AggregationSet<Customer>(); | |
customerAggregations.Apply(x =>x.RecordShell.Age + 3, | |
"AgeInThreeYears"); |
public static String script = "" + | |
"local key = KEYS[1]" + | |
"local field = ARGV[1]" + | |
"local value = ARGV[2]" + | |
"local op = ARGV[3]" + | |
"local current = redis.call('hget', key, field)" + | |
"if (current == null) then " + | |
" redis.call('hset', key, field, value)" + | |
"elseif op == '>' then" + | |
" if tonumber(value) > tonumber(current) then" + |
I hereby claim:
To claim this, I am signing this object:
x = 10000.times.to_a | |
a,b,c = x.dup, x.dup, x.dup | |
Benchmark.measure { 1000.times { out = []; out += a; out += b; out +=c; out.uniq! } } | |
Benchmark.measure { 1000.times { out = Set.new; out += a; out += b; out +=c; } } | |
Benchmark.measure { 1000.times { out = {}; a.each {|e| out[e] ||= 1}; b.each {|e| out[e] ||= 1}; c.each {|e| out[e] ||= 1}; } } |
> db.f.save({u: 1, v: 2}) | |
> db.f.save({u: 2, v: 2}) | |
> db.f.save({u: 1, v: 5}) | |
> db.f.save({u: 2, v: 10}) | |
> m = function() { emit(this.u, this.v) } | |
function () { | |
emit(this.u, this.v); | |
} | |
> r = function(k, vs) { r = 0; vs.forEach(function(v) { r += v; }); return r; } | |
function (k, vs) { |
#include <stdio.h> | |
#include "mongo.h" | |
int main() { | |
mongo conn[1]; | |
int status = mongo_connect( conn, "127.0.0.1", 27017 ); | |
if( status != MONGO_OK ) { | |
switch ( conn->err ) { | |
case MONGO_CONN_SUCCESS: printf( "connection succeeded\n" ); break; |
module Mongo | |
class Collection | |
def map_reduce(map, reduce, opts={}) | |
map = BSON::Code.new(map) unless map.is_a?(BSON::Code) | |
reduce = BSON::Code.new(reduce) unless reduce.is_a?(BSON::Code) | |
raw = opts.delete(:raw) | |
hash = BSON::OrderedHash.new | |
hash['mapreduce'] = self.name |
#include "mongo.h" | |
#include "bson.h" | |
int main() { | |
bson query[1], empty[1]; | |
mongo conn[1]; | |
int res; | |
mongo_cursor *cursor; | |
mongo_replset_init(conn, "test-rs"); |
#!/usr/bin/env ruby | |
require 'rubygems' | |
require 'bundler/setup' | |
require 'mongo' | |
@conn = Mongo::Connection.new | |
@db = @conn['supply_chain_development'] | |
puts @db['properties'].find.to_a.size |