Skip to content

Instantly share code, notes, and snippets.

View adriang133's full-sized avatar

Adrian Buzea adriang133

View GitHub Profile
@adriang133
adriang133 / CustomLogicalExpressions.cs
Created February 3, 2016 08:46
Custom implemtentation of logical expressions
namespace CustomLogicalExpressions
{
public enum LogicalOperator
{
And, Or, Xor, Not
}
public abstract class LogicalExpression
{
public bool Evaluate(params string[] parameters)
{
@adriang133
adriang133 / test.cs
Created February 3, 2016 08:47
Performance test
LogicalExpression testCustomExp = CustomLogicalExpressionHelper.ParseXml(testP);
Expression exp = LogicalExpressionHelper.ParseXml(testP);
var expParams = LogicalExpressionHelper.GetParameters(exp);
LambdaExpression lambda = Expression.Lambda(exp, expParams.Keys);
Delegate d = lambda.Compile();
string[] parameters = new string[] {"a", "b", "d", "e" };
int numberOfTests = 100000;
@adriang133
adriang133 / plot_inter.py
Last active January 9, 2020 11:38
Multiplier adjustment vs budget fill rate interactive graph
import numpy as np
import matplotlib.pyplot as plt
from matplotlib.widgets import Slider
BUDGET_FILLING_CAP_THRESHOLD = 0.97
BUDGET_FILL_ROLLING_WINDOW = 30
def ease_in_out_sine(x):
@adriang133
adriang133 / ToggleHDRCatalina.applescript
Last active May 3, 2021 13:22 — forked from lexrus/ToggleHDRCatalina.applescript
Workaround the HDR bug of macOS Catalina 10.15.4
#!/usr/bin/osascript
tell application "System Preferences"
activate
end tell
tell application "System Events"
tell process "System Preferences"
activate
delay 1
click menu item "Displays" of menu "View" of menu bar 1