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 the New York ColdFusion User Group (Sep. 2009) with:

Danilo Celic

Member since Dec 11, 2008

Recent Blog Comments By Danilo Celic

  • Arguments.length In Javascript Depends On Invocation Arguments, Not Function Signatures

    Posted on Mar 24, 2011 at 10:23 AM

    If you do want to know the number of arguments that are defined for a function, so that for example you can compare what you were expecting to what you actually get, you can use something similar to the following: function fnGreat(arg1, arg2, arg3){ console.log(fnGreat.length == arguments.length); ... read more »

  • Finding The XPath Of A Given XML Node In A ColdFusion XML Document

    Posted on Nov 2, 2010 at 12:12 PM

    Not quite the same thing, but if you have the XML file locally, or have it on the same domain (due to same domain JavaScript restrictions), you can use the Spry Data Set Explorer to load an XML document and then navigate within the structure of the document to see what the XPath would be for the sel... read more »

  • Using Composed Javascript UI Controllers With Event Delegation

    Posted on Oct 14, 2010 at 4:54 PM

    @Ben, Good point about the constructor creating all of the list items controllers when itself is created, so agree probably better to have it as a construction parameter. I suppose that the setter for the item controller could be useful if you want to replace the controller on the fly for whatever... read more »

  • Using Composed Javascript UI Controllers With Event Delegation

    Posted on Oct 14, 2010 at 4:01 PM

    Ben, As I've read through the last couple of post about the UI controls, one thought that I had was that the ListController has a dependency on the ListItemController class/object. Perhaps the ListItemController could be a parameter of the ListController constructor, or settable via a method simila... read more »

  • Javascript Array Methods: Unshift(), Shift(), Push(), And Pop()

    Posted on Jan 20, 2010 at 3:20 PM

    @someone else, I had a sneaky suspicion that call or apply would be part of the solution I was looking for. Thanks for posting the snippet, I'll be saving that one for sure.... read more »

  • Javascript Array Methods: Unshift(), Shift(), Push(), And Pop()

    Posted on Dec 29, 2009 at 4:26 PM

    Ben, The array method that I've been using a lot of lately that I don't see many people use is the splice() method. It allows removal (and optionally insertion ) of items at an arbitrary index in the array. It will return an array of elements removed from the array: // Example 1 var data = [ "A", ... read more »

  • Ask Ben: Selecting Random Values Without Repetition In ColdFusion

    Posted on Feb 3, 2009 at 5:15 PM

    Ben, This code has the potential to run, especially if the length of the list and the number of items to pull are fairly close to each other. Imaging 1000 numbers and pulling 990 out. The random number generator may pick many times in a row already picked items. Of course for relatively small sets... read more »

  • Kinky Solutions Shop - Holiday Season Beta Launch

    Posted on Dec 19, 2008 at 11:01 AM

    Creating yet another account and trying to keep track of it isn't what a lot of folks will want to do. How about using OpenID ( http://openid.net/ ) as a user authentication method? The bonus here would be if you haven't implemented OpenID before, it gives you at least several more blog posts abou... read more »

  • National Regular Expression Day And Reflections On My Own Journey

    Posted on May 30, 2008 at 1:13 PM

    As /s are used in a number of languages as indicators of a regular expression object, perhaps the /'s in your poster should be around the date rather than in the middle of it.... read more »

  • Compiling Several Linked Files Into One File

    Posted on Apr 8, 2008 at 9:50 AM

    @Ben, One concern I'd have with this implementation would be that you can run into caching issues. For example, you're combining 3 JavaScript files into one file without a "build number" in the file name. If you change one of your source JavaScript files, and rebuild the combined file, then that fi... read more »

  • CreateGradient() / DrawGradientRect() Added To ImageUtils.cfc

    Posted on Feb 20, 2008 at 11:08 AM

    Ben, My initial thought was that you could pass the DrawGradientRect a Gradient struct with the properties that are needed by CreateGradient DrawGradientRect, but then I was also thinking about the calculated set of color values that could then be used multiple times. As I've not looked at the imp... read more »

  • CreateGradient() / DrawGradientRect() Added To ImageUtils.cfc

    Posted on Feb 20, 2008 at 9:36 AM

    Hey Ben, Was there a particular reason that you have the "passthrough" parameters for DrawGradientRect in a different order than they are in CreateGradient? It seems to me to make the order of parameters the same would make them easier to remember (as well as potentially copy and paste when moving ... read more »

  • DreamWeaver CS3 Slows Me Down

    Posted on Feb 19, 2008 at 11:26 AM

    It would be good if Dreamweaver had such a code editing feature as what I would call "smart snippets" that are used in Eclipse. IT tends to be a bit more visual focused, a feature that could be considered similar would be the Server Behaviors where a UI can pop up where you enter the parameter value... read more »

  • DreamWeaver CS3 Slows Me Down

    Posted on Feb 18, 2008 at 10:03 PM

    @Ricky, Just to be clear I do not work for Adobe, I'm part of the Community Experts program: http://www.adobe.com/communities/experts/ If you have any suggestions about features for Dreamweaver make sure to submit them here: http://www.adobe.com/cfusion/mmform/index.cfm?name=wishform I do not... read more »

  • DreamWeaver CS3 Slows Me Down

    Posted on Feb 18, 2008 at 4:53 PM

    @Ben, Every application I recall using CTRL+Z is undo, and CTRL+Y is always redo. So for me if it deleted a line each time, I'd be in trouble. For me, CTRL + page up/down does (as well as without the CTRL held) moves the cursor to the top/bottom of the presently viewed "page" of code within the co... read more »

  • DreamWeaver CS3 Slows Me Down

    Posted on Feb 18, 2008 at 8:57 AM

    Hey Ben, I'm an Adobe Community Expert with a focus on Dreamweaver so I may be slightly biased in my opinion. :-) First off, no capital W in Dreamweaver. Regarding your comment about a networked drive, yes in fact, Dreamweaver is likely trying to refresh the files list every time you go back into... read more »

  • RELoop ColdFusion Custom Tag Case Study

    Posted on Nov 14, 2007 at 9:07 PM

    @Ben, Thanks for the link. I was also thinking about the different escape chars for different languages/context, puls what happens when you combine the two, like a CF string with escaped string that has an embedded JavaScript code sample. The mind just goes a little wonky. Thanks for the link, I'l... read more »

  • RELoop ColdFusion Custom Tag Case Study

    Posted on Nov 14, 2007 at 11:27 AM

    Hey Ben, Haven't played with your solution to test it, but it appears that you're not taking into account escaped quotes within a quoted string, so for something like the following string: She said: "If you want to quote something add a "" symbol to start of \r\n the string,\r\n and a "" to the en... read more »

  • Javascript Number.toFixed() Method

    Posted on Oct 29, 2007 at 7:01 PM

    @Ben, Yes, Number(str) will be NaN if the value of str isn't converted into a number. Make sure that you use isNan() to check for values being NaN because NaN does not equal NaN. var str = 's1234.56789'; var n1 = Number(str); var n2 = Number(str); alert(n1 == n2); This alerts false even though n... read more »

  • Javascript Number.toFixed() Method

    Posted on Oct 29, 2007 at 9:56 AM

    There are several ways to convert strings to numbers in JavaScript. One way is the parseFloat that you've shown here, but you can convert it directly into a number with the following: var str = Number('1234.56789'); An alternate method of moving a string to number is to subtract 0 from it: var str ... read more »