Archive for Adobe

Blizzard API and ColdFusion

Five years ago Ben Nadel blogged about manipulating Warcraft data from the armory as an XML file.

Today, the armory is nothing but a memory (permanently offline in August 2011) and has been replaced with the Blizzard Community Platform API.  This is actually a great thing… getting and manipulating your data is even easier!

The Blizzard Community Platform API uses RESTful services, so it’s really as easy as playing with some URLs:

<!--- Get Blizzard's RESTful data --->
<cfset serviceURL = "http://us.battle.net/api/wow/guild/Realm/Guild%20Name?fields=members" />
<!--- Returns the Blizzard data --->
<cfhttp method="get" url="#serviceURL#" resolveurl="yes" />
<!--- Because guilds typically consist of members with special characters in their names and setting charset="utf8" in cfhttp doesn't fix the problem --->
<cfset utf8Response = cfhttp.fileContent.toString("UTF8")>
<!--- Converts the Blizzard data into a structure --->
<cfset guildData = DeserializeJSON(utf8Response)>

What this does is return an awesome structure like so:

Read more

First Impression of ColdFusion Zeus/10

So the public beta of ColdFusion 10 is out… and man am I stoked!  Every version of ColdFusion for me has been nothing short of revolutionary, and after waiting for nearly two years I couldn’t wait to take it for a test drive.  So after little sleep and tinkering for 24 hours, here’s a first impression.

Zeus comes packed with a myriad of updates.

I immediately noticed Tomcat.  Maybe it is faster (I can’t really measure that too well over my local network on my development server which really has no measurable traffic), but everything just seems zippier and more responsive.  I don’t know whether that’s Tomcat or new, hot ColdFusion goodness, but I really appreciate that.

My favorite part by far is the exceptional detail and enhancements to security.  I rely on ColdFusion to be on top of its game with security so I don’t have to.  But because it is in fact security, I personally feel ALL of these security features should have been released in increments over the past two years with ColdFusion 9.  I’m a little irritated at Adobe with the decision to market security as a feature set instead of keeping all it’s products secure all the time (you know, like everyone else… norton, mcafee, php, java… just to name a few), but I’ll play along and say job well done because there’s great stuff here.

Read more

Fireworks!

I’ve always had a passion for using Fireworks since version 2. The first time I used Fireworks I could barely code a website… I used the Fireworks export tool to do everything for me (I totally flipped when I figured out how easily I could create rollover dropdown menus). In fact I’ve been using Fireworks so long now I still miss the oldskool font editor, although it’s something I’ve learned to live without.

Normally, I use Fireworks for all my web mockups… in fact I use it daily.

Then came along the day a few years ago when I wanted to learn how to create vector icons and I immediately turned to Illustrator. Meh… any vector icons I needed to create can just as easily be made in Fireworks… I just love the control and ease of use with my pen tool and those sprites.

This past year I designed a bunch of print material for various projects (several event flyers, event tickets and even a book of ads), so I turned to Photoshop (after strongly looking at Illustrator and InDesign). Nope… it’s Fireworks again to the rescue. I got the information I needed from the printer for DPI, size and bleed and I was easily able to export into the PDF format the printer needed.

I think it’s awesome I can do all this along with resizing and/or renaming images for my galleries with the batch tool, take screenshots of windows, use any Photoshop filter and even do skinning for Flex and Air.

I’m sure it has a lot to do with the comfort level I have with Fireworks, but it never ceases to amaze me the sheer versatility and flexibility the program has to offer. I personally don’t think Fireworks gets nearly enough praise for all it can do.

CF HTML5 Validation Gotcha

I spent some time scratching my head over this one and thought I’d share.

<cfset userAgent = trim(listGetAt(CGI.HTTP_USER_AGENT, 2, ';'))> <!--- This only works for IE --->
<cfset outtaDate = 'MSIE 8.0, MSIE 7.0b, MSIE 7.0, MSIE 6.1, MSIE 6.01, MSIE 6.0b, MSIE 6.0'> <!--- List all the versions of IE that are out of date --->
<cfif ListFindNoCase(outtaDate, userAgent, ',') NEQ 0> <!--- We're not gonna bump em from the site, but we will display a warning to those visitors using the older versions of IE --->
<div class="outtaDate">You are using an out of date version of Internet Explorer and this site <b>WILL NOT</b> display correctly. If you are using Windows Vista or Windows 7, please use Windows Update and upgrade to Internet Explorer 9 or newer. If you are using Windows XP and earlier which cannot upgrade to Internet Explorer 9, please download the latest version of <a href="http://www.mozilla.org" target="_blank">Firefox</a>, <a href="http://www.google.com/chrome" target="_blank">Chrome</a>, <a href="http://www.opera.com" target="_blank">Opera</a> or <a href="http://www.apple.com/safari/" target="_blank">Safari</a> to see this site correctly.</div>
</cfif>

I’m using this code to identify older versions of IE that don’t support CSS3 and/or HTML5. Maybe I should be identifying browsers a better way, but the problem here lies within the listGetAt on line 1.

This code will trip up the W3C Markup Validation Service marking your code invalid with one of ColdFusion’s styles from an error… ColdFusion’s pumping out an error to the service… even though the running site won’t pump out an error at all.

Here is ColdFusion’s exception error to the W3C service:

In function ListGetAt(list, index [, delimiters]), the value of index, 2, is not a valid as the first argument (this list has 1 elements).&nbsp;Valid indexes are in the range 1 through the number of elements in the list.

I’m sure this isn’t a big deal since most people aren’t identifying browsers with their code or even coding in HTML5 for that matter, let alone valid HTML5 to use the W3C service (hopefully it’s more than I think).

Either way, I don’t know why the validator service is getting that error, having tested the code on virtually every browser without any problems (old and current alike). And I can’t really tell whether the problem is with CF or the W3C’s tool, but it’s not having any sort of effect on the live code, which is always a good thing.

CFX: Feature Requests Part 3 – Everything Else

Although I was a part of several previous beta/pre-release testing versions of ColdFusion (Scorpio and Centaur) and my posts being as unpopular as they are so far, maybe it’s for the best I’m not part of Zeus [yet].  But, I’d still like to wrap up this series with a few remaining things I’d like to see brought to the tenth release of ColdFusion.

  • Facebook integration (similar to Google Maps integration only your parameters include your appID and secret key) — For those who don’t know, the work by Affinitiz on a ColdFusion SDK for FaceBook, although only in beta at the moment, is top-notch stuff… I love it!
  • Twitter integration
  • Google Calendar integration

This certainly isn’t a major thing and not even really a problem. It may not be considered best practice, but I can pass form variables directly into a CFC as such:

<cfform method="post" action="my.cfc?method=formMethod">

Best practice would have you submit to another CF file which invokes the method. I’d love to eliminate that extra step of submitting to a CF file (no reason… this is my wishlist :P) and have submitting the form data to the CFC be best practice:

<cfform method="post" component="#myCFC#" method="thisForm" optionalArgument="#formStructure.fieldName#">

When output to the browser, the form’s action would be masked with whatever the component file is, but without revealing the method (for security reasons). You could send the entire structure to the CFC’s argument or allow optional arguments from the structure as shown in the code above. Maybe it’s a tough sell, but I think it’s cool. 😉

If nothing else in this series was unpopular enough, I know this certainly will take the cake [or pie].  We have a development version of ColdFusion, but I still think the Standard edition of CF should be made free with no support from Adobe while offering a “professional edition” that’s the same thing as the Standard edition which includes paid support from Adobe.  Although there are free alternatives to ColdFusion out there, none of them are true to ColdFusion imho, adding in and making their own tweaks and adjustments along the way.  I’ve been preaching free CF w/o support for years though.

Anyhow, despite Adobe’s lackluster image lately [with Flash], ColdFusion remains an exciting, quality product and I’m looking forward to the next chapter of ColdFusion development.

CFX: Feature Requests Part 2 – New Tags & Functions

Before we get into the tags, I’d first like to mention I firmly believe SES URLs need to somehow make their way into ColdFusion.  The root of ColdFusion is making development life simple, and there is nothing simple about setting up SES URLs, particularly if you don’t know regular expressions.  I think this should be enabled/disabled at the application scope level and be a well thought out, simple process that doesn’t require IIS or Apache URL rewriting… it’s all done seamlessly in CFX.

With that said, here are some new tags I’d like to see:

  • CFTRAIL – This will leave a breadcrumb trail.  I initially thought this would be a feature that would require the use of SES URLs in the application scope, but thinking further, I think it could still be done with the developer providing parameters.
  • CFBROWSER – Web browser detection baby!

And while we’re at it lets add some parameters to CFLOCATION to allow delayed cflocating:

<CFLOCATION from="now()" delay="dd:hh:mm:ss" />

Lets also add a parameter to CFDIV to allow that loading icon to be customized:

<CFDIV icon="/images/yourAnimatedIcon.gif" />

This being ideal for loading user custom-created pages from a database, I think one of the features I would use the most is the ability to loop over cfcase in a cfswitch:

<CFSWITCH expression="#whatever#">
<cfloop query="yourQuery">
<cfcase value="#query.Column#"></cfcase>
</cfloop>
<cfdefaultcase></cfdefaultcase>
</cfswitch>

And finally some new functions I’d also like to see:

  • dollarformat() – oops!  Already exists.
  • encryptStruct()
  • encryptArray()
  • queryToArray(my.query,[dimension])

Coming next week
CFX: Feature Requests Part 3 – Everything Else

CFX: Feature Requests Part 1 – Addons & Frameworks

Even though I was unable to attend, Max 2011 produced some good things in the way of announcements for ColdFusion 10 (I like CFX better).  Most of what was announced though seemed like obvious steps forward of things that needed to be addressed, and not necessarily features that will make you jump out of your seat to line up and buy the product the second it’s released.  And I don’t really want to cover these features which can be easily found via Google.

Seeing as I’m not part of the alpha/beta of Zeus, what I do want to cover are some things that I believe would make CFX the product that would make you get in line and a product you can’t live without.

Today’s software and programming world is plagued with modularization. It is no longer just the language that is chosen for a project, but also the framework on which it’s built.

I am an anti-framework guy.  I honestly don’t get the buzz or see the benefit.  Inheriting someone else’s mistakes and relying on them because I’m too lazy to code the features myself isn’t a blessing for me or any of my clients.  It may save time to slap together a site in a few minutes, but does it really save time in the long run (and then have to keep that framework up-to-date… no thanks)?  Having jumped from framework to framework I’ve become a naysayer.  However, for the world of framework-lovers and the fact that ColdFusion is for everyone, lets modularize: Read more

ColdFusion CreateODBCDate Love

I was writing a mySQL query that only included dates in the results after today, and thought I’d share a quick problem I ran into.

SELECT column1, column2
FROM table
WHERE columnDate >= NOW()

Unfortunately, the NOW() function in mySQL will not include today.  Of course if I wanted to exclude today I’d take off the =.  I’m sure there’s a way to fidget with it and get it to do what I want in mySQL, but with a simple ColdFusion function I was able to get the result I was looking for.

SELECT column1, column2
FROM table
WHERE columnDate >= <cfqueryparam value="#CreateODBCDate(now())#" cfsqltype="cf_sql_date" />

Sexy!