Skip to main content
Ben Nadel
On User Experience (UX) Design, JavaScript, ColdFusion, Node.js, Life, and Love.

Dan G. Switzer, II

Member since Dec 11, 2008

Recent Blog Comments By Dan G. Switzer, II

  • Desktop Safari Seems To Add Extra Padding To CSS Flexbox Item Inside List Item

    Posted on May 30, 2019 at 8:14 AM

    I believe that Webkit is not ignoring the whitespace around your HTML. I bet if you remove the whitespace between your tags, the problem goes away.... read more »

  • Using Java's AtomicInteger To Loop Over A Range Of Numbers In ColdFusion

    Posted on Mar 20, 2018 at 8:49 AM

    Oops... Sorry missed that. Not enough caffeine yet apparently :)... read more »

  • Using Java's AtomicInteger To Loop Over A Range Of Numbers In ColdFusion

    Posted on Mar 20, 2018 at 8:35 AM

    @Ben: It appears you still have a race condition around the following statement: var currentValue = counter.get(); The problem is you could have multiple threads read this input and get back a value (let's say 4). The first thread that hits compareAndSet() will succeed, but the other threads wi... read more »

  • ColdFusion Can Safely Pull-Through NULL Values In Function Return Statements

    Posted on Feb 26, 2016 at 9:52 AM

    The behavior of "intermediary_return_value" drives me nuts. It makes working with the language, at times, so much more difficult than it should be.... read more »

  • Experimenting With ExtendedInfo To Aggregate Error Information In ColdFusion

    Posted on Dec 9, 2015 at 9:07 AM

    @Ben: The one problem with using serializeJSON() is that serialization bugs could result in the "catch" being transformed in some ways that might end up being misleading when debugging. It might be better to serialize the catch using ByteArrayOutputStream, then store it as Base64 (see ht... read more »

  • Creating A Closure-Based Tunnel Between A Thread And A Function In ColdFusion

    Posted on Nov 11, 2015 at 12:40 PM

    One thing to be aware of, which has bitten me a few times with closures. A closure will not work when executed outside the request context of the original request in which is was recreated. This makes it impossible to store a closure in something like the Application scope or store it in variable t... read more »

  • 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 »