This file contains hidden or 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
// following is analog of the o => o.ContextID == ContextId; | |
var recordType = typeof(NventstoreProduct); | |
var recordParam = Expression.Parameter(recordType, "o"); | |
var recordContextIDProperty = Expression.Property(recordParam, | |
recordType.GetProperty("ContextID")); | |
var serviceType = typeof (Nventstore); | |
var thisContextIDProperty = Expression.Property(Expression.Constant(this, serviceType), |
This file contains hidden or 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 ``Calculator Div Operation Specification`` | |
open FsSpec | |
open Example.Sut | |
module ``Describe simple divide opertion`` = | |
let ``divide two integers`` = | |
let res = Calc.Div 2 2 | |
res.should_be_equal_to 1 |
This file contains hidden or 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
Seq.initInfinite(fun i -> listener.AcceptTcpClient()) | |
|> Seq.iter(fun client -> Async.Start (handle client)) | |
//or | |
while true do | |
let client = listener.AcceptTcpClient() | |
Async.Start (handle client) |
This file contains hidden or 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.Net | |
open System.Net.Sockets | |
open System.Text | |
open System.IO | |
let listen port = | |
let listener = new TcpListener(IPAddress.Any, port) | |
listener.Start() | |
let client = listener.AcceptTcpClient() |
This file contains hidden or 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.Net | |
open System.Text | |
let listen url = | |
use listener = new HttpListener() | |
listener.Prefixes.Add(url) | |
listener.Start(); | |
let context = listener.GetContext() |
This file contains hidden or 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
form( | |
columns( | |
fields( | |
text("SKU", "SKU", required, max(40)), | |
text("Title", "Title", required) | |
) | |
), | |
wide( | |
rich("Description", "Description") | |
), |
This file contains hidden or 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
$genDate = (Get-Date) | |
$startFrom = (Get-Date).AddMinutes(-30) | |
$events = Get-EventLog -LogName:Application -Source:"ASP.NET 2.0.50727.0" -After:$startFrom | |
if ($events){ | |
$body = New-Object System.Text.StringBuilder | |
if ($events.Count){ | |
$body.AppendFormat("Gents, please welcome {0} events.`n", $events.Count) | |
} else { | |
$body.Append("Gents, please welcome an event bellow.`n") |
This file contains hidden or 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
Русский ребенок в американской школе. | |
Учительница задаёт детям вопрос: | |
— Дети, у нас на складе есть 3 руля и 12 колес. Сколько трёхколёсных велосипедов можно собрать? | |
Дети отвечают: ни одного. И только русская девочка заявляет — три, четыре. С неё смеются — экая глупышка. | |
Девочка говорит: | |
— Ну что же вы, разве не понимаете? Колёс на 4 велосипеда, но есть только 3 руля. Значит можно собрать 3 велосипеда. | |
Учительница ей говорит: | |
— А одних рулей и колёс недостаточно чтобы собрать велосипед. |
This file contains hidden or 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.Xml.Linq | |
let xn n = XName.Get(n, "http://schemas.microsoft.com/developer/msbuild/2003") | |
let xattrn n = XName.Get(n) | |
let xelem name (x:XElement) = x.Element(xn name) | |
let xattr name (x:XElement) = | |
x.Attribute(xattrn name).Value | |
let load (proj : XElement) = |
This file contains hidden or 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 Processing.Services2 | |
type BatchItem = { | |
Arguments : (string * string) list; | |
} | |
type Batch = { | |
Id : string; | |
ProcessorKey : string; | |
Items : BatchItem list; |