Ben Nadel
On User Experience (UX) Design, JavaScript, ColdFusion, Node.js, Life, and Love.
Ben Nadel at CFUNITED 2010 (Landsdown, VA) with: Jamie Ly
Ben Nadel at CFUNITED 2010 (Landsdown, VA) with: Jamie Ly@jamiealy )

Dan G. Switzer, II

Member since Dec 11, 2008

Recent Blog Comments By Dan G. Switzer, II

  • Handling Plupload's Uploader Init Race Condition In AngularJS

    Posted on Sep 1, 2015 at 7:24 PM

    @Ben: Why not use Plupload's event system. You could use the PostInit event to set a flag in your scope that indicates that it's initialized, so your destroy can clean it up. You can also check in the PostInit event see if view is destroyed and if so, have Plupload destroy itself. That way you're n... read more »

  • Parsing AngularJS Request Data On The Server Using ColdFusion

    Posted on Apr 25, 2014 at 8:23 AM

    I think Angular sets the "Content-Type" request header to "application/json". To make your code more full proof, you could just add something to your onRequest event handler to look if the "Content-Type" header is "application/json" and if it is, then do your ... read more »

  • Keep Overflow Content Scrolling Unresponsive Until Clicked Using jQuery

    Posted on Jan 7, 2014 at 12:09 PM

    You can get the same affect w/pure CSS too: I had to change the <div> to an <a> so that element would actually get focus. Tried to use a <button> element (which would be more correct) but scrolling a button element didn't seem... read more »

  • AsyncTaskQueue.cfc - Running Low-Priority Tasks In A Single CFThread

    Posted on Sep 13, 2013 at 11:54 AM

    @Ben: The funny thing is, I even found a blog post you wrote that indicates the limit is 2 threads: :) I could definitely be wrong, but what I seem to recall being the case was that a single request coul... read more »

  • AsyncTaskQueue.cfc - Running Low-Priority Tasks In A Single CFThread

    Posted on Sep 13, 2013 at 10:30 AM

    I'm pretty sure Standard is limited to 2 threads, not 10. I know some documentation says 10, but Peter Freitag has a blog entry indicating it was 2: And I'm pretty sure that was my finding as well, but maybe I'm remembering it incorrectly.... read more »

  • JsonSerializer.cfc - A Data Serialization Utility For ColdFusion

    Posted on Aug 7, 2013 at 5:12 PM

    @Ben, Regarding query objects and auto-case rules. If you use getMetaData() on a query object (i.e. getMetaData(queryVar)), then you will get an array of column information. The data should contain: * Name - case sensitive--either exactly how you typed it or if "*" then the case it is i... read more »

  • Strange Interaction Between DeserializeJson(), ArrayContains(), And Database Values In ColdFusion

    Posted on May 22, 2013 at 12:29 PM

    @Ben: What version of Java are you using? Also, did you test to see what Java reports as the data type? I wonder if it's not a Java primitive data type, but getting returned as something else--which is why it's not returning the value. If this is the case, it could lead to issues elsewh... read more »

  • Stateless Service Singletons vs. Stateful Service Entities

    Posted on Apr 3, 2013 at 2:03 PM

    I think it really depends on the use case on whether you use your singleton/stateless pattern works or whether it makes more sense to use a traditional transient object. If the code is being executed at in high iterations, then I think the stateless singleton pattern makes a ton of sense, just beca... read more »

  • Handling Forbidden RESTful Requests: 401 vs. 403 vs. 404

    Posted on Jul 19, 2012 at 2:43 PM

    @Ben: I recently implement our a RESTful version of our API (which uses MAC Access Authentication.) I found I used RFC2616 quite a bit in helping me decide what status codes should be returned. :) As for whether or not 403 or 404 is the correct response, it does really boil down to how much you wa... read more »

  • Writing My First Unit Tests With MXUnit And ColdFusion

    Posted on Jul 10, 2012 at 5:28 PM

    @Phil: There's are definitely tests that only do one thing. For example, you have to write your exception tests like that. I just started finding I wrote a lot less code if I just create an array of tests, w/expected results. Because I'm often doing multiple assertions test as well. I might be che... read more »

  • Writing My First Unit Tests With MXUnit And ColdFusion

    Posted on Jul 10, 2012 at 4:46 PM

    @Phil: I started originally doing one method for each individual test, but I found it ended up just taking way too much of my time and just ended up making for really bloated Test.cfcs. I found as long as you make sure to include a unique description for each error (so it's easy to find your error... read more »

  • Tracing Event Binding And Event Triggering In jQuery

    Posted on Jun 28, 2012 at 8:27 AM

    @Duncan: The "Tilt" add-on is no longer needed--it's built into Firefox 11+ and was the feature I was talking about. @Ben: To get to the the 3D view, you must open the native Firefox Inspector (right click on a page, and press "Q" when the context menu appears.) From there you... read more »

  • Tracing Event Binding And Event Triggering In jQuery

    Posted on Jun 27, 2012 at 2:31 PM

    On a related note, modern browsers have really great developer tools nowadays that can help really go a long way to help troubleshoot these kinds of problems. The problem is some of the tools are a little more obscure and don't get much press coverage. For example, in Firefox you can see a 3D view ... read more »

  • ColdFusion 10 - Looping Over Function Arguments

    Posted on Apr 16, 2012 at 5:00 PM

    @Ben: I labored hard when they introduced the Image* functions that they be implemented as objects and not dozens of function calls. They just keep polluting the function name space and I think that also tends to promote procedural code in some way. I've also wondered if they start using a more OO... read more »

  • ColdFusion 10 - Hashing Binary Data And Byte Arrays

    Posted on Apr 2, 2012 at 10:52 AM

    I was able to get it working fine w/an image using fileReadBinary(). I tested it before posting my comment.... read more »

  • Hashing Byte Arrays (Binary Data) With ColdFusion Before ColdFusion 10

    Posted on Apr 2, 2012 at 10:46 AM

    @Ben: I made this comment in your previous post, but in pre-CF10 you can also just call toString() on the binary data before calling hash() and you should get the same results. That means pre-CF10 you can do: imageHash = hash( toString(imageBinary) ); That said, the hashBytes() is nice work! Nev... read more »

  • ColdFusion 10 - Hashing Binary Data And Byte Arrays

    Posted on Apr 2, 2012 at 10:43 AM

    Ben: I think all CF10 is doing is running the equivalent of toString() on binary data. If I change: writeOutput( "BIN Fingerprint: " & hash( messageBinary ) ); to: writeOutput( "BIN Fingerprint: " & hash( toString(messageBinary) ) ); It works fine in pre-CF10 (I get ... read more »

  • Disabling Auto-Correct And Auto-Capitalize Features On iPhone Inputs

    Posted on Jan 5, 2012 at 11:29 AM

    I was curious if the autocorrect would also disable keyboard shortcuts in iOS5 and it does *not*. This is nice because I've set up a shortcut of @@ to insert my e-mail address. This means user defined shortcuts still work, it only affects spelling corrections. Now if I could just figure out how t... read more »

  • Extending JavaScript Arrays While Keeping Native Bracket-Notation Functionality

    Posted on Dec 1, 2011 at 3:04 PM

    @Ben: If you were actually trying to do something like this for real code, I wouldn't bother defining things in the Collection.prototype--I'd just immediately extend the Array object you create in the Collection() constructor. Since you're not actually returning an instance of the Collection, addi... read more »

  • Storing And Retrieving Global Dates And Times In The Database

    Posted on Sep 27, 2011 at 3:12 PM

    @Ben: The getOffset() returns the total number of milliseconds a current time stamp is away from UTC. So for the time stamp of "2011-09-26 09:00:00" (which we convert to Epoch) it will use the Java lookup tables to determine whether the current time is in DST, then add that to the base ... read more »