Calvin Hsia's WebLog

thoughts from a professional developer

  • Calvin Hsia's WebLog

    Decoding the timestamp in class libararies and forms

    • 4 Comments
    I was asked Is there a way to translate the timestamp in a VCX to a human readable format? Visual Foxpro puts a timestamp on many records in the table that represents a form or class library. Historically this field was used to match records across supported...
  • Calvin Hsia's WebLog

    Heartbeat: Garbage collection in VFP and .NET are similar

    • 3 Comments
    VFP stores user defined names such as variable, field, property, class and procedure names in a table. When the name table runs out of space, the GC begins. All the entries are marked as unused. Then all the various name table clients are sent a message...
  • Calvin Hsia's WebLog

    User Interface design for numeric keypads

    • 17 Comments
    I have just read Raymond’s User interface design for interior door locks which reminded me of a curiousity. Take a look at your telephone’s numeric keypad. The top row of buttons on mine is 1,2,3. Now look at your computer keyboard numeric keypad or a...
  • Calvin Hsia's WebLog

    Permutations

    • 2 Comments
    I saw this post which shows some VFP code to permute a string. For example, there are 6 permutations of “abc”: abc, acb, bac, bca, cab, cba There are n! permutations of a string of length n. I dug up some old code that did the same thing in fewer lines...
  • Calvin Hsia's WebLog

    Wite your own RSS News/Blog aggregator in <100 lines of code

    • 9 Comments
    The internet is a great way for people/entities to publish information. An RSS reader is a tool to help funnel only the information that you think is important to you. You can subscribe to RSS sources (Blogs, news sites, businesses, authors) by choosing...
  • Calvin Hsia's WebLog

    Do you like reading a blog author? Retrieve all blog entries locally for reading/searching using XML, XSLT, XPATH

    • 5 Comments
    If you like reading a particular blog and want to read more from the same author, you can subscribe to the blog using RSS and any number of blog readers, such as newsgator , intravnews . This will get a few current entries (RSS is limited to 15 entries...
  • Calvin Hsia's WebLog

    Use a simple XSLT to read the RSS feed from a blog

    • 13 Comments
    On most Blogs, there is a link called “Syndication”,”RSS”, or “XML” that is the RSS feed. Click on that, and you see an XML document that contains some recent blog posts. This simple code reads the RSS feed for my blog, does an XSLT transform of the XML...
  • Calvin Hsia's WebLog

    What is an index anyway?

    • 12 Comments
    Foxpro’s legendary speed is due in part to its index technology. About 14 years ago, the speed of Foxpro was demonstrated to live audiences around the country. A table (places.dbf) of almost 3 million streets in the US was used as the demo data (about...
  • Calvin Hsia's WebLog

    Binding to Windows Events for Fox windows

    • 3 Comments
    In a prior blog I described a demo I gave at Las Vegas Devcon that showed how to bind to Windows Events to respond to Windows Shell notifications. Another demo I gave at Devcon was a simple program that bound to Windows Events to trap for window activation...
  • Calvin Hsia's WebLog

    Interactively experimenting with controls: the Slider

    • 1 Comments
    I have a simple form that can show an individual photograph, or at the push of a button, show an array of thumbnails. It is a simple client front end for my collection of about 18000 digital photos and home movies. The thumbnail view shows about 100 pictures...
  • Calvin Hsia's WebLog

    Fox plays music

    • 10 Comments
    I received a customer question: I have searched the net and asked as many people as I could and could not get an answer, so I am bothering you. Do you know of a way to get VFP to play mp3 format tunes? There must be a way to use a media player driver...
  • Calvin Hsia's WebLog

    Foxpro Performance tip: field name lookup for tables

    • 11 Comments
    When FoxPro opens or uses a table or cursor, internally we have to keep track of the field names used in that table. For example, this statement creates a table with 3 fields. CREATE TABLE foo ( lastname c( 10 ), firstname c( 10 ),address c( 20 )) When...
  • Calvin Hsia's WebLog

    Creating a VFP application as a service:

    • 29 Comments
    Sometimes it’s useful to make your application run as a service. A service can run without any user logged in, can automatically start upon reboot, and can survive user logoffs. It can also run as a different user with different access rights. Normally...
  • Calvin Hsia's WebLog

    Sending Christmas cards: Creating mailng labels automatically

    • 14 Comments
    A family member sent out an emergency email plea for help: I bought labels: Avery 8160, which have very clear instructions about how to enter names and addresses manually, but nothing about how to use data from an Excel file to do so. Avery.com tells...
  • Calvin Hsia's WebLog

    Using non-Automation compatible types

    • 3 Comments
    A customer asks: I’m using a third party COM server dll with my VFP8 application. One of its methods requires a structure as a parameter. It seems to me that unlike with dlls, where you can trick VFP into substituting a character string for a structure...
  • Calvin Hsia's WebLog

    Intellisense: inspecting live objects

    • 7 Comments
    In this entry I talked about a performance improvement of FoxPro’s object handling. I showed an example of object based programming: oExcel= CREATEOBJECT ("excel.application") oExcel. A live instance of Excel is created. When you type the “.”, intellisense...
  • Calvin Hsia's WebLog

    Unbelievable performance gain by changing an Algorithm

    • 9 Comments
    Visual Foxpro added Object Oriented Programming in version 3 which was released about 10 years ago. Back then users weren’t expected to use very many objects. Nowadays, with more memory, users create thousands of objects, and things were slowing down...
  • Calvin Hsia's WebLog

    Another customer problem: a product doesn't work with VFP

    • 3 Comments
    A customer reported that a product they have doesn’t work with Visual Foxpro . Time to put on the detective hat! In the command window, type o= CREATEOBJECT (“ABCProduct.Application”) After hitting the Enter key, the FoxPro process crashes. I tried from...
  • Calvin Hsia's WebLog

    Programmatically add a watch expression to the debug watch window

    • 1 Comments
    A user may want to add a particular variable or expression to the Visual Foxpro debug watch window Here’s some code to do it. The debugger can read/write a particular debug config file. The default is stored in the fox resource file. Or you can choose...
  • Calvin Hsia's WebLog

    Screen Saver Tricks

    • 4 Comments
    In a prior blog entry I describe how a couple lines of code can start the currently registered screen saver instantly and how to disable the screen saver. Screen savers are funny animals. They are simply executable programs that typically will terminate...
  • Calvin Hsia's WebLog

    Run your code in response to a new drive being inserted

    • 6 Comments
    At the Las Vegas Devcon last month I used a digital camera to take a picture, then I plugged the camera media into my Tablet PC which was running the Visual Foxpro code below. The pictures on the media were automatically detected by the event handler...
  • Calvin Hsia's WebLog

    Using Outlook to manage new documents

    • 1 Comments
    I like using Outlook to manage documents that I compose, such as this blog entry. What I mean by that: I start writing a document by simply starting to compose a new mail message. I have Outlook configured to use MSWord as my email editor, so I have the...
  • Calvin Hsia's WebLog

    Creating, parsing, graphing web hit logfiles or other temporal data

    • 4 Comments
    Looking at temporal data can be quite informative. For example, I have a table of about 16000 photographs . Each record has a datetime stamp. Looking at the temporal distribution one can clearly see events, such as the birth of a child, the visit of relatives...
  • Calvin Hsia's WebLog

    Very Advanced Debugging tips

    • 9 Comments
    While debugging code, it might take very many complicated steps to reproduce an issue. The following applies to debugging both Visual FoxPro and Visual Studio Native code debugging, except where noted. The VFP debugger is modeled after the VS debugger...
  • Calvin Hsia's WebLog

    Give the impression that you're an expert and earn palpable respect

    • 2 Comments
    Our local bridge club uses a computer program to tabulate scores. The bridge director enters scores from each round as they finish, so within a few minutes after the event is over, the final scores, rankings and earned masterpoints are available, and...
Page 16 of 18 (430 items) «1415161718