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
<UserSettings><ApplicationIdentity version="12.0"/><ToolsOptions><ToolsOptionsCategory name="Environment" RegisteredName="Environment"/></ToolsOptions><Category name="Environment_Group" RegisteredName="Environment_Group"><Category name="Environment_FontsAndColors" Category="{1EDA5DD4-927A-43a7-810E-7FD247D0DA1D}" Package="{DA9FB551-C724-11d0-AE1F-00A0C90FFFC3}" RegisteredName="Environment_FontsAndColors" PackageName="Visual Studio Environment Package"><PropertyValue name="Version">2</PropertyValue><FontsAndColors Version="2.0"><Theme Id="{DE3DBBCD-F642-433C-8353-8F1DF4370ABA}"/><Categories><Category GUID="{58E96763-1D3B-4E05-B6BA-FF7115FD0B7B}" FontIsDefault="Yes"><Items><Item Name="Plain Text" Foreground="0x00444342" Background="0x00D9D9D9" BoldFont="No"/></Items></Category><Category GUID="{B36B0228-DBAD-4DB0-B9C7-2AD3E572010F}" FontName="Segoe UI" FontSize="9" CharSet="1" FontIsDefault="No"><Items><Item Name="Different content" Foreground="0x000014E5" Background="0x00FFFFFF" BoldFont="No"/><Item Name="Ident |
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
class Showable a where | |
shw :: a -> String | |
data A = A String | |
data B = B Int | |
instance Showable A where | |
shw (A s) = s | |
instance Showable B where |
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
* A brief history of time | |
* Black Swan | |
* Godel Escher Bach | |
* How not to be wrong | |
* Men of mathematics |
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
// start of a port of Ristretto/Coffeescript game of life to typescript | |
// http://withouttheloop.com/articles/2013-08-11-coffeescript-gameoflife-ristretto/ | |
class Cell { | |
constructor(public x: number, public y:number) {} | |
} | |
function isNeighbour(c:Cell, x:number, y:number): boolean { | |
return Math.abs(x-c.x) < 2 | |
&& Math.abs(y-c.y) < 2 |
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
module Library1 | |
open NUnit.Framework | |
open FsUnit | |
type IHaveAnAge = | |
abstract age: int | |
type Person = | |
{ name: string; age: int } | |
interface IHaveAnAge with |
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
euclid.start([{ | |
title: 'Dashboard', | |
route: '/dashboard/:date' | |
entry: function (date) { | |
return [pageComponent, initialProps]; | |
}, | |
exit: function () {}, | |
actions: { | |
showDetail: function (itemId) { | |
return updatedProps; |
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 Person = | |
{ _id: System.Guid; age: int; name: string } | |
interface IDocument with | |
member x.tableName() = "People" | |
member x.id() = x._id | |
[<Fact>] | |
let ``insert, read, update, delete a document`` () = | |
// insert | |
let id = System.Guid.NewGuid() |
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
let solveRPN expression = | |
let foldingFunction stack item = | |
match (stack,item) with | |
| (x::y::xs,"*") -> x * y :: xs | |
| (x::y::xs,"+") -> x + y :: xs | |
| (x::y::xs,"-") -> y - x :: xs | |
| (s,o) -> int o :: s | |
let words (i:string) = i.Split(' ') |> List.ofArray | |
words expression | |
|> List.fold foldingFunction [] |
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
// this works | |
let makeImage bytes = | |
match Array.length bytes with | |
| 784 -> Image bytes |> Some | |
| _ -> None | |
// but this does not. The none branch is never used. |
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
void Main() | |
{ | |
var environment = new Environment(30); | |
var composed = DoSomeStuff(); | |
var extracted = composed.RunReader(environment); | |
Console.WriteLine(extracted); | |
} | |
public class Environment { | |
public int Count {get; private set;} |