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?
[<AutoOpen>] | |
module SuccessOrFailure = | |
type SuccessOrFailure<'a> = | |
| Success of 'a | |
| Failure of exn | |
let point v = Success v | |
let (>>=) m f = | |
match m with |
public class Program | |
{ | |
public void Main() | |
{ | |
var solution = new Directory | |
{ | |
["global.json"] = new JObject | |
{ | |
["projects"] = new JArray { "src", "test" } | |
}, |
type LF = (Argument, State) => (State, Result) | |
case class _then(f : LF) | |
case class _else(f : LF) | |
def _if (ifFunc: LF) (thenFunc: _then) (elseFunc: _else) : LF = | |
(a, state) => ifFunc(a, state) match { | |
case (_, Accepted) => thenFunc.f(a, state) | |
case _ => elseFunc.f(a, state) | |
} |
// 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) |
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 = |
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 |
DROP TABLE data_staging; | |
DROP TABLE data; | |
CREATE TABLE data_staging | |
( | |
id number(10) not null, | |
name nvarchar2(50) not null, | |
city nvarchar2(20) | |
); |
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> |