Re: Removing duplicates from a value list
Hi Les, I have a little function for doing this: cffunction name=listCleanup returntype=string access=public hint=removes duplicates from given list and returns it alphanumerical sorted cfargument name=lList type=string required=yes hint=list to clear up cfargument name=bSort type=Boolean required=no default=FALSE hint=whether to return sorted list or not cfset var lReturn = cfset var strExistingKeys = structNew() cfset var aReturnList = arrayNew(1) cfloop list=#arguments.lList# index=sElement cfif NOT structKeyExists(strExistingKeys,sElement) cfset arrayAppend(aReturnList,sElement) cfset strExistingKeys[sElement] = TRUE /cfif /cfloop cfif arguments.bSort cfset arraySort(aReturnList,textNoCase) /cfif cfset lReturn = arrayToList(aReturnList) CFRETURN lReturn /cffunction Greets, Sigi What's the easiest way to remove dupes from a value list? I want to turn, say, this: History,Recreation,History,Music,Architecture,History,Recreation,Music into this: History,Recreation,Music,Architecture Thanks in advance for your help, Les ~| 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:343620 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
RE: Removing duplicates from a value list
http://acoderslife.com/index.cfm/blog/Simple-way-to-remove-duplicate-list-it ems-in-ColdFusion .:.:.:.:.:.:.:.:.:.:.:.:.:. Bobby Hartsfield http://acoderslife.com http://cf4em.com -Original Message- From: Les Irvin [mailto:les.cft...@gmail.com] Sent: Friday, April 08, 2011 12:07 AM To: cf-talk Subject: Removing duplicates from a value list What's the easiest way to remove dupes from a value list? I want to turn, say, this: History,Recreation,History,Music,Architecture,History,Recreation,Music into this: History,Recreation,Music,Architecture Thanks in advance for your help, Les ~| 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:343621 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Removing duplicates from a value list
CFLIb has a few options too: http://cflib.org/udf/ListDeleteDuplicates http://cflib.org/udf/ListDeleteDuplicatesNoCase On Fri, Apr 8, 2011 at 6:09 AM, Bobby Hartsfield bo...@acoderslife.com wrote: http://acoderslife.com/index.cfm/blog/Simple-way-to-remove-duplicate-list-it ems-in-ColdFusion .:.:.:.:.:.:.:.:.:.:.:.:.:. Bobby Hartsfield http://acoderslife.com http://cf4em.com -Original Message- From: Les Irvin [mailto:les.cft...@gmail.com] Sent: Friday, April 08, 2011 12:07 AM To: cf-talk Subject: Removing duplicates from a value list What's the easiest way to remove dupes from a value list? I want to turn, say, this: History,Recreation,History,Music,Architecture,History,Recreation,Music into this: History,Recreation,Music,Architecture Thanks in advance for your help, Les ~| 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:343622 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Odd issue with Query
Charlie, If you're using MSSQL and cfqueryparam /, sometimes running a query directly in SSMS may lead to misleading information. I wrote a blog issue a while back that talks about one issue: http://blog.pengoworks.com/index.cfm/2010/12/8/Performance-issues-with-cfqueryparam--on-first-execution-when-using-Microsoft-SQL-Server Essentially what can be happening is that MSSQL is having performance problems running sp_prepexec to analyze the best way to run your SQL, so the problem isn't running the query, it's with MSSQL trying to figure out the best way to run the query. You might also check out this lengthy article: http://www.sommarskog.se/query-plan-mysteries.html -Dan On Thu, Apr 7, 2011 at 7:40 PM, Charlie Stell charlie.st...@gmail.comwrote: So this was a weird one... the error is resolved, but I was wondering if anyone could explain what was causing my error. I had a query that was timing out (its one of those nice long monster queries - so I'm not pasting it in its entirety) - but when I copied/pasted out of the cfcatch.sql (from error thrown on timeout) into SQL Query Analyzer - or another template, it completed in under a second. In the query there was a join that looked like this - LEFT JOIN tableA on ColX cfif condition... = ColY cfelse = ColZ /cfif Changing it to either of the following resolved the issue Solution 1: LEFT JOIN tableA on ColX cfif condition... = ColY cfelse = ColZ /cfif Solution 2: cfif condition... LEFT JOIN tableA on ColX = ColY cfelse LEFT JOIN tableA on ColX = ColZ /cfif So I'm assuming there was something going on related to the carriage return following ColX - and in addition to the two solutions above, the process of copy-pasting also must have resolved it. If it makes any difference - I'm using SeeFusion for monitoring and so all my datasources use: JDBC URL: jdbc:seefusion:jdbcwrapper:{jdbc:macromedia:sqlserver://server1:1433; databaseName=dbname; SelectMethod=direct; sendStringParametersAsUnicode=false; MaxPooledStatements=1000}; Driver Class: com.seefusion.Driver Anyone have any idea on the root problem? Thanks! charlie ~| 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:343623 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Solr Errors
Well, by doing some research on the Solr boards and lists, I was able to figure out the problem. It appears to be due to CF committing after every cfindex tag and this causes Solr to open a new searcher and auto warm it (load from cache). If you are committing more frequently than the warming process, these searches pile up and you hit the error. So if you have a page that runs a lot of cfindex tags (as my unit tests were) you can easily hit this error. Problem is, I'm not sure how we can work around this easily. I tried setting the autoWarmCounts to 0 to see if I could reduce the startup time (and since my app does a lot more indexing at runtime than searches so slow startup is not a big issue) but I still hit the error when the number of searches exceeded the maximum set. I could try setting the limit for warming searches higher (setting it to 10 for instance fixes the problem with my tests) but that supposedly is a bit of a performance killer. In cases where my users are adding a batch of these data elements that I'm indexing, I'm almost certainly to bang into that limit again. In my case, it may mean we simply cannot use Solr for this, unless there's someway to batch the commits and just do one single one at the end of the request. What we need is something like a cftransaction tag for the cfindex tag. --- Mary Jo ~| 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:343624 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
replace function
How can I convert this string: bob,carol,ted,alice to this: bob,carol,ted,alice my replace() skills are not up to snuff... many thanks, Les ~| 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:343625 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: replace function
ListQualify(bob,carol,ted,alice, '') On Fri, Apr 8, 2011 at 2:21 PM, Les Irvin les.cft...@gmail.com wrote: How can I convert this string: bob,carol,ted,alice to this: bob,carol,ted,alice my replace() skills are not up to snuff... many thanks, Les ~| 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:343626 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Solr Errors
To be clear - is this only for your unit tests? Could you possibly use sleep() to slow things down a bit? That's a hack - but would allow you to keep testing. On Fri, Apr 8, 2011 at 11:36 AM, Mary Jo Sminkey mary...@cfwebstore.com wrote: Well, by doing some research on the Solr boards and lists, I was able to figure out the problem. It appears to be due to CF committing after every cfindex tag and this causes Solr to open a new searcher and auto warm it (load from cache). If you are committing more frequently than the warming process, these searches pile up and you hit the error. So if you have a page that runs a lot of cfindex tags (as my unit tests were) you can easily hit this error. Problem is, I'm not sure how we can work around this easily. I tried setting the autoWarmCounts to 0 to see if I could reduce the startup time (and since my app does a lot more indexing at runtime than searches so slow startup is not a big issue) but I still hit the error when the number of searches exceeded the maximum set. I could try setting the limit for warming searches higher (setting it to 10 for instance fixes the problem with my tests) but that supposedly is a bit of a performance killer. In cases where my users are adding a batch of these data elements that I'm indexing, I'm almost certainly to bang into that limit again. In my case, it may mean we simply cannot use Solr for this, unless there's someway to batch the commits and just do one single one at the end of the request. What we need is something like a cftransaction tag for the cfindex tag. --- Mary Jo ~| 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:343627 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
RE: Solr Errors
Mary Jo, There has to be a way to disable that warmcache process altogether... don't you think? -Mark Mark A. Kruger, MCSE, CFG (402) 408-3733 ext 105 www.cfwebtools.com www.coldfusionmuse.com www.necfug.com -Original Message- From: Raymond Camden [mailto:rcam...@gmail.com] Sent: Friday, April 08, 2011 2:25 PM To: cf-talk Subject: Re: Solr Errors To be clear - is this only for your unit tests? Could you possibly use sleep() to slow things down a bit? That's a hack - but would allow you to keep testing. On Fri, Apr 8, 2011 at 11:36 AM, Mary Jo Sminkey mary...@cfwebstore.com wrote: Well, by doing some research on the Solr boards and lists, I was able to figure out the problem. It appears to be due to CF committing after every cfindex tag and this causes Solr to open a new searcher and auto warm it (load from cache). If you are committing more frequently than the warming process, these searches pile up and you hit the error. So if you have a page that runs a lot of cfindex tags (as my unit tests were) you can easily hit this error. Problem is, I'm not sure how we can work around this easily. I tried setting the autoWarmCounts to 0 to see if I could reduce the startup time (and since my app does a lot more indexing at runtime than searches so slow startup is not a big issue) but I still hit the error when the number of searches exceeded the maximum set. I could try setting the limit for warming searches higher (setting it to 10 for instance fixes the problem with my tests) but that supposedly is a bit of a performance killer. In cases where my users are adding a batch of these data elements that I'm indexing, I'm almost certainly to bang into that limit again. In my case, it may mean we simply cannot use Solr for this, unless there's someway to batch the commits and just do one single one at the end of the request. What we need is something like a cftransaction tag for the cfindex tag. --- Mary Jo ~| 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:343628 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
BlueDragonJX WSDL issues
Anybody ever experience any problems calling web services with BlueDragon JX. Iâm on 7.0 awaiting an upgrade to 7.1. When calling a web service, I get the following error: âProblem buiding WSDL classes for http...â Iâll share my code below, but the funny thing is that this will work on BlueDragon.net, CF8 and CF9. Iâve seen some talk out there about BDJX and some axis problems (http://code.google.com/p/openbluedragon/issues/detail?id=301), but was wondering if anyone else had seen (or even better yet solved) this problem themselves... wsObj = createObject(âwebserviceâ, âhttps://www.pathtowsdlurl.com/service.asmx?wsdlâ); ping = wsObj.theMethodInQuestion(arg1=âxâ, arg2=âyâ); Iâve also broken it down to a cfinvoke call with no luck. I can browse the wsdl just fine, I can cfhttp to the wsdl and dump it on the page... I can move the exact code over onto a box running the app servers mentioned above and run it without any trouble... I even tried to run it with the wsdl2java arguments in the createObject and in the cfinvoke (using âa, âw, and both) â no dice. Any ideas?? Thanks, Ferg ~| 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:343629 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
RE: Solr Errors
According to this you should be able to comment out caching altogether in the solrconfig.xml file. http://wiki.apache.org/solr/SolrCaching#Disabling_Caching Give it a shot Mary Jo - if it fixes it then you at least have an aswer for those who want/need to use solr. -Original Message- From: Mark A. Kruger [mailto:mkru...@cfwebtools.com] Sent: Friday, April 08, 2011 3:37 PM To: cf-talk Subject: RE: Solr Errors Mary Jo, There has to be a way to disable that warmcache process altogether... don't you think? -Mark Mark A. Kruger, MCSE, CFG (402) 408-3733 ext 105 www.cfwebtools.com www.coldfusionmuse.com www.necfug.com -Original Message- From: Raymond Camden [mailto:rcam...@gmail.com] Sent: Friday, April 08, 2011 2:25 PM To: cf-talk Subject: Re: Solr Errors To be clear - is this only for your unit tests? Could you possibly use sleep() to slow things down a bit? That's a hack - but would allow you to keep testing. On Fri, Apr 8, 2011 at 11:36 AM, Mary Jo Sminkey mary...@cfwebstore.com wrote: Well, by doing some research on the Solr boards and lists, I was able to figure out the problem. It appears to be due to CF committing after every cfindex tag and this causes Solr to open a new searcher and auto warm it (load from cache). If you are committing more frequently than the warming process, these searches pile up and you hit the error. So if you have a page that runs a lot of cfindex tags (as my unit tests were) you can easily hit this error. Problem is, I'm not sure how we can work around this easily. I tried setting the autoWarmCounts to 0 to see if I could reduce the startup time (and since my app does a lot more indexing at runtime than searches so slow startup is not a big issue) but I still hit the error when the number of searches exceeded the maximum set. I could try setting the limit for warming searches higher (setting it to 10 for instance fixes the problem with my tests) but that supposedly is a bit of a performance killer. In cases where my users are adding a batch of these data elements that I'm indexing, I'm almost certainly to bang into that limit again. In my case, it may mean we simply cannot use Solr for this, unless there's someway to batch the commits and just do one single one at the end of the request. What we need is something like a cftransaction tag for the cfindex tag. --- Mary Jo ~| 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:343630 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: I hate CFScript and I'm willing to pay for a CFScript -- CFtag parser
Start here, Michael: http://www.pcworld.com/article/224722/new_commodore_64_is_finally_herefor_real.html On Thu, Apr 7, 2011 at 4:36 PM, Michael Grant mgr...@modus.bz wrote: And I'm willing to pay for a C-64 version of Halo 3. On Thu, Apr 7, 2011 at 7:20 PM, Jeff Gladnick jeff.gladn...@gmail.comwrote: I actually don't hate cfscript, but I do hate that we have both tags and script based syntax for CFML. And since it started off as tags, I firmly believe that's the way it should stay. I understand lots of people feel differently, but it really sucks (for me) seeing all the new great open source projects being released in cfscript. Therefore I have created a $1000 bounty (I have pledged $250) to the first developer who can deliver a working cfscript -- cftag based parser for eclipse. http://www.pledgebank.com/CFScriptSucks People can still write in cfscript if they want to, but people who feel like me won't have to deal with it anymore. Please post flames below ~| 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:343631 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm