Skip to content

Instantly share code, notes, and snippets.

Mike Chaliy (Mykhailo Chalyi) chaliy

Block or report user

Report or block chaliy

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View first_attempt_to_use_rx.cs
using System;
using System.Collections.Generic;
namespace TryRx
{
class Program
{
static void Main(string[] args)
{
Order.Paid.Subscribe(_ => Console.WriteLine("Paid"));
View bank_in_fsharp.fs
module Bank
// Model
type Amount = decimal
type Balance = {
CurrentAmount: Amount
}
View can_you_guess_output.cs
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;
View another_can_you_guess_output.cs
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");
View funny_contracts.cs
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);
View web_service.fs
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 = ""
View web_service.cs
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
{
View web_service_future.fs
namespace Processing.Services2
type BatchItem = {
Arguments : (string * string) list;
}
type Batch = {
Id : string;
ProcessorKey : string;
Items : BatchItem list;
View fsharp_xml.fs
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) =
View anek1.txt
Русский ребенок в американской школе.
Учительница задаёт детям вопрос:
— Дети, у нас на складе есть 3 руля и 12 колес. Сколько трёхколёсных велосипедов можно собрать?
Дети отвечают: ни одного. И только русская девочка заявляет — три, четыре. С неё смеются — экая глупышка.
Девочка говорит:
— Ну что же вы, разве не понимаете? Колёс на 4 велосипеда, но есть только 3 руля. Значит можно собрать 3 велосипеда.
Учительница ей говорит:
— А одних рулей и колёс недостаточно чтобы собрать велосипед.
You can’t perform that action at this time.