Review: Railo 3 Beginners Guide

The first Railo book Railo 3 Beginner's Guide, and hopefully not the last, was published by Packt Publishing sometime near the end of December, and while it's taken a bit of time a copy finally arrived last week for me to review.

I've already posted a review on Amazon and won't be repeating myself here. I also won't be doing a seriously in-depth exhaustive review a'la Charlie Arehart, cause thats not my style.

The Review

Firstly I just want to say this. It's about friggen time! The book could have been written sooner, hell I started writing a jumpstarter book a few years ago but then all hell broke loose (personally) and the project failed to really take off. I'm quite thankful that it did because Mark et Al did a bang up job.

I have a little beef with the title though, I think beginners guide is a misleading title, sure they go on to say that the reader is "expected to have some experience in web application development..." and given the intro chapter in CFML it's definitely a book by developers for developers.

I was a big confused with the jump to the server Admin in chapter 4, but when I think about how I learn, or how we learn in general, its good to get results fast. No one wants to sit in theory class for 6 weeks before sitting behind the wheel when learning to drive, show me the important stuff: brake, gas, clutch, steering wheel, ok? good! Here are the keys lets have a quick go around the empty parking lot to get a feel for it.

Besides chapter 5 through 8 go into more depth, then a bit more classroom work in Chapter 8 with Resources and Mappings, then back out behind the wheel with Extending Railo and the Video sharing application.

What I missed

I would have liked to have seen an Appendix with Railo's own CORE tags that are not in "Standard" CFML e.g. Engine specific Tags, and an Appendix showing their Engine specific Attributes when they differ. Quasi a comparative Matrix like we know showing the differences between the popular Browsers.

Buy it...

Buy it don't steal it, the e-book is only $19 don't be a cheap bastard and leach it.

JavaScript Expert Needed

We have an immediate need in Munich, Germany for a JavaScript expert. The candidate must have extensive interface design skills and strong familiarity working with js frameworks such as jQuery.

Being able to understand and communicate in German a requirement.

If you are interested or know someone who would be interested please send me an email using my contact form.

Cheers and happy programming.

oAuth Update on Riaforge

Just a quick note, we have updated the oAuth implementation on riaforge. There was a small bug in the toHeader() function the oAuth prefix was not being prepended to the authentication string.

I also put together a new simple "Test Harness" to test against twitter, this testing harness goes through the entire process from request token to access token.

Happy Coding...

SerializeJson Sucks II

I want to thank those of you who read my rant and added your opinions, questions and corrections (Thanks Nic loosely typed of course :) )

Letting of steam certainly helps and getting feedback helps focus too.

Thanks Kai, I will attempt to clarify my problem with SerializeJSON.

Russ S. I will definitely look at those projects as serializejson for my project is not usable.

[More]

Coldfusion's SerializeJson Sucks!

If I recall correctly CFML is a typeless language. I mean we can really all agree that Coldfusion is typeless right?

Ok now that we have that out of the way lets talk about Adobe's implementation of serializejson(). Serializejson is simply trying to be too damn smart for its own good.

Listen I don't want you to frig with my data, I want you to take my structured data, be it query, structure, or array, or whatever, and simply convert that structure into its JSON equivalent. Don't try to parse my dates, numbers or what not, or even try to. Just take what I give you and simply covert the data from one structure to the other mmmkay?

Since when is 9999999999999999E+10 equal to 9.999999999999999E25. Ok mathematically they are, but did I ask you to be smart and do math? NO, I don't think I did!

Either provide me with enough options that I can influence how numbers and dates are handled or do what Railo does and output everything as strings.

/rant off

Structkeyexists or Yes, No, Maybe So

Perhaps I'm just being picky here but why do some functions in CF return a boolean (true/false) and others return a boolean (yes/no)?

For example StruckKeyExists() is one such culprit it returns a Yes or a No, which in CF is boolean. The problem naturally comes in if you decide to send the results from a StructKeyExits to a language that doesn't understand that yes/no in reality means true/false. Even if you use the serializeJSON() function to convert your data to a JSON formatted string, the Yes/NO does not convert to a boolean in JavaScript whereas a True/False is. In fact serializeJSON converts Yes/No to a string!

The CF9 documentation for StructKeyExists even indicates that the result of the function is True if the key exists. They say nothing about Yes.

[More]

Book review: Coldfusion 9 Developer Tutorial

I've just received an updated copy of John Farrar's Developer Tutorial Book for Coldfusion 9 from Packt Publishing. I've not yet had the time to dive into the book yet as work has been insane busy but I'll try to get a "real" review of the book in the next couple of weeks. I'm actually in the process of migrating my blog over to Mango.

[More]

Some Thoughs on CFUnited

[OK something is going weird with blog CFC going to have to finally make the move to mango when I get back to Germany]

I'm kind of sad really. My first "major" speaking engagement happens to be at the last official CFUnited. Perhaps it's just me, and that I have never been to a CFUnited before but it struck me as odd at the shear number of women in attendance. At the Munich cfug I think there are perhaps one or two women and at the two European Max's I attended the number of women in the CF sessions were, well, practically non-existent.I really enjoyed being up in front of the audience and had a lot of fun presenting my topic. I will be uploading my slides to slideSix in the very near future. Tim Cunningham has offered to host the video of my presentation I just need to put upload it to he can pull it down.

I finally got to meet Ben Nadel after missing him when he came to Munich, and I may even end up on his slide-show with half the CF world.

CFUnited was a lot of fun, and a lot of hard work too as Alex and I manned our sponsor booth the 3 days. Lansdowne had the AC jacked way the hell up which, with all the stress of travel and my first time presenting, gave me a cold for the first time in like two years. I never quite understood why there is ever a need to have a building cooled down to under 20 (70) degrees.

I do hope that CFUnited will continue in some form or another and that I will have an opportunity to present again at either CFUnited or one of the other conferences.

Happy Coding...

Converting structkeys to lowercase

As you most probably know when you create a structure and don't quote the keys they are automatically converted to uppercase.


<cfset myStruct = structNew()>
<cfset mystruct.one=1>
<cfset mystruct.two=2>
<cfset mystruct.three=3>

When you dump it out you get:

and when you serialize it to json all the keys are also uppercase. This can be problematic since JS is case sensitive. You could create your structure with lowercase keys then serializeJSON() will maintain the case of your structure, but if you don't have control of the structure itself you need to do something to to convert only the structure keys to lowercase.

As a quick and dirty way of doing this I build a recursive function to do just that. Firstly I ran the structure through SerializeJSON() just in case the structure contained other datatypes that also need to be serialized, I think deserialized the string back into a structure. Make sure you use strict mapping so that the function doesn't try to convert your query back into a query. Then call the recursive function to go through and change all the keys to lowercase.

Here is the function:


    <cffunction name="convertStructToLower" access="public" returntype="struct">
        <cfargument name="st" required="true" type="struct">

        <cfset var aKeys = structKeyArray(st)>
        <cfset var stN = structNew()>
        <cfset var i= 0>
        <cfset var ai= 0>
        <cfloop array="#aKeys#" index="i">
            <cfif isStruct(st[i])>
                <cfset stN['#lCase(i)#'] = convertStructToLower(st[i])>
            <cfelseif isArray(st[i])>
                <cfloop from=1 to="#arraylen(st[i])#" index="ai">
                    <cfif isStruct(st[i][ai])>
                        <cfset st[i][ai] = convertStructToLower(st[i][ai])>
                    <cfelse>
                        <cfset st[i][ai] = st[i][ai]>
                    </cfif>
                </cfloop>
                <cfset stN['#lcase(i)#'] = st[i]>
            <cfelse>
                <cfset stN['#lcase(i)#'] = st[i]>
            </cfif>
        </cfloop>
        <cfreturn stn>
    </cffunction>

As you can see it also handles the case where you have an array of structures inside a structure.

I've tested it with nested structures that contain arrays of structures and it seems to work just fine. Perhaps you will find it useful for any Ajax stuff you are doing.

Happy Coding...

Pushing the Pause Button

As you may have noticed not much has changed on my blog in a while. A couple of entries ago I called it writers block. But it's not really writers block at all.

I have been quite busy at work working on several new software features and working on the 4.0 release. But that isn't the reason why I haven't been blogging nor the reason why I haven't yet managed to do the long overdue upgrade from Blog.CFC to Mango (thats been on my TODO list for about 9 months now).

The simple matter of fact is I have lost the desire. Without getting personal, lets just say that I currently have a lot of stuff going on in my life that makes 'worrying' about posting fresh content to my blog secondary or event tertiary.

Until then... Happy Coding...


Powered By Railo

Subscribe

Subscribe via RSS
Follow garyrgilbert on Twitter Follow me on Twitter
Or, Receive daily updates via email.

Tags

adobe air ajax apple cf community cfml coldfusion examples ext flash flex google javascript jquery max2007 max2008 misc open source programming railo software technology ui

Recent Entries

No recent entries.

Blogroll

An Architect's View
CFSilence
Rey Bango
TalkingTree

Wish List

My Amazon.com Wish List