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 file = new System.IO.File.Open("foo.xml", System.IO.FileMode.Append) in | |
printfn "file still open" | |
printfn "file now closed/disposed" |
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 Color = Blue | Red | Green | White | Black | |
type Token = Color * int | |
type Bank = {balance:Token list} | |
type Card = {cost:Token list} | |
let canBuyThisOne oneBalance oneCost = | |
match oneBalance,oneCost with | |
| (bcolor,b), (ccolor,c) -> bcolor = ccolor && b>=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
<html> | |
<head> | |
<title>Simple html page</title> | |
<script>if (typeof(xyz) === "undefined") { console.log("head: xyz doesn't exist") } else { console.log("head: xyz exists") }</script> | |
<script>console.log('head script executed')</script> | |
</head> | |
<body> | |
<h1>This is a <h1> element</h1> | |
<p>This is a <p> element</p> | |
<script>if (typeof(xyz) === "undefined") { console.log("body: xyz doesn't exist") } else { console.log("body: xyz exists") }</script> |
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
<html> | |
<head> | |
<title>Simple html page</title> | |
<script>if (typeof(xyz) === "undefined") { console.log("head: xyz doesn't exist") } else { console.log("head: xyz exists") }</script> | |
<script>console.log('head script executed')</script> | |
</head> | |
<body> | |
<h1>This is a <h1> element</h1> | |
<p>This is a <p> element</p> | |
<script>if (typeof(xyz) === "undefined") { console.log("body: xyz doesn't exist") } else { console.log("body: xyz exists") }</script> |
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
<html> | |
<head> | |
<meta charset="utf8"/> | |
<script> | |
isInterstellar = (typeof(window.interstellarBridge) !== "undefined"); | |
</script> | |
</head> | |
<body> | |
<h1>This webpage is running in <span id="host" /></h1> | |
<script> |
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
# Razer laptop | |
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDkOGMbkzQz3w1TFJb2+k4W3arOWAIT5tTIScptRaqekNnyXdxPZi68trrwNc16/nty3yyok/vRP2AOO25G44WxPWUwu0g5XJik+QYEITJYkyJC3yCWnVPRg2NnTtU1kQYRsCYO6JsOs5SZpVdFYy37U9OF6uTXy9EC5RBAMfT594lRj5qqhp5vxDaEr+u4zTfvZ/zsnoZpNMYJZOmFAy0Pw13BKZD2ckWwpoWGPyVyynBTNk76DCyCmRNwPv+N/ylCnbt6Sw+594gERd4HrZxq5fA3I2y/Yrfo/7DW82fV7ZreLM6uGeebK2P5ScoflWWKA2UUFsGAQVdVpcSgrStt |
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 private DataGridHelper = | |
static member inline IsValidRow (this: DataGrid<_,_,_>) row = row < this.rowInfo.Length && row >= 0 | |
static member inline IsValidCol (this: DataGrid<_,_,_>) col = col < this.colInfo.Length && col >= 0 | |
static member inline EnsureValidRow (this: DataGrid<_,_,_>) row = if not (DataGridHelper.IsValidRow this row) then raise (new IndexOutOfRangeException("row")) // TODO: F# vNext nameof(row) | |
static member inline EnsureValidCol (this: DataGrid<_,_,_>) col = if not (DataGridHelper.IsValidCol this col) then raise (new IndexOutOfRangeException("col")) // TODO: F# vNext nameof(col) | |
and DataGrid<'TRowInfo, 'TColInfo, 'TElement> = | |
private { rowInfo: 'TRowInfo[]; colInfo: 'TColInfo[]; elements: Map<int*int, 'TElement> } |
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 sineWaveFadeOutOver500Samples = [|0.000000f; 0.000000f; 0.062523f; 0.062523f; 0.124550f; 0.124550f; 0.185840f; 0.185840f; 0.246153f; 0.246153f; 0.305256f; 0.305256f; 0.362922f; 0.362922f; 0.418928f; 0.418928f; 0.473063f; 0.473063f; 0.525118f; 0.525118f; 0.574899f; 0.574899f; 0.622219f; 0.622219f; 0.666901f; 0.666901f; 0.708779f; 0.708779f; 0.747702f; 0.747702f; 0.783526f; 0.783526f; 0.816125f; 0.816125f; 0.845383f; 0.845383f; 0.871198f; 0.871198f; 0.893483f; 0.893483f; 0.912165f; 0.912165f; 0.927186f; 0.927186f; 0.938501f; 0.938501f; 0.946081f; 0.946081f; 0.949912f; 0.949912f; 0.949994f; 0.949994f; 0.946343f; 0.946343f; 0.938990f; 0.938990f; 0.927978f; 0.927978f; 0.913366f; 0.913366f; 0.895227f; 0.895227f; 0.873647f; 0.873647f; 0.848726f; 0.848726f; 0.820577f; 0.820577f; 0.789324f; 0.789324f; 0.755102f; 0.755102f; 0.718061f; 0.718061f; 0.678357f; 0.678357f; 0.636159f; 0.636159f; 0.591643f; 0.591643f; 0.544995f; 0.544995f; 0.496408f; 0.496408f; 0.446082f; 0.446082f; 0.394222f; 0.394222f; 0.341039f; 0.34103 |
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 Language = { | |
Name: string | |
} | |
let draggableLanguage = FunctionComponent.Of(fun (props: {| lang: Language |}) -> | |
let dragState, drag, preview = ReactDND.useDrag [ | |
DragSpec.Item { ``type`` = "Language"; dragSrc = props.lang } | |
DragSpec.Collect (fun mon -> { isDragging = mon.isDragging() }) | |
//DragSpec.End (fun dragItem mon -> printf "DragEnd: %A; Mon.DropTarget: %A" dragItem mon) | |
] |