URLValidator for AS3/Flex

I had the need for a URL Validator for a Flex project, and couldn’t find one. So, here’s the code:

package org.iotashan.validators
    import mx.validators.ValidationResult;
    import mx.validators.Validator;
    public class URLValidator extends Validator
        public function URLValidator()
        override protected function doValidation(value:Object):Array
            // Clear results Array.
            var results:Array = [];

            // Call base class doValidation().
            results = super.doValidation(value);       
            // Return if there are errors.
            if (results.length > 0)
                return results;
            // match regex pattern
            var pattern:RegExp = new RegExp("^http[s]?\:\\/\\/([^\\/]+)\\/");
            // run the pattern, but don't error if there is no value and this is not required
            if (!(!required && !value) && !pattern.exec(String(value))) {
                results.push(new ValidationResult(true, null, "notURL",
                    "You must enter a valid URL."));
                return results;
            return results;

You can download the swc here.

cf-flex-user-auth Released

I’m happy to announce the immediate availibility of cf-flex-user-auth, a starter application for developers building Flex applications with ColdFusion on the backend. I’ve been working on this for a while now, and it’s gone through two complete rewrites.

The idea behind this is for developers to be able to download this source code, and have a running start at building Flex applications. On the Flex side, we’re using the Mate framework. On the ColdFusion end, we’re not using any framework, since we’re really only exposing the database via CFC’s.

This application covers the basics of a user application, because I was tired of rewriting the wheel every few months:

  • User registration
  • Email confirmation
  • Login
  • Logout

So, go get it now via the Google Code SVN repository. If you need help, read the wonderful documentation.

Special thanks to Laura Arguello for the crash-course on Mate, and Dan Wilson for writing the installation docs.

Review: Jungle Disk Plus 2.0

I’ve been on a quest for the perfect off-site backup service. I’ve considered everything using my own servers and rsync, tried various free/cheap services like Carbonite and AT&T Remote Vault, and finally came across Jungle Disk. Jungle Disk uses Amazon S3 for storage, and Amazon EC2 for their Plus service. This review is of the backup features, and does not cover the flagship virtual drive features.

Licensing: Generous! Pricing: Cheap!

First, the bottom line. The software is a $20 purchase, and that’s good for lifetime updates and unlimited installs that share a single S3 account. They do not mark up Amazon’s pricing, so storage (as of 7/15/08) costs $0.15/GB, transfer in costs $0.10/GB in and $0.17/GB out. So, if we backed up a 100GB drive, based only on transfer and storage costs, we would expect a bill of about $25. Amazon has continued to adjust their S3 pricing, so we can likely expect those costs to go down over time.

Plus Service
Jungle Disk’s Plus Service is indispensable for doing backups. The ability to do block-level updates and upload resume are both key to cutting down bandwidth costs. And, at $1/month, it seems to be a no brainer.

Jungle Disk has built-in backup features, which are what I’ve been using. First, we’ll cover the down sides: Jungle Disk has to be running for backups to occur. It will wake your computer from sleep, but if your user is not logged in or Jungle Disk is not running, the backup will be delayed or skipped. There are some workarounds for running it as a Windows service, none of which I found to be reliable. Also, as with any online backup service, it only goes as fast as your internet connection. There is a bandwidth schedule, so you can throttle back on upload and/or download speeds according to your usage schedules.

Everything else is rainbows and unicorns. You can create multiple backup jobs, choose the files you want to back up, set up exclusion rules and schedules. Some advanced features include optionally removing files that have been deleted on your local system, and setting up rules for keeping previous versions of modified files. Here’s how my backups are now configured:

Desktop: Daily backup of users directory & development directories, with a 14-version history, up to a year.
Laptop: Daily backup of users directory & development directories, with a 14-version history, up to a year.
Web Server: Hourly backups of inetpub, with a 14 version history, up to 60 days.
Database Server: Daily backups of MySQL dumps, with a 14 version history.

For my first month of backups, I am expecting a bill of around $75. Considering that this is including a first-time upload cost that I won’t have in subsequent months, it’s really amazing. I have many, many gigs of pictures and videos, thanks to today’s 10 megapixel cameras and HD Video files, so it’s nice to get those precious memories backed up off-site, in addition to my Time Machine backups.

Availability & Security
One truly unbelievable feature that may go unnoticed is that Jungle Disk itself is not dependent on the stability of the company. The Plus service, but the basic service is only dependent on Amazon S3. Jungle Disk actually has open-source code on their download page that includes the code needed to read your data back off of S3. This provides unparalleled levels of service, when compared to other online backup offerings. Also, if you are the extremely paranoid type, you can opt to encrypt your files before they’re sent to S3 (over http or securely over https).

Final Thoughts
I’ve been supremely impressed with Jungle Disk as an application and a service. When doing backups, CPU usage has been minimal, and on my DSL line, web and email speeds haven’t suffered much, if any. I do get some lag when gaming, but it’s easy to pause and resume backups. The ability to use this cross-platform on OS X, Windows and Linux has proven indispensable, allowing me to further reduce the number of solutions needed to maintain my home network and development projects.