I'm only applying logic to the 3 points, not to writing massive
amounts of code. Personally, I'm a code minimalist. I want a few lines
of simple code to do a job. But then again, a few extra lines in
return for performance is ok, unless your going crazy. :)
On Thu, Aug 12, 2010 at 8:09 AM, Rick
What is the purpose of applying logic of any kind to a discussion
about writing massive amounts of code to do what lcase() does? =)
~|
Order the Adobe Coldfusion Anthology now!
, ALL)
/cfif
cfif find(Z, tempString) gt 0
cfset tempString = replace(tempString, Z, z, ALL)
/cfif
cfoutput#tempString#/cfoutput
-Original Message-
From: Rick Root [mailto:rick.r...@gmail.com]
Sent: Monday, August 09, 2010 10:18 AM
To: cf-community
Subject: Dysfunctional contest
I can look at that all day long and never figure it not... :(
-Original Message-
From: Rick Root [mailto:rick.r...@gmail.com]
Sent: Tuesday, August 10, 2010 3:46 AM
To: cf-community
Subject: Re: Dysfunctional contest
Relatively succinct but I'll be a lot of CF programmers would have
:18 AM
To: cf-community
Subject: Dysfunctional contest
Write a function to convert a string to lower case
Do not use lcase()
Example:
cffunction name=toLowerCase access=public output=false
returnType=string
cfargument name=src type=string required=yes
cfset var result
(tempString, Z, z, ALL)
/cfif
cfoutput#tempString#/cfoutput
-Original Message-
From: Rick Root [mailto:rick.r...@gmail.com]
Sent: Monday, August 09, 2010 10:18 AM
To: cf-community
Subject: Dysfunctional contest
Write a function to convert a string to lower case
Do not use lcase
= replace(tempString, Z, z, ALL)
/cfif
cfoutput#tempString#/cfoutput
-Original Message-
From: Rick Root [mailto:rick.r...@gmail.com]
Sent: Monday, August 09, 2010 10:18 AM
To: cf-community
Subject: Dysfunctional contest
Write a function to convert a string to lower case
On Wed, Aug 11, 2010 at 11:30 AM, Medic hofme...@gmail.com wrote:
Haha. Now THAT is a nice waste of space. I like how you test for the
existence of the letter before you replace it.
that actually is pretty awesomely bad, because you could totally leave
thoe if statements out and the code
And, since it's not a function, perhaps the user of such code would just
have it pasted all over the place. =)
Oh I like that. Nice extra touch.
~|
Order the Adobe Coldfusion Anthology now!
Speed tests are always a false indicator of real work. I look at the 3
points and just apply logic. But test results always look good no
matter.
On Wed, Aug 11, 2010 at 11:55 AM, Medic hofme...@gmail.com wrote:
haha, yes we _all_ know that the regex will be much faster. I was just
wondering
True dat. What does your logic say about my three points? Which would be
fastest in your opinion?
On Wed, Aug 11, 2010 at 3:47 PM, Michael Dinowitz
mdino...@houseoffusion.com wrote:
Speed tests are always a false indicator of real work. I look at the 3
points and just apply logic. But test
I'd guess that option 3 is fastest.
On Wed, Aug 11, 2010 at 12:50 PM, Medic hofme...@gmail.com wrote:
True dat. What does your logic say about my three points? Which would be
fastest in your opinion?
On Wed, Aug 11, 2010 at 3:47 PM, Michael Dinowitz
mdino...@houseoffusion.com wrote:
I think I'd agree. It was really more between 2 and 3. As testing for the
existence of the char is dumb.
I was just wondering if replacenocase would be faster than replace.
On Wed, Aug 11, 2010 at 3:55 PM, Judah McAuley ju...@wiredotter.com wrote:
I'd guess that option 3 is fastest.
On
But it is not that bad to update if needed. Just use find and replace in
Dreamweaver...
-Original Message-
From: Rick Root [mailto:rick.r...@gmail.com]
Sent: Wednesday, August 11, 2010 11:51 AM
To: cf-community
Subject: Re: Dysfunctional contest
On Wed, Aug 11, 2010 at 11:30 AM, Medic
Point 1 searchs the entire string for the first occurrence of
character X. Each check compares the letter with between 1 and
stringlength other letters. If a match is found, a check is made on
each and every character in the string to see if it should be
replaces. Total is 2 searches and 1
Relatively succinct but I'll be a lot of CF programmers would have to
spend some time figuring out what that did =) I didn't know about
those special replace sequences.
Rick
On Tue, Aug 10, 2010 at 1:26 AM, Michael Dinowitz
mdino...@houseoffusion.com wrote:
In ColdFusion, but less
That's why I like to 'step' document my regex for others.
I usually put all my regex into a structure set at the top of the page
called regex. Each pattern has it's own (relatively) well named
variable which I can use anywhere I like. Self documentation is always
a good thing.
I'll be blogging
Third is where I am now. :)
Profit?
~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion
Archive:
It's a contract, so yes.
Profit?
~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion
Archive:
Write a function to convert a string to lower case
Do not use lcase()
Example:
cffunction name=toLowerCase access=public output=false
returnType=string
cfargument name=src type=string required=yes
cfset var result =
cfloop from=1 to=#len(arguments.src)# step=1
def lowercase(string)
string.gsub(/([A-Z])/) {|c| (c[0]+32).chr}
end
regular expressions, closureshow much more convoluted can you get :)
On Aug 9, 2010, at 12:17 PM, Rick Root wrote:
Write a function to convert a string to lower case
Do not use lcase()
Example:
cffunction
Oh, I like! but.. heh, what language is that? =)
Rick
On Mon, Aug 9, 2010 at 1:36 PM, Zaphod Beeblebrox
zaph0d.b33bl3b...@gmail.com wrote:
def lowercase(string)
string.gsub(/([A-Z])/) {|c| (c[0]+32).chr}
end
regular expressions, closureshow much more convoluted can you get :
Ruby.
On Aug 9, 2010, at 12:51 PM, Rick Root wrote:
Oh, I like! but.. heh, what language is that? =)
Rick
On Mon, Aug 9, 2010 at 1:36 PM, Zaphod Beeblebrox
zaph0d.b33bl3b...@gmail.com wrote:
def lowercase(string)
string.gsub(/([A-Z])/) {|c| (c[0]+32).chr}
end
regular
In ColdFusion, but less convoluted.
REReplace(string, '^(.+)$', '\U\1\E')
^(.+)$ - starting at the beginning of the string, capture all
characters till the end
\U - make all characters after it upper case until a \E is reached.
24 matches
Mail list logo