The amazing adventures of Doug Hughes

Archive for January, 2006

My Recent OCFMG Presentations

Due to popular request Ive finally gotten a moment to publish the links to my two recent Online ColdFusion Meetup Group.

The first presentation was on the Alagad Image and Captcha Components. This presentation went rather well. It provided an overview of the capabilities and a demonstration of both components.

You can see a recording of the presentation here: http://adobe.breezecentral.com/p98616096/

My second presentation was on Reactor for ColdFusion, a ORM framework which generates customizable data persistence code on the fly. This was my largest presentation to date with roughly 60 people attending. The presentation really only scratched the surface of Reactor, but its a good starting point.

Heres the link for that presentation: http://adobe.breezecentral.com/p63651304/

I really enjoy speaking, though it can be quite exhausting!

Thursday – OCFMG Presentation on Reactor For ColdFusion

Please join the Online ColdFusion Meetup group for this FREE event, the second of two ColdFusion talks by Doug Hughes.

Doug Hughes will present on Reactor, a new persistence framework he has been working on. Reactor is an “Inline Dynamic Database Abstraction Generator”. What this means is that by using Reactor you can dynamically generate database objects on the fly in your code as needed. Additionally, these objects will be rewritten as your database changes. Reactor is simple, quick and powerful.

Time and Date:

This meeting will be on Thursday, January 19, 2006 at 12:00 (noon) US/Eastern time. Please refer to: http://www.timezoneconverter .com

About Doug Hughes:

Doug Hughes is the president of Alagad Inc and author of the Alagad Image Component. Alagad, which was founded in 1996, is a successful small business with clients around the world. Alagad specializes in web related services, consulting and development. Doug has spent many years "in the trenches" of web development. He has expertise in ColdFusion and many other technologies. Doug speaks at ColdFusion user groups, and frequently publishes technical articles on a wide range of topics on his website, DougHughes.net.

When:

Thursday, January 19, 2006, 12:00 PM

Presentation URL:

http://macromedia.breezecentra l.com/reactor/

Notes:

Location:
Please RSVP for this meeting. See the URL below for the Breeze Meeting room at breezecentral.com. If you’ve never used Macromedia Breeze, get a quick overview (watch the spaces): http://www.macromedia.com/re sources/breeze/brz_attend/

Recording:
This meeting will be recorded and available for playback later. Attending live is more fun, you can ask questions, and you can participate in any give-aways that occur. The URL for the recording will be posted here on the message board after the meeting is over.

The OCFMG is now officially registered as an Adobe User Group! As an Adobe UG, they will give away one copy of Adobe ColdFusion MX 7.01 Standard Edition, or Adobe software of equal to or lesser value as the winner desires.

Multiline Regular Expressions with ColdFusion

Ever needed to have a regular expression in ColdFusion match multiple lines? I bet you thought it wasn’t possible. I sure did. Luckily, everyone’s favorite CF Junky, Jared, set me straight.

It turns, by default, in ColdFusion the ReFind and ReFindNoCase functions will not find matches which span line breaks. I killed this fly with an elephant swatter: I used java’s regex capabilities directly. What a pain.

Turns out that you can actually just prepend “(?m)” to your regular expression and viola, it works!

Turns out there’s a few of these types of things you can apply. For instance, you can use (?x) to ignore white space. Using (?i) will make the regex case insensitive, even if you’re using ReFind().

For a full list of these options see the docs at: http://livedocs.macromedia.com/coldfusion/7/htmldocs/wwhelp/wwhimpl/common/html/wwhelp.htm?context=ColdFusion_Documentation&file=00000980.htm

Alagad Image Component Updated

At long last Ive released an update to the Alagad Image Component. This release includes roughly 6 months of assorted bug fixes and a few new features.

Of particular note are the following updates:

The Image.cfc file can now be renamed to whatever you want. Ive found that many people, especially non-English speakers want to rename the CFC. Now this is possible.

The Image Component used to require that any image read with the readImage() method had the correct file extension. Unfortunately, thats hard to guarantee. Now, you can pass in the type of file through a new, optional, third argument on the readImage() method. So, for example, you could pass in the mime subtype that ColdFusion returns when users upload files.

The Image Component now has two methods for reading and writing raw binary data: readFromBinary() and writeToBinary(). These are useful for people who store image data in databases or may already have binary data in a variable and who want to use the Image Component without first writing the data to disk. (These two new methods bring the count of image manipulation functions on the Image Component over 100.)

Lastly, support for BlueDragon 6.1 has been removed. The Image Component continues to support BlueDragon 6.2 and, now, 6.2.1 too.

The Image Component can be downloaded from Alagad.com.

Thursday – OCFMG Presentation on the Alagad Image and Captcha Components

Please join the Online ColdFusion Meetup group for this free event, the first of two ColdFusion talks by Doug Hughes.

Doug Hughes will be presenting on the Alagad Image and Captcha components. The Alagad Image Component is a CFC which leverages Java platform to provide a rich set of methods for creating and manipulating image directly from ColdFusion. The Captcha Component is a CFC used to create images of obfuscated text to prevent automated form submissions. Doug will cover the component’s feature sets, how to use them, their advantages, some potential road blocks and their solutions.

Time and Date:
This meeting will be on Thursday, January 12, 2006 at 12:00 (noon) US/Eastern time. For those of you not in this timezone, please refer to the conversions at this website: http://www.timezoneconverter.com/

Location:
RSVP for the online Breeze URL.

About Doug Hughes:
Doug Hughes is the president of Alagad Inc and author of the Alagad Image Component. Alagad, which was founded in 1996, is a successful small business with clients around the world. Alagad specializes in web related services, consulting and development. Doug has spent many years “in the trenches” of web development. He has expertise in ColdFusion and many other technologies. Doug speaks at ColdFusion user groups, and frequently publishes technical articles on a wide range of topics on his website, DougHughes.net.

When:
Thursday, January 12, 2006, 12:00 PM
This is United Coldfusion Meetup Day

More information:
http://macromedia.breezecentra l.com/alagadimage/ (I’m not sure if this is the information you find when you RSVP or not!)

Notes:

Location:
Please RSVP for this meeting. See the URL below for the Breeze Meeting room at breezecentral.com.
If you’ve never used Macromedia Breeze, get a quick overview (watch the spaces):
http://www.macromedia.com/re sources/breeze/brz_attend/

Recording:
This meeting will be recorded and available for playback later. Attending live is more fun, you can ask questions, and you can participate in any give-aways that occur. The URL for the recording will be posted here on the message board after the meeting is over.

I will be giving away a copy of the Image Component and the Captcha Component at the end of the presentation.

When Default Is Not The Default

Ive never really worked much with the cfchart tag. Ive just never had much of a need for it. However, I recently had a requirement to draw a 3d bar chart where each series of data had to appear behind previous datasets. I knew Id seen ColdFusion do this in the past, but for the life of me I couldnt figure it out.

Heres the sample code I was trying to get working. This creates a chart of random data:

<cfchart show3d="yes" xoffset=".125" yoffset=".125">
    <cfloop from="1" index="x" to="5">
        <cfchartseries type="bar">
            <cfchartdata item="Item 1" value="#randRange(1, 10)#"/>
            <cfchartdata item="Item 2" value="#randRange(1, 10)#"/>
            <cfchartdata item="Item 3" value="#randRange(1, 10)#"/>
            <cfchartdata item="Item 4" value="#randRange(1, 10)#"/>
        </cfchartseries>
    </cfloop>
</cfchart>

This produced an image that looked like this:

Bad Chart

However, I really wanted each chart series to appear behind the previous chart series. I googled and read and read and googled but didnt get anywhere. The cfchart tag has one attribute that effect this, seriesplacement. The seriesplacement has these four options, none of which seemed to work:

Cluster This didnt seem to make a difference.

Percent This appears to represent each row across the chart series as a percentage of the column. (Not what I wanted.)

Stacked This stacks each chart series on top of the other. (Also not what I wanted.)

Default Presumably, this is the default. So, if Cluster didnt make any difference in the chart then Cluster must be the default, right?

After a few hours of trying to figure this out I sent a question off to CF-Talk which was answered by Matt Walker. To quote him:

“Hilariously, in CF7, default is not the default!”

So, all I had to do was set the chartseries to default and it worked. Heres the code:

<cfchart seriesplacement="default" show3d="yes" xoffset=".125" yoffset=".125">
    <cfloop from="1" index="x" to="5">
        <cfchartseries type="bar">
            <cfchartdata item="Item 1" value="#randRange(1, 10)#"/>
            <cfchartdata item="Item 2" value="#randRange(1, 10)#"/>
            <cfchartdata item="Item 3" value="#randRange(1, 10)#"/>
            <cfchartdata item="Item 4" value="#randRange(1, 10)#"/>
        </cfchartseries>
    </cfloop>
</cfchart>

Heres the result:

Good Chart

Eat Your Own Dog Food

As a part of yesterdays Reactor announcement I also announced ReactorBlog, a sample application which relies on both Reactor and Model-Glue. Late last night I upgraded my blog and Im now using my own blog software.

So far I think ReactorBlog is pretty cool, though I may be somewhat biased. In many ways its a clone of the functionally in Rays blog CFC. However, under the covers, ReactorBlog is quite a different beast.

Some things that makes ReactorBlog unique:

  • ReactorBlog makes use of both Reactor and Model-Glue.
  • ReactorBlog is more OO than Rays blog.
  • Built in support for the Alagad Captcha Component to prevent blog span. (Youll need to buy your own license).
  • Entries can be indexed into a Verity collection. And though its untested, you can configure the blogs search to search additional collections.
  • Theres a nifty rating tool that readers can use to make you feel bad.
  • ReactorBlog shows the number of views of entries.
  • Rather than showing a calendar, ReactorBlog lists archives by month and year.
  • ReactorBlog has interfaces for managing users and categories.
  • Reactor Blog uses CSS to layout the site. (This is, of course, limited by capabilities with CSS.)
  • You can print any page on the site to FlashPaper or PDF.

Some things that ReactorBlog is missing right now:

  • Rays blog software has a nice system to unsubscribe from entries youve commented on. I need to add this at some point.
  • Rays blog software has been internationalized. Frankly, Im just a bit too lazy to do this right now. Maybe, if people really want it, Ill add it.

As with any new software, there have been a few minor glitches here and there. I spent a good portion of today working though them and fixing. So far I think its pretty stable.

The biggest problem with ReactorBlog, in my opinion, is that its a flaming royal pain in ass (please pardon my explicative) to deploy in a directory thats not /ReactorSamples/Blog. To compensate for this shortcoming Ive added reasonably detailed step by step instructions on how to do this in the ReadMe.txt in the ReactorBlog root directory.

To get ReactorBlog, download Reactor and look in the ReactorSamples directory.

Please let me know what you think!

Reactor Quickies: Documentation, MySQL 4, Speedups, Samples, New Zip, and More

As the title states, there’s been a lot going on with Reactor as of late. It continues to improve and stabilize. Here’s a summary of recent goings-on:

Documentation! At Last

I’ve spent almost all my free time over the past week writing documentation for Reactor. I estimate that, when all things are said and done, the documentation will be close to 200 pages. That means it’s about 20% done right now.

So far, the documentation has all you need to get started with reactor, including information on installing and configuring it. Also included is a quick start guide that helps you get your feet wet!

The latest documentation will always be available in the subversion repository.

MySQL 4 Support

Everyone’s favorite ColdFusion and frameworks guru, Sean Corfield kindly added MySQL 4 support to Reactor. I haven’t personally tested this, but Sean tells me it works just fine. The only issue is that neither he nor I know how to tell if a database object is a table or a view. So, views might have some minor issues when working with MySQL 4.

Thank you Sean!

Reactor is a Little Faster

I refactored Reactor last week and implemented a very short term caching system which really helps speed reactor up when in “development” or “always” modes. It shouldn’t make any difference for production applications.

Samples, Samples, Samples!

Over the past two weeks I put together two real sample applications for Reactor. If you download the zip or BER from subversion you’ll see a folder called ReactorSamples. Under this there are three folders:

Blog This sample is a full-featured blog application that uses both Reactor and Model-Glue. (I’ve started calling this ReactorBlog.) ReactorBlog is, in many ways, a clone of Ray Camden’s Blog CFC. However, there are a few extra features in mine, a few missing features (such as multilingual support), and ReactorBlog has a more robust architecture. (No offence, Ray!) As soon as I have time I will be migrating this site to ReactorBlog.

Contact Manager What framework would be complete without a contact manager sample application? This sample does not use any framework and really keeps to the bear bones to show how things work in Reactor.

Scratch This sample application isn’t actually an application. It’s really a set of files created while writing he quick start guide. Read the quick start and look at these files.

Presenting to the Online ColdFusion Meetup Group

On January 19th I will be presenting on Reactor to the Online ColdFusion meetup group. (Thank you, Steven Erat!) So far it looks like 35 people will be there, with another 6 saying they might make it. I’m really looking forward to this!

Reactor Wiki Removed

The Reactor Wiki has been removed. I was notified by a Good Samaritan that the Wiki had been spammed with lots of porn links. Rather than bothering to fight the spam, I’ve decided to just remove the Wiki. Sorry. Real documentation will be made available shortly.

Tag Cloud