Make your application settings store values in database

Application settings in .net applications is a mechanism that allows you to define, modify and easily access a collection of settings. Depending on the setting scope (user or application) they are stored in a .config file deeply under your %USER_PROFILE% folder or in your application’s .exe.config or web.config file. In this post I will show a way to change that behavior and ma…

By Mirek on (tags: settings, categories: None)

Why you should always wrap form elements in a form tag

A simple ‘because it helps’ should be enough for most, but as for details… Wrapping form elements in a form tag used to be the only way to go a few years back. That was the time when AJAX was not around. Then, the asynchronous processing came and it’s become common to skip that step, after all, the request is done in a different way.  To be honest, I’ve skipped this step a…

By on (tags: None, categories: web)

TypeScript - a way to embrace the fuzzy world of java script.

What I always dislike in java script was the fuzziness of this language. Very often you didn’t know what type the variable is or if it was an object or a function. I always lack of some strong typing, design time rich intellisense or compile time type checking, which would minimize the possibility of making a bug in the java script code. TypeScript is a cure for all inconvenien…

By Mirek on (tags: javascript, TypeScript, categories: architecture)

How serious are you about unit tests?

We all know and love them, though not everyone (me included) likes to write them. I do unit tests as often as possible, but still need to ‘will’ myself into writing them. Don’t get me wrong, I love to have them, just not the process of writing them. I mean – init, act, assert – not something I’d call rocket science; boring most of the time. But I’ve always been amazed by people…

By on (tags: momentjs, Unit test, categories: None)

Movable rows in WPF DataGrid

DataGrid control in WPF is a rich table structured control, which is perfect for displaying any kind of data in table like format. The one think about DataGrid it always lack, is a possibility to easily change the order of rows. It is not even about drag and drop of rows and items from and into the DataGrid , but simply rearrange existing rows in DataGrid control. It this post …

By Mirek on (tags: Attached property, DataGrid, WPF, categories: code)

Web Api: custom binding with AutoMapper

In Web Api 2.0 and MVC5 you can only pass: int, bool, double etc.., TimeSpan, DateTime, Guid, decimal, and string values in URI. For any complex type having lists or other complex object within you have to pass serialized JSON/XML in the request body. But what If we want use such complex type from URI? Then read on… What is binding? Binding is a mechanism used by the Web Api to…

By Piotr on (tags: automapper, mvc, Web API, categories: code)

Why should we be concerned about floating point arithmetic.

This is often quite obvious that when we are developing application which operates on a real numbers we use a double data type in .net. Here you will see why you should take a special care about the floating point calculations in your software. Generally all floating point calculation problems comes from the fact that many real number does not have an exact representation in fl…

By Mirek on (tags: decimal, double, flaoating-point, categories: architecture)

MVC custom error pages

Long story short – mvc does not handle custom error pages in a way that could be described as ‘even close to correct’. But if you need to fulfill a requirement, you start hacking. First of all, I’d like to share a few links: http://www.prideparrot.com/blog/archive/2012/5/exception_handling_in_asp_net_mvc http://benfoster.io/blog/aspnet-mvc-custom-error-pages http://www.secretge…

By on (tags: mvc, categories: code, web)

The TFSings you do

Short story on a case which tfs does not handle well In our tfs repo we have a structure – a dev folder which keeps dev branches in it. For one of our products, turns out we don’t need that structure, cause for the past 2 years, there were 2 cases in which this actually helped. In order to keep things simple I wanted to perform an easy (one would assume) task. Instead of having…

By on (tags: tfs, categories: tools)

Nested foreach loops replacement in C#

Nested foreach loops is something that I have always felt uncomfortable with. Recently I have found out more elegant and in some cases even more efficient, replacement for nested double foreach loop. Lets assume we have two lists of strings filled with some values and we want to have a collection of all combinations of elements from list l1with elements from list l2. Obvious so…

By Mirek on (tags: c#, Join, categories: code)