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
// @mdl | |
let rec kahan_sum_aux (xs : float list) (sum : float) (c : float) = | |
match xs with | |
| [] -> sum | |
| x::xs -> | |
let y = x - c in | |
let t = sum + y in | |
let c = (t - sum) - y in | |
kahan_sum_aux xs t c |
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
- name: Add the CouchDB repository | |
apt_repository: | |
repo: deb https://apache.bintray.com/couchdb-deb bionic main | |
state: present | |
update_cache: no | |
- name: Install the CouchDB repository key | |
apt_key: | |
keyserver: keyserver.ubuntu.com | |
id: 8756C4F765C9AC3CB6B85D62379CE192D401AB61 |
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 SharedMemory | |
open MBrace.FsPickler | |
module Rpc = | |
type RpcContext<'command, 'message> = | |
{ name: string; buffer: RpcBuffer; post: 'command -> Async<'message>} with | |
interface IDisposable with | |
member this.Dispose() = this.buffer.Dispose() | |
let createHost name (handler : 'command -> Async<'message>) = |
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 createComparer (map) = | |
{ | |
new EqualityComparer<_>() with | |
override this.Equals(a, b) = Unchecked.equals (map a) (map b) | |
override this.GetHashCode(a) = Unchecked.hash (map a) | |
} | |
module Seq = | |
let exceptWith map first second = | |
Enumerable.Except(first, second, createComparer map) |
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
// Fisher–Yates shuffle | |
let shuffle deck = | |
let n = Array.length deck | |
let rnd = new Random() | |
let pick n = rnd.Next n | |
let swap i j = | |
let a,b = deck.[i], deck.[j] | |
Array.set deck j a | |
Array.set deck i b |
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
static double SunModel(double td, double tm, double Tmin, double Tmax, double time_scale = 24) | |
{ | |
//http://www.comsiru.uct.ac.za/sites/default/files/image_tool/images/333/Research/Downloads/Mono_8.pdf | |
return -Sin(2 * PI * (td + tm) / time_scale) * ((Tmax - Tmin) / 2) + ((Tmax + Tmin) / 2); | |
} |
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 HtmlAgilityPack.FSharp | |
open HtmlAgilityPack | |
let parent (node : HtmlNode) = | |
node.ParentNode | |
let element name (node : HtmlNode) = | |
node.Element name |
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
<?xml version="1.0" encoding="UTF-16"?> | |
<Task version="1.2" xmlns="http://schemas.microsoft.com/windows/2004/02/mit/task"> | |
<Triggers> | |
<EventTrigger> | |
<Enabled>true</Enabled> | |
<Subscription><QueryList><Query Id="0" Path="Application"><Select Path="Application">*[System[Provider[@Name='.NET Runtime'] and EventID=1026]]</Select></Query></QueryList></Subscription> | |
<ValueQueries> | |
<Value name="eventChannel">Event/System/Channel</Value> | |
<Value name="eventRecordID">Event/System/EventRecordID</Value> | |
<Value name="eventSeverity">Event/System/Level</Value> |
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
# Discussion at https://github.com/dotnet/sdk/issues/2295 | |
function Uninstall-DotNetSdk { | |
param ( | |
[parameter(Mandatory = $False)] [switch] $All, | |
[parameter(Mandatory = $False)] [switch] $WhatIf | |
) | |
pushd $env:SystemRoot\System32 | |
Get-ChildItem HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall | | |
Get-ItemProperty | |
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
{ | |
// Use IntelliSense to learn about possible attributes. | |
// Hover to view descriptions of existing attributes. | |
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 | |
"version": "0.2.0", | |
"configurations": [ | |
{ | |
"name": "(Windows) Launch", | |
"type": "cppvsdbg", | |
"request": "launch", |
NewerOlder