Friday, 28 February 2014

ColdFusion 11: <cfhtmltopdf> is pretty good!

G'day:
I had a bit of a false start with getting cfhtmltopdf() working (see article "ColdFusion 11: cfhtmltopdf() a non-starter. Literally"), but that turned out to be an installer problem, rather than anything wrong with the functionality itself. Once I got it going, I gotta say I'm pretty impressed.

ColdFusion 11: undocumented new feature regarding <cfprocessingdirective>

G'day:
I can't see this documented anywhere, other than as a passing comment in the bug tracker, so I figured I'd mention it here.

ColdFusion 11: Adobe listening to their clients

G'day (from London again now):
Earlier in the week I wrote an article "ColdFusion 11: lists and arrays and empty elements and weird ways to fix stuff", which commented on some poor logic / common sense behind the way Adobe had chosen to fix an issue around how the application setting this.sameFormFieldsAsArray works, in that the array it creates ignores empty form values.

Tuesday, 25 February 2014

ColdFusion 11: <cfhtmltopdf> a non-starter. Literally

Update

This sorted itself out after two de-/re-installs. None of which showed any errors, but only the last one installed the PDF stuff. Unimpressed.

G'day:
This might be me doing something wrong, or a known issue or something, but I can't get <cfhtmltopdf> to work. Which is annoying because for once in my CF career... I actually need to generate some PDFs. Today. Right now.

ColdFusion 11: .map() and .reduce()

G'day:
More ColdFusion 11 testing. This time I look at the new .map() and .reduce() methods that each of array, struct and lists now have. It's mostly good news.

ColdFusion 11: lists and arrays and empty elements and weird ways to fix stuff

G'day:
Someone has asked me to draw attention to this issue (3560964), as they are dissatisfied with the way Adobe have handled it. Personally, I'm ambivalent, but err more towards the community members' positions than Adobe's. The detail of the ticket boils down to this:

Prior to CF10 to turn a repeated form element into an array we used getPageContext().getRequest().getParameterMap().

This worked smoothly this feature was replaced in CF10 with the application flag:
<cfset This.sameFormFieldsAsArray = true> This works nice except it removes empty elements. getPageContext()...getParamterMap() now returns an empty struct.

ColdFusion 11: query column types preserved when serialising to JSON, eh?

G'day:
I'm playing catch-up with the comments on the blog, and one of said comments from Roberto Marzialetti got me looking at an old article: "ColdFusion vs JSON. How to make a developer cry". In this article I mooted an alteration to how ColdFusion serialises query data so as to preserve the column types. This is critical with queries because CFML operations on this data such as QoQ is type-sensitive. So we need the data type.

Monday, 24 February 2014

Five-tagger? what n-tagger am I?

G'day:
Kev wrote an interesting article today: "Software Craftsmanship – for CFML Developers Part Six – Interlude – Passion", and I extracted a pleasing quote from it:

If you’re just a 9-5er and/or a 5 tagger [...] then do the rest of us a favour and F**K off

I needed the reorder those two clauses, but it does not alter the sentiment of the paragraph I extracted it from.

Breaking out of an each() loop

G'day:
I'm just soliciting opinions here. I'll raise a ticket for it anyhow, but let's see what people think.

ColdFusion 11: a lot of string member functions have not been implemented

G'day:
I was writing some scratch code today to parse some strings, and I tried to do this:

matches = myString.reMatch(regex);

And this didn't work. For some reason, Adobe have not implemented it.

So I've just been through all the functions that act on strings, and checked whether Adobe have bothered to implement member functions for them.

Sunday, 23 February 2014

ColdFusion 11: preserveCaseForStructKey

G'day:
There's a new feature in ColdFusion 11:

Case preservation of struct keys

Currently, the cases for struct keys are not preserved in ColdFusion. The struct keys get converted to upper case automatically.
[...]
To enable case preservation of struct keys at the application level, modify the application.cfc file by setting:
this.serialization.preservecaseforstructkey = true

On a whim, I decided to check how well this had been implemented...

ColdFusion 11: member functions implementations and suggestions

G'day:
Enough of the rhetoric, here's some code. I'm having a look at the new member functions in ColdFusion 11 today. And have some samples, observations and suggestions.

Saturday, 22 February 2014

ColdFusion: Fixing any bug has backwards compatibility concerns

G'day:
I'm going to bang on about isValid() and integers some more. You've been warned.

Right, so I was horrified to see that this is the case in ColdFusion:

isValid("integer", "$,1,2,$,2352345,$"): YES

And, what's more, having used ColdFusion to establish that $,1,2,$,2352345,$ is in fact an integer, if I then try to use it as an integer, ColdFusion breaks. At least it gets this half right. I discuss this at undue length in "Can we please agree that Adobe is not the arbitor of what constitutes an integer?".

Good old Rupesh poked his head above the parapet briefly, and offered a better response than one might expect here:

Avatar




There is no doubt that this behavior is incorrect. It is obviously wrong and it should be corrected. However, it has been like this forever and making such a fundamental change has a great potential to break a lot of applications. We dont want to do that in this release. As Rakshith has already communicated, we plan to take up such changes in 'Dazzle' where we will correct the behavior without worrying about backward compatibility.

This is an improvement over his earlier comment on the topic:

  • Rupesh Kumar
    2:53:06 AM GMT+00:00 Apr 24, 2012
    This has always been the behavior and changing this would result in backward compatibility issue. It will not be fixed.

There's a fundamental error in Rupesh's internal logic here. To suggest that fixing a bug somehow has backwards compatibility issues is utterly specious.

Intrinsically "a bug" causes some manner of behaviour to occur. It's a bug because the behaviour is incorrect. And, intrinsically, if a bug is fixed, it is implicit that the previous behaviour will change. That's the entire reason for fixing the bug: to replace incorrect behaviour with correct behaviour. So, on the face of it (and this is why I say his position is specious, not simply out and out frickin' stupid... although it is also that), this creates a backwards compatibility consideration. Because the new (correct) behaviour will be different from old (incorrect) behaviour.

But this is the nature of fixing bugs. The behaviour of the buggy functionality changes because it becomes "not buggy". If we were to clamour "backwards compatibility!" each time we considered fixing a bug... no bugs could ever possibly be fixed. And clearly we do fix bugs (obviously). So "backwards compatibility" is not grounds for not fixing bugs. Because it is not actually a valid consideration.

CFML: Feature toggling for both Railo(/Lucee) and ColdFusion

G'day:
I'm just drawing attention to part of the bottom line of my previous article ("Expressions and operators and doing weird shit"), as I think it's a significant feature request for both Railo and ColdFusion.

I've suggested both Railo (RAILO-2926) and ColdFusion (3712059) should implement a feature toggling system. This would resolve issues both platforms have with cross-compatibility and backwards-compatibility.

There are a few things recently that I've raised with both companies and the response has been "be that as it may... we can't do it due to backwards compat" (to be fair to Railo they are far less emphatic about this, and usually consider how else to approach things; in Adobe's case it's just their favourite mantra when they don't feel like fixing something, I think).

The degree of validity of the compatibility issues is one thing, but it is a real consideration. However I want Adobe to stop wallowing in the past, and I want Railo to not have to wallow alongside them for the sake of cross-compatibility. Plus there's some own-goal issues with some Railo code too.

What I think both need is a feature toggling system which can be applied to a feature meaning that by default a new backwards-incompat fix will work for everyone for whom there isn't a backwards compat issue (which, let's face it, will generally be most people, for any given issue). However to preserve the sanity of people whose code is impacted by these fixes and just toggle them off until they get around to updating their code to not rely on broken CFML behaviour.

I'm so fed up with some of the inertia we're seeing in CFML that something needs to be done. And especially for ColdFusion... now's the time, given we're in the dev phase of ColdFusion 11.

As always... thoughts / comments?

I think I need to do one more gripe about integers, but then I can crack on with looking at new stuff in ColdFusion 11. I'm still finding good stuff! :-)

--
Adam

CFML: Expressions and operators and doing weird s***

G'day:
I want to just return to the topic I touched on here briefly the other day in the article "ColdFusion 11: good stuff", and discussed more thoroughly on the Railo Google Group as "Probable bug in null-coalescing operator". I have moved my opinion here from "probable bug" to "definite bug". And the buggy behaviour relating to this extends further, and into both Railo and ColdFusion.

My contention is that Railo have implemented the null-coalescing operator (tritely referred to as the "Elvis operator" by some. Spare me) slightly incorrectly, as it confuses the notions of "null" and "non-existent" which are two distinct concepts. Also, in implementing this "non-existence-coalescing operator", it's done some rather fishy things in the process.

All of this has also now found its way into ColdFusion 11, unfortunately.

Friday, 21 February 2014

ColdFusion 11: queryExecute()

G'day:
No ifs or buts this time... Adobe dun good with a new feature in ColdFusion 11: queryExecute().

Can we please agree that Adobe is not the arbitor of what constitutes an integer?

G'day:
My... what a lot of ColdFusion chatter this is at the moment. It's bloody good I'm on holiday at the moment so I can keep up with it (and... erm... instigate some of it... ;-).

But for this article / gripe session, I want to reiterate an old article I wrote about integers. And ire.

Thursday, 20 February 2014

Completely off topic: this is the state of spam

G'day
A slightly lighter moment. I just had this land in the "is this legit?" box in my blog's moderation queue:

ColdFusion 11: good stuff

G'day (again!):
But it's not all bad. Some of the things I've looked at so far have worked well.

Wednesday, 19 February 2014

ColdFusion 11: preventing files from being included? WTF, Adobe?

G'day:
This is a follow-on from my earlier article "ColdFusion 11: first bug. Bad bug.". I'm writing it up separately here as it's a slightly different issue, worth discussion.

That previous issue cropped up because I was trying to run my TestBox regression tests on ColdFusion 11, and somewhere under the hood TestBox includes (via <cfinclude>) some JS and CSS files. This is not an uncommon practice (more common with JS than CSS, that said), and a handy way of writing out JS at request time. This is necessary sometimes to "pass" server-homed data to JS code, before running the rest of the JS out of .js files, executed on the browser via script tags.

I also know of one application that uses this to good effect generating dynamic .doc files, wherein the doc template is saved in XML format, and by including the file, runtime CFML expressions are processed into the resulting .doc file. This is really pretty cool.

Adobe in their infinitesimal wisdom have decided to prevent this functionality by default. Yeah, now out of the box ColdFusion 11 will only allow the inclusion of CFML and HTML files. Why? They cite "for security reasons". Here's a quote (posted in the bugtracker, originally from the pre-release forums):

"Vamseekrishna Manneboina: Yes, this was done as part of a security measure. You can now only include CFM/CFML files by default. You can specify additional extensions via a property called allowedextforinclude in neo-runtime.xml. By default, HTM and HTML file extensions are already added to this list/property, thereby allowing for inclusion of HTM and HTML files too by default."
(Note: this was changed to compileextforinclude, by the time ColdFusion 11 was actually released).

Not to put too fine a point on it, but... Vamsee... what the hell are you on about? What security measure? What security are you protecting against here? What's the use case?

ColdFusion 11: @cfmlnotifier feeds updated

G'day:
(yeah, you're going to get a battering from me today). I've updated the @cfmlnotifier feed to report the following on ColdFusion 11 bugs:

ColdFusion 11: first bug. Bad bug.

G'day:
Well that didn't take long.

One can no longer <cfinclude> any sort of file except a CFML file. EG:

<cfinclude template="junk.js">

This yields:

Invalid template junk.js provided for CFINCLUDE tag.

CFINCLUDE tag only supports including ColdFusion templates.
The error occurred inC:/apps/adobe/ColdFusion/11beta/gettingstarted/cfusion/wwwroot/shared/misc/junk/junk.cfm: line 1
1 : <cfinclude template="junk.js">

ColdFusion 11: "Getting Started Server"

G'day:
The first seemingly good thing that ColdFusion 11 offers is a "Getting Started Server", which is an installation-free version of ColdFusion server. It's just a zip file.

I'm downloading it now (it's still 282MB, but that's much smaller than the 597MB for the full installer)...

ColdFusion 11 has gone public beta...

G'day:
Just quickly... I have nothing really to report on this yet, but this is just a heads-up: ColdFusion 11 has just gone beta, and is available to download from Adobe: "Download Adobe ColdFusion Project Splendor and ColdFusion Builder Project Thunder".

The first ingteresting thing... there is a separate "getting started" install, which is just a zip file. Hopefully it's equivalent to Railo / OpenBD's express install, which is simply a matter of unzipping and running. I'm downloading it now, so will report back soon.

I am gonna start hammering it as soon as I can get it installed, and will report back with any meritworthy findings.

Stay tuned.

--
Adam

TestBox, BDD-style tests, Railo member functions and bugs therein

G'day:
One of the promised features of ColdFusion 11 is to bring "member functions" to ColdFusion's inbuilt data types. Railo's already had a good go at doing this, and has reasonably good coverage. See "Member Functions" for details.

One concern I have is whether ColdFusion 11 will implement these the same way as Railo already has. I mean... they should do, there's not much wriggle room, but who knows. If there's a way to do it wrong, I'm sure Adobe can find it. With that in mind, I want to be able to run through some regression/transgression tests on both systems once ColdFusion 11 goes beta, so in prep for that, today I knocked out some unit tests for all the struct member functions.

What I did is to go into the ColdFusion 10 docs, go to the "Structure functions" section (to remind me what all the functions were), and write unit tests for the whole lot. I used the ColdFusion docs rather than the Railo ones because the CF10 docs are more comprehensive than Railo's (this is an indictment of Railo's docs, not a recommendation for the ColdFusion ones, btw!), plus I wanted to make sure I covered any functions Railo might have overlooked.

To make this more interesting (because, let's face it, it's not an interesting task; either to undertake, write up, or for you to read about!), I decided to have a look at TestBox's BDD-inspired testing syntax. The short version of this side of things is that I rather like this new syntax.  I don't think it's got anything to do with BDD (which is an approach to documentation and test design, not a syntax model), but it's interesting anyhow.

Anyway, stand-by for a raft of code (there's a Gist of this too: Struct.cfc):

Tuesday, 18 February 2014

ColdFusion-UI-the-Right-Way: <cfajaxproxy>

G'day:
I've just finished another "chapter" on ColdFusion UI the Right Way, this time a quick treatment of <cfajaxproxy>. Once again, I'll repeat it here for the sake of a) promoting CFUItRW; b) adding content to the blog / Google ;-)

I might not be, but Gavin is...

G'day:
A few days back I got a bit shouty about not being a dead CF installer storage facility: "Things I am not...".

Gavin, who is a much nicer person than I am, has - instead of just complaining about stuff like I do - done something about it, as detailed here: "CFML Server - A Different type of ColdFusion Repo - ColdFusion Installs". Gavin has created an online repository (via copy.com), of old ColdFusion installer files. He's got a range of installs for various versions back to ColdFusion 5, as well as a mix of operating systems and bitness (what's the technical term to describe the concept like "32-bit" or "64-bit"?) of the OS architecture.

Slow news day & Adobe charging twice for CFML features

G'day:
You'll be pleased to know that Brendon McCullum got his 300 runs, becoming New Zealand's highest scorer for an innings, finally falling on 302. New Zealand declared on 680, which is their highest innings score in test cricket. We now have 56 overs to bowl India out to win the match. Which is seeming possibly on the cards as they are already 28/2: "McCullum, Neesham bat India out".

Increasingly the news media is relying on Twitter banality for its news content, and - whilst not a news organ - I don't see why I should be any different. So today's article is brought to you via a comment on Twitter.


James raises a very good point, and one I've been meaning to comment on for a coupla months now. Adobe are currently working through their bug backlog, and a lot of bugs are being fixed, with the comment of "this will be available in the next major release of ColdFusion" (ie: ColdFusion 11). That has a veneer of good news about it, but let's stop to think about this.

ColdFusion 9 and ColdFusion 10 are the current versions of ColdFusion. They are both still within their standard support phase (ColdFusion 9 until 31/12/2014, and 10 until 16/5/2017. Ref: "Adobe products and Enterprise Technical Support periods covered under the new Lifecycle Policy").

Monday, 17 February 2014

Railo bug? Or ColdFusion bug...

G'day:
I've had a bit of a break, as you will have noticed. I'm now sitting in my folks' place in Auckland, watching the cricket with me dad. New Zealand are desperately trying to salvage the match against India from certain loss. Currently NZ is on 363/5, with McCullum (183*) and Watling (92*) being the last real line of defence against India. NZ only lead by 118. We kinda need a lead of 250 to not lose (India have another innings yet, and there's still a day and a half to go). We're definitely not gonna win, but we might be able to eke out a draw.

I know hardly any of that will mean anything to most of my readers. However cricket represents "summer" to me.

But enough of the waffle.

Segue alert. One of the most noted wafflers in the CFML community - Scott Stroz - discovered some interesting behaviour when we was migrating some code from ColdFusion to Railo, and initially suspected a bug in Railo. I've had a closer look, and I think it's more likely a bug in ColdFusion, with the behavioural difference with Railo being that it doesn't have the bug. However I'm only 90% convinced of this. Here's the deal...

Wednesday, 12 February 2014

Things I am not...

G'day:
Just quickly. Whilst I might have various old ColdFusion installers lying around, I am not a download service for complete strangers who didn't think to keep hold of their own software.

When it was one person once in a blue moon who needed help with this sort of thing, it was no problem. But I've had two complete strangers in the last 48hrs ask me for various CF installer files, so am making a policy decision that the answer is automatically "no" if you're thinking of asking me for a ColdFusion installer file. NB: to the two bods who asked for help... I'm not having a go at you: it was a reasonable question to ask.

I can only suggest you post a question on the Adobe ColdFusion forums, or contact Adobe, or ask on Twitter or something.

Cheers.

--
Adam

Installing and Configuring Apache 2.2, Tomcat 6.0, and Open BlueDragon on Windows 2003 Server

G'day:
This is one of the articles I referred to yesterday in my "ColdFusion 9 on Windows 8" article. It was no longer online, and I was only able to find it by searching the Internet Archive. I thought it was a shame to have such useful information consigned to - basically - the rubbish heap, so I asked Matt Woodward if I could reproduce it. He's said I can, so here it is. Thanks to Matt for letting me re-post it here.


Note: the images are missing, and I can't guarantee all the links work. The content of the article is unchanged, however I have removed all the styling, and re-applied different mark-up in places. Just so the page doesn't break.

ColdFusion 9 on Windows 8

G'day:
I'm about to pop down to NZ for a coupla weeks to see me folks and make sure they're all still in working order and the like. And drink beer with my NZ-based mates. As part of this, I've retired my old Netbook, and have bought myself a new cheapish laptop (or an "ultrabook" as apparently they are being fashioned, these days) as its replacement. The reason I had the netbook is that the battery life was excellent, which was very handy on long-haul flights, plus it was a handy size for using on aircraft and when lurking in airport terminals. Which I do frequently enough for that to be a consideration. Anyway, this new thing has Windows 8 on it, and I spent Fri eveing and Saturday morning setting it up. Which went fine until I needed to install ColdFusion 9.

Thursday, 6 February 2014

ColdFusion-UI-the-Right-Way: <cfchart>

G'day:
Yay. I've finally participated in an open source project on Github. I've done a "chapter" on "ColdFusion UI the Right Way", covering <cfchart>. Well: using ZingCharts directly instead of <cfchart>. An easy win for me for today's article is to repeat the chapter here.

Wednesday, 5 February 2014

Waitangi Day again

G'day:
It's Waitangi Day again,(in NZ, anyhow... it's still the day before here in the UK) so here's some fluff about New Zealand.


This is a Kiwi:

Kiwi

So is this:

Self

And this:

Gavin
And so - apparently - is this:

Kai

Although I'm not so sure about that last one.

Tuesday, 4 February 2014

Cheers lads

G'day:
I'm making a blog article out of this because I can't fit it into 140 chars, and I don't want it to solely be buried on a comment on their own blog.

If you didn't know, or had managed to ignore it, the lads @ CFHour, Scott and Dave, took exception to something I wrote a coupla weeks back, "CFML: where Railo is better than ColdFusion", and had "a bit" of a rant in their recent podcast "Show #207 - Ryno, Rocks, Railo Rants, and Scott (Box)". I thought their tone was perhaps a bit more intense than it needed to be, and some other people have said the same.

TBH, I don't mind. I'm a big boy, and I simply don't take offence at stuff. They're entitled to their opinion, even if I don't happen to agree with it. For the record: no, I don't agree with pretty much everything they said, however I do see where they were coming from. That said, there was never any anguish or angst between us: I was talking to Dave about tickets in the bug tracker shortly afterwards, and was in touch with Scott yesterday too. I consider them my mates, so they can say what they like at me.

Monday, 3 February 2014

Now, children...

... stop it.

CFML: All shouty and bitey... and it's not even me doing it!

G'day:
Scott and Dave (albeit: mostly Scott) from CFHour have a nice tirade in response to my recent article "CFML: where Railo is better than ColdFusion" this week: "Show #207 - Ryno, Rocks, Railo Rants, and Scott (Box)".

It's worth listening to (having first fast forwarded to about the 6m30s mark where the actual content starts; and the shouty bit about 5min after that) in conjunction with what I said in my article.

I'll not comment further as I believe their work stands on its own merit.

--
Adam