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
"{0:N2} MB" -f ((((Invoke-WebRequest -uri http://localhost:8080/admin/stats -UseDefaultCredentials).Content | ConvertFrom-Json).LoadedDatabases | Measure-Object -Sum TotalDatabaseSize).Sum / 1MB) |
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
[<AutoOpen>] | |
module PropertyChangedBaseEx | |
open Caliburn.Micro | |
open System | |
open System.Linq.Expressions | |
open Microsoft.FSharp.Linq.QuotationEvaluation | |
open Microsoft.FSharp.Quotations | |
type PropertyChangedBase 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
from xy in Pois | |
where xy.Primarytype == "museen" | |
from xz in PoiDetails | |
where xz.PoiId == xy.Id && xz.Lang == "de" | |
from xw in InfoBoards | |
where xw.PoiDetailsId == xz.Id | |
select new | |
{ | |
SMGId = xy.Id, | |
SMGPoiname = xy.Nodename, |
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
(* see: http://stackoverflow.com/questions/6219726/throttled-async-download-in-f *) | |
open System | |
type ThrottlingAgentMessage<'a> = | |
| AddJob of Async<'a> * AsyncReplyChannel<'a> | |
| CompletedJob of 'a * AsyncReplyChannel<'a> | |
| Stop | |
type ThrottlingAgent<'a>(limit) = |
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
/// <summary>Removes Diacritics (tilde, cédille, umlaut and friends) from String</summary> | |
public static string RemoveDiacritics(this string s) | |
{ | |
string normalizedString = s.Normalize(NormalizationForm.FormD); | |
StringBuilder stringBuilder = new StringBuilder(); | |
for (int i = 0; i < normalizedString.Length; i++) | |
{ | |
char c = normalizedString[i]; | |
if (CharUnicodeInfo.GetUnicodeCategory(c) != UnicodeCategory.NonSpacingMark) |
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
/// Removes Diacritics (tilde, cédille, umlaut and friends) from String | |
let removeDiacritics (s: string) = | |
s.Normalize(NormalizationForm.FormD) | |
|> Seq.filter (fun c -> CharUnicodeInfo.GetUnicodeCategory c <> UnicodeCategory.NonSpacingMark) | |
|> Seq.fold (fun (sb: StringBuilder) c -> sb.Append c) (StringBuilder()) | |
|> string |
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
#I __SOURCE_DIRECTORY__ | |
#r "libs/NuGet.Core.dll" | |
#r "System.Xml.Linq" | |
open NuGet | |
open System | |
open System.IO | |
module NuGet = |
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
#nowarn "9" | |
module private Internals = | |
open System.Runtime.InteropServices | |
type CRED_TYPE = | |
| GENERIC = 1 | |
| DOMAIN_PASSWORD = 2 | |
| DOMAIN_CERTIFICATE = 3 |
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 |