jQuery div vs native doc fragment
I assumed creating a div with jQuery takes more time compared to native document fragment creation. Surprise, I was wrong. I’ve created a test page on JSPerf at http://jsperf.com/jquery-vs-documentfragment. Simply put, the speed depends on the browser. Verdict: Use document fragment in all...
Categories: News
Less CSS and IIS 7
In case you are using Less CSS to generate CSS markups, IIS won’t find your .less files by default. You will get a 404 Not Found error. The problem is the missing MIME type. The solution is simple, just register the MIME type for .less in web.config: <system.webServer> <staticContent...
Categories: News
ASP.NET MVC Internals 3: Controller structure
Controllers implement the IController interface: public interface IController ...
Categories: News
ASP.NET MVC Internals 2: Controller
The MvcHandler class processes an HTTP request. The routing framework calls its ProcessRequest() function in case of an incoming request matching an MVC route. public class MvcHandler : IHttpHandler, IRequiresSessionState ...
Categories: News
ASP.NET MVC - Internals 1
The topic of this article is the ASP.NET MVC bootstrapping process. Everything starts in Global.asax: public class MvcApplication : System.Web.HttpApplication...
Categories: News
jQuery and DOM dimension measurement
I had to rewrite a code that used standard DOM functions (like offsetWidth) to jQuery functions (like outerWidth). This is a simple document visually summarizing the differences. Link: jQuery HMTL with height cheat sheet (DOCX) Link: jQuery HMTL with height cheat sheet (PDF)
Categories: News
WaitableTimer in C++
This is an example code for calling a waitable timer. This is a good way to wait for a timer event without using CPU (thread blocks). There is a small trick in the code. It’s hard to create a FILETIME properly so I create a SYSTEMTIME (and set it according to my needs), convert it to FILETIME,...
Categories: News
Perforce file exclusion
There are file types and folders I don’t want to see in a source control repository. These are user-specific settings, temporary folders and binaries. There is a simple client-side way to exclude these files and folders. Just add the following lines to your workspace definition: ...
Categories: News
CV Tag Cloud
The tag cloud of my CV. Can be viewed in full size: http://www.wordle.net/show/wrdl/2686570/CV
Categories: News
Simple Map Reduce Example in C#
This is an example of map-reduce implementation for IEnumerable. This code is not optimized. I think we shouldn’t create separate Task for each enumerated item. Probably partitioning the enumeration and dealing with bigger chunks of data would be much more efficient. Browse source code: Google...
Categories: News
CAL and AutoMapper
I’m using Composite Application Library (CAL) in a project. I decided to use AutoMapper as well. I put AutoMapper’s Mapper.CreateMap<source, dest>() calls into one of the Bootstrapper.cs methods. I got an InvalidOperationException in the ModuleCatalog’s InnerLoad() function. Reason ...
Categories: News
F#: Piping and Composition
Piping and compositions are very expressive tools in F#. It significantly improves code readability. Let’s have the following functions: > let square x = x*x;; val square : int -> int > let negate x = -x;; val negate : int –> int Function square returns the...
Categories: News
Database Comparison
I' am very interested in open source database comparisons. I found two interesting blog posts: Sukhvinder Singh wrote about the comparison of H2, HSQLDB, DERBY, PostgreSQL, MySQL. Thirdstage wrote about the comparison of about HSQLDB, H2, SQLite Link: H2, HSQLDB, DERBY, PostgreSQL, MySQL...
Categories: News
Get WPF DataGrid row and cell
.csharpcode, .csharpcode pre
{
font-size: small;
color: black;
font-family: consolas, "Courier New", courier, monospace;
background-color: #ffffff;
/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharp...
Categories: News
Mixed mode assemblies on .NET 4.0
Mixed mode assembly is built against version 'v2.0.50727' of the runtime and cannot be loaded in the 4.0 runtime without additional configuration information. I got this message when I tried to start a project migrated from .NET 3.5 to .NET 4.0. I case of migration, migration wizard inserts...
Categories: News
NHibernate session management
When you start working with NHibernate, you will see code examples like this one: int userID = 1234;...
Categories: News
NHibernate and SQLite in-memory database
I’m implementing and in-memory database-based unit test framework for an application. I hope it speeds up unit tests. Unfortunately I have to redesign my entity repositories to support in-memory behavior. As far as I can learn from SUT behavior, SQLite will create a brand new database when...
Categories: News
CodePlex TFS from VS2010
Visual Studio 2010 Professional has a built-in Team Foundation Server (TFS) client. There are some user interface changes on the Add Team Foundation Server screen. When you are connecting to the CodePlex TFS, you need to specify the following information: Name or URL of TFS: tfs<number>...
Categories: News
Refresh WPF DataGrid
I am using WPF DataGrid for displaying a list of items. I had to modify an item, but the item had no INotifyPropertyChanged event on that property (it was a collection). So my first idea was: Update the list behind ItemsSource Set ItemsSource property to null to force unbinding Set...
Categories: News
DispatcherPriority
I had a very tough problem today. The following code did not work correctly: var books = _bookRepository.All;...
Categories: News

