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
let buildTrigrams (s : string) = | |
s | |
|> Seq.windowed 3 | |
|> Seq.map (fun s -> System.String s) | |
|> Seq.toArray | |
//buildTrigrams "ABCDEFGHIJK" | |
let hitPercent (s : string) (tg : string array) = | |
let matchCount = |
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
void Main() | |
{ | |
var result = | |
from g in AllGames() | |
let _ = Sort(g.Goals) | |
select new { Team1 = g.Team1, Team2 = g.Team2, Goals = g.Goals }; | |
result.Dump(); | |
} | |
// Define other methods and classes here |
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
#if INTERACTIVE | |
#r "System.Net.Http" | |
#endif | |
module MimeTip | |
open System.IO | |
open System.Net.Http | |
open System.Runtime.InteropServices |
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
#r "System.ComponentModel.Composition" | |
#if INTERACTIVE | |
#r "../Pretzel.exe" | |
#r "LibSass.x86.dll" | |
#r "libsassnet.dll" | |
#endif | |
open System.ComponentModel.Composition | |
open Pretzel.Logic.Extensibility | |
open Pretzel.Logic.Templating.Context |
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
#r @"C:\Users\TBurger\Downloads\UnityEngine.dll" | |
open UnityEngine | |
module Unity = | |
[<AutoOpen>] | |
module Log = | |
let inline uprintfn fmt = | |
Printf.kprintf Debug.Log fmt |
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
#r "System.Speech" | |
open System.Speech.Synthesis | |
let synt = new SpeechSynthesizer() | |
// synt.Rate <- 5 // schneller mochn! | |
let say s = synt.Speak(s: string) | |
[1 .. 100] | |
|> List.map (fun n -> | |
match n%3, n%5 with |
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
module Reflection = | |
open Microsoft.FSharp.Quotations | |
open Microsoft.FSharp.Quotations.Patterns | |
open System.Reflection | |
let private (|Name|) (info: MemberInfo) = info.Name | |
let private (|PropertyName|_|) = function | |
| PropertyGet (_, Name name, _) -> Some name | |
| _ -> None |
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
<?php | |
function diff($array1, $array2, $compare_func) { | |
return array_diff_ukey($array1, $array2, function($key1, $key2) use ($array1, $array2, $compare_func) { | |
if (!isset($array1[$key1])) return 1; | |
if (!isset($array2[$key2])) return -1; | |
return $compare_func($array1[$key1], $array2[$key2]); | |
}); | |
} |
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
static class EnumerableExtensions | |
{ | |
public static IEnumerable<T> Distinct<T, TProperty>( | |
this IEnumerable<T> source, | |
Expression<Func<T, TProperty>> propertyExpression) | |
{ | |
return source.Distinct( | |
new PropertyExpressionComparer<T, TProperty>(propertyExpression)); | |
} |
OlderNewer