This file contains 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 Agent = | |
| Async of MailboxProcessor<MailboxMessage> | |
| Sync of MailboxProcessor<MailboxMessage * AsyncReplyChannel<unit>> | |
let agent = | |
match mode with | |
| Default -> agent <- Async <| createDefaultAgent () | |
| UnitTest -> agent <- Async <| createUnitTestAgent () | |
let post msg = |
This file contains 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.Collections.Generic | |
let f (items: IEnumerable<Tuple<int, string>>) = | |
items | |
|> Seq.iter (fun i -> printf "%d %s" i.Item1 i.Item2) | |
let x = seq { yield Tuple.Create(10, "ten") } | |
f x |
This file contains 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 Mexx.Owin | |
open System | |
open System.Collections.Generic | |
open System.IO | |
open System.Reflection | |
open System.Resources | |
open Microsoft.Owin.FileSystems | |
/// <summary> |
This file contains 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
(* | |
Consider a list of four points on a plane; the points have integral coordinates, and their order is irrelevant. The four points determine a square if the distances between them are all equal, and the lengths of the two diagonals are also equal. For instance, the following lists are all squares: | |
(0,0), (0,1), (1,1), (1,0) -- the unit square | |
(0,0), (2,1), (3,-1), (1, -2) -- square not aligned to axis | |
(0,0), (1,1), (0,1), (1,0) -- unit square, in different order | |
And the following lists do not represent squares: | |
(0,0), (0,2), (3,2), (3,0) -- rectangle |
This file contains 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
import {bootstrap, Component, FORM_DIRECTIVES} from 'angular2/angular2'; | |
import {Hero} from './hero.ts'; | |
import {DateValueAccessor} from './date_value_accessor.ts'; | |
@Component({ | |
selector: 'my-app', | |
template:` | |
<h1>{{title}}</h1> | |
<h2>{{hero.name}} details!</h2> | |
<h5>{{hero.dateOfBirth}}</h5> | |
<div><label>id: </label>{{hero.id}}</div> |
This file contains 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
Target "BuildTests" (fun _ -> | |
trace "Building Tests..." | |
!! "tests/**/*.csproj" | |
|> Seq.collect (fun p -> MSBuildDebug (artifactsTestsDir @@ (Path.GetFileName(p))) "Build" [p]) | |
|> Log "TestBuild-Output: " | |
) |
This file contains 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
[<AutoOpen>] | |
module Code | |
type Quintuple<'t> = 't * 't * 't * 't * 't | |
module Seq = | |
let toQuintuple s = | |
match s with | |
| [a; b; c; d; e] -> (a, b, c, d, e) | |
| _ -> failwith "Ungültige Hand" |
This file contains 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 Microsoft.Owin.Hosting | |
open Owin | |
open System | |
open System.Net | |
open System.Net.Http | |
open System.Web.Http | |
type HttpRouteDefaults = { Controller : string; Id : obj } | |
type HomeController() = |
This file contains 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 System; | |
using System.Collections; | |
using System.Collections.Generic; | |
using System.Diagnostics; | |
using System.Linq; | |
using Xunit; | |
namespace LazyPartition | |
{ | |
public static class PartitionExtension |
This file contains 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 Building = { | |
left : int | |
right : int | |
height : int | |
} | |
let buildings : Building[] = [| {left = 1; right = 10; height = 5}; {left = 1; right = 10; height = 5} |] | |
let getHeight building = building.height | |
let getWidth building = building.right - building.left |
NewerOlder