Sunday, August 10, 2008

Wow! It's been 117 days since my last blog entry. I knew that it had been a while. I guess it was just too easy to keep telling myself I'll catch up on the blog next week. Oh well, here is what I've been up to for the past 4 months.

In April I resigned from CCS (Complete Computer Service, Ltd.) and took a position at White Light Computing. CCS is a small software company that sells vertical market applications to the Healthcare Staffing, Security Guard, and Temporary Help industries. With almost 13 years of service it was not an easy decision for me to leave, but I still think it is what will be best for me and my family in the long term. I hope to remain in contact and friends with the people I worked with there for many years to come.

May 1st was my first day at White Light Computing. So far I am really enjoying the challenges and the type of work I am doing. After working on a vertical market application for so many years it came to the point where I knew the code like the back of my hand and the frequency in which I was technically challenged was less and less. One of the things I like about software development is that I can constantly test myself and learn new things. And the work I am doing at White Light Computing lets me do just that.

On June 14th I took a little trip over to Grand Rapids Michigan to catch the GRAFUG (Grand Rapids Area FoxPro User Group) special event, The Andy & Marcia Show. Andy Kramek and Marcia Akins presented five topics: Implementing Design Patterns in Visual FoxPro - Part 1 & 2, The 26 Hour Day, Using ActiveX Controls, and Event Handling in Visual FoxPro. In addition, TechSmith donated copies of SnagIt and Camtasia Studio Bundle which were given away during the event. All of the above plus lunch and snacks for the low price of forty dollars. Definitely worth every penny and giving up a Saturday to attend.

The month of June was another big month for me personally. My wife and I celebrated our 10th anniversary with a ten day trip to the west coast. We started with three nights in Las Vegas at New York New York Hotel and Casino. One of my favorite places in Las Vegas is The Bar at Times Square and the dueling pianos. Another highlight was seeing "Phantom" at The Venetian. Although I have seen The Phantom of the Opera a couple of times before, I have to say that this production was by far the best, and the custom built theatre was amazing.

From Las Vegas we flew over to San Francisco and stayed at the Marriott Fisherman's Wharf for three nights. San Francisco is a really cool city with a lot of culture and unique bars, restaurants, and shops. I especially liked that most places we wanted to go were in walking distance. For the things that were not, the mass transit system is out of this world compared to what we have back home.

For the last segment of our trip we rented a convertible and drove to Napa Valley. Along the way we stopped and did some brief hiking at Muir Woods National Monument. This time we stayed three nights at a bed breakfast two blocks from downtown Napa, visited several wineries, and finished with a trip to a spa in Calistoga. The whole trip ended with a Friday night red-eye flight back home so that we would have at least two days to recoup before going back to work.

Vacation is always nice, but eventually you have to come back home and deal with all of the things that got left behind. That was July. I don't know where time went, no special events come to mind, but the days flew by none the less.

On second thought, I did start a half marathon training program in July. On October 5th I'll be running the Brooksie Way Half Marathon in Oakland County, Michigan. This is my first ever half marathon so I'm not expecting to break any records, finishing the event will be victory enough.


Links:
White Light Computing, Inc. http://www.whitelightcomputing.com
GRAFUG http://www.grafug.com
New York New York Hotel & Casino http://www.nynyhotelcasino.com
San Francisco Marriott Fisherman's Wharf http://www.marriottfishermanswharf.com
Muir Woods National Monument http://www.visitmuirwoods.com
Brooksie Way Half Marathon http://www.thebrooksieway.com

posted on Sunday, August 10, 2008 6:10:43 PM UTC  #    Comments [1]
 Tuesday, April 15, 2008

Ever since I decided to post the Beyond Compare add-on utility, VFP2Text, it was always my intention to also release the source code. The reason I waited was to allow some time for any bug reports or major enhancement ideas. I figured initially it would be easier for me to handle them.

Well, it's been over a month since I first blogged about the add-on and so far no problems reported and the enhancement requests have been about minor changes. So, in keeping with my original plan, I have posted the source code for the utility on my web site here.

In return, I ask that you please share with me any cool enhancements or bugs you find. Thanks.

posted on Tuesday, April 15, 2008 11:03:32 AM UTC  #    Comments [0]
 Friday, April 11, 2008

Last night Mike Feltman, of F1 Technologies, did a presentation called "Collections". He discussed the basics of collections and arrays, and very some cool utilities he wrote for working with both.

One of cool things I learned had to do with the FOXOBJ clause of the FOR EACH ... ENDFOR command. For example, in the following code sample "loObject" is not a Visual FoxPro object, but is re-casted as a COM object.

loCollection = CREATEOBJECT("Collection")
loCollection.Add(CREATEOBJECT("Custom"))
FOR EACH loObject IN loCollection
   && loObject is a COM object, AMEMBERS() returns 0.
ENDFOR

Starting with Visual FoxPro 9, we can add the FOXOBJ clause so that loObject is a Visual FoxPro object. This is an important distinction, because functions like AMEMBERS() and COMOBJ() would produce unexpected results.

loCollection = CREATEOBJECT("Collection")
loCollection.Add(CREATEOBJECT("Custom"))
FOR EACH loObject IN loCollection FOXOBJECT
   && loObject is a Visual FoxPro object, AMEMBERS() returns 18.
ENDFOR

The FOXOBJ clause was not new to me. However, what I did not know was that using the FOXOBJ clause made the FOR EACH ... ENDFOR command almost 2x faster than the FOR ... ENDFOR equivalent.

* create a collection with 10,000 items
loCollection = CREATEOBJECT("Collection")
FOR m.lnX = 1 TO 10000
   loCollection.Add(CREATEOBJECT("Custom"))
ENDFOR

* test the performance using FOR EACH
m.lnStartTime = SECONDS()
FOR EACH loObject IN loCollection
   * do nothing, we already have an object reference
ENDFOR
? "FOR EACH: " + TRANSFORM(SECONDS() - m.lnStartTime) && 0.156 seconds

* test the performance using FOR EACH with FOXOBJ
m.lnStartTime = SECONDS()
FOR EACH loObject IN loCollection FOXOBJ
   * do nothing, we already have an object reference
ENDFOR
? "FOR EACH with FOXOBJ: " + TRANSFORM(SECONDS() - m.lnStartTime) && 0.016 seconds

* test the performance using simple FOR
m.lnStartTime = SECONDS()
FOR m.lnX = 1 TO loCollection.COUNT
   * get an object reference to the item
   loObject = loCollection.ITEM(m.lnX)
ENDFOR
? "FOR: " + TRANSFORM(SECONDS() - m.lnStartTime) && 0.031 seconds

Little gems like this are one of the benefits of attending local FoxPro user groups meetings. The opportunity to learn something new, meet new people, and the comradery are all valuable benefits.

If you missed this presentation, I heard that Mike will be presenting it again at the Grand Rapids Area FoxPro User Group on May 10th, 2008.


Links:
DAFUG http://dafug.org
GRAFUG http://www.grafug.com
F1 Technologies http://www.f1tech.com

posted on Friday, April 11, 2008 10:43:36 PM UTC  #    Comments [0]
 Wednesday, April 09, 2008

I downloaded my first issue of FoxRockX and I have to say that I like it. The format reminds me of the old FoxTalk issues. There is a good amount of content; twenty-four pages with out any advertisements. And of course, source code was included.

Out of the five articles in this issue, Doug Hennig's "Deep Dive: A Generic Import Utility" is my favorite. This article is part one of a two-part series that will demonstrate how to add a generic import utility to your application. In this issue he discusses the overall design and engine code. The next issue will be about the user interface.

Articles like this are a major reason why I subscribe to technical publications. Maybe I don't have a need for this today. But, I know that there is a good chance I will someday. And when that time comes I will more than likely use this article and sample code as inspiration for designing and writing my own.


Links:
FoxRockX http://www.foxrockx.com
Subscription in America & Asia http://www.hentzenwerke.com
Subscriptions in Europe http://shop.dfpug.com

posted on Wednesday, April 09, 2008 10:27:24 PM UTC  #    Comments [0]
 Tuesday, April 08, 2008

Last year we let our subscription to FoxTalk lapse for several reasons. For starters, there was the marketing tactics of Eli Journals. Then there was the matter where the archive issues, published before Eli Journals took over, were no longer available on the web site. But most of all, I felt that the content was not what it used to be.

So when I heard that Rainer Becker was starting a new on-line magazine called FoxRockX, I was like "hey that's cool". Then I heard that one of my favorite columns, the KitBox, would be coming back along with the always entertaining Marcia Atkins and Andy Kramek...and I thought "that's awesome". But when I found that a FoxRockX subscription included on-line access to the complete archives of FoxTalk issues...I was sold.

It is going to be so cool to have the old FoxTalk issues available in a searchable format. I don't know how many times I've been able to get a head start on a problem by taking advantage of something in one of those articles. Plus, I can't wait to see the new stuff.


Links:
FoxRockX http://www.foxrockx.com
Subscription in America & Asia http://www.hentzenwerke.com
Subscriptions in Europe http://shop.dfpug.com

posted on Tuesday, April 08, 2008 10:21:43 PM UTC  #    Comments [0]
 Monday, April 07, 2008

When I started this blog, it was never my intention to allow so much time between posts. My goal was to try and blog at least once per month. Well, things have not quite worked out the way I envisioned. I always seem to find my self starting to write something, never feeling 100% happy with it, and then abandoning it all together.

I guess blogging is something that does not come easy to me, at least not yet. I think the only way to beat this problem is to just accept whatever comes out and post it. If it sucks, well at least I tried. So without further delay, here are some things that I've been meaning to post.

posted on Monday, April 07, 2008 10:10:36 PM UTC  #    Comments [0]
 Saturday, March 08, 2008

Beyond Compare is one of my favorite developer utilities.  It's a tool for comparing folders, files, and folder like things such as ZIP and CAB files.  It can detect differences using several methods, such as the timestamp, size, CRC, attributes, and more.


Once two files are identified as not identical, you can drill down into the contents and see exactly what is different line by line using Beyond Compare's File Viewer.


This feature is cool, however the native file viewer only supports text files such as HTML, TXT, XML, and so on.  If you try to compare a binary file, you get something that looks like this.


I checked Beyond Compare's web site and found several plug-ins for viewing other binary files like BMP, GIF, JPG, and MP3.  Hmm, not what I was looking for, but could be a handy thing to have in the future.


I looked around a little more and I found some file viewer rules for handling binary files like DOC, XLS, and PDF.  Once again, not what I needed, but I would probably need some day.

So I decided to download a few of these and what I found is that the file viewer rules use Beyond Compare's capability to launch an external conversion program before a file is passed to it's native file viewer.  For example, the DOC rule uses a Visual Basic Script (VBS) to automate Microsoft Word, open the passed DOC file, and then save a copy of it to a temporary text file.  This temporary file is then passed to Beyond Compare's internal File Viewer for the line by line comparison.


Bingo!  If Beyond Compare can call an external conversion program, why not write something that converts FoxPro files to plain text files.  And thus VFP2TEXT was created.

Here's how it works.  I created a file viewer rule in Beyond Compare for all FoxPro related file types (CDX, DBC, DBF, DCT, DCX, FPT, FRT, FRX, FXP, H, LBT, LBX, MNT, MNX, MPR, MPX, PJT, PJX, PRG, QPR, SCT, SCX, VCT, VCX).  This rule calls executes VFP2TEXT.EXE passing both the original file name and a temporary file name.


Based on the file type, the VFP2TEXT.EXE program converts the passed file to a text file using one of the following methods:

  • Index (CDX, DCX): retrieve the index tag information only.
  • Table (DBF, DBC, FRX, SCX, etc): use the CURSORTOXML() function to generate an XML file.
  • Text (H, MPR, PRG, etc): no conversion.
  • Visual Class Library (VCX): use the Class Browser View Code feature to generate a PRG file.


If you would like a copy of this utility, you can download the latest version from my web site here.  When using it, there are a couple of things to keep in mind:

  • Beyond Compare will execute the conversion program twice, once for the file on the left and once for the file on the right.
  • Be careful about doing a Rules-Based Comparison on a large directory.  I prefer to use the Binary Comparison first, and then use a Rules-Based Comparison on the results.


Links:
Beyond Compare http://www.scootersoftware.com/

posted on Saturday, March 08, 2008 12:48:52 PM UTC  #    Comments [4]
 Friday, December 14, 2007

Last night Paul Mrozowski did a presentation called "Lucene.NET as a Document Search Engine".  He began by explaining that Lucene.NET is an open source indexing and search library written in C#.  It is not a traditional application.  Instead it is a tool developers can use to index and search documents, such as CHM, DOC, HLP, PDF, RTF, and TXT files. 

Paul first demonstrated how easy it is to install Lucene.NET, some of the configuration settings, and how to set it up to run as a background service in Microsoft Windows.  Next he showed us a COM wrapper class that he created in order to use Lucene.NET from Visual FoxPro.

The wrapper class could be used to index the source files and perform some pretty complex searches.  I liked the way it could include the surrounding portions of text with the search results.  For example, if you searched for the phrase "fox" in "Visual FoxPro Rocks", you could include a variable amount of the original characters found before and after the search phrase.

In addition to indexing document files, he also demonstrated how the wrapper class could be used to build your own index entries with meta data.  For example, you could index the contents of a memo field and then store the table name and record identification in the meta data.  Later, this information could be searched the same as document file.

Although the wrapper class did not have the complete functionality of Lucene.NET, it did fill the most basic needs.  He mentioned the idea of either posting the sample code to his web site or better yet making it a VFPX project.  All in all, it was a very cool presentation.


Links:
DAFUG http://dafug.org
Paul Mrozowski http://www.rcs-solutions.com

posted on Friday, December 14, 2007 7:06:16 PM UTC  #    Comments [0]