[Looking for Charlie's main web site?]

The Ultimate Var Scope Resource list? Understanding/resolving problems with the var scope in CFML

If you or anyone you know ever wants to get up to speed on the "var scope problem" in CF, you may be challenged by the fact that there are many discussions of the topic, spread across many blogs. I've accumulated here a starting list of several of the key ones I know of. I certainly may have missed some, so I welcome suggestions of more.

I think it's helpful to have all the resources in one place. Indeed, ultimately I'll move this to my "resource lists" page where I keep similar "compendia".

I created the list of VAR scope resources today after helping a client with a problem which seemed related to this classic problem: the need to remember to var scope your variables in CFCs. It's often the cause of subtle bugs. Like many, they still hadn't heard about the problem (or had seen mention of it but didn't really understand it).

So if you're in that place, or know someone who may be, here are resources to help get started on understanding the topic and related issues. As always, the CF community has rallied the troops on the matter, and several folks have blogged in various detail or on various related aspects.

About the resources

[....Continue Reading....]

Come watch the Mura Show as we enable CArehart.org under Mura CMS

This could be very interesting. Starting today at 4pm EST, and over the next few weeks, the "Mura Show" (a weekly online user group for Mura CMS) will dedicate a few episodes to focus on the conversion of my site, CArehart.org.

A real live use-case, from scratch

What's interesting is that it will be an installation from scratch, in a "cinema verite" approach where we will assume nothing and if we trip over things, we'll talk about them. We'll talk about what I hope to gain by using Mura, and why it seems a good fit.

Ee'll proceed each step of the way with me as the new user (I have never used Mura), the Mura guys as my trusty guides, and of course with people able to ask questions all along the way and hopefully learning for themselves as we go.

Though I've not yet used Mara (or any CMS), I've been a big fan for a couple of years, observing it from the outside. Indeed, I blogged about how very impressed I was with their site in my May 2008 entry "A CFML-based product that really gets how to win customers, and what we can learn from it". And then I've watched as a couple of the ColdFusion Meetup episodes recently had covered Mura.

Though I've never really considered a CMS for my site, as I saw all that was possible with Mura and how it allowed for integration of existing CFML, I started to wonder if it may make sense to consider it for my site.

Going about enabling a CMS for a hodgepodge site

My site really hosts a few things and therefore offers different challenges in considering enabling a CMS. And this is what we'll cover over the next few weeks.

Some parts are static while others are dynamic (database driven). Some are just long static lists (my articles and presentations). Similarly, the CF411 site (which redirects to a page on my site) is an even larger list.

Each has just grown over time and naturally I'd love to make them both database-driven and to have some sort of paging, categorized presentation, searching, and such, and Mura can provide that. It can also allow me to let others contribute (especially to the CF411 site), which is a natural fit for a CMS.

Of course, I could also enable such db-driven paging and user contribution by hand. Idneed I had done that already for another part of my site, my UGTV repository of links to hundreds of recorded CF presentations. I knew when I started that it would not only grow substantially and that it would require entry of data by others.

So besides wanting to add more dynamic (and user-contributable) features for the other "static" parts of the site, it would also be interesting to see if/how I might keep or change this existing CF-driven part of the site. FWIW, the CF-driven part does not use any framework, either, since it was really a smallish app.

Another thing I've long wanted to add with all these sections (articles, presentations, UGTV, and CF411) is the concept of a "Landing page", where each item could have a page with more detail about it as well as features like rating, commenting, recommended related items, and such.

Again, I could do that for the UGTV site since it was already DB-driven, but since I'd have to make the other three sections be DB-driven and I'd have to code that, I just started to wonder if a CMS may be the way to go.

Mura to the rescue, and a case study is born

I thought to ask the Mura guys about things, and they felt on the surface that it woudl be a good fit. They asked me to present a list of the things I'd be interested in adding (as well as preserving), and on reviewing it, they not only felt it would work fine, but that it would make a great case study for the Mura show. They knew me from the past CFMeetups and they sensed that I would welcome the chance to do all this live on a Connect session. I said I would, absolutely, as I was sure many would benefit from seeing such a raw, live presentation. As they thought it over, they decided to propose a few weeks (whether they happen consecutively is to be determined), and I was open to that, as well.

Indeed, I expressed how I preferred (with the extra time) that we really do do it from scratch, so that people see really everything entailed. And of course we'd introduce how we got to this point (what you've read above), how they think it can all be done, and then (once we do the install, all this in the first show), we would proceed in future shows to start really integrating the site into Mura.

I'm really looking forward to it, and I hope others will too.

Update: The recording is now posted and available.

Integrating ColdFusion and the REST API for Harvest (TimeSheet Service); Accessing XML in CF

Often we will find API docs for a given service without any reference to a CFML example. I just experienced that, and while I offered a suggested example to the vendor, I wanted to share it here in case it never gets posted. At least if someone Googles in the future they may find this. Also, I conclude with some insights into learning more about the power of XML processing in CF.

I'll demonstrate here calling the REST API for the Harvest online timesheet application. (If you would want to point me to another alternative timesheet app, no need as I'm happy. I realize there are many. Indeed, I list many of them on my CF411 site section for time tracking tools and services.)

Anyway, the Harvest API docs pages do show a Ruby example. While I didn't take the time replicate that exactly (it has a few more touches like error-handling, extensibility, etc), I did want to at least show how one could call the REST-based API using CFHTTP.

Some Simple CFHTTP Examples

Here are two simple examples, first, showing calling the who_am_i method:

<cfhttp url="http://subdomain.harvestapp.com/account/who_am_i" username="user@email.com" password="password">
   <cfhttpparam type="header" name="Accept" value="application/xml">
   <cfhttpparam type="header" name="Content-Type" value="application/xml">
</cfhttp>

Note that I'm using the same nomenclature they do in their docs, in that you would need to change the "subdomain" value to be whatever your own it. Also, like them I've just left the placeholders above for your Harvest username/password. And the API docs show needing to pass in those two headers, which I do in the CFHTTPPARAM.

Getting TimeSheet Entries

The next, more interesting example calls the method to get the timesheet data for a given day (and yes, since the REST API has no state you do need to pass in the username/password on each call. In a more complete app, you might prompt the user for those and store it in a session for reuse, etc.):

<cfhttp url="http://subdomain.harvestapp.com/account/daily/245/2009" username="user@email.com" password="password">
   <cfhttpparam type="header" name="Accept" value="application/xml">
   <cfhttpparam type="header" name="Content-Type" value="application/xml">
</cfhttp>

Note also that the date is in Julian format (the number of the day in the year). I'm showing Dec 10. Again, I could elaborate this to take in URL variables to change the date. I'll leave that to the reader.

So how do you calculate the date in Julian format? Well, you could of course modify the code to use CF's date/time functions to do a conversion, but if you just want to look up a given day for manually, here's a trick. If you've never noticed it (as a Harvest user), the real web-based Harvest timesheet always also shows the julian date in the URL for a timesheet entry.

Getting Real Data from the Returned XML

The result of both calls is some XML. In the first example, I ignored it. In the second, of course, you need to get the data.

So I pass it to the XMLParse function (new in CF6 and still missed by many) . That converts the XML into an internal CF XML object, which represents the XML as a series of nested structures, arrays, and attributes. If you do a CFDUMP of the result, you'll see what I mean:

<cfset result=xmlparse(cfhttp.filecontent)>
<cfdump var="#result.daily.day_entries#">

And to output the hours for the first entry, one could do this:

<cfoutput>Hours:#result.daily.day_entries.day_entry[1]["hours"].xmltext#</cfoutput>

How did I figure out that nested set of arrays and structures, you ask?...

Learning More about XML processing in CFML

I won't elaborate here about how to go about accessing the various parts of the (sometimes complex) internal XML object. But you can learn it really quickly. Most CFers are blithely unaware of the power of this feature set (or they get confused and give up). There are two (well, three) places you can learn more.

First, the best resource on CF/XML processing (in my opinion) is a great extended Adobe Devnet article by Nate Weiss. Though from 2002, it's an all-time classic (recovered from the archive.org site).

He introduces the topic assuming you know nothing about XML, and steps quickly into processing it in CFML (reading and writing it), including understanding all those structures, arrays, and attributes. Within just a few pages, you'll be amazed at how much more productive you can be with XML processing in CFML.

Nate even introduced the valuable concepts of using XPath/XMLSearch to make accessing XML even easier and XSLT to do conversions from XML to other formats. He does all this very gently and in a compelling way. I still refer people to it often, to this day (and return to it myself when I'm stumped).

That said, there are of course a few ways that XML processing in CFML has evolved since CF6, so you will want to check out the CF docs as well. Besides the CFML Reference on XMLParse, note that there is also a chapter on the topic in the oft-missed ColdFusion Developer's Guide.

Many only know of the CFML Reference, but they miss out on this 1,000+ page free online book (from Adobe). The CF8 version of this is here and the chapter here. The CF9 version of the manual is here and the chapter is here.

Hope any of that may help someone.

Running a Google Group? Don't leave it open to spamming

Do you run a Google Group (or belong to one) that's suffering spam? Here's how to stop it.

I belong to (and also run) many Google groups, which can offer a great solution for a hosted mailing list. Sadly, if the group owners aren't careful, the list can soonbecome a haven for spam.

But there are three simple solutions (one in particular) that the group manager can take to prevent the problem, and I am NOT talking about moderating every message. Two of them add only a little new effort for you as manager, but the reward is so worth it.

To make (or consider) the changes, visit the page to manage settings at http://groups.google.com/group/groupname/manage_access. Or to get there, select "group settings" on the right, then choose the "access" tab at the top, and make the changes below, which I discuss after the screenshot.

From there, change 3 settings:

  • "who can join" - change from "anyone" to "people can request an invitation to join". You don't need to use the "custom question" option. This will just require that people request you let them in. Again, most spammers won't bother. It's like how locking your car door causes most thieves to just move on. More than that, this changes it so that people can't just join by sending an email, which really is where most spam comes from
  • "Who can post messages?" - change from "anyone" to "members only"
  • "Message moderation" - you don't need to set it to "all messages are held for moderation. Leave it as "No moderation", but do consider checking "Messages from new members are moderated". Yes, it means that when a new member posts a message, you'll get an email with a link to view their message and mark them as either "always allow" or "block".

Doing these, especially the first, really will stop most of the spam. Your members will really appreciate it.

cf.Objective() 2010 call for speakers, ends Nov 30

It's funny, no sooner had I posted my entry yesterday about CFUnited's call for speakers, then I started seeing the tweets about cf.Objective() 2010 also having its call for speakers. Had I noticed sooner, I would have covered them both at once. Oh well.

A big difference is cf.Objective()'s is ending November 30. Check out Sean Corfield's post for more information on the cf.Objective() call.

CFUnited "call for speakers" open until mid-January

Sometimes people say, "I never knew there was a call for speakers" for a conference, so the folks from CFUnited as asking that the word be spread that the call for speakers is open until mid-January.

Here are the tentative tracks for sessions:

  • AIR and UI Development - How to enhance the experience of your applications. Bring your application to the desktop or mobile.
  • Best Practices - Tips and Tools for improving and protecting your website.
  • ColdFusion (advanced) - Building applications, Charting, APIs, Custom Tags, PDF, Forms, Railo, Groovy, Facebook apps, Geolocation, Web-Oriented languages, and Integration.
  • ColdFusion (basics) - Getting started with ColdFusion
  • ColdFusion 9 and ColdFusion Builder - Topics from Adobe related to the new release of ColdFusion 9 and ColdFusion Builder
  • Configuration,Testing & Deployment - Deploy your websites with minimal issues and know what to expect
  • Databases - SQL, reporting, procedures, integration, server tuning
  • Flex (advanced) - An indepth look at building Flex applications
  • Flex (basics) - Getting started with Flex
  • Frameworks - Discover various Frameworks for ColdFusion and Flex
  • Managing Projects - Team Management, Project Requirements, Customer relations, Project management
  • OO Development - Object Oriented programming and using CFCs

They note as well that they're always open to new speakers.

Finally, the pointed out as well that the early bird deadline is Nov 30. More at CFUnited.com.

I've made it onto the CF9 video interviews at Adobe.com

Someone told me today they'd spotted me on the CF9 video interviews offered on the Adobe site. Pretty cool. There are actually a couple of sets of video interviews that I made it into.

One is a 3-minute conglomeration of comments from several people. These are both the "official" Adobe talkinghead-style videos, and some are more like "live remote shots" taken from the floor of CFUnited. Besides a couple of appearances in it, near the end they included me saying something fairly quotable. I'll let you find it. :-)

Then there's a another set of individual interviews with different folks (the talking head style), which appear (currently) at the top of the CF9 product page. You click on whichever one shows up (or click "community feedback") and an interface like slide show picker appears. You can pick any of them and at the end it offers to advance to the next. (That link to them at the top may eventually no longer appear on that page, I suppose.)

It was a treat being interviewed for these.

About the process

I got the invite over the summer and was told they'd be taken in a room at CFUnited. I assume the others were done there, too, but I don't know. The room was staffed by a video production team.

There was no way of telling for sure as we did them whether what we said would be included ultimately, and/or how much. Indeed, the interviews were a lot longer than what was showed (about 30 minutes for less than a couple), so much ended up on the cutting room floor for each of us, obviously. That was to be expected, of course, and I'm just thrilled to have been included at all.

Any disappointments?

My only disappointment: well, if you look at the videos and even the pictures at the top of the page, you'll notice something about mine stands out from the others. The production folks had made a point from the start about wanting me to "be sure to use my hands", so my inteview and picture show me gesticulating pretty vigorously. :-) It's not really my normal style, but if that's what they wanted.

But then I notice NO ONE ELSE is. Maybe I was an early interview and they dropped it eventually. If I knew the folks doing the interviews, I might feel like they punked me. :-) Heck, even on the tight shots (where they zoom in the editing) you can still see my fingers flying into the frame. Grr... :-)

And yet another appearance spotted

I notice that my shiny face also appears (for now) further down the product page next to a link labeled "Get Inspired". That's cool to see. I suppose it may well rotate with other folks (but it hasn't when I've refreshed it today).

Guess my 12 years of CF experience have born yet more fruit. Thanks, Adobe. And certainly I hope what I said is of value to some viewers, brief though the interviews are. Next time, if invited back, I'll also wear a less floppy-looking shirt! :-)

Palm owners: how to solve the "failed to backup" error for PmTraceDatabase on hotsync

If you're a Palm device owner who has been annoyed that attempts to hotsync your device fail with "Hotsync session completed with errors", because it "Failed to backup 1 file", the PmTraceDatabase, I have a solution for you, from Palm.

The problem is annoying, because if you have no other sync failures (such as Outlook calendar sync errors), you can't know for sure without digging into the hotsync log.

The good news is that Palm has come out with a solution to make this finally go away:

Update: Curiously, that link I had originally offered here in 2009 goes to a page that no longer offers or explains the fixpmtrace.prc file, as it used to. That's odd.

And while I found another version of the page on the site: http://kb.hpwebos.com/wps/portal/kb/na/centro/centro/bell/solutions/article/44937_en.html. Sadly, though, even that page has a failing link to that prc file.

I found all this in answering a question someone raised as a comment.

For more details, and a possible alternative solution, see my reply comment at http://www.carehart.org/blog/client/index.cfm/2009/9/7/solving_palm_pmtracedatabase_problem#c885AB116-E50B-DEA9-80CFFE5C48A7121E.

http://kb.palm.com/wps/portal/kb/common/article/44937_en.html

As the Palm site page discusses, you install that app onto your phone, and then run the FixPMTrace app on your device. It's important to note that it's NOT ENOUGH just to install the app onto your device. You do have to run that app from the Palm launcher (the list of apps, accessed by the "home" key, as usual) in order to have it do its magic. All it does is turn off the archive bit on a file so it stops trying to back it up.

Hope that helps someone else.

PS And before some of you jump on me for still using a Palm, :-) just know that yes I am seriously considering moving to an iPhone after several years of relative happiness with my Palm devices. I've been using a iPod Touch for a couple of years and really like that. Carrying both devices is of course a pain, so reducing it to one just makes sense.

And yes, I know about the Palm Pre. It's just that Sprint coverage in my home is really poor, and since I generally work from home, I just can't take it anymore. The Pre won't solve that (I called: they said it wouldn't likely be any better.) Since my wife has ATT and she's been happy, the forced move to ATT with the iPhone isn't a problem.

Still, I leave this Palm tip for those who may benefit.

Interesting "Test Focus Guide" for SP2 of Windows Server 2008/Vista

If you're running Windows Server 2008 or Vista, you've probably heard by now that there's a new SP2 release (or learn more here.)

One interesting document you might miss is the "Windows Vista SP2 and Windows Server 2008 SP2 Test Focus Guide", which is a 40-page guide that lists various changes, with scenarios and step-by-step instructions to recreate and observe the feature changes.

That's a nifty idea, and one I wish more vendors offered. It's not something I've seen offered for previous Windows OS releases (base or SP's).

I don't think it lists every feature, but it does list many that I'd not seen mentioned in the more glitzy "what's new" docs (at the URL offered up top here). By contrast, the Test Focus Guide is more text-heavy (all stuff, no fluff) and kind of rough.

For instance, I wish it offered more of a table of contents, because you can't readily eyeball what all it covers. I found the easiest way to find each topic is to search for "goal:", since each scenario has a listed goal.

Anyway, check it out. You may find something of interest there among its dozens and dozens of scenarios.

Finding the forums for the new Adobe Presentations

Just want to share this bit of info, in case others find it as hard to locate as I did.

If you start to use the new Adobe Presentations service, an online presentation-building tool, now at labs.adobe.com, you may want to engage in some discussion with other users, so may go looking for some forums. You may struggle as I did.

Sadly, there's none for it listed at the acrobat.com forums page. Perhaps that's because Presentations is still in lab status.

There's also none listed in the Help menu for Presentations. There is a link to share feedback, which gives you an email address. That's better than nothing, but it's not a discussion forum. Some may even fear using it if it might be a black hole.

I decided to go ahead use that feedback address. I was delighted to get a response pretty quickly (well, first an automated one, and then a real person).

But what surprised me most was that the automated email (offered in response to using that feedback address) offered the URL for the forum!

So where is the forum? It's at: http://forums.adobe.com/community/labs/presentations/.

I responded that this link really ought to be listed in the Help menu of Presentations, but that suggestion seems to be challenge for them to implement. Oh well. I decided to share the info here, and also as a comment in a blog entry on Presentations in the Acrobat.com blogs.

Just seems it shouldn't be so hard to find these forums.

More Entries

Copyright ©2018 Charlie Arehart
Carehart Logo
BlogCFC was created by Raymond Camden. This blog is running version 5.005.
(Want to validate the html in this page?)

Managed Hosting Services provided by
Managed Dedicated Hosting