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
// Adding dll config for reference assembly into build folder. add this list into csproj file your library assembly. | |
<ItemGroup> | |
<Content Include="app.config"> | |
<Link>$(TargetName).dll.config</Link> | |
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> | |
</Content> | |
</ItemGroup> |
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
public static T Deserialize<T>(string xmlPath) | |
{ | |
try | |
{ | |
using (FileStream fileReader = new FileStream(xmlPath, FileMode.Open, FileAccess.Read)) | |
{ | |
T result = (T)new XmlSerializer(typeof(T)).Deserialize(fileReader); | |
fileReader.Close(); |
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
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
string val1 = "Savin Arseni".ToUpper(); | |
string val2 = "Arseniy Savin".ToUpper(); | |
int res = GetLevensteinDistance(val1, val2); |
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
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
List<string> dict = new List<string> | |
{ | |
"Кодилак".ToUpper(), | |
"Кодла".ToUpper(), | |
"Колода".ToUpper(), | |
"Изуируд".ToUpper(), |
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
// Get SOAP current request | |
OperationContext.Curent.RequestContext.RequestMessage.ToString(); | |
public class WcfHelper : IDisposable | |
{ | |
private static WcfHelper wcf = new WcfHelper(); | |
private static Dictionary<Type, ChannelFactory> factories = new Dictionary<Type, ChannelFactory>(); | |
private static readonly object syncObject = new object(); | |
public static WcfHelper Wcf |
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
{ | |
"RouteInfo": { | |
"InstanceId": "GUID", | |
"ParentInstanceId": "GUID", | |
"RouteType": "String", | |
"RouteCode": "String" | |
}, | |
"Correlation": [ // Какието ID запесей в очереди базы, которые нужно ожидать пока они исполнятся | |
{ | |
"Id": "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
<!-- | |
Path: C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Config | |
Description: The setting calculate using this article https://docs.microsoft.com/en-us/previous-versions/msp-n-p/ff647813(v=pandp.10) | |
The values set out of youre hardware. | |
Example for hardware: CPU 4 Core, RAM 8 Gb | |
--> | |
<system.web> | |
<!--<processModel autoConfig="true" />--> | |
<processModel autoConfig="False" maxWorkerThreads="1000" maxIoThreads="1000" minWorkerThreads="1000" minIoThreads="1000" /> | |
<httpRuntime appRequestQueueLimit="50000" minFreeThreads="999" minLocalRequestFreeThreads="999"/> |
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
set nocount on | |
declare @name varchar(128), @substr nvarchar(4000), @column varchar(128) | |
set @substr = '%%' --фрагмент строки, который будем искать | |
create table #rslt | |
(table_name varchar(128), field_name varchar(128), value ntext) | |
declare s cursor for select table_name as table_name from information_schema.tables where table_type = 'BASE TABLE' order by table_name | |
open s | |
fetch next from s into @name |
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
SELECT TOP 10 substring(t.TEXT, qs.statement_start_offset / 2, CASE | |
WHEN qs.statement_end_offset = - 1 | |
THEN len(t.TEXT) | |
ELSE (qs.statement_end_offset - qs.statement_start_offset) / 2 | |
END) | |
,qs.execution_count | |
,cast(qs.total_worker_time / 1000 AS DECIMAL(18, 2)) AS total_worker_time_ms | |
,cast(qs.total_worker_time * 1. / qs.execution_count / 1000. AS DECIMAL(18, 2)) AS avg_worker_time_ms | |
,cast(p.query_plan AS XML) AS query_plan | |
FROM sys.dm_exec_query_stats qs |