Instantly share code, notes, and snippets.

View LabelMJS.cs
public class LabelMJS : Label
{
public enum Angles
{
/// <summary>
/// Normal drawing direction.
/// </summary>
LeftToRight = 0,
/// <summary>
/// Draw text top to bottom as viewed from the left.
View ByteArray.cs
public class ByteArray : IFormattable, IComparable, IComparable<ByteArray>, IEquatable<ByteArray>
{
public byte[] bytes;
public ByteArray() : this(0)
{
}
public ByteArray(int size)
{
bytes = new byte[size];
Active = true;
View IEnumerableStep.cs
public static class IEnumerableStep
{
/// <summary>
/// Generates a sequence of 8-bit signed numbers within a specified range starting at
/// 'form' through 'to' with a given step value.
/// </summary>
public static IEnumerable<sbyte> Step(this sbyte from, sbyte to, int step)
{
return Step(from, to, step).Select(i => i);
}
View MurMur3.cs
public class Murmur3 : HashAlgorithm
{
private ulong _h1;
private ulong _h2;
private ulong _length;
public Result Res;
public Result Seed;
public Murmur3() : this(new Result {H1 = 0, H2 = 0})
{
}
View CryptoRandomNumberGenerator.cs
[Serializable]
public class CryptoRandomNumberGenerator : RandomNumberGenerator
{
private const double DBi = 5.42101086242752E-20D;
private readonly RNGCryptoServiceProvider crng = new RNGCryptoServiceProvider();
public char NextChar()
{
return(char) (Sample() * char.MaxValue);
}
public char NextChar(char maxValue)
View BigStack.cs
[DebuggerTypeProxy(typeof(HashSetDebugViewInt<>))]
[DebuggerDisplay("Count = {Count}")]
[Serializable]
public class BigStack<T> : IEnumerable<T>
{
public BigArray<T> _array;
public BigStack() : this(BigArray<T>.Granularity)
{
}
public BigStack(ulong capacity)
View BigArray.cs
[Serializable]
public class BigArray<T> : IEnumerable<T>, IDisposable
{
private const int ShiftCount = 19;
public const ulong Granularity = 1 << 19;
private T[][] _arrays;
private bool _disposed;
private ulong _itemSize;
private ulong _numberOfArrays;
public string Tag;
View BigArray319.cs
[Serializable]
public class BigArray<T> : IEnumerable<T>, IDisposable
{
private const int ShiftCount = 19;
private const ulong Granularity = 1 << ShiftCount;
private readonly ulong _capacityHold;
private readonly GetObjectSize _gos = new GetObjectSize();
private T[][] _arrays;
private bool _disposed;
private ulong _itemSize;
View BigDictionary.cs
[DebuggerTypeProxy(typeof(HashSetDebugViewInt<>))]
[DebuggerDisplay("Count = {Count}")]
[Serializable]
public class BigDictionary<TKey, TValue> : IEnumerable<KeyValuePair<TKey, TValue>>
{
public BigSet<TKey> Keys;
public int Resizes;
public BigArray<TValue> Values;
public BigDictionary() : this(BigArray<TKey>.Granularity, new BigComparer<TKey>())
{
View BigHashSet.cs
[DebuggerTypeProxy(typeof(HashSetDebugViewInt<>))]
[DebuggerDisplay("Count = {Count}")]
[Serializable]
public class BigHashSet<T> : IEnumerable<T>
{
private readonly BigSet<T> _set;
public BigHashSet() : this(new BigComparer<T>())
{
}
public BigHashSet(IBigEqualityComparer<T> comparer)