Calvin Hsia's WebLog

thoughts from a professional developer

January, 2006

  • Calvin Hsia's WebLog

    Create your own Word Search puzzles

    • 27 Comments
    I wrote a Word Search generating program in C++ (308 lines) years ago: my brother used it to generate a puzzle including all the girls in his 8 th grade class, which was 22 years ago: about 1984 (sounds Orwellian<g>). I wrote one in C# (456 lines...
  • Calvin Hsia's WebLog

    Create your own typing tutor!

    • 22 Comments
    Here’s an idea to teach somebody the positions of the letters on the keyboard: letters fly in randomly from the right for 30 seconds. Hit the letter on the keyboard for points. Miss and lose points. As time goes on, the letters move faster and there are...
  • Calvin Hsia's WebLog

    What external code does your EXE depend on?

    • 10 Comments
    In the old days, when you wrote a program, you had full control over the CPU. The Instruction Pointer would always point to code that you wrote, and never anywhere else. That means if you wanted to do any kind of input/output, you had to write it yourself...
  • Calvin Hsia's WebLog

    A Discounter Introduces Reductions: Multiple Anagrams

    • 18 Comments
    Many moons ago, I was playing with spelling dictionaries (see What is an index anyway? ) and anagrams. After decoding a spelling dictionary for a word data base in the early 1980s, I wrote some word games, like scrabble and anagrams. APT, PAT, and...
  • Calvin Hsia's WebLog

    What's the difference between Vartype and Type

    • 8 Comments
    Happy New Year… I took some time off to spend with my family. To get the type of variable “MyVar”, you can use TYPE(“MyVar”) or VARTYPE(MyVar). Notice no quotes are used for VARTYPE. TYPE(cExp) scans and compiles the expression in the string...
  • Calvin Hsia's WebLog

    Find all statically linked libraries required before your process can start

    • 11 Comments
    There’s some code in this post What external code does your EXE depend on? that determines all the statically linked libraries and function calls of a particular EXE. VFP9.EXE links to about 18 modules. However, there are about 83 modules loaded when...
  • Calvin Hsia's WebLog

    Detecting Workstation state changes

    • 0 Comments
    I read Raymond’s post about detecting workstation events: http://blogs.msdn.com/oldnewthing/archive/2006/01/04/509194.aspx To detect shell events, such as a new drive being added, see my blog: Run your code in response to a new drive being inserted...
  • Calvin Hsia's WebLog

    Phone number and wife haven't changed in 11 years

    • 13 Comments
    There’s a sporting goods store that I’ve visited on occasion over the last 11 years. It’s a membership cooperative, which mails a percentage rebate check back to customers annually. I signed up as a member 11 years ago, which meant yet another card to...
  • Calvin Hsia's WebLog

    Is there a way in VFP to pass a DWORD to an API function from VFP?

    • 10 Comments
    A customer asked: Is there a way in VFP to pass a DWORD to an API function from VFP? The Beep API function used in Create your own typing tutor! uses DWORDs and is called via the DECLARE - DLL Command . A DWORD is just a 32 bit value. An integer...
  • Calvin Hsia's WebLog

    Change the default screen saver

    • 0 Comments
    After booting up Windows XP and before I’ve logged on, or when I connect via remote desktop to a machine, the machine’s screen saver settings for the Default User will determine what the screen saver is and how it is fired. However, after I log in, the...
  • Calvin Hsia's WebLog

    Remote Desktop and Offscreen Bitmaps

    • 3 Comments
    I read Raymond’s blog: Taxes: Remote Desktop Connection and painting , in which he describes offscreen bitmaps and why applications use them. My home web server sits on top of a bookcase and I never touch it, except for any maintenance. However...
  • Calvin Hsia's WebLog

    Why did we limit the command window history length?

    • 2 Comments
    In this post: You can hit enter anywhere on the line in the command window , I talked about the command window history. Daniel asked why the size of the history seems to have a limit of around 256K in VFP9, but no limit in VFP7 (or VFP8). ...
  • Calvin Hsia's WebLog

    Digging through old code: Chess program

    • 4 Comments
    There is a lot of waiting for parents at a chess tournament (see Eliminating Fire Alarm sound at Chess Tournament Awards Ceremony ). I had my computer, and I was asked if I had a chess program on it. The answer is a little bit complicated: I wrote...
  • Calvin Hsia's WebLog

    Carburetor is a car part, but prosecutable is not

    • 6 Comments
    My wife and I like to listen to PuzzleMaster Will Shortz.on NPR. This week’s challenge is from one of my favorite puzzle makers Merl Reagle : Take the word carburetor, add two letters and rearrange the result to name another car part. And...
  • Calvin Hsia's WebLog

    Index creation performance issues

    • 3 Comments
    In this post: Index creation performance question I asked: Is it faster to fill a table with values, then index it or create the index on an empty table, then fill it? Why? After a record in a cursor is modified, any associated index must be updated...
  • Calvin Hsia's WebLog

    You can hit enter anywhere on the line in the command window

    • 3 Comments
    The Fox Command window maintains a history of prior commands. (A quick search of the source code logs shows I added this feature on June 19, 2000, then a quick look at my ShipIt Award (a little trophy/plaque from Microsoft which has stickers for each...
  • Calvin Hsia's WebLog

    Publishing blog statistics horror story

    • 3 Comments
    I received an email from someone at Microsoft this morning about the availability of the Excel spreadsheet for internal Microsoft blogger December hit statistics. Last month I had written a program to show MS Bloggers hit statistics. So I ran the...
  • Calvin Hsia's WebLog

    Index creation performance question

    • 2 Comments
    Is it faster to fill a table with values, then index it or create the index on an empty table, then fill it? Why? Guess which one is faster before running the code below. (I attended a presentation by the MSN Search team a while ago where...
  • Calvin Hsia's WebLog

    Grid Cell Alignment response

    • 0 Comments
    This post: Is this a bug in the Grid Cell alignment? discusses a grid cell alignment issue. When the grid is created and there is a cursor open in the current work area, a grid column will be created for each field in the cursor. The alignment for...
  • Calvin Hsia's WebLog

    Do you know this feature of the Document View Window?

    • 3 Comments
    Open a PRG file with several procedures, functions or methods in the VFP editor. Open the Document View window (Tools->Document View). Right click on the Document View window and select “Sort by Location” Activate the edit window and hit Ctrl...
  • Calvin Hsia's WebLog

    Is this a bug in the Grid Cell alignment?

    • 1 Comments
    Run the code below. It creates a grid with 2 rows and 2 columns. Move your cursor between rows and you see “some data” bouncing around” Try it with the other IF condition to see the expected behavior. Is this a bug? PUBLIC oForm oForm...
Page 1 of 1 (21 items)