Skip to content

Instantly share code, notes, and snippets.

View kpko's full-sized avatar

Kevin Preller kpko

View GitHub Profile
def armijo_step(xi,alpha,beta,gamma):
k = 1
c = 0
s = - grad(xi)
left lambda: cost(xi + alpha*k*s) - cost(xi)
right lambda: alpha*k*gamma*np.dot(grad(xi).T,alpha*s)
while left() > right():
k = k * beta
meerkat
aardvark
addax
alligator
alpaca
anteater
antelope
aoudad
ape
argali
@kpko
kpko / SynchronousExecutionUtility.cs
Created December 31, 2018 16:08
Utility class to execute a workflow synchronously via WorkflowCore
public class SynchronousWorkflowExecutionResult
{
public string WorkflowId { get; set; }
public string WorkflowInstanceId { get; set; }
public string Reference { get; set; }
public LifeCycleEvent LastLifeCycleEvent { get; set; }
}
public class SynchronousWorkflowExecutionUtility
{
[][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]][([][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]])[+!+[]+[+[]]]+([][[]]+[])[+!+[]]+(![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[+!+[]]+([][[]]+[])[+[]]+([][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]])[+!+[]+[+[]]]+(!![]+[])[+!+[]]]((+(!+[]+!+[]+!+[]+[!+[]+!+[]]))[(!![]+[])[+[]]+(!![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]])[+!+[]+[+[]]]+(+![]
@kpko
kpko / MergeExtensions.cs
Last active August 29, 2015 14:21
.NET: Merge statement for lists
public static void Merge<T>(this IEnumerable<T> from, IEnumerable<T> into,
Action<T> newItem = null, Action<T> existingItem = null, Action<T> removedItem = null,
IEqualityComparer<T> comparer = null)
{
if (newItem != null)
{
var newItems = from.Except(into, comparer).ToList();
foreach (var item in newItems)
{
@kpko
kpko / ProjectionEqualityComparer.cs
Last active August 29, 2015 14:21
.NET: ProjectionEqualityComparer<T>
public class ProjectionEqualityComparer<T> : IEqualityComparer<T>
{
Func<T, object> _projector;
public ProjectionEqualityComparer(Func<T, object> projector)
{
this._projector = projector;
}
public bool Equals(T x, T y)
{
@kpko
kpko / index.html
Created March 7, 2015 20:18
ngRoute example with two views
<!DOCTYPE html>
<html>
<head lang="en">
<meta charset="UTF-8">
<title></title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.3.14/angular.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.3.14/angular-route.js"></script>
</head>
<body ng-app="myApp">
<a href="#/pms">PMs</a> | <a href="#/pms/5">PM Box</a>