Re: Slow (sorta) site issues - Ideas?

2004-12-28 Thread Jim McAtee
In a shared environment you have to ask yourself to what degree optimizing 
the performance of your site's code is ultimately going to improve your 
web site's performance.  Even if you were to increase performance 10-fold 
it's unlikely you'll see anywhere near that performance gain if there are 
200 other web sites on the same server.  It will of course depend on what 
those other sites are doing when yours is busy, but you have so little 
control over this that all you can do is cross your fingers.  If you knew 
that your site was going to use a significant percentage of the server's 
resources then it may be worth the effort.  If you don't know this then 
it's just a crap-shoot.


- Original Message - 
From: Jim Davis [EMAIL PROTECTED]
To: CF-Talk cf-talk@houseoffusion.com
Sent: Monday, December 27, 2004 8:38 PM
Subject: RE: Slow (sorta) site issues - Ideas?


 -Original Message-
 From: gabriel l smallman [mailto:[EMAIL PROTECTED]
 Sent: Monday, December 27, 2004 8:27 PM
 To: CF-Talk
 Subject: RE: Slow (sorta) site issues - Ideas?

 Couple of thoughts:

 1. Flatten every page you can to html

 I'm loath to do that just because I'd lose my clickstream caching... but
 then again it'd be better to lose some data than the site.

 2. Take a look at cfaccelerate sp? Basically saves flattened html in 
 the
 app. Scope. If your sneaky you can cache chunks of the page even if its
 dynamic much of the page is not.

 I do some of this as it is (navigation for example)... but I'll take a 
 look.
 I'm sure I could do more.

 3. turn on trusted cache (you will get a nice boost)

 Unfortunately not under my control (this is a shared hosting account - 
 we're
 not the only app on the box).

 4. pray!

 Well... I'm an atheist, but I get your drift.  ;^)

 5. cache every query you can even if for 10 seconds

 The application is already pretty heavily optimized.  The only real 
 queries
 being done is the session manager (which would definitely not benefit 
 from
 caching).  The main events database, for example, is loaded directly 
 into an
 Application scoped CFC bundle.  It makes accessing event data insanely 
 fast
 compared to DB calls.

 The festival itself is large by any standard, but doesn't represent a 
 whole
 lot of data (about 200 artists at something like 60 venues).  Loading it 
 all
 into memory is the biggest speed boost I can get (which I've done).

 This leaves the database doing only two things: saving and fetching 
 visitors
 plans (saved events) which is pretty peppy and storing session data.
 Neither can benefit from query caching.

 Btw.. What does a company like crystal tech charge to host?

 All sorts of prices.  ;^)  The account we're getting (VERY feature rich) 
 is
 only $26 a month (with SQL Server, tons of space, a generous bandwidth
 allotment).  CrystalTech has upped limits and features twice and dropped
 prices once since I've been with them.

 They're a very good CF host - any problems this site has on the 31st 
 can't
 truly be blamed on them.

 Jim Davis





 

~|
Special thanks to the CF Community Suite Gold Sponsor - CFHosting.net
http://www.cfhosting.net

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:188847
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: Single application - multiple users with differing specifications

2004-12-28 Thread Ian Buzer
Hi,

I don't think this is particularly unusual...

While department B wants additional features and won't use some of the 
existing, I am assuming that the features they share, and indeed the business 
rules behind them all are common.

In that case, write an application that does everything for everybody, then set 
up a security matrix that hides/disables the functionality from those 
users/groups/departments that don't want it (or shouldn't be using it for 
security reasons).

I seem to remember there was a thread on this list recently discussing various 
security models using groups, roles and authorities.

If you're using an architechture like fusebox, you can easily restrict an 
action or a circuit to a particular group or user.

Ian

~|
Special thanks to the CF Community Suite Gold Sponsor - CFHosting.net
http://www.cfhosting.net

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:188848
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: Single application - multiple users with differing specifications

2004-12-28 Thread Ian Buzer
Another thought.

Whatever you do, bear in mind that department C and D will be along soon with 
their own requirements. You need to be able to design something whereby you can 
accomodate this without multiplying the amount of code you produce. It's 
probably worth thinking How will this look if I find myself with 10 or 20 
departments, each with their own requirements.

Ian

~|
Special thanks to the CF Community Suite Silver Sponsor - CFDynamics
http://www.cfdynamics.com

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:188849
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: Dumb Question About CFPARAM

2004-12-28 Thread Gaulin, Mark
Yeah, that ought to work. CF can't see your sql if logic, so it might as 
well be one giant select statement for all it cares. On the SQL Server end I 
would expect it to handle that just fine.

You could also write a stored procedure for this logic.

Mark

-Original Message-
From: Jim Davis [mailto:[EMAIL PROTECTED]
Sent: Tuesday, December 28, 2004 1:35 AM
To: CF-Talk
Subject: Dumb Question About CFPARAM


I'm trying to optimize some queries and I've got a dumb question.  The
current code is like this:

!--- Check to see if the key exists --- cfquery ... 
SELECT  SessionKey
FROM Table
WHERE   SessionKey = cfqueryparam ... 
/cfquery
!--- If it's a new entry, create it, if not update it --- cfif
local.CheckEntry.RecordCount EQ 0
!--- Add the Session information ---
cfquery ... 
INSERT INTO Table( SessionKey )
VALUES ( cfqueryparam ...  )
/cfquery
cfelse
cfquery ... 
UPDATE Table
SET SessionKey = cfqueryparam ... 
/cfquery
/cfif

What I'm going to do (this is SQL Server 2000) is replace that with an
exists test in a single query like so:

!--- Check to see if the key exists --- cfquery ... 
IF EXISTS (
SELECT  SessionKey
FROM Table
WHERE   SessionKey = cfqueryparam ... 
)
BEGIN
INSERT INTO Table( SessionKey )
VALUES ( cfqueryparam ...  )
END
ELSE
BEGIN
UPDATE Table
SET SessionKey = cfqueryparam ... 
END
/cfquery

My question is with CFPARAM - what's up in this case?  Will it work fine
when all of the parameters all nested in IF statements like this?  Will
there just be a big long list of BIND variables and will the statement
(INSERT or RUN) use the right ones?

Am I making any sense?

Jim Davis





~|
Special thanks to the CF Community Suite Gold Sponsor - CFHosting.net
http://www.cfhosting.net

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:188850
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: Form Data Tracking

2004-12-28 Thread Tangorre, Michael
 From: Joe Eugene [mailto:[EMAIL PROTECTED] 
 We have a need to track Form Updates by users i.e. history of 
 updates to Forms.
 Once the user submits a from after validation, we want to 
 track the updates done.
 e.g.
 User A can change their Credit card info several times on a 
 Form, we need to Track those changes and any other agreements 
 they might have agreed to on the Form.
 
 Options.
 1. Save the entire contents of the Form as *.htm/*.pdf files 
 or populate them in the DB.
 2. Implement a complex DB Relational Structure to store the 
 content and data.
 
 Any other Ideas? Anybody else implemented something like this before?

Joe,

I would recommend setting up a DB structure to take care of the
historical change data. I would first identify how many fields you need
to track. If it is just a couple then create a couple tables and use
triggers (depending upon DB platform and application load) to capture
when columns are updated or inserted. For example: I want to keep track
of what credit cards users use with their accounts. Assuming I did not
structure the DB to accommodate multiple accounts (CC) I would implement
something like this:

USER
--USER_ID (PK)
--USERNAME
--CC_NUMBER

HIST_CC_NUMBER
--CHANGE_ID (PK)
--USER_ID (FK)
--FROM_CC_NUMBER
--TO_CC_NUMBER
--DATE_CHANGED

Add a trigger to the CC_NUMBER column in the USER table for 'insert' and
'update' and store the appropriate values. If your needs go beyond a
couple columns, you might consider a complete set of historical tables
that mimic your transactional tables. If you go this route, I would
evaluate application load to determine whether or not triggers are you
best bet or if programming the routines in code would yield better
results... I have done it both ways. 

HTH,

Mike

~|
Special thanks to the CF Community Suite Silver Sponsor - RUWebby
http://www.ruwebby.com

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:188851
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


Mach-II client variables

2004-12-28 Thread Matthew Small
Question for the Mach-II people on this list -
I have a dropdown box that appears on every page, in its own form on
each page of my small application.  I'd like the most recently selected item
on this dropdown box to be selected whenever I move to a new page view. I
can set a variable that holds the last value selected whenever the dropdown
is changed, but when I move to a view that does not pass the dropdown box
into the form scope, I lose the most recently selected value and it moves to
the default value on the next view.  
I tried placing the MRU value into both session and client
variables, and enabling client and session variables in the CFApplication
tag, but I just got an error.  Also, the most logical place for me to put an
assignment for this variable is in a CFC, but I see that Mr. Corfield does
not recommend doing this:

It's not that CFCs cannot access scope variables, just that they
should not in general (since it breaks encapsulation). The general
approach is to create a CFC whose sole job is to 'wrap' the scope
access so as to hide it from the rest of the app.

http://lists.topica.com/lists/mach-ii-coldfusion/read/message.html?mid=81031
3532sort=dstart=2193

So where/how can I create a variable that persists this information?

Thank you,

 
Matthew Small
Web Developer
American City Business Journals
704-973-1045
[EMAIL PROTECTED]


~|
Special thanks to the CF Community Suite Silver Sponsor - RUWebby
http://www.ruwebby.com

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:188852
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: Mach-II client variables

2004-12-28 Thread Matthew Small
I have realized that I am having a problem with client variables, but I
don't know why.  I get this message when I try to set a client variable:

Message:
The requested scope client has not been enabled. 

Details:
Before client variables can be used, the client state management system must
be enabled using the CFAPPLICATION tag.

However, I do have the clientmanagement=yes attribute set in the
CFAPPLICATION tag.  What am I doing wrong? Is there anything I should be
checking on the server?

 
Matthew Small
Web Developer
American City Business Journals
704-973-1045
[EMAIL PROTECTED]
 

-Original Message-
From: Matthew Small [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, December 28, 2004 8:52 AM
To: CF-Talk
Subject: Mach-II  client variables

Question for the Mach-II people on this list -
I have a dropdown box that appears on every page, in its own form on
each page of my small application.  I'd like the most recently selected item
on this dropdown box to be selected whenever I move to a new page view. I
can set a variable that holds the last value selected whenever the dropdown
is changed, but when I move to a view that does not pass the dropdown box
into the form scope, I lose the most recently selected value and it moves to
the default value on the next view.  
I tried placing the MRU value into both session and client
variables, and enabling client and session variables in the CFApplication
tag, but I just got an error.  Also, the most logical place for me to put an
assignment for this variable is in a CFC, but I see that Mr. Corfield does
not recommend doing this:

It's not that CFCs cannot access scope variables, just that they
should not in general (since it breaks encapsulation). The general
approach is to create a CFC whose sole job is to 'wrap' the scope
access so as to hide it from the rest of the app.

http://lists.topica.com/lists/mach-ii-coldfusion/read/message.html?mid=81031
3532sort=dstart=2193

So where/how can I create a variable that persists this information?

Thank you,

 
Matthew Small
Web Developer
American City Business Journals
704-973-1045
[EMAIL PROTECTED]




~|
Special thanks to the CF Community Suite Gold Sponsor - CFHosting.net
http://www.cfhosting.net

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:188853
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: Mach-II client variables

2004-12-28 Thread Tangorre, Michael
 From: Matthew Small [mailto:[EMAIL PROTECTED] 
 Before client variables can be used, the client state 
 management system must be enabled using the CFAPPLICATION tag.

You need to set the location for storing the client vars..
http://livedocs.macromedia.com/coldfusion/6.1/htmldocs/tags-pa3.htm#wp10
97308

You need to set the clientStorage attribute in the cfapplication tag.

HTH,

Mike

~|
Special thanks to the CF Community Suite Silver Sponsor - New Atlanta
http://www.newatlanta.com

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:188854
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: Mach-II client variables

2004-12-28 Thread Matthew Small
Thanks, but I've already tried that and it didn't do anything for me.  Here
is the present content of my CFAPPLICATION tag:  

cfapplication name=mrktPromoTool sessionmanagement=yes
clientmanagement=yes clientStorage = cookie setClientCookies=yes/


I've also had the clientStorage and setClientCookies attributes removes and
that does not help.  I'm using CFMX 6.1 if that's of any use.

Here is the offending line of code:
cfparam name=client.currentMarket default=0

What am I doing wrong?

 
Matthew Small
Web Developer
American City Business Journals
704-973-1045
[EMAIL PROTECTED]
 

-Original Message-
From: Tangorre, Michael [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, December 28, 2004 10:09 AM
To: CF-Talk
Subject: RE: Mach-II  client variables

 From: Matthew Small [mailto:[EMAIL PROTECTED] 
 Before client variables can be used, the client state 
 management system must be enabled using the CFAPPLICATION tag.

You need to set the location for storing the client vars..
http://livedocs.macromedia.com/coldfusion/6.1/htmldocs/tags-pa3.htm#wp10
97308

You need to set the clientStorage attribute in the cfapplication tag.

HTH,

Mike



~|
Special thanks to the CF Community Suite Silver Sponsor - CFDynamics
http://www.cfdynamics.com

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:188855
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: Mach-II client variables

2004-12-28 Thread Dave Watts
 I tried placing the MRU value into both session and client
 variables, and enabling client and session variables in the
 CFApplication tag, but I just got an error.  

As Mike Tangorre mentioned, if you want to use Client variables you will
need to specify where Client variables will be stored. You can either do
this using the CLIENTSTORAGE attribute of the CFAPPLICATION tag, or you can
specify a default storage location within the CF Administrator.

However, I would generally recommend that you not use both Client and
Session variables. Usually, I think you're better off just using one or the
other, depending on the needs of your application. For most relatively
simple applications, Session variables are your best bet. I'm
oversimplifying a bit here, of course. So, what happened when you tried to
use Session variables?

Remember that they also need to be enabled within the CF Administrator and
within your CFAPPLICATION tag using the SESSIONMANAGEMENT attribute.

 Also, the most logical place for me to put an assignment for this
 variable is in a CFC, but I see that Mr. Corfield does not recommend 
 doing this:

 It's not that CFCs cannot access scope variables, just that they
 should not in general (since it breaks encapsulation). The general
 approach is to create a CFC whose sole job is to 'wrap' the scope
 access so as to hide it from the rest of the app.

 ...
 
 So where/how can I create a variable that persists this information?

If you're using the Client scope, I suspect you'll get a little less value
out of the idea of encapsulating access to it within a CFC, since the Client
scope itself isn't stored in memory beyond a single page request, but rather
is refetched for each page request from whatever storage location you
specified. If you're using the Session scope, I would wholeheartedly endorse
Mr. Corfield's recommendation.

Dave Watts, CTO, Fig Leaf Software
http://www.figleaf.com/
phone: 202-797-5496
fax: 202-797-5444


~|
Special thanks to the CF Community Suite Gold Sponsor - CFHosting.net
http://www.cfhosting.net

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:188856
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: Single application - multiple users with differing specificat ions

2004-12-28 Thread Dave Watts
 While department B wants additional features and won't use some of the
 existing, I am assuming that the features they share, and indeed the
 business rules behind them all are common.

In my experience, this is a dangerous and unwarranted assumption. I can
think of many cases where we built applications for one group within a large
organization, in which other groups wanting to use the same application had
radically different business rules and desired features.

Dave Watts, CTO, Fig Leaf Software
http://www.figleaf.com/
phone: 202-797-5496
fax: 202-797-5444


~|
Special thanks to the CF Community Suite Gold Sponsor - CFHosting.net
http://www.cfhosting.net

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:188857
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: Dumb Question About CFPARAM

2004-12-28 Thread Dave Watts
 My question is with CFPARAM - what's up in this case?  Will it work
 fine when all of the parameters all nested in IF statements like this? 
 Will there just be a big long list of BIND variables and will the 
 statement (INSERT or RUN) use the right ones?

 Am I making any sense?

Assuming that you're asking about CFQUERYPARAM, yes, that's a perfectly
sensible question. And the answer is yes, it'll work fine - you'll just end
up with a longer list of bind parameters.

Dave Watts, CTO, Fig Leaf Software
http://www.figleaf.com/
phone: 202-797-5496
fax: 202-797-5444


~|
Special thanks to the CF Community Suite Silver Sponsor - RUWebby
http://www.ruwebby.com

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:188858
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: Form Data Tracking

2004-12-28 Thread Claude Schneegans
Implement a complex DB Relational Structure to store the content and
data.

This should not be that complex: just design a table with
- user ID
- date-time
- name of table modified
- name of column modified
- modified value

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



~|
Special thanks to the CF Community Suite Gold Sponsor - CFHosting.net
http://www.cfhosting.net

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:188859
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: Single application - multiple users with differing specificat ions

2004-12-28 Thread Matthew Small
Your response is the reason I asked the initial question.  Each department
wants to use the same application although with modifications and features
not found in the other.  I haven't done it myself, but I *think* I have
heard of inheriting forms (presentation logic) in .NET programming, and I
thought that there might be a process for CF. 

Thank you,
 
Matthew Small
Web Developer
American City Business Journals
704-973-1045
[EMAIL PROTECTED]
 

-Original Message-
From: Dave Watts [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, December 28, 2004 10:42 AM
To: CF-Talk
Subject: RE: Single application - multiple users with differing specificat
ions

 While department B wants additional features and won't use some of the
 existing, I am assuming that the features they share, and indeed the
 business rules behind them all are common.

In my experience, this is a dangerous and unwarranted assumption. I can
think of many cases where we built applications for one group within a large
organization, in which other groups wanting to use the same application had
radically different business rules and desired features.

Dave Watts, CTO, Fig Leaf Software
http://www.figleaf.com/
phone: 202-797-5496
fax: 202-797-5444




~|
Special thanks to the CF Community Suite Gold Sponsor - CFHosting.net
http://www.cfhosting.net

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:188860
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: Mach-II client variables

2004-12-28 Thread Dave Carabetta
On Tue, 28 Dec 2004 10:14:25 -0500, Matthew Small [EMAIL PROTECTED] wrote:
 Thanks, but I've already tried that and it didn't do anything for me.  Here
 is the present content of my CFAPPLICATION tag:
 
 cfapplication name=mrktPromoTool sessionmanagement=yes
 clientmanagement=yes clientStorage = cookie setClientCookies=yes/
 
 I've also had the clientStorage and setClientCookies attributes removes and
 that does not help.  I'm using CFMX 6.1 if that's of any use.
 
 Here is the offending line of code:
 cfparam name=client.currentMarket default=0
 
 What am I doing wrong?
 

To my knowledge, there's no way of explicitly disabling client
variables (i.e., through a CFMX Administrator setting or some such).
Where is this cfapplication declaration located? Are you sure that you
don't have an Application.cfm that gets executed before this code that
might have another cfapplication directive in it?

Also, I would not use cookies for clientStorage due to security
considerations (the data is stored in clear text on the user's
machine) -- it would be preferable to use your database to store the
client variables. However, that being said, one thing at a time. Have
you checked for any possible conflicting cfapplication directive in an
Application.cfm file that's being executed?

Regards,
Dave.

~|
Special thanks to the CF Community Suite Gold Sponsor - CFHosting.net
http://www.cfhosting.net

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:188861
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: Regex troubles

2004-12-28 Thread Tony Hicks
Thanks much guys! Really appreciated.

Jim, I appreciate the offer and I may take you up on it, I was just
sure there had to be an easier way. No offense.

It just seems that there should be a way to say with the [quote] tags
what you can say with ([^]*)...

Looping sounds alright though..

There is of course easy replace operations but that does nothing to
verify syntax.


On Mon, 27 Dec 2004 22:41:04 -0400, Michael Dinowitz
[EMAIL PROTECTED] wrote:
 If you point me to the code, I'd like to look at what it does and I'll 
 modifiy it for you if you want. The way the original post sounded, it's some 
 sort of wiki/comment manager code. Might be useful for some projects I'm 
 playing with. :)
 
 Mike talked about greedy settings using ? (this was not available when I
 wrote my DP_BBML tag) - that'll fix your immediate problem.
 
 The problem (that Mike also alludes to) is that it's
 rarely that simple and, at the very least, you have to loop to ensure that
 all instances are captured.
 
 It is slower (but as you said, not THAT slow ;^)  ) the way it's done in my
 tag, but the major benefit is that the looping process I use also does basic
 validation and nesting checks.
 
 Someday I'm going to update that tag... but even then I may not change the
 basic engine because I'd lose some robustness.  Still if there's anything in
 my tag that's helpful please feel free to rip it out.  ;^)
 
 Jim Davis
 
 

~|
Special thanks to the CF Community Suite Silver Sponsor - New Atlanta
http://www.newatlanta.com

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:188862
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


My Init() in my CFC...am I on the right track?

2004-12-28 Thread Jeff Small
cfset init()

cffunction name=init access=private output=false returntype=string 
displayname=Initializes my object and creates the datasource variable
cfset variables.DSN = myDataSourceName
cfreturn variables.DSN
/cffunction

I know I could make it so that you have to pass the datasource variable name 
in to the function, but I figured, I can always just change it in one place 
in my CFC, and it's good to go...right?

That should suit my needs, right? If I want a variable that's available to 
all the functions in my CFC...right? Am I thinking the right way? 



~|
Special thanks to the CF Community Suite Silver Sponsor - New Atlanta
http://www.newatlanta.com

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:188863
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: Single application - multiple users with differing specificat ions

2004-12-28 Thread Dave Watts
 I haven't done it myself, but I *think* I have heard of inheriting 
 forms (presentation logic) in .NET programming, and I thought that 
 there might be a process for CF.

I'm pretty sure there are forms reuse mechanisms in Windows Forms, but not
so sure about within ASP.NET. There's nothing really analogous to this built
into CF, since forms themselves aren't objects within CF. However, you could
certainly build components to generate forms, to provide your own
inheritance functionality. I don't know if it would be worth the effort. I
also don't know whether there's any functionality like this within Mach-ii -
I'd probably look there first.

However, the serious question isn't really a purely technical one, but
rather a question of process - making sure that you figure out basic
requirements for all the groups that will use your application in the
future, or alternatively providing so much flexibility that you will be able
to meet their requirements without knowing what they will be! This isn't a
trivial task.

Dave Watts, CTO, Fig Leaf Software
http://www.figleaf.com/
phone: 202-797-5496
fax: 202-797-5444


~|
Special thanks to the CF Community Suite Gold Sponsor - CFHosting.net
http://www.cfhosting.net

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:188864
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: Dumb Question About CFPARAM

2004-12-28 Thread Jim Davis
Yup - of course CFQUERYPARAM is what I meant.  The mind does strange thigs
at three AM.  ;^)

Thanks, all - it does seem to work just fine.  Unfortunately it doesn't
offer as much of a speed boost as I was hoping, but I'll take what I can
get.

Jim Davis



~|
Special thanks to the CF Community Suite Gold Sponsor - CFHosting.net
http://www.cfhosting.net

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:188865
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: My Init() in my CFC...am I on the right track?

2004-12-28 Thread Sean Corfield
On Tue, 28 Dec 2004 11:39:22 -0500, Jeff Small [EMAIL PROTECTED] wrote:
 cfset init()

Be wary of calling functions from the pseudo-constructor - if the CFC
is accessed in any way, including the doc browser, it will execute
this and call the function. In general I recommend *not* calling
init() automatically in the CFC but requiring users of the CFC to call
init() at construction time:

cfset obj = createObject(component,mycfc).init()/

 cffunction name=init access=private output=false returntype=string
 displayname=Initializes my object and creates the datasource variable

Normally, people would expect init() to be public and return an
instance of the CFC itself:

cffunction name=init access=public output=false returntype=mycfc
hint=Initializes my object and created the datasource variable

 cfset variables.DSN = myDataSourceName
 cfreturn variables.DSN

cfreturn this/

 /cffunction
 
 I know I could make it so that you have to pass the datasource variable name
 in to the function, but I figured, I can always just change it in one place
 in my CFC, and it's good to go...right?

Yes, that's a reasonable argument. You could even give init() an
optional argument to allow users to override the DSN without code
changes:

cfargument name=DSN type=string default=myDataSourceName/
cfset variables.DSN = arguments.DSN/

 That should suit my needs, right? If I want a variable that's available to
 all the functions in my CFC...right? Am I thinking the right way?

With the caveats about expectations for the init() function, yes,
you're on the right track.
-- 
Sean A Corfield -- http://www.corfield.org/
Team Fusebox -- http://www.fusebox.org/
Breeze Me! -- http://www.corfield.org/breezeme
Got Gmail? -- I have 6 invites to give away!

If you're not annoying somebody, you're not really alive.
-- Margaret Atwood

~|
Special thanks to the CF Community Suite Gold Sponsor - CFHosting.net
http://www.cfhosting.net

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:188866
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: My Init() in my CFC...am I on the right track?

2004-12-28 Thread Ian Skinner
Well I would say you maybe working a bit too hard.

If that is all you want to do you can just do this.

cfcomponent 
cfset variables.DSN = myDataSourceName

cffunction ...

This sets a variable that can be used by all functions.  Now the limitation of 
this is that you can not pass parameters to this constructor.  But since you 
stated that you did not want to pass parameters that should not be a problem.  
The reason for the defacto standard of an init() method is to be able to pass 
parameters to some kind of constructor like mechanism.  If parameters are not 
needed, I would feel the init() method is not needed.  But I'm sure that is 
debatable.


--
Ian Skinner
Web Programmer
BloodSource
www.BloodSource.org
Sacramento, CA

C code. C code run. Run code run. Please!
- Cynthia Dunning


cfset init()

cffunction name=init access=private output=false returntype=string 
displayname=Initializes my object and creates the datasource variable
cfset variables.DSN = myDataSourceName
cfreturn variables.DSN
/cffunction

I know I could make it so that you have to pass the datasource variable name 
in to the function, but I figured, I can always just change it in one place 
in my CFC, and it's good to go...right?

That should suit my needs, right? If I want a variable that's available to 
all the functions in my CFC...right? Am I thinking the right way?

Confidentiality Notice:  This message including any
attachments is for the sole use of the intended
recipient(s) and may contain confidential and privileged
information. Any unauthorized review, use, disclosure or
distribution is prohibited. If you are not the
intended recipient, please contact the sender and
delete any copies of this message. 



~|
Special thanks to the CF Community Suite Silver Sponsor - CFDynamics
http://www.cfdynamics.com

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:188867
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: My Init() in my CFC...am I on the right track?

2004-12-28 Thread Raymond Camden
A few comments here:

*Typically i make my init function public so I can call it directly.
This lets me do this in code:

cfset mycfc = createObject(component,mycfc).init(arg1, arg2, arg3)

You need to make your method do a cfreturn this for it to work right.

*Your init function didn't have an argument to it. Therefore, it is
kinda pointless. You can replace all of that code with just:

cfset variables.dsn = 

However, your best bet is to make the init function take an argument
so you can customize the DSN on the fly. You can still use the line
above (with a real value instead of three dots of course ;) so that
the CFC has a default DSN at least.

*And yes, if you want a variable to availavble to all methods of a
CFC, use the Variables scope.



On Tue, 28 Dec 2004 11:39:22 -0500, Jeff Small [EMAIL PROTECTED] wrote:
 cfset init()
 
 cffunction name=init access=private output=false returntype=string
 displayname=Initializes my object and creates the datasource variable
 cfset variables.DSN = myDataSourceName
 cfreturn variables.DSN
 /cffunction
 
 I know I could make it so that you have to pass the datasource variable name
 in to the function, but I figured, I can always just change it in one place
 in my CFC, and it's good to go...right?
 
 That should suit my needs, right? If I want a variable that's available to
 all the functions in my CFC...right? Am I thinking the right way?
 
 

~|
Special thanks to the CF Community Suite Silver Sponsor - New Atlanta
http://www.newatlanta.com

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:188868
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: My Init() in my CFC...am I on the right track?

2004-12-28 Thread Jim Davis
 -Original Message-
 From: Jeff Small [mailto:[EMAIL PROTECTED]
 Sent: Tuesday, December 28, 2004 11:39 AM
 To: CF-Talk
 Subject: My Init() in my CFC...am I on the right track?
 
 cfset init()
 
 cffunction name=init access=private output=false
 returntype=string
 displayname=Initializes my object and creates the datasource variable
 cfset variables.DSN = myDataSourceName
 cfreturn variables.DSN
 /cffunction

This should work, but I would definitely accept the name of the datasource
as an argument if it might change.  I don't know what the purpose of this
CFC is, but I can't see any reason that you would want the CFC to be
modified in that case - it should be modified at the point the CFC is
instantiated (I think).

The only other point is that it's common (and I think very good) practice to
return this from the init() method.

This returns the instance of your CFC to the caller, which is most often
what you want to do in the case of initialization.  Something like this:
]
cfset Application.MyDSNCFC = CreateObject(ThatCFC_Up_There).init() /

The CreateObject() function returns the CFC instance, so you can chain the
init() call it to it.  Since the init() call also returns this (the CFC
instance) you can assign it directly to a variable container as is.

I hope I'm making sense, I've just woken up...

Jim Davis




~|
Special thanks to the CF Community Suite Silver Sponsor - RUWebby
http://www.ruwebby.com

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:188869
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: Dumb Question About CFPARAM

2004-12-28 Thread Gaulin, Mark
You might squeak out a bit of performance by making a stored procedure out of 
it and using an optimistic update strategy... Just do the update and if the 
record count is zero then do an insert.  This will completely remove the select.

(I guess you don't need a sp for this.)

Mark

-Original Message-
From: Jim Davis [mailto:[EMAIL PROTECTED]
Sent: Tuesday, December 28, 2004 11:46 AM
To: CF-Talk
Subject: RE: Dumb Question About CFPARAM


Yup - of course CFQUERYPARAM is what I meant.  The mind does strange thigs
at three AM.  ;^)

Thanks, all - it does seem to work just fine.  Unfortunately it doesn't
offer as much of a speed boost as I was hoping, but I'll take what I can
get.

Jim Davis





~|
Special thanks to the CF Community Suite Silver Sponsor - CFDynamics
http://www.cfdynamics.com

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:188870
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: Regex troubles

2004-12-28 Thread Jim Davis
 -Original Message-
 From: Tony Hicks [mailto:[EMAIL PROTECTED]
 Sent: Tuesday, December 28, 2004 11:31 AM
 To: CF-Talk
 Subject: Re: Regex troubles
 
 Thanks much guys! Really appreciated.
 
 Jim, I appreciate the offer and I may take you up on it, I was just
 sure there had to be an easier way. No offense.

None take at all - I'd bet my eye teeth that there MUST be some faster
(although maybe not easier) way to do most of that.  My code was written
nearly three years ago for a version of CF that was then two years out of
date.

There are probably hundreds of places it could be spruced up in MX.  ;^)

Jim Davis



~|
Special thanks to the CF Community Suite Silver Sponsor - CFDynamics
http://www.cfdynamics.com

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:188871
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: single quotes insert sql server

2004-12-28 Thread Tony Weeg
charlie, jochem, mike, and joe

i upgraded the server to 6.1 patch, and all is well.

musta been something with 6.1 less the patch.

thanks for your help!

tw


On Sat, 18 Dec 2004 20:49:42 -0500, Tony Weeg [EMAIL PROTECTED] wrote:
 gotcha  thanks for the help, im going to get into the code again
 tomorow, as ive been wholly engulfed in football today :)
 
 tw
 
 On Sat, 18 Dec 2004 15:55:34 -0700, Charlie Griefer
 [EMAIL PROTECTED] wrote:
  granted, i'm grasping...i just recall pre-updated versions having
  issues with single quotes and cfqueryparam...
 
 
  On Sat, 18 Dec 2004 14:17:56 -0500, Tony Weeg [EMAIL PROTECTED] wrote:
   not sure, at the moment, i can dig around later, and find that out,
   but would a version matter with something simple?
  
   tw
  
   On Sat, 18 Dec 2004 09:20:36 -0700, Charlie Griefer
   [EMAIL PROTECTED] wrote:
Tony -
   
you said this exact code works fine on another machine?  Are they both
on MX 6.1?
   
   
On Sat, 18 Dec 2004 10:39:49 -0500, Tony Weeg [EMAIL PROTECTED] wrote:
 joe, charlie, and everyone else here is the code...

 cfquery name=insertClient username=#application.username#
 password=#application.password# datasource=webCollect
 insert into clients
 (company, contact)
values
 (cfqueryparam  cfsqltype=CF_SQL_VARCHAR 
 value=#form.company#,
  cfqueryparam  cfsqltype=CF_SQL_VARCHAR 
 value=#form.contact#
 )
 /cfquery

 and here is the error...

 [Macromedia][SequeLink JDBC Driver][ODBC Socket][Microsoft][ODBC SQL
 Server Driver][SQL Server]Line 21: Incorrect syntax near
 apos;,apos;.

 -- perplexed as shit, on a saturday mo'nin

 tw


 On Fri, 17 Dec 2004 23:44:27 -0500, Joe Rinehart [EMAIL PROTECTED] 
 wrote:
  As Jochem saidcan you paste the exact code, and the SQL shown 
  for
  the query in the CF debugging info?
 
  -joe
 
  --
  For Tabs, Trees, and more, use the jComponents:
  http://clearsoftware.net/client/jComponents.cfm
 
 


   
   
  
  
 
  

~|
Special thanks to the CF Community Suite Silver Sponsor - CFDynamics
http://www.cfdynamics.com

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:188872
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: My Init() in my CFC...am I on the right track?

2004-12-28 Thread Dave Carabetta
On Tue, 28 Dec 2004 11:39:22 -0500, Jeff Small [EMAIL PROTECTED] wrote:
 cfset init()
 
 cffunction name=init access=private output=false returntype=string
 displayname=Initializes my object and creates the datasource variable
 cfset variables.DSN = myDataSourceName
 cfreturn variables.DSN
 /cffunction
 
 I know I could make it so that you have to pass the datasource variable name
 in to the function, but I figured, I can always just change it in one place
 in my CFC, and it's good to go...right?
 
 That should suit my needs, right? If I want a variable that's available to
 all the functions in my CFC...right? Am I thinking the right way?
 

Not quite.

1) The access type on an init() function should be public, or you'll
get an error saying the method doesn't exist when you invoke it in
your calling code..
2) If you really want to make the value of variables.DSN public (to
pass back to calling code), make the cfreturn its own getDSN method,
as shown below.
3) Is the cfset init() in the CFC itself? If so, it should not be.
It should be in your calling code.
4) You should be using the hint attribute rather than the
displayname attribute for your description.
5) One practice that has become a best practice of sorts is to
return this from your init method so that you can method chain, as
shown below. Granted, not everybody follows this practice, as it's
more personal preference, but it's just what I'm used to now.
6) Another practice that I use, but I know many don't, is to place my
CFC instance variables into a instance structure so that they're
neatly stored (i.e., variables.instance.DSN instead of just
variables.DSN).

It should be noted that you'll get slight variations from people based
on their preferences, but the code below generally covers best
practices that I've seen. Here's the cleaned up CFC and the calling
code is below it:

cfcomponent output=false
cffunction name=init access=public output=false returntype=CFCName
hint=Initializes my object and creates the datasource variable
cfset setDSN(dsName:myDataSourceName)
cfreturn this
/cffunction

cffunction name=getDSN access=public output=false returntype=string
hint=Returns the name of the datasource
cfset variables.DSN = myDataSourceName
cfreturn this
/cffunction

cffunction name=setDSN access=private output=false returntype=void
hint=Sets the name of the datasource
cfargument name=dsName type=string required=true hint=The
datasource name to set
cfset variables.DSN = arguments.dsName
/cffunction
/cfcomponent

Calling code:

cfset variables.objMyCFC = createObject(component, path.to.my.CFC).init()
cfset variables.myDSN = variables.objMyCFC.getDSN()

Here's a link to a community-driven document of best practices for
further reference:
http://www.dintenfass.com/cfcbestpractices/

Hope this helps?

Regards,
Dave.

~|
Special thanks to the CF Community Suite Gold Sponsor - CFHosting.net
http://www.cfhosting.net

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:188873
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: My Init() in my CFC...am I on the right track?

2004-12-28 Thread Jeff Small
 Be wary of calling functions from the pseudo-constructor - if the CFC
 is accessed in any way, including the doc browser, it will execute
 this and call the function. In general I recommend *not* calling
 init() automatically in the CFC but requiring users of the CFC to call
 init() at construction time:

 cfset obj = createObject(component,mycfc).init()/

Okay, this makes sense. I'm reading about 4 different sources for how to 
build CFCs correctly (this is the first site where we get to program from 
the ground floor up and not add on to an existing website, so I'm excited 
to try and do what I would like to see as a CFC best practice where I'm 
setting things up the most correct way possible.

I see what you, Ian, and Raymond were saying about how I don't even really 
need that init function, and I was struggling with that as well, but when I 
consider allowing it to take an optional paramter (DSN) it starts to make 
much more sense.

So in my code where I'm using my CFC, I'm using CFOBJECT like so:
cfobject name=myObject component=mySite.myComponent

So how would I use that init function using the cfobject tag? Or should I 
just not use that and use CreateObject() instead?

 cffunction name=init access=private output=false 
 returntype=string
 displayname=Initializes my object and creates the datasource variable

 Normally, people would expect init() to be public and return an
 instance of the CFC itself:

This part somewhat confuses me, but again, I'm using CFOBJECT and not 
CreateObject so I'm not really setting anything equal to anything. I'm 
just creating an object on the page, then manipulating it via its methods 
further on down the page...for example, after my CFOBJECT, the very next 
line is:

cfset qGetNews = myObject.GetNews()
cfset qGetEvents = myObject.GetEvents(5)

So I'm thinking that I've instantiated an object with the CFOBJECT call, why 
would my init() function return the object (I mean, it makes total sense, 
I'm just wondering how it works, which is what I think I'm fuzzy on).

 Yes, that's a reasonable argument. You could even give init() an
 optional argument to allow users to override the DSN without code
 changes:

 cfargument name=DSN type=string default=myDataSourceName/
 cfset variables.DSN = arguments.DSN/

Okay, this is definitely the first *immediate* change I'm making. 



~|
Special thanks to the CF Community Suite Silver Sponsor - RUWebby
http://www.ruwebby.com

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:188874
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: My Init() in my CFC...am I on the right track?

2004-12-28 Thread Jeff Small
 Not quite.

 1) The access type on an init() function should be public, or you'll
 get an error saying the method doesn't exist when you invoke it in
 your calling code..

Makes *total* sense...

 2) If you really want to make the value of variables.DSN public (to
 pass back to calling code), make the cfreturn its own getDSN method,
 as shown below.
 3) Is the cfset init() in the CFC itself? If so, it should not be.
 It should be in your calling code.

I think Sean explained this pretty well, I see that now.

 4) You should be using the hint attribute rather than the
 displayname attribute for your description.

Okay, I've been using them both actually. I've been trying to make sure I 
use both, and I've been trying to go back thru my code every so often and 
make sure I'm using all the appropriate attributes.

 5) One practice that has become a best practice of sorts is to
 return this from your init method so that you can method chain, as
 shown below. Granted, not everybody follows this practice, as it's
 more personal preference, but it's just what I'm used to now.

I'm struggling with this. I don't understand even from Seans's post what 
purpose it serves to return this when you're using something like CFOBJECT 
or CreateObject() which creates an instance of an object anyway...

 6) Another practice that I use, but I know many don't, is to place my
 CFC instance variables into a instance structure so that they're
 neatly stored (i.e., variables.instance.DSN instead of just
 variables.DSN).

Hey, now that's pretty cool.

 It should be noted that you'll get slight variations from people based
 on their preferences, but the code below generally covers best
 practices that I've seen. Here's the cleaned up CFC and the calling
 code is below it:

 cfcomponent output=false
 cffunction name=init access=public output=false 
 returntype=CFCName
 hint=Initializes my object and creates the datasource variable
cfset setDSN(dsName:myDataSourceName)
cfreturn this
 /cffunction

 cffunction name=getDSN access=public output=false 
 returntype=string
 hint=Returns the name of the datasource
cfset variables.DSN = myDataSourceName
cfreturn this
 /cffunction

 cffunction name=setDSN access=private output=false 
 returntype=void
 hint=Sets the name of the datasource
cfargument name=dsName type=string required=true hint=The
 datasource name to set
cfset variables.DSN = arguments.dsName
 /cffunction
 /cfcomponent

 Calling code:

 cfset variables.objMyCFC = createObject(component, 
 path.to.my.CFC).init()
 cfset variables.myDSN = variables.objMyCFC.getDSN()

Keanuwhoa/Keanu

I think I need to print that out and go thru it slowly. Is your calling code 
in your page? Why do you use your getDSN function after you've already 
created an object and initialized it? If possible...could you please just 
sort of briefly explain the three functions? You're using some weird syntax 
in your init (dsName:myDataSourceName) that I don't 
kinda...well...get...

 Here's a link to a community-driven document of best practices for
 further reference:
 http://www.dintenfass.com/cfcbestpractices/

 Hope this helps?

Big Time, thanks so much! 



~|
Special thanks to the CF Community Suite Silver Sponsor - RUWebby
http://www.ruwebby.com

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:188875
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: My Init() in my CFC...am I on the right track?

2004-12-28 Thread Jeff Small
A few comments here:

 *Typically i make my init function public so I can call it directly.
 This lets me do this in code:

 cfset mycfc = createObject(component,mycfc).init(arg1, arg2, arg3)

 You need to make your method do a cfreturn this for it to work right.

 *Your init function didn't have an argument to it. Therefore, it is
 kinda pointless. You can replace all of that code with just:

 cfset variables.dsn = 

This makes sense now too, after seeing Sean and Dave's replies...I see what 
they're (and you) are talking about.

 However, your best bet is to make the init function take an argument
 so you can customize the DSN on the fly. You can still use the line
 above (with a real value instead of three dots of course ;) so that
 the CFC has a default DSN at least.

cfargument required=no?

 *And yes, if you want a variable to availavble to all methods of a
 CFC, use the Variables scope.

Cool. I did *something* right... 



~|
Special thanks to the CF Community Suite Silver Sponsor - New Atlanta
http://www.newatlanta.com

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:188877
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


Strange Data Submission Results

2004-12-28 Thread Claremont, Timothy
I have a form with about 40 fields in it.

My submission page has a CFINSERT statement as follows:

cfinsert datasource=QualityCompliance
tablename=tblQualityCompliance

What is happening is that when I submit the form, SOME of the fields get
populated in the database, but not all of them.

If I immediately REFRESH the submission page, thereby submitting the
same data again, SOME of the fields get populated in the database, but
they are DIFFERENT fields than the original submission Again, this
is just a refresh of the original submission page, so I would expect
some consistency, even if it does not submit all of the fields due to a
programming error on my part!

Access2002, CF6.1

Any clues???

TIA,
Tim
**
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please delete it from 
your system.

This footnote also confirms that this email message has been swept for
the presence of computer viruses.

Thank You,
Viahealth
**


~|
Special thanks to the CF Community Suite Silver Sponsor - CFDynamics
http://www.cfdynamics.com

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:188876
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: My Init() in my CFC...am I on the right track?

2004-12-28 Thread Jeff Small
 Be wary of calling functions from the pseudo-constructor - if the CFC
 is accessed in any way, including the doc browser, it will execute
 this and call the function. In general I recommend *not* calling
 init() automatically in the CFC but requiring users of the CFC to call
 init() at construction time:

Oh yeah...so this reminds me...

If you place the init() function in your CFC, and its job is to, let's say, 
create a datasource variable to use thruout the CFC (available only to the 
internal CFC methods) and you DON'T chain it when you create an object, 
you're hosed, right? If you go to the trouble of creating an init() function 
like that, is it then basically the idea that it's the coder's 
responsibility to make sure that the init() function is chained onto the 
end of any object creation? So if I get hit by a bus, and my replacement 
comes in to code after me, he (or she) would have to make sure they called 
that init() function anytime they were instantiating an object from my 
CFC...no? 



~|
Special thanks to the CF Community Suite Gold Sponsor - CFHosting.net
http://www.cfhosting.net

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:188878
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: Slow (sorta) site issues - Ideas?

2004-12-28 Thread Cameron Childress
Whatever you plan to do, I would definitely give CrystalTech a heads
up about your expected traffic spike.  They might be able to give you
a good suggestion, and if they can't, at least they won't be caught
blindsided and just unplug you or something unpleasant.  Hosts tend to
get cranky when the other 50 sites hosted on your server all call at
once to yell at them because you didn't warn them about your expected
load increase.

-Cameron


On Mon, 27 Dec 2004 15:18:25 -0400, Jim Davis
[EMAIL PROTECTED] wrote:
 I've a site that while not slow, is most likely not going to take the traffic 
 it's facing.  The site is www.firstnight.org - it will get absolutely pounded 
 on New Year's Eve.
 
 Since this will be the warnest New Year's Eve in recent memory AND is a 
 weekend AND is a holiday for nearly everybody now I fully expect this to be 
 one of the busiest years ever.
 
 Unfortunately we're still a non-profit.  We can't afford the kind of iron 
 that this kind of traffic would require for only one or two days a year. 
 Right now we're on a shared hosting plan at CrystalTech which we nearly 
 overran last year.
 
 I'm just going through and looking for savings here.
 
 1) An average page runs anywhere from 80-300 ticks.  I plan to address some 
 of that by caching the navigation HTML (right now it's dynamically generated 
 from a cached CFC).
 
 What do you think?  Too high?  Way too high?  Way, way too high?
 
 Many of the pages are quite large and complex (for example the All Events 
 list here:  
 http://www.firstnight.org/Content/NewYears/Artists/Explore/Events.cfm?Type=All
  ) but it's exactly those pages that are the most popular.
 
 As an aside, you can see the current number of active sessions and the 
 current page's tick count at the bottom of any page.
 
 2) My session manager is worrying me.  The site doesn't use CFs built in 
 Session management.  This allows me to capture user information at the end of 
 a session, but means that I have to manually check and destroy sessions.  
 When a session ends it's saved in a database along with the pages viewed 
 during the visit, information about the user agent and several other things.
 
 This process requires several database calls (perhaps a minimum of 8, but a 
 maximum determined by the number of pages visited) and averages in the range 
 of 40-80 ticks per session cleaned.
 
 That would be fine, except I may be cleaning several thousand sessions at a 
 shot on the 31st.  The system is SQL Server and I've optimized it about as 
 much as I know how (there are indexes on the major columns, I've cleaned out 
 all unneeded data, etc).
 
 Any thoughts on using multiple CFQuery statements vrs one more complex SQL 
 call?  Right now, for example, I make a call to the DB to see if the session 
 already exists, if it does I do an update, if not I do an insert.
 
 Could it actually be faster to do an IF statement in the SQL using only one 
 CFQUERY tag?  It seems to me that with maintain connections on this 
 wouldn't make a difference... but I'm not sure (and want to use the time I've 
 left wisely).
 
 I am using CFQUERYPARAM and caching what queries make sense.
 
 Some other thoughts:
 
 I've actually considered placing some of the site on another CrystalTech 
 account (on a different server of course) and using redirects to move the 
 traffic off.  Of course there's no way I could get the URLs to stay the same 
 (outside of frames) and I wouldn't want it there all the time - just for a 
 day or two.
 
 It would also royally screw up my log statistics.
 
 Any other ideas for kludgy, cheap load balancing?
 
 I can easily turn off the end-of-session handlers.  I know that this process 
 will take a while, but I'm not sure if it's really the performance hog that I 
 fear.  It is, after all, spending nearly all of it's time waiting for the 
 database - sitting effectly idle.  So what if the clean up process takes two 
 minutes if the thread isn't dominating the CPU?  (I will also decrease the 
 number of clean-ups to one every 15 minutes or so in an attempt to clear out 
 old sessions as quickly as possible.)
 
 Many (sometimes VERY many) of the sessions in memory are generated from bots. 
  I'm considering creating a ROBOTS.TXT that would prevent bots from indexing 
 the site for our busy time, but I fear that would inhibit them more than I 
 want - if you tell robot's to bugger off do they come back?
 
 I'm open to any other ideas.  My gut says that with the resources we have 
 we'll just have to live with overloads unless they want to create a much 
 simpler site (and they don't want to do that).
 
 Anybody got some heavy iron and bandwidth they're willing to donate for three 
 days a year.  ;^)
 
 Sorry for the babbling - I'm entering my normal end-of-year paranoid phase.
 
 Jim Davis
 
 

~|
Special thanks to the CF Community Suite Silver Sponsor - RUWebby
http://www.ruwebby.com


Re: My Init() in my CFC...am I on the right track?

2004-12-28 Thread Jochem van Dieten
Jeff Small wrote:
 
 5) One practice that has become a best practice of sorts is to
 return this from your init method so that you can method chain, as
 shown below. Granted, not everybody follows this practice, as it's
 more personal preference, but it's just what I'm used to now.
 
 I'm struggling with this. I don't understand even from Seans's post what 
 purpose it serves to return this when you're using something like CFOBJECT 
 or CreateObject() which creates an instance of an object anyway...

Because that works with cfobject and createobject(), but not with 
cfinvoke. (read on)


 cffunction name=setDSN access=private output=false returntype=void 
 hint=Sets the name of the datasource
cfargument name=dsName type=string required=true hint=The 
 datasource name to set
cfset variables.DSN = arguments.dsName
 /cffunction

If you have your setters return this too, you can chain them 
together:

cfset variables.myCFC.setDSN(dsn).setMode(READONLY)

Jochem

~|
Special thanks to the CF Community Suite Gold Sponsor - CFHosting.net
http://www.cfhosting.net

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:10
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: My Init() in my CFC...am I on the right track?

2004-12-28 Thread Jim Davis
 -Original Message-
 From: Jeff Small [mailto:[EMAIL PROTECTED]
 Sent: Tuesday, December 28, 2004 12:18 PM
 To: CF-Talk
 Subject: Re: My Init() in my CFC...am I on the right track?
 
 
 I'm struggling with this. I don't understand even from Seans's post what
 purpose it serves to return this when you're using something like
 CFOBJECT
 or CreateObject() which creates an instance of an object anyway...

It helps me (but isn't completely correct) to think of the createObject()
call as a blank CFC.  The init() call populates it to make it useful.

A metaphor might be a bunch of blank paper - all different sizes and shapes.
You first choose one (deciding that piece has the properties you need), then
your write your note on it (deciding what, specifically that appropriate
piece will do).

Assume a Recipe CFC.  The CFC instance begins as a blank index card.  Your
init() adds (via arguments, a database call or whatever) three properties:
Name, Ingredients and Directions.

In pseudo code it might look like:

cfset MyRecipe = CreateObject(Get One Blank 4x5 Index Card).init(Write
Recipe for Ice Cubes on Index Card) /

cfoutput
h1#MyRecipe.getName()#/h1
p#MyRecipe.getIngrediants()#/p
p#MyRecipe.getDirections()#/p
/cfoutput

(The above brought to you by the Coalition to Prevent the Proliferation of
Automobile Metaphors in Technical Discussion.)

Jim Davis



~|
Special thanks to the CF Community Suite Gold Sponsor - CFHosting.net
http://www.cfhosting.net

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:11
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: Dumb Question About CFPARAM

2004-12-28 Thread Jim Davis
 -Original Message-
 From: Gaulin, Mark [mailto:[EMAIL PROTECTED]
 Sent: Tuesday, December 28, 2004 11:54 AM
 To: CF-Talk
 Subject: RE: Dumb Question About CFPARAM
 
 You might squeak out a bit of performance by making a stored procedure out
 of it and using an optimistic update strategy... Just do the update and
 if the record count is zero then do an insert.  This will completely
 remove the select.
 (I guess you don't need a sp for this.)

I've toyed wit the idea for a while... but probably won't do it this time.

The queries involved are just so completely simple (selects against primary
keys, then updates or inserts) that I just can't see much (if any) of a
boost to be gained there.  There just doesn't seem to be much bang for the
buck.

Changing the calls as I did (using single statements instead of multiple
CFQUERY tags) seems to have helped slightly (perhaps a 5-10% performance
gain).

It's not a silver bullet, but I'll take it.  ;^)

Jim Davis



~|
Special thanks to the CF Community Suite Gold Sponsor - CFHosting.net
http://www.cfhosting.net

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:12
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: Slow (sorta) site issues - Ideas?

2004-12-28 Thread Jim Davis
 -Original Message-
 From: Cameron Childress [mailto:[EMAIL PROTECTED]
 Sent: Tuesday, December 28, 2004 12:29 PM
 To: CF-Talk
 Subject: Re: Slow (sorta) site issues - Ideas?
 
 Whatever you plan to do, I would definitely give CrystalTech a heads
 up about your expected traffic spike.  They might be able to give you
 a good suggestion, and if they can't, at least they won't be caught
 blindsided and just unplug you or something unpleasant.  Hosts tend to
 get cranky when the other 50 sites hosted on your server all call at
 once to yell at them because you didn't warn them about your expected
 load increase.

Already done.  We've been with CrystalTech for three (or maybe four...)
years now, this is becoming old hat.  ;^)

The main problem is that I never seem to get the same folks twice - so every
year it's the same explanations and assurances that the traffic won't spike
for more than three hours.

Jim Davis



~|
Special thanks to the CF Community Suite Silver Sponsor - RUWebby
http://www.ruwebby.com

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:13
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: Slow (sorta) site issues - Ideas?

2004-12-28 Thread Jim Davis
 -Original Message-
 From: Jim McAtee [mailto:[EMAIL PROTECTED]
 Sent: Tuesday, December 28, 2004 4:18 AM
 To: CF-Talk
 Subject: Re: Slow (sorta) site issues - Ideas?
 
 In a shared environment you have to ask yourself to what degree optimizing
 the performance of your site's code is ultimately going to improve your
 web site's performance.  Even if you were to increase performance 10-fold
 it's unlikely you'll see anywhere near that performance gain if there are
 200 other web sites on the same server.  It will of course depend on what
 those other sites are doing when yours is busy, but you have so little
 control over this that all you can do is cross your fingers.  If you knew
 that your site was going to use a significant percentage of the server's
 resources then it may be worth the effort.  If you don't know this then
 it's just a crap-shoot.

Too true - believe me, I understand this (this is the ninth year I've done
this site and we've had similar problems every year).

In this case our application, just on that one day, uses up to and over 95%
of the available resources.  Our host annually threatens to shut us down to
protect the integrity of the other applications on the box and we annually
start slowly down just in the nick of time.

For example, last year we did just under 775,000 page views (not hits) for
the month of December.  But a third of those views were on the 31st (and 20%
of them were on the 30th and 11% on the 29th - it's quite a steep, but
regular, curve).  A full quarter of the traffic for the 31st came in between
10am and noon.

It's around 11:15 every year that we get a call from the host.  ;^)

Of course these aren't insanely large numbers but in general they're pretty
high.  But for a shared hosting account they're quite high.

My worry this year is that 1) New Year's Eve is on a Friday, 2) It's now a
holiday for nearly everybody and 3) it's predicted to be the warmest New
Year's Eve in many years.

I worry that we're going to do significantly more traffic this year.

Jim Davis



~|
Special thanks to the CF Community Suite Silver Sponsor - RUWebby
http://www.ruwebby.com

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:14
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: Dumb Question About CFPARAM

2004-12-28 Thread Gaulin, Mark
Do you use the SQL Profiler to monitor your sql server? (This is not the stuff 
in Query Analyzer... it's a standa-alone app that shows all queries 
(filterable) as they are executed.)  I have found it to be extremely useful in 
finding both slow and also often-used queries... some of the quick ones are run 
so frequently that even saving a page fetch or two with each one feels worth 
it.  SQL Profiler can be fun to get configured just right, but it's very 
powerful.

-Original Message-
From: Jim Davis [mailto:[EMAIL PROTECTED]
Sent: Tuesday, December 28, 2004 12:48 PM
To: CF-Talk
Subject: RE: Dumb Question About CFPARAM


 -Original Message-
 From: Gaulin, Mark [mailto:[EMAIL PROTECTED]
 Sent: Tuesday, December 28, 2004 11:54 AM
 To: CF-Talk
 Subject: RE: Dumb Question About CFPARAM
 
 You might squeak out a bit of performance by making a stored procedure out
 of it and using an optimistic update strategy... Just do the update and
 if the record count is zero then do an insert.  This will completely
 remove the select.
 (I guess you don't need a sp for this.)

I've toyed wit the idea for a while... but probably won't do it this time.

The queries involved are just so completely simple (selects against primary
keys, then updates or inserts) that I just can't see much (if any) of a
boost to be gained there.  There just doesn't seem to be much bang for the
buck.

Changing the calls as I did (using single statements instead of multiple
CFQUERY tags) seems to have helped slightly (perhaps a 5-10% performance
gain).

It's not a silver bullet, but I'll take it.  ;^)

Jim Davis





~|
Special thanks to the CF Community Suite Gold Sponsor - CFHosting.net
http://www.cfhosting.net

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:15
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: Slow (sorta) site issues - Ideas?

2004-12-28 Thread Jochem van Dieten
Jim Davis wrote:
 
 I've actually considered placing some of the site on another CrystalTech 
 account (on a different server of course) and using redirects to move the 
 traffic off.  Of course there's no way I could get the URLs to stay the same 
 (outside of frames) and I wouldn't want it there all the time - just for a 
 day or two.

It is rather common to do that for images and static content.


You can do much better on the caching of your static content. You 
have zero cache headers even on your images.
Of course, to do this efficiently you would have to do this on 
the webserver and in a shared hosting environment this might be 
difficult. You might be able to convince them to create some 
virtual dirs that add cache headers and have the content expire 
on Jan 1, but I doubt they would fall for that.

Jochem

~|
Special thanks to the CF Community Suite Silver Sponsor - RUWebby
http://www.ruwebby.com

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:16
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: Form Data Tracking

2004-12-28 Thread Matt Robertson
If you just want to *see* the data and don't want to be able to
extract it back out again you can use a more obtuse approach and store
the submitted form data in a long text field, via cfdump if your needs
(and data qty)(are very simple and via a loop and table row construct
if more complex.  You'll need a table that tracks the User's ID number
as a separate field, as well as a date and time of mod.

I usually log the entire submitted form scope minus a few key things
like submitted passwords, the fieldnames field, the submit button name
or anything else I don't want stored in the clear in a db (uh... like 
a cc number).  You can fancy this up by encrypting data as well.




On Tue, 28 Dec 2004 10:37:18 -0500, Claude Schneegans
[EMAIL PROTECTED] wrote:
 Implement a complex DB Relational Structure to store the content and
 data.
 
 This should not be that complex: just design a table with
 - user ID
 - date-time
 - name of table modified
 - name of column modified
 - modified value
 
 --
 ___
 REUSE CODE! Use custom tags;
 See http://www.contentbox.com/claude/customtags/tagstore.cfm
 (Please send any spam to this address: [EMAIL PROTECTED])
 Thanks.
 
 
 

~|
Special thanks to the CF Community Suite Gold Sponsor - CFHosting.net
http://www.cfhosting.net

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:17
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: Dumb Question About CFPARAM

2004-12-28 Thread Jim Davis
 -Original Message-
 From: Gaulin, Mark [mailto:[EMAIL PROTECTED]
 Sent: Tuesday, December 28, 2004 1:05 PM
 To: CF-Talk
 Subject: RE: Dumb Question About CFPARAM
 
 Do you use the SQL Profiler to monitor your sql server? (This is not the
 stuff in Query Analyzer... it's a standa-alone app that shows all queries
 (filterable) as they are executed.)  I have found it to be extremely
 useful in finding both slow and also often-used queries... some of the
 quick ones are run so frequently that even saving a page fetch or two with
 each one feels worth it.  SQL Profiler can be fun to get configured just
 right, but it's very powerful.

Yes - of course in my case (shared hosting) I can only use it on the
development server, not production (gawd how I'd love to run a trace on
production!) due to permission issues.  ;^)

This is exactly the reason that I spent yesterday combining several simpler
CFQUERIES into single (but slightly more complex) Transact SQL Statements.
We save just the time in transit, but still that improved those processes by
about 5-10%.

For example I had (in several places in the Session Manager) something like:

Query to see if a key exists, if no rows do an insert, if rows do an update.

I replaced those with Transact SQL EXISTS based IF statements.  Just to
trim as much network latency as I could from the beast.

It wasn't a silver bullet, but I'm confidence that the application is
generally just about as optimized as its going to get... but every little
bit helps.

Jim Davis



~|
Special thanks to the CF Community Suite Gold Sponsor - CFHosting.net
http://www.cfhosting.net

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:18
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: Slow (sorta) site issues - Ideas?

2004-12-28 Thread Jim Davis
 -Original Message-
 From: Jochem van Dieten [mailto:[EMAIL PROTECTED]
 Sent: Tuesday, December 28, 2004 1:20 PM
 To: CF-Talk
 Subject: Re: Slow (sorta) site issues - Ideas?
 
 You can do much better on the caching of your static content. You
 have zero cache headers even on your images.
 Of course, to do this efficiently you would have to do this on
 the webserver and in a shared hosting environment this might be
 difficult. You might be able to convince them to create some
 virtual dirs that add cache headers and have the content expire
 on Jan 1, but I doubt they would fall for that.

Exactly as you noted - we really don't have access to the server to make
such changes.  For our $26 a month account the host has been really great,
but aren't about to add any more work for themselves.  ;^)

There are definitely places that I've failed to cache efficiently as well.
This year (well... like every year) the client wanted some major updates to
the site that turned into major updates (like that damn JavaScript
navigation which I hate) and we ran out of time.

Honestly I'm focusing now much more on the framework-level files than those
things specific to the site itself.  I'm trying to get the portable code as
optimized as possible before the one-off code.

Jim Davis



~|
Special thanks to the CF Community Suite Silver Sponsor - New Atlanta
http://www.newatlanta.com

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:19
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: Slow (sorta) site issues - Ideas?

2004-12-28 Thread Spike
Have you thought about using a web cache system like Coral?

http://www.scs.cs.nyu.edu/coral/

If you set the no-cache http header to true it caches pages for 5 
minutes before requesting a new copy. With a bit of experimentation it 
should be possible to track the user agent their bot uses and set the 
no-cache header only for that.

You'd probably have to do a bit of testing to make sure searches hit 
your site directly rather than the coral cache, but it might be worth a try.

Spike


Jim Davis wrote:
 I've a site that while not slow, is most likely not going to take the traffic 
 it's facing.  The site is www.firstnight.org - it will get absolutely pounded 
 on New Year's Eve.
 
 Since this will be the warnest New Year's Eve in recent memory AND is a 
 weekend AND is a holiday for nearly everybody now I fully expect this to be 
 one of the busiest years ever.
 
 Unfortunately we're still a non-profit.  We can't afford the kind of iron 
 that this kind of traffic would require for only one or two days a year. 
 Right now we're on a shared hosting plan at CrystalTech which we nearly 
 overran last year.
 
 I'm just going through and looking for savings here.
 
 1) An average page runs anywhere from 80-300 ticks.  I plan to address some 
 of that by caching the navigation HTML (right now it's dynamically generated 
 from a cached CFC).
 
 What do you think?  Too high?  Way too high?  Way, way too high?
 
 Many of the pages are quite large and complex (for example the All Events 
 list here:  
 http://www.firstnight.org/Content/NewYears/Artists/Explore/Events.cfm?Type=All
  ) but it's exactly those pages that are the most popular.
 
 As an aside, you can see the current number of active sessions and the 
 current page's tick count at the bottom of any page.
 
 2) My session manager is worrying me.  The site doesn't use CFs built in 
 Session management.  This allows me to capture user information at the end of 
 a session, but means that I have to manually check and destroy sessions.  
 When a session ends it's saved in a database along with the pages viewed 
 during the visit, information about the user agent and several other things.
 
 This process requires several database calls (perhaps a minimum of 8, but a 
 maximum determined by the number of pages visited) and averages in the range 
 of 40-80 ticks per session cleaned.
 
 That would be fine, except I may be cleaning several thousand sessions at a 
 shot on the 31st.  The system is SQL Server and I've optimized it about as 
 much as I know how (there are indexes on the major columns, I've cleaned out 
 all unneeded data, etc).
 
 Any thoughts on using multiple CFQuery statements vrs one more complex SQL 
 call?  Right now, for example, I make a call to the DB to see if the session 
 already exists, if it does I do an update, if not I do an insert.
 
 Could it actually be faster to do an IF statement in the SQL using only one 
 CFQUERY tag?  It seems to me that with maintain connections on this 
 wouldn't make a difference... but I'm not sure (and want to use the time I've 
 left wisely).
 
 I am using CFQUERYPARAM and caching what queries make sense.
 
 
 Some other thoughts:
 
 I've actually considered placing some of the site on another CrystalTech 
 account (on a different server of course) and using redirects to move the 
 traffic off.  Of course there's no way I could get the URLs to stay the same 
 (outside of frames) and I wouldn't want it there all the time - just for a 
 day or two.
 
 It would also royally screw up my log statistics.
 
 Any other ideas for kludgy, cheap load balancing?
 
 I can easily turn off the end-of-session handlers.  I know that this process 
 will take a while, but I'm not sure if it's really the performance hog that I 
 fear.  It is, after all, spending nearly all of it's time waiting for the 
 database - sitting effectly idle.  So what if the clean up process takes two 
 minutes if the thread isn't dominating the CPU?  (I will also decrease the 
 number of clean-ups to one every 15 minutes or so in an attempt to clear out 
 old sessions as quickly as possible.)
 
 Many (sometimes VERY many) of the sessions in memory are generated from bots. 
  I'm considering creating a ROBOTS.TXT that would prevent bots from indexing 
 the site for our busy time, but I fear that would inhibit them more than I 
 want - if you tell robot's to bugger off do they come back?
 
 I'm open to any other ideas.  My gut says that with the resources we have 
 we'll just have to live with overloads unless they want to create a much 
 simpler site (and they don't want to do that).
 
 Anybody got some heavy iron and bandwidth they're willing to donate for three 
 days a year.  ;^)
 
 Sorry for the babbling - I'm entering my normal end-of-year paranoid phase.
 
 Jim Davis
 
 

~|
Special thanks to the CF Community Suite Silver Sponsor - CFDynamics
http://www.cfdynamics.com


Re: My Init() in my CFC...am I on the right track?

2004-12-28 Thread Jeff Small
From: Jochem van Dieten
 Jeff Small wrote:
 5) One practice that has become a best practice of sorts is to
 return this from your init method so that you can method chain, as
 shown below. Granted, not everybody follows this practice, as it's
 more personal preference, but it's just what I'm used to now.

 I'm struggling with this. I don't understand even from Seans's post 
 what
 purpose it serves to return this when you're using something like 
 CFOBJECT
 or CreateObject() which creates an instance of an object anyway...

 Because that works with cfobject and createobject(), but not with
 cfinvoke. (read on)

I read on, and I still kinda don't understand when you say, that works with 
cfobject and createobject(), but not with cfinvoke..

So you're saying that if I wanted to use CFINVOKE, that I wouldn't be able 
to unless my init() method was returning this?

 cffunction name=setDSN access=private output=false 
 returntype=void hint=Sets the name of the datasource
cfargument name=dsName type=string required=true hint=The 
 datasource name to set
cfset variables.DSN = arguments.dsName
 /cffunction

 If you have your setters return this too, you can chain them
 together:

 cfset variables.myCFC.setDSN(dsn).setMode(READONLY)

 Jochem

Okay, that makes sense. You're able to do that because both methods 
(init() and setMode() both return this? 



~|
Special thanks to the CF Community Suite Gold Sponsor - CFHosting.net
http://www.cfhosting.net

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:188891
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: My Init() in my CFC...am I on the right track?

2004-12-28 Thread Matthew Drayer
   cfset variables.DSN = myDataSourceName

This might be a little off the best CFC practice topic, but why not create a 
second CFC to govern all contact with your database(s)?  This way you don't 
have to worry about each CFC that lives in your world understanding database 
lingo and knowing what the datasource names are -- there's only one spot where 
it needs to happen.

We've done this (the component is called database.cfc), and it's really helped 
to streamline our code.  All queries and other DB-specific interactions are 
done through this component.  Other CFCs don't need to know anything about it 
other than invoking the proper method and passing the right arguments.

Matt

~|
Special thanks to the CF Community Suite Silver Sponsor - CFDynamics
http://www.cfdynamics.com

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:188892
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: My Init() in my CFC...am I on the right track?

2004-12-28 Thread Jochem van Dieten
Jeff Small wrote:
 From: Jochem van Dieten
 Jeff Small wrote:

 I'm struggling with this. I don't understand even from Seans's post what
 purpose it serves to return this when you're using something like CFOBJECT
 or CreateObject() which creates an instance of an object anyway...
 
 Because that works with cfobject and createobject(), but not with
 cfinvoke. (read on)
 
 I read on, and I still kinda don't understand when you say, that works with 
 cfobject and createobject(), but not with cfinvoke..
 
 So you're saying that if I wanted to use CFINVOKE, that I wouldn't be able 
 to unless my init() method was returning this?

Yes.

If you use cfinvoke you use 'throwaway' objects. In one call, you 
create the object, initiaize it, use it and discard it again. The 
only way to call multiple methods of an object is to have the 
first one return an instance of the object, and then continue to 
use that instance.


 If you have your setters return this too, you can chain them
 together:
 
 cfset variables.myCFC.setDSN(dsn).setMode(READONLY)
 
 Okay, that makes sense. You're able to do that because both methods 
 (init() and setMode() both return this? 

Yes.

Jochem

~|
Special thanks to the CF Community Suite Silver Sponsor - CFDynamics
http://www.cfdynamics.com

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:188893
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


CFX_CyberCash, Direct Pay and CVV2

2004-12-28 Thread stas
Does anyone if CFX Cybercash support passing the CVVD code? I found
some info that this code is referred to as cpi.card-cic in CyberCash
realm, but I don't know if the tag itself supports it.

Thanks!

Stas


~|
Special thanks to the CF Community Suite Silver Sponsor - CFDynamics
http://www.cfdynamics.com

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:188894
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: My Init() in my CFC...am I on the right track?

2004-12-28 Thread Dave Carabetta
On Tue, 28 Dec 2004 14:18:14 -0400, Matthew Drayer [EMAIL PROTECTED] wrote:
cfset variables.DSN = myDataSourceName
 
 This might be a little off the best CFC practice topic, but why not create 
 a second CFC to govern all contact with your database(s)?  This way you don't 
 have to worry about each CFC that lives in your world understanding 
 database lingo and knowing what the datasource names are -- there's only one 
 spot where it needs to happen.
 
 We've done this (the component is called database.cfc), and it's really 
 helped to streamline our code.  All queries and other DB-specific 
 interactions are done through this component.  Other CFCs don't need to know 
 anything about it other than invoking the proper method and passing the right 
 arguments.
 

You absolutely could (and some might say should for maintenance
reasons) do that. I just didn't want to muddy the waters with OO
concepts when all he was looking for was feedback on his syntax and
basic usage. While it's good to be cognizant of OO patterns, that's
probably a bit beyond the scope of any beginner's use of CFCs. I'd
suggest getting the syntax and basic usage down, and then refactor
using OO-patterns (via DAOs) later.

Regards,
Dave.

~|
Special thanks to the CF Community Suite Gold Sponsor - CFHosting.net
http://www.cfhosting.net

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:188895
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: My Init() in my CFC...am I on the right track?

2004-12-28 Thread Jeff Small
 It should be noted that you'll get slight variations from people based
 on their preferences, but the code below generally covers best
 practices that I've seen. Here's the cleaned up CFC and the calling
 code is below it:

 cfcomponent output=false
 cffunction name=init access=public output=false
 returntype=CFCName
 hint=Initializes my object and creates the datasource variable
cfset setDSN(dsName:myDataSourceName)
cfreturn this
 /cffunction

 cffunction name=getDSN access=public output=false
 returntype=string
 hint=Returns the name of the datasource
cfset variables.DSN = myDataSourceName
cfreturn this
 /cffunction

 cffunction name=setDSN access=private output=false
 returntype=void
 hint=Sets the name of the datasource
cfargument name=dsName type=string required=true hint=The
 datasource name to set
cfset variables.DSN = arguments.dsName
 /cffunction
 /cfcomponent

 Calling code:

 cfset variables.objMyCFC = createObject(component,
 path.to.my.CFC).init()
 cfset variables.myDSN = variables.objMyCFC.getDSN()

 Keanuwhoa/Keanu

 I think I need to print that out and go thru it slowly. Is your calling 
 code
 in your page? Why do you use your getDSN function after you've already
 created an object and initialized it? If possible...could you please just
 sort of briefly explain the three functions? You're using some weird 
 syntax
 in your init (dsName:myDataSourceName) that I don't
 kinda...well...get...

Man, I still don't really get this...well, I understand pretty much 
everything that everyone's said in this thread pretty much up to here...the 
above code is sort of confusing. I mean, it's not syntax confusing, I can 
follow it. I just don't really get what it's accomplishing, and what the 
obvious benefits are for the above code. Don't get me wrong, as soon as the 
lightbulb goes off, I'm all about it, but right now, it's mainly just the 
above code that's making me scratch my headconceptually anyway... 



~|
Special thanks to the CF Community Suite Silver Sponsor - CFDynamics
http://www.cfdynamics.com

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:188896
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


If your CFC takes a struct, can Flash provide one via remoting?

2004-12-28 Thread Jeff Small
If one of the things you're looking forward to doing is using some methods 
with Flash Remoting down the line, and you made an insert() method say, that 
was looking for a struct (insert(myStruct) for instance) can Flash provide 
the method with the appropriate structure that ColdFusion (the CFC) is 
expecting? So you can take advantage of your insert() later on with a nice 
Flash form for instance, or something along those lines...without having to 
change any of the underlying CFC code... 



~|
Special thanks to the CF Community Suite Silver Sponsor - New Atlanta
http://www.newatlanta.com

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:188897
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: My Init() in my CFC...am I on the right track?

2004-12-28 Thread Dave Carabetta
Replies inline...

On Tue, 28 Dec 2004 15:00:07 -0500, Jeff Small [EMAIL PROTECTED] wrote:
  It should be noted that you'll get slight variations from people based
  on their preferences, but the code below generally covers best
  practices that I've seen. Here's the cleaned up CFC and the calling
  code is below it:
 
  cfcomponent output=false
  cffunction name=init access=public output=false
  returntype=CFCName
  hint=Initializes my object and creates the datasource variable
 cfset setDSN(dsName:myDataSourceName)
 cfreturn this
  /cffunction

All this does is call an internal private method called setDSN() to
set the datasource name. When I originally read your e-mail, I thought
that you wanted to eventually be able to pass back the name of the
datasource to your calling code (i.e., my_template.cfm needs the name
of the datasource). From your follow-up posts, it looks like all you
really want to do is use the datasource name in that CFC, in which
case the getDSN/setDSN method really aren't necessary. Apologies for
any confusion there.

 
  cffunction name=getDSN access=public output=false
  returntype=string
  hint=Returns the name of the datasource
 cfset variables.DSN = myDataSourceName
 cfreturn this
  /cffunction
 
  cffunction name=setDSN access=private output=false
  returntype=void
  hint=Sets the name of the datasource
 cfargument name=dsName type=string required=true hint=The
  datasource name to set
 cfset variables.DSN = arguments.dsName
  /cffunction
  /cfcomponent

Again, if you don't want your calling code (the CFM template that
invokes the CFC) to access the datasource name, then you really don't
need these two methods -- you can use your initial approach of
directly setting the variables.DSN value in your init() method and
chop the methods out. Any other method within your CFC that needs to
use variables.DSN can then directly refer to it rather than having to
call getDSN() to get its value.

 
  Calling code:
 
  cfset variables.objMyCFC = createObject(component,
  path.to.my.CFC).init()
  cfset variables.myDSN = variables.objMyCFC.getDSN()

Your calling code (again, the CFM template that invokes the CFC) now
only needs the first line to actually create an instance of your CFC:

cfset variables.objMyCFC = createObject(component, path.to.my.CFC).init()

At this point, you have both created a new instance of the CFC and
called its init() method at the same time. You now have a full-fledged
CFC object and you can simply call other methods in that CFC using
this syntax:

cfset variables.myQueryResult = variables.objMyCFC.getMyData()

 
  Keanuwhoa/Keanu
 
  I think I need to print that out and go thru it slowly. Is your calling
  code
  in your page? Why do you use your getDSN function after you've already
  created an object and initialized it? If possible...could you please just
  sort of briefly explain the three functions? You're using some weird
  syntax
  in your init (dsName:myDataSourceName) that I don't
  kinda...well...get...

I understand there's a lot to take in at the beginning!! As to the
first question, the calling code is the CFM template that actually
creates the CFC instance, and is where the variables.objMyCFC line of
code would go -- *not* in the CFC itself. As I said before, I put in
the getDSN line because I thought your *calling code* needed that
value for some reason. Since it turns out it doesn't, then you can
eliminate that line altogether.

Lastly, the init syntax I used for setDSN() is an alternative way of
calling CFC methods that some people don't use and some do -- I do.
When invoking CFC methods, you have the ability to use named arguments
or use positional arguments. Named arguments, as you might guess, is
when you explicitly note the argument name that the value applies to.
So, taking the setDSN() method from earlier, you'll see the I've
created a cfargument called dsName in the setDSN() method itself that
is expecting a string value. In the init() method, where I called the
setDSN() method, I simply put the name of the argument in front of the
value for clarity. Positional notation, like most other programming
languages, is simply putting the values in the correct order without
specifying the argument name that it goes with. ColdFusion then
implicitly takes the first value and associates it with the first
cfargument in the method being called, the second value with the
second cfargument, and so on. So you can write the setDSN() method
call in three ways (two using named arguments and one using positional
arguments:

Named:
cfset setDSN(dsName:myDatasourceName)
or
cfset setDSN(dsName=myDatasourceName)

Positional:
cfset setDSN(myDatasourceName)

Any of the above is perfectly valid. I personally prefer named
arguments because it makes my calling code more explicit in that I
don't have to go open the CFC to see what the argument name is that
I'm passing in. Further, if you use positional argument notation and
the order of your 

Re: My Init() in my CFC...am I on the right track?

2004-12-28 Thread Jeff Small
 Named:
 cfset setDSN(dsName:myDatasourceName)
 or
 cfset setDSN(dsName=myDatasourceName)

Aha! This I got immediately. I understand it all now and once we were both 
clear on what I was doing, it makes perfect sense both in what you were 
doing, and syntactically what you were writing. I've seen the lower named 
method in 99.99% of the examples that use that method, I don't honestly 
recall ever seeing the upper method used. But once I see what it is, it 
makes perfect sense.

 Positional:
 cfset setDSN(myDatasourceName)

 Any of the above is perfectly valid. I personally prefer named
 arguments because it makes my calling code more explicit in that I
 don't have to go open the CFC to see what the argument name is that
 I'm passing in.

...and this makes a LOT of sense. It's something I'm going to start trying 
to look at closer.

 Further, if you use positional argument notation and
 the order of your arguments gets messed up, then you will be setting
 the wrong values for each argument!

...again, another terrific reason...

 I should note that many prefer
 positional notation because it's just like Java, JavaScript, etc.,
 where you just pass in the value, and it keeps your coding guidelines
 more consistent.

Exactly! For me it was simply force of habit...

 Hopefully this helps a bit more?

TONS more...thanks so much! 



~|
Special thanks to the CF Community Suite Gold Sponsor - CFHosting.net
http://www.cfhosting.net

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:188899
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: My Init() in my CFC...am I on the right track?

2004-12-28 Thread Sean Corfield
On Tue, 28 Dec 2004 12:08:54 -0500, Jeff Small [EMAIL PROTECTED] wrote:
 Okay, this makes sense. I'm reading about 4 different sources for how to
 build CFCs correctly

I hope that includes both of the Macromedia Web Team docs :)

http:/livedocs.macromedia.com/wtg/public/

Note that even tho' the second one is mostly specific to Mach II,
there's a lot of advice about CFC and application design in terms of
OO.

 So in my code where I'm using my CFC, I'm using CFOBJECT like so:
 cfobject name=myObject component=mySite.myComponent

I'd strongly advise switching to cfset and createObject() - it's
more flexible:

cfset myObject = createObject(component,mySite.myComponent)/

This allows you to chain method calls, as others have noted, and will
probably help get you more into the habit of using cfset and method
calls (rather than cfinvoke which I also advise against).

Why? I think there's a psychological hint behind cfobject and
cfinvoke - they look like old-school tags and, hence, old school
thinking; whereas if you make a conscious effort to switch to cfset
and use createObject() / method calls directly, you'll get a hint
that this isn't just old-school tags and it'll help you switch gears
into new school (OO / CFC) thinking.

 This part somewhat confuses me, but again, I'm using CFOBJECT and not
 CreateObject so I'm not really setting anything equal to anything.

Which just reinforces my point about psychological hints above...
-- 
Sean A Corfield -- http://www.corfield.org/
Team Fusebox -- http://www.fusebox.org/
Breeze Me! -- http://www.corfield.org/breezeme
Got Gmail? -- I have 6 invites to give away!

If you're not annoying somebody, you're not really alive.
-- Margaret Atwood

~|
Special thanks to the CF Community Suite Gold Sponsor - CFHosting.net
http://www.cfhosting.net

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:188900
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: STICKY Application.datasource

2004-12-28 Thread Larry White
This is kind of dangerous unless you use cflocks properly, and
cflocking the application scope can slow things down. The reason
is if somewhere in your app you change the application.datsource from 
CODAGenomics to something else, which you've indicated happens,
any other user loading a page will change it right back to 
CODAGenomics. 


Well, that worked, TNX very much. 

When is cfparam appropriate?? 

-Original Message-
From: Qasim Rasheed [mailto:[EMAIL PROTECTED] 
Sent: Monday, December 27, 2004 7:30 PM
To: CF-Talk
Subject: Re: STICKY Application.datasource

Instead of this 

cfparam name=Application.datasource default=CODAGenomics

use this

cfset Application.datasource = CODAGenomics


On Mon, 27 Dec 2004 19:12:36 -0800, Richard Colman [EMAIL PROTECTED] wrote:

~|
Special thanks to the CF Community Suite Silver Sponsor - RUWebby
http://www.ruwebby.com

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:188901
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: My Init() in my CFC...am I on the right track?

2004-12-28 Thread Ben Rogers
 This allows you to chain method calls, as others have noted, and will
 probably help get you more into the habit of using cfset and method
 calls (rather than cfinvoke which I also advise against).

Just to be clear, are you advising people to chain method calls? Personally,
I'm not crazy about this practice. I find it much more difficult to read
code that does several different things on one line.

Additionally, it just seems unintuitive to have a setter method return a
variable. If a setter returns a variable, I have to decide if it's
meaningful in some way or if the guy before me was just being cute to save
himself from having to type a few extra characters.

Anyway, I'm just wondering if there's something I'm missing here.

Ben Rogers
http://www.c4.net
v.508.240.0051
f.508.240.0057

 
 Why? I think there's a psychological hint behind cfobject and
 cfinvoke - they look like old-school tags and, hence, old school
 thinking; whereas if you make a conscious effort to switch to cfset
 and use createObject() / method calls directly, you'll get a hint
 that this isn't just old-school tags and it'll help you switch gears
 into new school (OO / CFC) thinking.
 
  This part somewhat confuses me, but again, I'm using CFOBJECT and not
  CreateObject so I'm not really setting anything equal to anything.
 
 Which just reinforces my point about psychological hints above...
 --
 Sean A Corfield -- http://www.corfield.org/
 Team Fusebox -- http://www.fusebox.org/
 Breeze Me! -- http://www.corfield.org/breezeme
 Got Gmail? -- I have 6 invites to give away!
 
 If you're not annoying somebody, you're not really alive.
 -- Margaret Atwood
 
 

~|
Special thanks to the CF Community Suite Gold Sponsor - CFHosting.net
http://www.cfhosting.net

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:188902
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: My Init() in my CFC...am I on the right track?

2004-12-28 Thread Jim Davis
 -Original Message-
 From: Ben Rogers [mailto:[EMAIL PROTECTED]
 Sent: Tuesday, December 28, 2004 4:35 PM
 To: CF-Talk
 Subject: RE: My Init() in my CFC...am I on the right track?
 
  This allows you to chain method calls, as others have noted, and will
  probably help get you more into the habit of using cfset and method
  calls (rather than cfinvoke which I also advise against).
 
 Just to be clear, are you advising people to chain method calls?
 Personally,
 I'm not crazy about this practice. I find it much more difficult to read
 code that does several different things on one line.

Personally I really hate the notion of chaining setter calls (but I can see
way others may like it).  I do find that much harder to read.

But other chaining is great.

Being able to chain the create and the init() together  seems perfectly
sound to me.  As does any call which returns a CFC as a property then calls
a property of that return as in something like this:

cfset Name = Session.SessionCFC.getUserCFC().getName() /

Without chaining I would find that much harder to read and use (especially
when pulling many properties like this).

I think it's personal preference.

As for returning this from a setter... I never thought about it, but I
might start (mine all return void now).  I may personally never use it, but
if it doesn't affect performance it leaves to possibility open for others
that might want to.

I like those kind of there if you want it kind of compromises.  ;^)

Jim Davis



~|
Special thanks to the CF Community Suite Silver Sponsor - RUWebby
http://www.ruwebby.com

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:188903
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


SOT: SQL Server date range

2004-12-28 Thread Bryan Stevenson
Hey All,

Well while I'm searchin for it, I figured I'd see if anyone on list may have an 
answer for me...

What is the date range for SQL Server dates (i.e. how far back does it goI 
know a year of 1234 is not valid)??

TIA

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

~|
Special thanks to the CF Community Suite Silver Sponsor - CFDynamics
http://www.cfdynamics.com

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:188904
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: SQL Server date range

2004-12-28 Thread Bryan Stevenson
hmmm...after some quick testing...it looks like it goes back to 1754 if 
anyone cares ;-)

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 


~|
Special thanks to the CF Community Suite Silver Sponsor - New Atlanta
http://www.newatlanta.com

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:188905
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


FB4 on CFMX problem with set

2004-12-28 Thread Duncan I Loxton
Hi everyone, I wonder if you might be able to help me here.  I am
having trouble with the following:
This is in the circuit.xml in my login/model circuit

fuseaction name=checkUser 
include template=qry_checkUser.cfm/ 
if condition=validateUser.recordcount is 1
true
set name=request.usr_id 
value=#validateUser.usr_id# /
/true
/if
/fuseaction 

When I get thru the login process the request.usr_id isnt set - why??

-- 
Duncan I Loxton

~|
Special thanks to the CF Community Suite Silver Sponsor - RUWebby
http://www.ruwebby.com

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:188906
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: If your CFC takes a struct, can Flash provide one via remoting?

2004-12-28 Thread Sean Corfield
On Tue, 28 Dec 2004 15:24:36 -0500, Jeff Small [EMAIL PROTECTED] wrote:
 If one of the things you're looking forward to doing is using some methods
 with Flash Remoting down the line, and you made an insert() method say, that
 was looking for a struct (insert(myStruct) for instance) can Flash provide
 the method with the appropriate structure that ColdFusion (the CFC) is
 expecting?

Yes, but... Be aware of single argument methods: I seem to recall that
if Flash sees obj.method(singleArg) and singleArg is a struct, it
treats it much like CF's argumentCollection and passes the elements of
the struct as separate arguments I think. It's a special case with
single argument methods.

 So you can take advantage of your insert() later on with a nice
 Flash form for instance, or something along those lines...without having to
 change any of the underlying CFC code...

Modulo the caveat above, yes.
-- 
Sean A Corfield -- http://www.corfield.org/
Team Fusebox -- http://www.fusebox.org/
Breeze Me! -- http://www.corfield.org/breezeme
Got Gmail? -- I have 6 invites to give away!

If you're not annoying somebody, you're not really alive.
-- Margaret Atwood

~|
Special thanks to the CF Community Suite Silver Sponsor - RUWebby
http://www.ruwebby.com

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:188907
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: My Init() in my CFC...am I on the right track?

2004-12-28 Thread Joe Rinehart
 If parameters are not needed, I would feel the init() method 
 is not needed.  But I'm sure that is debatable.

Hey Ian,

Not trying to debate, just giving my point of view:  I'd use the
init() method regardless of the need for parameters.  This way, if
parameters need to be added, the external interface for the CFC
doesn't need to change.

-Joe

-- 
For Tabs, Trees, and more, use the jComponents:
http://clearsoftware.net/client/jComponents.cfm

~|
Special thanks to the CF Community Suite Silver Sponsor - New Atlanta
http://www.newatlanta.com

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:188908
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: STICKY Application.datasource

2004-12-28 Thread Cameron Childress
Not sure what that has to do with locks.  Nothing at all as far as I can tell.

I'd hope the entire application uses the same datasource.  If you need
a second one, just set application.otherdb = 'whatever'

-Cameron


On Tue, 28 Dec 2004 16:27:35 -0400, Larry White [EMAIL PROTECTED] wrote:
 This is kind of dangerous unless you use cflocks properly, and
 cflocking the application scope can slow things down. The reason
 is if somewhere in your app you change the application.datsource from
 CODAGenomics to something else, which you've indicated happens,
 any other user loading a page will change it right back to
 CODAGenomics.
 
 
 Well, that worked, TNX very much.
 
 When is cfparam appropriate??
 
 -Original Message-
 From: Qasim Rasheed [mailto:[EMAIL PROTECTED]
 Sent: Monday, December 27, 2004 7:30 PM
 To: CF-Talk
 Subject: Re: STICKY Application.datasource
 
 Instead of this
 
 cfparam name=Application.datasource default=CODAGenomics
 
 use this
 
 cfset Application.datasource = CODAGenomics
 
 
 On Mon, 27 Dec 2004 19:12:36 -0800, Richard Colman [EMAIL PROTECTED] wrote:
 
 

~|
Special thanks to the CF Community Suite Silver Sponsor - CFDynamics
http://www.cfdynamics.com

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:188909
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: SQL Server date range

2004-12-28 Thread Cameron Childress
http://www.devx.com/tips/Tip/13898

Values for datetime data types earlier than January 1, 1753 are not
permitted in SQL Server. SQL Server rejects all values that do not
fall within the range from 1753 to .

Another SQL Server data type, smalldatetime, stores dates and times of
day with less precision than datetime datatype. Valid date range for
this data type is from January 1, 1900 through June 6, 2079.

-Cameron

On Tue, 28 Dec 2004 14:23:57 -0800, Bryan Stevenson
[EMAIL PROTECTED] wrote:
 hmmm...after some quick testing...it looks like it goes back to 1754 if
 anyone cares ;-)
 
 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
 
 

~|
Special thanks to the CF Community Suite Gold Sponsor - CFHosting.net
http://www.cfhosting.net

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:188910
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


shopping cart, session variables - best practices

2004-12-28 Thread mayo
I'm setting up a shopping cart for a jewelry store.

I'm curious, what is performance limit for storing data in session
variables?

The following are lists:

Item No (itemID used in check out)
Item Qty (in case someone wants more than one)
Item Price
Item Description (most descriptions about 50 characters. ex: Ruby and gold
drop-earrings)

Most customers will not go above 3 or 4 items so I'm not concerned for this
project.

Just curious in general. At what point would storing data impact
performance?

Also, is updating session variables all that much quicker than updating a
database. For example a customer wants two pairs of a particular earring
instead of one.

-- gil


~|
Special thanks to the CF Community Suite Gold Sponsor - CFHosting.net
http://www.cfhosting.net

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:188911
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: shopping cart, session variables - best practices

2004-12-28 Thread Cameron Childress
 I'm curious, what is performance limit for storing data in session
 variables?

Memory (RAM) is really your only practical limit when using session
variables.  Just make sure you make your session timeout a practical
interval. and (assuming you are on CFMX) make sure you set both your
max and default memory sizes to the same value in the CFADMIN.

It's conceivable that if you have too many sessions going at once, you
could use up all the available RAM and run into out of memory errors,
but based on the limmited data you are storing in session, you will
likely hit another bottleneck point (ie: CPU or DB connections) before
your sessions exceed available RAM.

 Also, is updating session variables all that much quicker than updating a
 database. For example a customer wants two pairs of a particular earring
 instead of one.

Session variables are always going to be faster than making trips to the DB.

-Cameron

~|
Special thanks to the CF Community Suite Silver Sponsor - CFDynamics
http://www.cfdynamics.com

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:188912
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


CFMX 6.1 throwng lots of java.net.SocketException: Connection reset

2004-12-28 Thread Dov Katz
Any idea why these are sprouting up all over my mx6.1(windows) logs? Users get 
the standard JRun disconnect/protocol error page.

Any help is appreciated...


12/28 21:19:24 error Error while reading header HTTP-REFERER
java.net.SocketException: Connection reset by peer: socket write error
at java.net.SocketOutputStream.socketWrite0(Native Method)
at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:92)
at java.net.SocketOutputStream.write(SocketOutputStream.java:136)
at 
java.io.BufferedOutputStream.flushBuffer(BufferedOutputStream.java:66).



12/28 21:19:24 error Error while reading header CODESNIPPET
java.net.SocketException: Connection reset by peer: socket write error
at java.net.SocketOutputStream.socketWrite0(Native Method)
at java.net.SocketOutputStream.socketWrite(SocketOutputStream


12/28 21:19:23 error Error while reading header S_UNABLE
java.net.SocketException: Connection reset by peer: socket write error
at java.net.SocketOutputStream.socketWrite0(Native Method)
at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:92)
at java.net.SocketOutputStream.write(SocketOutputStream.java:136)


12/28 21:19:22 error Error in getRealPathFromConn
java.net.SocketException: Connection reset by peer: socket write error
at java.net.SocketOutputStream.socketWrite0(Native Method)
at java.net.SocketOutputStream.socketWrite(SocketOutputStream.j


~|
Special thanks to the CF Community Suite Gold Sponsor - CFHosting.net
http://www.cfhosting.net

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:188913
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: CFMX 6.1 throwng lots of java.net.SocketException: Connection reset

2004-12-28 Thread Sean Corfield
On Tue, 28 Dec 2004 21:52:26 -0400, Dov Katz [EMAIL PROTECTED] wrote:
 Any idea why these are sprouting up all over my mx6.1(windows) logs? Users 
 get the standard JRun disconnect/protocol error page.

I'll bet you've got isDefined(someUnqualifiedVariable) in your code
- if the variable isn't defined, CF looks up the list of scopes (per
the docs) and will eventually attempt to look in CGI scope if it
hasn't found the variable elsewhere. If the connection between the
browser and the web server has closed (for a variety of reasons) then
the JRun connector will fail to read the variable from the header.

You're much safer using
structKeyExists(someScope,someUnqualifiedVariable) which is not only
much faster but will avoid the (harmless) errors you are seeing, e.g.,

cfif structKeyExists(variables,codesnippet)
...
/cfif
-- 
Sean A Corfield -- http://www.corfield.org/
Team Fusebox -- http://www.fusebox.org/
Breeze Me! -- http://www.corfield.org/breezeme
Got Gmail? -- I have 6 invites to give away!

If you're not annoying somebody, you're not really alive.
-- Margaret Atwood

~|
Special thanks to the CF Community Suite Silver Sponsor - RUWebby
http://www.ruwebby.com

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:188914
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: shopping cart, session variables - best practices

2004-12-28 Thread Sean Corfield
On Tue, 28 Dec 2004 21:12:58 -0500, mayo [EMAIL PROTECTED] wrote:
 The following are lists:
 
 Item No (itemID used in check out)
 Item Qty (in case someone wants more than one)
 Item Price
 Item Description (most descriptions about 50 characters. ex: Ruby and gold
 drop-earrings)

Any reason you're not using an array of structs? It would be much
cleaner to work with and much faster than using lists (which is going
to have much more impact on your performance than storing data).
-- 
Sean A Corfield -- http://www.corfield.org/
Team Fusebox -- http://www.fusebox.org/
Breeze Me! -- http://www.corfield.org/breezeme
Got Gmail? -- I have 6 invites to give away!

If you're not annoying somebody, you're not really alive.
-- Margaret Atwood

~|
Special thanks to the CF Community Suite Gold Sponsor - CFHosting.net
http://www.cfhosting.net

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:188915
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: shopping cart, session variables - best practices

2004-12-28 Thread mayo
There's no particular reason to use list. I was wondering about using arrays
instead, and then got pulled elsewhere. Thx.

-- gil



-Original Message-
From: Sean Corfield [mailto:[EMAIL PROTECTED]
Sent: Tuesday, December 28, 2004 10:59 PM
To: CF-Talk
Subject: Re: shopping cart, session variables - best practices


On Tue, 28 Dec 2004 21:12:58 -0500, mayo [EMAIL PROTECTED] wrote:
 The following are lists:

 Item No (itemID used in check out)
 Item Qty (in case someone wants more than one)
 Item Price
 Item Description (most descriptions about 50 characters. ex: Ruby and
gold
 drop-earrings)

Any reason you're not using an array of structs? It would be much
cleaner to work with and much faster than using lists (which is going
to have much more impact on your performance than storing data).
--
Sean A Corfield -- http://www.corfield.org/
Team Fusebox -- http://www.fusebox.org/
Breeze Me! -- http://www.corfield.org/breezeme
Got Gmail? -- I have 6 invites to give away!

If you're not annoying somebody, you're not really alive.
-- Margaret Atwood



~|
Special thanks to the CF Community Suite Silver Sponsor - New Atlanta
http://www.newatlanta.com

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:188916
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: FB4 on CFMX problem with set

2004-12-28 Thread Michael T. Tangorre
 From: Duncan I Loxton [mailto:[EMAIL PROTECTED] 
 fuseaction name=checkUser 
   include template=qry_checkUser.cfm/ 
   if condition=validateUser.recordcount is 1
   true
   set name=request.usr_id 
 value=#validateUser.usr_id# /
   /true
   /if
 /fuseaction 
 
 When I get thru the login process the request.usr_id isnt set - why??

I would first verify that the query returns a record. Can you verify that
the query returns what you are expecting?
Also, I would change your conditional statement to take into account
multiple records or 0 records:

if condition=validateUser.RecordCount EQ 1
true
set name=request.usr_id value=#validateUser.usr_id# /
/true
false
  
false
/if 

Just cfdump the query first to make sure the values you expect are there...
Then go from there.

HTH,

Mike


~|
Special thanks to the CF Community Suite Gold Sponsor - CFHosting.net
http://www.cfhosting.net

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:188917
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: STICKY Application.datasource

2004-12-28 Thread Andrew Grosset
Unless it's really necessary I would try not to set datasource
as an application variable, either:

cfset datasource=CODAGenomics

or

cfset request.datasource=CODAGenomics

Andrew.

I seem to have a sticky application variable. How do I get it to change?

The application.cfm file is:

cfapplication name=CBRLVer11 sessionmanagement=Yes
clientmanagement=Yes SESSIONTIMEOUT=#CREATETIMESPAN(0,8,0,0)# 
cfparam name=Application.datasource default=CODAGenomics
cfparam name=Application.name default=CODA

All the queries use:

   cfquery datasource=#application.datasource# name=xxx

So, when I changed the application.datasource default value, the related
scripts
Still bring up the old value. 

Have tried clearing the browser cache, etc. etc.

Any idea why and how to fix?

TNX if you can shed some light on this problem.

Rick.

~|
Special thanks to the CF Community Suite Gold Sponsor - CFHosting.net
http://www.cfhosting.net

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:188918
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