Skip to content

Instantly share code, notes, and snippets.

View yallie's full-sized avatar

Alexey Yakovlev yallie

View GitHub Profile
@yallie
yallie / chardict4.cs
Last active December 14, 2015 03:59 — forked from rivantsov/chardict2.cs
An updated version of CompactCharDictionary: got rid of the CharLookupData class.
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
/* Results
Dictionary. Time elapsed: 00:00:40.8066077, single iteration: 0,000408066077 ms.
CharDictionary. Time elapsed: 00:00:12.6748487, single iteration: 0,000126748487 ms
CompactCharDictionary. Time elapsed: 00:00:12.6878289, single iteration: 0,000126878289 ms
@yallie
yallie / MasterSlaveExample.cs
Last active December 15, 2015 17:59
Master/slave example using Zyan.
// Compile using: csc MasterSlaveExample.cs /r:Zyan.Communication.dll
// Run master server: MasterSlaveExample.exe
// Run slave server: MasterSlaveExample.exe slave
// Run client: MasterSlaveExample.exe client
using System;
using System.Linq;
using Zyan.Communication;
public static class Program
@yallie
yallie / test.cs
Last active December 15, 2015 20:29
Test case which reproduces the bug with remoting channels: https://zyan.codeplex.com/workitem/1814
// https://zyan.codeplex.com/workitem/1814
// Compile: c:\Windows\Microsoft.NET\Framework\v4.0.30319\csc test.cs /r:Zyan.Communication.dll
// Run: test.exe
// Then run: test.exe slave
using System;
using System.Collections;
using System.Linq;
using Zyan.Communication;
@yallie
yallie / ipctest.cs
Last active November 13, 2018 10:18
Sample IPC server using Zyan Communication Framework: http://zyan.com.de
// Compile this code using: csc ipctest.cs /r:Zyan.Communication.dll
// First run — starts server.
// Second run — starts client.
using System;
using System.Linq;
using System.Text;
using Zyan.Communication;
using Zyan.Communication.Protocols.Ipc;
@yallie
yallie / test.cs
Created October 18, 2013 08:17
Shared proxy with lock / proxy per thread / proxy per request benchmark. Proxy per thread shows the best performance.
// Compile: csc test.cs /r:Zyan.Communication.dll
// Run server: test.exe
// Run client: test.exe /client
// Results:
// Shared proxy with lock benchmark. Time elapsed: 13.22
// Per thread proxies benchmark. Time elapsed: 5.05
// Per request proxies benchmark. Time elapsed: 5.33
using System;
@yallie
yallie / rxtest.cs
Last active December 28, 2015 15:59
RX observable example with Zyan.
// Compile this code using:
//
// csc rxtest.cs /r:Zyan.Communication.dll /r:System.Reactive.Core.dll /r:System.Reactive.Linq.dll /r:System.Reactive.Interfaces.dll /r:System.Runtime.dll /r:System.Threading.Tasks.dll
//
// First run — starts server.
// Second run — starts client.
using System;
using System.Linq;
using System.Text;
@yallie
yallie / streams.cs
Created December 3, 2013 10:51
Demonstrating the usage of streams in Zyan Communication Framework.
// Compile this code using:
//
// csc streams.cs /r:Zyan.Communication.dll
//
// First run — starts server.
// Second run — starts client.
using System;
using System.IO;
using System.Net.Sockets;
@yallie
yallie / eftest3.exe.config
Created December 20, 2013 23:38
Zyan+EF6+SqlCe4 concurrent data access example. Configuration file.
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<configSections>
<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
</configSections>
<entityFramework>
<providers>
<provider invariantName="System.Data.SqlServerCe.4.0" type="System.Data.Entity.SqlServerCompact.SqlCeProviderServices, EntityFramework.SqlServerCompact" />
</providers>
<defaultConnectionFactory type="System.Data.Entity.Infrastructure.SqlCeConnectionFactory, EntityFramework">
@yallie
yallie / eftest3.cs
Last active December 31, 2015 23:59
Zyan+EF6+SqlCe4 concurrent data access example. Application source code (make sure you create a configuration file).
// Zyan + EF6 concurrent data access example.
// Written by Alexey Yakovlev <yallie@yandex.ru>
// Compile this code using:
//
// csc eftest3.cs /r:Zyan.Communication.dll /r:EntityFramework.dll /r:EntityFramework.SqlServerCompact.dll /r:System.ComponentModel.DataAnnotations.dll
//
// First run — starts server.
// Second run — starts client.
using System;
@yallie
yallie / mono-windows-output.txt
Last active August 29, 2015 13:56
LogicalCallContext bug in Mono 3.2.x
Original thread: 1
Current thread: 3
Value is null
Current thread: 5
Value is null
Current thread: 5
Value is null