Saturday, August 22, 2009
SwFox Vault PreConference Teaser Video
Saturday, May 2, 2009
Speaking at Southwest Fox 2009
I’m very excited to be able to announce that I was invited to speak at the 2009 Southwest Fox conference in Mesa, Arizona. I could tell you all about Southwest Fox but if you are reading my blog, chances are that you already know about it. For those few who may not, you can find out more by visiting www.swfox.net.
Speaking at a FoxPro conference has always been a goal of mine but it is something that I’ve always questioned whether or not I had what it takes. The established speakers in the FoxPro community have been excellent and I’ve learned so much from them over the years. I’ve always wanted to find ways that I could give something back to the community, but I’ve struggled to find out what that could be. Most of the people whom I’ve met over the years attending the various FoxPro events are either independent programmer/consultants or work for companies that distribute a commercial software application. I write software that is only used by my company, in support of the over 500 customers that we provide mailing and other services for. While we are all using the same programming language, the goals and objectives we strive for can be very different. The question in my mind was whether I knew or did something new, cool or interesting that would benefit the community.
At last year’s conference, I really started to believe that I could be a speaker and started to think about topics I could present. I was able to participate in the “Show us your apps” session at Southwest Fox 2008 and received good reviews on some of the work I had done building developer tools with Intellisense to generate basic search/edit table maintenance web pages using West Wind's WebConnection. I was able to show this presentation again in a little more detail at a smaller gathering in Toledo this past January and again received very positive feedback. In conversations with other attendees, with some of the organizers and with members of my programming team, I started to bounce session ideas around and get some feedback as to what others thought about what I’ve done and what I could share. When speaker submission proposals were due in the spring, I decided to propose three topics for sessions related to Intellisense, SQL Server and SourceGear Vault.
A few weeks back, I was humbled by the receipt of an email from the conference organizers informing me that I had made the cut and they had chosen my Vault and SQL Server sessions. There was an immediate reaction of excitement – “I made it!” immediately followed by steadily growing burden of expectations – “What did I just get myself into!” Speaking in front of people has never been a problem for me (if it was, why would I even consider submitting a proposal?) and I’ve very comfortable in my knowledge of the topics and in my belief that what I have to share is something people should like. The biggest area of concern for me was in the requirements for a white paper for every session. Technical writing (and writing in general for that matter) has never been one of my strong points. This was the area I decided to focus on first in my preparation for the conference.
Many of the established speakers have been very kind and helpful to share tips and tricks that they use to prepare for speaking and they have shared with us access to a website where many speakers have contributed notes and resources directed at helping the conference speaker be the best they can. Since the white paper was my biggest source of angst, I jumped right in to the advice given for this. There were several recommended reading items given and after a little research, I decided that Write to the Point by Bill Stott was the best selection for me. A common theme of the reviews provided for this book was “encouraging the beginning, or the intimidated, writer”. This was me they were talking about.
I’m only about half way through the book but so far, it has been very good. The main theme of the book has been how a majority of us have all been beaten down and intimidated by our past English teachers by focusing so much on the technical aspects of the English language (grammar, punctuation, sentence structure, etc.) that we lost the ability to focus on what it was that we wanted to say in the first place. The book encourages you to focus on writing something new and interesting and not to worry about bad writing skills. No one will care about poor use of grammar or sentence structure if the material you are trying to share is worth reading. If however you write boring material or simply rehash ideas or topics that have already been covered in depth without introducing any new angles or challenging the existing thoughts, then you are in trouble as everyone will notice the grammatical mistakes since there is nothing really else to get excited about. That is now my goal – find a way to be what Stott refers to in his book – a “Good Bad Writer”. In case you haven’t noticed, I’m going to try the concept with this blog by talking about what the speaking experience is like from a new speaker perspective. How did I do?
Anyways, I’ll sign off with another plug for Southwest Fox 2009. As a company owner, a programming team leader and a software developer, I cannot speak highly enough of the value obtained by attending a development conference. I’ve attended close to 15 conferences in the last 10+ years and I’ve learned so much about the technology, different approaches in problem solving and made several close personal and business relationships. My company and my programming team would not be as strong as it is today if we had not made a commitment to sending as many of our programmers as possible to a conference every year. Whether you learn more about a technology or tool you may be considering, see a great session that solves a problem you’ve been fighting, have the opportunity to bounce questions or ideas off different speakers or peers in the break rooms or hotel bar or even simply get away from the day to day grind of the job and into an atmosphere that promotes fresh thoughts and openness to new ideas, the time I spend at a conference each year provides the highest return on the investment of my time and money that I could ever possibly hope to achieve. I hope to see you all there.
Sunday, March 1, 2009
VFP Syntax Coloring in Blogger
So I'm all excited about the prospect of starting a blog and I've got a list of topics going that I keep adding to. I'm working on one the other night (not published yet) and I wanted to add a few source code examples to it. Having never done this before, I'm thinking to myself, this shouldn't be that big of a deal, right? Wrong.
I'm publishing this blog with Google's free Blogger service. Say what you want about this tool but it was super easy to get started and with a last name like Krzystek, I didn't have to worry about the availability of wkrzystek on blogspot.com (or any other domain for that matter!). It's pretty customizable with several templates to choose from, many gadgets you can use, and more. If you are thinking about starting a blog and you are not sure which to use, I recommend this one very highly based on my experience so far. Many others tell me to upgrade to WordPress and it seems pretty cool as well but this was the one I had picked and I'm not interested in moving it at this juncture unless I find a compelling reason to do so.
One of the first items I tried was simply pasting my code directly into the Blogger editor and when I did this, the formatting was fine but I lost all of the Syntax coloring. Hmm. I've seen this before and I've used Word as a middle step so I launched a new instance of Word, pasted my VFP code and everything looked good. However, when I pasted the code in Blogger, the syntax coloring came across properly but everything was double spaced. Further more, trying to clean this formatting up in the Blogger editor was a major PITA to get the code to look like it was in VFP. This is too much work for my taste.
It seemed like Word was putting out CRLF's at the end of each line and then Blogger was converting each CR and LF to an Html line break tag. OK, I can handle this, back to VFP again - _Cliptext = STRTRAN(_Cliptext, CHR(10), ""). When I pasted this into blogger, everything was formatted properly again but all of my syntax coloring was now gone. Doh. Of course this made immediate sense to me since _Cliptext = _Cliptext is a tip I use every day in VFP (intellisense: CP2) to clear any formatting from the clipboard before pasting into another source where I don't want the original formatting to come along (this is great when copying stuff from the web into word or other rich text editors).
At this point, I started digging deeper into the problem. I had remembered a recent blog post from Bernard Bout who referenced a blog by Burkhard Stiller who was working on a project to convert the RTF used by VFP into valid HTML snippets so that it's easier to use when blogging. This seemed to me to be exactly what I needed. I downloaded the last copy from Burkhard's blog and tried running the form (OK, I should have spent more time reading his 7-part blog post first but that's just not me.) As soon as I ran the form, it crashed and after a little debugging, I determined that the clipboard format that my VFP is putting out wasn't the same as what Burkhard was expecting. OK, now it's time to read his posts to see if I can figure this out. Burkhard was using a constant of 49298 for the VFP clipboard RTF output and this value returned an empty string when I run the form. On his blog in Part 5 he shows some VFP code using FoxTools to enumerate all of the info on the clipboard. I modified this slightly for my use just to save the clipboard contents to a file that I could inspect in UltraEdit:
SET LIBRARY TO HOME() + "Foxtools.fll" ADDITIVE
IF OpenClip(_SCREEN.HWND)
ACTIVATE SCREEN
CLEAR
*\\ Start with EnumClipFm(0) gets the first format available.
nFormat = EnumClipFm(0)
DO WHILE m.nFormat != 0
IF BETWEEN(m.nFormat, 49152, 65535)
?? " | GetClipFmt(#" + ;
TRANSFORM(m.nFormat) + ") =", ;
GetClipFmt(m.nFormat)
ELSE
?? " | GetClipFmt(#" + ;
TRANSFORM(m.nFormat) + ") =", ;
"standard-format"
ENDIF
*** WTK: Save the clipboard text to a file
*** for further inspection
lcClipText = GetClipDat(m.nFormat)
STRTOFILE(lcClipText, "cp_" + ;
TRANSFORM(m.nFormat) + ".txt", 0)
nFormat = EnumClipFm(m.nFormat)
ENDDO
= CloseClip()
ENDIF
When I ran this code, the VFP RTF clipboard data was saved to cp_49292.txt. OK, go back to the form, change this value and voila - I get the HTML formatted code shown properly in the embedded browser control on the form. OK. This wasn't too bad. To get the html generated, I simply right-clicked and chose View Source from the browser control and I was able to get the html snippet. (As a side note, EditPadPro is an awesome html View Source utility. It automagically sets itself to be the View Source app for IE on install and displays the HTML in the same syntax coloring as Visual Studio's web developer). When I pasted the html in the blogger editor, it looked simply awful (as html does to the naked eye) and further more when you previewed the output of the post, all of the coloring was gone and none of the indenting was retained. In blogger, you have both a rich editor control as well as the ability to tweak the html source directly. I attempted to paste the generated HTML directly into the html source window and this still didn't work. Why not? Well, the way Burkhart's tool works currently is that he is using a CSS style for each style of code formatting options in VFP (strings, literals, commands, comments, etc). Since blogger is all template based, these CSS values are never registered. At this point I should have punted, but no - I'm much more stubborn than that. I went into the blogger layout options and tried in vain to add the CSS styles from the generated HTML code to the tempate's Head section. I made several different attempts at this to no avail and when I evaluated the risk of permanently fouling up my Blogger template if I continued I decided this was not the way to go.
I then went out to see if I could figure out what others were doing. I remembered reading a post from Rick Strahl's Blog about how he was getting syntax coloring for ASP.NET code from Visual Studio. While very cool, this wouldn't work for me. I then checked Doug Hennig's Blog, Rick Shummer's Blog and Cathy Pountney's Blog who were all using Blogger and saw that they didn't have source code syntax coloring in their blogs at all. I asked myself, can this be done? At this point I was getting tired and just a little frustrated and feeling like my concept of short and frequent blog posts had all gone to heck since I had been at this for a couple of hours now and I stopped for the night.
The next morning, I tweeted about the experience and had a few suggest tweaking my _VFP.EditorOptions to either include X or make sure that it was excluded. My setting was "LQKWT" and X wasn't included. When I looked at the help file since this isn't a setting I'm often tweaking, I saw that the purpose of X was specifically to suppress the RTF clipboard formatting. This wasn't it. I started going back to the thought of using Word as an intermediary which was also suggested. If you remember from the top of this post, when I pasted from Word, everything was double spaced. I couldn't tweak the clipboard externally from VFP but could I affect this from within Word directly? One of the things I always have set in Word is to Show all non-printing characters - I want to know if there is a tab character or if someone held down the space bar for 5 seconds to indent (that drives me nuts). When I pasted the code, I saw that each line had a end of paragraph symbol at the end of the line (what you get when you press the Enter key). I thought about changing these all to a "soft-enter" or "line-break" (what you get when you press Shift+Enter). One could certainly do this manually but that would be a pain for large blocks of code. I'm unfortunately using Word 2007 (which I still haven't acclimated to after about 6 months) so I'm not sure exactly if this tip will work in earlier or later versions of Word but I suspect that they will. I pasted my VFP code into a new Word document so I could safely do a Replace All. I launched the Find and Replace dialog and in my Find I put "^p" to search for a Carriage return/paragraph mark and in the Replace I put "^l" to replace with a New line. Check out this page for Special characters you can use with Find and Replace in Word. This worked like a charm - the code came into blogger properly indented and formatted and with the same syntax coloring I have in VFP.
To summarize what I learned in this process is that you really can't get the VFP syntax coloring copied out to anywhere but Word with any sense of reliability. To export it from Word to the Blogger editor, first replace all paragraph marks (^p) with new lines (^l) and then you can copy from Word directly into Blogger and all is well. I'm sure that if I tried hard enough, I could probably write a Word automation utility that would do all of this for free. That would be kinda cool, wouldn't it? Sounds like a future blog post!