Skip to main content
Ben Nadel
On User Experience (UX) Design, JavaScript, ColdFusion, Node.js, Life, and Love.
Ben Nadel at cf.Objective() 2017 (Washington, D.C.) with: David Colvin
Ben Nadel at cf.Objective() 2017 (Washington, D.C.) with: David Colvin

Recent Blog Posts by Ben Nadel

Encapsulating Deep Object-Graph Traversal Using A Visitor Function In Lucee CFML 5.3.6.61

The other day, in JavaScript, I wrote some code that required three nested for -loops in order to locate data for consumption. The JavaScript code looked something like this: screens.forEach( ( screen ) => { screen.conversations.forEach( ( conversation ) => { conversation.co... read more »


Mapping Arrays-To-Structs And Structs-To-Arrays Using Mapping Functions In Lucee CFML 5.3.6.61

When mapping one data-set onto another data-set in ColdFusion, we can usually use the built-in .map() functions. This works great when the input and the output data-sets are the same type . But, every now and then, I want to map an Array onto a Struct ; or, a Struct onto an Array ; which i... read more »


isNumeric() And numberFormat() Can Work With Very Large Numbers In Lucee CFML 5.3.6.61

For historical reasons, I'm a bit weary of any kind of numeric value that won't fit into a Signed Integer in ColdFusion. I can't point to specific issues necessarily; but, I know that I've run into errors working with large numbers. That said, yesterday when I was looking at how to implement an in... read more »


Performing An In-Place Natural Sort On An Alpha-Numeric Array In Lucee CFML 5.3.6.61

In the past, I've looked at implementing a "Natural Sort order" in both JavaScipt and ColdFusion . However, my ColdFusion-based approach has always created a new array as part of its algorithm. Most of the time this doesn't matter; however, yesterday at InVision , I ran into a situa... read more »


Using A Closure To "Terminate" CFThread Tags Across Page Requests In Lucee CFML 5.3.6.61

While the CFThread tag has a "terminate" action; and Lucee has a threadTerminate() built-in function (BIF); these two approaches only work within a single page-request - any attempt to terminate a CFThread reference spawned from another page will result in a ColdFusion error. Over... read more »


RequestTimeout Setting Affects CFThread Execution In Lucee CFML 5.3.6.61

Yesterday, when I was exploring task threads in Lucee CFML , I noticed that my long-running CFThread tags were suddenly dying at around 30-seconds of execution time. And, after I poked around in the Lucee Administrator, I noticed that the default request timeout for the server was set to 30-... read more »


Using A Task CFThread To Run And Restart Daemon CFThreads Indefinitely In Lucee CFML 5.3.6.61

The CFThread tag has been one of the most awesome feature-additions to the ColdFusion language, allowing us to seamlessly and effortlessly run asynchronous code in parallel to the main page request. But, the CFThread has always been a kind of "one off" type of processing. And, for yea... read more »


Using Apache POI 3.17 To Save InVision Prototypes As Interactive PowerPoints In Lucee CFML 5.3.6.61

At InVision , I spend a lot of time lurking in our #Support Slack channel, watching all of the questions that get tossed around in hopes that I see something that sparks a moment of inspiration. And, just the other day, I saw one of our Customer Success associates mention that they had a client ... read more »


Using Negative Box-Shadow Spread To Communicate Depth In CSS

Earlier this week, in Episode 17 of the CSS Podcast: Shadows , Adam Argyle made the observation that in the "real world", when you pick an object up off a surface the shadow that forms beneath the object actually shrinks. He then noted that we can better emulate this behavior by using ... read more »


Thinking About Boolean Arguments As A Code-Smell In A Legacy Codebase

To say that Boolean arguments represent some sort of a "code-smell" is not something new or unique. Martin Fowler has a "FlagArgument" article on the topic dating way back to 2011. However, I've been working in a single legacy codebase since about the same time; and I've seen ... read more »


Looking At Different Click-To-Edit Implementations In Angular 9.1.12

At InVision , one of the user experience (UX) patterns that we employ from time-to-time is the "click-to-edit" interaction. This is where the user clicks on a piece of plain-text and, by doing so, enables an "edit form" for said text in the same screen location. Personally, I d... read more »


Copying Slack's Brilliant Virtual Scrollbar And Overflow Container In Angular 9.1.12

The other day, as I was using the Slack chat app at InVision , I happened to notice that the scrollbar in the Channels column is only visible when I'm mousing-over the Channels column. I recently explored the idea of conditionally showing scrollbars on hover in Angular (based on GMail's impl... read more »


Strange Double-Encoding Character Behavior With CFLocation Tag In Lucee CFML 5.3.6.61

Yesterday, I was working with the Craft team at InVision to try and debug a rather odd URL-encoding problem. It seems that the CFLocation tag double-encodes the forward-slash ( / ); but, only when certain combinations of characters are present in the query-string parameter. I've been able to ... read more »


Testing wkhtmltopdf 0.12.6 With Docker In Lucee CFML 5.3.4.80

A few months ago, James Moberg listed out a good number of Command-Line utilities that he uses in ColdFusion . Among them is wkhtmltopdf , which is a tool that can convert HTML and CSS to PDFs using the Qt WebKit rendering engine. Since I've been digging into PDF document generation in Lucee... read more »


Evaluating Database Records That Contain ColdFusion Interpolation Expressions In Adobe ColdFusion 2018

Yesterday, I was talking to Angel Gonzalez about an interesting use-case in ColdFusion - something that I've never personally tried before - evaluating database records that contain ColdFusion Expressions . Specifically, database records that contain String interpolation in which the interpola... read more »


CFDocument Intelligently Reuses Repeated Image Objects In Lucee CFML 5.3.4.80

The other day, I experimented with saving InVision prototypes as interactive PDFs in Lucee CFML . And, while very few people will have an interest in such a technique, it's gotten me thinking a lot about how I might use PDFs more effectively. One thing I started to wonder about is how CFDocumen... read more »


ColdFusion Components (CFC) vs. ColdFusion Closures Performance Exploration In Lucee CFML 5.3.4.80

In the early days of ColdFusion, instantiating ColdFusion Components - CFCs - was pretty expensive. This was due, in part, to the highly dynamic nature of ColdFusion Components which has to be facilitated on top of Java, a significantly less dynamic language. With Lucee CFML, this cost was been l... read more »


The Double-Bang (!!) Operator And A Misunderstanding Of How JavaScript Handles Truthy / Falsy Values

Strictly speaking, there is no "double-bang" operator (or the "double-not" operator) in JavaScript; the ( !! ) notation is really just two "Not Operators" in a row. In languages, like JavaScript, that support Truthy / Falsy values, the double-bang operator can be used... read more »


Applying CSS Flexbox To Pseudo-Elements

The other day, I was listening to Episode 14 of the CSS Podcast: Pseudo Elements , hosted by Una Kravets and Adam Argyle , when Adam said something quite thought-provoking: he mentioned that you can apply CSS Flexbox to pseudo-elements in order to perfectly align icons. I didn't know if we was ... read more »


Using CFDocument To Save InVision Prototypes As Interactive PDFs In Lucee CFML 5.3.4.80

As I talked about in my post yesterday regarding "Dark Matter Designers" , I've been playing around with some more advanced ways to generate PDFs at InVision . One idea that I had recently was to try and save one of our interactive prototypes as an interactive PDF . Meaning, a PDF ... read more »


Are There "Dark Matter" Designers?

In the engineering world, people like Scott Hanselman , Ward Bell , and John Papa sometimes talk about a cohort of developers that they call, " Dark Matter Developers ". As Hanselmen described them 8-years ago, these dark matter developers: ... don't read a lot of blogs, they ne... read more »


Using CFDocument And CFPDF To Generate PDFs With Different-Sized Pages In Lucee CFML 5.3.6.61

When you use the CFDocument tag to generate a PDF in ColdFusion, you define the page-size on the root of the document. Which means, every page in the generated PDF uses the same size page. But, what if you wanted to generate a PDF in which each page (or related set of pages) needs a custom, conte... read more »


Using A Tracer Cookie To Watch For Browser Download-Prompts In Lucee CFML 5.3.6.61

Yesterday, I was working on some report-generation for InVision that used Content-Disposition: attachment in order to prompt the user to save the generated content. My current approach is just to initiate the download in a new tab, which the browser automatically closes once the report has been... read more »


Scope Traversal Behavior With Undefined Function Arguments In Lucee CFML 5.3.6.61

Just now, as I was looking at iterating over Structs using CFLoop in Lucee CFML , I ran into a fun little behavior of the ColdFusion language: Scope traversal will skip-over undefined function arguments and access like-named values in higher-up scopes. At first, this feels like a bug. But, I... read more »


Struct Iteration With CFLoop Exposes Both Key And Value In Lucee CFML 5.3.6.61

Back in February, when I was having lunch with Gert Franz , co-creator of Lucee CFML, we were commiserating on how amazing ColdFusion is. At that lunch, Gert told me about some of the great things that Lucee CFML offers, like its seamless support for ColdFusion Tags in CFScript . Another minor ... read more »


Proxying Amazon AWS S3 Pre-Signed-URL Uploads Using CFHTTP And Lucee CFML 5.3.6.61

At InVision , when a user goes to upload a screen for an interactive prototype, we have the browser upload the file directly to S3 using a pre-signed URL . We've been using this technique for years and it's worked perfectly well. However, we now have an Enterprise client whose network is blocking... read more »


Returning CFQuery / Query Results As Structs In Lucee 5.3.6.61

A few months ago, I looked at returning CFQuery results as an Array in Lucee CFML ; and, in the comments of that post, Gert Franz pointed out that Lucee could also return CFQuery results as a Struct in which a given column would be used as the look-up key in said Struct. Mapping a query ... read more »


Every Line Of Code That You Write Is An Explicit Decision To Make The Application Better Or Worse

CAUTION: This post is a very soap-boxy. The other day, I was watching the new Hannah Gadsby comedy special (which is great, by the way), when something she said about Art got me thinking about Programming. She was pointing out that every aspect of a painting reflected an explicit decis... read more »


Using UPDATE + ORDER BY + LIMIT To Drive Multi-Worker Migrations In Lucee CFML 5.3.6.61

Earlier this week, I took a look at using ORDER BY and LIMIT clauses within an UPDATE statement in MySQL 5.6.37 in order to limit the scope of the data-mutation. In that post, I said that such a technique can be used to drive a multi-worker / multi-threaded migration in which each worker &q... read more »


You Can Use ORDER BY And LIMIT Within UPDATE And DELETE Statements In MySQL 5.6.37

Continuing with the database-theme of the week , I wanted to share one piece of wisdom that I learned from our former director of Data, Brad Brewer . He taught me that you can use the ORDER BY and LIMIT clauses inside both UPDATE and DELETE SQL statements within MySQL 5.6. While I wouldn'... read more »