Tag Archives: ColdFusion

Zip proximity search

Gotta love the internet and the fates, those sly greek chicas.

A few days ago I came across some one’s blog posting about his articles in the Oct CFDJ. I can’t remember where I saw that, but I did download the PDF version. I didn’t read it at that time, but I scanned the cover.

Jump a few hours into the day, one of my clients is talking about an unscoped feature on the site I’m building for him. A search based on zip code proximity, didn’t I just see that somewhere? I did, the Oct CFDJ had an article by Troy Pullis on his implementation of a proximity search.

I read his article and he points to his source of inspiration, an article on webmonkey by none other than my new Pal Rob Capili. I met Rob at Flex training a few weeks ago. I had him send me his code (I couldn’t get webmonkey to load for whatever reason) and away I went. Thanks to his code and article, and Troy’s article in the CFDJ, my un-spec’ed search page was done in an hour or so, including my 5$ zipcode database.

Gotta love the CF Community.

CSS

I’ve never been a big fan of CSS. No real reason, it just seemed like such a PITA. And it is really, let’s be honest.

BUT

I’m working on a site for a client and they want it mostly CSS. More search engine friendly and all. I know enough CSS to fill a shot glass. Prefer other things in my shot glasses, but my CSS knowledge will if needed fit there.

My buddy Tom used one of our co-workers’ books on CSS, and said it had helped him with his immediate need. So.. off to the local B&N I went.

The local B&N actually has a really good section for computer books, I was impressed, and had I not been in a hurry to get back to the house and get working, I woulda stuck around a while.Seeing as I was at a book store I couldn’t come away with just one book, especially if the one ended up not be the one I need. So I picked up the O’Reilly offering on CSS as well. They tend to be pretty good books.

I am well on my way to really digging CSS. It certainly takes some getting used to but it sure is nice once you get going. This site I’m working on is pretty easy to tweak when I need to change a color or nudge something to the left. I’ve really been missing out.

Search Engine Friendliness

A client of my client recently had me make their site Search Engine friendly. Was quite an interesting project. I had never really looked into SEO, and SES stuff before. Gave me a chance to get a little insight into how the search engines work in relation to dynamic sites.

We used <cf_fake_url> to accomplish the ses conversion. It actually made the transition quite easy. A few pages required some tweaking with how they pass variables but otherwise it was a simple matter of changing all <A href> tags to use page.cfm/var/value/var/value. Worked rather well I must say.

Time Management & Invoicing

Long ago in a galaxy far, far away I worked on a project for an employer. They wanted some way for us developers (and eventually QA, and such) to track our time. The reason was two fold; see what we were spending our time on, and capitalize any new development in order to manage costs.

Well as resident CF Guru the application we needed fell to me. Not only was I the sole developer, I was the technical architect, before such titles existed. Long story short I came up with a pretty damn robust time tracking app, with lots of reporting features. When I left there and the company folded, I modified the application (which I somehow accidentally left on a CD) to be my time tracking and invoicing app for my consulting business. The time entries I made, were then translatable to an invoice that I could print or email. This was all CF5, so none of the cool new features we have today.

A badly planned HD wipe and restore left me with a copy of my app that was 5 months old a few years ago and I never came back to it, since I was a full time employee. Well I’m getting back into consulting again so I’ve resurected the app and am bringing it up to 2005.

Once I get it back to mostly stable I’ll start posting Zips of it for download by anyone interested. Screen shots are available over at my other site.

Scope Creep! I damn near killed her!

There really should be fines for those who indulge in either scope creep or over engineering a solution. I’m all for delivering a quality product, obviously. I’m a professional. However, delivering an over engineered solution that solves problems that people aren’t having, late, is not cool. In my experience users would rather have what they asked for on time, and then think about V2 to address the difficencies in the current version. Windows 3.0 wasn’t the last version of Windows. Too many developers out there, are so concerned with only working on cool new shit that they forget that if not them, someone has to maintain the beast they create. So they build this massive impossible to understand frankenstein monster of an application.

It really sucks some times.

My version of Captcha

Rob Brooks Bilson has an interesting post on how CFX_captcha is (or was at the time of his post) is proving to be tough to beat.

For those (are there any) that don’t know, captcha systems are those annoying little things that ask us to type in some random string of letters and numbers.

As Rob points out, for those of us that are color blind these systems are really hard to deal with. Hell I’m not color blind and I often have to refresh until I get a legible string.

So this brings us to my version. I could have used cfx_captcha, but I’m cheap and it woulda cost like $10/month for CrystalTech to host the CFX for me. Pass!

I launched my blog with no spammer protection initially. That, as you can imagine didn’t go well. My comments were flooded with Spam almost immediately. Short of disabling comments I needed a solution, so I came up with something pretty elegant IMO.

On the surface it’s a Checkbox with a label of “I am human”

under the covers, I create a random number and save it to session scope. That number becomes the name of the form field for the checkbox. On the processing end of  the comment processor, I look for a form field that matches my random number. If I have it, the comment passes. If not, I quietly disregard the comment.

<!— Random GUID Maker to fool spammer assholes —>

<CFSET SESSION.RandPart = RandRange(1,999999999)>

<CFOUTPUT><BR><input type=”checkbox” name=”FORM_#SESSION.RandPart#” value=”1″> I am Human (no check, no post).<BR></CFOUTPUT>

On the processing page it’s pretty simple.

<CFSET VARIABLES.LocalName = “FORM_#SESSION.RandPart#”>
<CFIF (Find(“www.johnwilker”, CGI.HTTP_REFERER) OR Find(“localhost”, CGI.HTTP_REFERER)) AND IsDefined(“#VARIABLES.LocalName#”)>

If it passes then the post is put into the database, if not the form says thanks and moves on.

I’m not sure how foolproof it is, but since I launched it. it’s never failed me. And it doesn’t offend the color blind.