Skip to content

Instantly share code, notes, and snippets.

View psurikov's full-sized avatar

Pavlo_Surikov psurikov

View GitHub Profile
/// <summary>
/// Subscribes collection child item events to some specific handler.
/// The logic of subscription and unsubscription can be complicated,
/// considering that you need to take into account collection changes,
/// new child items have to subscribe, while unused and removed items
/// need to unsubscribe.
/// </summary>
public class CollectionSubscription<TItem, THandler>
{
private Action<TItem> subscribe;
@psurikov
psurikov / Mongo db log
Created August 6, 2012 12:42
Mongo db log: cannot create a capped collection of size larger than 500MB
Mon Aug 06 15:31:34
Mon Aug 06 15:31:34 warning: 32-bit servers don't have journaling enabled by default. Please use --journal if you want durability.
Mon Aug 06 15:31:34
Mon Aug 06 15:31:34 versionCmpTest passed
Mon Aug 06 15:31:34 versionArrayTest passed
Mon Aug 06 15:31:34 shardObjTest passed
Mon Aug 06 15:31:34 shardKeyTest passed
Mon Aug 06 15:31:34 isInRangeTest passed
Mon Aug 06 15:31:34 [initandlisten] MongoDB starting : pid=2848 port=27017 dbpath=..\data 32-bit host=Cybertron
Mon Aug 06 15:31:34 [initandlisten]
public class Wrapper
{
public Wrapper(string value)
{
_value = value;
}
private string _value;
}
class Program
{
static Program()
{
var thread = new Thread(o => { });
thread.Start();
thread.Join();
}
static void Main()
@psurikov
psurikov / test.cs
Created July 29, 2011 08:04
Test for the stackoverflow chat
public class Test
{
public bool CheckIfAnyoneSeeMe()
{
return true;
}
}