Skip to content

Instantly share code, notes, and snippets.

View badamczewski's full-sized avatar
🙃

Bartosz badamczewski

🙃
View GitHub Profile
@badamczewski
badamczewski / BitSet.cs
Created December 1, 2020 13:08
BloomFilter Source Code
using System;
using System.Collections.Generic;
using System.Text;
namespace ProbabilisticDataStructures.DataStructures
{
public class BitSet
{
private ulong[] bitset;
public int Size { get; private set; }
@badamczewski
badamczewski / Morph.cs
Created December 1, 2020 14:11
Text Morphing in WPF
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Media;
using System.Windows.Media.Animation;
namespace WPFAnimations
@badamczewski
badamczewski / bitset.cs
Created November 10, 2020 20:19
Bit Set
public class BitSet
{
private ulong[] bitset;
public int Size { get; private set; }
public BitSet(int size)
{
bitset = new ulong[(size / 64) + 1];
Size = size;
}
diff --git a/src/PowerUp.Core/Decompilation/JITExtensions.cs b/src/PowerUp.Core/Decompilation/JITExtensions.cs
index 88b3397..0f18362 100644
--- a/src/PowerUp.Core/Decompilation/JITExtensions.cs
+++ b/src/PowerUp.Core/Decompilation/JITExtensions.cs
@@ -5,23 +5,18 @@ using System.Runtime.CompilerServices;
using System.Text;
using PowerUp.Core.Console;
using System.Linq;
+using System.Runtime.InteropServices;
using PowerUp.Core.Decompilation.Attributes;
@badamczewski
badamczewski / nullable.asm
Created January 26, 2022 10:43
Nullable
public int? A(int? x, int? y) {
int? sum = 0;
for(int i = 0; i < 1000; i++)
sum += x + y;
return sum.Value;
}
public int? B(int? x, int? y) {
int? sum = 0;
@badamczewski
badamczewski / bench.cs
Last active August 4, 2021 20:56
Bench
using BenchmarkDotNet.Attributes;
using BenchmarkDotNet.Configs;
using BenchmarkDotNet.Running;
using System;
using System.Diagnostics;
using System.Runtime.CompilerServices;
using System.Threading.Tasks;
using System.Linq;
using System.Collections.Generic;
public class Bench92
{
public int[] _x = null;
[GlobalSetup]
public void Setup()
{
_x = new int[10000];
}
public class Bench92
{
public int[] _x = null;
[GlobalSetup]
public void Setup()
{
_x = new int[10000];
}
public class Bench92
{
[Benchmark(Baseline = true)]
[MethodImpl(MethodImplOptions.NoInlining)]
[Arguments(0)]
public int A(int x)
{
try { _ = 1; } catch { }
for (int i = 0; i < 10000; i++) {
x++; x++; x++; x++;
public class Bench92
{
[Benchmark(Baseline = true)]
[MethodImpl(MethodImplOptions.NoInlining)]
[Arguments(0)]
public int A(int x)
{
try { _ = 1; } catch { }
for (int i = 0; i < 1000; i++)
x++;