Re: WHERE Left(str,5) = 'string' VS WHERE str LIKE 'string%'

2010-09-08 Thread Won Lee
I ran a quick test CREATE TABLE HoF ( ID INT NOT NULL AUTO_INCREMENT PRIMARY KEY, LastName VARCHAR(100) ) ENGINE = InnoDB; insert into HoF (LastName) values ('Smith'); insert into HoF (LastName) values ('Smithville'); insert into HoF (LastName) values ('Jones'); inse

Re: Preserve HTML format when inserting into HTML

2010-09-08 Thread Raymond Camden
Woot! Found it: http://www.mail-archive.com/cf-talk@houseoffusion.com/msg312892.html I have _never_ seen this in use, but it works perfectly: foo"> #x.root.child[1].xmltext# #s# On Wed, Sep 8, 2010 at 8:38 PM, Raymond Camden wrote: > I'm digging. This came up 3 years ago too: >

Re: Preserve HTML format when inserting into HTML

2010-09-08 Thread Raymond Camden
I'm digging. This came up 3 years ago too: http://www.houseoffusion.com/groups/cf-talk/thread.cfm/threadid:32864 On Wed, Sep 8, 2010 at 4:54 PM, Jake Munson wrote: > > Ray, > > In addition to my previous email with proof of concept code, I am able to > reproduce my problem using your code bel

Problem opening a CF created .XLS in OpenOffice.

2010-09-08 Thread Michael Grant
I have created a cfc that you pass in queries and get back an xls with multiple worksheets. This seems to work great and opens perfectly in Microsoft Excel. However if I open it in OpenOffice I get a screen telling me it's importing text and asks me to choose the language. Then the content of the

Re: WHERE Left(str,5) = 'string' VS WHERE str LIKE 'string%'

2010-09-08 Thread Michael Grant
Getting to actually test this hasn't been as easy as I'd hoped. If I can get something definitive I'll post. On Wed, Sep 8, 2010 at 3:45 PM, Won Lee wrote: > > mike, > > Please let us know what you find out. I'm very curious of this myself. As > the document clearly states, mysql will use an

Re: Preserve HTML format when inserting into HTML

2010-09-08 Thread Jake Munson
Ray, In addition to my previous email with proof of concept code, I am able to reproduce my problem using your code below by adding this cffile tag to the end of your code: >Weird. I can't reproduce this: > > >foo"> > > > > > > > > > > >#x.root.child[1].xmltext# > >#s# > > >The value is NOT e

Re: Preserve HTML format when inserting into HTML

2010-09-08 Thread Jake Munson
Ok, guys, I have a working proof of concept. At least on my server, this simple 4 line code example illustrates the problem. To recreate, dowload this file: http://techfeed.net/xmlHTMLTest.zip And then follow these steps. 1. Extract the zip to your ColdFusion sites directory. 2. BEFORE RUNNI

Re: Preserve HTML format when inserting into HTML

2010-09-08 Thread Jake Munson
> But like I said earlier, I created a workaround so I'm not stressing > about it. It's just odd. I have found the same problem with a different XML file. I am going to try to put together a proof of concept to see if other people besides me can recreate this issue. ~~~

Re: WHERE Left(str,5) = 'string' VS WHERE str LIKE 'string%'

2010-09-08 Thread Michael Grant
Yes I did. Apparently I can't count. :D On Wed, Sep 8, 2010 at 3:45 PM, Won Lee wrote: > > mike, > > Please let us know what you find out. I'm very curious of this myself. As > the document clearly states, mysql will use an index when you use a like > but > don't start the string with a wildc

Re: WHERE Left(str,5) = 'string' VS WHERE str LIKE 'string%'

2010-09-08 Thread Won Lee
mike, Please let us know what you find out. I'm very curious of this myself. As the document clearly states, mysql will use an index when you use a like but don't start the string with a wildcard. So we know that Left(str,5) = 'string' VS WHERE str LIKE 'string%'both will use an index. The que

Re: Creating a custom ajax error

2010-09-08 Thread Raymond Camden
Remove the dump perhaps. On Wed, Sep 8, 2010 at 1:58 PM, Tony Bentley wrote: > >   My post above is wrong. Here is what I wanted to happen: > >   >         >           >           >           StructFind(requestHeaders,"X-Requested-With") eq "XMLHttpRequest"> >             >             >    

Re: WHERE Left(str,5) = 'string' VS WHERE str LIKE 'string%'

2010-09-08 Thread Judah McAuley
Or, if anyone really cares, just write both the queries, fire up the Query Profiler (for MSSQL) and see what the execution plans say. On Wed, Sep 8, 2010 at 12:12 PM, Michael Grant wrote: > > Hmmm. That seems to conflict with what Steven says. Perhaps a blood match is > in order? > > > On Wed, S

RE: WHERE Left(str,5) = 'string' VS WHERE str LIKE 'string%'

2010-09-08 Thread DURETTE, STEVEN J (ATTASIAIT)
Well, I have to apologize! I am going through some training right now that is telling me exactly that. I was always told before that using like was bad, but apparently it is better. Steve -Original Message- From: Mike Chabot [mailto:mcha...@gmail.com] Sent: Wednesday, September 08, 20

Re: WHERE Left(str,5) = 'string' VS WHERE str LIKE 'string%'

2010-09-08 Thread Michael Grant
Hmmm. That seems to conflict with what Steven says. Perhaps a blood match is in order? On Wed, Sep 8, 2010 at 3:10 PM, Mike Chabot wrote: > > In SQL Server go with "like str%." The reason is that like str% is > sargable and functions are not. Functions also have overhead that > native set-base

Re: WHERE Left(str,5) = 'string' VS WHERE str LIKE 'string%'

2010-09-08 Thread Mike Chabot
In SQL Server go with "like str%." The reason is that like str% is sargable and functions are not. Functions also have overhead that native set-based SQL does not. I would assume the same is true with mySQL. Native SQL is usually faster than functions as a general rule, unless the equivalent SQL i

Re: Creating a custom ajax error

2010-09-08 Thread Tony Bentley
My post above is wrong. Here is what I wanted to happen: This throws the error and dumps it out in html for firebug but ajaxSetup() now knows what to do with it based on x.status == 50

Re: WHERE Left(str,5) = 'string' VS WHERE str LIKE 'string%'

2010-09-08 Thread Michael Grant
Great suggestion. Thanks. On Wed, Sep 8, 2010 at 2:26 PM, Russ Michaels wrote: > > turn on debug mode, run both versions and then look at the execution time > of > the cfquery, this will show you which processed faster. > > > > On Wed, Sep 8, 2010 at 7:11 PM, Won Lee wrote: > > > > > On Wed, S

Re: Creating a custom ajax error

2010-09-08 Thread Tony Bentley
This is what I got from today's lesson ... Application.cfc - OnError: Client side script: $.ajaxSetup({ error:function(x,e){ if(x.status == 500 && x.statusText == "Sess

Re: WHERE Left(str,5) = 'string' VS WHERE str LIKE 'string%'

2010-09-08 Thread Russ Michaels
turn on debug mode, run both versions and then look at the execution time of the cfquery, this will show you which processed faster. On Wed, Sep 8, 2010 at 7:11 PM, Won Lee wrote: > > On Wed, Sep 8, 2010 at 1:27 PM, Michael Grant wrote: > tioin > > > > What about mySQL? > > > > Do you know i

Re: Creating a custom ajax error

2010-09-08 Thread Raymond Camden
So I plan a blog entry on this, but taking my example of ajaxSetup: $.ajaxSetup({ error:function(x,e){ if(x.status == 500 && x.statusText == "SessionTimeout") { alert("Your session has timed out.");

Re: WHERE Left(str,5) = 'string' VS WHERE str LIKE 'string%'

2010-09-08 Thread Won Lee
On Wed, Sep 8, 2010 at 1:27 PM, Michael Grant wrote: > > What about mySQL? > > Do you know if this is documented and easy to find? > > > http://dev.mysql.com/doc/refman/5.6/en/mysql-indexes.html ~| Order the Adobe Coldfusion A

Re: Creating a custom ajax error

2010-09-08 Thread Tony Bentley
You're correct if the application was something on the public end but during black box testing is when this would be useful. Before go-live I would like the user (or another client based delivery system) to catch errors and pass them back to a ticket. I can then go into my error log files and see

Re: Creating a custom ajax error

2010-09-08 Thread Raymond Camden
FYI, blog entry on the work so far: http://www.coldfusionjedi.com/index.cfm/2010/9/8/Example-of-handling-session-time-outs-in-an-Ajax-application On Wed, Sep 8, 2010 at 12:16 PM, Raymond Camden wrote: > Hmm. Good followup! > > So I'd say you would a) want to handle the issue for sure, but b) >

Re: WHERE Left(str,5) = 'string' VS WHERE str LIKE 'string%'

2010-09-08 Thread Michael Grant
What about mySQL? Do you know if this is documented and easy to find? On Wed, Sep 8, 2010 at 1:23 PM, DURETTE, STEVEN J (ATTASIAIT) < sd1...@att.com> wrote: > > With SQL Server, DEFINITELY go with left(str, 4) = 'string' > > It has much less processing overhead. > > -Original Message-

RE: WHERE Left(str,5) = 'string' VS WHERE str LIKE 'string%'

2010-09-08 Thread DURETTE, STEVEN J (ATTASIAIT)
With SQL Server, DEFINITELY go with left(str, 4) = 'string' It has much less processing overhead. -Original Message- From: Michael Grant [mailto:mgr...@modus.bz] Sent: Wednesday, September 08, 2010 1:20 PM To: cf-talk Subject: WHERE Left(str,5) = 'string' VS WHERE str LIKE 'string%' A

WHERE Left(str,5) = 'string' VS WHERE str LIKE 'string%'

2010-09-08 Thread Michael Grant
Any advantage to one over the other? ~| 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/c

Re: Creating a custom ajax error

2010-09-08 Thread Raymond Camden
Hmm. Good followup! So I'd say you would a) want to handle the issue for sure, but b) probably not tell the user too much. So assuming that you normally have an error handler that say something vague (or maybe it shows the full error, whatever, point is, you handle it), we need a version for Aja

Re: Creating a custom ajax error

2010-09-08 Thread Tony Bentley
That's exactly what I was looking for Ray. So the $.ajaxSetup() method handles the errors and redirects expired session. I knew there was a way to do this outside of my ajax requests but wasn't sure if I needed to create a proxy method or otherwise. Also, I noticed that you are expecting a string

Re: Creating a custom ajax error

2010-09-08 Thread Raymond Camden
There are a couple of ways you can do this. I'm going to do a blog entry on this in a few minutes with a full example, but, you can have logic like this: (pseudo-code obviously for this part) if I need to login: if ajax request, throw an exception with a specific message else redirect to logi

Creating a custom ajax error

2010-09-08 Thread Tony Bentley
Has anyone used cfhttp to throw an ajax error that returns a JSON object and error code 500? I'm looking for a code snippet of your onError() method. I'm using jQuery and am also trying to decide how to handle it on the client side. Specifically looking for when a session expires and when a ser

Re: Need some fresh eyes on an application

2010-09-08 Thread Paul Day
Rick, I have fixed that error. Apparantly I was a little loose on how I was sending back errors. That has been standardized now, and errors should be working correctly (buh dum dum). Thanks, Paul >Not being familiar with mssql (I'm a mysql user), I made >some entry mistakes when trying to cre

Re: Need some fresh eyes on an application

2010-09-08 Thread Paul Day
Might have been a temporary network problem. Everything seems to be accessible now. Thanks, Paul > Login doesn't work (at the moment?). So I cannot help with testing. > I'm using Opera, IE8, Firefox, Safari and Chrome on Windows 7, but > none of them want to login with the credentials provi

cfdocument and flashpaper (link to flash if not installed)

2010-09-08 Thread Richard White
Hi, I am using cfdocument with format flashpaper. however, if users do not have flash installed instead of informing them of this and providing them with a link to download flash, the system is showing the download window. is there anyway to inform the user of this problem and provide them wit

Re: Finding if a key exists in a struct based on a variable name

2010-09-08 Thread Michael Grant
Thanks. I'm actually after the structvalue if it exists and a zero length string if it doesn't. It looks like Rex has me sorted though. Thanks Dom. On Wed, Sep 8, 2010 at 3:24 AM, Dominic Watson < watson.domi...@googlemail.com> wrote: > > On a side note, if you're after an output of 'yes' or 'no

Re: Finding if a key exists in a struct based on a variable name

2010-09-08 Thread Dominic Watson
On a side note, if you're after an output of 'yes' or 'no', this may be cleaner: #YesNoFormat( StructKeyExists(x.classAssign, "#y#head") )# Dominic On 8 September 2010 02:30, Michael Grant wrote: > > So I went back and read the docs for IIF. I haven't looked at them in years > and I'm shocked