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 Azure.Storage; | |
using Azure.Storage.Files.DataLake; | |
using Azure.Storage.Files.DataLake.Models; | |
using System; | |
using System.Collections.Generic; | |
using System.IO; | |
using System.Threading.Tasks; | |
namespace CopyToBlob | |
{ |
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 | |
type Number = uint | |
let radixPointBits = 8 | |
let minusOne = UInt32.MaxValue | |
let negateSlow (n:Number) : Number = | |
let mutable res = 0u | |
for i in 0u..n do |
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 Number = Zero | Succ of Lazy<Number> | |
let swap f a b = f b a | |
let toOption = function | |
| Zero -> None | |
| r -> Some(r) | |
let rec fold (f:('State -> 'State)) (state: 'State) (n: Number) : 'State = | |
match n 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
//dont forget to sudo update-ca-certificates after certificate download from yandex cloud | |
public class ClickHouseConnection | |
{ | |
public string Host { get; } | |
public string User { get; } | |
public string Password { get; } | |
public string Db { get; } | |
public ClickHouseConnection(string host, string user, string password, string db) |
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
//networks | |
let rec from x = Seq.unfold (fun x -> Some(x,x+1)) x | |
let rec filter n xs = Seq.filter (fun m -> (m % n) <> 0) xs | |
let rec sieve (xs:seq<int>) = | |
let m = Seq.head xs | |
seq{yield m; yield! sieve <| filter m (Seq.tail xs) } | |
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 findSentence (matcher:'e->'a-> 'a-> bool * 'e) (matcherEnv:'e) (sentences:'a list list) (target:'a) = | |
printfn "searching target %A in %A" target sentences | |
match sentences with | |
| [] -> None | |
| (name::subTargets)::sentences -> | |
let matched, resMatcherEnv = matcher matcherEnv name target | |
if matched then Some(subTargets,sentences, resMatcherEnv) | |
else findSentence matcher matcherEnv sentences target | |
| _::t -> findSentence matcher matcherEnv t target |
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 | |
let scale (n3: int16) (n2: int16) (n1: int16) : int16 = (int n1) * (int n2) / (int n3) |> int16 | |
let percent = scale 100s | |
let percent20 = percent 20s | |
let r = percent20 50s//10s |
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 Force.Crc32 | |
open System.Text | |
open Murmur | |
open HashLib | |
let check keys e name = | |
let hsahes = new HashSet<string>() | |
let stopWatch = System.Diagnostics.Stopwatch.StartNew() |
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 System; | |
using System.Collections.Generic; | |
using System.Diagnostics; | |
using System.Linq; | |
using System.Text; | |
using System.Threading.Tasks; | |
namespace Dkstra | |
{ | |
class Program |
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 "System.Drawing.dll" | |
module Bitmap = | |
open System | |
open System.IO | |
open System.Drawing | |
open System.Drawing.Imaging | |
let toArray (image:Bitmap) = | |
Array2D.init image.Width image.Height (fun i j -> image.GetPixel(i,j)) | |