Skip to content

Instantly share code, notes, and snippets.

open Akka.Actor
open Akka.Streams
open Akkling.Streams
open System
type Image = Image of string
let imageJob delay jobName (Image image) =
async {
printfn "%s Started: %s" jobName image
[<AutoOpen>]
module UoM =
// Units of measure for other than integral types
let inline (++) (w: ^W when ^W: (static member IsMeasureAbbrev: ^tm * ^t -> unit)) (t: ^t) = (# "" t: ^tm #)
let inline (--) (w: ^W when ^W: (static member IsMeasureAbbrev: ^tm * ^t -> unit)) (tm: ^tm) = (# "" tm: ^t #)
[<MeasureAnnotatedAbbreviation>]
type Guid<[<Measure>] 'm> = Guid
package main
import (
"log"
"runtime"
"sync"
"time"
)
func main() {
[<AutoOpen>]
module StringBuffer =
open System.Text
type StringBuffer = StringBuilder -> unit
type StringBufferBuilder () =
member inline _.Yield (txt: string) = fun (b: StringBuilder) -> b.Append txt |> ignore
member inline _.Yield (c: char) = fun (b: StringBuilder) -> b.Append c |> ignore
import kotlinx.coroutines.*
import kotlinx.coroutines.flow.*
import java.io.File
import java.io.IOException
import kotlin.coroutines.resumeWithException
@ExperimentalCoroutinesApi
suspend fun startProcess(cmd: String, workingDir: File): Process = suspendCancellableCoroutine { cont ->
try {
val process =
// download https://drive.google.com/file/d/1kXYcIkDMX25km5YtSBfFa9Xxx2dx8cNB/view?usp=sharing locally
using System;
using System.IO;
using System.Security.Cryptography.X509Certificates;
namespace EccSigNet5
{
static class Program
{
forAll { (i: Array[Char]) => {
val sb = new StringBuilder
for (c <- i) {
c match {
case '\\' => sb += '\\' += '\\'
case '"' => sb += '\\' += '"'
case _ => sb += c
}
}
val expected = sb.toString

Yesod

https://github.com/vasily-kirichenko/yesod-one

$ wrk -c100 -t10 -d30s --latency http://localhost:3000
Running 30s test @ http://localhost:3000
  10 threads and 100 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency    23.16ms   13.36ms  96.95ms   73.41%
open BenchmarkDotNet.Attributes
open BenchmarkDotNet.Running
open System
open ExtCore.Control
[<MemoryDiagnoser>]
type Test() =
let choiceFun x y = x |> Choice.bind (fun _ -> y)
let resultFun x y = x |> Result.bind (fun _ -> y)
2019-01-25 11:04:29
Full thread dump OpenJDK 64-Bit Server VM (25.152-b26 mixed mode):
"ApplicationImpl pooled thread 763" #2017 daemon prio=4 os_prio=-1 tid=0x000000004b056800 nid=0x4d90 waiting on condition [0x0000000070bcf000]
java.lang.Thread.State: TIMED_WAITING (parking)
at sun.misc.Unsafe.park(Native Method)
- parking to wait for <0x00000000aa188de0> (a java.util.concurrent.SynchronousQueue$TransferStack)
at java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:215)
at java.util.concurrent.SynchronousQueue$TransferStack.awaitFulfill(SynchronousQueue.java:460)
at java.util.concurrent.SynchronousQueue$TransferStack.transfer(SynchronousQueue.java:362)