Well that was Fun (Debugging)

I’m better now, but boy you should have seen me an hour ago.

Our story starts out with me installing an instance of BlogCFC inside of a password-protected web site. We’ll refer to this password-protected site as "the extranet".

Everything was going relatively well. Database set up… check. BlogCFC running… check. Log into BlogCFC admin… check. Log out of BlogCFC admin… che… whoa. Wait. WTF.

Logging out of the BlogCFC admin logged me out of the extranet. Interesting. So I start peeking under the hood a bit to see what’s going on.

BlogCFC uses <cflogin> and <cflogout> for it’s admin area. Before today, I had literally never used either tag (or any of the corresponding tags/functions). Seemed like a good place to jump to a conclusion. <cflogout> must be stomping on the session variables set by the extranet’s login process.

At first I thought <cflogout> must have been just clearing the entire session scope. So I dump the session on the extranet login page (after being redirected there as a result of logging out of the BlogCFC admin). Hmm… nope. There’s still a session scope with keys sessionid and urltoken. So I log back into the extranet and dump the session (this is an app that I inherited, so I’m not 100% sure how it’s handling the login). I see that it’s storing a session key called “user” which is composed of several pieces of pertinent user data. Apparently, <cflogout> was stomping my session.user variable. Was it too generic of a name? Why would it be getting stomped?

Read More»

A Model-Glue Gotcha

I can’t imagine this isn’t a fairly well known “issue” in the Model-Glue community, but what with being new to Model-Glue, this was a new issue for me. I figure it’s worth mentioning, if only to save somebody else the several billion hours of debugging that i lost this afternoon.

Let me point out first that this isn’t a Model-Glue issue per se. It’s a combination of using Model-Glue with ColdFusion debugging and some JavaScript thrown in for good measure (some of you may already know where I’m going with this).

Read More»

Mike Potter == Santa?

Santa (as channeled by Mike Potter) arrived a bit early at the Griefer household this year.

I just got home from work to find a box from Amazon waiting on the doorstep. It was the Flex 2 book by Chafic Kazoun and Joey Lott, with the following note:

Merry Christmas from the Adobe Flex Team! Thanks for your interest in Flex.
Add your Flex app to the Flex Showcase at http://flex.org/

From: Mike Potter, Flex Team

I’d heard of this happening to others, but never thought it would happen to me (which yes, I do recognize sounds like the opening to a penthouse letter).

I’ll actually be donating this to the Bay Area CFUG to be used as a raffle giveway during the next meeting. Turns out I already had this particular book. Not sure if I forgot to move it to the “purchased” items on my wishlist or not (it’s there now… but that’s either because I’d already done it, or because Mike bought me the book… likely the latter). I figure by donating it to the CFUG, it’ll still be going to a good cause. If you’re going to be in the Bay Area for the next meeting (Jan 21, 6:30 pm) stop by. The topic is Flex and AIR (Ted Patrick will be presenting), so it’s somewhat appropriate, i guess :)

In any event, the thought and effort is very much appreciated. Thanks to Mike and the entire Flex team. Merry Christmas back atcha!

The Art of Being Right (Learning OO)

Hey all. I’m back, and I’d like to officially apologize for going all “Bermuda Triangle” on you in the middle of the “Going OO” series. I’d like to take a few minutes and reflect on some of what happened, because some of it is actually relevant.

First… the non-relevant bits. we moved (again). I thought it would be a fairly easy thing to do this time around… because unlike the last 2 times it wasn’t a cross-country move (from AZ to FL, and then from FL to CA). This time it was from CA (southern) to CA (East Bay)… but it still really really sucked. It was just a very draining experience (both physically and mentally) and I never ever want to do it again (but I will).

Factor in starting the new job (which is going great so far, thankyouverymuch) and I just haven’t even had time to keep up with reading blogs, let alone writing an entry.

But things have settled down (somewhat) so I’m going to try and get back into the swing of things.

So the $64,000 question is… where’m I at with all of this OO stuff? Hell of a question. Sorta wish you hadn’t asked. *sigh* but you did, so…

Read More»

Make like a Banana and .split()

Of the many recurring ColdFusion related questions, one of the most prevalent is one that has to do with the fact that ColdFusion ignores empty elements in a list.

This came up (again) today on the CF-Talk mailing list, which in and of itself is not news… but today I saw an answer that I’ve not seen before, and I like it a lot. Usually the answer that I see is to replace consecutive delimiters (,, for example) with a space between those delimiters (such as , ,). Of course, this is somewhat hokey as it will only work for 2 consecutive delimiters and not 3 (or 4 or 5 or…). There are regex solutions, but i think a number of ColdFusion developers tend to give regex a wide berth when possible.

Peter Boughton offered up 3 different possible solutions, one of which I _really_ like. Java has a split() method. The split() method takes a list and creates an array based on the list delimiter. It’s really very similar to ColdFusion’s own listToArray() function, except listToArray() will (as noted) ignore empty list elements. So a list of 1,2,3,,5 will yield a 4 element array using listToArray().

Read More»

Structures in ColdFusion

I don’t have figures on this (I’d be curious to run an unscientific poll tho), but I think it’s safe to say that a large number of ColdFusion developers don’t have prior experience with other programming languages. It’s ColdFusion’s ease of use that is appealing, and makes ColdFusion a great place to start learning.

While I think this holds mostly true, there are a few situations where the learning curve can spike a bit due to the lack of a programming background (I know, I’ve smashed into -many- of those spikes). One of the concepts that’s not terribly easy for the non-programmer to grasp is the concept of copying-by-reference and copying-by-value. It’s not too long after learning about structures in ColdFusion that this becomes very important to understand.

In ColdFusion, a simple value can be copied as such:

<cfset a = "foo" />
<cfset b = a />

What happens here is that you have two distinct variables. a and b. They’ll both evaluate to “foo”. One has nothing to do with the other. You can safely do:

<cfset b = "bar" />

…and it has no bearing on a.

Read More»
Page 6 of 6« First...23456
© Copyright Charlie Griefer