Skip to content

Instantly share code, notes, and snippets.

View BBI-YggyKing's full-sized avatar

Yossarian King BBI-YggyKing

  • Blackbird Interactive
  • Vancouver, Canada
View GitHub Profile
@BBI-YggyKing
BBI-YggyKing / Pool.cs
Created December 18, 2015 20:28
A simple object pool. #speedcode
public class Pool<T> where T : new()
{
private readonly T[] mPool;
private int mNextAvailable;
public Pool(int capacity)
{
mPool = new T[capacity];
for (int i = 0; i < capacity; ++i)
{
@BBI-YggyKing
BBI-YggyKing / ILSpyAddInSamples.cs
Last active April 26, 2016 16:23
Test cases for ILSpy Visual Studio add-in "Open code in ILSpy" feature.
using System;
using System.Collections;
using System.Collections.Generic;
/// Sample source file indicating a wide variety of code elements that should work
/// with the "Open code in ILSpy" Visual Studio add-in feature. Each code element is
/// commented with the string generated by CodeElementXmlDocKeyProvider.GetKey and
/// used with the ILSpy /navigateTo command line option.
///
/// Note that this code is not compiled or used in the project in any way, it is
@BBI-YggyKing
BBI-YggyKing / pi.bat
Last active March 13, 2021 23:28
Happy π Day!
@echo off
REM https://www.mathscareers.org.uk/calculating-pi
setlocal
set /A "U=1<<27"
set I=1
set /A P=3*U
set Q=0
:start
set /A D=(I*2)*(I*2+1)*(I*2+2)
set /A T=4*U/D