Wednesday, December 17, 2008

VFP: Grid Header Pictures

Those following along on Twitter know that I am working with Craig Boyd's GridExtras class in one of my customer projects. This is an interesting tool that is making me look really proactive to my customers.

One of the features is the ability for users to double-click on the header and the RecordSource is sorted on the column in the grid. Jody Meyer enhanced this to toogle from ascending to descending to no order. The columns can also be filtered which is an awesome feature because Craig mimics the dialogs to work like column filtering in Microsoft Excel. Both of these features put images in the headers of the columns to give the users a visual clue of what is going on for the grid.

For some reason I was not getting the images in my grids. Obviously it is working for Craig because the sample app he ships has the images displayed. It is not a VFP 9 SP2 thing, because I could run his app in VFP 9 SP2 without any issue.

On a whim I moved the images from the gridextras folder I have under a different directory tree on the same drive, and put them into an images folder underneath the project. I then removed all the pointers in the project to the image files and added the images from the new folder into the project. Rebuilt the EXE and presto, the images show up in the grid header. Nice.

My question is why? All the images are compiled into the EXE either way as I did not exclude them in the Project Manager. VFP should be able to find the images in the EXE. Is there a logical answer, or is this one of the VFP quirks I have to remember to work around in the future?

Labels: ,

Avoiding the recession

I have a minor in economics and have always found it interesting how economic forces that appear negative for the masses still leave many untouched, and in some cases benefit some who work around and avoid the downturns. Might have to write a white paper some day how I am avoiding the media created recession of 2008. Over the last few months I have been looking for ways to be one of those who avoid the recession. I know, crazy talk if you listen to the so-called experts in the mainstream twisted media. I for one refuse to become a casualty of this economic situation, and so far am winning this battle.

This evening on Twitter I tweeted some of my keys to being successful during these times. I figure that only 10 people will read the tweets, and if I blog about it maybe 10 more might take the time to read.

You will not find sage advice on how to invest or how to survive smaller revenues. I have not had good luck working with investors (bad luck listening to alleged experts, see key #1), and I have no intention to making less money (see key #2). I am once again sharing key strategies of my success, which some people think is nuts (see key #4). Please be advised, your mileage might vary, and take it for what it is worth (free).
  • Key numero uno - most pundits are full of themselves and advice should be avoided. Same for elitists and extremists.
  • Key numero dos - know how to duck when morons throw shoes at you, and know how to laugh about it afterwards. Translate: avoid negative people.
  • Key numero tres - Be willing to take on work no one else wants to touch. Finding a niche funds growth and builds loyalty in customer base.
  • Key numero quattro - something learned in Kindergarten: share. Sharing with others helps promote good will that lasts a lifetime, good karma.
  • Key numero cinco - positive thoughts, positive results.
  • Key numero seis - surround yourself with good, genuine, and smart people.
Sure these are more zen-like than solid things you can add to your to-do list, but that is how I work. Take a view that is higher and visionary and work down. I am sure you can take each one of these keys and build to-do list items that will move you forward. These to-do items will be specific to your situation and environment.

Key #5 has served me well over the years and is one that negative people hate. "It never works" - if you believe this you are correct. I prefer to work the opposite way. These are words I repeat all the time. Hope you enjoyed some initial thoughts on how I am planning to live above the recession experienced by others. I look forward to hearing other ideas too.

Labels: , ,

Tuesday, December 09, 2008

VFP: File and folders via indirection

Last night one of my clients was implementing their vertical market application half way around the world. The onsite support people were reporting an error when the app was started: "Invalid path or file name."

Thanks to the new error handler we implemented in the app I tracked this problem down to a single line of code:

CD &lcDataPath

Looking at the value of lcDataPath it became instantly apparent what the problem was, spaces in the folder name. The tech support person right away explained to me the standard for the install is no spaces in the folder names. This site deviated from the standard folder name recommended by my customer. Now she knows exactly why the original developers proclaimed this "requirement" years ago.

I have not been burned by spaces in code for a long time because I always use indirection in my code whenever I deal with file names or folders.

CD (lcDataPath)
USE (lcFileName) IN 0 SHARED AGAIN
DELETE FILE (lcFileName)


I posted this issue on Twitter earlier today and Andrew MacNeill noted this is probably a great rule to add to Code Analyst up on VFPX. I agree. I am now curious how many developers do not test their applications in folder structures with spaces in the name. I just checked my development machine and all my test folders are space free. But I do install my applications on a virtual machine in the Program Files folders and this tests out the space problem.

Yet one more reason why we have standards at White Light Computing and why the adoption of industry best practices gives us more solid deployments and apps in production. Fortunately the onsite tech people were okay with renaming the folder, otherwise my customer would have been hiring us to review the application for other macro expansion gotchas.

Labels: , ,

Sunday, December 07, 2008

German DevCon - Day 3

The final day of the conference in Germany is like the final day of any conference, you start out the day exhausted. Add on top of the fact I have not slept more than a couple hours a night because of the jet lag and the time zone difference from home.

I also did not have the first session of the day so I was able to attend Bo Durban's 8:30 session on "Creating Custom Controls with Sedna." Yes, another reporting session I am sure will be very useful to me in the near future. Bo showed us how to take the Sedna reporting architecture and extend it for our own purpose. His extensions show how you can drop a shape on the report and have it be one of the custom shapes he has predefined. His custom shape takes on the attributes (size, color, etc.) of the standard VFP shape you drop on the report. Very interesting and will take a little to sink in.

Up next is Tamar's "Solving Common Problems with VFP SQL" session. It sort of was a session that gave me that time-warp sensation. I recall sitting in on one of Tamar's SQL sessions at one of the early DevCons (probably 1993 in Orlando). Tamar has been giving SQL sessions for many years so I am not sure if it was then or 1996 in Scottsdale. Or maybe both. It does not matter how many times I see sessions like this, I always walk away being reminded of some technique I have forgotten about. It also reminded me I probably should reread her book: "Taming Visual FoxPro's SQL - Real World Data Solutions For VFP". There are techniques I just have not used that were introduced in VFP9 like the ability to create SQL Selects from virtual tables (another SQL Select).

I skipped the Microsoft keynote given by Tim Fischer of Microsoft Deutschland because I probably would only understand about 1% of it. The topic was interesting as it was about Software + Services and VFP, but it was given in German and my mind was not prepared to pseudo translate.

After lunch was "Practical Uses of XML" by Doug. I really liked this session. I definitely have used XML in my customer applications and developer tools, but it is always interesting to see what applications other developers come up with. Doug's session gave a brief overview of XML and some of the gotchas you have to be aware of and some techniques for working with XML data.

Last session of the conference was my "Extending the Sedna Data Explorer" session. I have done this session numerous times and I got tripped up in the last example where I display the ShowPlans for all the views in a database. The demo crashed and burned. This is a demo I did in the morning when I ran through all my examples one last time. During the day I was working on the Upsizing Wizard chapter and upsized the VFP NorthWind database. I was testing the upsizing of VFP views and when you do this it turns them all into remote views. Well the ShowPlan code is counting on local views and I was seeing the SQL Server login dialog during the demo. Not cool. Fortunately everyone was understanding that the demo gods were not kind during the last 5 minutes of the session. See why I don't update my machine for a couple weeks before a conference? Even something a silly as a demo can get tripped up by changing data.

Later in the evening of the last day is the speaker dinner. Rainer always comes up with a spectacular spread of interesting food. Each year there is fun discussion and lots of laughs. I thought I would leave by 11:00 but they kicked us out sometime after midnight. I was nearly falling asleep at some point, but got my second wind along the way.

The conference was terrific. I learned a lot, got some important work done, and was able to get some ideas spawned for VFPX during my time in Germany. In fact, during the conference one of the German speakers submitted a project to automate VFP builds. It was accepted and is the first time I was able to tell the project manager face-to-face that the project was accepted. We have not announce the project yet because the project manager is busy with his real job, but expect to see it soon. Looks real interesting. I am looking forward to next year if I am so blessed to be selected to speak in Germany for the fifth straight year.

Labels: , ,

German DevCon - Day 2

I skipped all the morning sessions so I could work on my customer projects since I have seen all the English sessions already. I did not get a lot done Wednesday and Thursday and was feeling the heat to produce some code for the deliverables I promised. The code is not very glamorous as it is changes to a FoxPro for DOS app, but the implementation is extremely important for my customer and the code I am working on has some cool elements in scheduling service calls out for the repair people. My customer is changing the process of assigning the calls to the repair people for the first time since the 1990's so I have to make sure it works and assigns the calls correctly every time.

The first session I attended was Doug's "Creating Explorer Interfaces in VFP", a session I have looked forward to since he submitted it as a session for SWFox. His screencast generated a lot of interest among the people who registered for SWFox and it received a lot of praise from people I talked to who went to it (both at SWFox and in Germany). During the session Doug went into something I am coining as "high-speed Canadian" as he started speaking quickly. You can tell when a speaker is really excited by the material they are presenting. Doug is a natural high energy speaker and he was ramping up during the early part of his session. He did slow down eventually. You see, while the Germans are terrific at English, it is not their first language so it is the responsibility of English speakers to conscientiously slow themselves down. The session did not disappoint. Doug has a really powerful treeview wrapper class with all the bells and whistles you could want. I also know he added the ability to disable the treeview after his session based on feedback he got during the session. He also showed how he uses VFPX components from the Themed Controls project as well.

The second part of my "Using VFPX Components in Production Apps" session was next. I presented a couple of components and filled in the rest of the session by showing off the new changes to the New Property/Method and the Edit Property/Method Editor being worked on by Jim Nelson and Doug Hennig, and the recent FoxTabs project lead by Joel Leach.

The last regular session of the day was Kevin McNeish's "Rich Internet Applications in Silverlight 2.0." There has been some buzz around Silverlight and I have a potential project that might be best done as a Web app so I wanted to get the scoop on Silverlight.

Rainer asked me to talk about VFPX in the second bonus session during his segment on the future of Visual FoxPro. He wanted me to briefly discuss the importance of VFPX, why it is so important to the future of VFP. I took the opportunity to ask people to get involved one more time.

Labels: , , ,

German DevCon - Day 1

Rainer Becker (organizer) starts out the first day at 9:30am with a brief Welcome session. It is in German, but I still catch part of it based on the technology words he uses.

First up was Tamar's "Making the Most of the Toolbox" session. I vaguely recall seeing Tamar do a session like this many years ago, and Toni Feltman did a session on this tool several years ago at DAFUG. I even present a couple of uses of the Toolbox during my "Get Productive with VFP" sessions. That said, I rarely use the ToolBox. I drag and drop classes from the Project Manager. But Tamar reminded me that the Toolbox is way more than the Form Controls toolbar on steroids. There were lots of interesting things presented, but the one I really liked is how you can set properties on an item in the toolbox. The property settings you make are applied to the control when it is dropped on the designer. For instance, you have a command button in a class library to close forms. I drop this on to the designer and right away I am compelled to name the control cmdClose via the Property Sheet. You can set this up in the Toolbox so it is done for you. This works almost like a builder or property editor, but handled behind the scenes and is custom to the class you are working with.

Up next was the conference keynote and keynoteX (where Ken "KenX" Levy talked). Ken gave a little history of VFP and how Microsoft actually at one point killed the product after the 6.0 release, but it was not killed based on the community uproar and the efforts of the Fox Team. He also noted that developers need to try VFP 9 SP2 to make the appropriate business decision for themselves instead of making the decision based on what they hear SP2 is like. There are over 100 bugs fixed and a couple of serious regression bugs that might not affect your application. Ken also mentioned some interesting statistics from community surveys. The one I remember is half of VFP developers are using SQL Server.

As far as the future of VFP, Ken mentioned several things. He expects Microsoft to provide hotfixes for VFP 9 if there are issues related to Windows 7 (note these are Ken's opinions, not Microsoft official statements - he no longer works for Microsoft). He said that the Fox Community must remain active to support each other. He had high praise for VFPX and the efforts of the people working on projects. He even referred to the developers as the "New Fox Team." He is watching and recommends the community watch the progress of VFP Studio, Guineu, .NET Extender for VFP and the VFP Compiler for .NET.

Ken finished up noting the four pillars of the VFP Community:
1) Product and Experience (VFP9, Sedna, & third party products)
2) Frequent Communication (online forums, online content, Web casts, screencasts, blogs and white papers)
3) Deep Engagement (conference, events, influencers, open source)
4) Product Enhancement (VFP tools online, VFP XSource, and VFPX)

After lunch I gave the first part of my "Using VFPX Components in Production" session to a crowded room in the auditorium. As a speaker I prefer crowded rooms because I feed off the energy. Rainer said my two VFPX sessions had the highest attendance of the conference. Sweet. I think the session went okay. I did have trouble finding a couple of examples, which is uncharacteristic of my sessions at a conference (I blame the jet lag). I did get some positive feedback afterwards and during meals. VFPX is really taking off in the community right now so it is not unexpected that there is some buzz going on at conferences too.

Doug Hennig followed my session with his "Advantage Database Server for Developers" session. I really looked forward to this session and was not disappointed. I am learning bits and pieces of ADS and Doug's session really helped me understand the positives and minor negatives with this product. One of the things that impressed me is the full text searching you can do on memo fields. If I recall correctly it took five minutes to do a search with the $ operator in native VFP and less than a second using the ODBC drive and the full text index capability of ADS. Very cool stuff.

Bo Durban's session on "VFP 9 and SP2 Reporting Component Basics" was one of the sessions I really wanted to see at SWFox, but knew I could see in Germany. It is always cool to have this in my back pocket when I am picking sessions I want to see. Being able to spread them across two conferences rocks. I arrived a little late as I was talking with Igor Vit and Christof Wollenhaupt between sessions. In this session I was hoping to pick up some tips on working with some of the new SP2 reporting enhancements because I have not had a lot of time to work with them based on my current projects. Getting a refresher on the Dynamic properties was worth the price of admission. Bo has a knowledge packed white paper for the session. It is definitely going to be one of those white papers I will need to read several times for everything to sink in.

After dinner is the evening sessions. The first was more from KenX. Ken showed the NET4COM and My Intellisense tools from Sedna. He also showed his AppScanX tool he has been working on this year and plans to submit to VFPX as a new project. Ken mentioned AppScanX to me several months ago and was planning on showing it at SWFox, but decided at the last minute he was not ready. I have been wondering how this new tool was different from Code References. It is actually a cool tool that takes a different approach to searching for text in all the source code in the project. You can search for text strings just like Code References, but you can also tell it to skip instances of the string based on different conditions. The tool is a little rough based on the fact the UI is done by BROWSEing a table, but it shows a lot of promise and should be something to look at in the future. I am looking forward to seeing Ken submit the project to VFPX. We kidded Ken at the speakers meeting that we are under strict orders to reject anything he submits. I am sure it will be accepted.

That is all I could take for the day. It was busy for sure and I was feeling a little guilty because I was neglecting my customer work, but I make that up on Friday as you will read: I played hookie in the morning to work on my customer projects.

Labels: , , ,

German DevCon - Day 0

Sorry for the delayed posts, but life has been very busy since returning from Germany.

Traveling to Germany is not high on the physical fun list when you go and come back in less than a week. I like the conference and the people, but my body does not do well on the trip. The flight to Frankfurt was empty when I booked the trip and nearly as empty when I checked-in online the day before leaving. Wouldn't you know, someone picked the seat next to me when there was an empty row behind me. So I moved my seat so I could have two seats. When I got on the plane the person across the aisle made a bed out of 5 seats. I watched a couple of movies (Wall*E being one of them) and tried to sleep, but instead worked a little on customer code and some on the Upsizing Wizard chapter for the Sedna book.

We made it to Germany 30 minutes early. Normally I get there before Doug and I would go to his terminal. This time my flight was arriving after Doug and Tamar and so they came to my terminal. We got a taxi to the hotel. Rooms were not ready so we ate breakfast and talked about Southwest Fox feedback. Once the rooms were ready I took a nap and did a little bit of work before the speaker meeting Wednesday evening. Before the meeting I met Bo and his wife and listened to their stories about traveling in Germany before the conference. This is exactly what I did with Doug and Jeff the first year I came to the conference.

All the VFP sessions I attended at the conference were excellent. Normally you will see me rate them with a certain number of stars. I learned something in every one of the sessions and rate them all 5 of 5 stars.

I did a lot of live posts during sessions on Twitter using the #GerDevCon hashtag, but Hashtags.org is dead and Search.Twitter.com does not find them which bums me out as I was hoping to use them as notes for these posts. I did have lots of fun interacting with my friends on Twitter, especially when I offered twitter beer when Rainer brought in beer during the evening sessions.

The conference hotel rooms have a new digital TV and digital service. I thought it was cool that I could filter channels by language. Mostly watched the BBC to keep up on news, and CNBC to hear about the financial crisis and watch the Tonight Show for some American humor. After the speaker meeting I went back to the room and slept as solid as I have in Germany.

Labels: , ,