Re: CF Licensing on a VMWARE Server instance?

2006-02-15 Thread John Beynon
the virtual server solution from cfxhosting.com is VMWare based

I was with them a while and it worked great - they have 2 (was 4)
virtual servers per physical device and comes loaded with CF7. So i
guess they just have 1 CF per physical server..

These days, I shunted my sites over to GoDaddy virtual servers and so
far it's been great - given the $$$ I've actually got two virtual
servers from GoDaddy, a web server and a SQL2005 server, however
Godaddy are using Virtuozzo not vmware.ohn

hth

john


On 15/02/06, Chris Velevitch [EMAIL PROTECTED] wrote:
 If it's for development/testing purposes the developer version is
 free, so there's no limit to the number of machines (virtual or
 otherwise) you can install it on.


 Chris
 --
 Chris Velevitch
 Manager - Sydney Flash Platform Developers Group
 www.flashdev.org.au

 

~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:232316
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations  Support: http://www.houseoffusion.com/tiny.cfm/54


RE: CF Licensing on a VMWARE Server instance?

2006-02-15 Thread Big Mad Kev
Developer is still limited this is to ensure that every thing works as it
will on live and thus needs to be full blown]

Cheers 

-Original Message-
From: Chris Velevitch [mailto:[EMAIL PROTECTED] 
Sent: 15 February 2006 07:02
To: CF-Talk
Subject: Re: CF Licensing on a VMWARE Server instance?

If it's for development/testing purposes the developer version is free, so
there's no limit to the number of machines (virtual or
otherwise) you can install it on.


Chris
--
Chris Velevitch
Manager - Sydney Flash Platform Developers Group www.flashdev.org.au



~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:232317
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations  Support: http://www.houseoffusion.com/tiny.cfm/54


Re: Numeric field woes

2006-02-15 Thread Roberto Perez
At 10:04 PM 2/14/2006, Charlie Griefer you wrote:

  - if there are only spaces, it throws an error;
  - if there is text (e.g., n/a), it throws an error.

it throws an error?  what is it?  the regex?  the query?  what 
is the error?


If I type a space or text in the numeric input field calle hsGPA, I get this:

Error Executing Database Query.
[MERANT][SequeLink JDBC Driver][ODBC Socket][Microsoft][ODBC 
Microsoft Access Driver] Syntax error in UPDATE statement.

SQLUPDATE verifiedAppl_tb SET applLevel= 'Undergraduate' , hsGPA 
= , collGRE = 840 WHERE applicationID= 1


The UPDATE code looks like this:

UPDATE verifiedAppl_tb SET applLevel=
  cfif IsDefined(FORM.applLevel) AND #FORM.applLevel# NEQ 
'#FORM.applLevel#'
  cfelse
 NULL
  /cfif
, hsGPA =
  cfif IsDefined(FORM.hsGPA) AND #FORM.hsGPA# NEQ 
  #rereplace(FORM.hsGPA, '[^0-9/.]', '', 'all')#
  cfelse
 NULL
  /cfif
, collGRE =
cfif IsDefined(FORM.collGRE) AND #FORM.collGRE# NEQ 
   #FORM.collGRE#
cfelse
   NULL
/cfif
WHERE applicationID= #applID#



What I'm thinking is that the CFIF that should enter the NULL value 
is not being triggered, and the hsGPA field gets an empty record, and 
the DB does not like that. What about processing the REREPLACE 
outside of the query, assign the resulting string to a variable, and 
then checking against that variable? In that case, if the variable is 
empty, the CFIF will trigger the NULL option.

Roberto







--
Charlie Griefer


...All the world shall be your enemy, Prince with a Thousand Enemies,
and whenever they catch you, they will kill you. But first they must catch
you, digger, listener, runner, prince with a swift warning.
Be cunning and full of tricks and your people shall never be destroyed.



~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:232318
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations  Support: http://www.houseoffusion.com/tiny.cfm/54


Re: OT: CSS Positioning

2006-02-15 Thread Thomas Chiverton
On Tuesday 14 February 2006 15:55, Robert Everland III wrote:
 I want to play around with using CSS instead of using tables to position
 things. Does anyone have some sites that they use as an example of this
 that I can go off of.

CSS Zen Garden.

-- 

Tom Chiverton 
Advanced ColdFusion Programmer

~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:232319
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations  Support: http://www.houseoffusion.com/tiny.cfm/54


Re: Depressed Press BBML tag

2006-02-15 Thread Thomas Chiverton
On Tuesday 14 February 2006 04:47, Rick Root wrote:
 There are a lot of weird characters in the text that i've never noticed
 until now..

Is the tag encryped, or a CFX or something ?

-- 

Tom Chiverton 
Advanced ColdFusion Programmer

~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:232320
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations  Support: http://www.houseoffusion.com/tiny.cfm/54


Re: Depressed Press BBML tag

2006-02-15 Thread Rick Root
Thomas Chiverton wrote:
 On Tuesday 14 February 2006 04:47, Rick Root wrote:
 
There are a lot of weird characters in the text that i've never noticed
until now..
 
 Is the tag encryped, or a CFX or something ?

No... it turned out that the weird characters were character entities 
like Ugrave, ugrave, etc and for some reason the files weren't happy 
on my linux server.  What I ended up doing - and I shared my results 
with the author, was changing the funky characters - which neither VI 
nor notepad nor homesite displayed properly, to chr() functions.

Rick


~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:232321
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations  Support: http://www.houseoffusion.com/tiny.cfm/54


Multiserver install on W2K3 and McAfee 8.0i

2006-02-15 Thread Beru
Hello,

We are experiencing some problems when creating new instances with a
CF7.01multiserver install : After we create a new instance, we reboot,
and the
terminal services from W2K3 does not respond anymore (does not start). While
looking to the event log we get : Could not contact Filter Driver.  Error =
0x2 : The system cannot find the file specified. On McAfee's site, we
get the KB 40534 which basically says that we should re-install the driver.
Once we re-install this driver, and reboot the server, everything back to
normal.

Question is : how to avoid this problem? I already excluded the entire /JRUN
dir from scanning... Anything else I should monitor?

Any hint welcome!
Albert


~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:232323
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations  Support: http://www.houseoffusion.com/tiny.cfm/54


Re: OT: ColdFusion and Flex

2006-02-15 Thread Mark Drew
Hi

Sorry for the lack of updates, I have been busy adding a LOT of  
features to CFEclipse, and I am in the process of polishing a lot of  
the features off at the moment in preparation for the unveiling of  
them at the London CFUG

I shall add a note to the cfeclipse homepage just to keep you all up  
to date :D

MD


On 14 Feb 2006, at 01:34, James Holmes wrote:

 I was doing this for a while, but DW8 has so many enhancements that I
 don't get much benefit in swapping. The only thing in CFE that I miss
 when using DW is the CFC methods view (i.e. being able to jump
 directly to the method I want by clicking in an alpha-sorted list is
 nice). Everything else I liked (e.g. code folding) is there now.

 On 2/14/06, Sean Corfield [EMAIL PROTECTED] wrote:
 On 2/11/06, Aaron Rouse [EMAIL PROTECTED] wrote:
 I was wondering if it might mean we will eventually see them  
 replace DW with
 something built on Eclipse, at least for CFM dev work.

 FWIW, I use DW for all my visual layout work (CF or HTML) and Eclipse
 (with CFEclipse) for all of my non-visual work (CF). The CFEclipse
 project will never add a visual layout tool for CSS/HTML so I don't
 see ever being a replacement for DW in that area.

 --
 CFAJAX docs and other useful articles:
 http://jr-holmes.coldfusionjournal.com/

 

~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:232324
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations  Support: http://www.houseoffusion.com/tiny.cfm/54


RE: CSS Positioning

2006-02-15 Thread Kevin Graeme
I know you asked for web sites, but the books Eric Meyer on CSS and More
Eric Meyer on CSS are really good project tutorials that step you through
various actual implementations of using CSS.

Most sites I see cover the concepts but don't take you through the learning
process of implementing them.

---
Kevin Graeme
Cooperative Extension Technology Services
University of Wisconsin-Extension
 

 -Original Message-
 From: Robert Everland III [mailto:[EMAIL PROTECTED] 
 Sent: Tuesday, February 14, 2006 9:56 AM
 To: CF-Talk
 Subject: OT: CSS Positioning
 
 I want to play around with using CSS instead of using tables 
 to position things. Does anyone have some sites that they use 
 as an example of this that I can go off of.
 
 
 
 Bob
 
 

~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:232325
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations  Support: http://www.houseoffusion.com/tiny.cfm/54


Sessions timing out incorrectly

2006-02-15 Thread brad f
I am having a the occasional problem with session timeouts.. We have it setup 
in CF to timeout sessions after 1 hr of idle time. For some reason we are now, 
sometimes, having a problem with people being logged out after 3 or 4 minutes. 
The only solution is to restart the IIS services on the web box and this seems 
to stabalize the problem. Our setup is CF 7, latest update running atop of JRUN 
4 (updater 6), 3 web boxes load balanced by Local Director and 6 clusterd 
instances of CF 

~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:232327
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations  Support: http://www.houseoffusion.com/tiny.cfm/54


Try/Catch vs. direct error handling

2006-02-15 Thread Michael Dinowitz
This is a question of best practices and why. When I know there's a chance of a 
specific error, I tend to code specifically to handle it. Others code generally 
using try/catch. Which is seen as best in other languages and why? I doubt 
there's any real performance issue between them, so it's a question of industry 
standard and style.

For example, if I know an ID is needed on a page and it has to be a numeric I'd 
do:
CFIF Not IsDefined('ID')
An ID is needed
CFELSEIF Not IsNumeric(ID)
The passed ID needs to be numeric
/CFIF

Others do:
CFTRY
cfparam name=ID type=numeric
CFCATCH
You must pass a numeric ID
/CFCATCH
/CFTRY


~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:232328
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations  Support: http://www.houseoffusion.com/tiny.cfm/54


RE: dump memory in Coldfusion

2006-02-15 Thread Robertson-Ravo, Neil (RX)
You could force a GC I suppose ( System.gc() )- I am not sure that this will
work directly as I am not sure you can explicitly force it.





-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
Sent: 15 February 2006 15:19
To: CF-Talk
Subject: dump memory in Coldfusion

Is there a way to access the java underneath ColdFusion and force a clearing
out of the memory used by the heap? For example, cookie and DB based client
vars create a memory structure that does not time out. This, along with all
variable usage is contained within the heap. I'd like to just clear the heap
without restarting CF.
Is it possible?



~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:232329
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations  Support: http://www.houseoffusion.com/tiny.cfm/54


RE: Try/Catch vs. direct error handling

2006-02-15 Thread Robertson-Ravo, Neil (RX)
Good Q, either way is correct I suppose...like you noted it's developer
preference.

Obviously with the CFIF method you are not catching a CF error per se - you
are preventing it from happening full stop and catching it with defensive
coding.  In some cases such as a URL I would simply refresh the current page
back to the pre-manipulated/non numeric ID URL.

I suppose in the case of passing an ID say from a form I would try and catch
it via JS first, then via CF but the whole CFIF block would be in a
cftry/block as well to catch for any unforeseen errors no necessarily
related to the ID.







-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
Sent: 15 February 2006 15:38
To: CF-Talk
Subject: Try/Catch vs. direct error handling

This is a question of best practices and why. When I know there's a chance
of a specific error, I tend to code specifically to handle it. Others code
generally using try/catch. Which is seen as best in other languages and why?
I doubt there's any real performance issue between them, so it's a question
of industry standard and style.

For example, if I know an ID is needed on a page and it has to be a numeric
I'd do:
CFIF Not IsDefined('ID')
An ID is needed
CFELSEIF Not IsNumeric(ID)
The passed ID needs to be numeric
/CFIF

Others do:
CFTRY
cfparam name=ID type=numeric
CFCATCH
You must pass a numeric ID
/CFCATCH
/CFTRY




~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:232330
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations  Support: http://www.houseoffusion.com/tiny.cfm/54


cfdocument how to use on a .cfm to print a form?

2006-02-15 Thread Caroline Tobey
I am new to using MX and need to add a button to a .cfm form that has 
numerous input fields.  The user will need to input and save their data 
then click a button to print the completed form. How do I do this using 
a button on the form that will say printerfreindly output then the 
cfdocument tag in my code?  Any examplse would be wonderful thanks.


-
 Yahoo! Mail
 Use Photomail to share photos without annoying attachments.

~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:232331
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations  Support: http://www.houseoffusion.com/tiny.cfm/54


Re: Try/Catch vs. direct error handling

2006-02-15 Thread John C. Bland II
I think it depends on the circumstances. For all heavy hitting (queries,
ftp, pop, file manipulation, etc) I use try/catch. In the simple case of
checking for a variable I think it is overkill to use try/catch when a
simple cfif can fix the prob for you. I wouldn't use the block you have but
a 1 line cfif with a cfelse would suffice my typical situations.

cfif isDefined(ID) AND NOT isNumeric(ID)
handle it
cfelse
set ID
/cfif

On 2/15/06, Michael Dinowitz [EMAIL PROTECTED] wrote:

 This is a question of best practices and why. When I know there's a chance
 of a specific error, I tend to code specifically to handle it. Others code
 generally using try/catch. Which is seen as best in other languages and why?
 I doubt there's any real performance issue between them, so it's a question
 of industry standard and style.

 For example, if I know an ID is needed on a page and it has to be a
 numeric I'd do:
 CFIF Not IsDefined('ID')
 An ID is needed
 CFELSEIF Not IsNumeric(ID)
 The passed ID needs to be numeric
 /CFIF

 Others do:
 CFTRY
 cfparam name=ID type=numeric
 CFCATCH
 You must pass a numeric ID
 /CFCATCH
 /CFTRY


 

~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:232332
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations  Support: http://www.houseoffusion.com/tiny.cfm/54


RE: Try/Catch vs. direct error handling

2006-02-15 Thread Dave Francis
You would use the block he has if you were running CF5

-Original Message-
From: John C. Bland II [mailto:[EMAIL PROTECTED]
Sent: Wednesday, February 15, 2006 11:51 AM
To: CF-Talk
Subject: Re: Try/Catch vs. direct error handling


I think it depends on the circumstances. For all heavy hitting (queries,
ftp, pop, file manipulation, etc) I use try/catch. In the simple case of
checking for a variable I think it is overkill to use try/catch when a
simple cfif can fix the prob for you. I wouldn't use the block you have but
a 1 line cfif with a cfelse would suffice my typical situations.

cfif isDefined(ID) AND NOT isNumeric(ID)
handle it
cfelse
set ID
/cfif

On 2/15/06, Michael Dinowitz [EMAIL PROTECTED] wrote:

 This is a question of best practices and why. When I know there's a chance
 of a specific error, I tend to code specifically to handle it. Others code
 generally using try/catch. Which is seen as best in other languages and
why?
 I doubt there's any real performance issue between them, so it's a
question
 of industry standard and style.

 For example, if I know an ID is needed on a page and it has to be a
 numeric I'd do:
 CFIF Not IsDefined('ID')
 An ID is needed
 CFELSEIF Not IsNumeric(ID)
 The passed ID needs to be numeric
 /CFIF

 Others do:
 CFTRY
 cfparam name=ID type=numeric
 CFCATCH
 You must pass a numeric ID
 /CFCATCH
 /CFTRY






~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:232333
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations  Support: http://www.houseoffusion.com/tiny.cfm/54


finding the base of the application

2006-02-15 Thread Joe Ferraro
I'm trying to figure out good way to find the base of the application, but I
haven't come up with anything fool proof yet.

lets say my application is

C:\Inetpub\wwwroot\application\

How can I find the C:\Inetpub\wwwroot\ ?

Thanks,

Joe


~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:232334
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations  Support: http://www.houseoffusion.com/tiny.cfm/54


RE: Try/Catch vs. direct error handling

2006-02-15 Thread Russ
Why is that again?  Are you saying CF5 cannot handle lazy evaluation?  I
think that was CF4. 

Russ

 -Original Message-
 From: Dave Francis [mailto:[EMAIL PROTECTED]
 Sent: Wednesday, February 15, 2006 12:01 PM
 To: CF-Talk
 Subject: RE: Try/Catch vs. direct error handling
 
 You would use the block he has if you were running CF5
 
 -Original Message-
 From: John C. Bland II [mailto:[EMAIL PROTECTED]
 Sent: Wednesday, February 15, 2006 11:51 AM
 To: CF-Talk
 Subject: Re: Try/Catch vs. direct error handling
 
 
 I think it depends on the circumstances. For all heavy hitting (queries,
 ftp, pop, file manipulation, etc) I use try/catch. In the simple case of
 checking for a variable I think it is overkill to use try/catch when a
 simple cfif can fix the prob for you. I wouldn't use the block you have
 but
 a 1 line cfif with a cfelse would suffice my typical situations.
 
 cfif isDefined(ID) AND NOT isNumeric(ID)
 handle it
 cfelse
 set ID
 /cfif
 
 On 2/15/06, Michael Dinowitz [EMAIL PROTECTED] wrote:
 
  This is a question of best practices and why. When I know there's a
 chance
  of a specific error, I tend to code specifically to handle it. Others
 code
  generally using try/catch. Which is seen as best in other languages and
 why?
  I doubt there's any real performance issue between them, so it's a
 question
  of industry standard and style.
 
  For example, if I know an ID is needed on a page and it has to be a
  numeric I'd do:
  CFIF Not IsDefined('ID')
  An ID is needed
  CFELSEIF Not IsNumeric(ID)
  The passed ID needs to be numeric
  /CFIF
 
  Others do:
  CFTRY
  cfparam name=ID type=numeric
  CFCATCH
  You must pass a numeric ID
  /CFCATCH
  /CFTRY
 
 
 
 
 
 
 

~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:232335
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations  Support: http://www.houseoffusion.com/tiny.cfm/54


RE: Try/Catch vs. direct error handling

2006-02-15 Thread Brad Wood
While we are talking about try/catch's, does anybody know if there is a
performance hit at all (worth mentioning) when you use try catch.

The main reason I ask is because I work with someone who uses try/catch
around EVERYTHING HE EVER CODES.  He will even use it to terminate loops
and in place of if statements.  
For example, instead of a loop from 1 to arraylen() he would just until
an array out of bounds error was thrown, and then move on.  
Or, instead of an isdefined(), he will try to access the variable, and
then put his cfelse in the catch. 
I find this over-use to be excessive, but he claims it is perfectly
rational and has no performance implications to process hundreds and
hundreds of try catch's per template.

Any light you guys can shed?

Thanks.

~Brad


~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:232336
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations  Support: http://www.houseoffusion.com/tiny.cfm/54


Re: Try/Catch vs. direct error handling

2006-02-15 Thread John C. Bland II
Ahh...didn't realize that. :-) lol. We're on 7 and I never think back to
older versions.

On 2/15/06, Dave Francis [EMAIL PROTECTED] wrote:

 You would use the block he has if you were running CF5

 -Original Message-
 From: John C. Bland II [mailto:[EMAIL PROTECTED]
 Sent: Wednesday, February 15, 2006 11:51 AM
 To: CF-Talk
 Subject: Re: Try/Catch vs. direct error handling


 I think it depends on the circumstances. For all heavy hitting (queries,
 ftp, pop, file manipulation, etc) I use try/catch. In the simple case of
 checking for a variable I think it is overkill to use try/catch when a
 simple cfif can fix the prob for you. I wouldn't use the block you have
 but
 a 1 line cfif with a cfelse would suffice my typical situations.

 cfif isDefined(ID) AND NOT isNumeric(ID)
 handle it
 cfelse
 set ID
 /cfif

 On 2/15/06, Michael Dinowitz [EMAIL PROTECTED] wrote:
 
  This is a question of best practices and why. When I know there's a
 chance
  of a specific error, I tend to code specifically to handle it. Others
 code
  generally using try/catch. Which is seen as best in other languages and
 why?
  I doubt there's any real performance issue between them, so it's a
 question
  of industry standard and style.
 
  For example, if I know an ID is needed on a page and it has to be a
  numeric I'd do:
  CFIF Not IsDefined('ID')
  An ID is needed
  CFELSEIF Not IsNumeric(ID)
  The passed ID needs to be numeric
  /CFIF
 
  Others do:
  CFTRY
  cfparam name=ID type=numeric
  CFCATCH
  You must pass a numeric ID
  /CFCATCH
  /CFTRY
 
 
 



 

~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:232337
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations  Support: http://www.houseoffusion.com/tiny.cfm/54


Re: Try/Catch vs. direct error handling

2006-02-15 Thread Ben Doom
I generally try to avoid try/catch except if
a) there's no other good way to trap for the error
b) it's a seldom-used utility function and it doesn't pay to write it better
So, yeah.  I'm with you in this one.

--Ben

Michael Dinowitz wrote:
 This is a question of best practices and why. When I know there's a chance of 
 a specific error, I tend to code specifically to handle it. Others code 
 generally using try/catch. Which is seen as best in other languages and why? 
 I doubt there's any real performance issue between them, so it's a question 
 of industry standard and style.
 
 For example, if I know an ID is needed on a page and it has to be a numeric 
 I'd do:
 CFIF Not IsDefined('ID')
   An ID is needed
 CFELSEIF Not IsNumeric(ID)
   The passed ID needs to be numeric
 /CFIF
 
 Others do:
 CFTRY
   cfparam name=ID type=numeric
   CFCATCH
   You must pass a numeric ID
   /CFCATCH
 /CFTRY
 
 
 

~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:232338
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations  Support: http://www.houseoffusion.com/tiny.cfm/54


Re: Try/Catch vs. direct error handling

2006-02-15 Thread Bryan Stevenson
 The main reason I ask is because I work with someone who uses try/catch
 around EVERYTHING HE EVER CODES.  He will even use it to terminate loops
 and in place of if statements.
 For example, instead of a loop from 1 to arraylen() he would just until
 an array out of bounds error was thrown, and then move on.
 Or, instead of an isdefined(), he will try to access the variable, and
 then put his cfelse in the catch.
 I find this over-use to be excessive, but he claims it is perfectly
 rational and has no performance implications to process hundreds and
 hundreds of try catch's per template.

 Any light you guys can shed?

Well now that everyone in my office has had a good laugh.

Ummm...this guy needs a swift beating or some shock therapy to bring him back 
to 
realitythat is just plain BAD!!

I wish you the best of luck restraining yourself from throttling him in the 
near 
future ;-)

Cheers

Bryan Stevenson B.Comm.
VP  Director of E-Commerce Development
Electric Edge Systems Group Inc.
phone: 250.480.0642
fax: 250.480.1264
cell: 250.920.8830
e-mail: [EMAIL PROTECTED]
web: www.electricedgesystems.com 


~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:232339
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations  Support: http://www.houseoffusion.com/tiny.cfm/54


Re: Try/Catch vs. direct error handling

2006-02-15 Thread John C. Bland II
Wow, that is the epitomy of overkill. :-)

In most of those cases I'd say it could be a performance hit when you
compare this code:

cfset length = ArrayLen(blah)
cfloop from=1 to=#length# index=i/cfloop

to:

cftry
cfloop.../cfloop
cfcatch type=any !--- I guess he uses any ---
do stuff
/cfcatch

Why force an error when you can easily set a var and loop through the array
contents that are there? It definitely doesn't make sense, to me at least,
and seems like there would be a slight performance difference. This is
simply my opinion though.

On 2/15/06, Brad Wood [EMAIL PROTECTED] wrote:

 While we are talking about try/catch's, does anybody know if there is a
 performance hit at all (worth mentioning) when you use try catch.

 The main reason I ask is because I work with someone who uses try/catch
 around EVERYTHING HE EVER CODES.  He will even use it to terminate loops
 and in place of if statements.
 For example, instead of a loop from 1 to arraylen() he would just until
 an array out of bounds error was thrown, and then move on.
 Or, instead of an isdefined(), he will try to access the variable, and
 then put his cfelse in the catch.
 I find this over-use to be excessive, but he claims it is perfectly
 rational and has no performance implications to process hundreds and
 hundreds of try catch's per template.

 Any light you guys can shed?

 Thanks.

 ~Brad


 

~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:232340
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations  Support: http://www.houseoffusion.com/tiny.cfm/54


Re: Try/Catch vs. direct error handling

2006-02-15 Thread Ben Doom
Oh.  My.  God.
It's like using the emergency brake every time you want to slow down.

Yes, there are non-trivial performance issues with try/catch.  Not so 
much that it shouldn't be used for, you know, error-trapping, but... 
Also, used in this manner, you never know when something unexpected 
happened vs. intentionally erroring.

This guy needs to be LARTed, quickly.  That's just lazy and will lead to 
totally unmanagable code down the road, IMHO.  And that's not even 
thinking about debugging

Best of luck reprogramming this guy.

--Ben

Brad Wood wrote:
 While we are talking about try/catch's, does anybody know if there is a
 performance hit at all (worth mentioning) when you use try catch.
 
 The main reason I ask is because I work with someone who uses try/catch
 around EVERYTHING HE EVER CODES.  He will even use it to terminate loops
 and in place of if statements.  
 For example, instead of a loop from 1 to arraylen() he would just until
 an array out of bounds error was thrown, and then move on.  
 Or, instead of an isdefined(), he will try to access the variable, and
 then put his cfelse in the catch. 
 I find this over-use to be excessive, but he claims it is perfectly
 rational and has no performance implications to process hundreds and
 hundreds of try catch's per template.
 
 Any light you guys can shed?
 
 Thanks.
 
 ~Brad
 
 
 

~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:232341
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations  Support: http://www.houseoffusion.com/tiny.cfm/54


Re: Try/Catch vs. direct error handling

2006-02-15 Thread John C. Bland II
It's like using the emergency brake every time you want to slow down.

That's a perfect description. :-D

On 2/15/06, Ben Doom [EMAIL PROTECTED] wrote:

 Oh.  My.  God.
 It's like using the emergency brake every time you want to slow down.

 Yes, there are non-trivial performance issues with try/catch.  Not so
 much that it shouldn't be used for, you know, error-trapping, but...
 Also, used in this manner, you never know when something unexpected
 happened vs. intentionally erroring.

 This guy needs to be LARTed, quickly.  That's just lazy and will lead to
 totally unmanagable code down the road, IMHO.  And that's not even
 thinking about debugging

 Best of luck reprogramming this guy.

 --Ben

 Brad Wood wrote:
  While we are talking about try/catch's, does anybody know if there is a
  performance hit at all (worth mentioning) when you use try catch.
 
  The main reason I ask is because I work with someone who uses try/catch
  around EVERYTHING HE EVER CODES.  He will even use it to terminate loops
  and in place of if statements.
  For example, instead of a loop from 1 to arraylen() he would just until
  an array out of bounds error was thrown, and then move on.
  Or, instead of an isdefined(), he will try to access the variable, and
  then put his cfelse in the catch.
  I find this over-use to be excessive, but he claims it is perfectly
  rational and has no performance implications to process hundreds and
  hundreds of try catch's per template.
 
  Any light you guys can shed?
 
  Thanks.
 
  ~Brad
 
 
 

 

~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:232342
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations  Support: http://www.houseoffusion.com/tiny.cfm/54


RE: Try/Catch vs. direct error handling

2006-02-15 Thread Tim Heald
Huge error logs man.

You don't want to do that.

There is a built in means of terminating a loop. (break, exit?)

Tim 

 -Original Message-
 From: Brad Wood [mailto:[EMAIL PROTECTED] 
 Sent: Wednesday, February 15, 2006 12:08 PM
 To: CF-Talk
 Subject: RE: Try/Catch vs. direct error handling
 
 While we are talking about try/catch's, does anybody know if 
 there is a performance hit at all (worth mentioning) when you 
 use try catch.
 
 The main reason I ask is because I work with someone who uses 
 try/catch around EVERYTHING HE EVER CODES.  He will even use 
 it to terminate loops and in place of if statements.  
 For example, instead of a loop from 1 to arraylen() he would 
 just until an array out of bounds error was thrown, and then 
 move on.  
 Or, instead of an isdefined(), he will try to access the 
 variable, and then put his cfelse in the catch. 
 I find this over-use to be excessive, but he claims it is 
 perfectly rational and has no performance implications to 
 process hundreds and hundreds of try catch's per template.
 
 Any light you guys can shed?
 
 Thanks.
 
 ~Brad
 
 
 

~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:232343
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations  Support: http://www.houseoffusion.com/tiny.cfm/54


RE: Try/Catch vs. direct error handling

2006-02-15 Thread Tim Heald
Seriously that's crazy. 

 -Original Message-
 From: John C. Bland II [mailto:[EMAIL PROTECTED] 
 Sent: Wednesday, February 15, 2006 12:19 PM
 To: CF-Talk
 Subject: Re: Try/Catch vs. direct error handling
 
 Wow, that is the epitomy of overkill. :-)
 
 In most of those cases I'd say it could be a performance hit 
 when you compare this code:
 
 cfset length = ArrayLen(blah)
 cfloop from=1 to=#length# index=i/cfloop
 
 to:
 
 cftry
 cfloop.../cfloop
 cfcatch type=any !--- I guess he uses any --- do stuff 
 /cfcatch
 
 Why force an error when you can easily set a var and loop 
 through the array contents that are there? It definitely 
 doesn't make sense, to me at least, and seems like there 
 would be a slight performance difference. This is simply my 
 opinion though.
 
 On 2/15/06, Brad Wood [EMAIL PROTECTED] wrote:
 
  While we are talking about try/catch's, does anybody know 
 if there is 
  a performance hit at all (worth mentioning) when you use try catch.
 
  The main reason I ask is because I work with someone who uses 
  try/catch around EVERYTHING HE EVER CODES.  He will even use it to 
  terminate loops and in place of if statements.
  For example, instead of a loop from 1 to arraylen() he would just 
  until an array out of bounds error was thrown, and then move on.
  Or, instead of an isdefined(), he will try to access the 
 variable, and 
  then put his cfelse in the catch.
  I find this over-use to be excessive, but he claims it is perfectly 
  rational and has no performance implications to process 
 hundreds and 
  hundreds of try catch's per template.
 
  Any light you guys can shed?
 
  Thanks.
 
  ~Brad
 
 
  
 
 

~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:232344
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations  Support: http://www.houseoffusion.com/tiny.cfm/54


Re: Try/Catch vs. direct error handling

2006-02-15 Thread Michael Dinowitz
Short Circuited Boolean Evaluation was added in CF 4.01 and was one of the 
best things added to CF at the time.


 Why is that again?  Are you saying CF5 cannot handle lazy evaluation?  I
 think that was CF4.

 Russ


~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:232345
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations  Support: http://www.houseoffusion.com/tiny.cfm/54


RE: Try/Catch vs. direct error handling

2006-02-15 Thread Tim Heald
He he he

Yes, yes it was.

4.5.1 made it solid though. 

 -Original Message-
 From: Michael Dinowitz [mailto:[EMAIL PROTECTED] 
 Sent: Wednesday, February 15, 2006 12:33 PM
 To: CF-Talk
 Subject: Re: Try/Catch vs. direct error handling
 
 Short Circuited Boolean Evaluation was added in CF 4.01 and 
 was one of the best things added to CF at the time.
 
 
  Why is that again?  Are you saying CF5 cannot handle lazy 
 evaluation?  I
  think that was CF4.
 
  Russ
 
 
 

~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:232346
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations  Support: http://www.houseoffusion.com/tiny.cfm/54


Re: Try/Catch vs. direct error handling

2006-02-15 Thread Douglas Knudsen
holy WTFs Batman!  that's silly.  does this guy still use font tags in
his HTML?  LOL!  Quite an odd approach.

DK

On 2/15/06, Brad Wood [EMAIL PROTECTED] wrote:
 While we are talking about try/catch's, does anybody know if there is a
 performance hit at all (worth mentioning) when you use try catch.

 The main reason I ask is because I work with someone who uses try/catch
 around EVERYTHING HE EVER CODES.  He will even use it to terminate loops
 and in place of if statements.
 For example, instead of a loop from 1 to arraylen() he would just until
 an array out of bounds error was thrown, and then move on.
 Or, instead of an isdefined(), he will try to access the variable, and
 then put his cfelse in the catch.
 I find this over-use to be excessive, but he claims it is perfectly
 rational and has no performance implications to process hundreds and
 hundreds of try catch's per template.

 Any light you guys can shed?

 Thanks.

 ~Brad


 

~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:232347
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations  Support: http://www.houseoffusion.com/tiny.cfm/54


Re: Try/Catch vs. direct error handling

2006-02-15 Thread Michael Dinowitz
From my understanding, the use of the CFTRY/CFCATCH tag has no real overhead 
in and of itself. It's only when an actual error occurs where it has 
overhead. This is how it was explained to me. When a CFTRY tag is parsed, 
all that is done is a 'marker' is placed to say where your watching from. 
The code within the CFCATCH is ignored (other than for proper syntax). i.e. 
it is never run on the page parsing unless an error is thrown. This means 
that a CFTRY/CFCATCH block is rather cheap to use in CF.
When it does go off, you have error structures created, logs written, events 
going off, etc. I'd say the cost of when an error actually happens is a step 
more than the code that runs within the CFCATCH alone.

As for your co-worker, slap him. Really. No joke. Here I'm asking if 
defensive programming for potential errors is better than general catches 
and he's perverting the entire idea with something that NO real programmer 
would do. Just slap him and then force him to read a book on programming. 
Any book will do. But make him read it.


 While we are talking about try/catch's, does anybody know if there is a
 performance hit at all (worth mentioning) when you use try catch.

 The main reason I ask is because I work with someone who uses try/catch
 around EVERYTHING HE EVER CODES.  He will even use it to terminate loops
 and in place of if statements.
 For example, instead of a loop from 1 to arraylen() he would just until
 an array out of bounds error was thrown, and then move on.
 Or, instead of an isdefined(), he will try to access the variable, and
 then put his cfelse in the catch.
 I find this over-use to be excessive, but he claims it is perfectly
 rational and has no performance implications to process hundreds and
 hundreds of try catch's per template.

 Any light you guys can shed?

 Thanks.

 ~Brad


 

~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:232348
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations  Support: http://www.houseoffusion.com/tiny.cfm/54


RE: Try/Catch vs. direct error handling

2006-02-15 Thread FROEHLING, ROBERT \(ASI-AIT\)
Here are a couple of performance tests for try/catch, variable
existence, and block vs. script.

http://www.daveshuck.com/index.cfm?commentID=82
http://www.daveshuck.com/index.cfm?commentID=83

-Original Message-
From: Brad Wood [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, February 15, 2006 11:08 AM
To: CF-Talk
Subject: RE: Try/Catch vs. direct error handling


While we are talking about try/catch's, does anybody know if there is a
performance hit at all (worth mentioning) when you use try catch.

The main reason I ask is because I work with someone who uses try/catch
around EVERYTHING HE EVER CODES.  He will even use it to terminate loops
and in place of if statements.  
For example, instead of a loop from 1 to arraylen() he would just until
an array out of bounds error was thrown, and then move on.  
Or, instead of an isdefined(), he will try to access the variable, and
then put his cfelse in the catch. 
I find this over-use to be excessive, but he claims it is perfectly
rational and has no performance implications to process hundreds and
hundreds of try catch's per template.

Any light you guys can shed?

Thanks.

~Brad




~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:232349
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations  Support: http://www.houseoffusion.com/tiny.cfm/54


Re: Try/Catch vs. direct error handling

2006-02-15 Thread Dave Carabetta
On 2/15/06, Michael Dinowitz [EMAIL PROTECTED] wrote:
 This is a question of best practices and why. When I know there's a chance of 
 a specific error, I tend to code specifically to handle it. Others code 
 generally using try/catch. Which is seen as best in other languages and why? 
 I doubt there's any real performance issue between them, so it's a question 
 of industry standard and style.

 For example, if I know an ID is needed on a page and it has to be a numeric 
 I'd do:
 CFIF Not IsDefined('ID')
 An ID is needed
 CFELSEIF Not IsNumeric(ID)
 The passed ID needs to be numeric
 /CFIF

 Others do:
 CFTRY
 cfparam name=ID type=numeric
 CFCATCH
 You must pass a numeric ID
 /CFCATCH
 /CFTRY

Actually, there is a performance difference between them in theory.
try/catch introduces more overhead into the performance due to its
need to run, evaluate, and then test the various catch conditions for
a best match. With the isDefined(), it either exists or it doesn't.
Very simple and brute force. Here are my two rules that I would
submit as best practices:

1) In CFMX 6 and 7, every internal scope is a struct, and, as such,
the struct-related functions have been heavily optimized. (I think
there were some exceptions for scopes like cookie in previous
versions.) Therefore, I almost never use isDefined() anymore, for
reasons that have been documented both here and on various blogs. My
team's standards dictate that structKeyExists() be used around checks
for all variables:

cfif structKeyExists(variables, id)
 ...
/cfif

cfif structKeyExists(url, id)
 ...
/cfif

The only time I can think of where I use isDefined() is in something
like an error e-mail where I want to check if there was a form scope
in the request that failed so that I can dump it or skip it.
isDefined() will go through every possible scope it can, including the
CGI scope to find the variable being checked. That puts a
(comparatively) noticeable overhead on the request as opposed to
targeting a specific scope or scopes. I might be forgetting another
one-off example, but you'll find most of the time that isDefined()
just isn't needed.

2) Put cftry/cfcatch around code snippets that rely on non-ColdFusion
technologies, and around snippets of code that can gracefully handle
an exception. I don't put it around each and every query because I
know that if a very basic query if failing, then I have bigger
problems that a try/catch isn't going to solve. However, we interface
with a lot of non-CF technologies at my company (i.e., Python external
methods, web services, etc.), and I don't necessarily have control
over their uptime or availability (for example). Therefore, I need to
be able to display a system is down message and/or send an e-mail to
myself as an alert. Other examples include POP and FTP access.

try/catch should be used only when necessary. As for the reply that
noted he has a developer who puts try/catch around everything,
education is the best remedy there. Have him research try/catch both
in LiveDocs and across the web to show why his approach isn't
recommended.

Regards,
Dave.

~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:232350
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations  Support: http://www.houseoffusion.com/tiny.cfm/54


Re: Try/Catch vs. direct error handling

2006-02-15 Thread Dave Carabetta
On 2/15/06, Dave Carabetta [EMAIL PROTECTED] wrote:
 On 2/15/06, Michael Dinowitz [EMAIL PROTECTED] wrote:
  This is a question of best practices and why. When I know there's a chance 
  of a specific error, I tend to code specifically to handle it. Others code 
  generally using try/catch. Which is seen as best in other languages and 
  why? I doubt there's any real performance issue between them, so it's a 
  question of industry standard and style.
 
  For example, if I know an ID is needed on a page and it has to be a numeric 
  I'd do:
  CFIF Not IsDefined('ID')
  An ID is needed
  CFELSEIF Not IsNumeric(ID)
  The passed ID needs to be numeric
  /CFIF
 
  Others do:
  CFTRY
  cfparam name=ID type=numeric
  CFCATCH
  You must pass a numeric ID
  /CFCATCH
  /CFTRY

 Actually, there is a performance difference between them in theory.
 try/catch introduces more overhead into the performance due to its
 need to run, evaluate, and then test the various catch conditions for
 a best match. With the isDefined(), it either exists or it doesn't.
 Very simple and brute force. Here are my two rules that I would
 submit as best practices:

 1) In CFMX 6 and 7, every internal scope is a struct, and, as such,
 the struct-related functions have been heavily optimized. (I think
 there were some exceptions for scopes like cookie in previous
 versions.) Therefore, I almost never use isDefined() anymore, for
 reasons that have been documented both here and on various blogs. My
 team's standards dictate that structKeyExists() be used around checks
 for all variables:

 cfif structKeyExists(variables, id)
  ...
 /cfif

 cfif structKeyExists(url, id)
  ...
 /cfif

 The only time I can think of where I use isDefined() is in something
 like an error e-mail where I want to check if there was a form scope
 in the request that failed so that I can dump it or skip it.
 isDefined() will go through every possible scope it can, including the
 CGI scope to find the variable being checked. That puts a
 (comparatively) noticeable overhead on the request as opposed to
 targeting a specific scope or scopes. I might be forgetting another
 one-off example, but you'll find most of the time that isDefined()
 just isn't needed.

 2) Put cftry/cfcatch around code snippets that rely on non-ColdFusion
 technologies, and around snippets of code that can gracefully handle
 an exception. I don't put it around each and every query because I
 know that if a very basic query if failing, then I have bigger
 problems that a try/catch isn't going to solve. However, we interface
 with a lot of non-CF technologies at my company (i.e., Python external
 methods, web services, etc.), and I don't necessarily have control
 over their uptime or availability (for example). Therefore, I need to
 be able to display a system is down message and/or send an e-mail to
 myself as an alert. Other examples include POP and FTP access.

 try/catch should be used only when necessary. As for the reply that
 noted he has a developer who puts try/catch around everything,
 education is the best remedy there. Have him research try/catch both
 in LiveDocs and across the web to show why his approach isn't
 recommended.


Sorry, forgot to paste this link in regarding structKeyExists() vs.
isDefined() usage. Sean very nicely summed up what I was trying to
say:

http://www.corfield.org/blog/index.cfm/do/blog.entry/entry/isDefined_vs_structKeyExists

Note that the layout on this is wonky in Firefox, but the content still holds.

Regards,
Dave.

~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:232351
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations  Support: http://www.houseoffusion.com/tiny.cfm/54


Verity problems - going nuts/need help

2006-02-15 Thread JoeT
We recently moved a site with a Verity Collection from a Windows NT server 
running CF 4.5 to a Windows 2000 server running CF 5.  I recreated the 
collection on the new server successfully but am unable to index it either from 
CF Administrator or programatically.  The following error is thrown when I try 
to do it programatically:


Error Diagnostic Information
Error occurred in tag CFINDEX

Error during SetCurrentDirectory



Here is the code:
CFINDEX 
collection=TrusteeDocuments 
action=REFRESH
type=PATH
key=d:\Clients\firmname\www\TrusteeIntranet\Documents\
extensions=.htm, .html, .txt, *., .pdf, .doc, .xls, .ppt
recurse=YES
language=english
urlPath=http://www.firmname.com/TrusteeIntranet/Documents;

The key path is valid - I have tried it with and without the trailing 
backslash.  Same with the URL path.  If I set type=FILE I do not get an error 
message but it, of course, does not index content in folders below ..\Documents

I am at my wits end with this.  We have looked into the OS permission settings 
on the folders where the documents and the collection are stored to make sure 
they weren't too restrictive.

Any thoughts on this would be greatly appreciated.

Thanks
Joe 
High Caliber Solutions

~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:232352
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations  Support: http://www.houseoffusion.com/tiny.cfm/54


Re: Try/Catch vs. direct error handling

2006-02-15 Thread John C. Bland II
So, in the case of a simple query what happens if your datasource can't
connect? (db down, etc) How do you handle this error with an open cfquery?
onError in App.cfc?

Just curious...

On 2/15/06, Dave Carabetta [EMAIL PROTECTED] wrote:

 On 2/15/06, Michael Dinowitz [EMAIL PROTECTED] wrote:
  This is a question of best practices and why. When I know there's a
 chance of a specific error, I tend to code specifically to handle it. Others
 code generally using try/catch. Which is seen as best in other languages and
 why? I doubt there's any real performance issue between them, so it's a
 question of industry standard and style.
 
  For example, if I know an ID is needed on a page and it has to be a
 numeric I'd do:
  CFIF Not IsDefined('ID')
  An ID is needed
  CFELSEIF Not IsNumeric(ID)
  The passed ID needs to be numeric
  /CFIF
 
  Others do:
  CFTRY
  cfparam name=ID type=numeric
  CFCATCH
  You must pass a numeric ID
  /CFCATCH
  /CFTRY

 Actually, there is a performance difference between them in theory.
 try/catch introduces more overhead into the performance due to its
 need to run, evaluate, and then test the various catch conditions for
 a best match. With the isDefined(), it either exists or it doesn't.
 Very simple and brute force. Here are my two rules that I would
 submit as best practices:

 1) In CFMX 6 and 7, every internal scope is a struct, and, as such,
 the struct-related functions have been heavily optimized. (I think
 there were some exceptions for scopes like cookie in previous
 versions.) Therefore, I almost never use isDefined() anymore, for
 reasons that have been documented both here and on various blogs. My
 team's standards dictate that structKeyExists() be used around checks
 for all variables:

 cfif structKeyExists(variables, id)
 ...
 /cfif

 cfif structKeyExists(url, id)
 ...
 /cfif

 The only time I can think of where I use isDefined() is in something
 like an error e-mail where I want to check if there was a form scope
 in the request that failed so that I can dump it or skip it.
 isDefined() will go through every possible scope it can, including the
 CGI scope to find the variable being checked. That puts a
 (comparatively) noticeable overhead on the request as opposed to
 targeting a specific scope or scopes. I might be forgetting another
 one-off example, but you'll find most of the time that isDefined()
 just isn't needed.

 2) Put cftry/cfcatch around code snippets that rely on non-ColdFusion
 technologies, and around snippets of code that can gracefully handle
 an exception. I don't put it around each and every query because I
 know that if a very basic query if failing, then I have bigger
 problems that a try/catch isn't going to solve. However, we interface
 with a lot of non-CF technologies at my company (i.e., Python external
 methods, web services, etc.), and I don't necessarily have control
 over their uptime or availability (for example). Therefore, I need to
 be able to display a system is down message and/or send an e-mail to
 myself as an alert. Other examples include POP and FTP access.

 try/catch should be used only when necessary. As for the reply that
 noted he has a developer who puts try/catch around everything,
 education is the best remedy there. Have him research try/catch both
 in LiveDocs and across the web to show why his approach isn't
 recommended.

 Regards,
 Dave.

 

~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:232353
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations  Support: http://www.houseoffusion.com/tiny.cfm/54


RE: Try/Catch vs. direct error handling

2006-02-15 Thread Bobby Hartsfield
Purely theoretical thinking in the interest of conversation here but it
seems to me that using cftry/cfcatch unnecessarily is a waste of the ever so
precious overhead space. I call it theoretical thinking because I haven't
really dug into the inner-workings of cftry/cfcatch to see what it actually
does. I haven't done that because my use of it is very minimal and when/if I
DO have to use it... I have to use it and it doesn't really matter how it
works.

I wouldn't think that it was TOO much overhead just by thinking about what
it's doing though. CF could display the error on the page or store that
error information in a structure for you to do what you want with. But,
again just logically thinking here, if an error DOES happen in a
cftry/cfcatch block, that seems like it would be the only time (other than
slightly more code) that any overhead concerns would pop up.

I, of course, could be way off and CF may be attempting to compile the
entire block looking for errors, then truly compiling it if there arenÂ’t any
errors. Like I said, I don't really know what it's doing but either way
seems like a potential for (usually) unnecessary overhead. 

I'll admit, I used to use it quite often but I hardly ever use it now but
when I do, it's never to catch an error that could have been completely
avoided by something as simple as a cfparam.

As for the example you used, I'd most likely try something like...

cfparam name=id default=0 /
cfif isnumeric(val(id))
 ID was given, is numeric, and is not 0
cfelse
 Id was not given or wasn't numeric and therefore is 0
/cfif

The method that ID is being passed to the page could of course change that.

I only used isnumeric() around it because apparently very large numbers or
strings will cause val() to fail (I was just recently told that but haven't
tried it out yet)

Over the years, my use of isdefined() has gotten less and less... almost to
the point of not using it at all. I've gotten into the habit of creating
cfparams for almost everything that will be 'tested' (so to speak) in the
way you've laid out.

That's just the way I do things though. Taking a step back and looking at
what cftry/cfcatch APPEARS to be doing just makes me think that it's more
overhead than is usually needed. 

..:.:.:.:.:.:.:.:.:.:.:.:.
Bobby Hartsfield
http://acoderslife.com

 

 

-Original Message-
From: Michael Dinowitz [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, February 15, 2006 10:38 AM
To: CF-Talk
Subject: Try/Catch vs. direct error handling

This is a question of best practices and why. When I know there's a chance
of a specific error, I tend to code specifically to handle it. Others code
generally using try/catch. Which is seen as best in other languages and why?
I doubt there's any real performance issue between them, so it's a question
of industry standard and style.

For example, if I know an ID is needed on a page and it has to be a numeric
I'd do:
CFIF Not IsDefined('ID')
An ID is needed
CFELSEIF Not IsNumeric(ID)
The passed ID needs to be numeric
/CFIF

Others do:
CFTRY
cfparam name=ID type=numeric
CFCATCH
You must pass a numeric ID
/CFCATCH
/CFTRY




~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:232354
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations  Support: http://www.houseoffusion.com/tiny.cfm/54


RE: Try/Catch vs. direct error handling

2006-02-15 Thread Tim Heald
Then it is appropriate to use transaction processing and try/catch logic.

You're dealing with more complex objects at this point already, dealing with
the network and another server, this way even if you lose the network in the
middle of running a proc or something it will roll back. 

 -Original Message-
 From: John C. Bland II [mailto:[EMAIL PROTECTED] 
 Sent: Wednesday, February 15, 2006 1:10 PM
 To: CF-Talk
 Subject: Re: Try/Catch vs. direct error handling
 
 So, in the case of a simple query what happens if your 
 datasource can't connect? (db down, etc) How do you handle 
 this error with an open cfquery?
 onError in App.cfc?
 
 Just curious...
 
 On 2/15/06, Dave Carabetta [EMAIL PROTECTED] wrote:
 
  On 2/15/06, Michael Dinowitz [EMAIL PROTECTED] wrote:
   This is a question of best practices and why. When I know 
 there's a
  chance of a specific error, I tend to code specifically to 
 handle it. 
  Others code generally using try/catch. Which is seen as 
 best in other 
  languages and why? I doubt there's any real performance 
 issue between 
  them, so it's a question of industry standard and style.
  
   For example, if I know an ID is needed on a page and it 
 has to be a
  numeric I'd do:
   CFIF Not IsDefined('ID')
   An ID is needed
   CFELSEIF Not IsNumeric(ID)
   The passed ID needs to be numeric /CFIF
  
   Others do:
   CFTRY
   cfparam name=ID type=numeric
   CFCATCH
   You must pass a numeric ID
   /CFCATCH
   /CFTRY
 
  Actually, there is a performance difference between them in theory.
  try/catch introduces more overhead into the performance due to its 
  need to run, evaluate, and then test the various catch 
 conditions for 
  a best match. With the isDefined(), it either exists or it doesn't.
  Very simple and brute force. Here are my two rules that I would 
  submit as best practices:
 
  1) In CFMX 6 and 7, every internal scope is a struct, and, as such, 
  the struct-related functions have been heavily optimized. (I think 
  there were some exceptions for scopes like cookie in previous
  versions.) Therefore, I almost never use isDefined() anymore, for 
  reasons that have been documented both here and on various 
 blogs. My 
  team's standards dictate that structKeyExists() be used 
 around checks 
  for all variables:
 
  cfif structKeyExists(variables, id) ...
  /cfif
 
  cfif structKeyExists(url, id)
  ...
  /cfif
 
  The only time I can think of where I use isDefined() is in 
 something 
  like an error e-mail where I want to check if there was a 
 form scope 
  in the request that failed so that I can dump it or skip it.
  isDefined() will go through every possible scope it can, 
 including the 
  CGI scope to find the variable being checked. That puts a
  (comparatively) noticeable overhead on the request as opposed to 
  targeting a specific scope or scopes. I might be forgetting another 
  one-off example, but you'll find most of the time that isDefined() 
  just isn't needed.
 
  2) Put cftry/cfcatch around code snippets that rely on 
 non-ColdFusion 
  technologies, and around snippets of code that can 
 gracefully handle 
  an exception. I don't put it around each and every query because I 
  know that if a very basic query if failing, then I have bigger 
  problems that a try/catch isn't going to solve. However, we 
 interface 
  with a lot of non-CF technologies at my company (i.e., 
 Python external 
  methods, web services, etc.), and I don't necessarily have control 
  over their uptime or availability (for example). Therefore, 
 I need to 
  be able to display a system is down message and/or send 
 an e-mail to 
  myself as an alert. Other examples include POP and FTP access.
 
  try/catch should be used only when necessary. As for the reply that 
  noted he has a developer who puts try/catch around everything, 
  education is the best remedy there. Have him research 
 try/catch both 
  in LiveDocs and across the web to show why his approach isn't 
  recommended.
 
  Regards,
  Dave.
 
  
 
 

~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:232355
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations  Support: http://www.houseoffusion.com/tiny.cfm/54


RE: Try/Catch vs. direct error handling

2006-02-15 Thread Bobby Hartsfield
Actually, a cferror template is probably the only place I'd find isdefined()
in any of my code anymore... for the exact same reason Dave described below.

..:.:.:.:.:.:.:.:.:.:.:.:.
Bobby Hartsfield
http://acoderslife.com

-Original Message-
From: Dave Carabetta [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, February 15, 2006 12:49 PM
To: CF-Talk
Subject: Re: Try/Catch vs. direct error handling

The only time I can think of where I use isDefined() is in something
like an error e-mail where I want to check if there was a form scope
in the request that failed so that I can dump it or skip it.
isDefined() will go through every possible scope it can, including the
CGI scope to find the variable being checked. That puts a
(comparatively) noticeable overhead on the request as opposed to
targeting a specific scope or scopes. I might be forgetting another
one-off example, but you'll find most of the time that isDefined()
just isn't needed.

. 
..
...

Regards,
Dave.

-- 
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.375 / Virus Database: 267.15.9/261 - Release Date: 2/15/2006
 



~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:232356
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations  Support: http://www.houseoffusion.com/tiny.cfm/54


Re: Try/Catch vs. direct error handling

2006-02-15 Thread John C. Bland II
Good stuff...

On 2/15/06, FROEHLING, ROBERT (ASI-AIT) [EMAIL PROTECTED] wrote:

 Here are a couple of performance tests for try/catch, variable
 existence, and block vs. script.

 http://www.daveshuck.com/index.cfm?commentID=82
 http://www.daveshuck.com/index.cfm?commentID=83

 -Original Message-
 From: Brad Wood [mailto:[EMAIL PROTECTED]
 Sent: Wednesday, February 15, 2006 11:08 AM
 To: CF-Talk
 Subject: RE: Try/Catch vs. direct error handling


 While we are talking about try/catch's, does anybody know if there is a
 performance hit at all (worth mentioning) when you use try catch.

 The main reason I ask is because I work with someone who uses try/catch
 around EVERYTHING HE EVER CODES.  He will even use it to terminate loops
 and in place of if statements.
 For example, instead of a loop from 1 to arraylen() he would just until
 an array out of bounds error was thrown, and then move on.
 Or, instead of an isdefined(), he will try to access the variable, and
 then put his cfelse in the catch.
 I find this over-use to be excessive, but he claims it is perfectly
 rational and has no performance implications to process hundreds and
 hundreds of try catch's per template.

 Any light you guys can shed?

 Thanks.

 ~Brad




 

~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:232357
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations  Support: http://www.houseoffusion.com/tiny.cfm/54


Re: Try/Catch vs. direct error handling

2006-02-15 Thread Michael Dinowitz
But the performance hit only comes when an actual error occurs. When no 
error occurs, the CFTRY/CFCATCH has very little overhead.
As for the issue of StructKeyExists() over IsDefined(), I've advocated it in 
my presentations for a long time as it is logically more efficient. This may 
be a fallacy, but I believe it to be.

 Actually, there is a performance difference between them in theory.
 try/catch introduces more overhead into the performance due to its
 need to run, evaluate, and then test the various catch conditions for
 a best match. With the isDefined(), it either exists or it doesn't.
 Very simple and brute force. Here are my two rules that I would
 submit as best practices:

 1) In CFMX 6 and 7, every internal scope is a struct, and, as such,
 the struct-related functions have been heavily optimized. (I think
 there were some exceptions for scopes like cookie in previous
 versions.) Therefore, I almost never use isDefined() anymore, for
 reasons that have been documented both here and on various blogs. My
 team's standards dictate that structKeyExists() be used around checks
 for all variables:

 cfif structKeyExists(variables, id)
 ...
 /cfif

 cfif structKeyExists(url, id)
 ...
 /cfif

 The only time I can think of where I use isDefined() is in something
 like an error e-mail where I want to check if there was a form scope
 in the request that failed so that I can dump it or skip it.
 isDefined() will go through every possible scope it can, including the
 CGI scope to find the variable being checked. That puts a
 (comparatively) noticeable overhead on the request as opposed to
 targeting a specific scope or scopes. I might be forgetting another
 one-off example, but you'll find most of the time that isDefined()
 just isn't needed.

 2) Put cftry/cfcatch around code snippets that rely on non-ColdFusion
 technologies, and around snippets of code that can gracefully handle
 an exception. I don't put it around each and every query because I
 know that if a very basic query if failing, then I have bigger
 problems that a try/catch isn't going to solve. However, we interface
 with a lot of non-CF technologies at my company (i.e., Python external
 methods, web services, etc.), and I don't necessarily have control
 over their uptime or availability (for example). Therefore, I need to
 be able to display a system is down message and/or send an e-mail to
 myself as an alert. Other examples include POP and FTP access.

 try/catch should be used only when necessary. As for the reply that
 noted he has a developer who puts try/catch around everything,
 education is the best remedy there. Have him research try/catch both
 in LiveDocs and across the web to show why his approach isn't
 recommended.

 Regards,
 Dave.

 

~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:232358
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations  Support: http://www.houseoffusion.com/tiny.cfm/54


Re: cfdocument how to use on a .cfm to print a form?

2006-02-15 Thread Jon Gunnip
Caroline,

I'm not exactly sure what you are asking.  If you are asking How do I
include a form in my cfdocument?  the answer is that the form tag is
not currently supported in cfdocument.  When I've tried to use forms
in cfdocument PDF's, I get some funky output.

See 
http://livedocs.macromedia.com/coldfusion/7/htmldocs/wwhelp/wwhimpl/common/html/wwhelp.htm?context=ColdFusion_Documentationfile=1442.htm

HTH,
Jon

On 2/15/06, Caroline Tobey [EMAIL PROTECTED] wrote:
 I am new to using MX and need to add a button to a .cfm form that has
 numerous input fields.  The user will need to input and save their data
 then click a button to print the completed form. How do I do this using
 a button on the form that will say printerfreindly output then the
 cfdocument tag in my code?  Any examplse would be wonderful thanks.


 -
  Yahoo! Mail
  Use Photomail to share photos without annoying attachments.

 

~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:232359
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations  Support: http://www.houseoffusion.com/tiny.cfm/54


Re: Try/Catch vs. direct error handling

2006-02-15 Thread Michael Dinowitz
Counts on what you want done. If the query can be retried or faked, then I'd 
do a try/catch and deal with it specifically. If it's failure breaks the 
entire page run, an onError might be best. All depends on how you've coded 
the site and what fallbacks you have in place.


 So, in the case of a simple query what happens if your datasource can't
 connect? (db down, etc) How do you handle this error with an open cfquery?
 onError in App.cfc?

 Just curious...



~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:232360
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations  Support: http://www.houseoffusion.com/tiny.cfm/54


Re: Try/Catch vs. direct error handling

2006-02-15 Thread Dave Carabetta
On 2/15/06, John C. Bland II [EMAIL PROTECTED] wrote:
 So, in the case of a simple query what happens if your datasource can't
 connect? (db down, etc) How do you handle this error with an open cfquery?
 onError in App.cfc?

 Just curious...


Well, like I said, if you can't connect to your database at all, then
you have bigger problems than whether or not a particular code snippet
works. This is where test probes should be written specifically to
ping your database every so often. We have a test set up using Nagios
that runs a probe that just hits our database every 15 seconds via a
ColdFusion page. We use Oracle, so the query is literally just:

SELECT
  sysdate
FROM
  dual

If that returns without issue, then all's fine. If our test page
doesn't return with the expected string (I won't reveal ours for
security reasons), then we know something's up and Nagios sends up the
appropriate alerts.

Remember that try/catch is at the code level for specific bits of
logic that you can reasonably forecast might not execute correctly for
a given reason. You need to have layers above your code base that run
the appropriate system checks to make sure things are up and running.
Using Nagios (which is an open source host, service and network
monitoring program, by the way) should be where you do your system
health checks over systems that you control.

Hope this helps?

Regards,
Dave.

~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:232361
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations  Support: http://www.houseoffusion.com/tiny.cfm/54


Re: Try/Catch vs. direct error handling

2006-02-15 Thread John C. Bland II
In that same vein (storing error in struct), isn't it conceivable the error
stored in the cfcatch struct is going to be created whether you catch it or
not? Obviously preventing the error is the best way but in the case of a
cfquery gone wrong aren't you simply taking a struct that will automatically
be created and literally catching it instead of allowing it to show on the
page? If you look at the arguments passed to onError in App.cfc you will see
CF pretty much spits out the struct (or just the info) as the error.

If all of this is true, there is no extra overhead since it is going to
happen anyway. Going back to Mike's original post it would be extra to allow
an error you know you can prevent. Why put your hand in a rabid dogs mouth
if it is the last hand you have and your job requires at least one hand? It
just doesn't make since, unless you want to collect disability. :-)

^ = my opinions

On 2/15/06, Bobby Hartsfield [EMAIL PROTECTED] wrote:

 Purely theoretical thinking in the interest of conversation here but it
 seems to me that using cftry/cfcatch unnecessarily is a waste of the ever
 so
 precious overhead space. I call it theoretical thinking because I haven't
 really dug into the inner-workings of cftry/cfcatch to see what it
 actually
 does. I haven't done that because my use of it is very minimal and when/if
 I
 DO have to use it... I have to use it and it doesn't really matter how it
 works.

 I wouldn't think that it was TOO much overhead just by thinking about what
 it's doing though. CF could display the error on the page or store that
 error information in a structure for you to do what you want with. But,
 again just logically thinking here, if an error DOES happen in a
 cftry/cfcatch block, that seems like it would be the only time (other than
 slightly more code) that any overhead concerns would pop up.

 I, of course, could be way off and CF may be attempting to compile the
 entire block looking for errors, then truly compiling it if there aren't
 any
 errors. Like I said, I don't really know what it's doing but either way
 seems like a potential for (usually) unnecessary overhead.

 I'll admit, I used to use it quite often but I hardly ever use it now but
 when I do, it's never to catch an error that could have been completely
 avoided by something as simple as a cfparam.

 As for the example you used, I'd most likely try something like...

 cfparam name=id default=0 /
 cfif isnumeric(val(id))
 ID was given, is numeric, and is not 0
 cfelse
 Id was not given or wasn't numeric and therefore is 0
 /cfif

 The method that ID is being passed to the page could of course change
 that.

 I only used isnumeric() around it because apparently very large numbers or
 strings will cause val() to fail (I was just recently told that but
 haven't
 tried it out yet)

 Over the years, my use of isdefined() has gotten less and less... almost
 to
 the point of not using it at all. I've gotten into the habit of creating
 cfparams for almost everything that will be 'tested' (so to speak) in the
 way you've laid out.

 That's just the way I do things though. Taking a step back and looking at
 what cftry/cfcatch APPEARS to be doing just makes me think that it's more
 overhead than is usually needed.

 ..:.:.:.:.:.:.:.:.:.:.:.:.
 Bobby Hartsfield
 http://acoderslife.com





 -Original Message-
 From: Michael Dinowitz [mailto:[EMAIL PROTECTED]
 Sent: Wednesday, February 15, 2006 10:38 AM
 To: CF-Talk
 Subject: Try/Catch vs. direct error handling

 This is a question of best practices and why. When I know there's a chance
 of a specific error, I tend to code specifically to handle it. Others code
 generally using try/catch. Which is seen as best in other languages and
 why?
 I doubt there's any real performance issue between them, so it's a
 question
 of industry standard and style.

 For example, if I know an ID is needed on a page and it has to be a
 numeric
 I'd do:
 CFIF Not IsDefined('ID')
 An ID is needed
 CFELSEIF Not IsNumeric(ID)
 The passed ID needs to be numeric
 /CFIF

 Others do:
 CFTRY
 cfparam name=ID type=numeric
 CFCATCH
 You must pass a numeric ID
 /CFCATCH
 /CFTRY




 

~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:232362
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations  Support: http://www.houseoffusion.com/tiny.cfm/54


Re: Try/Catch vs. direct error handling

2006-02-15 Thread Michael Dinowitz
Ah, but what if you don't want to give the id a default but instead want to 
give a login page instead. CFPARAM without a default throws an error if the 
variable does not exist. You can catch that or know that you may have to 
handle it and do so.
In CFMX 6 there was an option to view the pre-compiled java code that your 
CF template turned into. This was VERY interesting as it showed things like 
CFIF and IIF() compiled down to the exact same code. I wonder what CFPARAM 
would compile down to in comparison to some CFIFs and how efficient it is 
under the hood. Just for knowledge sake. :)

 As for the example you used, I'd most likely try something like...

 cfparam name=id default=0 /
 cfif isnumeric(val(id))
 ID was given, is numeric, and is not 0
 cfelse
 Id was not given or wasn't numeric and therefore is 0
 /cfif


~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:232363
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations  Support: http://www.houseoffusion.com/tiny.cfm/54


Re: Try/Catch vs. direct error handling

2006-02-15 Thread John C. Bland II
I only use transactions when I'm doing more than one insert, update, or
sproc call. My question to Brad was how do you handle these possibilities
without a cftry? The easy way would be to let it fail to your global error
handler (onError or error templates) but that doesn't fix the issue...just
puts a nice pretty face on it.

Again, just curious...

On 2/15/06, Tim Heald [EMAIL PROTECTED] wrote:

 Then it is appropriate to use transaction processing and try/catch logic.

 You're dealing with more complex objects at this point already, dealing
 with
 the network and another server, this way even if you lose the network in
 the
 middle of running a proc or something it will roll back.

  -Original Message-
  From: John C. Bland II [mailto:[EMAIL PROTECTED]
  Sent: Wednesday, February 15, 2006 1:10 PM
  To: CF-Talk
  Subject: Re: Try/Catch vs. direct error handling
 
  So, in the case of a simple query what happens if your
  datasource can't connect? (db down, etc) How do you handle
  this error with an open cfquery?
  onError in App.cfc?
 
  Just curious...
 
  On 2/15/06, Dave Carabetta [EMAIL PROTECTED] wrote:
  
   On 2/15/06, Michael Dinowitz [EMAIL PROTECTED] wrote:
This is a question of best practices and why. When I know
  there's a
   chance of a specific error, I tend to code specifically to
  handle it.
   Others code generally using try/catch. Which is seen as
  best in other
   languages and why? I doubt there's any real performance
  issue between
   them, so it's a question of industry standard and style.
   
For example, if I know an ID is needed on a page and it
  has to be a
   numeric I'd do:
CFIF Not IsDefined('ID')
An ID is needed
CFELSEIF Not IsNumeric(ID)
The passed ID needs to be numeric /CFIF
   
Others do:
CFTRY
cfparam name=ID type=numeric
CFCATCH
You must pass a numeric ID
/CFCATCH
/CFTRY
  
   Actually, there is a performance difference between them in theory.
   try/catch introduces more overhead into the performance due to its
   need to run, evaluate, and then test the various catch
  conditions for
   a best match. With the isDefined(), it either exists or it doesn't.
   Very simple and brute force. Here are my two rules that I would
   submit as best practices:
  
   1) In CFMX 6 and 7, every internal scope is a struct, and, as such,
   the struct-related functions have been heavily optimized. (I think
   there were some exceptions for scopes like cookie in previous
   versions.) Therefore, I almost never use isDefined() anymore, for
   reasons that have been documented both here and on various
  blogs. My
   team's standards dictate that structKeyExists() be used
  around checks
   for all variables:
  
   cfif structKeyExists(variables, id) ...
   /cfif
  
   cfif structKeyExists(url, id)
   ...
   /cfif
  
   The only time I can think of where I use isDefined() is in
  something
   like an error e-mail where I want to check if there was a
  form scope
   in the request that failed so that I can dump it or skip it.
   isDefined() will go through every possible scope it can,
  including the
   CGI scope to find the variable being checked. That puts a
   (comparatively) noticeable overhead on the request as opposed to
   targeting a specific scope or scopes. I might be forgetting another
   one-off example, but you'll find most of the time that isDefined()
   just isn't needed.
  
   2) Put cftry/cfcatch around code snippets that rely on
  non-ColdFusion
   technologies, and around snippets of code that can
  gracefully handle
   an exception. I don't put it around each and every query because I
   know that if a very basic query if failing, then I have bigger
   problems that a try/catch isn't going to solve. However, we
  interface
   with a lot of non-CF technologies at my company (i.e.,
  Python external
   methods, web services, etc.), and I don't necessarily have control
   over their uptime or availability (for example). Therefore,
  I need to
   be able to display a system is down message and/or send
  an e-mail to
   myself as an alert. Other examples include POP and FTP access.
  
   try/catch should be used only when necessary. As for the reply that
   noted he has a developer who puts try/catch around everything,
   education is the best remedy there. Have him research
  try/catch both
   in LiveDocs and across the web to show why his approach isn't
   recommended.
  
   Regards,
   Dave.
  
  
 
 

 

~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:232364
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations  Support: http://www.houseoffusion.com/tiny.cfm/54


Re: Try/Catch vs. direct error handling

2006-02-15 Thread John C. Bland II
Good answer. So essentially Nagios will calmly stop the processing of your
cf app? By stop I mean it will set a flag somwehere (app scope, etc) which
tells your site to degrade?

Sounds interesting but not sure if I would nix my cftry/catches. Let's look
at another scenario.

You have a cfquery that executes a sproc (stored procedure) on your db. A
change is made to the sproc that unknowingly affects this lonely cfquery
tucked in a corner somewhere. How do you manage this potential error from
happening? Sometimes things happen and people forget to make certain updates
to necessary templates. It just happens. How does your app degrade here?

BTW, I guess I meant Dave but said Brad in my other post.

On 2/15/06, Dave Carabetta [EMAIL PROTECTED] wrote:

 On 2/15/06, John C. Bland II [EMAIL PROTECTED] wrote:
  So, in the case of a simple query what happens if your datasource can't
  connect? (db down, etc) How do you handle this error with an open
 cfquery?
  onError in App.cfc?
 
  Just curious...
 

 Well, like I said, if you can't connect to your database at all, then
 you have bigger problems than whether or not a particular code snippet
 works. This is where test probes should be written specifically to
 ping your database every so often. We have a test set up using Nagios
 that runs a probe that just hits our database every 15 seconds via a
 ColdFusion page. We use Oracle, so the query is literally just:

 SELECT
   sysdate
 FROM
   dual

 If that returns without issue, then all's fine. If our test page
 doesn't return with the expected string (I won't reveal ours for
 security reasons), then we know something's up and Nagios sends up the
 appropriate alerts.

 Remember that try/catch is at the code level for specific bits of
 logic that you can reasonably forecast might not execute correctly for
 a given reason. You need to have layers above your code base that run
 the appropriate system checks to make sure things are up and running.
 Using Nagios (which is an open source host, service and network
 monitoring program, by the way) should be where you do your system
 health checks over systems that you control.

 Hope this helps?

 Regards,
 Dave.

 

~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:232365
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations  Support: http://www.houseoffusion.com/tiny.cfm/54


RE: cfdocument how to use on a .cfm to print a form?

2006-02-15 Thread ColdFusion
I have not use cfdocument as of yet, but I think what your asking
Is how to direct a form action to a CFM file so that it can be 
printed using CFDOCUMENT, correct? 

Not can you use FORM within CFDOCUMENT.

Maybe that is the clarrification that is needed so someone else with
CFDOCUMENT experience can chime in.

-Original Message-
From: Jon Gunnip [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, February 15, 2006 1:22 PM
To: CF-Talk
Subject: Re: cfdocument how to use on a .cfm to print a form?

Caroline,

I'm not exactly sure what you are asking.  If you are asking How do I
include a form in my cfdocument?  the answer is that the form tag is not
currently supported in cfdocument.  When I've tried to use forms in
cfdocument PDF's, I get some funky output.

See
http://livedocs.macromedia.com/coldfusion/7/htmldocs/wwhelp/wwhimpl/common/h
tml/wwhelp.htm?context=ColdFusion_Documentationfile=1442.htm

HTH,
Jon

On 2/15/06, Caroline Tobey [EMAIL PROTECTED] wrote:
 I am new to using MX and need to add a button to a .cfm form that has 
 numerous input fields.  The user will need to input and save their 
 data then click a button to print the completed form. How do I do this 
 using a button on the form that will say printerfreindly output then 
 the cfdocument tag in my code?  Any examplse would be wonderful thanks.


 -
  Yahoo! Mail
  Use Photomail to share photos without annoying attachments.

 



~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:232366
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations  Support: http://www.houseoffusion.com/tiny.cfm/54


Re: Try/Catch vs. direct error handling

2006-02-15 Thread Rick Root
Michael,

CF-TALK not getting enough traffic today so you post a preference 
question? ;)

For what it's worth, I *PREFER* direct error handling because I think 
it's more flexible.

You wrote the following code:
CFIF Not IsDefined('ID')
An ID is needed
CFELSEIF Not IsNumeric(ID)
The passed ID needs to be numeric
/CFIF

I'd probably actually do:

CFIF Not IsDefined('ID')
cflocation url=someotherpage.cfm
CFELSEIF Not IsNumeric(ID)
The passed ID needs to be numeric
/CFIF

Generally because if an ID is required on a page, and none was passed 
in, I'm just gonna send them to a different page.. but if an invalid ID 
was passed I might want to show an error.

I think in order to do *THAT* you'd have to write a lot more code using 
cftry/cfcatch.

rick

~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:232367
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations  Support: http://www.houseoffusion.com/tiny.cfm/54


Re: Try/Catch vs. direct error handling

2006-02-15 Thread Dave Carabetta
On 2/15/06, Michael Dinowitz [EMAIL PROTECTED] wrote:
 But the performance hit only comes when an actual error occurs. When no
 error occurs, the CFTRY/CFCATCH has very little overhead.
 As for the issue of StructKeyExists() over IsDefined(), I've advocated it in
 my presentations for a long time as it is logically more efficient. This may
 be a fallacy, but I believe it to be.


Agreed, but, in my humble opinion, a pragmatic programmer correctly
programs for situations that s/he can reasonably predict in advance.
Here's sort of the way I look at it at a broader level:

try/catch should be used around snippets of business logic. Whether it
be a specific algorithm, an external call, or whatever, if you can
reasonably predict that a given section of code can *acceptably* fail,
then you can use cfthrow and catch the exception message. Your code is
so much cleaner than having to write detection logic for error
variables and such. structKeyExists() should be used for the existence
of a specific variable. That's what it's for. That's what the
engineers at Allaire/Macromedia/Adobe had in mind for the function all
along. Let it do what it does best. try/catch around the use of a
variable on the off-chance that it doesn't exist is simply not what it
was designed for, performance aside.

Regards,
Dave.

~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:232368
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations  Support: http://www.houseoffusion.com/tiny.cfm/54


RE: Try/Catch vs. direct error handling

2006-02-15 Thread Snake
I have a CFC that does my error handling.
I use a try/catch block, when an error occurs, I call the CFC and this CFC
creates a dump of all the error information plus all variable scopes, and
creates a nice friendly error message, like the windows ones, with a hidden
div that contains all the error information.
The alert then contains a button to view the error, which then shows the
hidden div, so you can still view the errors from the site.
A copy of the error is also emails to the webmaster so he can track errors
on the sites.

The usualy problem with error trapping, is that a client reports an erorr on
the site, and no-one can see it, and if visitors to the site get an error,
you don't even know about it.  with the above method, it's very easy to
debug without breaking an application, and I usually get the emails with the
error before the client reports it or even knows about it.

Russ
 

-Original Message-
From: Michael Dinowitz [mailto:[EMAIL PROTECTED] 
Sent: 15 February 2006 15:38
To: CF-Talk
Subject: Try/Catch vs. direct error handling

This is a question of best practices and why. When I know there's a chance
of a specific error, I tend to code specifically to handle it. Others code
generally using try/catch. Which is seen as best in other languages and why?
I doubt there's any real performance issue between them, so it's a question
of industry standard and style.

For example, if I know an ID is needed on a page and it has to be a numeric
I'd do:
CFIF Not IsDefined('ID')
An ID is needed
CFELSEIF Not IsNumeric(ID)
The passed ID needs to be numeric
/CFIF

Others do:
CFTRY
cfparam name=ID type=numeric
CFCATCH
You must pass a numeric ID
/CFCATCH
/CFTRY




~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:232369
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations  Support: http://www.houseoffusion.com/tiny.cfm/54


Re: Try/Catch vs. direct error handling

2006-02-15 Thread Michael Dinowitz
It was less a preference question then it was a question of industry 
standard practices and efficiency. Just because I like to code ahead of 
errors doesn't make it more efficient than a try/catch. I wanted to hear 
what others said, what links they brought up, etc. The links to Dave Shuck's 
blog is very interesting, especially to those who have not seen it before. 
Of course, it brings up the issue of test methodology and code actually 
used, but the point is still there. We're getting better info on the subject 
and new techniques.
That oracle ping query was rather interesting and I wonder if MSSQL has an 
equivalent without a lot of overhead (i.e. no overhead at all).


 Michael,

 CF-TALK not getting enough traffic today so you post a preference
 question? ;)

 For what it's worth, I *PREFER* direct error handling because I think
 it's more flexible.

 You wrote the following code:
 CFIF Not IsDefined('ID')
 An ID is needed
 CFELSEIF Not IsNumeric(ID)
 The passed ID needs to be numeric
 /CFIF

 I'd probably actually do:

 CFIF Not IsDefined('ID')
 cflocation url=someotherpage.cfm
 CFELSEIF Not IsNumeric(ID)
 The passed ID needs to be numeric
 /CFIF

 Generally because if an ID is required on a page, and none was passed
 in, I'm just gonna send them to a different page.. but if an invalid ID
 was passed I might want to show an error.

 I think in order to do *THAT* you'd have to write a lot more code using
 cftry/cfcatch.

 rick

 

~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:232370
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations  Support: http://www.houseoffusion.com/tiny.cfm/54


Re: Try/Catch vs. direct error handling

2006-02-15 Thread Aaron Rouse
I do not use MSSQL much but wouldn't it just be something like:

SELECT GETDATE()

For some reason I was thinking MSSQL will let you do a select with no from.


On 2/15/06, Michael Dinowitz [EMAIL PROTECTED] wrote:

 That oracle ping query was rather interesting and I wonder if MSSQL has an
 equivalent without a lot of overhead (i.e. no overhead at all).



~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:232371
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations  Support: http://www.houseoffusion.com/tiny.cfm/54


Re: Try/Catch vs. direct error handling

2006-02-15 Thread Claude Schneegans
 he claims it is perfectly rational

This is the hardest to take ! ;-))

-- 
___
REUSE CODE! Use custom tags;
See http://www.contentbox.com/claude/customtags/tagstore.cfm
(Please send any spam to this address: [EMAIL PROTECTED])
Thanks.


~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:232372
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations  Support: http://www.houseoffusion.com/tiny.cfm/54


Re: finding the base of the application

2006-02-15 Thread Nathan Strutz
You could try #expandPath(/)#
It's not foolproof, but it should generally work.

-nathan strutz
http://www.dopefly.com/

On 2/15/06, Joe Ferraro [EMAIL PROTECTED] wrote:
 I'm trying to figure out good way to find the base of the application, but I
 haven't come up with anything fool proof yet.

 lets say my application is

 C:\Inetpub\wwwroot\application\

 How can I find the C:\Inetpub\wwwroot\ ?

 Thanks,

 Joe


 

~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:232373
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations  Support: http://www.houseoffusion.com/tiny.cfm/54


RE: Try/Catch vs. direct error handling

2006-02-15 Thread Tim Heald
How fast is:

Select @@identity
From #mytable#

??

Or 

Select @@identity as myID 

 -Original Message-
 From: Aaron Rouse [mailto:[EMAIL PROTECTED] 
 Sent: Wednesday, February 15, 2006 1:54 PM
 To: CF-Talk
 Subject: Re: Try/Catch vs. direct error handling
 
 I do not use MSSQL much but wouldn't it just be something like:
 
 SELECT GETDATE()
 
 For some reason I was thinking MSSQL will let you do a select 
 with no from.
 
 
 On 2/15/06, Michael Dinowitz [EMAIL PROTECTED] wrote:
 
  That oracle ping query was rather interesting and I wonder if MSSQL 
  has an equivalent without a lot of overhead (i.e. no 
 overhead at all).
 
 
 
 

~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:232374
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations  Support: http://www.houseoffusion.com/tiny.cfm/54


Re: Try/Catch vs. direct error handling

2006-02-15 Thread Dave Carabetta
On 2/15/06, John C. Bland II [EMAIL PROTECTED] wrote:
 Good answer. So essentially Nagios will calmly stop the processing of your
 cf app? By stop I mean it will set a flag somwehere (app scope, etc) which
 tells your site to degrade?

You could if you want to, but I actually don't do that. Before you
gasp in horror, I want to reiterate that sometimes you just have
larger problems than anything ColdFusion can solve for you. In my
case, I'll get alerted every 15 seconds by 3 different geographic
locations that are pinging our site that something's up with the
database or with ColdFusion. I don't use the Probes feature built in
to ColdFusion (Enterprise, anyway...never used Standard) because it's
a purely CF solution. Well if CF is messed up somehow, then having
that probe does me no good. I would submit that you should have at
least one non-CF way of checking your site for a problem.


 Sounds interesting but not sure if I would nix my cftry/catches. Let's look
 at another scenario.

Definitely not advocating the abandonment of try/catches in the
slightest. I use them a lot around snippets of logic. I never use it
around checking for the existence of a variable though.


 You have a cfquery that executes a sproc (stored procedure) on your db. A
 change is made to the sproc that unknowingly affects this lonely cfquery
 tucked in a corner somewhere. How do you manage this potential error from
 happening? Sometimes things happen and people forget to make certain updates
 to necessary templates. It just happens. How does your app degrade here?

You might hate this answer, but that's precisely what a staging
environment and utilities like rsync and/or ANT are for. You're right,
there's a human element to issues that might arise. But no amount of
try/catch blocks or structKeyExists() checks can account for that. I
go back to a comment I made above. ColdFusion can't solve every single
issue that might arise with a web site. It would be convenient, and it
would make my life a lot easier sometimes, but it can't...and it
shouldn't. If you had to put in conditional checks to gracefully
handle every potential change in your application, then you're
fighting a losing battle, plain and simple. If you don't use utilities
like rsync or ANT, then definitely do some research into them. I can't
tell you how many times they've save my butt from this very problem
you outlined.


 BTW, I guess I meant Dave but said Brad in my other post.

No worries.

Regards,
Dave.

~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:232375
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations  Support: http://www.houseoffusion.com/tiny.cfm/54


Re: Try/Catch vs. direct error handling

2006-02-15 Thread Dave Carabetta
 On 2/15/06, Michael Dinowitz [EMAIL PROTECTED] wrote:
 
  That oracle ping query was rather interesting and I wonder if MSSQL has an
  equivalent without a lot of overhead (i.e. no overhead at all).
 

I don't use ColdFusion with SQL Server, but we do have a SQL Server
instance that I checked against and I simply did:

SELECT
  getDate()

That's it. I'm not sure if the SQL Server JDBC drivers are happy with
that syntax, but the SQL Query Analyzer had no problem with it.

Regards,
Dave.

~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:232376
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations  Support: http://www.houseoffusion.com/tiny.cfm/54


RE: finding the base of the application

2006-02-15 Thread Snake
That will return the path of whatever file is currently being executed.
I think you want GetBaseTemplatePath()

Russ 

-Original Message-
From: Nathan Strutz [mailto:[EMAIL PROTECTED] 
Sent: 15 February 2006 18:59
To: CF-Talk
Subject: Re: finding the base of the application

You could try #expandPath(/)#
It's not foolproof, but it should generally work.

-nathan strutz
http://www.dopefly.com/

On 2/15/06, Joe Ferraro [EMAIL PROTECTED] wrote:
 I'm trying to figure out good way to find the base of the application, 
 but I haven't come up with anything fool proof yet.

 lets say my application is

 C:\Inetpub\wwwroot\application\

 How can I find the C:\Inetpub\wwwroot\ ?

 Thanks,

 Joe


 



~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:232377
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations  Support: http://www.houseoffusion.com/tiny.cfm/54


Re: cfdocument how to use on a .cfm to print a form?

2006-02-15 Thread carol Tobey
What I need to do is have basically two versions of a .cfm one that has 
CFDocument wrapped around the code that I want output as either flashpaper of 
pdf.  But I do not want to keep to different .cfm files one with the 
cdoucment tag and one without. I want to put the CFDOCUMENT tag around my 
code but only want it to execute when they click a button that says printable 
format.  Otherwise if I wrap the cfdocument around my code all the time my 
form will never be able to accept input. An example would be mapquest they have 
a link that says printer friendly I want to do this on my form and have it call 
it's self so the user can then  print out either the flashpaper or pdf file.  
Does that help clarify what I want to do?

~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:232378
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations  Support: http://www.houseoffusion.com/tiny.cfm/54


Re: cfdocument how to use on a .cfm to print a form?

2006-02-15 Thread carol Tobey
What I need to do is have basically two versions of a .cfm one that has 
CFDocument wrapped around the code that I want output as either flashpaper of 
pdf.  But I do not want to keep to different .cfm files one with the 
cdoucment tag and one without. I want to put the CFDOCUMENT tag around my 
code but only want it to execute when they click a button that says printable 
format.  Otherwise if I wrap the cfdocument around my code all the time my 
form will never be able to accept input. An example would be mapquest they have 
a link that says printer friendly I want to do this on my form and have it call 
it's self so the user can then  print out either the flashpaper or pdf file.  
Does that help clarify what I want to do?

~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:232379
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations  Support: http://www.houseoffusion.com/tiny.cfm/54


Re: finding the base of the application

2006-02-15 Thread Joe Ferraro
getBaseTemplatePath doesn't get me exactly what i need, but I found another
way to get what I want. Esentially I wanted to be able to load an XML from a
relative path that was below the webroot. Looking in the code for Tartan I
found the something to the affect of this.

cfsavecontent variable=xmlcfinclude
template=\application\config\config.xml //cfsavecontent

This works really well and can be called from within a cfc regardless of
path context.

On 2/15/06, Snake [EMAIL PROTECTED] wrote:

 That will return the path of whatever file is currently being executed.
 I think you want GetBaseTemplatePath()

 Russ

 -Original Message-
 From: Nathan Strutz [mailto:[EMAIL PROTECTED]
 Sent: 15 February 2006 18:59
 To: CF-Talk
 Subject: Re: finding the base of the application

 You could try #expandPath(/)#
 It's not foolproof, but it should generally work.

 -nathan strutz
 http://www.dopefly.com/

 On 2/15/06, Joe Ferraro [EMAIL PROTECTED] wrote:
  I'm trying to figure out good way to find the base of the application,
  but I haven't come up with anything fool proof yet.
 
  lets say my application is
 
  C:\Inetpub\wwwroot\application\
 
  How can I find the C:\Inetpub\wwwroot\ ?
 
  Thanks,
 
  Joe
 
 
 



 

~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:232380
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations  Support: http://www.houseoffusion.com/tiny.cfm/54


Re: cfdocument how to use on a .cfm to print a form?

2006-02-15 Thread Sam Farmer
Something like this is, I think, what you are looking for:

cfif structKeyExists(url,print)
cfdocument
/cfif

cfform content etc

cfif structKeyExists(url,print)
/cfdocument
/cfif

Then have a link
a href=#cgi.script_name#?print=Print This/a

Cheers,

Sam F

On 2/15/06, carol Tobey [EMAIL PROTECTED] wrote:
 What I need to do is have basically two versions of a .cfm one that has 
 CFDocument wrapped around the code that I want output as either flashpaper 
 of pdf.  But I do not want to keep to different .cfm files one with the 
 cdoucment tag and one without. I want to put the CFDOCUMENT tag around my 
 code but only want it to execute when they click a button that says printable 
 format.  Otherwise if I wrap the cfdocument around my code all the time my 
 form will never be able to accept input. An example would be mapquest they 
 have a link that says printer friendly I want to do this on my form and have 
 it call it's self so the user can then  print out either the flashpaper or 
 pdf file.  Does that help clarify what I want to do?

 

~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:232382
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations  Support: http://www.houseoffusion.com/tiny.cfm/54


Re: Try/Catch vs. direct error handling

2006-02-15 Thread John C. Bland II
You are absolutely correct. There is no amount of code to catch everything
but I was just throwing out scenarios of potential issues Nagios doesn't
detect, based on your description of how you use it.

All is well.

On 2/15/06, Dave Carabetta [EMAIL PROTECTED] wrote:

 On 2/15/06, John C. Bland II [EMAIL PROTECTED] wrote:
  Good answer. So essentially Nagios will calmly stop the processing of
 your
  cf app? By stop I mean it will set a flag somwehere (app scope, etc)
 which
  tells your site to degrade?

 You could if you want to, but I actually don't do that. Before you
 gasp in horror, I want to reiterate that sometimes you just have
 larger problems than anything ColdFusion can solve for you. In my
 case, I'll get alerted every 15 seconds by 3 different geographic
 locations that are pinging our site that something's up with the
 database or with ColdFusion. I don't use the Probes feature built in
 to ColdFusion (Enterprise, anyway...never used Standard) because it's
 a purely CF solution. Well if CF is messed up somehow, then having
 that probe does me no good. I would submit that you should have at
 least one non-CF way of checking your site for a problem.

 
  Sounds interesting but not sure if I would nix my cftry/catches. Let's
 look
  at another scenario.

 Definitely not advocating the abandonment of try/catches in the
 slightest. I use them a lot around snippets of logic. I never use it
 around checking for the existence of a variable though.

 
  You have a cfquery that executes a sproc (stored procedure) on your db.
 A
  change is made to the sproc that unknowingly affects this lonely cfquery
  tucked in a corner somewhere. How do you manage this potential error
 from
  happening? Sometimes things happen and people forget to make certain
 updates
  to necessary templates. It just happens. How does your app degrade here?

 You might hate this answer, but that's precisely what a staging
 environment and utilities like rsync and/or ANT are for. You're right,
 there's a human element to issues that might arise. But no amount of
 try/catch blocks or structKeyExists() checks can account for that. I
 go back to a comment I made above. ColdFusion can't solve every single
 issue that might arise with a web site. It would be convenient, and it
 would make my life a lot easier sometimes, but it can't...and it
 shouldn't. If you had to put in conditional checks to gracefully
 handle every potential change in your application, then you're
 fighting a losing battle, plain and simple. If you don't use utilities
 like rsync or ANT, then definitely do some research into them. I can't
 tell you how many times they've save my butt from this very problem
 you outlined.

 
  BTW, I guess I meant Dave but said Brad in my other post.

 No worries.

 Regards,
 Dave.

 

~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:232383
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations  Support: http://www.houseoffusion.com/tiny.cfm/54


RE: Clean uninstall of CF 5.0

2006-02-15 Thread Dave Watts
 We're getting ready to migrate from CF 5.0 to CFMX 6.1. The 
 powers that be want a clean uninstall of 5.0 before we install MX.
 
 Are there any registry settings that are missed by the uninstaller?

If I recall correctly, the uninstaller will leave the registry settings that
contain configuration data in place, in case you reinstall CF in the future.
Those are in HKLM\SOFTWARE\Allaire\ColdFusion. It won't hurt anything if you
leave them there. The registry settings that tell the OS that CF is a
service, etc are removed.

Dave Watts, CTO, Fig Leaf Software
http://www.figleaf.com/

Fig Leaf Software provides the highest caliber vendor-authorized
instruction at our training centers in Washington DC, Atlanta,
Chicago, Baltimore, Northern Virginia, or on-site at your location.
Visit http://training.figleaf.com/ for more information!

~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:232385
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations  Support: http://www.houseoffusion.com/tiny.cfm/54


DreamWeaver MX - How do you add your own button

2006-02-15 Thread Brian Yager
to the toolbar at the top?  It was SO easy in CF Studio.  Right click, 
customize, add custom button.  Why did Macromedia take my studio away!

Brian

~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:232386
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations  Support: http://www.houseoffusion.com/tiny.cfm/54


CFUNITED-06 interview 7: Jeffry Houser - Creating Reusable Components in CFML

2006-02-15 Thread Michael Smith
In this issue of ColdFusion conference and training news:
* Hotel update - 77% full
* Win a ticket to CFUNITED with our competition. Deadline 2/28/06
* What's coming soon... classes, Free Sneak Peak and more...
* Interview with Jeffry Houser - Creating Reusable  Components in CFML


CFUNITED is the premier ColdFusion Conference near
Washington DC 6/28-7/1/06 (Four whole days!)
Check out speakers and topics at http://www.cfunited.com/

- Michael Smith
TeraTech, Inc

TeraTech is hiring a senior developer to join our growing team
http://www.teratech.com/index.cfm?go=About.JobDetailJobID=7

Conference and training news


* Upcoming classes
CF202 - Web Accessibility and 508 Feb 21 2006
FB101 - Intro to FuseboxFeb 28 2006
MS01 - Avoiding web disasters   Mar 1 2006
FB201 - Intermediate FuseboxMar 7 2006
CF206 - ColdFusion SQL Skills   Mar 14 2006

Cost $59 - $349 see http://www.teratech.com/training/ for more
details and registration


CFUNITED NEWS!
* Hotel guest room update. Currently 77% of the rooms have been sold. 
The Bethesda
North Marriot is the host of our event, which is located right at the 
Montgomery
County Conference Center. See http://www.cfunited.com/travel.cfm for 
details.

* Win a ticket to CFUNITED with our competition. Answer the questions 
and tell us
why should people come to CFUNITED-06 by 2/28/06 and you could win a 
free ticket to the event
http://www.cfunited.com/survey.cfm

* Come to CFUNITED Sneak Peek event on March 1st, 2006 at 7pm - 9pm at 
the Bethesda North Marriott
Hotel and Montgomery County Conference Center in the Brookside Room on 
the lower level. This is a
chance to get the inside scoop at what is happening new at this year's 
main event in June and you
also get to learn a little bit more about ColdFusion too. By the way, 
the event is FREE! (But
registration is required).
http://www.cfug-md.org/cfunited-sneak-peek.cfm

* New topic - MindMaps for better programming.

* Timely bird price ends 3/31/06

* only 131 days left until CFUNITED!

* What else is coming soon to CFUNITED website?
-- Fusetalk attendee chat list
-- Common Interest application where you can find other attendees with 
interest in common with you.
-- The schedule will have a new feature that you will be able to easily 
create your own personalized
schedule and print it out too.
-- Pre-conference class schedule and topics will be posted soon along 
with sign-up. Teachers are
Simon Horwith, Jeff Peters, Hal Helms, John Paul Ashenfelter, Kurtis D. 
Leatham, Rob Gonda, Adam
Wayne Lehman, and Nate Nelson.

**
And now our CFUNITED spotlight interview.

Michael Smith: This time we are talking with Jeffry Houser about his 
CFUNITED-06 talk Creating
Reusable Components in CFML. So why should a developer come to your 
session Jeffry?

Jeffry Houser: A developer should come to my session because they want 
to spend less hours at work
and more time on important things such as a with their wife, kids, or Xbox.

MS: That sounds intriguing, but what kind of magic juice are you 
drinking?  It isn't that easy, is
it?

JH: I'm actually drinking water today, but yes it is that easy.  In my 
presentation I'm going to be
talking about the different flavors of code re-use in CFML.  Once you 
implement code-reuse you'll
have less development time, less debugging time, and less overtime.

MS: That does sound nice.  Are you sure that it isn't your water that is 
flavored, as opposed to
CFML?  How do you re-use your CFML code?

JH: I assure you this is just plain water.  There are plenty of ways to 
reuse code in CFML, all of
them built right into the language itself.  I'll talk about includes, 
custom tags, User Defined
Functions (UDFs), and ColdFusion Components (CFCs).  My presentation 
will talk about the evolution
of encapsulation through the ages of CFML, what each flavor brings to 
the table, and when to use
one over the other.

MS: The Evolution of Encapsulation, eh?  Nice alliteration.  What 
exactly is encapsulation, and how
did it evolve?

JH: Encapsulation is the process of building re-usable chunks of code. 
With each release of
ColdFusion, the encapsulation features of the language just keep 
improving.  We didn't have UDFs
until CF5, and CFCs were not introduced until CFMX.  Re-use is one 
by-product of encapsulation.

MS: I think I get it now.  Are there other benefits of encapsulation?

JH: There sure are.  As I mentioned before, encapsulation offers you 
less debugging time and
quicker development.  With some forms of encapsulation you also have the 
benefit of code hiding.
This means that you are coding a black box type of implementation.  Your 
black box can change, but
the code that uses your black box does not change.  You can think of 
ColdFusion as one big black
box.  When you upgraded from CF5 to CFMX everything inside the box 
changed (From C++ to Java), yet
your usage of CFML was probably not affected.  You still 

OT: Oracle Select Help needed...

2006-02-15 Thread Charles E. Heizer
Hello,
I've hit a snag and I'm not sure how to get past it. I have a table  
with ldap paths in it. The column is called compdn and I'm trying to  
find all of the records which have the phrase THE-LAB in it. The  
problem I' having is that it's returning 0 records found when I know  
there are several in there.

Here is my query...

cfquery datasource=myDBODBC name=q_Systems
SELECT upper(COMPDN) as DN
FROM ADINFO
WHERE COMPDN like '%THE-LAB%'
/cfquery

Here is an example record...
OU=Computers,OU=FOO,DC=the-lab,DC=llnl,DC=gov


Can someone please explain to me why this does not work?

Thanks,
- Charles

~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:232391
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations  Support: http://www.houseoffusion.com/tiny.cfm/54


Re: OT: Oracle Select Help needed...

2006-02-15 Thread Charles E. Heizer
Sorry,
Nevermind... I figured it out...

It should read ...

SELECTCOMPDN as DN
FROM ADINFO
WHERE upper(COMPDN) like '%THE-LAB%'


On Feb 15, 2006, at 3:51 PM, Charles E. Heizer wrote:

 Hello,
 I've hit a snag and I'm not sure how to get past it. I have a table
 with ldap paths in it. The column is called compdn and I'm trying to
 find all of the records which have the phrase THE-LAB in it. The
 problem I' having is that it's returning 0 records found when I know
 there are several in there.

 Here is my query...

 cfquery datasource=myDBODBC name=q_Systems
   SELECT upper(COMPDN) as DN
   FROM ADINFO
   WHERE COMPDN like '%THE-LAB%'
 /cfquery

 Here is an example record...
 OU=Computers,OU=FOO,DC=the-lab,DC=llnl,DC=gov


 Can someone please explain to me why this does not work?

 Thanks,
 - Charles

 

~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:232392
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations  Support: http://www.houseoffusion.com/tiny.cfm/54


Re: OT: Oracle Select Help needed...

2006-02-15 Thread Dave Carabetta
On 2/15/06, Charles E. Heizer [EMAIL PROTECTED] wrote:
 Hello,
 I've hit a snag and I'm not sure how to get past it. I have a table
 with ldap paths in it. The column is called compdn and I'm trying to
 find all of the records which have the phrase THE-LAB in it. The
 problem I' having is that it's returning 0 records found when I know
 there are several in there.

 Here is my query...

 cfquery datasource=myDBODBC name=q_Systems
 SELECT upper(COMPDN) as DN
 FROM ADINFO
 WHERE COMPDN like '%THE-LAB%'
 /cfquery

 Here is an example record...
 OU=Computers,OU=FOO,DC=the-lab,DC=llnl,DC=gov


 Can someone please explain to me why this does not work?


It looks like the record is being stored as ...the-lab... and you're
searching on THE-LAB. Since the search is case-sensive, you'll need to
either use LCase() around the CF variable or put UPPER() around the
compdn column name, like so:

SELECT
  UPPER(compdn) AS dn
FROM
  adinfo
WHERE
  UPPER(compdn) LIKE '%THE-LAB%'

You lose a lot by doing that (if there's and index on the compdn
column, it won't get used), but the seach should at least yield the
expected results.

Regards,
Dave.

~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:232393
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations  Support: http://www.houseoffusion.com/tiny.cfm/54


CFC cftransaction

2006-02-15 Thread Stan Winchester
I'm still relatively new to CFC's and I was wondering is there anything
wrong with wrapping a cftransaction block around a method that flushes to
the database as follows? 

cfset OKtoCommit = TRUE /
cftransaction action=BEGIN
  cftry
 
 cfset myDiscount.flushDiscountToDatabase(ArgumentCollection=urlParams)
/

cfcatch type=Any
  cfset OKtoCommit = FALSE /
/cfcatch
  /cftry
  cfif OKtoCommit
cftransaction action=COMMIT /
  cfelse
cftransaction action=ROLLBACK /
  /cfif
/cftransaction

I know the works, but if this is okay, then theoretically one could do a
batch insert of parent/child table records and one cftransaction to handle
it all. Is there a better way to handle this?
 
Thank you,
Aftershock Web Design, Inc.
by: Stan Winchester
President/Developer
http://www.aftershockweb.com/   



~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:232394
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations  Support: http://www.houseoffusion.com/tiny.cfm/54


Re: CFC cftransaction

2006-02-15 Thread Barney Boisvert
No need to catch and manually roll back or commit the transaction, the
CFTRANSACTION tag will take care of all that for you.  You'd get the
same effect with this:

cftransaction
cfset myDiscount.flushDiscountToDatabase(ArgumentCollection=urlParams) /
/cftransaction

The only difference would be that execution will stop with this code,
while with your code, execution would continue after the
/cftransaction tag.

Either way, this is a perfectly reasonable practice.

cheers,
barneyb

On 2/15/06, Stan Winchester [EMAIL PROTECTED] wrote:
 I'm still relatively new to CFC's and I was wondering is there anything
 wrong with wrapping a cftransaction block around a method that flushes to
 the database as follows?

 cfset OKtoCommit = TRUE /
 cftransaction action=BEGIN
   cftry

  cfset myDiscount.flushDiscountToDatabase(ArgumentCollection=urlParams)
 /

 cfcatch type=Any
   cfset OKtoCommit = FALSE /
 /cfcatch
   /cftry
   cfif OKtoCommit
 cftransaction action=COMMIT /
   cfelse
 cftransaction action=ROLLBACK /
   /cfif
 /cftransaction

 I know the works, but if this is okay, then theoretically one could do a
 batch insert of parent/child table records and one cftransaction to handle
 it all. Is there a better way to handle this?

 Thank you,
 Aftershock Web Design, Inc.
 by: Stan Winchester

--
Barney Boisvert
[EMAIL PROTECTED]
360.319.6145
http://www.barneyb.com/

Got Gmail? I have 100 invites.

~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:232395
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations  Support: http://www.houseoffusion.com/tiny.cfm/54


Re: CF Licensing on a VMWARE Server instance?

2006-02-15 Thread Chris Velevitch
On 2/15/06, Big Mad Kev [EMAIL PROTECTED] wrote:
 Developer is still limited this is to ensure that every thing works as it
 will on live and thus needs to be full blown]

Limited in what respect. I thought the developer version was simply
the full version but limits the number of connections.


Chris
--
Chris Velevitch
Manager - Sydney Flash Platform Developers Group
www.flashdev.org.au

~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:232396
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations  Support: http://www.houseoffusion.com/tiny.cfm/54


RE: CFC cftransaction

2006-02-15 Thread Dave Watts
 I'm still relatively new to CFC's and I was wondering is 
 there anything wrong with wrapping a cftransaction block 
 around a method that flushes to the database as follows? 
 
 cfset OKtoCommit = TRUE /
 cftransaction action=BEGIN
   cftry
  
  cfset 
 myDiscount.flushDiscountToDatabase(ArgumentCollection=urlParams)
 /
   
 cfcatch type=Any
   cfset OKtoCommit = FALSE /
 /cfcatch
   /cftry
   cfif OKtoCommit
 cftransaction action=COMMIT /
   cfelse
 cftransaction action=ROLLBACK /
   /cfif
 /cftransaction
 
 I know the works, but if this is okay, then theoretically one 
 could do a batch insert of parent/child table records and one 
 cftransaction to handle it all. Is there a better way to handle 
 this?

I have two things I want to say in response to your question.

First, and this has nothing to do with your question, you don't need all
that try/catch junk in there. This:

cftransaction action=begin
cftry
... queries ...
/cftry
cfcatch
cftransaction action=rollback
/cfcatch
/cftransaction

is equivalent to this:

cftransaction
... queries ...
/cftransaction

If any of the queries fail, the transaction will be rolled back. That's what
transactions do. For some reason, I see this kind of code a lot, and I
really don't know where the idea came from that you need to use try/catch
logic with this. If you were to do something outside the database, and you
wanted to roll back the transaction if that operation failed, then yes,
you'd use try/catch.

OK, now on to your actual question. I'll be honest and say that I've never
tried this, but I suspect it will work, as long as the
flushDiscountToDatabase method only runs queries within the same database
connection (datasource, username, password). But the problem is, looking at
your code, you really can't tell. My general rule for these sorts of things
is, if there's any ambiguity in what you're doing, you're probably better
off not doing it. And in your case, since you're only executing the one
method in your CFC, why not just put the transactional logic within the
method you're calling?

Again, I could be wrong - it may not work at all. The CFTRANSACTION tag has
quite a few limitations in what you can do with it. But I won't find out,
because I won't interact with the database that way. In general, if I feel
that multiple database operations should be contained within a single
transaction, I'll write a stored procedure to do that and call my stored
procedure from my application. My approach does have some shortcomings, such
as not being able to easily deal with multiple child rows when creating a
parent record and N children, but I've learned to live with them.

Dave Watts, CTO, Fig Leaf Software
http://www.figleaf.com/

Fig Leaf Software provides the highest caliber vendor-authorized
instruction at our training centers in Washington DC, Atlanta,
Chicago, Baltimore, Northern Virginia, or on-site at your location.
Visit http://training.figleaf.com/ for more information!


~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:232397
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations  Support: http://www.houseoffusion.com/tiny.cfm/54


Re: cfdocument how to use on a .cfm to print a form?

2006-02-15 Thread Chris Velevitch
On 2/16/06, Caroline Tobey [EMAIL PROTECTED] wrote:
 I am new to using MX and need to add a button to a .cfm form that has
 numerous input fields.  The user will need to input and save their data
 then click a button to print the completed form. How do I do this using
 a button on the form that will say printerfreindly output then the
 cfdocument tag in my code?  Any examplse would be wonderful thanks.

Since this is a two step process 1) to save the data on the form and
2) print the data from the form, you'll need have two .cfm files to
handle this. The cfdocument tag doesn't allow the inclusion of the
cfform tag, which makes sense because if the cfdocument tag did allow 
 the cfform tag, all you'll end up with is a printed version of an
empty form. The cfdocument tag doesn't generate html as it's output,
it generates pdf or flashpaper out. The cfdocument tag is not an
interactive tag, it's a server processing tag.


Chris
--
Chris Velevitch
Manager - Sydney Flash Platform Developers Group
www.flashdev.org.au

~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:232398
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations  Support: http://www.houseoffusion.com/tiny.cfm/54


RE: CFC cftransaction

2006-02-15 Thread Nick Han
is equivalent to this:

 cftransaction
... queries ...
 /cftransaction

If any of the queries fail, the transaction will be rolled back.
That's what transactions do. For some reason, I see this kind of code
a lot, and I really don't know where the idea came from that you need
to use try/catch logic with this. If you were to do something outside
the database, and you wanted to roll back the transaction if that
operation failed, then yes, you'd use try/catch.

Dave, I read this in Cold Fusion MX Bible book.  According to the
author and I quote, In our tests, ColdFusion MX slows to a crawl if
CFTRANSACTION tags are not explicitly coded with BEGIN, COMMIT, and
ROLLBACK commands


~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:232399
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations  Support: http://www.houseoffusion.com/tiny.cfm/54


Re: CFC cftransaction

2006-02-15 Thread Stan Winchester
The reason you see a lot of code using cftransaction with try/catch is probably 
because it comes straight from the ColdFusion MX Bible. They say if we don't 
use BEGIN, COMMIT, and ROLLBACK then CFMX will slow to a crawl.

Putting the cftransaction with try/catch in the action page does work, and it 
does catch errors; I just want to do something stupid. So you feel if I passed 
the data source as an argument, then you would be okay?

I'm working in MySQL 4.1 now, so stored procedures are not an option, but would 
be the better approach.

I can put the cftransaction in the cfc, but if I do an insert/update on a 
parent record and N children then I may have to write the same queries more 
than once since you cannot nest cftransaction tags. I may want to only update a 
parent or a single child record without having to update the entire family. I 
was thinking I should be able to do the following:

cftransaction 
  cfset myDiscount.flushDiscountToDatabase(ArgumentCollection=formParams) /
  cfloop index=i from=1 to=#somenum#
cfset myChildDiscount.flushChildDiscountToDatabase(i) /
  /cfloop
/cftransaction

Thanks! Stan

~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:232400
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations  Support: http://www.houseoffusion.com/tiny.cfm/54


A little query help..

2006-02-15 Thread J W
I am trying to get a query to run and right now my brain is in Monday mode..

Lets say I have 2 tables

Table 1 - COLORS

ColorID   Color
1red
2blue
3green
4tan

Table 2 - PEOPLE

PersonIDName   colorchoice1   colorchoice2
1Jane   1   3
2Jim 2   4


How do I display this from a query:

Jane  red   green
Jimblue  tan

?? I can get one name by using this

select *
from colors c, people p
where c.colorchoiceID = p.colorchoice1

That will effectively give me the name of the first color. How in the world
can I get the second color in ONE query. I can do it in two, but trying to
use it in CFGRID, you can only use the one. Is it even possible to get in 1?

Thanks,
Jeff


~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:232401
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations  Support: http://www.houseoffusion.com/tiny.cfm/54


Re: coldfusion and SQL2005

2006-02-15 Thread J W
After hashing it over with the dell rep today. here was my conclusion.

You don't need a processor license if your webserver making the connections
appears as one user making the queries. (I am pretty sure coldfusion
operates this way) That way you only need 1 cal per web server.

Jeff


~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:232402
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations  Support: http://www.houseoffusion.com/tiny.cfm/54


Re: A little query help..

2006-02-15 Thread Jim Wright
you can join the first table twice

select p.name,c1.color AS color1, c2.color AS color2
from  people p LEFT JOIN colors c1 ON p.colorchoice1 = c1.colorID
LEFT JOIN colors c2 ON p.colorchoice2 = c2.colorID


On 2/15/06, J W [EMAIL PROTECTED] wrote:
 I am trying to get a query to run and right now my brain is in Monday mode..

 Lets say I have 2 tables

 Table 1 - COLORS

 ColorID   Color
 1red
 2blue
 3green
 4tan

 Table 2 - PEOPLE

 PersonIDName   colorchoice1   colorchoice2
 1Jane   1   3
 2Jim 2   4


 How do I display this from a query:

 Jane  red   green
 Jimblue  tan

 ?? I can get one name by using this

 select *
 from colors c, people p
 where c.colorchoiceID = p.colorchoice1

 That will effectively give me the name of the first color. How in the world
 can I get the second color in ONE query. I can do it in two, but trying to
 use it in CFGRID, you can only use the one. Is it even possible to get in 1?

 Thanks,
 Jeff


 

~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:232403
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations  Support: http://www.houseoffusion.com/tiny.cfm/54


Re: A little query help..

2006-02-15 Thread Tony
yeah, that way too :)

tony

On 2/15/06, Tony [EMAIL PROTECTED] wrote:
 here is what i would do:

 select *
 from people
 order by name

 and then you can make your display choices on the display
 layer, and handle it through html and cf statements.  not
 sure if you can accomplish with that db design.

 and on that note, i think a join table would be more normalized, but not DIRE.

 tw

 On 2/15/06, J W [EMAIL PROTECTED] wrote:
  I am trying to get a query to run and right now my brain is in Monday mode..
 
  Lets say I have 2 tables
 
  Table 1 - COLORS
 
  ColorID   Color
  1red
  2blue
  3green
  4tan
 
  Table 2 - PEOPLE
 
  PersonIDName   colorchoice1   colorchoice2
  1Jane   1   3
  2Jim 2   4
 
 
  How do I display this from a query:
 
  Jane  red   green
  Jimblue  tan
 
  ?? I can get one name by using this
 
  select *
  from colors c, people p
  where c.colorchoiceID = p.colorchoice1
 
  That will effectively give me the name of the first color. How in the world
  can I get the second color in ONE query. I can do it in two, but trying to
  use it in CFGRID, you can only use the one. Is it even possible to get in 1?
 
  Thanks,
  Jeff
 
 
  

~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:232408
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations  Support: http://www.houseoffusion.com/tiny.cfm/54


RE: DreamWeaver MX - How do you add your own button

2006-02-15 Thread Eric Roberts
You don't...at least not until you upgrade to version 8...

Eric 

-Original Message-
From: Brian Yager [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, 15 February 2006 14:21
To: CF-Talk
Subject: DreamWeaver MX - How do you add your own button

to the toolbar at the top?  It was SO easy in CF Studio.  Right click,
customize, add custom button.  Why did Macromedia take my studio away!

Brian



~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:232409
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations  Support: http://www.houseoffusion.com/tiny.cfm/54


Re: coldfusion and SQL2005

2006-02-15 Thread Jim Wright
Also, they only need licence the
 number of CPUs being used by Windows Server. In Windows Server 2003 you can
 rope off processors so that while a box may have two CPUs it only uses one.
 In that example they'd only need a single processor licence.

hmmm..in SQL Server you can also limit which CPU's are used...would
that affect the licensing even if Windows was using all of the
processors?

--
Jim Wright
Wright Business Solutions
[EMAIL PROTECTED]
919-417-2257

~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:232410
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations  Support: http://www.houseoffusion.com/tiny.cfm/54


RE: coldfusion and SQL2005

2006-02-15 Thread Dawson, Michael
I also agree with Jim.  MS' rule is that you must know each user that
connects to SQL Server.  You must then provide a SQL CAL for each user.

If you do know know each user, basically when connected to the
internet via a web server, then you MUST license SQL as per-processor.

Otherwise, you could get a base SQL Server install (that normally
includes 5 CALs) and get by with a minimum expense.  You know MS won't
allow that. ;)

If this SQL Server will provide for an intranet ONLY (captive audience),
then you can get buy with CALs, but then you have the hassel of
maintaining enough CALs and the cost may be more-expensive than just
licensing per-processor.

M!ke 

-Original Message-
From: Jim Wright [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, February 15, 2006 8:38 PM
To: CF-Talk
Subject: Re: coldfusion and SQL2005

That may be what the Dell rep said, but I can pretty much guarantee you
that MS doesn't think of it that way.  Everything I have seen regarding
using SQL Server in conjunction with an internet facing application
server requires the per processor license.  Even in the old days before
the current per processor licensing, you had to by the internet
connector license if it was going to be used with an application server
on the internetjust a CAL wouldn't cut it.

~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:232411
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations  Support: http://www.houseoffusion.com/tiny.cfm/54


Re: coldfusion and SQL2005

2006-02-15 Thread Peter Tilbrook
This is similar to how Macromedia/Adobe license ColdFusion 7 and JRun. More 
that 2 processors requires more than the initial license. Not certain if that 
includes clustering but imagine a license is required for each separate server 
in the cluster (Enterprise as Standard cannot cluster of course).

~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:232412
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations  Support: http://www.houseoffusion.com/tiny.cfm/54


Re: Try/Catch vs. direct error handling

2006-02-15 Thread Rick Root
Aaron Rouse wrote:
 I do not use MSSQL much but wouldn't it just be something like:
 
 SELECT GETDATE()
 
 For some reason I was thinking MSSQL will let you do a select with no from.

getdate() has overhead.

how about:

SELECT 1

in Oracle I always did SELECT 1 FROM DUAL.

Access doesn't like SELECT 1 and has no dummy table so I actually 
created a table called DUAL in Access for ease of coding in blogcfm so 
i could actually write code to be nearly all the same.

doing SELECT @@IDENTITY or SELECT GETDATE() both require the server to 
do some work.. calculate the time, get the last identity, etc.

Rick

~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:232417
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations  Support: http://www.houseoffusion.com/tiny.cfm/54


burning the midnight oil on my chat room

2006-02-15 Thread Rick Root
http://www.opensourcecf.com/chat

Anyone wanna drop in for a few minutes?

rick

~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:232418
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations  Support: http://www.houseoffusion.com/tiny.cfm/54


Re: burning the midnight oil on my chat room

2006-02-15 Thread Rick Root
Due to a really nasty security risk I've just discovered, my chat room 
is no longer available I'm off to the AJAX list!

Rick

Rick Root wrote:
 http://www.opensourcecf.com/chat
 
 Anyone wanna drop in for a few minutes?


~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:232419
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations  Support: http://www.houseoffusion.com/tiny.cfm/54