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
Recompress your digital pictures to save space
Posted
over 8 years ago
by
CalvinH
8
Comments
I have 23,000 digital pictures and movies taking many gigabytes of storage from the past decade or so. The more recent ones are larger, because higher resolution cameras were more readily available. I have a few copies of the entire collection on various...
Calvin Hsia's WebLog
DECLARE DLL allows OBJECT type
Posted
over 8 years ago
by
CalvinH
1
Comments
Before VFP7, it was very difficult to get an object back from a DECLARE DLL call. I added the “OBJECT” type for VFP7 which allows you to call a DLL which returns a COM object reference. Luckily, most COM objects are created from other COM objects, and...
Calvin Hsia's WebLog
Are water and salt the only inorganics we consume?
Posted
over 8 years ago
by
CalvinH
3
Comments
Of all the naturally occurring foods/drinks that humans normally ingest, is it true that all but two of them contain carbon? In any case, these 2 are very common. Maybe there’s a candy bar I don’t know about that doesn’t have carbon<g>. (Of course...
Calvin Hsia's WebLog
Use Regular Expressions to get hyperlinks in blogs
Posted
over 8 years ago
by
CalvinH
4
Comments
At Southwest Fox conference I presented a sample calling a VB.NET server to do regular expression matching . Here’s the sample I used. It gets some HTML from my blog and parses all the hyperlinks (looks for the HREF tags) and puts them into a VFP table...
Calvin Hsia's WebLog
Eliminating Fire Alarm sound at Chess Tournament Awards Ceremony
Posted
over 8 years ago
by
CalvinH
2
Comments
My daughter earned a 4 th place trophy out of 100 competitors in her division at a chess tournament, far ahead of all other unrated players. As a proud parent, I wanted to get a photo and video of the trophy presentation to hear how the award was presented...
Calvin Hsia's WebLog
Excel's new gradient Data Bar feature is cool: you can do it too!
Posted
over 8 years ago
by
CalvinH
12
Comments
I’ve seen demos of Excel 12 and it’s conditional formatting Data Bar and thought it was cool. In each cell, it draws a colored gradient bar with a width proportional to the cell’s value, making it easy to spot the largest/smallest values. So I wrote...
Calvin Hsia's WebLog
Fox helps drag racer win Microsoft Start Something Amazing Award
Posted
over 8 years ago
by
CalvinH
10
Comments
It was very impressive to see a computer using FoxPro helping a 15 year old drag racer win competitions. When I started reading about it, I thought it must be some sort of simulation: don’t you have to be older to drive? Then I saw the video, which clearly...
Calvin Hsia's WebLog
What happens if external code throws an exception?
Posted
over 8 years ago
by
CalvinH
6
Comments
In VFP, there are many features to call external code, such as ActiveX controls, COM servers, DECLARE DLL or SET LIBRARY TO . In older versions, you could even LOAD and CALL machine code. If such external calls caused a crash for some reason, what should...
Calvin Hsia's WebLog
Intentionally crash your program
Posted
over 8 years ago
by
CalvinH
8
Comments
When developing the Watson error reporting features (see Dr. Watson: Please send in your error report , and What is a C0000005 crash? , What was Dr. Watson's original name? )) it was useful to cause a crash intentionally In VFP we have a simple...
Calvin Hsia's WebLog
Is this a bug in the View Parent Code button?
Posted
over 8 years ago
by
CalvinH
4
Comments
We received a bug report Steps to Reproduce : 1) Create MyButtonClass1 class of MyButtonLibrary1. Add code to click method. 2) Create MyFormClass1 class of MyFormLibrary1. 3) Add commandbutton of class created in step1. Add code to commandbutton...
Calvin Hsia's WebLog
Collecting pictures for yearbook, Ektaflex
Posted
over 8 years ago
by
CalvinH
2
Comments
Not even three months of school have passed, and I’ve already received a request for school photos for the yearbook. Simple: bring up my VFP Picture Query program , type in “School”, date range since September 2005, and presto: a SQL Select query of my...
Calvin Hsia's WebLog
How old is your computer?
Posted
over 8 years ago
by
CalvinH
2
Comments
You can determine the last time your Administrator password was changed, which could have been the first time you started your computer (if you haven’t formatted your hard disk or changed the admin password) This code calls NetUserGetInfo to get user...
Calvin Hsia's WebLog
I cant understand why men cant live without wars
Posted
over 8 years ago
by
CalvinH
6
Comments
I read A 'Rand'om Word Trick For You about inserting “Random” words into Word for sample data. It actually puts in a fixed sentence (“The quick brown fox jumps over the lazy dog”) multiple times, which isn’t random at all. That reminded me of the...
Calvin Hsia's WebLog
Windows Security and how it affects running generated code
Posted
over 8 years ago
by
CalvinH
6
Comments
Here I described how VFP generates executable code and runs it for early and late binding COM clients and implementing COM interfaces. However, there is an important issue with generating and running executable code in the same process. A computer...
Calvin Hsia's WebLog
Load, Call, Character Generators, and "Letter Quality" printers
Posted
over 8 years ago
by
CalvinH
3
Comments
I remember early versions of FoxPro had the LOAD and CALL commands (try typing them in the command window!) that allowed you to put binary code directly into memory and run it! Back about 20 years ago, I wrote code in Foxbase that I hand assembled...
Calvin Hsia's WebLog
The vTable name is __vfptr in the debugger
Posted
over 8 years ago
by
CalvinH
2
Comments
When I’m at a breakpoint debugging some C++ code, sometimes I drill down into members of variables to inspect values. The way C++ implements inheritance, there is a virtual function pointer table, often called a vtable. The Visual Studio debugger allows...
Calvin Hsia's WebLog
What to do with the Bindevent return value?
Posted
over 8 years ago
by
CalvinH
3
Comments
The BINDEVENT( ) Function allows you to attach code to run when other code is executed. It’s sort of like an event hook. The first example below has a method called “Foobar” which is called to return a value. After BindEvent is called, the method is...
Calvin Hsia's WebLog
Quiz: Infinite Continued fractions
Posted
over 8 years ago
by
CalvinH
5
Comments
At the SouthWest Fox speaker dinner we were talking about continued (or infinite) fractions. I posed this question: What does this expression evaluate to? 1 + 1 _________ 1 + 1 ________ 1 + 1 _______ 1 + 1 ______...
Calvin Hsia's WebLog
How does Task Manager determine if an Application is Not Responding?
Posted
over 8 years ago
by
CalvinH
5
Comments
If you start Task Manager (Ctrl-Shift-Esc) and display the Applications tab, you will see a list of running applications. Once in a while an application shows as “Not Responding”. How does Task Manager figure that out? A simple way to determine...
Page 1 of 1 (19 items)