I’ve Seen This Before. It’s An Outlier.

UPDATE: Finally figured out this issue. I was encrypting an XML file, which caused some illegal characters to appear from time to time (the “outlier” instances). Took out the header of the XML file, and everything works as expected.

I recently added some functionality to an app which allows the app to login to a web service with a username and password. Since I want to retain the login information (so the user doesn’t have to be prompted to enter their credentials every time), I store the username and password in an XML “settings” file.

I’ve been using Craig Boyd’s excellent VFPEncryption FLL to encrypt/decrypt the password. The user enters her username and password, the password is encrypted, and the username and password are written to the XML file. It’s been working great on thousands of computers.

Except for four computers.

When the app needs to retrieve the username and password, it opens the XML file, decrypts the password, and tries to login to the web service. But on these four computers, the decryption crashes with “API call caused an exception”.

Working with a customer on this particular problem, I pointed him to the XML file and asked him if he would be willing to change his password for the web service – just to see if maybe we could get past the crash.

He changed a couple of characters in his password, and voila! – it worked with no problem.

So he went back to his original password and made note of the encrypted password which was stored in the XML file. Oddly, the encrypted password contained an embedded carriage return:

<PASSWORD>?-arP?­Z?=¤¨?? ;?¥
?8??*ù©y</PASSWORD>

He changed a couple of characters, and made note of the encrypted password again:

<PASSWORD>ðF’1L’|„ žU­MU¨èˆfâ‚?TÀn Çvõ’U</PASSWORD>

Freaky, huh? When I run the code from the app via the Visual FoxPro Command Window, including the STRTOFILE() and FILETOSTR() lines to write and read the XML file, it works with no problem.

The customer, a former software developer, tried 16 more random passwords – just to see what would happen. Every one of them worked flawlessly.

So, after successfully trying 17 passwords he went back to the original. Same problem: an embedded carriage return in the stored encrypted password, and an API exception when decrypting it.

The last thing he said to me was:

Then it hit me, not the first time I’ve seen this. It’s an outlier. There is a very good reason why this is happening. You may close the ticket now. The function is working fine.

Ceil Silver Ambassador Fund

One of my best highlights of last years Southwest Fox conference was meeting Emerson Reed. Emerson is the creator of the ThemedControls suite on VFPx, a stunning set of visual controls which provide a modern UI for Visual FoxPro applications.

He is also one of the nicest people I’ve ever met. Every minute I spent with Emerson at the conference was a great pleasure for me, and I’m very thankful for the opportunity to have met him in person.

Emerson attended the conference as the first Ceil Silver Ambassador to Southwest Fox, representing the Brazilian FoxPro Community, and he truly was a wonderful ambassador.

If you’ve never heard of the Ceil Silver Ambassador Fund, here’s some info from the Southwest Fox Website:

The Ceil Silver Ambassador Fund brings a developer to the Southwest Fox conference as an ambassador for the developers in his or her country. This gives the recipient the opportunity to meet and share experiences with developers attending Southwest Fox and gives other attendees the opportunity to learn about VFP development in the recipient’s country. The Fund is financed by contributions from the VFP community, and from Geek Gatherings.

The Fund is named in memory of Ceil Silver, a long-time member of the Visual FoxPro community, who passed away in January, 2009. Ceil served as Editor of FoxPro Advisor’s Tips and Tricks column for many years and was the founder of the Westchester County FoxPro chapter of PADD, the Professional Association of Database Developers. She was also a contributing author to Special Edition Using Visual FoxPro 6. Ceil understood the value of attending professional conferences, and continued to attend them until her failing health prevented it.

At the conference, Emerson showed off the ThemedControls during one of the Show Us Your App sessions, including a new Office 2007-style ribbon control. Everyone in the audience was amazed at the capabilities of the ThemedControls.

He also spent a lot of time answering questions from me. I’m sure I sounded like a total hack with some of the questions, but he was always gracious and patient, and never turned me away.

When he showed the Ribbon control, he asked for help from the community in developing it. I told him I’d love to help. Unfortunately, thanks to limited time and resources (and by resources I mean ability on my part), I’ve sadly been zero help at all.

So if you have a hankering to help, please contact Emerson via his blog or the CodePlex site.

Emerson Reed – Southwest Fox 2009 (From Emerson’s Blog)

This year there will be TWO Ceil Silver Ambassadors at Southwest Fox: César Chalom (from Brazil) and Bernard Bout (from Australia).

Both César and Bernard are active bloggers on Foxite, and both have done tremendous work with GDIPlusX and showing us how to move our Visual FoxPro apps into the 21st century.

Emerson, César and Bernard truly put the “Visual” in Visual FoxPro.

César also created the FoxCharts (on VFPx) and FoxyPreviewer (a separate project on CodePlex). Both are sensational reminders of what is possible with VFP.

I’m really looking forward to meeting (and learning from) both of them this October.

Updated: 11:32AM – Rick Schummer pointed out that FoxyPreviewer is not a VFPx project. It is a separate project on CodePlex. Thanks, Rick!

My Favorite Teacher Is Speaking At Southwest Fox

Updated: Most links now point to archived versions of the Southwest Fox Conference (depending on the year). Click here to visit the current Southwest Fox web site.

Southwest Fox 2005 was the first FoxPro Conference I attended. Though I was a wallflower for most of the conference and kept to myself, I was amazed at the amount of technical knowledge that permeated the air (I spent most of my time at the conference simply absorbing as much of the knowledge as I could).

What I learned in one session that year practically paid for the entire conference, saving me tons of time in my own work. That year, Rick Borup presented Integrating RSS With Visual FoxPro Applications. I had been working on integrating RSS with a couple of apps, and had hit the proverbial brick wall. Everything I tried, failed. Miserably. The harder I worked on it, the worse it got.

In a single 75-minute session, Rick opened the floodgates. My problems were solved that very day as I went back to my hotel room with my laptop that night and started applying what I had learned from Rick to my apps.

Flash forward to 2009. I was (finally) going back to Southwest Fox, and Rick was speaking again, presenting The Show Must Go On: Disaster Recovery and Business Continuity Planning and Quibbles, Quirks, and Quickies. Having promised myself that I would go to at least one of Rick’s presentations anytime I was attending a conference he was speaking at, I chose the Quibbles, Quirks, and Quibbles session.

I didn’t go to that session expecting to learn a whole lot (though I did, especially considering he wrote a 35-page whitepaper for the session). I went because I really appreciate Rick’s style of presenting. He is direct, informative, knowledgeable, and as well-prepared for a session as anyone I’ve ever seen.

There’s never any wasted moments in one of Rick’s sessions.

And that reminds me of my favorite teacher in high school. An Air Force retiree, he taught Algebra, Geometry, and Calculus with an almost surgical precision. Never a wasted moment, always prepared, always something to learn (even when you think you already know everything there is to know).

Rick is speaking again at Southwest Fox. A pre-conference session titled An Introduction to Ruby and Rails, and a regular conference session titled Design Patterns in Visual FoxPro.

There’s no way I’ll miss the Design Patterns session.

This week, Rick was interviewed by Andrew MacNeill on The FoxShow podcast about his sessions for this years conference. As usual, his style was evident: direct, knowledgeable, and prepared.

Rick is one more great reason to attend Southwest Fox this year.

Not registered for the conference yet? Register Now…