C# TcpClient and NetworkStream usage behaviour

It can be confusing at first when developing an application that employs TCP connection implementation of TcpClient, TcpListener and the underlying NetworkStream, because the way data is sent and read may not be what you think it is and the MSDN is not very explicit regarding how it actually works, leaving the developers to fall […]

What Is Node.js

If you are totally confused by the description of Node.js on their very own website, you are not alone. To bring back your sanity, first of all, you need to unlearn Node.js:. 1. Node.js has nothing to do with JavaScript. 2. Node.js has nothing to do with web servers, HTTP, web pages, web applications.

Hosting WCF In IIS7 With Multiple Website Bindings

In IIS7 (should be similar in IIS6 as well) Manager, you can create a website under Sites with multiple Bindings so that the website root can be accessed by different combinations of host name, IP and port etc. However, if you have a WCF service that you intend to host in this website, there are […]

WrapPanel not wrapping as ListBox ItemsPanel

When using a WrapPanel as the ItemsPanel for a ListBox as such The WrapPanel may not wrap the items as expected. This is because of WPF’s width and height sizing issue. Depending on the type of Panel that the ListBox is contained in e.g. StackPanel, Grid, etc the width of the ListBox will be resolved […]

How to create Visual Studio Setup Project for VSTO add-in

This is written in the context of an Visual Studio 2010 and VSTO Excel add-in, that I created and had to deploy using the setup project after exploring all other options including ClickOnce, Wix, InstallShield and what-not. As it turns out, the Visual Studio Setup Project remains to be the easiest to understand and use. […]

SUBST command line tool to shorten file paths

The shadow copy service provides snapshots of the file volumes but appends a time stamp in the path. This may cause the resulting path to be longer than the system can handle. In order to copy files from the shadow copy “previous versions”, you need to shorten the path name. The SUBST command line tool […]

Winforms controls not painting correctly, messed up.

While writing a custom paint routine you may come across a strange phenomenon where some of the controls on the Winforms are not painting correctly or even appearing at times. This is usually due to Control.Invalidate() being called recursively, and the API tries to keep on painting what is important and defers the painting of […]

Flash Player 10 Loader.unloadAndStop()

One of the biggest problem with Flash Player 9 AS3 is that it doesn’t take initiative in cleaning up its mess and you always have to tell it what to do and even so, they do not do it promptly. If the mess doesn’t affect us, we can easy just turn a blind eye to […]