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 Message = | IHaveAValue | |
| ILostMyValue | |
[<ReferenceEquality>] | |
type Constraint = Constraint of (Message -> unit) | |
let forEachExcept (except:obj) (procedure: Constraint -> unit) (list: Constraint list) = | |
let rec loop (items: Constraint list) = | |
match items with | |
| [] -> () | |
| h::t when System.Object.ReferenceEquals(h,except) -> loop t |
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 Action = unit->unit | |
type Wire = (bool ref) * (Action list ref) | |
let getSignal ((s,_):Wire) : bool = s.Value | |
let setSignal ((s,fs):Wire) (signal:bool) = | |
if s.Value <> signal | |
then s.Value <- signal | |
List.iter (fun f->f()) fs.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
type Stream<'a> = | Nil | Cons of 'a * Lazy<Stream<'a>> | |
module Stream = | |
let cons a b = Cons(a,b) | |
let singleton a = cons a (Lazy.CreateFromValue(Nil)) | |
let empty = Nil | |
let isEmpty = function | |
| Nil -> true | |
| Cons(a,_) -> false |
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 Var = VarC of int | |
type ObjT = | |
| Int of int | |
| Str of string | |
| Bool of bool | |
| Null | |
type Term = | |
| Var of Var |
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
# %% | |
from skimage import io | |
import numpy as np | |
import matplotlib.pyplot as plt | |
url_astronaut = ('https://raw.githubusercontent.com/scikit-image/scikit-image/' | |
'master/skimage/data/astronaut.png') | |
astro = io.imread(url_astronaut) | |
print("Type:", type(astro), "Shape:", astro.shape, "Data type:", astro.dtype) |
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 QuantumComplex; | |
IMPORT Log, Math; | |
TYPE | |
Complex = RECORD | |
r,i:REAL | |
END; | |
PROCEDURE (VAR c: Complex) Init*(r,i:REAL), NEW; |
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
namespace ConsoleApp7 | |
{ | |
public class AsyncMonitor | |
{ | |
private readonly SemaphoreSlim signal = new SemaphoreSlim(1, 1); | |
public void Exit() | |
{ | |
try |
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.Security.Cryptography; | |
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
#r "nuget: FSharp.Charting, 2.1.0" | |
#r "nuget: System.Windows.Forms, 4.0.0" | |
#r "System.Windows.Forms.DataVisualization" | |
#r "nuget: FSharp.Control.Reactive, 5.0.2" | |
open System | |
open FSharp.Control.Reactive | |
open FSharp.Charting | |
open System.IO.Ports |
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": "project1", | |
"version": "0.1.0", | |
"private": true, | |
"dependencies": { | |
"bootstrap": "^4.1.3", | |
"jquery": "^3.4.1", | |
"merge": "^1.2.1", | |
"oidc-client": "^1.9.0", | |
"react": "^16.0.0", |