This file contains hidden or 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
| #time "on" | |
| open System | |
| open System.IO | |
| open System.Collections.Generic | |
| let input = | |
| File.ReadAllLines(__SOURCE_DIRECTORY__ + "/../data/input07.txt") | |
| |> Seq.toList |
This file contains hidden or 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
| open System | |
| open System.IO | |
| let input = | |
| File.ReadAllLines(__SOURCE_DIRECTORY__ + "input06.txt") | |
| |> Seq.head | |
| |> Seq.toArray | |
| // First solution uses "windowed" function. It is not memory efficient because it allocates large number of arrays | |
| // (the number of allocated arrays is approximately the count of characters in input string) |
This file contains hidden or 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 Serilog; | |
| using Serilog.Sinks.Grafana.Loki; | |
| namespace LokiMemoryTest | |
| { | |
| internal class Logger | |
| { | |
| public static ILogger Create() | |
| { | |
| return new LoggerConfiguration() |
This file contains hidden or 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
| [12:26:44][Step 2/21] Starting: C:\Windows\system32\cmd.exe /c dotnet gitversion /output buildserver /b refs/heads/use-gitversion | |
| [12:26:44][Step 2/21] in directory: C:\BuildAgent\work\3f54bead41b5db4e | |
| [12:26:44][Step 2/21] INFO [10/11/21 12:26:44:57] Working directory: C:\BuildAgent\work\3f54bead41b5db4e | |
| [12:26:44][Step 2/21] INFO [10/11/21 12:26:44:59] Branch from build environment: 9c96c02dabd37958ecc9c267f6ed27d75decf286 | |
| [12:26:44][Step 2/21] INFO [10/11/21 12:26:44:59] Project root is: C:\BuildAgent\work\3f54bead41b5db4e\ | |
| [12:26:44][Step 2/21] INFO [10/11/21 12:26:44:59] DotGit directory is: C:\BuildAgent\work\3f54bead41b5db4e\.git | |
| [12:26:44][Step 2/21] INFO [10/11/21 12:26:44:60] Begin: Normalizing git directory for branch '9c96c02dabd37958ecc9c267f6ed27d75decf286' | |
| [12:26:44][Step 2/21] INFO [10/11/21 12:26:44:63] One remote found (origin -> 'https://github.com/nrkno/distribution-oddjob'). | |
| [12:26:44][Step 2/21] INFO [10/11/21 12:26:44:63] Skipping fetching, if GitVersion does not calculate your vers |
This file contains hidden or 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 ProtobufSerializationTests | |
| open System | |
| open System.IO | |
| open ProtoBuf | |
| open Xunit | |
| module ProtoBufUtils = | |
| [<ProtoContract>] |
This file contains hidden or 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 rec loop lastSavedSnapshotSequenceNr = | |
| actor { | |
| let! msg = mailbox.Receive() | |
| let effect = deliverer.Receive (upcast mailbox) msg | |
| if effect.WasHandled() | |
| then | |
| return effect | |
| else | |
| return | |
| match msg with |
This file contains hidden or 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 PhobosBootstrapper = | |
| module AppInsights = | |
| let createMetrics (mb : IMetricsBuilder) = | |
| let metrics = mb.Configuration.Configure (fun opts -> | |
| opts.GlobalTags.Add("host", Dns.GetHostName()) | |
| opts.DefaultContextLabel <- "akka.net" | |
| opts.Enabled <- true | |
| opts.ReportingEnabled <- true) | |
| let metrics = |
This file contains hidden or 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 TwentyThree = | |
| open System | |
| let testInput = "389125467" | |
| let input = "942387615" | |
| let cups = (Seq.map ((fun x -> x.ToString()) >> Int32.Parse) input) |> Seq.toList | |
| let rec findDestination (cups : int list) pickup destination = | |
| if not (pickup |> List.contains destination) then |
This file contains hidden or 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 TwentyOne = | |
| open System | |
| open System.IO | |
| let parseFood (line : string) = | |
| let splitter = " (contains " | |
| let splitIndex = line.IndexOf splitter | |
| let ingredients = | |
| line.Substring(0, splitIndex).Split(' ') |> Set |
This file contains hidden or 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 Nineteen = | |
| open System | |
| open System.IO | |
| open System.Text.RegularExpressions | |
| type RuleContent = | |
| | Char of string | |
| | Rules of int array array |