Re: Problem with pound signs
I use cfmail to send out thousands of emails a day and I have to restart the SMTP server once every 2 months I would guess. It's not frequent and it took 10 minutes to set up an email alert if the queue is above 3 files (would've take 2 minutes if I had see Nadel's blog post) ~| 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:348961 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Problem with pound signs
can we make this die now? No one cares whether it's a word or not. ~| 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:348143 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Problem with pound signs
I tried, buy I'll try again. I'm out, On 2011-10-14, at 7:58 AM, matt busche mrbus...@gmail.com wrote: can we make this die now? No one cares whether it's a word or not. ~| 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:348144 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Problem with pound signs
this is a no reply inbox, so there aren't any legitimate emails sitting in here. Deleting any message with reply or delay in the body is going to cause some valid messages to be lost because both words are in common usage. Just a thought. DEL ~| 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:346958 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Problem with pound signs
yes but auto responders and server delayed mails do not know that, so if you just consider all emails that come into thsi mailbox to be bounces you could be deleting legitimate users. On Tue, Aug 23, 2011 at 1:01 PM, matt busche mrbus...@gmail.com wrote: this is a no reply inbox, so there aren't any legitimate emails sitting in here. Deleting any message with reply or delay in the body is going to cause some valid messages to be lost because both words are in common usage. Just a thought. DEL ~| 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:346959 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Problem with pound signs
Alternatively, set the the outgoing mail's failto address to a different mailbox, so you know that all mail going to that box is a failure. -- WSS4CF - WS-Security framework for CF http://wss4cf.riaforge.org/ On 23 August 2011 20:07, Russ Michaels r...@michaels.me.uk wrote: yes but auto responders and server delayed mails do not know that, so if you just consider all emails that come into thsi mailbox to be bounces you could be deleting legitimate users. On Tue, Aug 23, 2011 at 1:01 PM, matt busche mrbus...@gmail.com wrote: this is a no reply inbox, so there aren't any legitimate emails sitting in here. Deleting any message with reply or delay in the body is going to cause some valid messages to be lost because both words are in common usage. Just a thought. DEL ~| 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:346960 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Problem with pound signs
Sorry, I wasn't clear. The replies and out of office messages are just deleted from the inbox, not from the subscription list. yes but auto responders and server delayed mails do not know that, so if you just consider all emails that come into thsi mailbox to be bounces you could be deleting legitimate users. ~| 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:346961 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Problem with pound signs
I'm not 100% sure all this code will work w/ CF5, but this is what I use. The JS is thanks to a UDF written by Ray Camden this code pulls all emails from an inbox and searches for anything that I've identified as a bounceback. Then it uses the UDF to find the email and then I add that email address to a list. This also delete out of office emails from the inbox. Hopefully this helps, Matt cfpop server= username= password= action=getAll name=getAllMail cfset DeleteOrder = '' cfoutput cfset Email_List = '' /!--- set a variable to hold the list of all the emails --- cfloop query=getAllMail cfif FROM CONTAINS 'postmaster' OR FROM CONTAINS 'MAILER-DAEMON' OR FROM CONTAINS 'Mail Delivery' OR Body CONTAINS 'Failed' OR Body CONTAINS 'no longer with' OR Body CONTAINS 'Notice' cfset emailList = Body / cfscript function getEmails(str) { var email = (['_a-z0-9-]+(\.['_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*\.(([a-z]{2,3})|(aero|coop|info|museum|name|jobs|travel))); var res = ; var marker = 1; var matches = ; matches = reFindNoCase(email,str,marker,marker); while(matches.len[1] gt 0) { res = listAppend(res,mid(str,matches.pos[1],matches.len[1])); marker = matches.pos[1] + matches.len[1]; matches = reFindNoCase(email,str,marker,marker); } return res; } /cfscript cfloop list=#getEmails(emailList)# index=k cfif NOT ListFind(Email_List,k) cfdump var=#k#br / cfquery datasource=Corporate_Production INSERT INTO InvalidEmails (TextBody) VALUES ('#Trim(k)#') /cfquery cfset DeleteOrder = ListPrepend(DeleteOrder, MessageNumber) cfset Email_List = ListAppend(Email_List,k) / /cfif /cfloop !--- Delete out of office emails --- cfelseif Body CONTAINS 'Out of Office' OR Subject CONTAINS 'Out of Office' cfset DeleteOrder = ListPrepend(DeleteOrder, MessageNumber) cfelseif Body CONTAINS 'Out of the Office' OR Subject CONTAINS 'Out of the Office' cfset DeleteOrder = ListPrepend(DeleteOrder, MessageNumber) cfelseif Body CONTAINS 'Reply' OR Subject CONTAINS 'Reply' cfset DeleteOrder = ListPrepend(DeleteOrder, MessageNumber) cfelseif Body CONTAINS 'Delay' OR Subject CONTAINS 'Delay' cfset DeleteOrder = ListPrepend(DeleteOrder, MessageNumber) /cfif /cfloop /cfoutput cfif DeleteOrder NEQ '' cfset Count = 0 / cfloop list=#DeleteOrder# delimiters=, index=i cfpop server= username= password= action=delete messagenumber=#i# name=deleteMail cfset Count = Count + 1 / /cfloop br /cfdump var=#Count# EMAILS FOUND /cfif cfquery DELETE FROM ML_EMAILS WHERE EMAIL IN (SELECT TEXTBODY FROM INVALIDEMAILS) /cfquery cfquery DELETE FROM INVALIDEMAILS /cfquery ~| 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:346951 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Problem with pound signs
Deleting any message with reply or delay in the body is going to cause some valid messages to be lost because both words are in common usage. Just a thought. On Mon, Aug 22, 2011 at 8:27 PM, matt busche mrbus...@gmail.com wrote: I'm not 100% sure all this code will work w/ CF5, but this is what I use. The JS is thanks to a UDF written by Ray Camden this code pulls all emails from an inbox and searches for anything that I've identified as a bounceback. Then it uses the UDF to find the email and then I add that email address to a list. This also delete out of office emails from the inbox. Hopefully this helps, Matt cfpop server= username= password= action=getAll name=getAllMail cfset DeleteOrder = '' cfoutput cfset Email_List = '' /!--- set a variable to hold the list of all the emails --- cfloop query=getAllMail cfif FROM CONTAINS 'postmaster' OR FROM CONTAINS 'MAILER-DAEMON' OR FROM CONTAINS 'Mail Delivery' OR Body CONTAINS 'Failed' OR Body CONTAINS 'no longer with' OR Body CONTAINS 'Notice' cfset emailList = Body / cfscript function getEmails(str) { var email = (['_a-z0-9-]+(\.['_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*\.(([a-z]{2,3})|(aero|coop|info|museum|name|jobs|travel))); var res = ; var marker = 1; var matches = ; matches = reFindNoCase(email,str,marker,marker); while(matches.len[1] gt 0) { res = listAppend(res,mid(str,matches.pos[1],matches.len[1])); marker = matches.pos[1] + matches.len[1]; matches = reFindNoCase(email,str,marker,marker); } return res; } /cfscript cfloop list=#getEmails(emailList)# index=k cfif NOT ListFind(Email_List,k) cfdump var=#k#br / cfquery datasource=Corporate_Production INSERT INTO InvalidEmails (TextBody) VALUES ('#Trim(k)#') /cfquery cfset DeleteOrder = ListPrepend(DeleteOrder, MessageNumber) cfset Email_List = ListAppend(Email_List,k) / /cfif /cfloop !--- Delete out of office emails --- cfelseif Body CONTAINS 'Out of Office' OR Subject CONTAINS 'Out of Office' cfset DeleteOrder = ListPrepend(DeleteOrder, MessageNumber) cfelseif Body CONTAINS 'Out of the Office' OR Subject CONTAINS 'Out of the Office' cfset DeleteOrder = ListPrepend(DeleteOrder, MessageNumber) cfelseif Body CONTAINS 'Reply' OR Subject CONTAINS 'Reply' cfset DeleteOrder = ListPrepend(DeleteOrder, MessageNumber) cfelseif Body CONTAINS 'Delay' OR Subject CONTAINS 'Delay' cfset DeleteOrder = ListPrepend(DeleteOrder, MessageNumber) /cfif /cfloop /cfoutput cfif DeleteOrder NEQ '' cfset Count = 0 / cfloop list=#DeleteOrder# delimiters=, index=i cfpop server= username= password= action=delete messagenumber=#i# name=deleteMail cfset Count = Count + 1 / /cfloop br /cfdump var=#Count# EMAILS FOUND /cfif cfquery DEL ~| 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:346954 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Problem with pound signs
when one programmer decides to do a mass search and replace and totally destroys a code base, then management directs you to do it by hand. That's because management doesn't know that the correct response to that was: 1) why didn't they check it on their local machine before committing? 1) why were the errors not picked up during code review? 2) how did any of this get past testing? ~| 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:345902 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Problem with pound signs
( Although the management can probably at least count to three correctly. :$ ) ~| 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:345903 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Problem with pound signs
I thought you were doing a Fibonacci series. On Wed, Jun 29, 2011 at 8:26 AM, Peter Boughton bought...@gmail.com wrote: ( Although the management can probably at least count to three correctly. :$ ) ~| 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:345910 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Problem with pound signs
I tried it out. It works sort-of. It only lists the first time the single pound sign happened. While this identifies the file you have to rescan just to find the next error. Someone else mentioned that manually fixing would be boring and tedious. I agree with that but when one programmer decides to do a mass search and replace and totally destroys a code base, then management directs you to do it by hand. :( Steve Sent from my iPhone On Jun 25, 2011, at 5:01 PM, Raymond Camden rcam...@gmail.com wrote: I'll forgive you - once. ;) I'm still waiting to here back from Steven to see if this method worked for him. ~| 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:345789 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Problem with pound signs
Someone else mentioned that manually fixing would be boring and tedious. I agree with that but when one programmer decides to do a mass search and replace and totally destroys a code base, then management directs you to do it by hand. :( backup and restore? 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/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:345792 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Problem with pound signs
Yeah but for us that involved getting another group involved and lots of programmer down-time. Sent from my iPhone On Jun 27, 2011, at 1:45 PM, Dave Watts dwa...@figleaf.com wrote: Someone else mentioned that manually fixing would be boring and tedious. I agree with that but when one programmer decides to do a mass search and replace and totally destroys a code base, then management directs you to do it by hand. :( backup and restore? Dave Watts, CTO, Fig Leaf Software http://www.figleaf.com/ http://training.figleaf.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:345793 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
RE: Problem with pound signs
Times like this you have to love the revision control system, as well as Eclipse for this type of things. Regards, Andrew Scott http://www.andyscott.id.au/ -Original Message- From: Dave Watts [mailto:dwa...@figleaf.com] Sent: Tuesday, 28 June 2011 3:45 AM To: cf-talk Subject: Re: Problem with pound signs Someone else mentioned that manually fixing would be boring and tedious. I agree with that but when one programmer decides to do a mass search and replace and totally destroys a code base, then management directs you to do it by hand. :( backup and restore? Dave Watts, CTO, Fig Leaf Software http://www.figleaf.com/ http://training.figleaf.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:345819 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Problem with pound signs
Here is a crazy idea - wouldn't what you are looking for be a runtime error? I would expect that to be a compile-time error, actually. But the code analyzer might still find it. 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/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:345685 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Problem with pound signs
Here is a crazy idea - wouldn't what you are looking for be a runtime error? I would expect that to be a compile-time error, actually. But the code analyzer might still find it. Aaaand now I've gotten to the bottom of the thread, and see this has already been covered. D'oh! 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/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:345686 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Problem with pound signs
I'll forgive you - once. ;) I'm still waiting to here back from Steven to see if this method worked for him. On Sat, Jun 25, 2011 at 12:12 PM, Dave Watts dwa...@figleaf.com wrote: Here is a crazy idea - wouldn't what you are looking for be a runtime error? I would expect that to be a compile-time error, actually. But the code analyzer might still find it. Aaaand now I've gotten to the bottom of the thread, and see this has already been covered. D'oh! 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/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:345694 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Problem with pound signs
well any variable has to be #text# with no spaces, so you could search for any #'s that has some text and then a space which would identify missing closing hashes. something like #.+[:space] On Fri, Jun 24, 2011 at 3:41 AM, Steven Durette st...@durette.org wrote: Hi all, I've been given some code to fix that others have tried but had little luck. I believe I've found the major culprit, but I want to use regex to find it but I'm a little stumped. The errors are usually one of two things, either single pound signs in between cfoutputs (ie: font tag with color) or many places where the original programmers meant to use a variable but only put a pound sign on one side of the variable. Any ideas of the regex I should use? Steve Sent from my iPhone ~| 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:345615 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Problem with pound signs
well any variable has to be #text# with no spaces No it doesn't. If you felt like it, you could do... # text # That is perfectly valid and works on all the CFML engines. However, even if a valid assumption for the codebase in question, trying to match a hash followed by spaces would results in matching... #text# this #text# Which is obviously not desired. ~| 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:345617 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Problem with pound signs
I would start by finding/escaping identifiable single hashes - i.e. the font colours and HTML entities. Using a regex search that supports lookbehind (so not CF itself, but ok with CFEclipse/CFBuilder) you can do: (?!#)#(?=[A-F0-9]{3,6}\s*+[';]) Which assumes colours must end with or ' or ; which I think covers both HTML attributes and CSS use. For HTML entities: (?=)#(?=\d+;|x[A-F0-9]+;) Oh and # parts in links... something like: (?=\.(ht|cf)ml?)#(?=[^#']++[']) Those three are all written to just match the # itself, so you can replace with ## and it should work. (Obviously make sure you have a backup of the code before changing anything though.) Once all the known single hashes are escaped, I'd just attempt to compile all the templates using cfcompile, and see what errors crop up from that. ~| 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:345618 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
RE: Problem with pound signs
Russ, you should know better. cfset myVariable = application.datasource / Has no hashes nor should it either. Regards, Andrew Scott http://www.andyscott.id.au/ -Original Message- From: Russ Michaels [mailto:r...@michaels.me.uk] Sent: Friday, 24 June 2011 7:32 PM To: cf-talk Subject: Re: Problem with pound signs well any variable has to be #text# with no spaces, so you could search for any #'s that has some text and then a space which would identify missing closing hashes. something like #.+[:space] ~| 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:345619 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Problem with pound signs
Andrew, I believe you misread the original question. The author stated he was trying to find incorrect uses of pound signs in a code base. This is what he said: The errors are usually one of two things, either single pound signs in between cfoutputs (ie: font tag with color) or many places where the original programmers meant to use a variable but only put a pound sign on one side of the variable. On Fri, Jun 24, 2011 at 6:07 AM, Andrew Scott andr...@andyscott.id.au wrote: Russ, you should know better. cfset myVariable = application.datasource / Has no hashes nor should it either. Regards, Andrew Scott http://www.andyscott.id.au/ ~| 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:345620 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
RE: Problem with pound signs
Ray, no I did read that I was referring to the comment that Russ made about variables all being wrapped in hashes. Regards, Andrew Scott http://www.andyscott.id.au/ -Original Message- From: Raymond Camden [mailto:rcam...@gmail.com] Sent: Friday, 24 June 2011 9:35 PM To: cf-talk Subject: Re: Problem with pound signs Andrew, I believe you misread the original question. The author stated he was trying to find incorrect uses of pound signs in a code base. This is what he said: The errors are usually one of two things, either single pound signs in between cfoutputs (ie: font tag with color) or many places where the original programmers meant to use a variable but only put a pound sign on one side of the variable. ~| 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:345621 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Problem with pound signs
Err -but the original poster was trying to find bad CFML code with unbalanced hash signs. His comment was referring to that - not variables in general. I'm sure Russ knows that # signs aren't necessary in regards to your response. On Fri, Jun 24, 2011 at 7:07 AM, Andrew Scott andr...@andyscott.id.au wrote: Ray, no I did read that I was referring to the comment that Russ made about variables all being wrapped in hashes. Regards, Andrew Scott http://www.andyscott.id.au/ ~| 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:345622 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Problem with pound signs
I would write first some mini syntax analyser to find all text in between CFOUTPUT... and /CFOUTPUT, keeping in mind that they may be stacked in several levels. Then for each string found, use regexp to find single # followed by any character illegal in a variable name before a next # or end of string. Ie: #[a-zA-z0-9_]+([^a-zA-z0-9_#]|$) This does not take in account eventual # inside delimited strings. ~| 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:345626 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Problem with pound signs
yes, but as that has no hashes, it wont be causing a problem will it. On Fri, Jun 24, 2011 at 12:07 PM, Andrew Scott andr...@andyscott.id.auwrote: Russ, you should know better. cfset myVariable = application.datasource / Has no hashes nor should it either. Regards, Andrew Scott http://www.andyscott.id.au/ -Original Message- From: Russ Michaels [mailto:r...@michaels.me.uk] Sent: Friday, 24 June 2011 7:32 PM To: cf-talk Subject: Re: Problem with pound signs well any variable has to be #text# with no spaces, so you could search for any #'s that has some text and then a space which would identify missing closing hashes. something like #.+[:space] ~| 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:345630 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
RE: Problem with pound signs
All these responses are really helping! Ok so here is what I'm going to do so far... I have a CF Application that can search through the code base and find stuff inside of tags or between opening and closing tags, but I have to tell it what tag and give it regex to do the search. I'm breaking this down into two steps first I'm going to search for the color codes in between cfoutputs that have a single #. From what I've been reading so far I think this regex should work: [^#]#[a-fA-F0-9]{3,6} If I'm correct it would pick up #FF3366 but not ##FF3366. What do you think about that regex? I'll deal with the missing # signs later after I get the color codes fixed. Thanks, Steve ~| 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:345632 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Problem with pound signs
Here is a crazy idea - wouldn't what you are looking for be a runtime error? If so - can't you use the Code Analyzer in the CF Admin to scan the folder and find them all at once? On Fri, Jun 24, 2011 at 10:41 AM, Steven Durette st...@durette.org wrote: All these responses are really helping! Ok so here is what I'm going to do so far... I have a CF Application that can search through the code base and find stuff inside of tags or between opening and closing tags, but I have to tell it what tag and give it regex to do the search. I'm breaking this down into two steps first I'm going to search for the color codes in between cfoutputs that have a single #. From what I've been reading so far I think this regex should work: [^#]#[a-fA-F0-9]{3,6} If I'm correct it would pick up #FF3366 but not ##FF3366. What do you think about that regex? I'll deal with the missing # signs later after I get the color codes fixed. Thanks, Steve ~| 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:345634 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
RE: Problem with pound signs
Dohh. Didn't think of that... -Original Message- From: Raymond Camden [mailto:rcam...@gmail.com] Sent: Friday, June 24, 2011 12:23 PM To: cf-talk Subject: Re: Problem with pound signs Here is a crazy idea - wouldn't what you are looking for be a runtime error? If so - can't you use the Code Analyzer in the CF Admin to scan the folder and find them all at once? On Fri, Jun 24, 2011 at 10:41 AM, Steven Durette st...@durette.org wrote: All these responses are really helping! Ok so here is what I'm going to do so far... I have a CF Application that can search through the code base and find stuff inside of tags or between opening and closing tags, but I have to tell it what tag and give it regex to do the search. I'm breaking this down into two steps first I'm going to search for the color codes in between cfoutputs that have a single #. From what I've been reading so far I think this regex should work: [^#]#[a-fA-F0-9]{3,6} If I'm correct it would pick up #FF3366 but not ##FF3366. What do you think about that regex? I'll deal with the missing # signs later after I get the color codes fixed. Thanks, Steve ~| 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:345635 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Problem with pound signs
I just tried a test on this. I told the CA to filter by error only. I edited one file to add cfoutput#foo/cfoutput and the CA correctly found it. On Fri, Jun 24, 2011 at 11:22 AM, Raymond Camden rcam...@gmail.com wrote: Here is a crazy idea - wouldn't what you are looking for be a runtime error? If so - can't you use the Code Analyzer in the CF Admin to scan the folder and find them all at once? On Fri, Jun 24, 2011 at 10:41 AM, Steven Durette st...@durette.org wrote: ~| 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:345636 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Problem with pound signs
Let me know if it works well for you. I think it could be a much simpler solution. If so - I'll blog about it. On Fri, Jun 24, 2011 at 11:24 AM, DURETTE, STEVEN J (ATTASIAIT) sd1...@att.com wrote: Dohh. Didn't think of that... -Original Message- From: Raymond Camden [mailto:rcam...@gmail.com] Sent: Friday, June 24, 2011 12:23 PM To: cf-talk Subject: Re: Problem with pound signs Here is a crazy idea - wouldn't what you are looking for be a runtime error? If so - can't you use the Code Analyzer in the CF Admin to scan the folder and find them all at once? On Fri, Jun 24, 2011 at 10:41 AM, Steven Durette st...@durette.org wrote: All these responses are really helping! Ok so here is what I'm going to do so far... I have a CF Application that can search through the code base and find stuff inside of tags or between opening and closing tags, but I have to tell it what tag and give it regex to do the search. I'm breaking this down into two steps first I'm going to search for the color codes in between cfoutputs that have a single #. From what I've been reading so far I think this regex should work: [^#]#[a-fA-F0-9]{3,6} If I'm correct it would pick up #FF3366 but not ##FF3366. What do you think about that regex? I'll deal with the missing # signs later after I get the color codes fixed. Thanks, Steve ~| 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:345637 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Problem with pound signs
Steven wrote: From what I've been reading so far I think this regex should work: [^#]#[a-fA-F0-9]{3,6} If I'm correct it would pick up #FF3366 but not ##FF3366. That will not just pick up #FF3366 it will *also* pick-up the character before that (either space, colon, quote, etc). If you are simply identifying matches, that doesn't make a huge difference - however, it also means you need to manually fix matches, which is boring. I explicitly used a negative lookbehind to exclude any preceeding hash without also matching any characters, so that they can be escaped automatically with a simple search/replace. (You only need the a-f part if you are doing a case-sensitive match/replace - given that this is as simple as ticking/unticking a checkbox in an IDE, I didn't bother with that in any of my expressions.) If you really want to use your CF application for this, you can easily access java regex (which supports lookbehinds) by doing: NewString = OldString.replaceAll('regex','replacement') Which probably means you spend much less time manually escaping colours everywhere. ~| 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:345644 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Problem with pound signs
Ray wrote: Here is a crazy idea - wouldn't what you are looking for be a runtime error? If so - can't you use the Code Analyzer in the CF Admin to scan the folder and find them all at once? Guessing you meant to write compile-time there (since that's where the error is; when compiling the template it'll find incorrect syntax, without needing to run it). This is what I meant when I said use cfcompile - forgot there was an admin interface that did it. Of course, I guess this will stop at the first error in each file, so it will need to be executed multiple times until no errors are reported. ~| 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:345645 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Problem with pound signs
Of course, however you do this, you'll want to make sure you don't inadvertently escape colours/etc that are *not* inside cfoutput (or any tags that emulate cfoutput; cfmail, cfquery, etc). ~| 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:345646 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Problem with pound signs
Um. Yeah. I meant that. Really. Yeah. ;) On Fri, Jun 24, 2011 at 2:36 PM, Peter Boughton bought...@gmail.com wrote: Ray wrote: Here is a crazy idea - wouldn't what you are looking for be a runtime error? If so - can't you use the Code Analyzer in the CF Admin to scan the folder and find them all at once? Guessing you meant to write compile-time there (since that's where the error is; when compiling the template it'll find incorrect syntax, without needing to run it). This is what I meant when I said use cfcompile - forgot there was an admin interface that did it. Of course, I guess this will stop at the first error in each file, so it will need to be executed multiple times until no errors are reported. ~| 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:345651 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm