Skip to content

Instantly share code, notes, and snippets.

View chaliy's full-sized avatar

Mykhailo Chalyi (Mike Chaliy) chaliy

  • Ukraine, Lviv
  • 14:45 (UTC +03:00)
  • X @chaliy
View GitHub Profile
using System;
using System.Collections.Generic;
namespace TryRx
{
class Program
{
static void Main(string[] args)
{
Order.Paid.Subscribe(_ => Console.WriteLine("Paid"));
module Bank
// Model
type Amount = decimal
type Balance = {
CurrentAmount: Amount
}
class Program
{
static void Main(string[] args)
{
TestEvents test = new TestEvents();
var ff = new EventHandler<EventArgs>((s, e) => Console.WriteLine("Test"));
test.SomethingOccured += ff;
test.SomethingOccured += ff;
class Program
{
static void Main(string[] args)
{
TestEvents test = new TestEvents();
test.SomethingOccured += (s, e) => Console.WriteLine("Test1");
test.SomethingOccured += (s, e) => Console.WriteLine("Test2");
test.SomethingOccured -= (s, e) => Console.WriteLine("Test1");
public static class InvoiceFactory
{
public static Invoice CreateByOrder(Order order)
{
#region Contract
Contract.Requires(order != null);
Contract.Requires(order.PaidDate.HasValue);
Contract.Requires(order.Customer != null);
namespace Processing.Services
open System.Runtime.Serialization
open System.Collections.Generic
open System.ServiceModel
[<DataContract(Namespace="urn:just-applications:nventree:batch-v1.0")>]
type Argument() =
let mutable key : string = ""
let mutable arg_value : string = ""
using System;
using System.Collections.Generic;
using System.Runtime.Serialization;
using System.ServiceModel;
namespace ProcessingService
{
[DataContract(Namespace = "urn:just-applications:nventree:batch-v1.0")]
public class Argument
{
namespace Processing.Services2
type BatchItem = {
Arguments : (string * string) list;
}
type Batch = {
Id : string;
ProcessorKey : string;
Items : BatchItem list;
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) =
Русский ребенок в американской школе.
Учительница задаёт детям вопрос:
— Дети, у нас на складе есть 3 руля и 12 колес. Сколько трёхколёсных велосипедов можно собрать?
Дети отвечают: ни одного. И только русская девочка заявляет — три, четыре. С неё смеются — экая глупышка.
Девочка говорит:
— Ну что же вы, разве не понимаете? Колёс на 4 велосипеда, но есть только 3 руля. Значит можно собрать 3 велосипеда.
Учительница ей говорит:
— А одних рулей и колёс недостаточно чтобы собрать велосипед.