Memory Leaks Demo & Detection in .NET Application

Memory leaks are always headache of developers. Do .NET developers no longer bother to worry about memory leaks because of garbage collection? Yes and NO. GC periodically find objects that cannot be accessed in the future and then reclaim the resources used by the objects. GC achieves this by maintaining a list of references to…


Designing Your Own Recent Posts Widget for MSDN Blog

In my MSDN blog, I need “Recent Posts”, but I don’t need archive side bar. After having played with template for a while, still no luck. Hmmm, looks like I have to DIY it. Fortunately in News sidebar, you can fill in raw html including JavaScript. Then next question is where we can retrieve post…


Searching For a Number in Shifted Sorted Array within O(log(n)) time

Run into the algorithm problem long time ago. Now post my answer here. A sorted array, say: {1,2,3,4,5,6,7,8,9,10,11,12}, do right rotate through carry unknown times, and then it might become: {6,7,8,9,10,11,12,1,2,3,4,5}. Now we need get the index of a given number, say 4, from the array within O(log(n)) time. Apparently a 8-year-old can get it…


My FB app Development Experience

That FB app( is totally out of curiosity about how FB developer platform is working. Roughly it is like this: Get started cost  — ~10$/year for a website space; need a PC of course Technology platform — LAMP. Website host provides it as a bundle for free. I choose this platform instead of .NET because…


Principles for Building Secure Database Applications in Action

What I am talking about in this post might be well known to many people(too simple, sometimes naive?), but often most basic things make a difference. OK, get down to business. Thumbs rules for DB security might be: Define your security boundary(or attack surface) All input is evil! Evaluate them with whitelist Don’t store blank password, even hard-coded in…


Multi-threading your UI

Basically, window app UI, either WPF or traditional WinForm, is single threaded, which means only one thing can happen in the UI at any given time. To be specific, it is not generally possible to create an object on one thread, and access it from another. In almost all cases this will result in an…


Getting Object’s All Properties at Runtime

We often need to know a given object’s all properties at run time, for example, tracking a data container object’s properties changes across different components. Here is a simple helper class you can use to do this magic. namespace Helper {     using System;     using System.Collections.Generic;     using System.Diagnostics;       public static class…


Programmatically Adding a Column to Your Outlook 2007 Inbox Table View

In my previous post, I mentioned that I will write an article about adding a new column to your inbox. Here you go! What we will achieve Quite simple. Take a look at below screenshot and you will notice that a new column, SubjectLength, is added to the inbox. Its values are the length of…


Outlook 2007 Views from Programmers’ Perspective

In this post, I’d like to talk about certain basics for Outlook 2007 starter programmers. Outlook 2007 is shipped with enhanced programmability in various ways. Looking at Outlook Object Model Reference, new users are often confused by terms such as view, reading pane, inspector, Ribbon, etc. Below two pictures illustrate often used view terms here….


Building Objects from XML of eBay API with LINQ

In this post, I’d like to illustrate the power of LINQ with code sample. I query the web service published by eBay. Refer to this article about eBay API concepts.   EbayItem.cs namespace LINQ2EbayResponse {     class EbayItem     {         public string ItemID { get; set; }         public string Title { get; set;…