Debugging WCF high memory usage

Recently I was debugging high memory usage in application written in .NET 4 using WCF. After few hours application was eating almost 8 GB of memory. I made a memory dump and started digging into it. First, statistics of heap (sorted by total…

Browser link injecting into MVC action response

Imagine that you have the following action in MVC 5 controller: [HttpGet] public string GetData() { return JsonConvert.SerializeObject( new JObject( new JProperty(“message”, “Ok”), new JProperty(“data”, new JObject( new JProperty(“value”, “< /body>“) )) ) ); } We create simple object on a fly, serialize…

SQLxD Part 2 — Grammar

This is the second part of the SQLxD series. For your convenience you can find other parts in the table of contents in Part 1 – XML Transformation In order to implement SQLxD database, we need to know, what kind of queries we…

ILP Part 44 — Pizza riddle simplified

This is the forty forth part of the ILP series. For your convenience you can find other parts in the table of contents in Part 1 – Boolean algebra Today we are going to solve Pizza practice problem from Hash Code 2017 contest…

ILP Part 43 — Maximum revisited

This is the forty thrid part of the ILP series. For your convenience you can find other parts in the table of contents in Part 1 – Boolean algebra We have already seen how to implement function in ILP. Last time we used…

SQLxD Part 1 — XML Transformation

This is the first part of the SQLxD series. For your convenience you can find other parts using the links below : Part 1 — XML Transformation Part 2 — Grammar Part 3 — Model and parsing XML Part 4 — Selectors Part…

ILP Part 42 — Fifteen puzzle

This is the forty second part of the ILP series. For your convenience you can find other parts in the table of contents in Part 1 – Boolean algebra Today we solve another puzzle: Fifteen puzzle. Let’s begin. Game Image from Wikipedia. In…

ILP Part 41 — Rubik’s cube

This is the forty first part of the ILP series. For your convenience you can find other parts in the table of contents in Part 1 – Boolean algebra We continue our exploration of riddles solvable by ILP. Today we are going to…

ILP Part 40 — Ternary logic

This is the fortieth part of the ILP series. For your convenience you can find other parts in the table of contents in Part 1 – Boolean algebra We already know how to implement binary logic in ILP, today we are going to…

How to override sealed function in C#

Warning — clickbait title! We are not going to override sealed function, however, we are going to substitute one method with another using some machine code. Let’s go. Introduction Sometimes we would like to stub a function in order to use different one…

ILP Part 39 — Non-deterministic Turing Machine

This is the thirty ninth part of the ILP series. For your convenience you can find other parts in the table of contents in Part 1 – Boolean algebra Today we are going to simulate non-deterministic Turing machine using ILP. Let’s begin. Idea…

ILP Part 38 — Arrays in ILP

This is the thirty eighth part of the ILP series. For your convenience you can find other parts in the table of contents in Part 1 – Boolean algebra Today we are going to implement basic data structure: array. If you know functional…

Generate EF includes from lambda mapping

Imagine that we have an entity handled by Entity Framework which we want to transform into some kind of DTO. To be precise, let’s have the following entity: public class StubEntity { public ICollection< StubEntity> RecursiveCollection1 { get; set; } public ICollection< StubEntity>…

Async Wandering Part 4 — Awaiting for void methods

This is the fourth part of the Async Wandering series. For your convenience you can find other parts in the table of contents in Part 1 – Why creating Form from WinForms in unit tests breaks async? C# allows us to write async…

Async Wandering Part 3 — Awaiting in synchronous WinForms code

This is the third part of the Async Wandering series. For your convenience you can find other parts in the table of contents in Part 1 – Why creating Form from WinForms in unit tests breaks async? async and await are great features…

Async Wandering Part 2 — Synchronous call on WinForms control and ObjectDisposedException

This is the second part of the Async Wandering series. For your convenience you can find other parts in the table of contents in Part 1 – Why creating Form from WinForms in unit tests breaks async? I once found the following code…

ILP Part 37 — Send more money

This is the thirty seventh part of the ILP series. For your convenience you can find other parts in the table of contents in Part 1 – Boolean algebra Today we are going to solve “Send more money” problem. We have the following…

ILP Part 36 — Various goal types

This is the thirty sixth part of the ILP series. For your convenience you can find other parts in the table of contents in Part 1 – Boolean algebra Today we will try to introduce various goal types to our problems. There are…

ILP Part 35 — Approximation

This is the thirty fifth part of the ILP series. For your convenience you can find other parts in the table of contents in Part 1 – Boolean algebra Last time we saw how to implement Special ordered sets in ILP. Today we…

ILP Part 34 — Special Ordered Set Type 1 and 2

This is the thirty fourth part of the ILP series. For your convenience you can find other parts in the table of contents in Part 1 – Boolean algebra In the next part of ILP series we will implement Special ordered sets. These…