Skip to main content

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 »

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

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

  • Why Do I Even Get Any Huge Ass Traffic?

    Posted on Jun 26, 2007 at 9:02 AM

    I believe that this is the link you're looking for: http://www.bloginblack.de/archives/000871.cfm... read more »

I believe in love. I believe in compassion. I believe in human rights. I believe that we can afford to give more of these gifts to the world around us because it costs us nothing to be decent and kind and understanding. And, I want you to know that when you land on this site, you are accepted for who you are, no matter how you identify, what truths you live, or whatever kind of goofy shit makes you feel alive! Rock on with your bad self!
Ben Nadel