Sunday, 23 November 2014

Weekend quiz: Dave's answer (Python)

G'day:
I'm continuing to look at each person's submissions for the quiz ("Something for the weekend? A wee code quiz (in CFML, PHP, anything really...)").

Dave's done a Python version. Like Chris just before him, Dave got his answer in before I varied the rules slightly, so his answer just finds the first longest subseries within the threshold from within the series; it does not check same-lengthed subseries for which has the highest within-threshold total. "Within" three times in a sentence. Sorry about that.

Saturday, 22 November 2014

The Adobe ColdFusion Team are doing a bloody good job at the moment

G'day:
I know I am the first (and loudest, and most repetitive...) to whinge about Adobe's ColdFusion lads (/ladesses), but... fair's fair... there's very bloody little to complain about at the moment.

My answer to a question on Stack Overflow about DI

G'day:
I'm re-posting this here, hoping to get feedback from the DI doyens like Sean, Brad and Luis. Plus it's an easy article to post whilst I get together my article about Dave's Python code (from the quiz: "Something for the weekend? A wee code quiz (in CFML, PHP, anything really...)").

The question is here: "Dependency injection is only for testing?", and I'll reproduce it here (I'll ask the OP if this is OK, and remove/summarise if not):

Friday, 21 November 2014

PHP: a survey about date data handling

G'day:
I'm just going to regurgitate the intro paragraph to the survey (https://www.surveymonkey.com/r/XV9ZP8W) here:

I'm in the process of teaching myself PHP, having come from a CFML background. One topic that came up in conversation yesterday was how to store dates in memory (ie: in a variable). In CFML we'd use a date object. It seems in PHP there are a number of common options: using an integer in the guise of a "Unix timestamp" or using a DateTime object being two options. I'm just wondering what people tend to do here.

Thursday, 20 November 2014

Railo "unexpected" behaviour: opinions solicited

G'day:
This will be one of those really quick ones as I have precisely 19min of lunchtime left to write it.

Ryan Guill found some oddness with Railo yesterday, with code like this:

function tikiOtinga(required string s required numeric i){
    writeDump(arguments);
}

(his example wasn't in Maori, but hey).

Can you spot what's wrong with it?

Weekend quiz: ChrisG's answer (CFML)

G'day:
OK, now I'm gonna look at each person's submissions for the quiz ("Something for the weekend? A wee code quiz (in CFML, PHP, anything really...)").

Chris has done a CFML version. He was very quick off the mark, and had his submission in before I varied the rules, so this one just solves the initial challenge which is to find the longest subseries within a given threshold, but does not consider equal-length longest subseries. Fair enough.

Tuesday, 18 November 2014

What should CFML's deleteAt() method return?

G'day:
This will be quick, as I'm out of time before I'm due to start work.

As I mentioned in my earlier article ("Weekend quiz: my answer (CFML version)"), Railo's (and ColdFusion's for that matter) Array.deleteAt() method returns a pointless boolean, rather than something useful. What do you think it should return?