Skip to content

Instantly share code, notes, and snippets.

View ReubenBond's full-sized avatar
🌞
building

Reuben Bond ReubenBond

🌞
building
View GitHub Profile
@ReubenBond
ReubenBond / veh_hook.cpp
Created December 19, 2017 22:58
INT3 Vectored Exception Handler hooking
/**
veh_hook Vectored Exception Handler hooking library
Version: 24-March-2008
**/
#define WINVER 0x0501
#define _WIN32_WINNT 0x0501
#include <windows.h>
#include "veh_hook.h"
static veh_list_t* list = NULL;
### Keybase proof
I hereby claim:
* I am reubenbond on github.
* I am reubenbond (https://keybase.io/reubenbond) on keybase.
* I have a public key ASCrV546-58t4XtSgwI9FTTzWNy2FpBV7scVBX7Qsdkq_Qo
To claim this, I am signing this object:
@ReubenBond
ReubenBond / VersionTolerantSerializer.md
Last active November 26, 2017 23:16
Proposal for a Version-Tolerant Serializer

Proposal for a Version-Tolerant Serializer

Orleans allows developers to send arbitrary, complex objects between remote processes with little or no prior knowledge of what those object might be. This flexibility & ease-of-use has been key to the success of Orleans, and it's certainly one of our strengths. Ideally, we want to stay out of the way of developers and let them be free to model their applications as they see fit.

Developers build applications with lifetimes ranging in the years and over that time these applications need to evolve. This often means evolving the kinds of objects which are sent between processes or stored and retrieved. One of Orleans' weaknesses is its currently poor support for this kind of evolution. Recently, we've implemented version tolerance for communication interfaces, but we still do not support evolution for object schemas.

Existing serialization libraries which support version tolerance tend to restrict how data is modelled, usually by providing a very restricted type sy

@ReubenBond
ReubenBond / notes.md
Created May 8, 2017 21:51
version tolerant serialization notes
  • Want a serialization library which:
    • Supports schema evolution (version tolerant)
    • Is suitable for persistence
    • Suports the rich type system of .NET (cyclic references, generics, polymorphism, referential equality)
    • Is fast and compact
    • Requires minimal effort to use
    • Supports safe/stable serialization of types which the user does not have control over and therefore cannot alter (eg, via surrogates)
    • Has a documented wire format
    • Supports serialization/deserialization context, so that we can deserialize GrainReferences using it and have them still have seamless access to the runtime.
  • Core concepts:
@ReubenBond
ReubenBond / Benchmarks.md
Last active March 30, 2017 10:37
CowDictionary
|       Method |                           Kind | Items |              Mean |          StdDev |            Median |     Gen 0 | Allocated |
|------------- |------------------------------- |------ |------------------ |---------------- |------------------ |---------- |---------- |
|        Write | CachedReadConcurrentDictionary |  1000 |   225,437.8898 ns |   2,301.2916 ns |   224,307.7639 ns |   19.9219 | 125.19 kB |
| RandomAccess | CachedReadConcurrentDictionary |  1000 |        38.1510 ns |       0.3593 ns |        38.1710 ns |         - |       0 B |
|      ForEach | CachedReadConcurrentDictionary |  1000 |    12,751.5773 ns |     581.2744 ns |    12,767.5491 ns |         - |      48 B |
|    WriteRead | CachedReadConcurrentDictionary |  1000 |        78.9771 ns |       0.9068 ns |        79.0207 ns |         - |       0 B |
|        Write |           ConcurrentDictionary |  1000 |   220,681.6271 ns |   3,044.1570 ns |   220,026.7558 ns |   19.9219 |  125.2 kB |
| RandomAccess |           ConcurrentDic
@ReubenBond
ReubenBond / ServiceFabricPropertyManagerMembershipProvider.cs
Created December 22, 2016 21:16
PropertyManager-based Cluster Membership provider for Service Fabric integration in Microsoft Orleans
namespace Microsoft.Orleans.ServiceFabric
{
using System;
using System.Collections.Generic;
using System.Fabric;
using System.Globalization;
using System.Linq;
using System.Net;
using System.Threading.Tasks;
namespace ServiceCommon.Utilities
{
using System;
using System.Collections;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Orleans.Runtime;
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Text;
using System.Threading;
using OrleansBenchmarks.Serialization;
namespace OrleansBenchmarks
{
using BenchmarkDotNet.Attributes;
@ReubenBond
ReubenBond / ILFieldBuilder.cs
Created October 12, 2016 01:58
Generating static fields on the fly in C# (for use in other codegen)
using System;
using System.Collections.Concurrent;
using System.Reflection;
using System.Reflection.Emit;
internal class ILFieldBuilder
{
private static readonly AssemblyBuilder AssemblyBuilder =
AssemblyBuilder.DefineDynamicAssembly(
new AssemblyName(nameof(ILFieldBuilder)),
@ReubenBond
ReubenBond / GuidJsonConverter.cs
Created January 7, 2016 10:25
Guid Json Converter for Orleans / Json.NET
using System;
using Newtonsoft.Json;
namespace ServiceCommon.Utilities.Serialization
{
/// <summary>
/// JSON converter for <see cref="Guid"/>.
/// </summary>
public class GuidJsonConverter : JsonConverter
{