This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{-# LANGUAGE OverloadedStrings #-} | |
module Example where | |
import Language.Marlowe.Extended | |
main :: IO () | |
main = print . pretty $ contract | |
-- Define the parties involved | |
seller, buyer, arbiter, market :: Party |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{-# LANGUAGE OverloadedStrings #-} | |
module Escrow where | |
import Language.Marlowe.Extended | |
main :: IO () | |
main = print . pretty $ contract | |
-- We can set explicitRefunds True to run Close refund analysis | |
-- but we get a shorter contract if we set it to False |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Data.Common; | |
using System.Linq; | |
using System.Text; | |
using Microsoft.SqlServer.TransactSql.ScriptDom; | |
using NPoco; | |
public class SystemCheckQueryInterceptor : IExecutingInterceptor | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
########################################################################### | |
#Install VirtualBox https://www.virtualbox.org/wiki/Downloads | |
#Install Vagrant https://www.vagrantup.com/downloads.html | |
#Rename this file to Vagrantfile (no extension) | |
#In your favorite shell, navigate to the directory with this file | |
#type >> vagrant up | |
#wait for process to complete (will take a few minutes) | |
#once it is done, you can log into the virtual machine with | |
#username: vagrant password: vagrant |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
########################################################################### | |
#Install VirtualBox https://www.virtualbox.org/wiki/Downloads | |
#Install Vagrant https://www.vagrantup.com/downloads.html | |
#Rename this file to Vagrantfile (no extension) | |
#In your favorite shell, navigate to the directory with this file | |
#type >> vagrant up | |
#wait for process to complete (will take a few minutes) | |
#once it is done, you can log into the virtual machine with | |
#username: vagrant password: vagrant |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using NodaTime; | |
using NPoco; | |
public class NodaMapper : DefaultMapper | |
{ | |
public override Func<object, object> GetFromDbConverter(Type DestType, Type SourceType) | |
{ | |
if (DestType == typeof(Instant) || DestType == typeof(Instant?)) | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static class LevenshteinDistance | |
{ | |
/// <summary> | |
/// Compute the distance between two strings. | |
/// The distance between the strings is defined as the minimum | |
/// number of edits needed to transform one string into the other, | |
/// with the allowable edit operations being insertion, deletion, | |
/// or substitution of a single character. | |
/// </summary> | |
public static int CalculateDistance(string s, string t) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static string GenerateRandomString(int minLength, int maxLength, int minLCaseCount, int minUCaseCount, int minNumCount, int minSpecialCount) | |
{ | |
char[] randomString; | |
const string LCaseChars = "abcdefgijkmnopqrstwxyz"; | |
const string UCaseChars = "ABCDEFGHJKLMNPQRSTWXYZ"; | |
const string NumericChars = "23456789"; | |
const string SpecialChars = "*$-+?_&=!%{}/"; | |
Hashtable charGroupsUsed = new Hashtable(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
namespace ELO | |
{ | |
public class ELORanker | |
{ | |
private readonly IKResolver _kResolver; | |
public ELORanker() : this(new DefaultKResolver()){} |