Skip to content

Instantly share code, notes, and snippets.

View ayende's full-sized avatar

Ayende Rahien ayende

View GitHub Profile
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.IO.Compression;
using System.Linq;
using System.Threading.Tasks;
using Lucene.Net.Analysis.Standard;
using Lucene.Net.Documents;
Raven.Tests.FileSystem.Notifications.NotificationsReceivedWhenFileRenamed 15414
Raven.Tests.FileSystem.Notifications.NotificationReceivedWhenFileUpdated 1019
Raven.Tests.FileSystem.Notifications.NotificationsIsReceivedWhenConfigIsUpdated 684
Raven.Tests.FileSystem.Notifications.NotificationsIsReceivedWhenConfigIsDeleted 783
Raven.Tests.FileSystem.Notifications.NotificationReceivedWhenFileDeleted 908
Raven.Tests.FileSystem.Notifications.NotificationsAreOnlyReceivedForFilesInGivenFolder 2552
Raven.Tests.FileSystem.Notifications.NotificationReceivedWhenFileAdded 906
Raven.Tests.FileSystem.StorageOperationsTests.Should_remove_file_deletion_config_after_storage_cleanup 746
Raven.Tests.FileSystem.StorageOperationsTests.Should_resume_file_renaming_from_client 914
Raven.Tests.FileSystem.StorageOperationsTests.Should_not_delete_downloading_file_if_synchronization_retry_is_being_performed 723
<!doctype html>
<meta charset="utf-8">
<title>HyParView visualization</title>
<link rel="stylesheet" href="http://cpettitt.github.io/project/dagre-d3/latest/demo/demo.css">
<script src="http://d3js.org/d3.v3.min.js" charset="utf-8"></script>
<script src="http://cpettitt.github.io/project/dagre-d3/latest/dagre-d3.js"></script>
<style id="css">
[Fact]
public void CanQueryMapReduceIndex_WithUpdates()
{
using (var store = NewDocumentStore())
{
store.DatabaseCommands.PutIndex("TagCloud",
new IndexDefinition
{
Map =
@"
@ayende
ayende / Program.cs
Created July 22, 2011 05:59
Sample of what appears to be a memory leak in the WCF Discovery
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Net.Security;
using System.ServiceModel;
using System.ServiceModel.Discovery;
using System.Text;
using System.Threading.Tasks;
public class ConcurrentLeastFrequentlyUse<T> where T : class
{
private readonly int[] generationSizes;
private readonly ConcurrentQueue<T>[] queues;
public ConcurrentLeastFrequentlyUse(params int[] generationSizes)
{
this.generationSizes = generationSizes;
queues =new ConcurrentQueue<T>[generationSizes.Length];
}
public T GetCache<T>(string id)
{
return Cache[id] ??
Cache[id] = Session.Get<T>(id);
}
@ayende
ayende / gist:1186051
Created September 1, 2011 12:14 — forked from Andrea/gist:1186006
namespace ravenConsole
{
using System;
using System.Linq;
using Raven.Client.Document;
using Raven.Client.Indexes;
using Xunit;
public class DocumentsTests
{
@ayende
ayende / Program.cs
Created December 15, 2011 12:58
Test file to see why Esent takes big files
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using Microsoft.Isam.Esent.Interop;
namespace EsentSize
{
class Program
results = RavenSession.Query<Suppliers_QueryIndex.ReduceResult, Suppliers_QueryIndex>()
.Where(x => x.LocationName == location)
.Search(x => x.Query, string.Join(" ", suggestions))
.Search(x => x.Query, term +"*")
.Take(5 - ravenResults.Count)
.As<Supplier>()
.ToList();