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
{ | |
"commands": [ | |
"Folkeregister.Contracts.Commands.CreatePerson", | |
"Folkeregister.Contracts.Commands.AddAdressToPerson" | |
], | |
"types": [ | |
{ | |
"$type": "Folkeregister.Web.TypeDeserialization.ObjectModel, Folkeregister.Web", | |
"type": "Folkeregister.Contracts.Commands.CreatePerson", | |
"name": "CreatePerson", |
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
#r "../packages/FsPickler.Json.0.9.6/lib/net45/FsPickler.Json.dll" | |
#r "../packages/FsPickler.0.9.6/lib/net45/FsPickler.dll" | |
#r "../packages/Newtonsoft.Json.6.0.3/lib/net45/Newtonsoft.Json.dll" | |
open Nessos.FsPickler | |
open Nessos.FsPickler.Json | |
open Nessos.FsPickler.Combinators | |
open System.IO | |
let res y = | |
let jsp = FsPickler.CreateJson() |
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
java -classpath ".\*;.\sigar\*;" -Delasticsearch -Des-foreground=yes -Des.path.home=".." -Des.path.data="c:\tmp\elas\data" -Des.http.port=9201 org.elasticsearch.bootstrap.Bootstrap |
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
$setupExe = "c:/files/SQLEXPRWT_x64_ENU.exe" | |
$adminsGroupName = (New-Object Security.Principal.SecurityIdentifier 'S-1-5-32-544').Translate([Security.Principal.NTAccount]).Value | |
Install-ChocolateyPackage 'SqlServer2012Express' 'exe' "/Q /INDICATEPROGRESS /ACTION=Install /FEATURES=SQL,Tools /TCPENABLED=1 /INSTANCENAME=SQLEXPRESS /SQLSVCACCOUNT=`"NT AUTHORITY\Network Service`" /SQLSYSADMINACCOUNTS=`"$adminsGroupName`" /AGTSVCACCOUNT=`"NT AUTHORITY\Network Service`" /IACCEPTSQLSERVERLICENSETERMS " $setupExe -validExitcodes @(0,3010) | |
#The exe referenced is the official for SQL Express 2012, http://download.microsoft.com/download/8/D/D/8DD7BDBA-CEF7-4D8E-8C16-D9F69527F909/ENU/x64/SQLEXPRWT_x64_ENU.exe |
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 | |
let toDecStr = sprintf "%i" | |
let toOctStr = sprintf "%o" | |
let revStr (x:string) = String(x.ToCharArray() |> Array.rev) | |
let isPalindrom x = x = (revStr x) | |
let numPalCheck conv x = x |> conv |> isPalindrom | |
let decCheck = numPalCheck toDecStr | |
let octCheck = numPalCheck toOctStr | |
let checker x = (octCheck x) && (decCheck x) | |
let result = [1..1000000] |> Seq.filter checker |> Seq.length |
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 | |
type CharSpec = {Char:char; SndOffset: int} | |
type DiamondSpec = CharSpec list | |
let printDiamondRow charSpec = | |
match charSpec with | |
| {Char = x; SndOffset = 0} -> sprintf "%c" x | |
| {Char = x; SndOffset = y} -> sprintf "%c%s%c" x (String(' ', (y-1))) x | |
let padRow size (row:string) = |
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
#r "./FSharp.Data.2.2.0/lib/net40/FSharp.Data.dll" | |
open FSharp.Data | |
open System | |
let rnd = Random() |
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
// Implemented Jimmy Bogard's https://github.com/jbogard/presentations/tree/master/WickedDomainModels/After in F# | |
namespace FSharp.Wicked | |
open System | |
module Types = | |
type Id = Id of Guid | |
type Entity<'T> = Id * 'T | |
let createEntity state = Guid.NewGuid(), state |
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
public class Person | |
{ | |
private readonly PersonState _state; | |
public Person(string name) | |
{ | |
_state = new PersonState(name); | |
} | |
public string GetName() |
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 Money | |
{ | |
public class Money<TCurrency> where TCurrency : ICurrency | |
{ | |
private readonly decimal _value; | |
public Money(decimal value) | |
{ | |
_value = value; | |
} |
OlderNewer