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
SELECT p.UpdatedUtc, p.LastReadTimeStampUtc, p.LastReadMeterValue, p.Unit, p.MeterPointId | |
FROM (SELECT UpdatedUtc, | |
LastReadTimeStampUtc, | |
LastReadMeterValue, | |
Unit, | |
MeterPointId, | |
rn = ROW_NUMBER() OVER (PARTITION BY MeterPointId ORDER BY UpdatedUtc DESC) | |
FROM AbsoluteMeterReadings | |
WHERE UpdatedUtc <= @until )as p | |
WHERE rn=1 |
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
public bool Start(HostControl host) | |
{ | |
// exceptions to be thrown on min thread | |
_mainTask.ContinueWith(x => | |
{ | |
throw x.Exception; | |
}, TaskContinuationOptions.OnlyOnFaulted); | |
_mainTask.Start(); | |
return true; | |
} |
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
--------------------------------------------------------------------- | |
Build Time Report | |
--------------------------------------------------------------------- | |
Target Duration | |
------ -------- | |
Clean 00:00:00.7735971 | |
RestoreNugetPackages 00:00:16.9486360 | |
Build 00:00:09.0179679 | |
BuildTest 00:00:57.5668270 | |
CoverXUnit2 00:00:23.2599174 |
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
#r "tools/FAKE/tools/FakeLib.dll" | |
open Fake | |
open Fake.Testing | |
open Fake.MSTest | |
open Fake.DotCover | |
open Fake.TeamCityHelper | |
open Fake.ZipHelper | |
open Fake.MSBuildHelper | |
"../.nuget/packages.config" |> RestorePackage (fun p -> { p with OutputPath = "tools" |
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.Collections.Generic | |
open System.IO | |
open System.Linq | |
open NAudio.Wave | |
open FSharp.Charting | |
let samplesPerSecond = 44100 | |
let duration = 10*1000 | |
let msDuration = duration*1000 |
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 ProgramSpillerGenerators | |
open System | |
open FsCheck | |
type ProgramId = string | |
type ConstrainedDate = DateTime | |
type Tolker = None | Tolk | Syns | |
type ProgramSpillerGenerators = | |
static member DateTimeInRange() = |
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 takeSkip2 (s: IEnumerable<byte>) (n: int) : (byte[] * IEnumerable<byte>) = | |
let c = Seq.cache s | |
(c |> Seq.truncate n |> Seq.toArray, c |> Seq.skip n) |
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
type EnumerableFromEnumerator(input: IEnumerator<byte> ) = | |
interface IEnumerable<byte> with | |
member this.GetEnumerator() = input | |
interface System.Collections.IEnumerable with | |
member this.GetEnumerator() = input :> System.Collections.IEnumerator | |
let takeSkip (sequence: IEnumerable<byte>) (n: int) : (byte[] * IEnumerable<byte>) = | |
let enumerator = sequence.GetEnumerator() | |
let data = Array.zeroCreate(n) | |
let rec readSequence i = |
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 | |
open System.Collections.Generic | |
type StreamingFileThingy(filename: string) = | |
let bufferlength = 4096 | |
let fs = new FileStream(filename, FileMode.Open, FileAccess.Read, FileShare.ReadWrite) | |
let rec infStream = seq { | |
let buffer = Array.zeroCreate<byte> bufferlength | |
let bytesRead = fs.Read(buffer,0,bufferlength) | |
if not (bytesRead = bufferlength) 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
let fileAsSeq filename = | |
let bufferlength = 4096 | |
let fs = new FileStream(filename, FileMode.Open, FileAccess.Read, FileShare.ReadWrite) | |
let rec infStream = seq { | |
let buffer = Array.zeroCreate<byte> bufferlength | |
let bytesRead = fs.Read(buffer,0,bufferlength) | |
if not (bytesRead = bufferlength) then | |
let smallerbuffer = Array.zeroCreate<byte> bytesRead | |
Array.Copy(buffer,0,smallerbuffer,0,bytesRead) | |
yield! smallerbuffer |