Thursday, August 29, 2013

Check Gmail inbox via Windows 7 PowerShell Part 2: message body

Here i wrote about how to quickly check gmail inbox messages using gmail rss feed and powershell. But what about getting the email body or applying some sort of filtering? Luckily, powershell allows us to execute c# code :)

Tuesday, August 20, 2013

Why multiple inheritance is bad?

I'm not against multiple inheritance. Anything can be a tool in the right hands, and multiple inheritance is a such tool. But it is common question: why multiple inheritance is not suitable for most situations? And really it is not very good. Almost any problem could be solved using single inheritance, interfaces or composition. Many languages deny multiple inheritance, and here is my point of view on this problem.

Imagine, we have two classes "cat" and "duck" :)

Monday, August 19, 2013

Tip: analyze .net stack and heap

Sometimes it is necessary to analyze values stored in stack and heap. Or maybe you need to answer the oldest question on earth: "do the array of ints stored in stack?". You can once again use SOS dll for it.

Friday, August 16, 2013

Tip: find memory leaks in .net application

Sometimes we face some nasty problems, while working with managed code. And one of them is memory leak. When you see in task manager, that an application slowly (or rapidly) consumes precious memory, it means that garbage collector can't release some resources, allocated in code. Sometimes it is easy to find the weak spot, sometimes it is not. Memory leak can be represented by something like holding the reference to managed object longer, than it's needed, or not releasing unmanaged resources.

Friday, April 12, 2013

MSSQL: Transaction was deadlocked

For the past few weeks i’ve encountered mssql deadlock error in my application. The exception was: “Transaction (Process ID ...) was deadlocked on lock resources with another process and has been chosen as the deadlock victim. Rerun the transaction.” So what is this deadlock and how to find more information about it?

Tuesday, February 5, 2013

ASP.NET MVC: Custom unobtrusive validation

Sometimes becomes necessary to create custom validation attribute using custom regular expression. Obviously, we want to keep the client side validation and to make use of our custom regular expression on client side.