Calvin Hsia's WebLog

thoughts from a professional developer

Create a simple File Watcher to monitor folder changes: Windows Prefetcher

There’s a folder like c:\Windows\Prefetch on your machine, probably with a few hundred files and a...

Author: CalvinH Date: 11/30/2018

How to stress and measure the Garbage Collector

Many years ago, I was writing real time applications for monitoring sound signals bouncing off...

Author: CalvinH Date: 10/30/2018

Using Async with ManualResetEventSlim

When I first started writing programs many years ago, my computer had only one processor and no...

Author: CalvinH Date: 09/29/2018

Use reflection to get assembly type and method sizes for comparison

I wanted to know what changed between two versions of a managed assembly. Software changes over...

Author: CalvinH Date: 08/31/2018

Detouring code

Microsoft Detours from Microsoft Research is a powerful technology to intercept operating system...

Author: CalvinH Date: 07/26/2018

Visual Studio slowdown because Virus & Threat protection Windows Defender Antivirus is scanning this file

I noticed that if I hit F5 to build and debug some code for a very small solution (1-5 small...

Author: CalvinH Date: 06/27/2018

AzureAzure lets you get free virtual machines.What does this mean? You can use a free Azure account...

Author: CalvinH Date: 05/30/2018

Lasers reflecting off an ellipse

Various conic sections (hyperbolas, parabolas, ellipses) have interesting reflective properties....

Author: CalvinH Date: 03/30/2018

Store different derived classes in collections in C++ and C#: CoVariance, shared_ptr, unique_ptr

I wanted to create a collection container that would hold objects of various types, all derived from...

Author: CalvinH Date: 01/31/2018

Calculate Pi to measure processor performance

We know that computers can calculate very quickly, but how do we compare performance between code? I...

Author: CalvinH Date: 12/30/2017

Manipulate Visual Studio from Excel or Word

You can use automation to manipulate various applications, like Word, Excel, Visual Studio, Visual...

Author: CalvinH Date: 12/01/2017

The Central Limit theorem, Normal Distribution and Poker hand distributions

In Graph Poker Hand Distributions I showed some code to graph poker hands and the distributions of...

Author: CalvinH Date: 10/31/2017

Create a Visual Studio Extension with minimal impact on VS startup performance

The good news: It’s very easy to create an extension in Visual Studio. The bad news: It’s also easy...

Author: CalvinH Date: 09/19/2017

Create a security system with cameras on your Windows IOT Raspberry Pi

Last time I wrote about getting started using a Raspberry Pi and Windows Internet Of Things. This...

Author: CalvinH Date: 04/29/2017

Getting started with Windows Internet of Things (Windows IoT)

With just a few items you can get started building apps for Windows Internet of Things using VB, C#...

Author: CalvinH Date: 03/16/2017

Cannot open include file: 'metahost.h': No such file or directory

You might upgrade your Visual Studio Project to VS 2017 and you might get errors like:...

Author: CalvinH Date: 02/13/2017

Automatically open Visual Studio Projects and Solutions using IMessageFilter

I wanted to learn more about what an IMessageFilter is and how it behaves. So I wanted to have some...

Author: CalvinH Date: 10/29/2016

Memory use of Dynamically expanding TreeView

I created a tool a few years ago that uses a WPF TreeView with huge numbers of nodes. The branching...

Author: CalvinH Date: 09/29/2016

Use gravity to generate Cartoon animation frames

I wrote a cartoon animation program around 1982 in C. The Honolulu Academy of Arts asked me to demo...

Author: CalvinH Date: 08/31/2016

What's in a PDB file? Use the Debug Interface Access SDK

It’s easy to use C# code and MSDia140.dll from the Debug Interface Access SDK to examine what’s...

Author: CalvinH Date: 07/30/2016

Mapped Files give very fast access to huge amounts of data

Sometimes you write a program and it requires lots of extra storage. Perhaps it needs to deal with...

Author: CalvinH Date: 06/30/2016

Visual Sorting Algorithms part II

In the days before the internet, email and cell phones: My ice hockey team was in the locker room...

Author: CalvinH Date: 05/28/2016

Visual Sorting Part 1

Remember the days before the internet? I have a collection of hundreds of programs that I wrote in...

Author: CalvinH Date: 04/30/2016

Use C++ to show memory use in an Excel Pivot table

(apologies for the formatting: The MSDN blog infrastructure has changed and some tools aren't...

Author: CalvinH Date: 04/01/2016

Create a Concordance for a Word Document from C# using Automation

I was talking to my son about some of his homework assignments. He had to write several essays. We...

Author: CalvinH Date: 02/26/2016

Use C++ and no managed code to create a WPF form

In Use the power of Reflection to create and manipulate managed objects I showed how to create a WPF...

Author: CalvinH Date: 01/29/2016

Use the power of Reflection to create and manipulate managed objects

When you create a Windows Presentation Foundation (WPF) project in Visual Studio, references to WPF...

Author: CalvinH Date: 12/30/2015

Big numbers

When I first started learning about numbers I remember marveling at what infinity means. How many...

Author: CalvinH Date: 11/30/2015

Examining a crash dump

A crash dump is very helpful for diagnosing a problem with software. It can contain enough...

Author: CalvinH Date: 09/30/2015

Create your own crash dumps

Sometimes programs will crash on your machine. Windows Error Reporting can send problem reports back...

Author: CalvinH Date: 08/31/2015

Blinking Lights are useful

A while ago, computers had blinking lights on a front panel. I recognized various patterns of...

Author: CalvinH Date: 07/31/2015

Execute tasks in parallel using async and await to speed up computation

Suppose you have five tasks you want your computer to execute and that each takes 1 second to...

Author: CalvinH Date: 06/30/2015

Create your own Process Explorer

I was playing around with showing some resizable content in a WPF window. I wanted 2 variable sized...

Author: CalvinH Date: 05/28/2015

Wireless HeadPhone Adventures

I wanted to get wireless headphones to listen to music. At the office I have 3 desktops, with a...

Author: CalvinH Date: 04/29/2015

Write native to managed interop code: reg free COM

If you followed the steps of the last post (Call C# code from your legacy C++ code), then your C++...

Author: CalvinH Date: 03/31/2015

Call C# code from your legacy C++ code

For many decades, folks have been quite productive in creating C++ code. These “legacy” apps have...

Author: CalvinH Date: 02/27/2015

Heap Corruption Exception 0xC0000374

Modern computers can execute millions of instructions per second, and if one of them is erroneous,...

Author: CalvinH Date: 01/30/2015

Debugger features help to find memory leaks

You can use the debugger $CALLSTACK and TracePoints to find memory leaks. Memory leaks are very...

Author: CalvinH Date: 12/27/2014

Create managed Tests for native code

In the old days of code development, the developer would do several steps repeatedly: 1. edit the...

Author: CalvinH Date: 11/25/2014

Export your data to Excel using CSV and all data appears in one column

In many prior posts, I export data to Excel via writing to a TEMP file and just starting that TEMP...

Author: CalvinH Date: 10/30/2014

Next>