Re: How to Capture Field Name with Two Input Variables
Go with Form[outcome_ i], not Evaluate or '#form.outcome##form._ac_id#'. It's just way cleaner. d ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:338498 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Does ORM scale?
Just starting to look at the CF ORM stuff, pretty nice API, Hibernate underneath, all good. But as I understand it, ORM queries return arrays of cfc objects, and I'm concerned about performance at scale. On a gut level, I'd rather be able to get a native CF query, which I could deal with in straight CF as usual, or through an IBO if I wanted object-like behavior for that whole collection. So... - Is it possible to have CF ORM return a query, when I want it to? - What's people's experience with this stuff at scale, meaning large result sets, more than departmental traffic etc? Are there any largish sites doing that? Thanks, Dave ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:338469 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Does ORM scale?
Not so much thinking about transactions, or avoiding straight queries with stored procs, more about returning large result sets as native queries rather than collections of cfc objects. One possibility of course is to use ORM for single/composite record detail, and native cf queries for search/list etc. That would be looking at result lists as a reporting function, where you'd use different (non-ORM) techniques. Really just wondering if people are using ORM at scale, if they're running into performance/memory issues, and how they're being dealt with if so. Dave On Fri, Oct 22, 2010 at 8:54 AM, Russ Michaels r...@michaels.me.uk wrote: Well if you are doing A LOT of database transactions then you have to consider the additional processing time and memory required by creating all those objects. Instantiating objects is nowhere near as much of a bottleneck as it used to be, so it depends on your application and requirements. It is a trade off at the end of the day, ORM increases productivity and reduces complexity but at the same time you lose flexibility and control and of course performance. If performance and scalability if your big concern for your database then you should perhaps be looking at using stored procedures, I don't know how hibernate copes with these, if at all but as the SQL and logic is in the SP, I can't see benefit to using ORM to call the SP anyway. -- Russ Michaels FREE CFML hosting for developers www.cfmldeveloper.com ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:338471 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Does ORM scale?
Thanks Joe, that's pretty much where I was headed too, with the possible/probable exception of using something IBO-like to leverage objects while iterating over a query. I grew up w SQL, never wanted something to just make it go away, but clearly life should be domain-object-centric, not db-centric. Still haven't heard from anyone actually in production with a large-scale ORM app yet. Maybe there just aren't any out there, around a year after CF 9.0. Or maybe they don't read this list, at least this quickly. We'll see... Dave On Fri, Oct 22, 2010 at 11:15 AM, Joe Rinehart j...@firemoss.com wrote: The rule of thumb we (myself, Brian Kotek, Marc Esher, and Scott Stroz) are using on our first large CF ORM project is: 1. If a service is working with changing data, use ORM. 2. If an operation largely works with one item (e.g. a form or detail page), use ORM. 3. If we're going to show a list of things, especially across tables, get off our butts and write a decent SELECT statement to return a query. The common argument against using a select/vanilla query is What it the getters in my objects model formatting/custom logic? Our response to that is to factor that logic into a helper class that is a) used by the object and b) used where the query is cfoutput'd. -Joe On Fri, Oct 22, 2010 at 8:44 AM, enigment enigm...@gmail.com wrote: Just starting to look at the CF ORM stuff, pretty nice API, Hibernate underneath, all good. But as I understand it, ORM queries return arrays of cfc objects, and I'm concerned about performance at scale. On a gut level, I'd rather be able to get a native CF query, which I could deal with in straight CF as usual, or through an IBO if I wanted object-like behavior for that whole collection. So... - Is it possible to have CF ORM return a query, when I want it to? - What's people's experience with this stuff at scale, meaning large result sets, more than departmental traffic etc? Are there any largish sites doing that? Thanks, Dave ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:338481 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: CF (8.0.0) performance vs PHP (5)
+1,000,000 for Jame's theory about string concatenation. CF is very inefficient at this. Doesn't amtter much for small stuff and a few repeats, but for bulk, a Java buffer is the way to go. Dave On Mon, Oct 18, 2010 at 4:04 AM, Jochem van Dieten joch...@gmail.com wrote: On Mon, Oct 18, 2010 at 5:14 AM, Bryn Parrott wrote: When I code this algorithm and execute in PHP 5 it runs in 7 seconds (give or take); When I code and excecute it in CF 8.0.0, it runs in around 74 seconds. Sonme might suggest this is difficult since I have deliberately not posted the code; Indeed. So I'll be just as obscure and limit myself to the words fake fsync in PHP and wait for the code. Jochem -- Jochem van Dieten http://jochem.vandieten.net/ ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:338279 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Subversion Software
+1 VisualSVN Dave ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:338165 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Looping over Query that's contained in a structure.
The spellchecker in IntelliJ IDEA is camel-case aware, so it highlights things like this. Not just for that reason, I'm very happy with it. Dave ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:338166 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: jQuery and cfcontent
+1 for Dan's approach. Dave On Tue, Oct 12, 2010 at 10:12 PM, Dan G. Switzer, II dswit...@pengoworks.com wrote: On Tuesday, October 12, 2010, Dave Watts dwa...@figleaf.com wrote: You can't prompt the user to download a file if you're invoking the URL with standard jQuery AJAX calls. You have to basically just fetch the URL into a new or blank window. I'd recommend posting to an iframe. You can even build the iframe dynamically if you want, it doesn't have to be visible on the page. I've used this technique in the past with great success. -Dan ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:338110 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: CF Site not load - only show HTTP header
Is it the gzip encoding maybe? Can you turn that off on the server to try it? Dave On Tue, Oct 12, 2010 at 6:44 PM, Judah McAuley ju...@wiredotter.com wrote: Are they using any sort of proxy? Perhaps an ad blocker? Judah On Tue, Oct 12, 2010 at 3:12 PM, Sebastian Powell bas...@gmail.com wrote: Hi, I have a user who cannot view my coldfusion website, we have large number of users on the site that are not experiencing the issue and i can't replicate the issue. When this particular user browses the site they just see the following message (seems to be HTTP header) and the site does not load. HTTP/1.1 200 OK Connection: close Date: Sat, 09 Oct 2010 13:31:33 GMT Content-Type: text/html; charset=UTF-8 Server: Microsoft-IIS/6.0 X-Powered-By: ASP.NET Content-Encoding: gzip Vary: Accept-Encoding Transfer-Encoding: chunked Any ideas what may be causing this issue? or how i can debug? I am leaning towards a web server issue rather than coldfusion, but not sure. any thoughts are appreciated. Note: have advised user do the following so far: * check site on different browsers - same issue * tried clearing browser cache - same issue Bas. ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:338100 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: cfssetting showdebugoutput
Using cfsetting showdebugoutput=false does actually disable debug output. Any chance there's another call to it somewhere else with a different setting? Are you actually seeing debug output in the requests that fail, even with that code? Or you're not, but debug output being on in administrator but off on the page still breaks things? If that's the case, I'd suggest diffing the working HTML with the busted HTML, and seeing what's different. I'ts unlikely that that combination outputs something toxic to the page, but I suppose it's theoretically possible. That'd tell you what's different, and maybe point you towards a solution. Dave On Sat, Oct 9, 2010 at 10:29 PM, fun and learning funandlrnn...@gmail.com wrote: Hi All - I am using jqgrid to display some data. This works when I turn off the Request Debugging Output in Coldfusion Administrator. I do not have access to Administrator page at my work. Using cfsetting showdebugoutput = false also does not help. Is there a way I can disable request debugging output through my code? ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:338035 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: cfssetting showdebugoutput
I'm pretty certain that no, false, and 0 all have the same effect. Dave On Sun, Oct 10, 2010 at 3:43 PM, Reed Powell r...@powellgenealogy.com wrote: You want cfsetting showdebugoutput=No not false. It will stop any debug output, just as if you removed your IP address from the list in cf admin. It will not have any effect on error output, etc. ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:338046 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: What version-/source control are you using (if any)?
At work we use AccuRev, which is expensive, and flawed, but on the whole really great. It has a stream inheritance model that means changes in an earlier release stream automatically flow to later releases unless there are changes to the same file there already. Also has integrated issue tracking, good change tracking, decent merging (I hear great things about the Mercurial and Git merge process, no experience so I can't compare). For personal stuff I use Visual SVN Server now, used to use manually installed and configured SVN. Visual SVN is amazingly quick and simple to get running, and just works. Dave On Wed, Oct 6, 2010 at 5:55 AM, Andrew Scott andr...@andyscott.id.au wrote: It also depends on your SDLC, and workflow for releases as well. I use SVN Externals for common code across applications as well, and the one thing that I do is have only a stable release structure in SVN for any application. This means that a developer can code, make changes to all the heart's content. And until you have gone through your testing, staging and release flow. It will not be affected by other projects, not until you merge the changes into your release folder in SVN. Regards, Andrew Scott http://www.andyscott.id.au/ -Original Message- From: Michael Christensen [mailto:mich...@strib.dk] Sent: Wednesday, 6 October 2010 8:29 PM To: cf-talk Subject: Re: What version-/source control are you using (if any)? It's a really good question, and one that I have no real good answer for. I think if you are used to working on a common set of files, you do things a little bit differently than when you have your own copy. We rarely have the issue of people leaving broken files, not in the least because your colleagues will be on you in about 2 seconds. ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:337897 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Positional argument collection
Say I have an array of values, arbitrary length, that I want to pass as the arguments to a method. For example, with this: positionalArgs = ['foo', 'bar', 42]; // this varies, may be any length I want to make this call: SomeComponent.someMethod('foo', 'bar', 42); Is there a positional equivalent to argumentCollection, or some other language construct that I don't know about to do this? If the arguments were in a structure, I could pass it as the argumentCollection, but I don't know how to do this by position in a clean way. Only thing I thought of is a switch statement with some finite number of cases, each of which calls the method with a specific number of arguments, like this (partial): case 2: SomeComponent.someMethod(positionalArgs[1], positionalArgs[2]); break; case 3: SomeComponent.someMethod(positionalArgs[1], positionalArgs[2], positionalArgs[3]); break; etc... Any thoughts? Thanks, Dave ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:337898 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Positional argument collection
Thanks for chiming in Michael. Using ArrayToList would pass all three values as a single string. I'm looking for a generic way to pass each array element as an individual argument, regardless of how many there are. Take another look at the examples I gave. Dave On Wed, Oct 6, 2010 at 11:02 AM, Michael Grant mgr...@modus.bz wrote: I'm not exactly sure what you're asking but would some variation of this work for you? SomeComponent.someMethod(ArrayToList(positionalArgs)); Of course you may need to qualify the list etc if you are passing strings, but I think that suits your example. On Wed, Oct 6, 2010 at 10:54 AM, enigment enigm...@gmail.com wrote: Say I have an array of values, arbitrary length, that I want to pass as the arguments to a method. For example, with this: positionalArgs = ['foo', 'bar', 42]; // this varies, may be any length I want to make this call: SomeComponent.someMethod('foo', 'bar', 42); Is there a positional equivalent to argumentCollection, or some other language construct that I don't know about to do this? If the arguments were in a structure, I could pass it as the argumentCollection, but I don't know how to do this by position in a clean way. Only thing I thought of is a switch statement with some finite number of cases, each of which calls the method with a specific number of arguments, like this (partial): case 2: SomeComponent.someMethod(positionalArgs[1], positionalArgs[2]); break; case 3: SomeComponent.someMethod(positionalArgs[1], positionalArgs[2], positionalArgs[3]); break; etc... Any thoughts? Thanks, Dave ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:337901 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Positional argument collection
@Michael: What I'm looking for is the positional equivalent of argumentCollection. If it wasn't for that, you'd think the same about passing a structure of arguments -- any object you pass will be treated as a single argument. But argumentCollection trumps that. I even tried a structure with keys 1, 2, 3, and passing that as argumentCollection (unnamed arguments appear inside the function as 1, 2, and 3 if you dump arguments), no joy. @Jason: Clearly, calling a method three times, each time with one argument, is very different than calling it once with all three. Say they're search fields, lastName, FirstName, ZIP; you want the search to run with all three of them in place, not separately for each one. (Not sure why you went with an iterator rather than just indexing over the array, but it doesn't matter, not what I need to do.) Thanks for the ideas though. This just may not be possible. Dave On Wed, Oct 6, 2010 at 12:15 PM, Jason Durham jdur...@cti-stl.com wrote: Whoops.. read the rest of the email below. var I = positionalArgs.iterator(); var arg = ; while( i.hasNext() ) { arg = i.next(); SomeComponent.someMethod(arg); } That will call someMethod() for each array value. You could use a For loop with i LTE arrayLen(positionalArg) if you don't want to use iterator(). -Original Message- From: enigment [mailto:enigm...@gmail.com] Sent: Wednesday, October 06, 2010 10:48 AM To: cf-talk Subject: Re: Positional argument collection Thanks for chiming in Michael. Using ArrayToList would pass all three values as a single string. I'm looking for a generic way to pass each array element as an individual argument, regardless of how many there are. Take another look at the examples I gave. Dave On Wed, Oct 6, 2010 at 11:02 AM, Michael Grant mgr...@modus.bz wrote: I'm not exactly sure what you're asking but would some variation of this work for you? SomeComponent.someMethod(ArrayToList(positionalArgs)); Of course you may need to qualify the list etc if you are passing strings, but I think that suits your example. On Wed, Oct 6, 2010 at 10:54 AM, enigment enigm...@gmail.com wrote: Say I have an array of values, arbitrary length, that I want to pass as the arguments to a method. For example, with this: positionalArgs = ['foo', 'bar', 42]; // this varies, may be any length I want to make this call: SomeComponent.someMethod('foo', 'bar', 42); Is there a positional equivalent to argumentCollection, or some other language construct that I don't know about to do this? If the arguments were in a structure, I could pass it as the argumentCollection, but I don't know how to do this by position in a clean way. Only thing I thought of is a switch statement with some finite number of cases, each of which calls the method with a specific number of arguments, like this (partial): case 2: SomeComponent.someMethod(positionalArgs[1], positionalArgs[2]); break; case 3: SomeComponent.someMethod(positionalArgs[1], positionalArgs[2], positionalArgs[3]); break; etc... Any thoughts? Thanks, Dave ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:337909 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Positional argument collection
It's unusual for a method to take an array of its arguments, rather than individual ones. Situation is something like a dispatcher; the methods already have defined arguments, say Widgets.search(widgetName, widgetCategory, widgetID). It'd be pretty weird for it to take an array containing those three arguments. The layer I'm talking about wants to call that, but only has an array of argument values, in order. Not to be cranky, but while there's room for debate on why I want to do this, this isn't that conversation. If there's no more elegant approach than the switch strategy I mentioned, I'll probably ditch this entire route. I first wanted to check if anyone could think of a way to accomplish this in the CFML language, out of curiosity and to maybe learn something that might be useful some day, as well to get it done -- there's lots of smart and experienced folks out there. I didn't mean to discuss whether it's worth doing. Thanks, Dave On Wed, Oct 6, 2010 at 12:42 PM, Michael Grant mgr...@modus.bz wrote: Dave, Why don't you just pass in the array? cfset positionalArgs = ['foo', 'bar', 42] / cfset myFunction(positionalArgs) / cffunction name=myFunction cfargument name=positionalArgs type=array cfloop from=1 to=#arraylen(positionalArgs)# index=x cfdump var=#x#: #positionalArgs[x]#br / /cfloop /cffunction On Wed, Oct 6, 2010 at 12:38 PM, enigment enigm...@gmail.com wrote: @Michael: What I'm looking for is the positional equivalent of argumentCollection. If it wasn't for that, you'd think the same about passing a structure of arguments -- any object you pass will be treated as a single argument. But argumentCollection trumps that. I even tried a structure with keys 1, 2, 3, and passing that as argumentCollection (unnamed arguments appear inside the function as 1, 2, and 3 if you dump arguments), no joy. @Jason: Clearly, calling a method three times, each time with one argument, is very different than calling it once with all three. Say they're search fields, lastName, FirstName, ZIP; you want the search to run with all three of them in place, not separately for each one. (Not sure why you went with an iterator rather than just indexing over the array, but it doesn't matter, not what I need to do.) Thanks for the ideas though. This just may not be possible. Dav ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:337912 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Positional argument collection
Imagine an SES URL processor somewhat analogous to what Django provides, with a regex match that captures specific segments of the incoming URL and passes them to the requested method. Yes I know about ColdCourse, and the related ColdBox plugin etc, I was just thinking about alternate approaches. So yes, maybe it's unusual, but not irrational, or due to lack of structure in my code. Please, can we not debate my motivation any more? If there are any actual answers to the original question, I'd be interested in hearing them, but frankly I doubt it. I've been doing CF for quite a while, and didn't know of one, so I thought I'd ask around, but this keeps focusing on larger issues. That's a Good Thing in many cases, but actually not here. I'm asking if there's a language feature I'm not aware of to accomplish this, nothing more. Dave On Wed, Oct 6, 2010 at 1:34 PM, Michael Grant mgr...@modus.bz wrote: It's also pretty unusual to not have any idea how many arguments you are passing into a method. There are many more elegant approaches to your switch suggestion. The primary one being writing code that has structure and passes in the expected amount of arguments each time. Another one would be that since you know how many arguments you are expecting in the method perhaps write a function to loop over and pad your array with null values if they aren't defined. Then your call to the method can always pass in the expected amount of arguments. On Wed, Oct 6, 2010 at 1:13 PM, enigment enigm...@gmail.com wrote: It's unusual for a method to take an array of its arguments, rather than individual ones. Situation is something like a dispatcher; the methods already have defined arguments, say Widgets.search(widgetName, widgetCategory, widgetID). It'd be pretty weird for it to take an array containing those three arguments. The layer I'm talking about wants to call that, but only has an array of argument values, in order. Not to be cranky, but while there's room for debate on why I want to do this, this isn't that conversation. If there's no more elegant approach than the switch strategy I mentioned, I'll probably ditch this entire route. I first wanted to check if anyone could think of a way to accomplish this in the CFML language, out of curiosity and to maybe learn something that might be useful some day, as well to get it done -- there's lots of smart and experienced folks out there. I didn't mean to discuss whether it's worth doing. Thanks, Dave On Wed, Oct 6, 2010 at 12:42 PM, Michael Grant mgr...@modus.bz wrote: Dave, Why don't you just pass in the array? cfset positionalArgs = ['foo', 'bar', 42] / cfset myFunction(positionalArgs) / cffunction name=myFunction cfargument name=positionalArgs type=array cfloop from=1 to=#arraylen(positionalArgs)# index=x cfdump var=#x#: #positionalArgs[x]#br / /cfloop /cffunction On Wed, Oct 6, 2010 at 12:38 PM, enigment enigm...@gmail.com wrote: @Michael: What I'm looking for is the positional equivalent of argumentCollection. If it wasn't for that, you'd think the same about passing a structure of arguments -- any object you pass will be treated as a single argument. But argumentCollection trumps that. I even tried a structure with keys 1, 2, 3, and passing that as argumentCollection (unnamed arguments appear inside the function as 1, 2, and 3 if you dump arguments), no joy. @Jason: Clearly, calling a method three times, each time with one argument, is very different than calling it once with all three. Say they're search fields, lastName, FirstName, ZIP; you want the search to run with all three of them in place, not separately for each one. (Not sure why you went with an iterator rather than just indexing over the array, but it doesn't matter, not what I need to do.) Thanks for the ideas though. This just may not be possible. Dav ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:337914 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Positional argument collection
Missing the point. The method already exists and has other callers, who pass separate arguments by name or position. I'm not redesigning its API to take an array of arguments. I want to generically pass in a set of ordered arguments to it. Dave On Wed, Oct 6, 2010 at 1:57 PM, Michael Grant mgr...@modus.bz wrote: I gave you a perfectly viable, easy to implement solution. On Wed, Oct 6, 2010 at 1:55 PM, enigment enigm...@gmail.com wrote: Imagine an SES URL processor somewhat analogous to what Django provides, with a regex match that captures specific segments of the incoming URL and passes them to the requested method. Yes I know about ColdCourse, and the related ColdBox plugin etc, I was just thinking about alternate approaches. So yes, maybe it's unusual, but not irrational, or due to lack of structure in my code. Please, can we not debate my motivation any more? If there are any actual answers to the original question, I'd be interested in hearing them, but frankly I doubt it. I've been doing CF for quite a while, and didn't know of one, so I thought I'd ask around, but this keeps focusing on larger issues. That's a Good Thing in many cases, but actually not here. I'm asking if there's a language feature I'm not aware of to accomplish this, nothing more. Dave On Wed, Oct 6, 2010 at 1:34 PM, Michael Grant mgr...@modus.bz wrote: It's also pretty unusual to not have any idea how many arguments you are passing into a method. There are many more elegant approaches to your switch suggestion. The primary one being writing code that has structure and passes in the expected amount of arguments each time. Another one would be that since you know how many arguments you are expecting in the method perhaps write a function to loop over and pad your array with null values if they aren't defined. Then your call to the method can always pass in the expected amount of arguments. On Wed, Oct 6, 2010 at 1:13 PM, enigment enigm...@gmail.com wrote: It's unusual for a method to take an array of its arguments, rather than individual ones. Situation is something like a dispatcher; the methods already have defined arguments, say Widgets.search(widgetName, widgetCategory, widgetID). It'd be pretty weird for it to take an array containing those three arguments. The layer I'm talking about wants to call that, but only has an array of argument values, in order. Not to be cranky, but while there's room for debate on why I want to do this, this isn't that conversation. If there's no more elegant approach than the switch strategy I mentioned, I'll probably ditch this entire route. I first wanted to check if anyone could think of a way to accomplish this in the CFML language, out of curiosity and to maybe learn something that might be useful some day, as well to get it done -- there's lots of smart and experienced folks out there. I didn't mean to discuss whether it's worth doing. Thanks, Dave On Wed, Oct 6, 2010 at 12:42 PM, Michael Grant mgr...@modus.bz wrote: Dave, Why don't you just pass in the array? cfset positionalArgs = ['foo', 'bar', 42] / cfset myFunction(positionalArgs) / cffunction name=myFunction cfargument name=positionalArgs type=array cfloop from=1 to=#arraylen(positionalArgs)# index=x cfdump var=#x#: #positionalArgs[x]#br / /cfloop /cffunction On Wed, Oct 6, 2010 at 12:38 PM, enigment enigm...@gmail.com wrote: @Michael: What I'm looking for is the positional equivalent of argumentCollection. If it wasn't for that, you'd think the same about passing a structure of arguments -- any object you pass will be treated as a single argument. But argumentCollection trumps that. I even tried a structure with keys 1, 2, 3, and passing that as argumentCollection (unnamed arguments appear inside the function as 1, 2, and 3 if you dump arguments), no joy. @Jason: Clearly, calling a method three times, each time with one argument, is very different than calling it once with all three. Say they're search fields, lastName, FirstName, ZIP; you want the search to run with all three of them in place, not separately for each one. (Not sure why you went with an iterator rather than just indexing over the array, but it doesn't matter, not what I need to do.) Thanks for the ideas though. This just may not be possible. Dav ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:337916 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Positional argument collection
Hmmm, not sure what you mean by build a method call to the original method, and write the values positionally by iterating through the array. Do you mean write it out to disk or VFS? I'd thought of that, but wasn't super fond of the idea, since unless I'm missing something, you'd have to do that for every supported number of arguments for every publicly accessible method in the app. Or maybe I'm just not on your wavelength here. Dave On Wed, Oct 6, 2010 at 2:24 PM, Dave Watts dwa...@figleaf.com wrote: Missing the point. The method already exists and has other callers, who pass separate arguments by name or position. I'm not redesigning its API to take an array of arguments. I want to generically pass in a set of ordered arguments to it. How about writing a new method that takes two arguments: the name of the method you want it to call and an array of arguments. This method could then build a method call to the original method, and write the values positionally by iterating through the array. Presumably, you'd plop this method in a utility CFC, rather than in the original CFCs. Or, you could add it to the superclass so that it's present through your class hierarchy. Dave Watts, CTO, Fig Leaf Software http://www.figleaf.com/ http://training.figleaf.com/ Fig Leaf Software is a Veteran-Owned Small Business (VOSB) on GSA Schedule, and provides the highest caliber vendor-authorized instruction at our training centers, online, or onsite. ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:337919 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Positional argument collection
You're right, I did misread your last post, sorry. But it's still not super practical as a generic SES-URL-to-method-call dispatcher, unless I'm still not getting what you mean. You'd need to inspect each method before you called it to find out how many args it takes, pad the array out that far, and then you'd still need a switch statement to call the method with that specific number of arguments. Keying the switch statement of the actual number of captured URL segments seems simpler and less overhead. In other words, whether the variable number of items in the array is the number of arguments for each individual method, or the number of URL segments actually captured, the problem of how to generically call a method with a variable number of arguments remains. Unless you want to find out the maximum number of arguments passed by *any* method, and always use that, but by that time I'd think this was too clunky to consider. Is there some other way you're thinking of to make the actual call? Dave On Wed, Oct 6, 2010 at 2:33 PM, Michael Grant mgr...@modus.bz wrote: Re-read my last post. If you know that the method will accept x number of arguments. And your array may have anywhere from 1 to x possible values then write a function to pad your array with (x - arraylen) null values. Like this: cfset positionalArgs = ['foo', 'bar', 42] cfset positionalArgs = padMyArray(positionalArgs,10) / cfset myFunction(positionalArgs[1], positionalArgs[2], positionalArgs[3], positionalArgs[4], positionalArgs[5], positionalArgs[6], positionalArgs[7], positionalArgs[8], positionalArgs[9], positionalArgs[10] ) cffunction name=padMyArray cfargument name=arrIN type=array required=true cfargument name=arrLen type=numeric required=true cfloop from=#arraylen(arrIN)# to=#arrlen# index=x cfset ArrayAppend(arrIN,) /cfloop cfreturn arrIN / /cffunction cffunction name=myFunction cfargument name=arg1 required=false default=not defined cfargument name=arg2 required=false default=not defined cfargument name=arg3 required=false default=not defined cfargument name=arg4 required=false default=not defined cfargument name=arg5 required=false default=not defined cfargument name=arg6 required=false default=not defined cfargument name=arg7 required=false default=not defined cfargument name=arg8 required=false default=not defined cfargument name=arg9 required=false default=not defined cfargument name=arg10 required=false default=not defined cfdump var=arg1: #arg1# cfdump var=arg2: #arg2# cfdump var=arg3: #arg3# cfdump var=arg4: #arg4# cfdump var=arg5: #arg5# cfdump var=arg6: #arg6# cfdump var=arg7: #arg7# cfdump var=arg8: #arg8# cfdump var=arg9: #arg9# cfdump var=arg10: #arg10# ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:337920 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Positional argument collection
No, actually not, unless I missed it. Evaluate is against my religion, but I might make an exception if there isn't any other way and I care enough. It's an odd language feature to work around, argumentCollection (args by name) exists, but there's no positional equivalent. Thanks, Dave On Wed, Oct 6, 2010 at 3:28 PM, Dave Watts dwa...@figleaf.com wrote: Hmmm, not sure what you mean by build a method call to the original method, and write the values positionally by iterating through the array. Do you mean write it out to disk or VFS? I'd thought of that, but wasn't super fond of the idea, since unless I'm missing something, you'd have to do that for every supported number of arguments for every publicly accessible method in the app. No, I didn't mean on disk or VFS, I meant just writing a string of code and executing it using Evaluate. There might be a more elegant approach, but that should work. I haven't really read the rest of the thread that closely, so I'm not sure if someone has basically proposed the same thing or not. Dave Watts, CTO, Fig Leaf Software http://www.figleaf.com/ http://training.figleaf.com/ Fig Leaf Software is a Veteran-Owned Small Business (VOSB) on GSA Schedule, and provides the highest caliber vendor-authorized instruction at our training centers, online, or onsite. ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:337922 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: How to point to a Directory?
You might be best off just having them type it in, and complain if it doesn't exist. These are users at a high enough level that they're configuring things, yes? Maybe the simplest solutions is the best. Dave On Mon, Oct 4, 2010 at 7:47 PM, William Seiter will...@seiter.com wrote: AIR is not the only method, but you can't get it done with just html. You will need A java applet or flash or air or some other program that can talk to the system as well as your app. -- William Seiter On Oct 4, 2010, at 4:39 PM, Gonzo Rock gonzor...@gmail.com wrote: Well the purpose is to capture and store the Directory as part of a configuration routine. Then days in the future other users of the application will trigger it to process some datafiles... but coldfusion needs to know where those datafiles are located. The current user has no idea where they are stored... they just want the files in the directory processed. Currently during the configuration session we can capture it by making them point to a file in the directory and then stripping the actual file name from the network path they navigated down... however how to do this when there is NO file in the directory for them to use while configuring the Directory Location for future use... that is the problem... which Dave suggests can only be solved using AIR :-( On Mon, Oct 4, 2010 at 4:18 PM, Russ Michaels r...@michaels.me.uk wrote: also u do not need to remember the path as this is the default behaviour of windows. When you open a browse window it always takes you to the last location you used. On Tue, Oct 5, 2010 at 12:15 AM, Dave Watts dwa...@figleaf.com wrote: Using input type=file works great to let a user point to a file... but how do you let the user browse and point to a Directory? I am trying to figure out how to let a user browse to a particular directory location on their network and then capture that location for future use. In this instance the application will always look in this location for files that it needs to process for the user. There's nothing built into HTML to capture a directory path. Also, browsers won't let you store a directory path for later use, for security reasons - the user always has to choose the file directly. Adobe AIR is a nice alternative here. Downloadable applications can do all sorts of things that browsers won't allow. Dave Watts, CTO, Fig Leaf Software http://www.figleaf.com/ http://training.figleaf.com/ Fig Leaf Software is a Veteran-Owned Small Business (VOSB) on GSA Schedule, and provides the highest caliber vendor-authorized instruction at our training centers, online, or onsite ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:337848 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: 3 layers of validation?
IMO... - You *always* need server side validation, because as mentioned, client validation may not always run, and also so you can make an API available beyond browser front ends. - If that's true, I prefer to stay DRY and write validation in only one place, so that means on the server not the client. To work with that, you probably want to establish infrastructure and conventions to communicate server-side bus rule failures back to the client for presentation to the user. For example, our ajax layer includes the ability to specify mappings of back-end method arguments to a friendly name you can say to the user (Last name is required, not last_name), and a list of DOM IDs that should get highlighted in the UI if the data for that argument is invalid. Dave On Thu, Sep 23, 2010 at 8:34 AM, Rick Root rick.r...@gmail.com wrote: Database validation probably comes into play in a couple ways. #1 - datatypes and constraints (including things like foreign keys) provide some level of database validation. #2 - if you're using stored procedures to perform actions, stored procedures can sometimes have business logic validation in them as well. Of course we all use database validation like #1. Although I've written a few stored procedures, I've neve really put any validation in them. Server validation protects you against a number of things that client validation absolutely cannot do. - bugs in client side validation - hackers/spambots who aren't using the web client that you built and try to post things directly to your server side scripts, cfcs, etc. Rick ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:337368 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: removing chr(10), chr(13), chr(9), chr(12)
You might want to replace runs of consecutive unacceptable whitespace characters with a single space. Otherwise, two sentences that used to have CRs and/or LFs between them will be jammed against each other, with no space at all between them. Dave On Mon, Aug 23, 2010 at 12:10 AM, Matthew Smith chedders...@gmail.com wrote: That got it. Thank you so much. On Sun, Aug 22, 2010 at 9:12 PM, Wil Genovese jugg...@trunkful.com wrote: This is what I use to remove all control characters from a string. Which includes linefeed chr(10) and carriage return chr(13). REReplaceNoCase(string,'([[:cntrl:]])','','All') Wil Genovese Sr. Web Application Developer/ Systems Administrator Wil Genovese Consulting wilg...@trunkful.com www.trunkful.com On Aug 22, 2010, at 8:58 PM, Justin Scott wrote: Thank you for the help. It seems I am still missing the line feed somehow. In the replaceList() put a comma between char 13 and 10 so it will catch them individually instead of only when they're together (and add another comma to the second attribute as well). Sometimes text will only have a line break (10) without the carriage return (13). -Justin ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:336458 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: HTMLEditFormat() broken in CF9?
Thanks for checking this, good to know. I think the project I'm working on right now can't be sure the 9.0 isn't in play, so I'll just use my own ReplaceList equivalent. Thanks again, Dave On Sun, Aug 15, 2010 at 8:31 PM, Aaron Neff w...@itisdesign.com wrote: Hi Dave, I believe this was bug #82039, which has been fixed in CF 9.0.1. I ran your code in CF8, CF9, and CF9.0.1. Result in CF8 and CF9.0.1 was the same. Thanks!, -Aaron Neff It looks to me that in CF9, HTMLEditFormat no longer escapes text that's already escaped. ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:336291 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: (ot) Site issue with Safari 5.01 on Mac
Hi Rock, Looks fine in Safari 5.1 on my wife's macbook, Mac OS X 10.5.8, Can't speak to the details since she's actually using it, but it wasn't like that mostly-empty screenshot. HTH, Dave On Sun, Aug 15, 2010 at 8:44 PM, Rick Root rick.r...@gmail.com wrote: Hi all, We've got a user saying that their site is scred up on Safari 5.01 on Mac ... I don't have a Mac so I can't really test but it looks fine in every browser I can test on Windows, including Safari 5.01 Here's the URL http://www.shsclassof76.com/ Here's a screenshot of what he sees: http://forums.classcreator.com/attachment.cfm?file_id=62CAFFE0-EAD3-B4D3-F768FB4CA543E243 Anyone got any suggestions? Rick ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:336292 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm