Ask these questions:
- How many of you have deployed your applications for the cloud?
- Have you ever had any downtown out of something you didn't do?
type AccountIdentifier = | |
| AccountIdentifier of System.Guid | |
type Account = { | |
Identifier : AccountIdentifier | |
Name : string | |
} | |
open Nessos.FsPickler // https://www.nuget.org/packages/FsPickler/ |
type Building = { | |
left : int | |
right : int | |
height : int | |
} | |
let buildings : Building[] = [| (* ... *) |] | |
let getHeight building = building.height | |
let getWidth building = building.right - building.left |
type Building = | |
{ left : int | |
right : int | |
height : int } | |
let buildings = [] | |
let getHeight building = building.height | |
let getWidth building = building.right - building.left | |
let getArea building = getHeight building * getWidth building |
<?xml version="1.0"?> | |
<configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform"> | |
<system.webServer> | |
<httpLogging xdt:Transform="SetAttributes(selectiveLogging)" selectiveLogging="LogSuccessful" > | |
</httpLogging> | |
</system.webServer> | |
</configuration> |
type Building = | |
{ left : int | |
right : int | |
height : int } | |
let buildings = [] | |
let getHeight building = building.height | |
let getWidth building = building.right - building.left | |
let getArea building = getHeight building * getWidth building |
DROP TABLE data_staging; | |
DROP TABLE data; | |
CREATE TABLE data_staging | |
( | |
id number(10) not null, | |
name nvarchar2(50) not null, | |
city nvarchar2(20) | |
); |
module Parsing = | |
open System.Collections.Generic | |
let (|Mul|_|) ch = if ch = '*' then Some(fun a b -> a * b) else None | |
let (|Add|_|) ch = if ch = '+' then Some(fun a b -> a + b) else None | |
let (|Space|_|) (ch:Char) = if Char.IsWhiteSpace ch then Some(ch) else None | |
let (|Digit|_|) (ch:Char) = if Char.IsDigit ch then (new String ([|ch|])) |> Int32.Parse |> Some else None | |
type Token = | |
| Number of int |
open System | |
[<AutoOpen>] | |
module Attempt = | |
type Result<'TSuccess> = | |
| Success of 'TSuccess | |
| Failure of Exception | |
// make sure f is pure, otherwise monad laws will fail | |
let (>>=) x f = |
// tail-recursive quick-select | |
let select vs k = | |
let rec selectImpl vs k result = | |
match vs with | |
| [] -> result | |
| head :: tail -> | |
let (less, more) = tail |> List.partition ((>=) head) | |
match List.length less with | |
| x when x < k -> selectImpl more (k - x) (less @ result) |