Archive

Archive for May, 2009

Comments – The Universal Blog Currency

May 29th, 2009 amclean 1 comment

I’ve discovered something recently that I know I’ve taken for granted.

Google has been my primary educator – be it from forums, blogs, tech documents or tutorial sites. Many of these sites are paid for by advertising, but that’s typically not what motivates the creators to continue their craft.

Comments are.

Every blog post is an opportunity to comment. Everyone naturally comments on Facebook but for some reason the same courtesy is not applied to articles released daily by bloggers like myself who yearn for the encouraging but ultimately elusive comment.

I’ve been guilty of it myself. I read what I want and I move on, thinking nothing of the hours or even days spent toiling over details included in an article. I have been a leech of the internet community, and for that I am ashamed.

So I entreat all of you readers – not just for me and my site, but for all bloggers and community members alike – comment, even if it’s just to say you liked the article. Some places would say if you have nothing to contribute, it’s better not to comment. Personally I don’t feel like someone should be silent simply because they can’t say anything profound or meaningful. When you slave over an article, there is nothing more gratifying than a perfect stranger saying simply “great article”.

That one comment would feed my motivation for days.

Categories: News Tags:

Flash Forms in ColdFusion 8

May 27th, 2009 amclean 3 comments

I am not a ColdFusion expert.

I actually haven’t been working with ColdFusion for very long – less than a year. And the majority of that time has been spent developing things like registration forms for systems that are developed separately. I guess some developers really hate writing forms.

I guess I get it. The input part is tedious, the validation exhausting. And in the end, all you’ve really done is make it so that the end user can put their information into the database without screwing it up.

One of the things I like about Adobe ColdFusion 8 is the flash forms, which is actually a bit of a misnomer due to it actually being Flex 1.5 behind the scenes. I’ve read complaints from developers that the “skins” are very limited and boring, but personally I think they’re perfect. Granted I’m more of a back-end developer than a designer. I just enjoy things that are simple and clean.

Being a student of CF8, I find the documentation sometimes lacking a certain visual element. It’s fine to tell me about functions and tags but when you’re dealing with something on the presentation side of things, it helps to have some pretty pictures. So I’m hoping to help you out today by giving code examples and showing the results.

First off, to create a flash form, you start with a simple tag

<cfform format="flash">

This tells the ColdFusion engine to generate a swf instead of HTML to create the form.

The skins available include haloblue halogreen, haloorange, and halosilver, which you add via an optional skin=”haloblue” attribute. Haloblue seems to be the default, and it mimics the effect that Safari does when highlighting text input boxes. This code:

<cfform method="post" name="loginForm" format="flash" skin="Haloblue" height="200" width="400" preloader="true">
<cfformgroup type="page">
<cfformitem type="html" height="20"><b>Please Login</b></cfformitem>
</cfformgroup><cfformgroup type="hdividedbox" >
<!--- Group the box contents, aligned vertically. --->
</cfformgroup><cfformgroup type="vertical">
<cfinput type="text" name="uName" required="yes" label="username" width="100" tooltip="Username must be unique and only contain alphanumeric characters">
</cfinput><cfinput type="text" name="pWord" required="yes" label="password" width="100" tooltip="Password minimum 8 characters"></cfinput>
</cfformgroup>
<cfformgroup type="horizontal">
<cfinput type="checkbox" name="rememberMe" label="remember me" checked="true">
</cfinput><cfinput type="button" name="Login" value="Login"></cfinput>
</cfformgroup>
</cfform>

Produces this form:

I’ve simplified the form a bit to remove the calls to application.cfc to create the user session once logged in.

The hardest part, I find, is keeping straight the properties. Depending on how you organize the flash structure, you can generate some very interesting looking forms.

For example the tabNavigator style is visually appealing and functional, allowing the user to either click on the next tab to move on to the next part of the form. In the example below, some instructions provided by dcolumbus allowed me to control the tabs with the “next” button until the last tab, which alters the value to “finish”.

<cfform format="flash" width="600">
<cfformgroup type="tabnavigator"  height="120" style="marginTop: 0" id="tnav" onChange="if(tnav.selectedIndex>=2){nextTab.label='Finish';}else{nextTab.label='Next';}">
</cfformgroup><cfformgroup type="page" label="Contact Information *">
</cfformgroup><cfformgroup type="horizontal">
</cfformgroup><cfformgroup type="hbox" width="200">
<cfinput type="text" name="fName" label="First Name" value="" width="100">
</cfinput><cfinput type="text" name="lName" label="Last Name" value="" width="100">
</cfinput></cfformgroup>
<cfformgroup type="hbox" width="200">
<cfinput type="text"  name="uName" label="User Name" value="" width="100">
</cfinput><cfinput type="password" name="pWord" label="Password" value="" width="100"></cfinput>
</cfformgroup>
<cfformgroup type="page" label="Profile Information"></cfformgroup>
<cfformgroup type="page" label="Payment"></cfformgroup>
<cfformgroup type="horizontal">
<cfformitem type="text" width="400">*  All Fields Required</cfformitem>
<cfinput name="nextTab" onClick="if(tnav.selectedIndex>=2){tnav.selectedIndex=0;}else{tnav.selectedIndex++;}" type="button" width="100"  value="Next"></cfinput>
</cfformgroup>
</cfform>

Which creates this beautiful form:

Notice how “First Name” and “Last Name” are contained within the same , as well as “Last Name” and “Password”.

Notice what happens if i change the right “hbox” to simply “horizontal”:

You see it goes out of alignment because that’s what the hbox and vboxes are for. And of course you’ll notice that line 4 of the code is a , which tells the form to display each nested horizontally instead of stacking the two vertically.

The cfdocs available online all explain this very logically but sometimes it helps to see it in action and understand how it behaves visually.

Categories: ColdFusion Tags:

GeoTagging Photos

May 25th, 2009 amclean 1 comment

My wife Janine has always loved photography, and I’ve encouraged her buy purchasing some very decent cameras over the years. Most recently, the Sony alpha a100 DSLR with 10 Megapixels.

Next I should mention we have two kids and we travel. Not tons of travel, just more than some and less than others. Janine recently told me she takes an average of 3000 pictures a month, which amounts to about 100 pictures a day, and that means a little over one picture every 10 minutes she’s awake. Suffice it to say there are a lot of photos taken, especially of the kids.

The digital age has brought us many wonders. Computers, the internet, and of course GPS. Somewhere along the line, people wanted to know where their photos had been taken – myself included. This is likely old hat to many of you reading this but I personally know of many who have no idea what GeoTagging or Geocaching or even GPS is. And my own experience GeoTagging photos wasn’t always easy so I thought I’d try my hand at explaining and providing a list of useful devices and software.

GeoTagging involves writing geospatial coordinates to the digital picture’s EXIF data – the same data that your computer uses to see what the exposure setting, f-stop, zoom, camera model etc are. These tags are interpreted by certain programs such as iLife 09 or Picasa which can render a map displaying all the pinpoints representing the locations these photos were taken (see my earlier iLife 09 Review).

Cameras

A few cameras available today have GeoTagging functions. Fortunately some of these cameras are incredibly mainstream such as the Blackberry Curve or the iPhone, though the image quality of these are nothing compared to higher end cameras.

In 2008, many manufacturers promised to release GPS enabled cameras, but with the advent of certain simpler, lower powered solutions they seem to be dragging their feet a bit. Most at this point seem to take advantage of proprietary add-ons unique to each manufacturer, and generally only for the professional models such as DSLRs.

Devices

Third party devices are popping up which can either be used separately with software or integrated directly by way of SD cards or hot-shoe attachments.

Here are some highlights.

Eye-Fi – $99.99(http://www.eye.fi/)
4GB SD card with Wi-FI and GPS support
1 year of free Wayport Hotspot access
Can upload to various services such as flickr, facebook, picasa, youtube(for video), photobucket and more.
Uses Skyhook to establish wifi-assisted gps (at time of writing, this covers 70% of the US and Canada; 70% of populated Germany, France, and UK; While they plan to expand coverage in the west and Asia)
AMOD AGL3080 – $99.99(http://www.semsons.com/amaggpsdalos.html)
Data Logger
128MB USB 2.0 – Doubles as Flash Disk
15 hours with 3 x AAA batteries
Fast SiRF III chipset – get a satellite fix in as little as 1 second
Sony GPSCS3KA $149.99 (SonyStyle)
Data Logger
Acts as USB GPS interface for any computer with a USB port and GPS software
Built-in MemoryStick and SecureDigital ports for automatically matching GPS data to images
15 hours with 2 x AA batteries

Software

There are a number of easy to use programs that offer GeoTagging, such as iLife 09, Picasa, and Aperture. But if you want to match up GPS data from a data logger device such as the AMOD AGL3080, I’ve got a few tips since that’s what I have.

Basically there are two providers: Houdah and GPSBabel, with some crossover.

HoudahGeo – $30 (http://www.houdah.com/houdahGeo/)
OS X 10.4+
Geocodes for Google Earth or Flickr
Writes to iPhoto 09 places database
Map-based geocoding
HoudahGPS – Free (http://www.houdah.com/houdahGPS/)
Front-end GUI for GPSBabel command-line tool
Mac-Only (GPSBabel available for Windows, Mac or Linux and other GUIs are available, but nothing as streamlined and simple as HoudahGPS)

Conclusion

I personally use HoudahGeo paired with my AMOD AGL3080. If I could choose now, I’d probably go with the Sony device since all you have to do is turn it on, take your pictures and then just plug in your card when you’re done – the device will write all the appropriate EXIF data to the image files. The AMOD has a few extra steps to it, but it logs files with the same format as the Sony does, so when you import the data into HoudahGPS, you must specify the Sony data format.

If anyone wants a full demonstration of HoudahGeo or HoudahGPS or any cool tricks you can do with them and Google Earth, please comment and say so. I might even write one anyway.

Categories: Software Tags:

The Best USB Applications Are At PortableApps.com

May 25th, 2009 amclean No comments

On the off chance that you computer savvy users have not heard of PortableApps.com, I thought I’d bring it to your attention.

Basically all of the best open-source applications have been shrunk down and configured in a way that doesn’t involve embedding itself in your system registry. Apps include Firefox, Thunderbird, OpenOffice3.0, ClamWin (antivirus), InfraRecorder (cd authoring), Pidgin (chat), Notepad++ (pretty much my favourite text editor) and more.

I used to keep everything on my laptop and generally I do, but since I can’t always bring my laptop with me and I have this nasty habit of needing to be connected all of the time, I carry around my trusty USB key so I can even check my email from several accounts using Thunderbird.

The programs offered even include a portable PHP and MySQL server, which can come in handy for when you need to work offline and don’t already have a local environment.

Many of these programs are useful to me both as a programmer and a mobile tech. The program names will be more familiar to linux users due to the open source nature and the wide availability of mainstream products. Pidgin, for example is a chat program that can interface with MSN, Yahoo, ICQ, IRC, AIM, and even Google Talk. It doesn’t support any of the extra features such as video or voice chat, but it does a great job where it needs to.

Categories: Software Tags:

Web Series Announcement And Talent Showcase

May 24th, 2009 amclean No comments

I suppose now is as good a place and time as any to mention that I’m in the process of producing what seems to be the latest fad of the internet – a “Web Series”. It’s been scripting for some time now and the first drafts should be done at the end of the month. With any luck we can start filming this summer and have at least the first 3 episodes out by August. The cast so far consists of myself, my good friend and up-and-coming writer Tim Zeman, and a number of great friends willing to embarrass themselves publicly.

To get our main actress some exposure, some of us thought it prudent to release some of her recent work for the world to see so that they can appreciate her talent as much as we do. The video highlights her great singing voice.

The next video here is from my friend over at dcolumbus.net who is also involved in the project, which also involves singing but not his voice.

We’re all really excited about the project and I’ll keep you posted until I have another site set up for it.

*Edit: 02/15/2011*

This kinda died. Long story but the show is still being developed – just more as a television sitcom than a web-series.

Categories: News Tags:

Encouraging Comments Are Welcome!

May 23rd, 2009 amclean No comments

I’ve had a few encouraging referrers and trackbacks, but I live for comments. Many thanks to my friend over at develop.dcolumbus.net for getting the ball rolling. The site is young and I’ve yet to really get into it myself, so help me out by encouraging me to write things that interest you more or even offer helpful criticism.

And incidentally, I have a traffic competition going between myself and dcolumbus, so feel free to help him out by going to his site at the link above.

Please feel free to comment and thank you for visiting!

Categories: News Tags:

Bad Behaving Flash Form When Using Mask Attribute in CFML

May 22nd, 2009 amclean 2 comments

I’ve had this problem for months and so far have discovered no acceptable solution.

Take for example the following code:

<cfform>
Phone <cfinput maxlength="12" size="15" mask="999-999-9999" required="yes" name="phone" type="text">
</cfinput>
</cfform>

This code generates the following:

Then to demonstrate the issue, I will convert it into a Flex form

<cfform format="flash">
<cfinput maxlength="12" size="15" mask="999-999-9999" required="yes" name="phone" type="text" label="Phone">
</cfinput>
</cfform>

Which generates this:

Neither form has been submitted, but the first form will report an error if it’s submitted empty or mal-formed The second code will show an error immediately as if it’s been submitted already. The problem seems to be a combination of using the mask (999-999-9999 to indicate any numerical digit separated by a dash) and the “required” attribute while using the flash form. If I remove the mask attribute, it doesn’t report an error until after it’s been submitted – but this loses the client-side auto-formatting feature. If I remove the “required” attribute, the mask works but I lose the uniform look beside the rest of the form I’d potentially be placing alongside as “required” fields. And if I remove the format=”flash” part of the cfform, the issue clears right up but provides no visual clue that the field is required until after it has been submitted.

I submitted this to Adobe as a bug and have not yet received a response, and I’ve confirmed this issue to be present in the beta version of yet-to-be-released Adobe Centaur (codename for CF9).

Categories: ColdFusion Tags:

Generating An iCalendar .ics File With ColdFusion

May 22nd, 2009 amclean No comments

I currently work for a company who had an in-house scheduling app that is accessible from the web. The app covers everything from the client database to invoices, technician availability, and the daily schedule. Incidentally, it lacks any real mechanism to sanitize database inputs and thus we have to be careful what characters we put into it (and I would love to overhaul the whole system). But what I thought would be really great would be to generate an ICS file that any of our techs could synchronize to Outlook, iCalendar, Gmail or even Mozilla Thunderbird.

Sadly I’ll probably never have opportunity to do this, but if I were to, I would use the code from WebDH blog:
http://blog.webdh.com/index.cfm/2008/3/21/Generating-an-iCalendar-ics-file

You might notice my comment on the post clarifying the use of the daylight savings code.

I plan to use this on my next project which will generate a file so that people who choose to attend a webinar can synch it with their calendar which should take into account their local time zone in relation to that of the webinar host.

Categories: ColdFusion Tags:

ColdFusion LiveDocs Desktop Reference With Adobe Air

May 22nd, 2009 amclean No comments

This is awesome.

I don’t often get in to see the ColdFusion livedocs, since I have some other reference material. But every once in a while I end up there with some code clarification. I didn’t even consider that I could get a local desktop version, but now that I think about it, it would be awesome to have an offline reference.

Brian Love of brianflove.com has created an Adobe Air version of CFDocs, which is insanely fast with quick access to tags and functions complete with examples. I guarantee I will be using this a lot from now on.

You can download the CFDocs.air file from http://www.brianflove.com/public/CFDocsOnAIR/

Enjoy a complete, blazing fast ColdFusion reference from the comfort of your desktop.

Categories: ColdFusion Tags:

“Teleporting” Between Macs

May 22nd, 2009 amclean 2 comments

I came across a great post today, highlighting software that sadly I can’t experiment with because I only have a single Mac – a Mini.

For those of you with multiple Macs, this software may be for you.

And as an added bonus, the post is from a ColdFusion developer not far from here over in Vancouver.

Check out the post http://mallinson.ca/post/12/

Categories: Software Tags: