Wednesday, December 30, 2015

TSQL: count specific children in hierarchy

We have a project with hierarchical data: there are products nested in different categories and categories in its turn nested in segments. The goal was to count products and display this count on parent nodes. So basically we needed something like this:

As you can see there is amount of products displayed next to every node. Lets take a look on how to count those products using TSQL and CTE tables.

Tuesday, December 29, 2015

.NET: Custom minified script bundles with sourcemaps

I stumbled upon a situation where I had to create minified javascript bundle with a sourcemap for this bundle. There is no default implementation at the moment, however there are classes in Microsoft.Ajax.Utilities namespace which can be used to do it.

Wednesday, September 23, 2015

Drawing graphs with vis.js

First of all I want to give a shout out to the guys who made amazing visjs library - it is a great thing. It has a ton of different features, I used only network, but there are much more out there.

We had a task recently: our customer works with a chain of suppliers and factories often related to each other, and all this data is stored in the database. We had to find a way to visualize data and display it as user friendly graph. And we found vis.js :) So we took our data, mapped it properly and got this with no effort at all:

Let's take a look on how it’s done.

Tuesday, April 14, 2015

Managing encrypted files

Imagine that we have a system which generates a certain amount of small .pdf or .xlsx reports and stores them on disk. The requirement is to encrypt those reports and store them as encrypted files. Original file must never hit the disk and all the encryption must be done in memory.

Tuesday, April 7, 2015

Exploring BMP format

Let's decode bitmap image file. Just because it's simple and I want to dig into something. And because BMP is relatively easy.