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
public class RavenController : Controller | |
{ | |
private static IDocumentStore documentStore; | |
public static IDocumentStore DocumentStore | |
{ | |
get | |
{ | |
if(documentStore == null) | |
{ |
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.Linq; | |
using System.Text; | |
using Raven.Abstractions.Data; | |
using Raven.Abstractions.Indexing; | |
using Raven.Client.Bundles.MoreLikeThis; | |
using Raven.Client.Indexes; | |
using Raven.Json.Linq; | |
using Xunit; |
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
private static User FindUser(DocumentStore docStore, string query) | |
{ | |
using (var session = docStore.OpenSession()) | |
{ | |
var q = session.Query<User>("Users/Search") | |
.Search(x=>x.Name, query); | |
var user = q.FirstOrDefault(); | |
if (user != null) |
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.Linq; | |
using Orders; | |
using Raven.Abstractions.Indexing; | |
using Raven.Client.Indexes; | |
namespace RavenDB.Course.Nov2015 | |
{ | |
public class Users_Search : | |
AbstractIndexCreationTask<User, Users_Search.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
using System; | |
using System.Linq; | |
using Raven.Abstractions.Indexing; | |
using Raven.Client; | |
using Raven.Client.Indexes; | |
using Xunit; | |
namespace Raven.Tests.MailingList | |
{ | |
public class NullableIssue : RavenTest |
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.Net.Http; | |
using System.Threading; | |
using System.Threading.Tasks; | |
using System.Web.Http; | |
using System.Web.Http.Controllers; | |
using Raven.Client; | |
using Raven.Client.Document; | |
namespace Webinars.Controllers |
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
uint32_t x = 25426435u; | |
std::cout << x << std::endl; | |
uint32_t a = (x >> 17); | |
uint32_t b = (x << 15); | |
std::cout <<a << " " << b << " " << (a | b) << std::endl; | |
//OUTPUT: | |
// 25426435 | |
// 193 4244733952 4244734145 |
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.Linq; | |
using Raven.Abstractions.Smuggler; | |
using Raven.Client.Indexes; | |
using Raven.Database.Smuggler; | |
using Raven.Tests.Helpers; | |
using Xunit; | |
namespace RavenTests | |
{ |
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.Concurrent; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
using System.Threading.Tasks; | |
namespace ConsoleApplication2 | |
{ | |
class Program |
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
public class ProperlyFlushFileStream : FileStream | |
{ | |
[DllImport("kernel32.dll")] | |
static extern bool FlushFileBuffers(IntPtr hFile); | |
public void FSync() | |
{ | |
base.Flush(false); | |
if(!FlushFileBuffers(SafeFileHandle)) |