An Architect's View

CFML, Clojure, Software Design, Frameworks and more...

An Architect's View

Entries for month: November 2010

OpenCF Summit - Speakers & Partners

November 30, 2010 ·

It's now official: I'm speaking at the OpenCF Summit in Garland, TX in February! This will be a unique event in the CF world, with its focus on open source, and it has a lot of interesting types of sessions on the schedule: Pecha Kucha, Open Spaces, Hackfests - as well as regular sessions - and several BOFs and panels!

In addition, many of the OpenCF Summit partners are listed, including Railo Consulting, O'Reilly Media, Packt Publishing, hosting companies and consulting groups.

I think it's one of the most exciting new conferences on the schedule - I hope lots of people will agree and take advantage of this event with it's low price of $199!

Tags: oss · coldfusion · fw1 · opencfsummit · railo · openbd

Fun with Zodiac signs

November 22, 2010 ·

Here's a little puzzler for you! Given the twelve signs of the zodiac, write some code to print out a list of all the valid keys / pairs such that:

  • The keys have the form: zodiac.firstsign.secondsign (all lowercase)
  • The values have the form Firstsign and Secondsign (correct case on the sign names)
  • firstsign and secondsign are in alphabetical order
  • There are no duplicates

The result will have lines like:

  • [zodiac.aquarius.aquarius Aquarius and Aquarius]
  • [zodiac.aquarius.pisces Aquarius and Pisces]
  • ...
  • [zodiac.aries.pisces Aries and Pisces]
  • [zodiac.aries.aries Aries and Aries]
  • [zodiac.aries.taurus Aries and Taurus]
  • ...

Click through to see the solution I came up with (in Clojure because I expected it to be easier).

[

Tags: clojure · programming · coldfusion

cf.Objective() - passing the torch

November 17, 2010 ·

I've been closely involved with cf.Objective() since it started back in 2006. Yes, it's been going for five years now! When Jared started complaining to me, in 2005, about the lack of ColdFusion conferences in the middle of the country, I said "Don't complain, do something about it!". That exchange led to a small (100 people) event in an interesting hotel near the Mall of America that covered a lot of 'enterprise' level ColdFusion topics. I wrote enthusiastically about cf.Objective() 2006 and plans for cf.Objective() 2007 were in progress almost immediately.

Over the last five years, I've helped put together the agenda for the conference - usually with help (especially Nic Tunney for several years!) but occasionally on my own. It's a lot of work! Last year - 2010 - we tried something different: a content advisory board. It had some pros and some cons and we learned a lot about the dynamics of committees. The consensus was that the CAB was too large and that centralized control was still the most effective way to drive the process forward. After five years of volunteering for cf.Objective(), working on the content of the conference, I need a break. The question was: who should take over the role of leading content organization?

Although not a member of the 2010 CAB, one of our speakers was particularly helpful and proactive, organizing the Pecha Kucha and running surveys etc to help shape the Birds of a Feather sessions. Based on his contributions to cf.Objective() 2010, I proposed that he head up conference content for 2011. The conference committee agreed and so I am very pleased to announce that I am passing the torch to Bob Silverberg. Bob and I have talked about the processes used over the last few years, the pros and the cons and he has some great ideas for pushing the conference to new heights. I'm looking forward to cf.Objective() 2011! I'm especially looking forward to having a lot more personal time over the next six months!

Bob has posted information about plans for cf.Objective() 2011. will be posting information about his plans for cf.Objective() 2011 shortly - and I'll update this blog post with a link to his blog post on that topic! In the meantime, please join me in thanking Bob for taking on this heroic task - I hope you will all support him in his efforts!

You can also suggest / view topic suggestions for cf.Objective() 2011!

Tags: coldfusion · cfobjective

Just For Kicks - Scala and Clojure

November 10, 2010 ·

Jack Widman posted a Scala snippet on Twitter today to calculate the sum of squares up to a given number:

def sumSquares(n:Int) =
    (0 /: List.range(1,n+1).map((i:Int)=>i*i)) (_ + _)

(I renamed the parameter of the anonymous function argument to map just to make it clear it's different to the parameter of sumSquares itself)

I responded with a version of it in Clojure for comparison:

(defn sum-squares [n]
    (reduce + (map #(* % %) (range 1 (inc n)))))

They're very similar: they both reduce (using +) over map (using * to square items) over a range of numbers from 1 to n+1 (inclusive at the bottom, exclusive at the top). Note that reduce is called /: in Scala and the function argument comes afterward.

To be a true apples-to-apples comparison, the Clojure version should be typed, i.e., the parameter n should be declared to be an integer:

(defn sum-squares [^Long n] ... )

That makes quite a difference to the performance.

CFML doesn't have collections so it's not easy to produce an equivalent version without writing all of the primitives (reduce, map, range) from scratch and even then it would only be easy to write for arrays - and it wouldn't be very efficient since ColdFusion copies arrays on assignment (Railo treats arrays as reference types for efficiency reasons).

Of course, most CFers would just write sumSquares in a straightforward procedural manner like this:

function sumSquares(n) {
    var total = 0;
    for ( var i = 1; i <= n; ++i ) {
        total += i * i;
    return total;

This is radically different of course since it conflates reduce and map (in the body of the loop) and range has become a for-loop. This is why I tell people it's so valuable to learn other languages: they help you think about problems in a different way and you can become a better programmer because of that. It's why I recently bought Seven Languages in Seven Weeks by Bruce Tate. Of the seven languages, I know three fairly well (Clojure, Prolog and Scala) although it's been years since I did anything significant with Prolog. I've dabbled with Haskell and I had a brief look at Ruby a few years ago. I'm a couple of days into the Ruby week and it's challenging in a good way. Tate deliberately doesn't provide any hand-holding for installation or "getting started" basics (and he explains why in the book) so even the relatively simple real-world exercises require a bit of work and some reading up on your own. Definitely a good way to force you to learn. I'm looking forward to revisiting Prolog and going deeper into Haskell as well as getting started properly with Erlang, Io and Ruby!

Put the book on your Christmas list!

Tags: clojure · coldfusion · scala

Adobe MAX 2010

November 03, 2010 ·

Adobe MAX is always impressive. It offers unparalleled networking, fascinating exhibit hall booths and, for the last few years, excellent unconference sessions - all accessible on a $200 exhibits only pass. The general sessions are always well-rehearsed and theatrical, the sneak peeks interesting (with a cool special guest). This year was definitely enhanced by the swag: everyone got a Motorola Droid 2 and a Logitech Revue Google TV box - and a free eBook from O'Reilly! Several people got Blackberry Torch phones too. Sponsors and exhibitors went nuts this year with giveaways (VMware gave away a couple of iPod Touch devices and many booths had iPad raffles).

[

Tags: coldfusion · adobe · adobemax10