View CustomGroupBox.cs
public class CustomGroupBox : Panel
{
public enum BorderStyles
{
GroupBox = 0,
Panel
}
public enum HeaderMode
{
None = 0,
View GetProcessorInfo.cs
private static Dictionary<string, string> GetProcessorInfo()
{
ManagementObjectCollection moc;
var Processor = new Dictionary<string, string>();
try
{
moc = new ManagementObjectSearcher("select * from Win32_Processor").Get();
}
catch
View CalculateThisPCGFLOPS.cs
public static double CalculateThisPCGFLOPS()
{
const int Flops = 10_000_000;
const int Loops = 10;
var etl = new List<double>();
var random = new Random();
var begE1 = Enumerable.Range(0, Flops).AsParallel().WithDegreeOfParallelism(Environment.ProcessorCount).Select(i => random.NextDouble()).ToArray();
var mulE1 = Enumerable.Range(0, Flops).AsParallel().WithDegreeOfParallelism(Environment.ProcessorCount).Select(i => random.NextDouble()).ToArray();
for(var loop = 0; loop < Loops; ++loop)
{
View SmartI.cs
public class SmartI
{
private readonly Dictionary<int, Smart> _smartInfo = new Dictionary<int, Smart>();
public readonly HashSet<int> FutureReserchUnknownAttributes = new HashSet<int>();
private static bool Is64Bit => IntPtr.Size == 8;
private static uint OffsetSize => Is64Bit ? 8u : 6u;
public Dictionary<int, Smart> SmartInfo
{
get
{
View PDiskInformation.cs
public class PDiskInformation
{
private Dictionary<string, PhysicalDiskStruct> _pdiCache = new Dictionary<string, PhysicalDiskStruct>();
public Dictionary<string, PhysicalDiskStruct> PDiskInfo
{
get
{
if(_pdiCache.Count == 0)
_pdiCache = GetDiskPI();
return _pdiCache;
View bigsqrt.cs
public BigInteger Sqrt(BigInteger n)
{
var q = BigInteger.One << ((int)BigInteger.Log(n, 2) >> 1);
var m = BigInteger.Zero;
while (BigInteger.Abs(q - m) >= 1)
{
m = q;
q = (m + n / m) >> 1;
}
return q;
View ConcurrentHashSet.cs
[Serializable]
public class ConcurrentHashSet<T> : IReadOnlyCollection<T>, ICollection<T>
{
private readonly IEqualityComparer<T> _comparer;
private readonly bool _growLockArray;
private int _budget;
private volatile Tables _tables;
public ConcurrentHashSet()
: this(DefaultConcurrencyLevel, 16, true, null)
{
View PolyNomial.cs
public class PolyNomial
{
public int[] _coefficients;
public PolyNomial()
{
}
public PolyNomial(int degree)
{
_coefficients = new int[degree];
}
View GetObjBytes.cs
public static byte[] GetObjBytes(object obj, Type type = null)
{
Type _type;
if (type == null)
_type = obj.GetType();
else
_type = type;
switch (_type.Name)
{
case "Byte":
View TinyHashSet.cs
public class TinyHashSet<T> : IEnumerable<T>
{
private readonly IEqualityComparer<T> _comparer;
private int[] _hashBuckets;
private uint[] _hashcodes;
private int[] _next;
public T[] Items;
public int Version;
public TinyHashSet() : this(1, EqualityComparer<T>.Default)
{