Ben Nadel
On User Experience (UX) Design, JavaScript, ColdFusion, Node.js, Life, and Love.
I am the chief technical officer at InVision App, Inc - a prototyping and collaboration platform for designers, built by designers. I also rock out in JavaScript and ColdFusion 24x7.
Meanwhile on Twitter
Loading latest tweet...
Ben Nadel at cf.Objective() 2012 (Minneapolis, MN) with:

Recent Blog Posts by Ben Nadel

Creating Signed Java Byte Values Using ColdFusion Numbers

By Ben Nadel on October 1, 2014
Tags: ColdFusion

For the last two days, I've been baffled as to why I couldn't create a Byte from 8 bits. After much head-banging, I discovered that Java bytes are signed. This means that the 8th bit doesn't represent 128, but rather -128. In ColdFusion, bit-wise functions (such as bitAnd() and bitOr()) return long... read more »

Providing Environment Variables When Executing Node.js Program

By Ben Nadel on September 26, 2014

Lately, I've been trying to wrap my head around Node.js streams by reading through the Node.js source code. In the latest branch, I noticed that there were a lot of calls to debug(). And, when I looked at the source code for debug(), I noticed that it only ran when the environmental variables dicta... read more »

Using Base32 Encoding And Decoding In ColdFusion

By Ben Nadel on September 26, 2014
Tags: ColdFusion

Earlier this week, I looked at converting a binary value into a "bit stream" that would allow for sub-byte reads . I did this because I was trying to figure out how to run Base32 encoding in ColdFusion, which requires splitting binary data up into 5-bit chunks. This was a surprisingly complicated ... read more »

Converting A Byte Array Into A Bit Stream Using ColdFusion And BigInteger

By Ben Nadel on September 24, 2014
Tags: ColdFusion

The other day, I was faced with a situation where I had to split a set of bytes up into smaller sets of bits (smaller than the 8 bits that go into a byte). I was definitely stumped. Not only have I never done this before but, my understanding of bits (especially signed-bits) is rather weak. After s... read more »

Uploading And Sending MMS (Multimedia Messaging Service) Messages With Twilio And ColdFusion

By Ben Nadel on September 19, 2014
Tags: ColdFusion

Last year, I blogged about sending MMS (Multimedia Messaging Service) messages using the Twilio API . However, at the time, Twilio only supported MMS messages on Canadian phone numbers and US short-codes (ie, those 5-digit phone numbers). Yesterday, however, Twilio finally announced full MMS suppo... read more »

You Can Reference Your Derived SELECT Columns In Your ORDER BY Clause In SQL

By Ben Nadel on September 17, 2014
Tags: ColdFusion, SQL

Sometimes, nothing gets me more excited than a well-crafted SQL statement (what can I say, I'm a cheap date). I also love cleaning up and [hopefully] optimizing queries. One thing that I see from time-to-time is someone executing duplicate calculations (typically aggregates such at COUNT) in both t... read more »

EventEmitter Invokes Event Callbacks In The Context Of The EventEmitter Instance In Node.js

By Ben Nadel on September 16, 2014

This is a small but powerful Node.js feature. When you bind an event handler to an EventEmitter instance (or a sub-class instance such as Readable Stream), that callback gets invoked in the context of that EventEmitter instance. This means that, unless you are explicitly overriding the context with... read more »

Buffer.slice() Won't Error On Out-Of-Bounds Indices In Node.js

By Ben Nadel on September 16, 2014

Yesterday, when I was looking at streaming cached Buffers into HTTP responses in Node.js , I discovered something rather useful - Buffer.slice() won't throw errors when you attempt to slice beyond the bounds of the Buffer. This makes iterating over the Buffer more straightforward as you can iterat... read more »

Turning Buffers Into Readable Streams In Node.js

By Ben Nadel on September 15, 2014

So far, I've been digging deep into error handling in Node.js streams , trying to build a more robust mental mode. And, as I've done that, I've mostly created streams that were completely self-contained in terms of "state". As a new experiment, I wanted to look at creating a Node.js stream that ha... read more »

Be Careful About Launching Asynchronous Tasks Inside CFTransaction In ColdFusion

By Ben Nadel on September 8, 2014
Tags: ColdFusion

The other day, I was trying to track down inconsistent behavior in some ColdFusion code. Sometimes it would run properly; other times it would fail. At first, the issue wasn't entirely obvious. But, after digging into the workflow, I realized that it was a transaction race-condition in which an asy... read more »

How Error Events Affect Piped Streams In Node.js

By Ben Nadel on September 3, 2014

Over the weekend, I demonstrated that "error" events don't have any inherent affect on how individual Streams work in Node.js . In that post, I stressed that I was talking about "individual" streams because multi-stream workflows, that use .pipe(), are somewhat affected by "error" events. The "err... read more »

Error Events Don't Inherently Stop Streams In Node.js

By Ben Nadel on September 1, 2014

Perhaps another basic Stream post for some of you, but I'm still trying to flesh out my own mental model of how streams work in Node.js. One thing that wasn't immediately clear to me was how Streams interacted with errors. Part of the problem is that I didn't know how to reconcile .pipe() behavior ... read more »

Node.js Streams Inherit Error-Handling Behavior From EventEmitter

By Ben Nadel on August 31, 2014

I started digging into Node.js recently as a means to understand why my Gulp.js build script wasn't working. This lead me down a rabbit hole of exploration into Streams in Node.js and, more specifically, into how streams handle errors. And, while this may be obvious to most Node.js developers, it... read more »

Bind Your Error Handler Before Your Readable Handler When Using Node.js Streams

By Ben Nadel on August 31, 2014

If you've been using Node.js for a while, streams are probably second nature to you; but, for me, streams have proven to be quite a hurdle with many facets that don't seem immediately obvious. One such concept that recently tripped me up was the importance of binding your "error" event handler befo... read more »

The User Experience (UX) Of Custom Scrollbars

By Ben Nadel on August 26, 2014

Since the beginning of time (or thereabouts), browsers have provided a native way to define a scrollable viewport for content. They're not the most beautiful things; but, they work really well, they're super easy to implement, and everyone knows exactly how to use them. When you build a custom scro... read more »

Creating A Reusable Timer In AngularJS

By Ben Nadel on August 25, 2014

In my AngularJS applications, I want my controllers to respond to events. But, often times, I don't necessarily want the controller to react to every single event; rather, I'd like to throttle those events such that closely timed events trigger only one reaction. After implementing this logic a goo... read more »

ColdFusion Per-Application Datasources Don't Work In The OnApplicationEnd() Event Handler

By Ben Nadel on August 19, 2014
Tags: ColdFusion

After yesterday's blog post about the limitations of the onApplicationEnd() event handler in ColdFusion , I wanted to see if the per-application datasources fell pray to the same problem. Long story short, they do. And, while I haven't tested all of the options, it is becoming clear to me that non... read more »

ColdFusion Per-Application Mappings Don't Work In The OnApplicationEnd() Event Handler

By Ben Nadel on August 18, 2014
Tags: ColdFusion

The ColdFusion application framework provides hooks into the full application and session life-cycles; but, to be honest, I hardly ever use the onSessionEnd() or onApplicationEnd() event handlers. This inexperience came to light the other day when I went to clean up data in the onApplicationEnd()... read more »

Looking At Nested Event Timing And DOM Structure In AngularJS

By Ben Nadel on August 11, 2014

In AngularJS, the DOM (Document Object Model) responds, so to speak, to changes in the view-model (VM) as defined by the Controllers. But, the Controllers don't directly control the DOM; in fact, the Controller aren't supposed to know about the DOM. This is a clean separation of responsibilities; b... read more »

MySQL GROUP_CONCAT() Has Buggy Interaction With UNION Clauses

By Ben Nadel on August 9, 2014
Tags: ColdFusion, SQL

So, earlier this week, I blogged about the unfortunate way in which MySQL's GROUP_CONCAT() function will fail silently when you hit its size limit . Well, it turns out that GROUP_CONCAT() is even more unfortunate. After some testing, it looks like GROUP_CONCAT() fails even harder (and more mysteri... read more »

MySQL GROUP_CONCAT() Fails Silently When It Hits Its Size Limit

By Ben Nadel on August 7, 2014
Tags: ColdFusion, SQL

The other day, we ran into interesting little problem. We were using MySQL's GROUP_CONCAT() function to turn an aggregate list into a comma-delimited list. But things weren't working. No errors - just confusing behavior. After logging a lot of output, we realized that the GROUP_CONCAT() function wa... read more »

Normalizing HTTP Header Values Using CFHttp And ColdFusion

By Ben Nadel on August 5, 2014
Tags: ColdFusion

Last week, Saravana Muthu point out that my Sticky CDN project (a content delivery network for local development environments) couldn't handle complex values in HTTP request header responses. To be honest, in all the years that I've been rocking out in ColdFusion, I never noticed that header va... read more »

Parsing Http Time Strings With ParseDateTime() In ColdFusion

By Ben Nadel on August 4, 2014
Tags: ColdFusion

This is a super minor post; but, last week, when I was working on Sticky CDN, I remembered that the parseDateTime() function, in ColdFusion, could parse the date/time strings commonly used in HTTP headers. parseDateTime() won't take the timezone information into account; but, it will parse the date... read more »

Less CSS, Relative Paths, Nested Quotes, Url() Constructs, And Post-Processing

By Ben Nadel on August 1, 2014
Tags: HTML / CSS

This is a really tiny post, but it's something that had our team baffled for weeks. We were using an older version of RetinaJS which defined an .at2x() mixin for inserting media-query rules for retina-sized images. Everything was working great until we upgraded our Less CSS compilers; then, every... read more »

Sticky CDN - A Content Delivery Network (CDN) For Your Local Development Environment

By Ben Nadel on July 31, 2014
Tags: ColdFusion

So, last week, I had an itch to create a content delivery network (CDN) for my local development environment. I was able to get something working in a few hours; but it looked junky and I've since spent the last few mornings refactoring it into something that feels a little bit more elegant. I pres... read more »

Cloning RegExp (Regular Expression) Objects In JavaScript

By Ben Nadel on July 24, 2014

This morning, Mathrick pointed out that the RegExp-cloning approach in my Node.js Transform Streams exploration was fairly inadequate. While it wasn't the focus of the blog post (it was about Node.js streams), he was 100% right - my approach only worked coincidentally with my input. And, as some... read more »

Node.js Transform Streams vs. Through2 Streams

By Ben Nadel on July 22, 2014

As I've been trying to get my Gulp.js build script to work, I've found it necessary to dip down into Node.js and learn about streams. According to the Gulp.js documentation, all Gulps.js plugins are Transform streams, running in "Object Mode," that accepts and emit vinyl File objects. Furthermore, ... read more »

My First Look At Streams In Node.js

By Ben Nadel on July 21, 2014

Last week, I started to look into Gulp.js as a possible build-system. It seems really cool; but, I immediately felt the pain of not understanding Node.js streams, which are at the core of Gulp.js. As such, I spent the last few days trying to build a Node.js stream. This turned out to be a bear of a... read more »

CFFinally Tag Will Execute Even After An Abort In ColdFusion

By Ben Nadel on July 19, 2014
Tags: ColdFusion

This is just a quick sanity check. Earlier this year, I tested to see if the CFFinally tag would execute if the CFCatch block threw an error ; which it did. Along the same lines, I wanted to see if the CFFinally tag would execute if the CFCatch block tried to abort the request processing. To test... read more »

Clustering Plupload Instances For Parallel File Uploads

By Ben Nadel on July 14, 2014

If you follow this blog, you know that I'm a super-fan of Plupload for client-side file uploads. But, one thing that I've always wanted to experiment with is parallel uploads. By default, Plupload uploads one file at a time. But what if we clustered several instances of Plupload? Then we could dist... read more »