Sign in
Calvin Hsia's WebLog
thoughts from a professional developer
Translate This Page
Translate this page
Powered by
Microsoft® Translator
Options
Email Blog Author
RSS for posts
Atom
RSS for comments
OK
Search
Tags
64bit
C++
CSharp
Debugging
FunGames
History
LINQ
Memory
Mesh
Miscellaneous
Pictures
Programming
SmartPhone
Testing
VB
Vista
Visual FoxPro
Visual Studio
Web
Windows API
WPF
Archive
Archives
April 2013
(2)
March 2013
(1)
February 2013
(1)
January 2013
(1)
December 2012
(1)
November 2012
(1)
October 2012
(1)
September 2012
(1)
August 2012
(1)
July 2012
(1)
June 2012
(1)
May 2012
(2)
March 2012
(1)
February 2012
(1)
January 2012
(1)
December 2011
(1)
November 2011
(1)
October 2011
(1)
September 2011
(1)
August 2011
(1)
July 2011
(1)
June 2011
(1)
May 2011
(1)
April 2011
(1)
March 2011
(1)
February 2011
(1)
January 2011
(1)
December 2010
(2)
November 2010
(1)
October 2010
(1)
September 2010
(1)
August 2010
(1)
July 2010
(1)
June 2010
(1)
May 2010
(1)
April 2010
(1)
March 2010
(2)
February 2010
(1)
January 2010
(1)
December 2009
(1)
November 2009
(1)
October 2009
(1)
September 2009
(1)
August 2009
(1)
July 2009
(1)
June 2009
(1)
May 2009
(1)
April 2009
(1)
March 2009
(2)
February 2009
(1)
January 2009
(2)
December 2008
(1)
November 2008
(1)
October 2008
(1)
September 2008
(1)
August 2008
(1)
July 2008
(3)
June 2008
(2)
May 2008
(2)
April 2008
(2)
March 2008
(2)
February 2008
(2)
January 2008
(2)
December 2007
(3)
November 2007
(8)
October 2007
(6)
September 2007
(4)
August 2007
(9)
July 2007
(2)
June 2007
(2)
May 2007
(11)
April 2007
(5)
March 2007
(2)
February 2007
(2)
January 2007
(1)
December 2006
(2)
November 2006
(1)
October 2006
(4)
September 2006
(6)
August 2006
(10)
July 2006
(13)
June 2006
(11)
May 2006
(7)
April 2006
(8)
March 2006
(14)
February 2006
(5)
January 2006
(21)
December 2005
(9)
November 2005
(19)
October 2005
(20)
September 2005
(12)
August 2005
(23)
July 2005
(12)
June 2005
(8)
May 2005
(7)
April 2005
(4)
March 2005
(1)
February 2005
(2)
January 2005
(13)
December 2004
(9)
November 2004
(4)
October 2004
(10)
September 2004
(4)
August 2004
(8)
July 2004
(1)
June 2004
(10)
Posts
Subscribe via RSS
Sort by:
Most Recent
|
Most Views
|
Most Comments
Excerpt View
|
Full Post View
Calvin Hsia's WebLog
Does the CLR release memory when no longer needed?
Posted
22 days ago
by
CalvinH
0
Comments
A colleague asked the other day if the CLR releases memory when it’s no longer needed. Suppose you allocate lots of memory, then release it. The CLR will grow the managed heap (the green below), but it will also shrink it if it can. All memory in a process...
Calvin Hsia's WebLog
Cartoon animation works great on Surface Pro
Posted
1 month ago
by
CalvinH
0
Comments
I showed my 9 year old son a cool drawing program called Physamajig , in which users can draw objects, which behave like real physical objects, including reacting to gravity, friction, and bounce. He was having fun with it on my Surface RT and it reminded...
Calvin Hsia's WebLog
The Visual Studio Feedback tool
Posted
1 month ago
by
CalvinH
0
Comments
Sometimes when you use Visual Studio, or any application on a computer, there’s a notable pause when you try to do something. For example, trying to access a file on a network share somewhere, perhaps on a slow connection, the application will...
Calvin Hsia's WebLog
Compiling code at runtime and MVP program is 20
Posted
2 months ago
by
CalvinH
0
Comments
This month marks the 20 th anniversary of the Microsoft MVP program, so MVPs were in the news. Apparently I had a lot to do with the founding of the program J Wikipedia: http://en.wikipedia.org/wiki/Microsoft_Most_Valuable_Professional Microsoft News...
Calvin Hsia's WebLog
Windows Error Reporting and the Appdomain.UnhandledException Event
Posted
3 months ago
by
CalvinH
0
Comments
Sometimes applications fail. If you are the author and it fails on your machine, typically you fire up the code in a debugger, figure out the issue, fix it, and rebuild the code. If the applications is out in the wild, perhaps with millions of users,...
Calvin Hsia's WebLog
Create a logger for watching your test progress as it runs.
Posted
4 months ago
by
CalvinH
0
Comments
I was creating a project that’s a Windows Service, which has components running in multiple processes, using multiple threads and named pipes for communication. To understand the behavior of the code, I wanted to have accurate logging that: · The...
Calvin Hsia's WebLog
Turn your tests into stress tests easily
Posted
5 months ago
by
CalvinH
0
Comments
It’s great to be able to write tests and execute them while developing a project. While I’m developing, I can hit a button and run the dozens of tests to see if I’ve broken anything. As code gets written lots of things get refactored, moved around, etc...
Calvin Hsia's WebLog
Its easy to Create your own FrameWorkElement in WPF
Posted
6 months ago
by
CalvinH
0
Comments
Sometimes you want to have very fine control of how your application looks and behaves. Other times, you just want to draw something on your UI. It’s pretty easy to create your own control class and put instances of it on your form. The sample below create...
Calvin Hsia's WebLog
The number of Garbage Collections indicate how much memory is used
Posted
7 months ago
by
CalvinH
0
Comments
One of the performance improvements we made in .Net was with System.Text.StringBuilder . StringBuilder is used in lots of code to build strings: it has various methods to modify strings quickly. Once a string is built, the ToString method is called to...
Calvin Hsia's WebLog
Performance of Memory vs Disk
Posted
9 months ago
by
CalvinH
0
Comments
There is a comment on this Visual Studio Blog post (about how we made Visual Studio faster): “Focus on speed, not memory usage. Memory is very cheap, but CPU performance is muuuuuuuuch moooooooore expensive.” Yes, memory keeps getting cheaper, but actually...
Calvin Hsia's WebLog
Examine the layout of managed strings in memory
Posted
10 months ago
by
CalvinH
0
Comments
Suppose you wrote some C# code like this: var str1 = "ThisIsAString" ; var str2 = "ThisIsAnotherString" ; As you’d expect, each string is stored in the resulting built binary and also in memory when the binary is loaded,...
Calvin Hsia's WebLog
Increase the memory available to your tests
Posted
10 months ago
by
CalvinH
0
Comments
I love having test projects included in my solutions. Software is alive. I’m constantly making improvements/changes/fixes. When I have customers asking for various features in my code, or for code improvements, being agile and able to publish...
Calvin Hsia's WebLog
Create multiple threads to see if work is done simultaneously
Posted
11 months ago
by
CalvinH
0
Comments
When you hear about threads and threading, you hear that they allow concurrent execution of code, which is supposed to lead to better performance. Most computers nowadays have more than one CPU, meaning that each CPU can be executing code at the same...
Calvin Hsia's WebLog
Tetris
Posted
over 1 year ago
by
CalvinH
0
Comments
A long time ago I worked in the Green Building (building 54 at MIT) . Several NASA Apollo lunar missions (I think 11, 12, 14… I know it wasn’t 13 J ) placed seismometers on the moon, in various locations. They didn’t detect earth quakes. The Moonquakes...
Calvin Hsia's WebLog
Examine your program's available memory: is it leaking?
Posted
over 1 year ago
by
CalvinH
0
Comments
Sometimes your program wakes up and finds itself running in an environment that might not be as suitable as you’d like. For example, it might be distributed to a user running on a machine with not enough memory, and could be failing. Perhaps...
Calvin Hsia's WebLog
Process Windows Messages in your WPF application
Posted
over 1 year ago
by
CalvinH
0
Comments
I have some code that attaches and injects code into a target application (like Visual Studio or IE) to examine its memory use. In order to do that, my code freezes the target. I wanted my application to respond to WM_QUERYENDSESSION so...
Calvin Hsia's WebLog
Be careful about nothing in managed code
Posted
over 1 year ago
by
CalvinH
0
Comments
Here’s a pattern of code use I’ve seen in a few places. There’s a function DeserializeList that returns an array of various sizes, depending on the input. This code can be called to deserialize (rehydrate) an object from a stream. For example,...
Calvin Hsia's WebLog
Advanced debugging: change your program execution without Edit and Continue
Posted
over 2 years ago
by
CalvinH
1
Comments
Last time ( Improve your managed debugging skills: examining registers and memory ) we examined some debugging techniques to understand the behavior of managed code. It might take a long time or many manual steps to reproduce a particular software...
Calvin Hsia's WebLog
Improve your managed debugging skills: examining registers and memory
Posted
over 2 years ago
by
CalvinH
1
Comments
I was helping a colleague and we were deep in the middle of a debug session, single stepping some code and we wanted to see a value in the debugger. The debugger showed either nothing, because the intermediate value has been optimized out, or a...
Calvin Hsia's WebLog
More fun with the Fast Fourier Transform
Posted
over 2 years ago
by
CalvinH
2
Comments
The sounds that we hear can be recorded via a microphone and can be graphed as a signal of amplitude versus time. Low notes show as a lower frequency wave, and high notes show as higher frequency waves. Over the past few decades, some music players, like...
Calvin Hsia's WebLog
Using and styling a treeview in WPF
Posted
over 2 years ago
by
CalvinH
0
Comments
As you know, a treeview control is very useful for viewing hierarchical information. Each node in a tree can have its own parent/child relationships. Some of these trees can be extremely large, and can thus be prohibitively expensive to...
Calvin Hsia's WebLog
Automatic tests protect your code
Posted
over 2 years ago
by
CalvinH
0
Comments
Last month in Dynamically create huge tooltips in WPF TreeView and ListView I showed some code that creates large tooltips to present lots of data. Today, we’ll talk about creating automatic tests for this feature. Testing...
Calvin Hsia's WebLog
Dynamically create huge tooltips in WPF TreeView and ListView
Posted
over 2 years ago
by
CalvinH
0
Comments
Tooltips are useful. When the mouse hovers over a button a tip can indicate what happens when it’s clicked. The mouse move does not actually invoke the button, but can give information in a passive way. Sometimes I want to make huge tooltips...
Calvin Hsia's WebLog
Returning data from a recursive method
Posted
over 2 years ago
by
CalvinH
1
Comments
Sometimes you need to write a method that requires recursion to be elegant. Often that method needs to accumulate data between recursion levels There are many ways to do so, and some are more elegant than others. I like the Optional Parameter method...
Calvin Hsia's WebLog
Embed a ListView inside another ListView for one to many relationships
Posted
over 2 years ago
by
CalvinH
0
Comments
In the old days (about 16 years ago), FoxPro’s object, containership and inheritance models made it easy to put objects inside other objects. So, for example, a FoxPro grid of Customers could have a column containing a grid of each customer’s orders,...
Page 1 of 17 (410 items)
1
2
3
4
5
»