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 VolumeNoHeightis0(a:decimal<m>) = | |
(a <= 10000000000m<m> && a >= 0m<m>) ==> | |
(lazy (V 0m<m> a a = 0m<m^3>)) | |
Check.Quick VolumeNoHeightis0 |
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.IO | |
open FsCheck | |
open FsCheck.Xunit | |
[<Measure>] type m | |
[<Measure>] type Area = m^2 | |
[<Measure>] type Volume = Area*m | |
let f (h:decimal<m>) = h |
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
[<Measure>] type m | |
[<Measure>] type s | |
[<Measure>] type kg | |
[<Measure>] type N = kg m / s / s | |
let a = 9.81<m/s/s> | |
let mass = 10.0<kg> | |
let f = a*mass | |
let pow3 (x:float<'u>):float<'u^3> = | |
let power = pown (float x) 3 |
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
[<Measure>] type Length | |
[<Measure>] type Area = Length*Length | |
let area (a : float<Length>) (b: float<Length>) = System.Math.PI*a*b | |
let a1:float<Area> = area 0.0<Length> 1.0<Length> | |
let a2:float<Area> = area 1.0<Length> 0.0<Length> | |
let a3:float<Area> = area 1.0<Length> 1.0<Length> | |
("for 0,1: " + a1.ToString()).Dump() | |
("for 1,0: " + a2.ToString()).Dump() | |
("for 1,1, circle should be pi: " + a3.ToString()).Dump() |
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
[<Measure>] type Length | |
[<Measure>] type Area = Length*Length | |
let area (a : float<Length>) (b: float<Length>) = 2.0*a*b | |
let a1:float<Area> = area 0.0<Length> 1.0<Length> | |
let a2:float<Area> = area 1.0<Length> 0.0<Length> | |
let a3:float<Area> = area 1.0<Length> 1.0<Length> | |
("for 0,1: " + a1.ToString()).Dump() | |
("for 1,0: " + a2.ToString()).Dump() | |
("for 1,1, circle should be pi: " + a3.ToString()).Dump() |
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
[<Measure>] type Length | |
[<Measure>] type Area = Length*Length | |
let area (a : float<Length>) (b: float<Length>) = a * a *a / b | |
let a1:float<Area> = area 0.0<Length> 1.0<Length> | |
let a2:float<Area> = area 1.0<Length> 0.0<Length> | |
("for 0,1: " + a1.ToString()).Dump() | |
("for 1,0: " + a2.ToString()).Dump() |
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
[<Measure>] type Length | |
[<Measure>] type Area = Length*Length | |
let area (a : float<Length>) (b: float<Length>) = a * a + b * b | |
let a1:float<Area> = area 0.0<Length> 1.0<Length> | |
a1.Dump() |
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
[<Measure>] type Length | |
[<Measure>] type Area = Length*Length | |
let area (b : float<Length>) (a: float<Length>) = a*b^2 | |
let a1:float<Area> = area 3.0<Length> 5.0<Length> |
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
[Route("")] | |
public HttpResponseMessage GetResult() | |
{ | |
var fs = new FileStream(@"C:\data\medline13n0701.xml"), FileMode.Open); | |
var response = new HttpResponseMessage(HttpStatusCode.OK) | |
{ | |
Content = new StreamContent(fs) | |
}; | |
response.Content.Headers.ContentType = new MediaTypeHeaderValue("application/xml"); | |
return response; |
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 turtle import * | |
shape("turtle") | |
for count in range(4): | |
forward(100) | |
right(90) |