Skip to content

Instantly share code, notes, and snippets.

View KallDrexx's full-sized avatar

Matthew Shapiro KallDrexx

  • Microsoft
View GitHub Profile
@KallDrexx
KallDrexx / gist:11094250
Created April 19, 2014 19:07
Daily Programmer 4/18/2014 challenge
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Scratchpad.DailyProgrammer
{
public class Dp20140418
{
@KallDrexx
KallDrexx / vector assertions.rs
Created August 29, 2016 02:54 — forked from anonymous/playground.rs
Shared via Rust Playground
//#![feature(trace_macros)]
//trace_macros!(true);
macro_rules! assert_vec_match{
(@empty $vector:expr) => {
if $vector.len() > 0 {
panic!("Expected an empty vector, but the vector contained {} elements", $vector.len());
}
};
@KallDrexx
KallDrexx / gist:b4d9e574ffcfede10a9422160f900817
Last active October 8, 2016 21:44
IEnumerable example 1
void Main()
{
var manager = new SessionManager();
manager.AddSession(new Session(1, 23, "Mobile"));
manager.AddSession(new Session(2, 99, "Web"));
manager.AddSession(new Session(3, 23, "Web"));
manager.AddSession(new Session(4, 55, "Mobile"));
manager.AddSession(new Session(5, 11, "Mobile"));
// .... other stuff happens
public interface IStringReader
{
IEnumerable<string> GetStrings();
}
public class InMemoryStringReader : IStringReader
{
private readonly string[] _strings;
public InMemoryStringReader(string[] strings)
@KallDrexx
KallDrexx / Execution
Created December 27, 2016 04:40
Beam message passing latency testing
{:ok, tracker} = MessageTest.Tracker.start_link
Enum.each(1..1000, fn _ -> MessageTest.P1.start_link(tracker, 16, 1000) end)
iex(9)> MessageTest.Tracker.get_results(tracker, 99.9)
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, ...]
@KallDrexx
KallDrexx / keybase.md
Created September 9, 2019 17:57
keybase.md

Keybase proof

I hereby claim:

  • I am kalldrexx on github.
  • I am kalldrexx (https://keybase.io/kalldrexx) on keybase.
  • I have a public key ASCRW-aqlFGs4R6g41rJlc4S4U8AdrIzlg7nYnfc1-6Viwo

To claim this, I am signing this object:

@KallDrexx
KallDrexx / Program.cs
Last active December 2, 2019 16:46
Vtable benchmark
using System;
using System.Runtime.CompilerServices;
using BenchmarkDotNet.Attributes;
using BenchmarkDotNet.Running;
namespace VtableVsSwitchBenchmark
{
class Program
{
static void Main(string[] args)
@KallDrexx
KallDrexx / output.txt
Created December 8, 2019 14:52
AoC Day 8 Part 2
C:/Users/me/.cargo/bin/cargo.exe run --color=always --package aoc2019 --bin aoc2019
Compiling aoc2019 v0.1.0 (C:\code\personal\aoc2019)
Finished dev [unoptimized + debuginfo] target(s) in 0.43s
Running `target\debug\aoc2019.exe`
[2, 1, 1, 0, 2, 1, 2, 2, 0, 1, 1, 1, 1, 0, 2, 0, 0, 2, 0, 2, 1, 0, 2, 2, 2, 0, 0, 2, 2, 0, 1, 0, 0, 0, 0, 1, 2, 2, 0, 0, 0, 2, 1, 1, 1, 0, 1, 1, 0, 0, 1, 0, 2, 0, 0, 1, 0, 0, 1, 2, 2, 1, 0, 0, 1, 2, 2, 0, 2, 2, 2, 2, 0, 2, 0, 0, 1, 1, 2, 1, 0, 0, 1, 1, 1, 2, 1, 0, 1, 0, 2, 1, 1, 0, 0, 2, 0, 0, 0, 0, 1, 2, 0, 0, 1, 0, 2, 1, 2, 0, 1, 0, 0, 2, 2, 0, 0, 0, 1, 2, 2, 2, 1, 0, 0, 1, 1, 0, 1, 1, 2, 2, 0, 2, 0, 2, 1, 1, 1, 0, 0, 0, 1, 0, 0, 2, 0, 1, 1, 2]
[2, 2, 2, 2, 2, 2, 0, 2, 2, 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 2, 2, 2, 2, 2, 2, 2, 2, 1, 2, 2, 1, 2, 2, 2, 2, 2, 2, 1, 2, 2, 2, 2, 1, 2, 2, 2, 2, 2, 0, 2, 2, 2, 1, 2, 2, 2, 2, 2, 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 2, 2, 2, 1, 2, 2, 2, 2, 1, 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 2, 0, 2, 2, 2, 2, 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2
@KallDrexx
KallDrexx / EmitterLogic.cs
Last active August 14, 2020 13:35
Particle Emitter CodeGen example
using System;
using System.Numerics;
using Parme.CSharp;
public class Test : IEmitterLogic
{
private readonly Random _random = new Random();
private float _timeSinceLastTrigger;
---------------------------
---------------------------
A plugin has had an error.
Shutting down the plugin Global ContentManager Helper Plugin version 1.0 at file location
C:\code\FlatRedBall\FlatRedBall\FRBDK\Glue\Glue\bin\x86\Debug\netcoreapp3.0\Plugins\OfficialPlugins\OfficialPluginsCore.dll
Additional information:
System.ArgumentException: Cannot check if a null file name is relative.