Re: Handling In-Field Commas in CSV import?

2010-06-03 Thread Barney Boisvert

There is absolutely no reason to parse a CSV document manually; there
are myriad tools for exactly this purpose.  A quick Googling will turn
up a pile of options.  You may need to tweak them if your file is
enormous and must be processed line-by-line, but even then you should
be able to use an off-the-shelf parser and just treat each individual
line as a separate CSV document (which they are), and then do your
aggregation between them however you see fit.

At the very least, build yourself a UDF that strictly does CSV parsing
so you don't have that logic mixed in with your business logic,
because it's more complicated than you think.  And if you go this
route, ensure you consider the differences between standard and
Excel CSV format.

cheers,
barneyb

On Thu, Jun 3, 2010 at 10:32 AM,  p...@smashedvision.com wrote:

 I'm trying to import a comma delimited CSV file using cfloop

 file=filename.csv, but some records contain commas and they are throwing

 everything off. I can't seem to figure out how to replace the in-field

 commas without messing up the delimiter. Any ideas? Thanks in advance.



 -Paul

 

~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:334272
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: Query Results sent from search engines CGI variable?

2010-06-01 Thread Barney Boisvert

It'll be in the referrer, if present, which is sent by the browser.
cgi.http_referer, split it up, check the domain to identify the search
engine, and then check the query string to find the search query under
the corresponding variable.

cheers,
barneyb

On Tue, Jun 1, 2010 at 1:34 PM, UXB Internet denn...@uxbinternet.com wrote:

 I have a client who wants to make their site more user friendly when someone
 is sent to them from a search engine.  What they want is when someone comes
 from a search engine link that we obtain the original search query (if sent)
 and in addition to showing the requested page present a list of other items
 from their site matching an internal search result using that criteria.

 I know that many search engines send the original search query over to the
 website I am assuming in the header because I can obtain that information
 from the web-server log reports.  What I don't know is if it is available in
 the CGI variables Cold Fusion can get from IIS6.

 Does anyone know if they are available and how to programmatically extract
 them for use within Cold Fusion?


 Dennis Powers
 UXB Internet - A Website Design  Hosting Company
 P.O. Box 6028
 Wolcott, CT 06716
 203-879-2844
 http://www.uxbinternet.com







 

~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:334199
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: referencing #application.applicationname#

2010-05-31 Thread Barney Boisvert

locks aren't necessary for simple reads to prevent memory
corruption.  They ARE necessary if you have a potential race
condition.

To put that another way, CF5 and before required locks to prevent
memory corruption, but CF6+ does not.  However, if you care about your
application behaving correctly (not just having non-corrupted memory),
then read-only locks are absolutely needed in certain cases.

Macromedia rather botched up this message, I think, when the change
first happened, because they implied that you no longer had to lock
reads.  In reality, you only get to avoid the lock when you have a
read on a single shared scope variable.  If you have multiple reads,
you must at least consider whether a lock is required (it should be,
but you can sometimes safely skip it).  If you have a read and then a
write, you MUST lock the read.  In this latter case you can do a
read-only lock and then escalate to an exclusive for the write if
that'll reduce the serialization of concurrent requests, but the read
MUST be in a lock.

I don't want to be an anal retentive pedant, but this is REALLY
important.  Doing it wrong will only manifest bugs under weird
situations, so the chance of organically identifying and correcting
the bug is nearly zero.  If you get it wrong, it's going to be a
under-load data corruption issue (not memory corruption, mind you,
data corruption) in production that tells you you have a bug.

cheers,
barneyb

On Mon, May 31, 2010 at 7:52 AM, Raymond Camden rcam...@gmail.com wrote:

 Do you remember what chapter that is? I'm 99% sure CFWACK makes it
 clear that locks aren't necessary for simple reads. I remember writing
 those updates myself a few revs back but I'd like to confirm the
 current text is clear.


 On Sun, May 30, 2010 at 4:29 PM, Matthew P. Smith m...@smithwebdesign.net 
 wrote:

 Does this require a lock?

 I was reading through the CF WACK, and it has an example like so:
 cflock name=#application.applicationname#_whatever type=exclusive
 timeout=10

 does reading the app scope require a lock?  Would I nest two locks?  Or is
 it not required because the application name does not change?



-- 
Barney Boisvert
bboisv...@gmail.com
http://www.barneyb.co

~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:334148
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: Attributes scope in a cfc

2010-05-30 Thread Barney Boisvert

What attributes scope?  If you mean the structure
variables.attributes that is created from the form and url scopes by
some front controller frameworks, then no, since it's just a struct
(not a scope).  In general, however, referencing the environment from
within a CFC is a bad idea.  In nearly all cases you should be passing
in everything you need.

cheers,
barneyb

On Sun, May 30, 2010 at 12:00 PM, Matthew P. Smith m...@smithwebdesign.net 
wrote:

 Any way to access the attributes scope in a cfc without passing it in as a
 argument?


 

~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:334127
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: referencing #application.applicationname#

2010-05-30 Thread Barney Boisvert

CFLOCK is only required to serialize access to prevent race
conditions.  For immutable state, no race conditions can arise, so
locking is unneeded.  Since application.applicationname is immutable,
you don't need to lock access to it.

In a more general sense, anything that is only accessed in a read-only
and side effect-free fashion doesn't need to be locked.  This is the
reason that functional languages are so supremely suited to highly
concurrent applications.  With immutable state and side effect-free
operations, the issue of concurrency basically vanishes from the
programmer's mind.

This purity of environment only works completely in academia, but a
very close approximation can be created that is useful for real-world
problems.  Clojure (a JVM-based Lisp dialect) is an example of this,
leveraging Actors to deal with concurrent modification problems
without foisting the hassle of locking on the developer.

cheers,
barneyb

On Sun, May 30, 2010 at 2:29 PM, Matthew P. Smith m...@smithwebdesign.net 
wrote:

 Does this require a lock?

 I was reading through the CF WACK, and it has an example like so:
 cflock name=#application.applicationname#_whatever type=exclusive
 timeout=10

 does reading the app scope require a lock?  Would I nest two locks?  Or is
 it not required because the application name does not change?


 

~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:334129
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: How to delete a post in House of fusion?

2010-05-27 Thread Barney Boisvert

On the flip side, if you contact Michael Dinowitz, he would be able to
delete the post.  Whether he would be willing to do that or not is a
different question, but he's the man to talk to about at least
removing it from HoF.

But as has been pointed out, making it non-public is impossible, even
if Michael is willing to remove it from HoF itself.

cheers,
barneyb

On Thu, May 27, 2010 at 10:49 AM, Ian Skinner h...@ilsweb.com wrote:

 On 5/27/2010 10:43 AM, Phillip Vector wrote:
 All posts that go there also get sent out on the mailing list and
 google tends to be pretty quick archiving them.

 Even if you delete the post, it's likely that it's out there on the
 net for good.

 On Thu, May 27, 2010 at 10:34 AM, C Scortical...@yahoo.com  wrote:
 Hi:
 Due to some privacy issues I need to delete some of my posts and the 
 replies to them in House of fusion but the option is not available as a 
 default one. Is it a way? Please help me because the privacy issue is very 
 important


 As well as all of us who have copies in our email archives, and Googles
 archives.  There are several other mirror sits that copy House of Fusion
 content.

 You are in a tough place my friend.


 

~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:334047
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: Getting a list of MySQL database views

2010-05-26 Thread Barney Boisvert

http://dev.mysql.com/doc/refman/5.0/en/views-table.html

On Wed, May 26, 2010 at 1:00 PM, Ray Meade raym...@yahoo.com wrote:

 I'm trying to create a custom export page for our member rep's. I'm using 
 cfdbinfo to get a list of tables to pull the data from, but I also have a 
 handful of views that combine data from different tables. (such as the 
 members table and the deliverables table) Is there any way to pull a list of 
 DB views that I can use instead of raw tables? (I've named my views with 
 intuitive names ('members' instead of 'users', etc.) so that our rep's. will 
 know where to pull the data they need) I've looked everywhere I can think of 
 for a solution including the MySQL doc's., but to no avail...please help.

 

~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:334018
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: create cf-tags as code for a file

2010-05-20 Thread Barney Boisvert

This is the right way to do it, in general:

cfsavecontent var=content
 #chr(60)#cfoutput
  li.../li
 #chr(60)#/cfoutput
/cfsavecontent

It's kind of ugly, however, and this will often work:

cfsavecontent var=content
 [cfoutput
  li.../li
 [/cfoutput
/cfsavecontent
cfset content = replace(content, [cf, cf, all) /

cheers,
barneyb

On Thu, May 20, 2010 at 11:02 AM, daniel kessler dani...@umd.edu wrote:

 I want to generate a file (by code) that has CF tags in it so that it can be 
 included into another file.  I can write in the # by escaping them, but I 
 also want to escape the cold fusion tags so that they're not enacted when I 
 write the file, but rather when that generated file is included in another 
 file.

 cfsavecontent variable=xml_counts
        ul style=margin-top:-10px;
        cfloop condition=ea_date gte start_date

         cfoutput
 ---
 I don't want the following cfoutput tag to be enacted by rather written into 
 the file,
           so that when it's included into another file, it has the cfoutput 
 tag to work.  I need to escape the tag.  How to do that?
 ---
         cfoutput
         lia href='##the_page##?archive=#the_content#/li

        /cfoutput
        /cfloop
        /ul
 /cfsavecontent

 

~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:333859
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: HomePortals?

2010-05-18 Thread Barney Boisvert

The guy who built it happens to be sitting at the desk next to me.  ;)

It's not really a wiki, but it might serve the need.  Canvas and Codex
are both real CFML wiki packages, and they should run next to
CommonSpot, I'd think.

cheers,
barneyb

On Tue, May 18, 2010 at 9:44 AM, Sandra Clark sclarkli...@gmail.com wrote:

 Just ran across this while searching for a Coldfusion Wiki that needs to run
 alongside Commonspot.  Anyone heard of it?  Any pros or cons regarding it?

 I'm willing to download it, but unfortunately, my time is limited to get
 this project done and I don't have a lot of time to play with something and
 then have to reject it,

 Any and all information would be appreciated.

 Also any ideas on a Wiki that will run alongside Commonspot would be helpful
 as well.

 Sandy


 

~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:333787
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: Force SSL

2010-05-18 Thread Barney Boisvert

Make a HTTP host that simply redirects to the same domain-relative
URI, except over HTTPS.  Then every request will be either over SSL or
forward to one that is.

cheers,
barneyb

On Tue, May 18, 2010 at 10:00 AM, Donnie Carvajal
donnie.carva...@transformyx.com wrote:

 Does anyone know of a way to force SSL for all files in a web site?  This 
 solution should handle non-Coldfusion pages such as PDF files as well.  I am 
 using Windows 2003 with IIS.

 Thanks,

 Donnie

 

~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:333790
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: Convert to number

2010-05-13 Thread Barney Boisvert

That won't work, you'll get 100.00, not 10.00.  Try
REReplace(my_number, [^0-9.], , all).

cheers,
barneyb

On Thu, May 13, 2010 at 10:34 AM, DURETTE, STEVEN J (ATTASIAIT)
sd1...@att.com wrote:

 Robert,

 You shouldn't have to strip it in a perfect world, but the comma makes it a 
 string not a number according to ColdFusion.

 Try this instead: $#numberFormat(val(my_number), __.00)#

 Might not work, I didn't test it.

 Steve


 -Original Message-
 From: Robert Harrison [mailto:rob...@austin-williams.com]
 Sent: Thursday, May 13, 2010 1:28 PM
 To: cf-talk
 Subject: Convert to number


 This is just plain stupid.

        Client enters:  100,000.00

 Formatting is:  $#NumberFormat(my_number,___.00)#

 Cold Fusion Says: Cannot convert  100,000.00 to number.

 I have to be brain dead. There is no way I should have to strip commas, so
 what stupid thing am I doing?  Just no seeing it right now.

 Thanks


 Robert B. Harrison
 Director of Interactive Services
 Austin  Williams
 125 Kennedy Drive, Suite 100
 Hauppauge NY 11788
 P : 631.231.6600 Ext. 119
 F : 631.434.7022
 http://www.austin-williams.com

 Great advertising can't be either/or.  It must be .

 Plug in to our blog: AW Unplugged
 http://www.austin-williams.com/unplugged



 __ Information from ESET Smart Security, version of virus signature
 database 5113 (20100513) __

 The message was checked by ESET Smart Security.

 http://www.eset.com




 

~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:333655
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: Convert to number

2010-05-13 Thread Barney Boisvert

Yes, . means any single character in RegEx - except within a character
class.  Inside character classes the metacharacters lose their meaning
(aside from a leading ^ for negation, backslash for escaping, and the
] to end the class).  So you don't need to escape the . in that
context.  Consider this code:

cfset s = 123.456\? /
cfoutput
#s#br /
#REReplace(s, [^0-9.], , all)#br /
#REReplace(s, [^0-9\.], , all)#br /
#REReplace(s, [^0-9\\.], , all)#br /
#REReplace(s, [^0-9\\], , all)#br /
/cfoutput

It will output this:

123.456\?
123.456
123.456
123.456\
123456\

The backslash to escape the period in the third line (your proposal)
is a no-op, because the period doesn't have special meaning to escape
from.

cheers,
barneyb

On Thu, May 13, 2010 at 10:41 AM, DURETTE, STEVEN J (ATTASIAIT)
sd1...@att.com wrote:

 Barney,

 Thanks for correcting my mistake.  One question though, shouldn't it be 
 REReplace(my_number, [^0-9\.], , all)?

 I thought that . meant any single character in RegEx.

 Thanks,
 Steve


 -Original Message-
 From: Barney Boisvert [mailto:bboisv...@gmail.com]
 Sent: Thursday, May 13, 2010 1:38 PM
 To: cf-talk
 Subject: Re: Convert to number


 That won't work, you'll get 100.00, not 10.00.  Try
 REReplace(my_number, [^0-9.], , all).

 cheers,
 barneyb

 On Thu, May 13, 2010 at 10:34 AM, DURETTE, STEVEN J (ATTASIAIT)
 sd1...@att.com wrote:

 Robert,

 You shouldn't have to strip it in a perfect world, but the comma makes it a 
 string not a number according to ColdFusion.

 Try this instead: $#numberFormat(val(my_number), __.00)#

 Might not work, I didn't test it.

 Steve


 -Original Message-
 From: Robert Harrison [mailto:rob...@austin-williams.com]
 Sent: Thursday, May 13, 2010 1:28 PM
 To: cf-talk
 Subject: Convert to number


 This is just plain stupid.

        Client enters:  100,000.00

 Formatting is:  $#NumberFormat(my_number,___.00)#

 Cold Fusion Says: Cannot convert  100,000.00 to number.

 I have to be brain dead. There is no way I should have to strip commas, so
 what stupid thing am I doing?  Just no seeing it right now.

 Thanks


 Robert B. Harrison
 Director of Interactive Services
 Austin  Williams
 125 Kennedy Drive, Suite 100
 Hauppauge NY 11788
 P : 631.231.6600 Ext. 119
 F : 631.434.7022
 http://www.austin-williams.com

 Great advertising can't be either/or.  It must be .

 Plug in to our blog: AW Unplugged
 http://www.austin-williams.com/unplugged



 __ Information from ESET Smart Security, version of virus signature
 database 5113 (20100513) __

 The message was checked by ESET Smart Security.

 http://www.eset.com








 

~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:333661
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: Loop through an array - with GROUPING?

2010-05-13 Thread Barney Boisvert

I'm not sure what you mean, but with a snip of Groovy you can group an
array's items into a structure with a key for each group.  Consider
this array:

cfset variables.people = [
 { name = barney, age = 29 },
 { name = kim, age = 30 },
 { name = holly, age = 33 },
 { name = emery, age = 4 },
 { name = lindsay, age = 6 },
] /

Let's group them by the decade of their life each person is in:

g:script
  variables.people = variables.people.groupBy { Math.ceil(it.age / 10) }
/g:script

The result will be equivalent to this:

cfset variables.people = {
  1 = [
{ name = emery, age = 4 },
{ name = lindsay, age = 6 }
  ]
  3 = [
   { name = barney, age = 29 }
  ]
  4 = [
{ name = kim, age = 30 },
{ name = holly, age = 33 }
  ]
} /

Now you have a nice grouped structure that you can iterate over.

The g:script tag is from CFGroovy
(http://www.barneyb.com/barneyblog/projects/cfgroovy2/) and requires
no installation beyond unzipping the archive and CFIMPORTing into the
g prefix (or whatever prefix you choose).

cheers,
barneyb

On Thu, May 13, 2010 at 9:21 PM, Les Mizzell lesm...@bellsouth.net wrote:

 I have an array set up sorta:

 cfset thisARRAY[#thisCOUNT#][1] = SECTION
 cfset thisARRAY[#thisCOUNT#][2] = id
 cfset thisARRAY[#thisCOUNT#][3] = title
 cfset thisARRAY[#thisCOUNT#][4] = stuff
 cfset thisARRAY[#thisCOUNT#][5] = other stuff
 cfset thisARRAY[#thisCOUNT#][5] = more stuff
 cfset thisARRAY[#thisCOUNT#][5] = even more stuff

 Is there a way to loop through this array, but GROUP by [#thisCOUNT#][1]
 (SECTION)?



 __ Information from ESET NOD32 Antivirus, version of virus signature 
 database 5113 (20100513) __

 The message was checked by ESET NOD32 Antivirus.

 http://www.eset.com



 

~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:333684
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: SQL Gurus... obtaining the correct Incremental ID

2010-04-28 Thread Barney Boisvert

Transactions, transactions, transactions.  Don't write another line of
SQL until you learn about transactions.

In this case it doesn't matter because @@identity is bound to the
active connection (and connections are single threaded), but you
should still be transactionally aware.

In addition to transactions, you can also do various types of locking
on the database to serialize access (exactly like CFLOCK), but they
obviously have performance and concurrency ramifications.
Transactions are typically a better way to solve it those types of
problems because their semantics are slightly different and can be
implemented in a more performant manner in most cases.

cheers,
barneyb

On Wed, Apr 28, 2010 at 10:51 AM, Che Vilnonis ch...@asitv.com wrote:

 When using set nocount on, select @@identity as xyz and set nocount
 off in a cfquery, how can I be certain that two transactions that occur at
 roughly the same time obtain the proper incremental id from an Identity
 column? Is their a SQl equivalent to CF's cflock tag?

 Thanks, Che



-- 
Barney Boisvert
bboisv...@gmail.com
http://www.barneyb.com/

~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:333187
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: sql method in cfcatch

2010-04-28 Thread Barney Boisvert

The error you're catching might not have those properties.  For
example, maybe it's a connection failure error.  Or perhaps an
expression error in a CFQUERYPARAM.  Those keys will be present when
appropriate, but they're not necessarily available all the time.  As
such, you have to do existence checks before you use them.

cheers,
barneyb

On Wed, Apr 28, 2010 at 1:11 PM, fun and learning
funandlrnn...@gmail.com wrote:

 Hi All -

 I am using try/catch around a cfquery. When I am trying to output 
 #cfcatch.sql# or #cfcatch.where#, I get an error that SQl or where is 
 undefined in cfcatch. These two used to work for me before. I have no issues 
 with cfcatch.message or cfcatch.detail.

 Can anyone let me know what could be the issue?



 

~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:333197
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: Not so simple date format question...

2010-04-27 Thread Barney Boisvert

s = 20100420;
mid(s, 5, 2)  /  right(s, 2)  /  left(s, 4);

cheers,
barneyb

On Tue, Apr 27, 2010 at 8:32 AM, Che Vilnonis ch...@asitv.com wrote:

 I'm working with an accounting database that stores order dates as a varchar
 (8) field. An example would be 20100420.
 Obviously, CF's dateformat chokes when used.

 Short of using a bunch of cfset statements with CF functions, how can I (in
 SQL preferrably or CF) easily format this string to 04/20/2010?

 Thanks, Che




 

~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:333154
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: CFEclipse and dynamic snippets

2010-04-13 Thread Barney Boisvert

Eclipse (via a plugin) supports JavaScript scripting of the IDE, so
you can get some of this behaviour.  It's not snippet-centric, which
makes snippets harder, but lets you do anything you want (e.g., bulk
edit files).

I can't remember the name of the plugin off hand, but Google should
turn it up.  It might even be part of the core by now.

cheers,
barneyb

On Tue, Apr 13, 2010 at 10:08 AM, Michael Christensen mich...@strib.dk wrote:

 I love snippets in Eclipse and they save me a bunch of keystrokes every day...

 But surely I can't be the only one longing for a bit more (dynamic) 
 functionality in snippets? In good ol' HomeSite+ you could do snippet-like 
 behavior which you coded in VBScript - that meant if/then, loops etc. which 
 processed stuff before inserting into your code.

 Anyone know if something like that can be accomplished in Eclipse?

 

~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:332866
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: CFEclipse and dynamic snippets

2010-04-13 Thread Barney Boisvert

Sorry, I don't know.  A quick Googling
(http://www.google.com/search?q=scripting+eclipse) turned up a pair of
projects:

Eclipse Monkey:
http://www.brain-bakery.com/projects/articles/eclipse-monkey-scripting/
Eclipse Shell: http://eclipse-shell.sourceforge.net/

The former is the one I was thinking of, I believe, and it looks like
it has made it's way into the main Eclipse ecosystem.

cheers,
barneyb

On Tue, Apr 13, 2010 at 10:15 AM, Michael Christensen mich...@strib.dk wrote:

 That does sound promising - any more info you could give me?

 

~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:332868
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: Easy application question

2010-04-12 Thread Barney Boisvert

Only a single Application.cfm file (note the capital 'A') will be run
for a single request.  CF will look up the directory tree until it
finds one, but it will stop it's search at the first one encountered.
If you want to chain Application.cfm files as you propose, simply use
CFINCLUDE to grab the parent one:

cfinclude template=../Application.cfm /

Unfortunately, Application.cfc is becoming a requirement for building
CF applications, so you should switch to that.  It has a host of
problems, but it's also the only way to get certain functionality with
CF (ORM, default datasource, code-based mappings, etc.).  Hopefully
Adobe will change that, but it seems unlikely.  Railo, by contrast,
lets you use the full functionality without forcing you into
Application.cfc and all the problems it provides.

cheers,
barneyb

On Mon, Apr 12, 2010 at 7:01 AM, Brian Bradley bbrad...@plrb.org wrote:

 I think I misunderstand how to use application.cfm files.  I have a 
 application.cfm file on the root and I set a group of session variables.  I 
 have a folder off the root named products with an application.cfm file in it. 
  It was my understanding that the root application.cfm would take precedence 
 to the subfolder's application.cfm and could share variables to the 
 application.cfm like it could any page in that folder.  But when I call a 
 variable in the sub application.cfm file to the higher level application.cfm, 
 I get variable is undefined error.  Is that just not possible to share 
 variables among application.cfm files even if they are hierarchically below a 
 higher application.cfm file or am I doing something else wrong?

 

~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:332839
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: Easy application question

2010-04-12 Thread Barney Boisvert

The primary issue is that it couples your persistence layer (default
datasource and ORM) your business layer (mappings) and your front
controller (events) into a very inflexible one-to-one-to-one
structure.  You can't have multiple frontends for a single ORM
persistence layer, for example.  You also can't have a single frontend
backed by mutliple Hibernate SessionFactories.

Then there are some implementation problems, the biggest one being
that you don't have access to the application scope when you're
defining the this.XXX variables.  That means if you're setting them
dynamically you can't rely on an application-scope cache, you have to
store your per-application configuration in the server scope.  But
there isn't any sort of event for that, so you end up jumping through
all kinds of hoops to deal with the arcane timing of the
Application.cfc psuedoconstructor because that's the ONLY place you
can define settings.

It's enormously better with the CFAPPLICATION tag, because you can run
that anywhere you want.  Even better, Railo lets you run the
CFAPPLICATION tag multiple times, so you can run it once to get your
application scope, and then run it again to set up mappings/default
dsn/whatever.  That's really powerful.

So it's not really Application.cfc itself, it's more that Adobe has
piggybacked so much functionality on top of Application.cfc that
really doesn't belong there.  The event handler structure is quite
beneficial, don't get me wrong, but they've tried to make
Application.cfc the be all/end all place for everything, and it really
paints you into a corner with complex applications/deployments.
Application refers to a lot of different things in the Adobe
parlance, and they've squished them all into a single container.

cheers,
barneyb

On Mon, Apr 12, 2010 at 8:35 AM, Cutter (ColdFusion)
cold.fus...@cutterscrossing.com wrote:

 Barney,

 Not to pick a fight, but what problems do you see with using
 Application.cfc? I, personally, find it to be a much better solution, so
 I am curious about your misgivings...

 Steve Cutter Blades
-- 
Barney Boisvert
bboisv...@gmail.com
http://www.barneyb.com/

~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:332842
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: Eclipse search question

2010-04-10 Thread Barney Boisvert

Hit CTRL-H, and then pick your search scope/context near the bottom of
the dialog (project, workspace, selected files/folders).  You can also
use the Search menu to do it.

cheers,
barneyb

On Sat, Apr 10, 2010 at 8:36 PM, fun and learning
funandlrnn...@gmail.com wrote:

 Hi,

 Is there a way in Eclipse (I am using CFEclipse) to search for something in 
 the entire project folder. I see that option of searching the entire folder 
 in Dreamweaver, but not in eclipse unless I am missing something. Can any one 
 please clarify this?

 Thanks.

 

~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:332823
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: CFDocs

2010-04-08 Thread Barney Boisvert

Eric, you can use the function category dropdown if you want to
filter that way instead of enter the text it starts with.

cheers,
barneyb

On Thu, Apr 8, 2010 at 8:01 AM, Eric Cobb cft...@ecartech.com wrote:

 I like http://coldfusiondocs.com/app/, it has both ACF and Railo
 (although CF 9 stuff isn't there yet).

 I've found that cfquickdocs is not accurate when doing broader lookups.
 For example, if you search for array, you'll see it only brings back
 items that start with array.  Things like isArray, ListToArray,
 etc..., are not listed in cfquickdocs, but they are in
 coldfusiondocs.com and cfmldocs.com.

 Just being picky...

 thanks,

 eric cobb
 http://www.cfgears.com



 Paul Kukiel wrote:
 There is also http://www.cfmldocs.com which also has an offline AIR app.

 Paul
 http://blog.kukiel.net


 On Apr 8, 2010, at 2:31 AM, Dave Sueltenfuss wrote:


 Does anyone know if the creator of cfdocs.org has plans to update the site
 to use the latest versions of CF Documentation
 It's still pointing to CF7'd documents







 

~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:332770
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: CFDocs

2010-04-07 Thread Barney Boisvert

cfquickdocs.com is a similar concept and it has modern docs.  I'd
imagine cfdocs.org was probably abandoned if it's that old, quite
likely because cfquickdocs is around now.

cheers,
barneyb

On Wed, Apr 7, 2010 at 9:31 AM, Dave Sueltenfuss dsueltenf...@gmail.com wrote:

 Does anyone know if the creator of cfdocs.org has plans to update the site
 to use the latest versions of CF Documentation
 It's still pointing to CF7'd documents


 

~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:332712
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: Is ColdFusion request speed based on CPU clock speed alone?

2010-04-07 Thread Barney Boisvert

CF request are single threaded, so they can only use a single core at
a time.  Decent DB software will parallelize across multiple cores
(and processors) if available.  Second, the instruction set that the
JVM converts your bytecode to is probably not going to leverage any
new functionality that might be available in a newer-gen processor, so
unless they've made changes to the way basic instructions are
implemented on-die, a newer gen chip isn't going to help.

So yeah, for the question you're asking, CPU clock speed is the
primary determinant.  In real life you typically have concurrent
requests, in which case those extra cores will help (since you can run
a request per core).

cheers,
barneyb

On Wed, Apr 7, 2010 at 1:38 PM, John Foster jfos...@turbosquid.com wrote:

 I'm running ColdFusion8 on Windows 2003 x32 bit machines. From my research It 
 appears that CF request speed is directly correlated to CPU clock, not number 
 of cores, cache, or bus speed.

 Here are the average page load times from a group of test pages on 3 
 different machines:

 2x single core opteron 246 (2Ghz / core):  251ms
 2x Dual core Xeon 5160 (3Ghz / core):  196ms
 2x Quad core Xeon 5540 (2.53Ghz / core):  261ms

 I would have expected the Xeon 5440 to process requests the fastest, but 
 that's not the case.  We're running database servers on similar Xeon 5540 
 machines and the SQL performance on those boxes if far better that what we 
 would get with the Opteron's or Xeon 5160's.

 Does anyone know why requests run on the older generation xeon 5160 would be 
 20% faster than the current generation 5540?  Is the speed of a ColdFusion 
 app purely based on clock speed in anyone elses experience?

 Thx,

 John

-- 
Barney Boisvert
bboisv...@gmail.com
http://www.barneyb

~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:332727
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: Is ColdFusion request speed based on CPU clock speed alone?

2010-04-07 Thread Barney Boisvert

The instruction width doesn't change the number of instructions you
can run at any given time.  Certain operations can be done more
efficiently (for example, adding small numbers can be done
in-instruction, rather than having to load stuff into registers
first), but in general it's not going to matter.  You're not going to
magically get parallelism with 64-bit.

And it has nothing to do with Java (or at least very little).
Servicing an HTTP request is pretty much a top-to-bottom procedure,
there isn't a way to easily divide it up into bits of work that can be
run in parallel.  But since HTTP servers are typically servicing
multiple concurrent requests, the overhead of trying to parallelize a
single request is hugely outweighed by simply parallelizing separate
requests.  If you've got a multicore, multiprocessor machine, it's
exceptionally unlikely you're going to be one request at a time, so
trying to optimize that use case is of little value.

To go back to your original scenario.  If 1 request to your machine
with the 5540s takes 261ms, then I'd expect 16 simultaneous requests
to also take about 260ms.  The cores/processors will allow those 16
requests to all run in parallel with all the CPU they can use.
Contrast this with your 5160s, which can run 1 request in 196ms, but
should take around 392ms to service those same 16 concurrent requests
(because it can service 8 at a time, so the second 8 wait while the
first 8 are processed, and then they get some CPU).  And it's probably
actually worse than that because unless you have your JVM/CF tuned to
your request load there will probably be context switches between
threads so you'll loose a bit of efficiency trying to run 16 requests
on 8 execution threads.

cheers,
barneyb

On Wed, Apr 7, 2010 at 2:41 PM, John Foster jfos...@turbosquid.com wrote:

 Do you think a 64 bit OS or CF9 would allow my apps to better utilize newer 
 CPU's , or would I still be bottlenecked by java to a single thread / request?

 

~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:332739
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: java.lang.String as a structure with members

2010-04-05 Thread Barney Boisvert

cfset t1 = #Trim(t1.Team)#

you're setting t1 equal to a string, so it's no longer a recordset.

cheers,
barneyb

On Mon, Apr 5, 2010 at 12:33 PM, Rick Sanders c...@webenergy.ca wrote:

 I've done this a dozen times before, and now the following code gives me
 this error:

 You have attempted to dereference a scalar variable of type class
 java.lang.String as a structure with members.



 This is the line throwing the error:

 cfset logo1 = #Trim(t1.Logo)#



 The logo being pulled from the database is just the image name logo.jpg



 cfquery name=Games datasource=hockey

 SELECT Team1, Team2, GameDate, GameTime, Location, Comments FROM Games where
 (GameID=#url.gameid#)

 /cfquery

 cfset team1 = #Games.Team1#

 cfquery name=t1 datasource=hockey

 SELECT Team,Logo FROM Teams WHERE (TeamID=#team1#)

 /cfquery

 cfset t1 = #Trim(t1.Team)#

 cfset logo1 = #Trim(t1.Logo)#



 Thanks,



 Rick

 Webenergy

 www.webenergy.ca






 

~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:332594
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: Best way to return generated html from cfc

2010-04-05 Thread Barney Boisvert

Yep, that's exactly the way to do it.

cffunction returntype=string
cfset var stuff =  /
cfsavecontent variable=stuff
  ... blah bla blah ...
/cfsavecontent
cfreturn stuff /
/cffunction

cheers,
barneyb

On Mon, Apr 5, 2010 at 4:22 PM, Matthew Smith chedders...@gmail.com wrote:

 I have a cfc that will generate some html to be displayed inline.  I was
 just going to reuturn a string rather than have it output directly.  Is this
 the proper way to do that?

 How do I save generated html from cf code into a variable to be returned as
 a string?

 Thanks.

-- 
Barney Boisvert
bboisv...@gmail.com
http://www.barneyb.co

~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:332604
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: Custom search engine

2010-03-26 Thread Barney Boisvert

MySQL has decent (not stellar, not terrible) FULLTEXT indexing
capabilities.  It's not going to give you web indexing, just database
indexing, but that might be sufficient if the content to search is
simple and stored the right way.  If you wanted to go really low tech,
you could use wget to spider the site and load the pages into a MySQL
database to do FULLTEXT searches against.

Note that I don't consider this anything even approaching a good
solution, but it IS a potential solution since it appears that
many/most of the good ones have been ruled out.

cheers,
barneyb

On Fri, Mar 26, 2010 at 2:05 PM, Dave Burns cft...@burnsorama.com wrote:

 I have a customer who would like a search function for his web-site but does 
 not want to use Google's custom search service. They use shared hosting 
 (CrystalTech) that does not offer Verity or Solr (I believe this is true but 
 am confirming with them).

 Given those constraints, does anyone here know of an alternative? I 
 understand the complexity of the problem so I'm not 100% surprised I've found 
 nothing with a little Googling around.

 Thanks,
 Dave


 

~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:332350
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: CFThread limitations with CF9 Standard vs Enterprise

2010-03-25 Thread Barney Boisvert

I'm pretty sure in CF8 the limitation is 1 on standard, not 10.  The
default max concurrent threads setting in the CF Administrator is
10, but that's irrelevant on standard, since it's hard-capped at 1.

cheers,
barneyb

On Thu, Mar 25, 2010 at 10:43 AM, Judah McAuley ju...@wiredotter.com wrote:

 Wow, that is a big change. The limit is 10 in CF8 standard. I'm sure
 glad I haven't upgraded my production app to CF9 and going the Railo
 route instead for thread happiness. I just wanted to get past the 10
 thread limitation, never expected it to drop down to 2.

 Cheers,
 Judah

 On Thu, Mar 25, 2010 at 9:23 AM, James Holmes james.hol...@gmail.com wrote:

 CFTHREAD is limited to two additional spawned threads in Standard edition.

 http://www.adobe.com/products/coldfusion/pdfs/cf9_feature_comparison_matrix_ue.pdf

 mxAjax / CFAjax docs and other useful articles:
 http://www.bifrost.com.au/blog/


 On 25 March 2010 23:07, Che Vilnonis ch...@asitv.com wrote:


 Back when CF8 was released, there were discussions about cfthread and
 limitations when using CF8 standard edition vs. the enterprise edition.
 Does
 anyone know if anything has changed with cfthread in CF9 between the two
 versions?

 Thanks, Che







 

~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:332273
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: Repeating Data - Unsure of my use of cfquery

2010-03-15 Thread Barney Boisvert

Your second query is the problem, both the repeating data and the
slowness.  You have a full outer join of five tables, which is not
what you want.  You need inner joins.  Here is a simple reference that
might help you on your way:

http://www.sql-tutorial.net/SQL-JOIN.asp

Has a million reference to other pages that might help.

If you get that query sorted you should be all set.

cheers,
barneyb

On Mon, Mar 15, 2010 at 6:21 AM, Steven Sprouse sspro...@ccboe.com wrote:

 My Code: (link to live page - 
 http://www2.ccboe.com/summeracademy/app/emp/index.cfm)

 cfquery name=getSchools datasource=filemaker_schools

 SELECT SchNum, SchoolBrief
 FROM SCHOOLS
 ORDER BY SchoolBrief

 /cfquery

 cfquery name=getSrastaff datasource=filemaker_srmastaff

 SELECT ApplySubject, ApplySchool, School, ApplyPosition, YrsPartic, TshirtSize
 FROM ApplySchoolList, SRAStaff, ApplySubjectGrList, YrsParticList, 
 TshirtSizeList
 ORDER BY School

 /cfquery

 form name=form1 method=post action=/summeracademy/app/app_process.cfm

        table width=100% cellpadding=2 cellspacing=2 border=0

        tr

                td colspan=4 bgcolor=dceaf3h4Contact and Payroll 
 Information:/h4/td

        /tr

        tr

                td valign=topbApplicant Name:/b/td
            td valign=topFirst: input name=First type=text/td
            td valign=topLast: input name=Last type=text/td
            td valign=topMI: input name=MI type=text/td

        /tr

        tr

                td valign=topbEmployee ID:/b/td
            td colspan=3 valign=topinput name=EmpID type=text 
 maxlength=6/td

        /tr

        tr

                td valign=topbCurrent Regular School:/b/td
            td colspan=3 valign=topselect name=CurrentSchool size=1
                                                                        
 option selected=selected value=0Select your school/option
                                                                               
          cfoutput query=getSchools
                                                                               
          option value=#getSchools.SchoolBrief##getSchools.SchoolBrief#br 
 //option/cfoutput

            /select/td

        /tr

        tr

                td valign=topbCurrent Grade and/or Subject that you 
 teach:/b/td
            td colspan=3 valign=topinput name=CurrentSubjectorGr 
 type=text/td

        /tr

        tr

                td valign=topbPhone Numbers:/b/td
            td valign=topHome: input name=PhoneHome type=text/td
            td colspan=2 valign=topCell: input name=PhoneCell 
 type=text/td

        /tr

        tr

                td valign=top /td
            td valign=topWork: input name=PhoneWork type=text/td
            td colspan=2 valign=topIP Phone ext.: input 
 name=Voicemail type=text/td

        /tr

        tr

                td valign=topbAddress:/b/td
            td colspan=3 valign=topStreet: input name=Address 
 type=textbr
                                                                               
  City: input name=City type=text State: input name=State 
 type=text Zip: input name=Zip type=text/td

        /tr

         tr

                td valign=topbEmail:/b/td
            td colspan=3 valign=top input name=Email type=textbr
                                Please type this carefully so that we can 
 reach you. There are no spaces in an email address./td

        /tr

        tr

                td colspan=4 bgcolor=dceaf3h4Application Information 
 for Summer Academy 2010:/h4/td

        /tr

        tr

                td valign=topbWhat position are you applying 
 for:/b/td
            td colspan=3 valign=top select name=ApplyPosition 
 size=1
                                                                        
 option selected=selected value=0Select a position/option
                                                                               
          cfoutput query=getSrastaff
                                                                               
          option 
 value=#getSrastaff.ApplyPosition##getSrastaff.ApplyPosition#/option/cfoutput

            /select/td

        /tr

        tr

                td valign=topbWhat school would you prefer?/b/td
            td colspan=3 valign=top select name=ApplyPosition 
 size=1
                                                                        
 option selected=selected value=0Select a school/option
                                                                               
          cfoutput query=getSrastaff
                                                                               
          option 
 value=#getSrastaff.School##getSrastaff.School#/option/cfoutput

            /select/td

        /tr

        tr

                td valign=topbIf you do not get your preferred school, 
 mark where you are willing to work:/b/td
            td colspan=3 valign=top cfoutput query=getSrastaffinput 
 name=SchoolApplyOther type=checkbox 

Re: listgetat problem...

2010-03-15 Thread Barney Boisvert

The CSV format is not a comma-delimited list per line.  It's richer
than that.  So you can't just use the list functions on it, you need
an actual CSV parser.  One isn't hard to write (and there are several
valid approaches), but the easiest course of action is to just grab
one that is already written.  I've used
http://ostermiller.org/utils/CSV.html on a few occasions with great
success.  It's Java and token-based, but it's simple enough.

cheers,
barneyb

On Mon, Mar 15, 2010 at 11:31 AM, Les Irvin les.cft...@gmail.com wrote:

 Hi all -

 I'm trying to (unsuccessfully) import a comma delimited text file
 (from an MLS service) into a MySQL db and looping over the file using
 listgetat in this manner:

 ...
 '#listgetAt('#index#',4, ',')#',
 '#listgetAt('#index#',5, ',')#',
 '#listgetAt('#index#',6, ',')#'
 ...

 I'm suspecting that the format of the text file is breaking my code.
 Here's a sample of the text file.

 RES,A,AUN,776082,877,,ST,RACINE,HOFFMAN
 TOWN,80011,3,2,RES,1051,,,KELLER WILLIAMS REALTY
 LLC,CHARMING RANCH STYLE HOME, 3 BEDROOMS, 2 FULL BATHS, CONCRETE
 EXTENDED DRIVEWAY (ISSUES), NO FHA !!,5AURO,1681,

 Note that text items have quotes around them and number items don't.
 Also, text items can and do include commas within.  Am I improperly
 using the listgetat function?  If so, how can I rewrite it to get
 around these issues?

 Many thanks in advance,
 Les

 

~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:331765
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: how to maintain source code

2010-03-14 Thread Barney Boisvert

Version control software.  Always use it.  If the company doesn't want
to use it, that's their [idiotic] prerogative, but there is no reason
you can't with a local server.

Subversion is trivially easy to set up a repository whatever your OS
(download and install free binaries).  The cool kids are apparently
using Git (I use Subversion) which doesn't need a repository, though
my experience is that the GUI tools are rather lacking.

In any case, version control shouldn't be a problem, even if it's just
a personal setup.  But really, if you're working somewhere that
doesn't want to use version control it seems like finding a different
place to work might be a good idea.  There is a reason there are so
many systems and it's a constant topic of discussion: it's REALLY
important.  If not even more important.

cheers,
barneyb

On Sun, Mar 14, 2010 at 7:19 PM, fun and learning
funandlrnn...@gmail.com wrote:

 Hello All -

 Have any of you faced a situation where the place you work does not have a 
 version control software, and in that case what are the best way to maintain 
 code files on your development machine?

 Thanks.

 

~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:331734
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: replacement for ionic rewriter on 64 bit

2010-03-14 Thread Barney Boisvert

How does running IIS in 32-bit mode affect your CF?  Just run a 32-bit
IIS and have it front your 64-bit CF, right?  Or were you going 64-bit
specifically for IIS?

Or even better, drop IIS for Apache.  :)  Where we still have Windows
at work, we use Apache exclusively.  It works like a champ.  And yes,
on public-facing, high-load sites, both CF and PHP.

cheers,
barneyb

On Sun, Mar 14, 2010 at 8:12 PM, Michael Dinowitz
mdino...@houseoffusion.com wrote:

 I've been tweaking the configurations for a 64 bit install of CF on
 win 2003 running iis 6. I tried to put the latest Ionic ISAPI onto the
 box and it fails in every instance. The suggested fix was to run IIS
 in 32 bit mode, which kills the reason I'm running 64 bit CF.

 What are people using instead of the Ionic rewriter? I don't want to
 lose the scripts I've already written.

 Thanks

 --
 Michael Dinowitz

 

~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:331736
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: Need Ajax Combobox

2010-03-12 Thread Barney Boisvert

jQueryUI has a pretty nice autocomplete widget that I use for most stuff:
http://jqueryui.com/demos/autocomplete/

I wrote this combobox 5-6 years ago (because there weren't any freely
available implementations that didn't suck) and though it predates
both jQuery and Prototype, still use it when jQueryUI's doesn't cut
the mustard:
http://www.barneyb.com/barneyblog/projects/combobox/

Both support local and remote completions.  Last time I checked you
have to hack the jQuery one if you want to send back rich options
(e.g., with embeded images).

cheers,
barneyb

On Fri, Mar 12, 2010 at 12:09 PM, sandeep saini sandeep00...@yahoo.com wrote:

 Hi,

 I need ColdFusion Ajax Combobox. I should be able to enter text and based on 
 that the options should populate dynamically.

 Thanks


 

~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:331706
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: using name of query in QofQ form custom tag

2010-03-12 Thread Barney Boisvert

You need to do this:

cfset myQuery = caller[attributes.query] /
cfquery dbtype=query name=caller.#attributes.query#
select * from myQuery
/cfquery

The first line pulls the query object from the caller scope down into
the current variables scope where the QofQ can successfully
dereference it.  If you'd like to preserve the original query name
(perhaps for nicer error messages), you can do it this way:

cfset variables[attributes.query] = caller[attributes.query] /
cfquery dbtype=query name=caller.#attributes.query#
select * from #attributes.query#
/cfquery

Note also the addition of caller. in the name attribute of the
CFQUERY tag, which you didn't explicit state you wanted, but judging
from the code, I suspect is the case.

cheers,
barneyb

On Fri, Mar 12, 2010 at 12:19 PM, Tony Bentley t...@tonybentley.com wrote:

 Okay here is what I am trying to do:

 tag:customtag query=testquery


 customtag:

 cfquery dbtype=query name=#attributes.query#
 select * from #attributes.query#
 /cfquery


 Obviously the name=#attributes.query# does not work.

 Any ideas?



-- 
Barney Boisvert
bboisv...@gmail.com
http://www.barneyb.com/

~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:331707
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: Two CFQUERY statements?

2010-03-11 Thread Barney Boisvert

You can happily query multiple databases within the same request; what
you can't do is query multiple databases within a single transaction.
So as long as your CFQUERY tags don't share a CFTRANSACTION block you
should be fine.

Can you post the actual error message?

cheers,
barneyb

On Thu, Mar 11, 2010 at 12:26 PM, Steven Sprouse sspro...@ccboe.com wrote:

 I have someone who has two separate databases and they want me to write a Web 
 form generating option menus from both databases.

 I have set up both as separate data sources in my Coldfusion administrator 
 and have included one cfquery at the head of my document generating a list of 
 locations. It's working fine. When I try to query the second database and do 
 a cfoutput for another option menu, I get errors.

 I seem to remember that it might not be possible to have two separate cfquery 
 statements in the same document. Is this correct? If so, how would I go about 
 achieving my desired result?

 

~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:331608
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: Pretty XML

2010-03-10 Thread Barney Boisvert

I've updated the UDF on my blog to deal with the
closing-tag-on-same-line issue, as well as submitted it to cflib.org.

cheers,
banreyb

On Sat, Mar 6, 2010 at 3:13 PM, Scott McAllister stmcallis...@gmail.com wrote:

 Got it! Thanks to all that replied and helped!

 Barney, I used your UDF and it worked as a fantastic starting point. The XML 
 displayed to the screen and was formatted almost perfectly. The one issue 
 that I had, which I think you mention in your blog post, was that it was 
 increasing the indent on every line until it came across a closing tag at the 
 start of a line.

 I added a fix that worked for my use case and would be more than willing to 
 share. As you mentioned in your blog post the Googles didn't really help when 
 I looked around for things. Have you ever thought of posting the UDF up on 
 Riaforge.org or cflib.org? I found it highly useful.

 Thanks again!

 -Scott

 

~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:331547
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: choosing a methodology

2010-03-10 Thread Barney Boisvert

If you like procedural, fb3lite is a extra-super-lightweight
combination of FB3 and FB5 that I built a few years ago.

http://www.barneyb.com/barneyblog/projects/fb3lite/

The framework is a whopping 72 lines long, but I use it for pretty
much everything I do, and after I used it for a couple projects at
work, it's pretty much taken over everything we do because of it's
simplicity.  It's unapologetically bare-bones, and only handles
front-controller responsibilities, but if that's what you're looking
for it's a great tool.

cheers,
barneyb

On Wed, Mar 10, 2010 at 10:14 AM, LRS Scout lrssc...@gmail.com wrote:

 Fusebox seems to be end of life what with FW/1 and Coldbox really being the
 frameworks to know now.  I'm certainly no FB hater.  I used it for years and
 was once an elected advisory board member.

 My personal preference is FW/1.  Lighter and less to learn than Coldbox.
 That being said these are not procedural frameworks and you're going to need
 to understand MVC and OO principles.


 -Original Message-
 From: Matthew Smith [mailto:chedders...@gmail.com]
 Sent: Wednesday, March 10, 2010 11:52 AM
 To: cf-talk
 Subject: chossing a methodolgy


 I've been coding CF for around 12 years now.  I've been using fusebox 3
 since it came out and love it.  I can do a site pretty quick with it and I'm
 very comfortable there.  So comfortable that I haven't looked any further.
  Not a good thing for growth.

 As I've grown as a developer, my applications have become more comlex, and
 the way some things are done in fusebox 3 feel a bit kludgy to me now.

 So, It's time to try something new.

 I tried fusebox 4 for a few days when it came out, couldn't get the basic
 app to work, and gave up.  I'm willing to give it another go, and noticed
 they are up to 5.5.1 now.  I'm considering investing the time to give it
 another try.

 The documentation link under Learning Fusebox for 5.5 is broken.  Only
 tutorials are for fusebox 4 and earlier.  The book is $40, a bit much I
 think.

 So, before I spend $40 and, even more valuable to me, time, any
 recommendations?  Is fusebox 5.5.1 worth it or should I go to something
 else?

 Thanks.




 

~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:331550
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: Stack overflow in self nested custom tag

2010-03-08 Thread Barney Boisvert

I haven't tested this, but I'd imagine that the CURRENT tag is on the
tag stack (as it is with exceptions).  Since getBaseTagData operates
on names rather than offsets/indexes, it's going to match the current
tag, and then return it's own data.  So lvData is pointing at one of
it's own scopes, which then has to be copied into lvData, and well you
can see the problem.

However, getBaseTagData accepts an optional second parameter for how
many matches it should find before returning, simply moving the , 2
to the right by one parenthesis will probably solve your problem.
Again, I haven't actually tested, but that's what I'd try first.

cheers,
barneyb

On Mon, Mar 8, 2010 at 11:12 PM, Chris Velevitch
chris.velevi...@gmail.com wrote:

 I'm using CF7.02 and I'm trying to create a custom tag that will be
 self nested, like:-

     cf_ct1
          cf_ct2
               cf_ct2
               /cf_ct2
          /cf_ct2
     /cf_ct1

 And in cf_ct2, I'm trying to get the data of the parent tag and
 assigning to a variable in the current tags state:-

     cfset lvData=GetBaseTagData(ListGetAt(GetBaseTagList(),2))

 But the assignment creates a stack overflow and I don't understand why?



 Chris
 --
 Chris Velevitch
 Manager - Adobe Platform Users Group, Sydney
 m: 0415 469 095
 www.apugs.org.au

 Adobe Platform Users Group, Sydney
 March 2010: ColdFusion Application Architecture for the Impatient and
 Using jQuery when Flash is Overkill
 Date: 29nd Mar 6pm for 6:30 start
 Details and RVSP on http://groups.adobe.com/posts/148c9056a4

 

~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:331455
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: Pretty XML

2010-03-05 Thread Barney Boisvert

I wrote this little UDF a couple years back to pretty-print XML.

http://www.barneyb.com/barneyblog/2008/05/01/indentxml-cf-udf/

cfoutput
pre#htmlEditFormat(indentXml(xmlStringToFormat))#pre
/cfoutput

On Fri, Mar 5, 2010 at 10:20 PM, Brad Wood b...@bradwood.com wrote:

 ToString(XmlParse(xmlString))

 This is redunant.  You just turned a string into an object, and back into a
 string again.

 XmlFormat(ToString(XmlParse(xmlString)))

 5 yard penalty for misuse of the xmlFormat function.  That function is
 designed to make a string safe for inclusion in an XML document without
 being confused with the XML markup of the document it is being included in.

 Try this:

 pre
    #xmlString#
 /pre

 If you want more control, htmlEditFormat it, and manually replace line
 breaks with br, spaces with nbsp; and tabs with
 nbsp;nbsp;nbsp;nbsp;nbsp; etc...

 ~Brad


 

~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:331406
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: sql on Linux

2010-03-03 Thread Barney Boisvert

From the error message, it appears that your login attempt is failing.
 Did you double check your username/password in the DSN settings?

cheers,
barneyb

On Wed, Mar 3, 2010 at 8:30 AM, Orlini, Robert rorl...@hwwilson.com wrote:

 I'm running CF7 on Linux and it won't connect to the datasources.

 It generates a Connection verification failed for data source: 
 status_internal_test
 []java.sql.SQLException: [Macromedia][SQLServer JDBC Driver][SQLServer]Cannot 
 open database requested in login 'wweb_status_internal_test'. Login fails.
 The root cause was that: java.sql.SQLException: [Macromedia][SQLServer JDBC 
 Driver][SQLServer]Cannot open database requested in login 
 'wweb_status_internal_test'. Login fails. error.

 How do I check the sql connection in Linux? I know windows, but am a bit weak 
 on Linux. Or is something else wrong?

 Thanks.

 RO
 HWW



 

~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:331310
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: chain variable setting

2010-03-01 Thread Barney Boisvert

A quick test indicates it's new in CF9.  Worth mentioning that it is
NOT treating the assignment as an expression, it is only allowing
multiple variables to be assigned to a single expression.  Your second
test case would fail regardless of which one CF was doing, but this
example also fails (meaning it's the latter):

cfset c=(b=a+1)+1

You can also use assignments in loop conditions.  I think Ben blogged
about that last summer.

cheers,
barneyb

On Mon, Mar 1, 2010 at 1:33 PM, Michael Dinowitz
mdino...@houseoffusion.com wrote:

 I think that I missed this in the docs. It seems that you can chain
 set variables

 cfset a=1
 cfset c=b=a+1

 This will give you a=1, b=2, c=2.

 On a related note, the following will fail

 cfset a=1
 cfset c=b+1=a+1

 The chain works as long as there is no operation except on the
 right-most item in the chain.

 This is all expected behavior in some other languages but I've never
 seen it in CF. Anyone know when it was added?

 Please make me look like a fool for missing it. :)

 --
 Michael Dinowitz




-- 
Barney Boisvert
bboisv...@gmail.com
http://www.barneyb.com/

~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:331227
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


Re: Time to patch the servers ...

2010-02-18 Thread Barney Boisvert

You can remove the servlet mappings from web-xml.  I suppose that's
technically editing configuration files manually, but everyone
already does that for RDS, so it's not that foreign.

cheers,
barneyb

On Thu, Feb 18, 2010 at 1:50 PM, Dave Watts dwa...@figleaf.com wrote:

 Ok, cool.  Thanks.  I have those turned off.  :-)

 You have remoting turned off? Are you sure? I don't recall an off
 switch for that, really - you have to edit configuration files
 manually to disable this if I recall correctly.

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

 Fig Leaf Software is a Veteran-Owned Small Business (VOSB) on
 GSA Schedule, and provides the highest caliber vendor-authorized
 instruction at our training centers, online, or onsi

 

~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:330897
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


Re: Total Two Field From Two Tables

2010-02-15 Thread Barney Boisvert

Just add:

(select count(*) from articles where zipcode = fddirectory.fdd_zip) as
articleCount

to the end of your SELECT clause:

SELECT  fddirectory.fdd_id, fddirectory.fdd_name, fddirectory.fdd_zip,
fddirectory.fdd_state, states.abrev
, (select count(*) from articles where zipcode = fddirectory.fdd_zip)
as articleCount
FROMfddirectory, states
WHERE   fddirectory.fdd_state = cfqueryparam value=#statecodeID#
cfsqltype=CF_SQL_VARCHAR
   AND fddirectory.fdd_state = states.abrev
ORDER BY fddirectory.fdd_name

That should do it for you,

cheers,
barneyb

On Mon, Feb 15, 2010 at 8:50 AM, Barry Mcconaghey bmcconag...@gmail.com wrote:

 Hello Everybody.

 I have been thinking and working on this for three days now. I'm looking for 
 some help totaling two fields from two tables.

 Here is what I have:

 Sample Tables:

 Table - fdd_directory

 fdd_name (Example: ACME Fire Dept)
 fdd_state (Example: PA)
 fdd_zip (Example: 12345)

 Table - states

 statecodeID  (Example: 111)
 abrev  (Example: PA)
 statename  (Example: Pennsylvania)

 Table - articles

 zipcode (Example: 12345)

 !---Here is what I have:---

 cfquery name=states datasource=#dsn#
    SELECT      count(fddirectory.fdd_id) AS FDCount, states.statename, 
 states.abrev, states.statecodeID
    FROM        fddirectory, states
    WHERE       fddirectory.fdd_state = states.abrev
    GROUP BY statename
    ORDER BY statename
 /cfquery

 cfoutput query=states
 a href=next.cfm?statecodeID=#abrev##states.statename# 
 (#NumberFormat(fdcount)#)/abr /
 /cfoutput

 So far, so good...

 Next.cfm

 cfquery name=Story datasource=#dsn#
 SELECT  fddirectory.fdd_id, fddirectory.fdd_name, fddirectory.fdd_zip, 
 fddirectory.fdd_state, states.abrev
 FROM    fddirectory, states
 WHERE   fddirectory.fdd_state = cfqueryparam value=#statecodeID# 
 cfsqltype=CF_SQL_VARCHAR
                AND fddirectory.fdd_state = states.abrev
 ORDER BY fddirectory.fdd_name
 /cfquery

 !---Here is where I would like to total articles.zipcode = 
 fddirectory.fdd_zip---

 cfoutput query=Story
 a href=next1.cfm?fdd_id=#story.fdd_id##story.fdd_name#/a (Total 
 Here)br
 /cfoutput

 Total Here should equal articles.zipcode = fddirectory.fdd_zip or the 
 number of article(s) from the articles table that match each fdd_name.

 For Example:

 ACME FD (Total 38)

 Thanks,

 Barry



 

~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:330742
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4


Re: Total Two Field From Two Tables

2010-02-15 Thread Barney Boisvert

What version of MySQL are you using?  If it's a really old one that
doesn't support subqueries, check out the MySQL docs.  They have a
section about rewriting subqueries into JOINs.

cheers,
barneyb

On Mon, Feb 15, 2010 at 9:16 AM, Barry Mcconaghey bmcconag...@gmail.com wrote:

 Thanks Barney B.

 ERROR Message:

 Syntax error or access violation: You have an error in your SQL syntax. Check 
 the manual that corresponds to your MySQL server version for the right syntax 
 to use near 'select count(*) from articles where zipcode = fddirectory.fdd_z

 Here is the cfquery:

 cfquery name=Story datasource=#dsn#
 SELECT  fddirectory.fdd_id, fddirectory.fdd_name, fddirectory.fdd_zip, 
 fddirectory.fdd_state, states.abrev, (select count(*) from articles where 
 zipcode = fddirectory.fdd_zip) as articleCount
 FROM    fddirectory, states
 WHERE   fddirectory.fdd_state = cfqueryparam value=#statecodeID# 
 cfsqltype=CF_SQL_VARCHAR
                AND fddirectory.fdd_state = states.abrev
 ORDER BY fddirectory.fdd_name
 /cfquery

Just add:

(select count(*) from articles where zipcode = fddirectory.fdd_zip) as
articleCount

to the end of your SELECT clause:

SELECT  fddirectory.fdd_id, fddirectory.fdd_name, fddirectory.fdd_zip,
fddirectory.fdd_state, states.abrev
, (select count(*) from articles where zipcode = fddirectory.fdd_zip)
as articleCount
FROM    fddirectory, states
WHERE   fddirectory.fdd_state = cfqueryparam value=#statecodeID#
cfsqltype=CF_SQL_VARCHAR
               AND fddirectory.fdd_state = states.abrev
ORDER BY fddirectory.fdd_name

That should do it for you,

cheers,
barneyb




 

~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:330745
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


Re: Total Two Field From Two Tables

2010-02-15 Thread Barney Boisvert

You just need a JOIN and GROUP BY clause.  Check out the
subquery-to-join docs on MySQL's site. They have examples of how to do
exactly what you want.

cheers,
barneyb

On Mon, Feb 15, 2010 at 11:19 AM, Barry Mcconaghey
bmcconag...@gmail.com wrote:

 I'm using MySQL 4.0.20.

 Is there any other way to total these two fields?

 Barry

What version of MySQL are you using?  If it's a really old one that
doesn't support subqueries, check out the MySQL docs.  They have a
section about rewriting subqueries into JOINs.

cheers,
barneyb


 

~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:330749
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


Re: how do I create a new file with cffile?

2010-02-11 Thread Barney Boisvert

Either the containing directory doesn't exist, or you (meaning the CF
server) doesn't have sufficient privileges to create a new file in
that location (because of filesystem ACLs).  Java doesn't delineate
between the two for security reasons, much like web apps return 404
for existing resources you don't have access to and have no way of
gaining access to.

cheers,
barneyb

On Thu, Feb 11, 2010 at 7:13 PM, Matthew Smith chedders...@gmail.com wrote:

 I am trying to save dynamic pages as static html with cffile.  I have the 
 html I want to write, but when I go to write it, I get:

 An error occurred when performing a file operation write on file 
 D:\inetpub\site\page.htm.
 The cause of this exception was: java.io.FileNotFoundException: 
 D:\inetpub\sitepage.htm (The system cannot find the path specified).

 The file does not exist.  I am trying to create a new file.


 

~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:330640
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


Re: IDE for coldfusion 9

2010-02-09 Thread Barney Boisvert

You have to specify which version of CF you're using on your project,
and if you upgraded, you'll still be set on CF8.  Not sure what the
default is, but it could well be CF8 as well, since CF9 is still lower
adoption.

cheers,
barneyb

On Tue, Feb 9, 2010 at 11:50 AM, Qing Xia txiasum...@gmail.com wrote:



  Can anyone tell me if there is a new CFEclipse plugin for Coldfusion 9?


 I am using CFEclipse plugin version 1.3.4.200906240705, which seems to be
 the latest version.  I noticed certain new CF9 tags, such as CFIMAP, are not
 recognized.


 

~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:330504
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


Re: IDE for coldfusion 9

2010-02-09 Thread Barney Boisvert

The default is in the global prefs (Windows  Preferences), and each
project has it's own setting the project properties.

cheers,
barneyb

On Tue, Feb 9, 2010 at 11:56 AM, Qing Xia txiasum...@gmail.com wrote:


 You have to specify which version of CF you're using on your project,
 and if you upgraded, you'll still be set on CF8.  Not sure what the
 default is, but it could well be CF8 as well, since CF9 is still lower
 adoption.



 Oh yeah, you are right Barney. My dictionary view is set to CF8. Trying to
 figure out how to update it to CF9 now...




-- 
Barney Boisvert
bboisv...@gmail.com
http://www.barneyb.com

~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:330506
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


Re: mod_rewrite issue on fusebox 5

2010-01-23 Thread Barney Boisvert

You need a slash at the front of your rule (and you DO need to escape
both the question mark and period):

RewriteRule ^/index.cfm\?fuseaction=test\.test$ bob.html

cheers,
barneyb

On Sat, Jan 23, 2010 at 12:23 PM, Matthew Gersting mgerst...@gmail.com wrote:

 Hey gang,
 Having an issue I was hoping someone might have an answer to.

 I have a mod_rewrite rule:

 RewriteRule ^index.cfm?fuseaction=test.test$ bob.html

 The problem is that this is not getting caught and rewritten, it's going 
 through to the Fusebox.  I've also tried escpacing the ? and the . both 
 alone and together (as below) without any luckany thoughts?

 RewriteRule ^index.cfm\?fuseaction=test.test$ bob.html
 RewriteRule ^index.cfm\?fuseaction=test\.test$ bob.html

 

~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:330074
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


Re: ORM question

2010-01-18 Thread Barney Boisvert

You should virtually never cache ORM-managed instances anywhere.
Their state MUST be managed by the ORM framework, or you run into all
kinds of crazy issues.  If you simply must cache one (a common-ish use
case is for business-level transactions where you need to keep
modified persistent instances around between requests), then you have
to explicitly deal with deattaching and reattaching the instance
to/from the ORM session in question.  It's a real mess.

But really, I'm pretty confident you'll be fine, and optimizing before
you've done load testing to indicate you aren't fine is a waste.

cheers,
barneyb

On Mon, Jan 18, 2010 at 10:22 AM, Victor Moore victor.mo...@gmail.com wrote:

 I think I will stick with one load per call and probably will end up
 saving it in the application scope so it's available
 in other places as needed.

 Thank you
 Victor



-- 
Barney Boisvert
bboisv...@gmail.com
http://www.barneyb.com/

~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:329762
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


Re: Difference between 3 tier architecture and MVC pattern

2010-01-18 Thread Barney Boisvert

MVC is a pattern for structuring your UI-layer code, while a three
tier architecture is about how your hardware is laid out.

MVC is about separating the request processing code from the state
(model) code and from the display (view) code. The three all worth
together to deal with a user interaction, but the pieces have distinct
roles and are typically best served to be segregated based on those
roles.

Three tier architecture is about physically separating your
presentation code (typically an MVC application) from your business
logic (typically a set of business objects) and your persistence layer
(a database) onto different hardware.  The advantages are that the
three layers can then scale independently and that they can have
different network security policies wrapped around them.

Fusebox is concerned with MVC, since it is a UI-layer code framework.

cheers,
barneyb

On Mon, Jan 18, 2010 at 11:34 AM, funand learning
funandlrnn...@gmail.com wrote:

 Hi All,

 I was trying to understand the concepts of fusebox and came across MVC
 design pattern, Can anyone please help me in understanding the difference
 between MVC and 3 tier architecture. I am confused as both are concerened
 with separation of layers?

 Thanks.



-- 
Barney Boisvert
bboisv...@gmail.com
http://www.barneyb.com/

~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:329767
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


Re: ORM question

2010-01-17 Thread Barney Boisvert

If you subCategories collections are relatively small, then you should
be safe to just loop over it and terminate after the third row.  Yeah,
you'll be getting more than you need back from the database, but
Hibernate is really good about optimizing data access for
relationships, so I'd assume it WON'T be a problem until you
demonstrate via load testing that it is.

No question, ORM is quite a departure from the normal SQL world.  It
can be hard to get into, but it's worth giving it a try.  Really.  The
payoffs in the maintenance phase are huge, because you're expression
your code at a much higher level than with SQL.

cheers,
barneyb

On Sun, Jan 17, 2010 at 10:44 AM, Victor Moore victor.mo...@gmail.com wrote:

 Hi Barney,

 After trying to find the answer to the question for almost a day I was
 afraid that the answer is no but just wanted to be sure :)
 The reason I want only a few is for display purposes. Just to give
 some indication to users the type of subcategories exists.

 While I like the idea of ORM, I'm afraid to use it in a heavy
 production environment because I don't really know the guts of it and
 may introduce problems that are hard to debug.
 I'm starting a new project and I'm on the fence. I'm just learning it
 and don't want to jeopardize it because my inexperience (with ORM)
 plus (at least initially) will take me more time to code than using
 direct SQL, I know SQL, it comes very easy to work with and (for the
 most part) I understand, can optimize and test it.

 Thanks

 Victor

 On Sat, Jan 16, 2010 at 11:58 PM, Barney Boisvert bboisv...@gmail.com wrote:

 The short answer is no.

 The long answer is that yeah, you can do a whole bunch of hacking
 around to make it work like that (or at least APPEAR to work like
 that), but it's a mess.  I can't think of a case when you wouldn't be
 better off a) just constraining the loop over the subcategories when
 you go to use them, or b) using a separate query for subcategoies
 rather than a relationship traversal.

 What's your reason for wanting to only get three?

 cheers,
 barneyb

 On Sat, Jan 16, 2010 at 8:49 PM, Victor Moore victor.mo...@gmail.com wrote:

 Hi,

 I have the following cfc:
 component output=false persistent=true entityname=Category
 table=category
 {
        property name=catID column=cat_id;
        property name=name ;
        property name=subCategories
                        fieldtype=one-to-many cfc=SubCategory 
 singularname=SubCategory
                        fkcolumn=cat_id cascade=all lazy=extra;

 }

 is it possible to retrieve only 3 subCategories when calling
 entityLoad (Category)?

 Thanks
 Victor





 

~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:329743
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


Re: ORM question

2010-01-17 Thread Barney Boisvert

lazy=proxy gives you N+1 behaviour for your collection.  That is, if
you need a Category and it's 10 subcategories, you'll end up doing 11
queries (one to retrieve each row individually).  Of course, if you
only use the category and three children you'll only run 4 queries.
But if you do an eager fetch of the subcategories (the default),
you'll run a single query.  Period.  Yes, it'll be wider, but it's a
single query and therefore avoids a significant amount of overhead.

I've done a number of projects with Hibernate, and if I've learned
anything, it's that second guessing Hibernate is usually the wrong
thing to do.  I don't know where those guys learned how to do their
jobs, but they are DAMN good at it.

cheers,
barneyb

On Sun, Jan 17, 2010 at 7:23 PM, Raymond Camden rcam...@gmail.com wrote:

 According to this posty,
 http://www.rupeshk.org/blog/index.php/2009/09/coldfusion-orm-performance-tuning-lazy-loading/,
 if you use lazy=proxy, you would only load the objects you use. So if
 you only displayed the first three, then only the first three would be
 loaded.

 On Sun, Jan 17, 2010 at 7:13 PM, Barney Boisvert bboisv...@gmail.com wrote:

 If you subCategories collections are relatively small, then you should
 be safe to just loop over it and terminate after the third row.  Yeah,
 you'll be getting more than you need back from the database, but
 Hibernate is really good about optimizing data access for
 relationships, so I'd assume it WON'T be a problem until you
 demonstrate via load testing that it is.

 No question, ORM is quite a departure from the normal SQL world.  It
 can be hard to get into, but it's worth giving it a try.  Really.  The
 payoffs in the maintenance phase are huge, because you're expression
 your code at a much higher level than with SQL.

 cheers,
 barneyb

 On Sun, Jan 17, 2010 at 10:44 AM, Victor Moore victor.mo...@gmail.com 
 wrote:

 Hi Barney,

 

~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:329745
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


Re: ORM question

2010-01-17 Thread Barney Boisvert

It does solve the problem, but has pretty significant performance  
implications in common use cases, which is why it's not the  
default.  Obviously it's hard to say what is best without seeing the  
code, but I'd say the default (just get them all) is probably best,  
unless the category tree is really broad.  Fetching a bit more data  
than you need with a single query is usually better than fetching  
exactly the right amount of data at really fine granularity with a lot  
of little queries.  The connection/query overhead is more expensive  
than the return data transfer.  Ideally you'd get both (exact right  
data in a single query), however since you use your objects in lots of  
different ways but only get to map them once, you have to generalize a  
bit.  Or you can make everything lazy and do all ops with HQL, which  
would be as perfect as SQL, but with all the downsides and more, so  
don't do that. :)

Sorry for how run-on that is.  Hard to do editing on the phone, so I  
just kind of streamed it out.

cheers,
barneyb

--
Barney Boisvert
bboisv...@gmail.com
http://www.barneyb.com/

On Jan 17, 2010, at 9:52 PM, Raymond Camden rcam...@gmail.com wrote:


 I'm confused - are you saying this _doesn't_ solve the problem - or
 has side effects if he doesn't use it as described? Or are you saying
 that it is best to just get em all at once?

 On Sun, Jan 17, 2010 at 10:19 PM, Barney Boisvert  
 bboisv...@gmail.com wrote:

 lazy=proxy gives you N+1 behaviour for your collection.  That is, if
 you need a Category and it's 10 subcategories, you'll end up doing 11
 queries (one to retrieve each row individually).  Of course, if you
 only use the category and three children you'll only run 4 queries.
 But if you do an eager fetch of the subcategories (the default),
 you'll run a single query.  Period.  Yes, it'll be wider, but it's a
 single query and therefore avoids a significant amount of overhead

 

~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:329747
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


Re: ORM question

2010-01-16 Thread Barney Boisvert

The short answer is no.

The long answer is that yeah, you can do a whole bunch of hacking
around to make it work like that (or at least APPEAR to work like
that), but it's a mess.  I can't think of a case when you wouldn't be
better off a) just constraining the loop over the subcategories when
you go to use them, or b) using a separate query for subcategoies
rather than a relationship traversal.

What's your reason for wanting to only get three?

cheers,
barneyb

On Sat, Jan 16, 2010 at 8:49 PM, Victor Moore victor.mo...@gmail.com wrote:

 Hi,

 I have the following cfc:
 component output=false persistent=true entityname=Category
 table=category
 {
        property name=catID column=cat_id;
        property name=name ;
        property name=subCategories
                        fieldtype=one-to-many cfc=SubCategory 
 singularname=SubCategory
                        fkcolumn=cat_id cascade=all lazy=extra;

 }

 is it possible to retrieve only 3 subCategories when calling
 entityLoad (Category)?

 Thanks
 Victor

 

~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:329736
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


Re: form.FieldNames

2010-01-07 Thread Barney Boisvert

I would expect the order to be the same as the order that the fields
are submitted to the server (which, in turn, should be the same as the
DOM order of the form elements), but if I wouldn't rely on that
behaviour.  If you need them in a specific order, best to order them
yourself on the server.  This is especially true if you have some sort
of non-HTML (or impure-HTML) interface, since any sort of dynamic
scripting (e.g. JavaScript) can potentially mutate the actual form
submission in an arbitrary way.

cheers,
barneyb

On Thu, Jan 7, 2010 at 8:17 AM, Chad Gray cg...@careyweb.com wrote:

 How is the order of the elements in #FORM.fieldNames# determined?  Could it 
 be different and not well structured?

 Like if I have a form with text inputs named foo1, foo2, foo3.

 Will #FORM.fieldNames# always be:

 Foo1,foo2,foo3?

 Or could it be ordered different?

 Thanks,
 Chad


 

~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:329462
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


Re: How to query encrypted password

2010-01-05 Thread Barney Boisvert

What you need to do is take the input password and encrypt it in the
same way that the database password was originally encrypted.  Then do
a string compare on the two of them.

Typically when you store passwords you don't encrypt them, you hash
them.  Encryption is symmetric; encrypted things can be decrypted.
Hashing is one-way; once something is hashed there is no way to get
back to the original, but you don't lose the identity of the original
(since a given input will always generate the same hash).  This makes
it perfect for passwords (though it is usually combined with salt to
prevent dictionary attacks).

cheers,
barneyb

On Tue, Jan 5, 2010 at 7:59 PM, Nathan Chen nathan.c...@cu.edu wrote:

 All:



 I need to query an Oracle user table where username and encrypted
 password are stored. I need to compare the user input password with the
 encrypted password in the table. Can the CF Decrypt function do the
 work? Can someone give me a pointer?



 Nathan



 

~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:329430
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4


Re: Loading an CSV

2009-12-22 Thread Barney Boisvert

Use a CSV parsing library, rather than rolling your own.  They take
care of all that stuff for you.  I've used
http://ostermiller.org/utils/CSV.html in the past.

If you really want to parse it yourself, you can use listToArray, and
then iterate over the array and combine items that are quoted.  For
example take this line:

1,barney,boisvert, \crazy man\, barney,1234 Main Street, Apt 5

When you listToArray it, you'll get this:

[
 '1',
 'barney',
 'boisvert',
 ' \crazy man\',
 ' barney',
 '1234 Main Street',
 ' Apt 5'
]

Note the position of the double quotes in the items.  What you need to
do is find items that START with a double quote, and then combine them
with the following elements until you find an element that ENDS with a
double quote.  You'll need to handle the case when the current item is
the whole string (in the case of the second element), and when the
ending quote is escaped (the forth item).

In this particular case you need to remove the quotes from item 2
(since it's a whole string to itself), and you need to combine items
3, 4 and 5 (3 starts with a quote, 5 ends with a quote).  The quotes
in item 4 are escaped, so they should be ignored for combination, and
then the backslashes should be removed after the fact.  Note that
you'll need to deal with double-escaping.  As you can see, it's a
mess, so I'd highly recommend the third-party library.  ;)

cheers,
barneyb

On Tue, Dec 22, 2009 at 8:51 AM, Phillip Vector
vec...@mostdeadlygame.com wrote:

 I have a CSV that looks like the following...

 3270,5101650,Dewey, Cheatum  Howe , 0   , 0   ,0.00,0.00,9.25,-9.25
 3270,5101650,Phillip Vector                , 34 , 3,161.00
 ,92.97,79.25,61.76,17.50
 3270,5101650,James P. Kardone JR., P.C.     , 0   , 0   
 ,0.00,0.00,9.25,-9.25

 I'm stuck on how to process the fields and load them into an array.
 How would I say, If the field is surrounded by quotes, then ignore
 the commas in it?

 I would think I would need to load it into the array as a field before
 I could find out if it's surrounded by quotes. But I can't load it
 correctly into the array until I find out if there are quotes around
 it.

 Changing the CSV is not an option (I know, it would make things much easier).

 Ideas?

 

~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:329313
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


Re: Loading an CSV

2009-12-22 Thread Barney Boisvert

Quoting is part of standard CSV, Ostermiller will take care of it.
But you don't need to loop over every character.  Once you have your
array, you start combining when you find an item that begins with a
quote, and you stop combining when you find an item that ends with a
quote.  In my example, item 2 both starts and ends with a quote, so,
and then item 3 starts with a quote, and item 5 ends with a quote,
which is why you combine 3-5.  The quotes in item 4 are escaped, but
you probably don't have any of those (at least your example didn't
illustrate any).

cheers,
barneyb

On Tue, Dec 22, 2009 at 9:21 AM, Phillip Vector
vec...@mostdeadlygame.com wrote:

 On Tue, Dec 22, 2009 at 9:09 AM, Barney Boisvert bboisv...@gmail.com wrote:

 Use a CSV parsing library, rather than rolling your own.  They take
 care of all that stuff for you.  I've used
 http://ostermiller.org/utils/CSV.html in the past.

 I took a look at that and didn't see anything that would be of help
 since it's not standard formatted that I can see.

 If you really want to parse it yourself, you can use listToArray, and
 then iterate over the array and combine items that are quoted.  For
 example take this line:

 1,barney,boisvert, \crazy man\, barney,1234 Main Street, Apt 5

 When you listToArray it, you'll get this:

 [
  '1',
  'barney',
  'boisvert',
  ' \crazy man\',
  ' barney',
  '1234 Main Street',
  ' Apt 5'
 ]

 Note the position of the double quotes in the items.  What you need to
 do is find items that START with a double quote, and then combine them
 with the following elements until you find an element that ENDS with a
 double quote.  You'll need to handle the case when the current item is
 the whole string (in the case of the second element), and when the
 ending quote is escaped (the forth item).

 In this particular case you need to remove the quotes from item 2
 (since it's a whole string to itself), and you need to combine items
 3, 4 and 5 (3 starts with a quote, 5 ends with a quote).  The quotes
 in item 4 are escaped, so they should be ignored for combination, and
 then the backslashes should be removed after the fact.  Note that
 you'll need to deal with double-escaping.  As you can see, it's a
 mess, so I'd highly recommend the third-party library.  ;)

 See, the issue is that there is no escaped quotes to show it's part of
 the field.

 3270,5101650,Dewey, Cheatum  Howe , 0 , 0 ,0.00,0.00,9.25,-9.25
 3270,5101650,Phillip Vector , 34 , 3,161.00
 ,92.97,79.25,61.76,17.50
 3270,5101650,James P. Kardone JR., P.C. , 0 , 0 ,0.00,0.00,9.25,-9.25

 So I'm not sure how to determine the end quote. I suppose I can set a
 flag if I have started with a quote and unset the flag when I
 encounter another quote... But I was hoping I didn't have to loop over
 every character to do it.

 

~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:329319
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


Re: ColdFusion could not delete the file

2009-12-07 Thread Barney Boisvert

If you just want to silently ignore, wrap with CFTRY..CFCATCH and
nothing in the CFCATCH.  Typically windows has this problem if another
process has the file open for some reason (or just hasn't cleaned up
it's handles).

cheers,
barneyb

On Mon, Dec 7, 2009 at 7:37 AM, Stefan Richter ste...@flashcomguru.com wrote:

 Hi all,
 what may be causing the following error and what - if anything - could I do 
 to prevent it? This is on a Windows server with CF8.
 ColdFusion could not delete the file C:\Inetpub\...\folder\file.ppt for an 
 unknown reason.

 This happens when I run
 cfdirectory action=delete directory=C:\Inetpub\...\folder recurse=yes

 Regards,

 Stefan





 

~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:328906
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


Re: ColdFusion could not delete the file

2009-12-07 Thread Barney Boisvert

procexp (Process Explorer) from sysinternals
(http://www.sysinternals.com/ or
http://live.sysinternals.com/procexp.exe) will let you browse open
handles on files and see what process(es) have them open.  I don't
know how to do it programatically (like from CF), but you might find a
command-line utility in the sysinternals package that you can run with
CFEXECUTE if you dig a bit.  There's all kinds of goodies in there.

cheers,
barneyb

On Mon, Dec 7, 2009 at 8:01 AM, Stefan Richter ste...@flashcomguru.com wrote:

 Thanks Barney,
 I'm already catching it. I was wondering if there's a way to force delete it 
 somehow - any process that is still hanging onto it would likely be CF or the 
 webserver. On the other hand, how can I find out what's holding onto it? I 
 know how to do this on OSX...


 Cheers

 Stefan



 On 7 Dec 2009, at 15:40, Barney Boisvert wrote:


 If you just want to silently ignore, wrap with CFTRY..CFCATCH and
 nothing in the CFCATCH.  Typically windows has this problem if another
 process has the file open for some reason (or just hasn't cleaned up
 it's handles).

 cheers,
 barneyb

 On Mon, Dec 7, 2009 at 7:37 AM, Stefan Richter ste...@flashcomguru.com 
 wrote:

 Hi all,
 what may be causing the following error and what - if anything - could I do 
 to prevent it? This is on a Windows server with CF8.
 ColdFusion could not delete the file C:\Inetpub\...\folder\file.ppt for an 
 unknown reason.

 This happens when I run
 cfdirectory action=delete directory=C:\Inetpub\...\folder 
 recurse=yes

 Regards,

 Stefan




 

~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:328909
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


Re: cflocation tag

2009-12-04 Thread Barney Boisvert

Do you have CFFLUSH above the CFLOCATION tag anywhere (like another
template or Application.cfm)?  Once you flush the page, you can no
longer do a CFLOCATION (or CFHEADER, CFCONTENT, etc.).

cheers,
barneyb

On Fri, Dec 4, 2009 at 11:27 AM, Mike Stromme gtrplayer5...@gmail.com wrote:

 Anyone ever have cflocation stop working.  It is happening on our MX7 test 
 server but works fine on our production MX7 server.  I created a test page 
 with just the cflocation tag with and without the addToken attribute and it 
 just stays on the test page.

 Thanks,
 Mike

 

~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:328874
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


Re: Date Compare Help

2009-11-29 Thread Barney Boisvert

Just change that EQ to LT and you'll be set.

On Sunday, November 29, 2009, m...@markleder.com m...@markleder.com
m...@markleder.com wrote:

 Hi all,
 Trying to do a date compare on a file datelastmodified (retrieved through 
 CFDirectory).
 If the file datelastmodified is older than 1 hour previous to Now, I want to 
 refetch the file.

 In other words, if the file is posted at 9:00 AM, if it's presently 10:05 AM, 
 I want to get a new file.

 Here's my attempt, but I can't get it to work right:

 DateCompare(dirname.DateLastModified, DateAdd(h, -1, Now())) EQ 0

 Thanks!

 Mark

 

~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:328743
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


Re: Round to the nearest .5 value

2009-11-25 Thread Barney Boisvert

Assuming 'n' is your number, use #round(n * 2) / 2#

For example:

3.21 * 2 == 6.42
round(6.42) == 6
6 / 2 == 3

3.31 * 2 = 6.62
round(6.62) == 7
7 / 2 == 3.35

cheers,
barneyb

On Wed, Nov 25, 2009 at 11:13 AM, Che Vilnonis ch...@asitv.com wrote:

 I'm trying to create a ratings system that shows 1/2 values. Quick
 question, what would be the easiest way to round a value to the nearest .5
 of a number? I'm trying to avoid multiple if/elses.

 i.e. 3.21 would round to 3
 i.e. 3.31 would round to 3.5
 i.e. 3.61 would round to 3.5
 i.e. 3.91 would round to 4

 Thanks, Che



 

~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:328687
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4


Re: Round to the nearest .5 value

2009-11-25 Thread Barney Boisvert

Oops, you're right, Ian.  That should be 7 / 2 == 3.5 (remove the
second three), of course.  I wonder who had coffee this morning and
therefore can't control his fine motor skills.  At least with a
computer your assertions are actually checked, so typos get caught.
:)

cheers,
barneyb

On Wed, Nov 25, 2009 at 11:32 AM, Ian Skinner h...@ilsweb.com wrote:

 Barney Boisvert wrote:
 7 / 2 == 3.35

 No it doesn't!  I suspect your typing thumbs, or is it your ring finger,
 is making you look like a bad mathematician! ;-)



-- 
Barney Boisvert
bboisv...@gmail.com
http://www.barneyb.com

~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:328694
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


Re: Selecting everything in a string up to a point....

2009-11-18 Thread Barney Boisvert

cfset html = REReplace(html, '^(.*?img[^]+header.jpg[^]*).*', '\1') /

I think that'll do it, but I didn't actually test.  That says
starting at the beginning of the string, find everything until you
find the string img, followed by one or more characters excluding
, followed by the string header.jpg, followed by zero or more
characters excluding , and then replace the whole string with just
that part.

cheers,
barneyb

On Wed, Nov 18, 2009 at 1:43 PM, John Egbert
john.egb...@milestonetech.com wrote:

 Hey all!  I'm trying to capture all of the data up to a point in an HTML 
 document.  So for instance... there could be the htmlheadblabla bla 
 tags...and these could variate, but on every HTML doc there is a header 
 image.  img src=header.jpg or whatever.  I need to know how I can write a 
 string command to capture/select everything previous and including the header 
 image (or not including the header image...I really need to know how to do 
 both.)

 

~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:328500
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


Re: MySQL Limit

2009-11-16 Thread Barney Boisvert

select r.*, v.*
from (select resourceId from resources limit 100) r
inner join resourcesattributesvalues v on r.resourceId = v.resourceId

cheers,
barneyb

On Mon, Nov 16, 2009 at 4:49 PM, Agha Mehdi aghaime...@gmail.com wrote:

 I have three tables

 tableA Rresources (resourceID)
 tableB Attributes (attributeID, attributeName)
 tableC ResourcesAttributesValues (ravID, resourceID, attributeID, value)

 I need to apply MySQL Limit clause to get paginated dataset from row 1 -
 100/101-200/201-300 I'd like to run a single query to get 1-100...
 resources with all of their attributes and values.

 What is the most efficient way to do it?

 Thanks


 

~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:328448
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


Re: ColdFusion 9 runs slower as a WAR than as standalone

2009-11-16 Thread Barney Boisvert

Something to do with your CF configuration, I'd wager.  We run all our  
CF9 on Tomcat at work with no issues, so if your tomcat is soundly  
configured, I'd start with you CF config.  Or maybe you've got the bad  
JVM version with the classloader issues (though I'd expect that'd  
affect other apps as well)?

cheers,
barneyb

--
Barney Boisvert
bboisv...@gmail.com
http://www.barneyb.com/

On Nov 16, 2009, at 5:48 PM, J Boss dotfus...@changethings.org wrote:


 I have ColdFusion 9 installed standalone and the performance is  
 great. I also have it as a WAR file running on Tomcat 6, and it runs  
 much slower.

 Pages that take 100ms on the standalone server take 1000ms when CF  
 is running on Tomcat.

 My Tomcat instance is fine, as other WARs run just fine with optimal  
 performance.

 Anyone have any ideas about why this is happening and how I can  
 correct it?

 

~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:328453
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


Re: Deleting contents within a folder

2009-11-09 Thread Barney Boisvert

If you don't mind synchronizing, you can just delete the directory (as
you are now) and then recreate an empty one after you're done.
Otherwise you'll need to use CFDIRECTORY to get a list of the
contained files and delete them individually with CFFILE.

cheers,
barneyb

On Monday, November 9, 2009, Damo Drumm damien.dr...@quinn-group.com wrote:

 Hi
 Im trying to delete all the contents within a folder using coldfusion, but 
 its deleting the actual folder each time

 The contents of the folder contains be PDF's

 has anyone any tips on deleting the contents and not the actual folder

 Thanks

 

~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:328127
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


Re: custom tag content displaying twice

2009-11-04 Thread Barney Boisvert

just do cfset thisTag.generatedContent =  / in the end tag?

CF has to do one or the other (render the output or suppress the
output), and then provide a means to accomplish the other.  At least
from the perspective of the principle of least surprise, rendering the
output seems like the correct default choice.

cheers,
barneyb

On Wed, Nov 4, 2009 at 12:16 PM, Mik Muller ad...@montaguema.net wrote:

 Hmm having never made a custom tag with an open and close pair, I didn't 
 realize that the contained content will display twice.

 http://www.mail-archive.com/cf-talk@houseoffusion.com/msg29687.html

 No way around this?  It seems pretty stupid that CF wouldn't suppress the 
 initial output, leaving the responsibility of displaying the content to the 
 tag.

 Mik


 At 01:25 PM 11/4/2009, Michael Muller wrote:

Hey all

I'm trying to make a custom tag for cfmail so I can create a standard From, 
Subject, and HTML layout inside the email that is sent.

I have created the tag and am using the open / close method, but the content 
of the email winds up being displayed on the page, as well as being emailed. 
I'm using THIS.generatedContent inside the custom tag in the body of the 
cfmail tag, and have even tried wrapping the tag inside a cfsilent.

What am I missing?  How do I stop the body of the custom tag from displaying, 
or is that not possible.

Mik


cf_mailsend to=s...@address.comyadda yadda/cf_mailsend



cfsilent
cfswitch expression=#thisTag.ExecutionMode#

cfcase value=start
cfparam name=attributes.to default=
/cfcase

cfcase value=end
cfmail to=#trim(attributes.to)# subject=subject from=f...@address.com 
type=HTML
div style=padding:20px; margin:20px; border:2px solid blue;
#trim(thistag.generatedcontent)#
/div
/cfmail
/cfcase

/cfswitch
cfsilent



Michael Muller
office (413) 863-6455
cell (413) 320-5336
skype: michaelBmuller
http://MontagueWebWorks.com

Information is not knowledge
Knowlege is not wisdom

Eschew Obfuscation




 

~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:328041
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


Re: custom tag content displaying twice

2009-11-04 Thread Barney Boisvert

The custom tag isn't rendering the content again, YOU are rendering
the content again.  If you create an empty custom tag and invoke it,
you'll get a single copy of the output.  If you then add emitting of
the generated content in the custom tag, you'll get two copies.  So
building up from the nothing case, you can see that you should
expect double output if you're doing outputting explicitly.

The EM tag in HTML is rather different, because it's being interpreted
as a formatting directive, not executed as code.  A better example
would be CFQUERY, where the generated content (the SQL statement) is
not emitted to the page output.  If you were to reimplement a
simplistic CFQUERY, it might look like this (using some magic helper
functions for brevity):

cfif thisTag.executionMode EQ start
  cfparam name=attributes.dsn default=#application.dsn# /
cfelse
  cfset sql = thisTag.generatedContent /
  cfset thisTag.generatedContent =  /  !--- we don't want the SQL
emitted ---
  cfset result = runQueryOnDsn(attributes.dsn, sql) /
  cfif structKeyExists(attributes, name)
cfset caller[attributes.name] = result /
  /cfif
/cfif

cheers,
barneyb

On Wed, Nov 4, 2009 at 2:06 PM, Mik Muller ad...@montaguema.net wrote:

 Barney,

 Well, as I said, in this case the prinicple of least surprise would have 
 effused a behavior wherein the page calling the custom tag would not have 
 rendered the content, leaving that responsibility to the tag itself. In _my_ 
 mind, anyway. I mean, if the tag is supposed to receive the content, the 
 calling page really has no business rendering the content again.

 And not being able to stop it from being rendered again is a serious 
 drawback.  I mean, think of the lowly EM tag.  It takes the input and renders 
 the content in italics (or whatever). The browser doesn't then render the 
 content again UNitalicized, correct? It trusts the EM tag to take care of its 
 business. Isn't that the way a tag should work?

 I'll try your suggestion, below, but I've already gone the less elegant route 
 of using cfsavecontent around my content and pushing the resulting variable 
 as an attribute into the now-self-closing custom tag.

 Mik


-- 
Barney Boisvert
bboisv...@gmail.com
http://www.barneyb.co

~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:328053
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


Re: Child Threads

2009-10-28 Thread Barney Boisvert

It sounds like that's a sequential-parallel process, not a
parallel-parallel one?  I.e. you have to convert the PDF to image
before you can slice the image up, but you CAN post-process the images
in parallel.

Can you not do this (in psuedo-code)

imageArray = pdfToImage(myPdf);
threadArray = [];
for (image in imageArray) {
  threadArray.add(new thread(image) {
doStuffToImage(image);
  })
}
joinThreads(threadArray);

So you'll do the pdfToImage first, and then loop over each page's
image spawning a thread per page so they all process in parallel.

To answer your first question, if you use CFHTTP, you get a new
context.  The no-nesting limitation is within a single CFML request,
so if you initiate another request, you get a new (empty) threading
context.  Note that while this lets you spawn new threads, it means
you CAN'T interact with the original request's threads.

cheers,
barneyb

On Wed, Oct 28, 2009 at 12:32 PM, Stefan Richter
ste...@flashcomguru.com wrote:

 Thanks Barney.
 What may be a good workaround for the child threads problem? Could I
 hit another CFM script via cfhttp from within my first thread and have
 tat CFM spawn another thread, or is that still consider a child thread
 then?
 Basically I have 2 or 3 long running processes (image conversions and
 manipulations) which should be chained somehow. For example I need to
 first kick off a PDF to image conversion via cfpdf after a user
 uploads a file. After that process is complete I need to rename and
 sometimes cut up the generated images, or apply a different
 compression setting, resize them etc.
 Each step can take a few minutes.

 Yes I could use some sort of polling mechanism but that's not slick
 enough ;-)

 Cheers

 Stefan





 On 27 Oct 2009, at 22:46, Barney Boisvert wrote:


 No limit to threads on Enterprise Edition, but no CF edition allows
 child threads.  Total buzzkill.  Fortunately, with native threads can
 be leveraged with Groovy or JavaLoader's CFC-based dynamic proxies.
 Neither one is particularly elegant, but at least you can do it, since
 CF itself doesn't provide the tooling.

 cheers,
 barneyb

 On Tue, Oct 27, 2009 at 3:43 PM, Stefan Richter ste...@flashcomguru.com
  wrote:

 Quick question: does the CF Enterprise edition allow child threads?
 Also is there a limit of threads with that edition?

 Cheers

 Stefan





 

~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:327802
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


Re: Child Threads

2009-10-27 Thread Barney Boisvert

No limit to threads on Enterprise Edition, but no CF edition allows
child threads.  Total buzzkill.  Fortunately, with native threads can
be leveraged with Groovy or JavaLoader's CFC-based dynamic proxies.
Neither one is particularly elegant, but at least you can do it, since
CF itself doesn't provide the tooling.

cheers,
barneyb

On Tue, Oct 27, 2009 at 3:43 PM, Stefan Richter ste...@flashcomguru.com wrote:

 Quick question: does the CF Enterprise edition allow child threads?
 Also is there a limit of threads with that edition?

 Cheers

 Stefan



 

~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:327781
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4


Re: Unit Testing Frameworks

2009-10-26 Thread Barney Boisvert

MXUnit pretty much superceded CFCUnit.  CFCUnit is still viable, of
course, but MXUnit is certainly seeing a lot more activity, and is
pretty much the de facto standard for unit testing of CF apps.

cheers,
barneyb

On Mon, Oct 26, 2009 at 9:15 PM, Judith Dinowitz
jdino...@houseoffusion.com wrote:

 From what I can see, the last thing posted on the CFCUnit website is dated 
 2006. Is CFCUnit still a going concern? What Unit-Testing Frameworks are 
 people using in the CF community?

 Judith

 

~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:327741
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


Re: rotating cfchart

2009-10-21 Thread Barney Boisvert

Can you post a link that isn't secured?

On Wed, Oct 21, 2009 at 12:35 PM, Michael Dinowitz
mdino...@houseoffusion.com wrote:

 ColdFusion MX used to have an attribute called rotate which would
 rotate a chart by 90 degrees. This was removed in ColdFusion 7 without
 a good replacement. I've seen many people talk about using a
 horizontalbar but this causes the bars to come from the side, not what
 I'm looking for.

 This document shows the old and new charts:
 http://docs.google.com/a/epicenterconsulting.com/Doc?id=dfhfz5dw_12c2cd2dfp

 What am I missing to make the new look like the old? I've played with
 the code a LOT but no luck.

 Thanks

 --
 Michael Dinowitz (http://www.linkedin.com/in/mdinowitz)
 President: House of Fusion    (http://www.houseoffusion.com)
 Publisher: Fusion Authority    (http://www.fusionauthority.com)
 Adobe Community Expert / Advanced Certified ColdFusion Professional

 

~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:327463
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


Re: Can anyone see the problem here?

2009-10-21 Thread Barney Boisvert

The three uses of APPLICATION.DBPRE are invalid; hash-wrapped
juxtaposition is not valid for concatenation except within quoted
strings.

cheers,
barneyb

On Wed, Oct 21, 2009 at 2:20 PM, Douglas Brown mistobr...@gmail.com wrote:

 I think I have lost it and cannot seem to see the error of my ways..

 Invalid CFML construct found on line 156 at column 28. ColdFusion was looking 
 at the following text:pAdvertisements.zipcode


  CFIF IsDefined(form.zip)
  and form.zip IS NOT 
  and IsDefined(form.radius)
  and form.radius neq 0
  and len(form.zip) eq 5
  and ( #APPLICATION.DBPRE#Advertisements.zipcode in 
 (#ListQualify(ValueList(results.zip),')#)
  or (#APPLICATION.DBPRE#Advertisements.city in 
 (#listQualify(ValueList(results.city),')#)
  and (#APPLICATION.DBPRE#Advertisements.State in 
 (#listqualify(valuelist(results.State), ')#)))
  /CFIF


 Thanks

 Doug

 

~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:327475
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


Re: Issues using CFHTTP

2009-10-21 Thread Barney Boisvert

You're approaching this in the wrong way, I think.  Ideally what you'd
do is take your existing security mechanism (whatever it is) and add
the ability to spoof another user.  So any Administrator could hit
the I want to spoof page where they'd see a list of Super Users to
pick from.  When they pick you, manipulate your authentication store
(probably in session variables) to indicate that the person is really
still Administrator X, but the site should consider them to be Super
User Y.  The same mechanism would hold for the Super User - End User
pairing.

Here's a really simple example.

I'm going to assume you have something like this currently:
session.isAuthenticated (a boolean), session.userId (the identifier of
the user who is authenticated), and session.userType (one of
administrator, superUser, or endUser).  When someone logs in, you do
your checks, and set those three variables.  Then the site reads those
three variables in order to make decisions about what to render and
how.

In that case, you want to add session.baseUserId, and
session.baseUserType that are initialized to the same as userId and
userType on login, and which the site never read.  Then somewhere add
code like this:

cfif listFind(administrator,superuser, session.baseUserType) GT 0
cfif session.userId EQ session.baseUserId
!--- they can spoof, but they aren't currently ---
a href=start_spoofing.cfmstart spoofing/a
cfelse
a href=stop_spoofing.cfmstop spoofing/a
/cfif
/cfif

Those two pages (start_spoofing.cfm and stop_spoofing.cfm) should take
care of setting/clearing session.userId and session.userType to allow
the user to spoof someone else, without touching their real session
state, which is stored in baseUserId and baseUserType.

Obviously that's a really generic description, but hopefully it'll get
you started down the right path.  It overcomes a couple really
important shortcomings with what you proposed as well.  Namely, you
don't have to render an arbitrary user's password out to other users
(which is REALLY bad), and you don't even have to have the passwords
in a readable format (which you really should never do).  It also
keeps your users with some connection to their real user context,
even when they're emulating another user, so they can back out and
return to normal without logging out and having to log back in as
their normal user.

cheers,
barneyb

On Wed, Oct 21, 2009 at 3:56 PM, Asaf Peleg a...@locusenergy.com wrote:

 Hi everyone,

 My websites has different types of profiles that our end users log into that 
 follows a simply hierarchy that goes as follows.

 Administrator - Super Users - End Users

 Where all Super Users are managed by the Administrator and each Super User 
 manages a subset of all End Users.  Each profile is locked by a username and 
 password from a login page. For debugging, auditing or support purposes 
 sometimes it becomes very useful for the Administrator to log into the 
 profile of one of his Super Users or for a Super User to log into one of his 
 End Users profiles since each profile contains different landing pages and 
 content.  I'm trying to achieve this functionality without the need to look 
 up that persons password (for obvious security reasons) so I've been toying 
 around with different methods.

 My first thought was to use CFHTTP but I've had no luck with it.  I thought I 
 could simply do

 cfhttp url=mylogincheck method=post redirect=true
 cfhttpparam type=formfield name=username value=#username#
 cfhttpparam type=formfield name=password value=#password#
 /cfhttp

 and it would redirect me much like a cflocation does except with form data 
 being posted, but I could get that desired behavior.  I've gave up on this 
 and did the following.

 cfoutput
 form action=mylogincheck method=post name=login
 input type=hidden name=username value=#username#
 input type=hidden name=password value=#password#
 script language=JavaScript
 document.login.submit();
 /script
 /form
 /cfoutput

 Which works but I'm concerned this is a not the correct way and could 
 possibly pose security issues since I'm technically creating an HTML page 
 with someones password even though the page redirects instantly. Would anyone 
 care to tell me what I'm doing wrong with CFHTTP or if alternatively, my 
 concerns are unfounded and my solution is in fact secure.

 Thanks,
 Asaf


-- 
Barney Boisvert
bboisv...@gmail.com
http://www.barneyb.

~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:327482
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


Re: Randomize Query results?

2009-10-13 Thread Barney Boisvert

If you're picking one item from a query, you can just do:

myQuery.myColumn[randRange(1, myQuery.recordCount)]

That'll be way more efficient than reordering the whole query.

cheers,
barneyb

On Tue, Oct 13, 2009 at 2:53 PM, Yuliang Ruan yuliangr...@hotmail.com wrote:

 I have a Query of Query right now that I'd like to have the results sort 
 order randomized.  Any ideas?   I've seen examples dependent on the dbms for 
 producing a random randomization, but is there any way to do that within 
 QofQ?   The base query that my QoQ is operating on is a cached Oracle query.

 Also brainstorming for other alternatives.  It's a simple round robin load 
 balancer.   I'd rather not have the first unit just by database index order 
 selected all the time.

 TIA

 

~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:327160
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4


Re: Splitting a list of unknown amount

2009-10-10 Thread Barney Boisvert

Totally untested and written on my phone, but it should be close:

A = listToArray(yourList);
Parts = [];
while (arrayLen(a) gt 100) {
   ArrayAppend(parts, a.subList(0, 100));
   A = a.subList(100, arrayLen(a));
}
Dump(parts);

Cheers,
Barneyb
--
Barney Boisvert
bboisv...@gmail.com
http://www.barneyb.com/

On Oct 10, 2009, at 3:47 PM, Chuka Anene anene.quor...@yahoo.com  
wrote:


 I've been looking for this for long now.
 What happens when you have a list containing coma-delimited numbers,  
 say

 1,2,3,4,X

 Where X is a number below 5000.
 How do you split this list into equal lengths of 100?

 

~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:327086
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4


Re: Deploying ColdFusion to Tomcat Server

2009-10-07 Thread Barney Boisvert

I don't see how that could possible be the case for Railor or
BlueDragon.  All three engines operate in exactly the same way: a
servlet mappings for .cfm and .cfc files that run a servlet from the
local context.  They all have to be copied into each context they're
needed.

Can we see your tomcat config for a working one and a non-working one?
 I suspect that's where the discrepancy is.

All said, having each app with it's own CFML runtime is rather
desirable in my opinion, and the couple hundred MB of space is hella
cheap.  All the projects we do at work are WAR-level packages; you
check out from SVN and includes all the code, a full CFML runtime,
possible a CMS runtime, etc.  Deployment happens the same way.  Makes
things enormously easier because it eliminates and potential
discrepancies between various environments.

cheers,
barneyb

On Wed, Oct 7, 2009 at 7:52 AM, Jeff Chastain li...@admentus.com wrote:

 In my development environment, I currently have Railo and Blue Dragon
 deployed to separate Tomcat servers.  Setting this up was simply a matter of
 dropping the war file into the webapps folder and doing a little bit of
 renaming to make it the root web app.  Then I could create new hosts and
 they all recognized the respective ColdFusion engine with no additional
 copying of files or configuration changes.



 Then I get to Adobe CF.  I have gone through the installer and generated the
 EAR file, which once expanded, includes a single cfusion.war file with both
 RDS and ColdFusion (I think).  I attempted to deploy this war file to a new
 Tomcat server in the same manner as before, renaming it to ROOT.  If I
 address the server via http://localhost, then I can access CFIDE, etc.
 However, if I create a new host, it has no visibility to the ColdFusion
 engine.  CFIDE does not exist and ColdFusion scripts are not processed.  The
 only way I have been able to make this work is to copy the CFIDE, WEB-INF,
 and META-INF folders from the war file into the web root of each individual
 host.   Not only is this very heavy on the file system but it is a pain.



 Am I missing something in the setup of ColdFusion on Tomcat here?



 Thanks

 -- Jeff



 

~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:326997
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


Re: Deploying ColdFusion to Tomcat Server

2009-10-07 Thread Barney Boisvert

I've attached a screenshot of a project's SVN repository, hopefully
it'll make it through to the list.  It was created with roughly these
steps:

 - unzip tomcat
 - empty webapps/ROOT
 - unzip cfusion.jar into webapps/ROOT
 - add svn:ignore for various bits (the cfclasses directory's
contents, for example)
 - check the webapps/ROOT into subversion
 - start building the app (which is the source of all the other
directories and files you see).
 - check the code in

Then for deployment, we pretty much just do an export from SVN, and
rsync it out to the destination server(s).  We also manage ALL the
administrative settings via the admin API, so they are completely
reset upon each application startup, eliminating any requirement to
carefully manage the neo-xxx.xml files.

We have a couple CF builds that we version separately so the unzip
cfusion.jar step above was really export CF from SVN as a starting
point.  That just gives us a central place to manage all our CF
setups.  In this particular case, it was a CF/Magnolia hybrid
basically created by overlaying the Magnolia jars atop an unzipped
cfusion.jar, plus a few custom classes we wrote to make them play
nicely.

cheers,
barneyb

On Wed, Oct 7, 2009 at 12:47 PM, Jeff Chastain li...@admentus.com wrote:

 I was mistaken on the Railo front - that server was setup a while back.  For
 Railo, it was deployed according to Sean Corfield's Multi-Web setup
 (http://corfield.org/blog/index.cfm/do/blog.entry/entry/Railo_on_Tomcat__mul
 tiweb) which adds the Railo jar files to the common.loader path and then
 defines the servlets and servlet-mappings within the main web.xml file.
 With that said, once this process is complete, all you have to do is add a
 new host definition in the server.xml and you have a new site without
 copying a bunch of files.  Railo will add a WEB-INF folder to that new site,
 but it is only a couple of MB.

 So, for your configuration, does the SVN repo you referred to contain the
 full CFIDE, META-INF, and WEB-INF folders which go into the web root of
 every project?  Would you mind sharing the contents / structure of your
 template project as that sounds exactly like what I am trying to setup?

 Thanks
 -- Jeff


 -Original Message-
 From: Barney Boisvert [mailto:bboisv...@gmail.com]
 Sent: Wednesday, October 07, 2009 11:51 AM
 To: cf-talk
 Subject: Re: Deploying ColdFusion to Tomcat Server


 I don't see how that could possible be the case for Railor or
 BlueDragon.  All three engines operate in exactly the same way: a
 servlet mappings for .cfm and .cfc files that run a servlet from the
 local context.  They all have to be copied into each context they're
 needed.

 Can we see your tomcat config for a working one and a non-working one?
  I suspect that's where the discrepancy is.

 All said, having each app with it's own CFML runtime is rather
 desirable in my opinion, and the couple hundred MB of space is hella
 cheap.  All the projects we do at work are WAR-level packages; you
 check out from SVN and includes all the code, a full CFML runtime,
 possible a CMS runtime, etc.  Deployment happens the same way.  Makes
 things enormously easier because it eliminates and potential
 discrepancies between various environments.

 cheers,
 barneyb

 On Wed, Oct 7, 2009 at 7:52 AM, Jeff Chastain li...@admentus.com wrote:

 In my development environment, I currently have Railo and Blue Dragon
 deployed to separate Tomcat servers.  Setting this up was simply a matter
 of
 dropping the war file into the webapps folder and doing a little bit of
 renaming to make it the root web app.  Then I could create new hosts and
 they all recognized the respective ColdFusion engine with no additional
 copying of files or configuration changes.



 Then I get to Adobe CF.  I have gone through the installer and generated
 the
 EAR file, which once expanded, includes a single cfusion.war file with
 both
 RDS and ColdFusion (I think).  I attempted to deploy this war file to a
 new
 Tomcat server in the same manner as before, renaming it to ROOT.  If I
 address the server via http://localhost, then I can access CFIDE, etc.
 However, if I create a new host, it has no visibility to the ColdFusion
 engine.  CFIDE does not exist and ColdFusion scripts are not processed.
  The
 only way I have been able to make this work is to copy the CFIDE, WEB-INF,
 and META-INF folders from the war file into the web root of each
 individual
 host.   Not only is this very heavy on the file system but it is a pain.



 Am I missing something in the setup of ColdFusion on Tomcat here?



 Thanks

 -- Jeff







 

~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:327004
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: 
http

Re: CFScript - what's the advantage?

2009-10-04 Thread Barney Boisvert

You can't express a true counter (for) loop with CFLOOP, only a  
condition loop (while).  So that's one reason.  Probably the reason I  
use it most often, even over reducing verbosity.

Beyond verbosity and a couple edge cases, I think it's pretty much  
entirely personal preference.

cheers,
barneyb

--
Barney Boisvert
bboisv...@gmail.com
http://www.barneyb.com/

On Oct 4, 2009, at 10:05 PM, Mike Kear afpwebwo...@gmail.com wrote:


 I've been trying to see what's the benefit of enhancing CFScript.
 There are a couple of reasons I can think of,  but am I missing
 something?  Are there more significant reasons for enhancing CFScript
 than I have here? Like for example performance issues?

 [A]  I like to code using a javascript-like syntax  i.e  personal  
 preference
 [B]  if we are going to have a script-style syntax at all, it ought to
 be fully featured with all functions available so developers dont have
 to switch back and forth.
 [C] there are 'snobs' who think that tag-based coding isn't real
 coding and having a script language satisfies their need for a real
 programming language.

 Is there another reason to code in the CFScript rather than tags??


 -- 
 Cheers
 Mike Kear
 Windsor, NSW, Australia
 Adobe Certified Advanced ColdFusion Developer
 AFP Webworks
 http://afpwebworks.com
 ColdFusion, PHP, ASP, ASP.NET hosting from AUD$15/month

 

~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:326885
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


Re: Error (The Value 2F cannot be converted to a number)

2009-10-02 Thread Barney Boisvert

val() will do that for you, but that's a rather course approach.  If
you have a know format (e.g. one number then one letter), you'd be
better parsing it explicitly (e.g., left(value, 1)) rather than using
something like val().

cheers,
barneyb

On Fri, Oct 2, 2009 at 12:48 AM, Damo Drumm
damien.dr...@quinn-group.com wrote:

 HI, Im having a slight problem while importing text files to a database, Im 
 using the below code, but it displaying an error (The Value 2F cannot be 
 converted to a number)
 How do i get it to ignore the F and just look at the 2 using code?

 cfif len(i) gte 6
                !--- Temp value of line number ---

                cfset tempvvalue1 = trim(left(i,4))
                !--- Invoice Line Text ---
                cfset stringvalue = left(right(i,Len(i)-5),130)
                !--- Calculate Line Numbers ---
        cfif isNumeric(tempvvalue1)
                cfset linenumber = right(tempvvalue1,2)
                cfelse
                cfset vvalue2 = trim(left(i,6))
                cfset linenumber = right(linenumber + vvalue2,2)
        /cfif
                cfif linenumber eq 26
                cfset invoicenumber = trim(right(left(i,74),20))

 

~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:326830
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


Re: can I do the following entirety in script? (CF8)

2009-10-02 Thread Barney Boisvert

This isn't a list loop, it's an index loop into a list.  There's is a
marked performance difference if you list is of any size, because you
have to do tokenization of the list at least twice per loop when you
use an index loop.  I did some tests a few years ago and even a
10-item list is about twice as slow to do what you propose compared
with converting the list to an array and looping over the array
(because the tokenization only happens  once).  A 20-item list takes
ten times as long.

The moral of the story is that if you're going to loop over a list
with an index, convert the list to an array first.

cheers,
barneyb

On Fri, Oct 2, 2009 at 8:11 AM, Tony Bentley t...@tonybentley.com wrote:

 for(i=1;i lte listlen(listToUpdate,,);i++){
 #listgetat(listToUpdate,i,,)#
 }

Hi,

cfscript (ColdFusion 8) can I do the following entirety in script?


cfloop index=i list=#listToUpdate# DELIMITERS=, 

value = #i#

/cfloop

Thanks

 

~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:326841
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


Re: MySQL Auto Increment Field

2009-09-30 Thread Barney Boisvert

Just out of curiosity Sean, do you know if the value is lazy loaded,
or do you have to pay the cost of retrieving the value on every query
(or at least introspecting to determine whether a value is available)
regardless?  I know you're closest to Railo, but I'm interested in
both (all three?) platforms if you've got the info.

cheers,
barneyb

On Wed, Sep 30, 2009 at 10:19 PM, Sean Corfield seancorfi...@gmail.com wrote:

 On Tue, Sep 29, 2009 at 12:22 PM, Azadi Saryev az...@sabai-dee.com wrote:
 if you are on CF8, use RESULT attribute of cfquery tag and then get
 GENERATED_KEY from that result:
 cfquery name=myquery datasource=... result=qResult
 INSERT ...
 /cfquery
 cfset newID = qResult.GENERATED_KEY

 As an aside, the generated key is placed into a different element of
 the result struct for each different database in CF8 (why??!?!) but
 that is fixed in CF9 which also adds GENERATEDKEY for *all* DB types
 so you can write portable code (assuming you stick to standard SQL of
 course and not TSQL - sorry Robert, couldn't resist! :)

 Railo recently implemented this same feature (both adding the various
 DB-specific generated key elements as well as the generic GENERATEDKEY
 element). I don't know whether Open BlueDragon supports this feature
 yet. Anyone?
 --
 Sean A Corfield -- (904) 302-SEAN
 Railo Technologies US -- http://getrailo.com/
 An Architect's View -- http://corfield.org/
-- 
Barney Boisvert
bboisv...@gmail.com
http://www.barneyb.com/

~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:326791
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


Re: MySQL Auto Increment Field

2009-09-29 Thread Barney Boisvert

select last_insert_id() as id

http://dev.mysql.com/doc/refman/5.0/en/information-functions.html#function_last-insert-id

cheers,
barneyb

On Tue, Sep 29, 2009 at 12:16 PM, Agha Mehdi aghaime...@gmail.com wrote:

 All,
 How do I get the ID value back in CF from MySQL after doing an insert with
 auto_inc data type in the table?

 Thanks for help

 Agha


 

~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:326749
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4


Re: SOT aligning multiple lists

2009-09-28 Thread Barney Boisvert

One solution would be to create a master list first, and then loop
over it, detecting which lists contain the value and indicating as
such.  Another would be to iterate over all three lists concurrently,
and at each iteration check and see which list (or lists) contains the
lowest unprocessed value, use that for the current row, and then mark
all instances of that value as processed.

The former is probably simpler to implement, but requires two passes,
an extra parallel data structure, and a whole bunch of
exists-in-collection checks.  As such, it's probably somewhat less
performant, but you'd have to do some tests to confirm that, as the
difference is probably trivial with small list sizes and counts.

cheers,
barneyb

On Mon, Sep 28, 2009 at 12:30 PM, Ian Skinner h...@ilsweb.com wrote:

 I have 6 alphabetical lists, CFML structure key lists but I don't think
 that matters.

 These 6 lists have many common keys with each having a few differences.
 I want to display a table with each list in its own column.  I would
 like it to sort such that common keys align together in the same row.
 But if no common key then skip that row for that list.  Maybe a diagram
 would clarify this.

 ListA ListB ListC
 1     1     1
 2           2
      3     3
      4
 5     5

 The trouble is there is no master list to drive this from.  I just can
 not get my sleep deprived, aging mind to conceive of a way to create
 this display from six arbitrary lists.


 TIA
 Ian



-- 
Barney Boisvert
bboisv...@gmail.com
h

~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:326713
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4


Re: (ot) Detect OS and CPU Architecture

2009-09-26 Thread Barney Boisvert

Windows only runs on Intel, and I says windows right in the UA  
string.  What else do you need?

--
Barney Boisvert
bboisv...@gmail.com
http://www.barneyb.com/

On Sep 26, 2009, at 11:23 AM, Don L do...@yahoo.com wrote:


 Barney, thank you for your input.

 I ran CGI.HTTP_USER_AGENT (cf) for it.
 Here's what I got.

 With Firefox 3.5 I get:
 Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9.1.3) Gecko/ 
 20090824 Firefox/3.5.3 (.NET CLR 3.5.30729)

 With IE7 I get:
 Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0; SLCC1; .NET CLR 2.0.50727 
 ; Media Center PC 5.0; .NET CLR 3.5.30729; .NET CLR 3.0.30618)

 hmm, I can't seem to see anything that could be translated into cpu  
 arch.  What else could we try?




 Well, windows only runs on Intel, and it states 32/64 bit in the user
 agent.  Linux usually has an architecture in the user agent.  OSX  
 is a
 wildcard, but universal binaries make it no big deal if it's PPC or
 Intel.

 But to answer your question, JS is unable to determine it, and more  
 to
 the point, unable to do anything architecture-specific anyway.

 cheers,
 barneyb

 --
 Barney Boisvert
 bboisv...@gmail.com
 http://www.barneyb.com/

 On Sep 25, 2009, at 6:37 PM, D



 

~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:326663
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


Re: (ot) Detect OS and CPU Architecture

2009-09-25 Thread Barney Boisvert

Well, windows only runs on Intel, and it states 32/64 bit in the user  
agent.  Linux usually has an architecture in the user agent.  OSX is a  
wildcard, but universal binaries make it no big deal if it's PPC or  
Intel.

But to answer your question, JS is unable to determine it, and more to  
the point, unable to do anything architecture-specific anyway.

cheers,
barneyb

--
Barney Boisvert
bboisv...@gmail.com
http://www.barneyb.com/

On Sep 25, 2009, at 6:37 PM, Don L do...@yahoo.com wrote:


 Hi,

 Preferably do it with javascript.
 Did a bit of digging myself, neither navigator.userAgent nor  
 navigator.appVersion command would suffice for the CPU part.  Hmm,  
 is javascript simply unable to or I simply don't know better?

 As always many thanks.

 

~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:326655
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


Re: Getting URL from URL address bar!

2009-09-23 Thread Barney Boisvert

Do it on the app sever.  Accept requests for xyz.com and abc.com, log
the request, and then redirect to finalsite.com.  Just make sure you
do a 302 so search engines won't correct themselves.

cheers,
barneyb

On Wed, Sep 23, 2009 at 10:54 AM, David Torres djt...@yahoo.com wrote:

 Hello,

 My company needs to track when users type either one domain or the other to 
 get to the final page, for example a person types www.xyz.com or www.abc.com 
 to be redirected to www.finalsite.com.

 I know how to do the redirect, but how can I capture the address they typed 
 to finally get to the site. I need to know also when the user clicks the link 
 from a search engine.

 Thanks, David

 

~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:326544
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4


Re: Getting URL from URL address bar!

2009-09-23 Thread Barney Boisvert

301 is permanent, which tells people they can safely skip xyz.com and
go right to finalsite.com.  I.e. that it's safe to never actually hit
xyz.com and just automatically do the rewrite without an HTTP request.
 You don't want that if you want to track the traffic on xyz.com.

cheers,
barneyb

On Wed, Sep 23, 2009 at 11:12 AM, Jacob ja...@excaliburfilms.com wrote:

 Hmm... should it be a 301?

 -Original Message-
 From: Barney Boisvert [mailto:bboisv...@gmail.com]
 Sent: Wednesday, September 23, 2009 11:02 AM
 To: cf-talk
 Subject: Re: Getting URL from URL address bar!


 Do it on the app sever.  Accept requests for xyz.com and abc.com, log
 the request, and then redirect to finalsite.com.  Just make sure you
 do a 302 so search engines won't correct themselves.

 cheers,
 barneyb

 On Wed, Sep 23, 2009 at 10:54 AM, David Torres djt...@yahoo.com wrote:

 Hello,

 My company needs to track when users type either one domain or the other
 to get to the final page, for example a person types www.xyz.com or
 www.abc.com to be redirected to www.finalsite.com.

 I know how to do the redirect, but how can I capture the address they
 typed to finally get to the site. I need to know also when the user clicks
 the link from a search engine.

 Thanks, David





 

~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:326547
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


Re: clearing flash cache

2009-09-18 Thread Barney Boisvert

Just add a dummy timestamp parameter to the url's query string.  E.g.
change this:

fileXml.load(/path/to/your.cfm)

to something like this:

fileXml.load(/path/to/your.cfm?ts= + new Date().valueOf())

cheers,
barneyb

On Fri, Sep 18, 2009 at 11:18 AM, Michael Muller mich...@mullertech.com wrote:

 Hey all,

 I have a client who has a Flash movie playing on a page, which reads an xml 
 file (a cfm file returning xml code, that is) and displays a list of files in 
 that customer's image folder.

 After a customer uploads a new file to the website (through an html form on 
 the side) the page reloads and the flash movie loads the XML code again and 
 displays the list of file, again.

 In FireFox this works fine.

 In IE it only displays the new file if the end-user has Tools  Internet 
 Options  Browsing History [Settings]  set to Always.  If it's not, then 
 the new files will not list in the Flash app until the browser cache expires, 
 whenever that may be.

 I already have the following meta tags in the head of the containing CFM 
 file, but this appears to have no effect on the Flash app.

 META HTTP-EQUIV=CACHE-CONTROL CONTENT=NO-CACHE
 META HTTP-EQUIV=Pragma CONTENT=no-cache /

 I have since also added the following lines to both the CFM file holding the 
 Flash app, as well as the CFM file producing the XML for the Flash app:

 cfheader name=Expires value=#Now()#
 cfheader name=Pragma value=no-cache

 Still no go.

 So, my question is this.  Can a Flash app override IE's current caching sceme 
 and absolutely, positively, load a file off the drive?  This is driving me 
 and my client absolutely nuts.

 Thanks,

 Mik




 
 Michael Muller
 office (413) 863-6455
 cell (413) 320-5336
 skype: michaelBmuller
 http://MontagueWebWorks.com

 Information is not knowledge
 Knowlege is not wisdom

 Eschew Obfuscation


 

~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:326439
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


Re: Strange VAR error: browser specific

2009-09-17 Thread Barney Boisvert

CF looks up a whole pile of scopes when dereferencing variables,
including CGI.  It's possible that IE8 sends an extra header named
myvar that is what CF found to interrogate, but no other browser
sends it.  Is the actual name of myvar reasonable for that case?

cheers,
barneyb

On Thu, Sep 17, 2009 at 11:03 AM, Robert Harrison
rob...@austin-williams.com wrote:

 Just encountered a weird CF error. I ran a cfquery and used a var from it,
 but forgot to include the query name (instead of thequery.myvar I just did
 my myvar). It choked on a CFIF statement that checked the condition of
 myvar (I mean thequery.myvar).

 Here's the strange thing. The error was browser specific. IE 8 only.  Worked
 in all other browsers.

 Any ideas how that could happen, since the query and the CFIF are executed
 on the server?

 I saw it happen, but don't know why it was browser specific. Am I missing
 some basic concept here?



 Robert B. Harrison
 Director of Interactive Services
 Austin  Williams
 125 Kennedy Drive, Suite 100
 Hauppauge NY 11788
 P : 631.231.6600 Ext. 119
 F : 631.434.7022
 http://www.austin-williams.com

 Great advertising can't be either/or.  It must be .

 Plug in to our blog: AW Unplugged
 http://www.austin-williams.com/unplugged




 __ Information from ESET Smart Security, version of virus signature
 database 4434 (20090917) __

 The message was checked by ESET Smart Security.

 http://www.eset.com


 

~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:326389
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4


Re: Putting a random phrase after a sentence.

2009-09-17 Thread Barney Boisvert

100% untested, but you get the idea:

s = The project is done.;
strings = [
  and dinna spare the whip,
  and I sure am handsome,
  ...
]
start = 0;
while (true) {
  // any . ? ! preceded by a letter and followed by a space
  start = REFind([a-zA-Z][.?!]( |$), s, start);
  if (start == 0) {
break; // no match
  }
  if (randRange(1, 20) EQ 1) { // 5% chance
rs = strings[randRange(1, arrayLen(strings))];
insert(,   rs, s, start + 1);
start += len(rs) + 4;
  }
}

On Thu, Sep 17, 2009 at 10:15 PM, Phillip Vector
vec...@mostdeadlygame.com wrote:

 Hey people. I'm working on a filter to put in some random text into my
 pages. For example...

 The project is done.

 Becomes

 The project is done, and dinna spare the whip!

 (I think some of you know why I am doing this). :)

 Anyway, I don't want to have it appear after EVERY period or ! or ?..
 I'd like to randomly put it (say, 5% chance every sentence).

 I'm thinking about looping over the text, character by character. When
 it finds a period, it rolls the dice and perhaps does the
 replacement based on the last few characters before the period. Then
 keeps going.

 Does anyone have a less convoulted way of doing this (or something I
 can plug and play into it)?

 

~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:326420
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


Re: HoF invaded

2009-09-15 Thread Barney Boisvert

Or the user account the web/app server runs as shouldn't have write
access to the code it's executing?  Sure, it might be a hole in IIS,
but IIS is like sieve, and you shouldn't be able to modify the code in
place like that in any case.

On Tue, Sep 15, 2009 at 10:14 AM, Michael Dinowitz
mdino...@houseoffusion.com wrote:

 Each and every .cfm file that is on a site that is mapped to iis was
 affected. If a .cfm was in a non-mapped directory then it was not
 touched. This says to me that the hole is in iis.

 On Tue, Sep 15, 2009 at 1:02 PM, Andy Matthews li...@commadelimited.com 
 wrote:

 Is it the actual file itself? That means someone got into your site via FTP.

 I told you that you shouldn't have left the password as 1234.

 :)

 But seriously. Sorry to hear about that Michael. Keep us posted.

 -Original Message-
 From: b...@bradwood.com [mailto:b...@bradwood.com]
 Sent: Tuesday, September 15, 2009 11:54 AM
 To: cf-talk
 Subject: RE: HoF invaded


 Ouch.  Are you on shared hosting?

 I would change every FTP password stat.

 Good Luck.

 ~Brad

  Original Message 
  Subject: HoF invaded
  From: Michael Dinowitz mdino...@houseoffusion.com
  Date: Tue, September 15, 2009 11:46 am
  To: cf-talk cf-talk@houseoffusion.com


  Somehow, every .cfm file on the HoF site has been infected with a  malware
 script tag.






 

~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:326320
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


Re: 65mb XML file Crashing CF8 on my workstation

2009-09-14 Thread Barney Boisvert

I'd recommend grabbing a SAX parser and using that instead of the
DOM-based stuff that CF ships with.  Then you can stream the file in
and deal with it's nodes sequentially, rather than having to inflate
the whole thing into a DOM tree to manipulate.  Definitely can make
the code trickier to write since you only have one shot at each node,
but it'll save your ass with the memory constraints.

cheers,
barneyb

On Mon, Sep 14, 2009 at 2:42 PM, Alan Rother alan.rot...@gmail.com wrote:

 Hey All,
 I'm trying to parse out a 65mb XML file from a customer... Don't ask...
 Every time I try to hit it with XMLParse(), memory spikesfrom 500mb to 1,200
 and then crashes CF

 Has anyone else dealt with big XML files like this?


 =]

 --
 Alan Rother
 Adobe Certified Advanced ColdFusion MX 7 Developer
 Manager, Phoenix Cold Fusion User Group, AZCFUG.org


 

~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:326292
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


Re: Is this possible with component methods in cf8?

2009-09-11 Thread Barney Boisvert

You can't send anything back to the user until all the photos are
uploaded, but once that's done, you can just leave them on disk,
record the fact that they're there in session scope, and return a
response after kicking off a background thread to process the images.
That background thread should update the same session scope data
structures, which you can interrogate via Ajax requests to update the
user on progress.

If you need status updates while the actual upload is happening,
you'll have to use a Flash uploader or something

cheers,
barneyb

On Fri, Sep 11, 2009 at 9:48 PM, Rick Fairclothr...@whitestonemedia.com wrote:

 What I'd like to do concerns uploading and processing images which sometimes
 takes

 awhile and leaves the user wondering what's happening while they're waiting.



 If the user is uploading, say 10 photos, and all the photos have to be
 resized into two different

 images, renamed, saved, etc., the process can take some time.



 I was wondering if I could set up a method of process 1 images, then return
 the name of the

 image to the user via ajax, with a message such as Image house1.jpg
 processed., then when

 image two has been uploaded and processed, Image house2.jpg processed,
 etc. until all

 images have been processed.



 This would keep the user informed of the progress and keep them from
 worrying that the

 process was hanging up.



 So, the question is, can messages (via cfreturn) be sent back to the client
 multiple times

 from a method?  Or perhaps there's a different way to achieve this?



 Any suggestions or ideas?



 Thanks,



 Rick



 
 ---

 Those who hammer their guns into plows will plow for those who do not.  -
 Thomas Jefferson






 

~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:326240
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


Re: ColdFusion Builder - free or commercial product?

2009-08-24 Thread Barney Boisvert

To this point, Adobe and it's ancestors have charged for all their
development products: HomeSite, CF Studio, Dreamweaver, UltraDev,
FlexBuilder, perhaps others?  They also obviously charge for their
design products (the Creative Suite's members).  It stands to reason
that FlashBuilder and CF Builder will cost to purchase when released.
I would say it's theoretically possible FlashBuilder and CF Builder
(minus some features) might be released for free with the extra stuff
available as paid upgrades, but nothing I've heard indicates that's
likely.

All that said, regardless of whether they cost money to use, they will
certainly be commercial products and licensed as such.

cheers,
barneyb

On Mon, Aug 24, 2009 at 8:34 PM, Pete Ruckelshauspruckelsh...@gmail.com wrote:

 I've been using ColdFusion Builder and am more or less happy with it (any
 unhappiness stems from Eclipse quirks and limitations), but I have a
 question: Once it's out of beta, will CF Builder be a commercial product
 that will need to be purchased, or will it be available for free?
 Thanks

 Pete


 

~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:325655
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


Re: Coldfusion + Flex

2009-08-21 Thread Barney Boisvert

For the officially released products, FlexBuilder and CFEclipse (on
Eclipse) or IntelliJ's counterparts.  If you don't mind beta,
FlashBuilder and CFBuilder (on Eclipse).  I use the first pair
personally.

cheers,
barneyb

On Fri, Aug 21, 2009 at 9:22 AM, Agha Mehdiaghaime...@gmail.com wrote:

 What is the most common and best IDE people are using for Coldfusion and
 Flex combined?


 

~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:325590
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


  1   2   3   4   5   6   7   8   9   10   >