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
var DomWriter = function (target, namespace) { | |
var instance = this; | |
var template = namespace; | |
var coalesce = function( value, defaultValue ) { | |
return typeof(value) != 'undefined' ? | |
value : defaultValue; | |
}; | |
this.isObject = function( value ) { |
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
Action<IList<XElement>> saveAction = SaveChunk; | |
var loader = new BulkPostLoader(@"e:\stackoverflow\062010 so\posts.xml"); | |
var batches = loader.BufferWithCount(5000); | |
var results = batches.Select(x => saveAction.BeginInvoke(x, null, null)); | |
results | |
.Aggregate(new HashSet<IAsyncResult>(), (set, result) => | |
{ | |
set.RemoveWhere(x => x.IsCompleted); | |
set.Add(result); |
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
sys = require "sys" | |
rabbit = require "amqp" | |
console.log "Connecting to rabbit..." | |
connection = rabbit.createConnection { host: "localhost", port: 5672 } | |
connection.on "ready", () -> | |
exchangeOptions = { type: "fanout", autoDelete: true } | |
connection.exchange( |
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
handle_request(Req) -> | |
#req{uri={_,Uri}} = Req:raw(), | |
Ext=filename:extension(Uri), | |
handle_request(Req, Uri, Ext). | |
handle_request(Req, _Uri, []) -> | |
Segments = Req:resource([urldecode]), | |
Method = get_atom(Req:get(method)), | |
[Resource|Arguments]=Segments, | |
ResourceModule = get_atom(Resource), |
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
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
Assimilate | |
.Core<StructureMapAdapter>() | |
.AddConsoleLogger<RiakService>( x => x.Info().MessageLayout( m => m.Message().Newline() ) ) | |
.Messaging() | |
.Daemon( x => x.Arguments( args ).Name( "Riak Demo" ) ) | |
.Riak( x => x.AddNode( r => r.Address( "192.168.1.100" ) ) ) |
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
using System; | |
using System.Collections.Generic; | |
using Symbiote.Core; | |
using Symbiote.Http; | |
using Symbiote.Http.Impl; | |
using Symbiote.Http.Owin; | |
using Symbiote.StructureMap; | |
using Symbiote.Daemon; | |
using Symbiote.Messaging; | |
using Symbiote.Actor; |
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
using System; | |
using System.Collections.Generic; | |
using System.Diagnostics; | |
using System.Linq; | |
using System.Threading; | |
using System.Threading.Tasks; | |
using Machine.Specifications; | |
namespace ringbuffer | |
{ |
NewerOlder