[cfaussie] Re: cflocation fails in CF10 but fine in CF9

2013-11-21 Thread Adam Cameron
I don't know how this *ever* worked. One cannot have both content *and* a 
redirect in a response.  sets the HTTP status header to do a 
 302 redirect, but for that to work, one must've have yet sent any content 
down to the browser. Because the first thing that gets sent in a response 
are the headers. Once the response has started being sent to the browser 
one cannot change the HTTP status code, so one cannot use  to 
redirect.

The only difference perhaps is that CF9 didn't used to send any content 
down to the browser until the end of the request or a  is 
encountered, but maybe CF10 starts spooling the response down to the 
browser as soon as it has [some amount] of content there?

Either way, the code is "wrong", and relies on a vagary of CF's behaviour 
to work, rather than it working by design.

-- 
Adam


On Wednesday, 20 November 2013 07:08:18 UTC, Mark Picker wrote:
>
> Hi,
>
>  
>
> I did post this to stackoverflow a month or so ago (
> http://stackoverflow.com/questions/19416810/cflocation-no-longer-working-in-cf10)
>  
> but didn’t end up with any follow up answers after working out the real 
> source of the problem.  Hoping someone on here has some ideas.
>
>  
>
> I have a multi-step process that runs overnight. The process is made up of 
> about 10 files that chain together using cflocation (only follows 
> cflocation if no errors were detected).  This was working fine until I 
> moved from CF9 to CF10.  Code works fine until it hits cflocation tag.  Has 
> anyone seen an issue with cflocation not working in CF10 vs. CF9?
>
>  
>
> I’ve been able to reproduce this problem with 2 files:
>
>  
> *index.cfm*
>  
>
> Testing cflocation
>
>  
>
> 
>
> row #i#: 
> abcdefghijklmnopqrstuvwxyz0123456789abcdefghijklmnopqrstuvwxyz0123456789abcdefghijklmnopqrstuvwxyz0123456789abcdefghijklmnopqrstuvwxyz0123456789
>
> 
>
>  
>
> Now loading resultpage via cflocation
>
> 
>  
>  
> *resultpage.cfm*
>  
>
> Made it!
>
> Reload the first page
>
>  
>
> In my testing I found that if I looped 6808 times it works but 6809 times 
> fails. With 7000 records we are only talking about a 36 KB file….any clues 
> why this is failing only in CF10?
>
>  
>
> Cheers
>
> Mark
>

-- 
You received this message because you are subscribed to the Google Groups 
"cfaussie" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cfaussie+unsubscr...@googlegroups.com.
To post to this group, send email to cfaussie@googlegroups.com.
Visit this group at http://groups.google.com/group/cfaussie.
For more options, visit https://groups.google.com/groups/opt_out.


[cfaussie] Re: Weird Problem Element is Undefined problem

2009-11-25 Thread Adam Cameron
If you do a collection/item loop over the struct, can you fetch the
value?  Is there any chance the key has got some leading or trailing
space in it, which would not be completely obvious in a ?

Can you post your actual code in which you're seeing this?  There
might be a typo you're not seeing, or something.

--
Adam


On Nov 25, 6:37 pm, KC Kuok  wrote:
> When I try to get key value from a structure I get an error however if
> I do a dump function, I can see the struct AND the variable which is
> referred to similarly.
>
> E.g.
> ...
> ThisValue = STRUCTVARIABLE.THISFOREIGNKEY;
> ...
>
> I get
>
> Element THISFOREIGNKEY is undefined in STRUCTVARIABLE
>
> However If I do a dump function, dodump(STRUCTVARIABLE) or even dodump
> (STRUCTVARIABLE.THISFOREIGNKEY ) just before that line I can see the
> entire structure or just the value respectively. I can't see what is
> wrong, could this be a cfscript related bug ? Or am I missing
> something real obvious ?
>
> One of the things I thought maybe wrong is the scope, but even then it
> does not seem that anything is wrong with it...
>
> Dodump() is just a regular cffunction which passes the args to cfdump
> inside.
>
> Any thoughts?
>
> Thanks in advance!
> Chong

--

You received this message because you are subscribed to the Google Groups 
"cfaussie" group.
To post to this group, send email to cfaus...@googlegroups.com.
To unsubscribe from this group, send email to 
cfaussie+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/cfaussie?hl=en.




[cfaussie] Re: RegEx Banging Head

2008-11-25 Thread Adam Cameron

CF's regexes are greedy by default, so a * will match the longest
string possible.  If you want it to match the smallest string
possible, you need to modify it with a ?.

It seems to me like you've perhaps not read the regex stuff in
livedocs?  Or at least perhaps you could do with giving it a once-over
again, if it's not fresh in your memory:

http://livedocs.adobe.com/coldfusion/8/regexp_01.html

Those docs are amongst the most useful ones I've read on regexes.
Plus they have the bonus of only covering the flavour of regex that CF
implements!

--
Adam
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"cfaussie" group.
To post to this group, send email to cfaussie@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cfaussie?hl=en
-~--~~~~--~~--~--~---



[cfaussie] Re: RegEx Banging Head

2008-11-25 Thread Adam Cameron

On Nov 24, 11:58 pm, "Steve Onnis" <[EMAIL PROTECTED]> wrote:
> REReplaceNoCase(string, "([^<]*)",
> "\3", "ALL");

Hi Steve.
I'm not sure this bit is right:

[^(href)]

That matches any single character that is not "(", "h", "r", "e", "f"
or ")".  square brackets mean "match a single character".  One cannot
stick parentheses in there to match a sequence (or in your attempt,
*not* match a sequence).

I think Robin's example is fine, but I'd perhaps augment it to make
sure the href is within an anchor tag (as opposed to in a link tag,
for example):

]*?href\s*?=\s*?([""'])([^\1]*?)\1[^>]*?>

Of course it depends on the source string as to whether this is
necessary.  If it's already just going to be solely the anchor tag and
its contents, there's no need for this.  However if one is parsing a
longer string holding an HTML document, this might be a safer way of
doing it.

To Dale: CF's regexes aren't that much different from JavaScript and
Perl ones, and the main differences are less-commonly-used features in
my experience (coming from CF, they're "less-commonly-used" because CF
doesn't support 'em ;-).  It's rare that when I need to look one up
that it won't work on CF.  Obviously your experience varies here,
which surprises me.

I would make a point of using regexes as much as possible.  Whenever
one finds oneself thinking that perhaps to process a string one might
need to loop over it; a regex find / replace is almost always going to
be another possible option to consider.  And they do seem a bit
impenetrable at first, but with only a superficial amount of
practise / repetition, the muddy waters start to clear.

I find this site a useful resource for explanations how various regex
expressions work: http://www.regular-expressions.info/tutorial.html

Oh, and Robin: cheers for the heads-up re that Eclipse plug-in.  I
also use regex coach: http://www.weitz.de/regex-coach/

--
Adam
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"cfaussie" group.
To post to this group, send email to cfaussie@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cfaussie?hl=en
-~--~~~~--~~--~--~---



[cfaussie] Re: 301 redirect not changing URL

2007-12-18 Thread Adam Cameron

Hi Ryan
What browser are you seeing this in?

I've just tested this in IE7, FF2, Opera9, and all work as one would
expected, with redirected (dest.cfm in this case) URL in the address
bar.  Test code:

{code}
source.cfm

http://localhost:8302/shared/cf/cfml/
header/dest.cfm">

dest.cfm

{code}

NB: to whomever said either a 301 or a 302 is a server-side redirect:
they're both client-side.  This should be obvious by the fact that for
the redirect to be implemented, they send an HTTP status code.  Where
do you think they're *sending* the status code?  To the browser (you
can see this if you use a packet sniffer to watch the HTTP requests
from the broeser: there'llbe two: a 301 and a 200).  The redirect code
tells the browser "actually you'll be wanting this URL (and for this
reason)".  For this sort of thing you definitely *want* a client-side
message (ie: the 301), because it tells search engines to stop trying
that URL, and use the new one instead.  With humans, it probably
doesn't matter so much.

--
Adam
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"cfaussie" group.
To post to this group, send email to cfaussie@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cfaussie?hl=en
-~--~~~~--~~--~--~---



[cfaussie] Re: super.init( argumentsCollection = arguments ); Major dramas...!

2007-11-28 Thread Adam Cameron

> I think that's a bug in CF - super.xxx functions don't accept
> argumentCollection.

Which version of CF, Blair?

Seems to work OK for me (7,0,2,142559, Enterprise, Windows XP).

--
Adam
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"cfaussie" group.
To post to this group, send email to cfaussie@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cfaussie?hl=en
-~--~~~~--~~--~--~---



[cfaussie] Re: super.init( argumentsCollection = arguments ); Major dramas...!

2007-11-28 Thread Adam Cameron

Have you done all the usual "make CF notice small changes to the
source code" hoop-jumping like clear out any cached classes in the
cfclasses dir, restarted the CF service, etc?

--
Adam
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"cfaussie" group.
To post to this group, send email to cfaussie@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cfaussie?hl=en
-~--~~~~--~~--~--~---



[cfaussie] Re: super.init( argumentsCollection = arguments ); Major dramas...!

2007-11-27 Thread Adam Cameron

I doubt argumentScollection ever worked on your dev box.  Well not in
the way you'd want it to, anyhow.

(Everyone has done this @ some point).

--
Adam
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"cfaussie" group.
To post to this group, send email to cfaussie@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cfaussie?hl=en
-~--~~~~--~~--~--~---



[cfaussie] Re: Having a bad day with this problem

2007-10-08 Thread Adam Cameron

Are you locked into that node / parentNode hierarchy model?  It's not
very efficient.

There are more than one ways of skinning a cat here, if you're in a
position to drop that particular approach...

That said, it's doable in one query on Oracle with CONNECT BY PRIOR.
I think SQL Server 2005 has a similar construct (but 2000 does not).

--
Adam


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"cfaussie" group.
To post to this group, send email to cfaussie@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cfaussie?hl=en
-~--~~~~--~~--~--~---



[cfaussie] Re: Posting to Adobe forums

2007-09-25 Thread Adam Cameron

Aah, cool: that explains it ;-)

I had a shufti around the actual CF area, but didn't think to look at
the "top level" of the forums.

One might have thought they'd put that boilerplate on all pages.

Cheers.

--
Adam


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"cfaussie" group.
To post to this group, send email to cfaussie@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cfaussie?hl=en
-~--~~~~--~~--~--~---



[cfaussie] Posting to Adobe forums

2007-09-25 Thread Adam Cameron

Hi
I'm having some problems accessing the Adobe CF forums (http://
www.adobe.com/cfusion/webforums/forum/index.cfm) @ present:

1) nothing's coming through on the news feed;
2) on the web interface, there are no links to add new posts or
respond to existing posts.  I have verified this on two different
login accounts.

How's it looking for anyone else who happens to use those facilities?

--
Adam


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"cfaussie" group.
To post to this group, send email to cfaussie@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cfaussie?hl=en
-~--~~~~--~~--~--~---



[cfaussie] Re: Cannot find key in struct.

2007-09-20 Thread Adam Cameron

This technique of yours, Mark, is a bit grim in my view (and it's just
that: my opinion only).

It's only relevant if one doesn't know the key name already, as one
CAN do this, quite happily:

getStruct().key

So this means it's only useful in a situation in which we're using a
runtime value for the key name, AND we don't want to actually use the
struct for anything other than getting that one key, because if one
wanted another key, one would need to call getStruct() again, and
that's a bit lazy.

And at the base level, it doesn't quite sit right with me that one
would be using a getter for a "non-predefined".  It's as if one
doesn't know what member variables one's object has.  Which... I
dunno, doesn't seem "right".

What's a real world use case for this technique, Mark?

Sure, it demonstrates a usage of structFind(), which was what you're
pointing out, but I'm not sure how often it's a technique that would
be something to recommend.

--
Adam


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"cfaussie" group.
To post to this group, send email to cfaussie@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cfaussie?hl=en
-~--~~~~--~~--~--~---



[cfaussie] Re: Cannot find key in struct.

2007-09-18 Thread Adam Cameron

> If you try and output "struct[key]" and the key doesn't exists that it will
> error

Sure.  As with structFind().

Hence my question.


> I think maybe you have confused the meaning of your message :)

Maybe.  Or maybe... not.

--
Adam


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"cfaussie" group.
To post to this group, send email to cfaussie@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cfaussie?hl=en
-~--~~~~--~~--~--~---



[cfaussie] Re: Function local variables scope

2007-07-03 Thread Adam Cameron

> I'm inside a function and I want to cfdump the functions local scope.



--
Adam


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"cfaussie" group.
To post to this group, send email to cfaussie@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cfaussie?hl=en
-~--~~~~--~~--~--~---



[cfaussie] Re: isDefined() bad?

2007-06-04 Thread Adam Cameron

isDefined() will sometimes return false positives when dealing with
SESSION-scoped variables.  I do not recall which version of CF this
was on, but would have been no earlier than 6.1.  Ihave not re-
verified this on subsequent versions.  At that point in time I
switched to using structKeyExists(): I simply don't trust isDefined().

The situation was unpredictable, but replicable (if one was patient
during re-testing).

It seemed fine with all variable scopes other than session.

isDefined() is also limited to using variables using CF's "simple
variable name format", whereas structKeyExists() is not.

--
Adam


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"cfaussie" group.
To post to this group, send email to cfaussie@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cfaussie?hl=en
-~--~~~~--~~--~--~---



[cfaussie] Re: coldfusion tags in a string

2007-05-04 Thread Adam Cameron

> So back to the question, can cf tags be put in a string to be used in
> another tag later?

Short answer: no.

Mid-length answer:
You've got to think about the CF live cycle.  What you see as source
code isn't actually what's finally executed.  Before it's executed,
CFML is "compiled" into Java bytecode, and *that* is executed.  For
CFML tags to "run", they need to already be there at "compile
time" (as opposed to "run time", which is when your string exists).

This is the same reason why one cannot "build" CFML statements out of
other CFML statements at runtime - which is a question that does the
round on various forums every week or so - and expect the built
statements to somehow run.

Long answer:
The best you can hope for is to write your string to a file, and then
include it.  Even with CF's gains in this area over the last few
versions, this is a slow solution, as your runtime file needs to be
compiled (slow) before it's executed.

For your  situation, what I've done is to re-implement
 as a function, and include in that processing for swapping
out a token (by default, it's {cfqp}) in my SQL string for a
 tag, populating it from an array of structs also passed-
in to the function.  Someone else had written a far more elegant
solution a while back which DID allow for in-line #cfqueryParam()#
calls in the SQL string, which again was subsequently re-processed as
a  tag by the cfquery() function.  I've lost his source
code, so am in the process of re-implementing my own.  I'm 90% of the
way through it... just waiting for a spare hour to finish it.  My
development paused for reflection a bit when I found out that there
are [cough] "things on the horizon" which will make re-implementing CF
tags as functions *much* *much* *much* easier.  Once it's released.

--
Adam


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"cfaussie" group.
To post to this group, send email to cfaussie@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cfaussie?hl=en
-~--~~~~--~~--~--~---



[cfaussie] Re: coldfusion tags in a string

2007-05-04 Thread Adam Cameron

> How can this be a security Risk
>
> 
>  where someField = 
> 
>
> 
>  select * from some table
>  #test#
> 

Given it simply won't work?  The only security risk would be your JOB
security, I should think ;-)

--
Adam


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"cfaussie" group.
To post to this group, send email to cfaussie@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cfaussie?hl=en
-~--~~~~--~~--~--~---



[cfaussie] Re: coldfusion tags in a string

2007-05-04 Thread Adam Cameron

> But I will say that if this is inside a cffunction and its being validated
> as arguments. You can skip the cfqueryparam anyway.

Well that's only half (maybe as much as half) true.

 values are as much about query compilation and improved
DB server  erformance and memory management as they are about data
validation.

--
Adam



--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"cfaussie" group.
To post to this group, send email to cfaussie@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cfaussie?hl=en
-~--~~~~--~~--~--~---



[cfaussie] Re: Java inner classes

2007-04-26 Thread Adam Cameron

Way hey!  Sorted it.

Once I RTFM'ed, I saw where I was going wrong:



And from the Java docs for field:


Throws:
IllegalArgumentException - in any of the following situations:

* the field is neither stored nor indexed


So, yeah... that'd be why I got the error.  Once I changed the
Field.Store to YES, it worked.

It's like pulling teeth, but I'm getting there.

--
Adam


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"cfaussie" group.
To post to this group, send email to cfaussie@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cfaussie?hl=en
-~--~~~~--~~--~--~---



[cfaussie] Re: Java inner classes

2007-04-26 Thread Adam Cameron

[sorry didn't see your follow-up Grant, was busy writing mine]

Cheers.

--
Adam


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"cfaussie" group.
To post to this group, send email to cfaussie@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cfaussie?hl=en
-~--~~~~--~~--~--~---



[cfaussie] Re: Java inner classes

2007-04-26 Thread Adam Cameron

Cheers all.

Just some notes:
1) Andrew, I think you have misread what I asked.  Yes, I pointed you
@ some constructors.  What you were supposed to be noting was that
those constructors require arguments of type Field.Index, Field.Store,
Field.TermVector, which are inner classes.  Make sense now?

2) Grant's example doesn't work (in case anyone else was tempted to
run with it).  One's never going to get very far trying to instantiate
a Java object as a "component" (I presume that's just a brain-fart,
though), but more importantly the class-reference syntax seems wrong.
Or at least it is at odds with what a few other people have come up
with, and indeed it just errors.

3) MrBuzzy: cheers, that's it.  The Adobe article is, however, a bit
misleading in saying this: "You cannot call Java inner classes
directly in ColdFusion".  Because, as MrBuzzy demonstrates, you can.

4) Using MrBuzzy's syntax, I see what Grant is talking about: despite
creating the objects just fine, the constructor code just errors with
- rather unhelpfully - " An exception occurred when instantiating a
java object. The cause of this exception was that: ." back from CF.
Accessing the objects in isolation works fine, but CF is buggering
something up between instantiation and using them in the constructor.

EG:
 
 
 

 
 


 

NB: using the Field(String name, Reader reader) constructor works
fine, but I don't want to do that.

I've yet to finish exploring this, though, and if I nut it out, I'll
pass it on.

I am leaning towards Grant's / MrBuzzy's suggestions of wrapping this
stuff in a quick Java class, written in such a way that the methods
only expect data types CF is comfortable with.

All interesting stuff.

Cheers again.

--
Adam


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"cfaussie" group.
To post to this group, send email to cfaussie@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cfaussie?hl=en
-~--~~~~--~~--~--~---



[cfaussie] Java inner classes

2007-04-25 Thread Adam Cameron

G'day
How does one - in CF - refer to an inner class (ClassFoo.Bar) of a
given
class (ClassFoo), when the constructor of ClassFoo takes an argument
of
type ClassFoo.Bar?

For example the first, third,fourth and fifth constructors shown here:
http://tinyurl.com/hfg9s (org.apache.lucene.document.Field).

Any ideas?

--
Adam

(PS: first posted to the Adobe CF forums: http://tinyurl.com/2r3w84)


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"cfaussie" group.
To post to this group, send email to cfaussie@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cfaussie?hl=en
-~--~~~~--~~--~--~---



[cfaussie] Re: CFQUERYPARAM was RE: [cfaussie] Re: @#$!! queryparam

2007-03-05 Thread Adam Cameron

> Databases weren't designed to dynamically updated at runtime, and never have
> been - so you will end up hitting brick walls there.

Can you explain to me what you mean by "runtime", in the context of a
DB engine?  In such a way that distinguishes between me using CF as a
DB client or using Query Analyser / Enterprise Manager / TOAD / SQL
Developer as a client, I mean.

--
Adam


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"cfaussie" group.
To post to this group, send email to cfaussie@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cfaussie?hl=en
-~--~~~~--~~--~--~---



[cfaussie] Re: CFQUERYPARAM was RE: [cfaussie] Re: @#$!! queryparam

2007-03-05 Thread Adam Cameron

> Most database (including SQLServer) presume that the database structure does
> not change between re-uses of parameterized queries.

What a strange presumption for them to make!  Sure, table-schema
updates are rare compared to table-queries, but it's not like the DB
doesn't *know* when the table gets updated, and accordinly is
completely unprepared for the ramifications of such.  So it should be
sensible enough to go "well all those compiled queries that use that
table ambiguously (like the ones with select *)... out the window you
go: you'll have to be recompiled next time".  That is better than just
going "err... I have no idea what you're talking about any more [face
plant]".

Does Oracle behave like this?

--
Adam


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"cfaussie" group.
To post to this group, send email to cfaussie@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cfaussie?hl=en
-~--~~~~--~~--~--~---



[cfaussie] Re: refindnocase - trouble returning array

2007-03-01 Thread Adam Cameron

reFindNoCase() only returns the first match; it does not return an
array of all matches.

When you pass the returnsubexpressions=true argument, it does what it
says on the box: it returns an array of any subexpressions *of the
regex*.

http://livedocs.adobe.com/coldfusion/7/htmldocs/0607.htm

Java regexes work the same way (not surprising as CF regex are just
wrapped up Java ones).

http://java.sun.com/j2se/1.4.2/docs/api/java/util/regex/Matcher.html

You'll need to do the looping approach as suggested, or a regex
replace of *everything else* in the string that doesn't match your
requirements.

--
Adam


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"cfaussie" group.
To post to this group, send email to cfaussie@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cfaussie?hl=en
-~--~~~~--~~--~--~---



[cfaussie] Re: Talking of evaluate()

2006-12-08 Thread Adam Cameron

G'day Mat
I hate to be a fly in the ointment, but you're quite wrong with most of
what you say about isDefined() in your preceding post.

> isdefined(session.crap) will return true

It will error.  If your double-quote key is missing and you actually
mean isdefined("session.crap") (which is a different, but valid
construct), it will return false.

> isdefined(crap) should be true

Again, it'll error or it'll be false, depending on whether you meant it
to have quotes.  isDefined() does NOT inspect the session scope unless
you ask it to (by specifying it).


where as isdefined("
session.crap) could find an incorrect variable
You can see there is a diff if you have 2 vars

session.session.crap
and
session.session.session.crap
in the one page.


No it won't.  Because isDefined("session.crap") will find neither of
those.  It's not quite *that* stupid as a function.

Are you sure you're not thinking of structFindKey(), which DOES behave
kinda along the lines you're suggesting?

What isDefined() WILL do that could either suck or be "actually we
meant it to be that way" depending on whether you either "use CF for a
living" or "work for Adobe", is that isDefined("foo") will return true
if there's a key "foo" in any of the scopes mentioned here:
http://livedocs.macromedia.com/coldfusion/7/htmldocs/0914.htm

However not for the session scope.

This can lead to unexpected behaviour.  Well: if one's paying
attention, it shouldn't be unexpected, I guess.  Or one could always
scope one's variables, in which case it's a non-issue.

-- 
Adam


--~--~-~--~~~---~--~~
 You received this message because you are subscribed to the Google Groups 
"cfaussie" group.
To post to this group, send email to cfaussie@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cfaussie?hl=en
-~--~~~~--~~--~--~---



[cfaussie] Re: Talking of evaluate()

2006-12-08 Thread Adam Cameron

Presume you mean:
isdefined("session.crap)"  (note: quotes)?

I tried this code:





structKeyExists(session, "crap"): #structKeyExists(session, "crap")#
isDefined(session.crap):
#isDefined(session.crap)#Didn't think that one would
work too well [#cfcatch.message#] ;-)
isDefined("session.crap"): #isDefined("session.crap")#


And it did this:
structKeyExists(session, "crap"): NO
isDefined(session.crap): Didn't think that one would work too well
[Element CRAP is undefined in SESSION.] ;-)
isDefined("session.crap"): NO


Which is what I'd expect.

CFMX: 7,0,2,142559 & 6,1,0,63958

-- 
Adam


--~--~-~--~~~---~--~~
 You received this message because you are subscribed to the Google Groups 
"cfaussie" group.
To post to this group, send email to cfaussie@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cfaussie?hl=en
-~--~~~~--~~--~--~---



[cfaussie] Re: Talking of evaluate()

2006-12-08 Thread Adam Cameron

Semantics aside, the reason I stopped using isDefined() is because it
was flaky, and returned false positives sometimes.

One could have code like this:


#session.foo#


And it *could* error, saying session.foo doesn't exist.  Note, this was
in a closed test environment, running one browser instance on one
machine with only me testing it: no possibility of race conditions, no
chance anything else was running other than the current request.
Putting debug code BEFORE the  indeed demonstrated the variable
actually DID NOT exist.

It did not happen all the time (obviously), only seemed to affect the
session scope, and was acknowledged by Macromedia @ the time.  Whoever
I was talking to there suggested structKeyExists() would not have the
problem, ever, and indeed I've never had said problem again.

It might be (should have been!) fixed since - this conversation was
back on CFMX6.1 - but it was enough to leave a bad taste in my mouth
regarding isDefined(), and structKeyExists() almost always can be used
in its place, so that's what I now use.

isDefined() also has that stupid hang-up about "properly-formed
variable names" (underscores, letters, numbers, unicode currency signs,
starts with underscore or a letter, etc), which has not actually been a
limitation in CF since CFMX6.  It's like they're not bothering to
maintain it any more..?

-- 
Adam


--~--~-~--~~~---~--~~
 You received this message because you are subscribed to the Google Groups 
"cfaussie" group.
To post to this group, send email to cfaussie@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cfaussie?hl=en
-~--~~~~--~~--~--~---



[cfaussie] Re: Talking of evaluate()

2006-12-07 Thread Adam Cameron

G'day
My testing recently suggested that terrible the performance hit one
used to get with evaluate() has all but gone now.  So that's good.

The only gripe I have with it is that people tend to over-use it: it's
seldom the correct answer to a question about dynamic variables or any
other situation where one's inclination might be to use it.

You touch on one instance when it seems to be necessary to use it, and
I can think of a couple of others, but a lot of people seem to use it
every time things get slightly confusing to them.  These are perhaps
the same people #who# #put# #pound-signs# #around# #everything#, "just
in case".

My position is this:
1) if one can reasonably NOT use evaluate(), then don't.
2) if one thinks "I need to use evaluate() for that", have another
small think about it before deciding it's the right answer.
3) and, yes, sometimes it's unavoidable.  In these cases, there's no
need to feel like one is doing something wrong.

I think it's a three-step process before settling on using it.

-- 
Adam


--~--~-~--~~~---~--~~
 You received this message because you are subscribed to the Google Groups 
"cfaussie" group.
To post to this group, send email to cfaussie@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cfaussie?hl=en
-~--~~~~--~~--~--~---



[cfaussie] Re: Is there such a thing as "undocumented features" now?

2006-12-06 Thread Adam Cameron

There's two sides to this.

1) doing something like this:


That's leveraging the fact that a CF string is actually a Java string,
and using a standard Java string method upon it.

2) 

That's leveraging the fact that a CF query is actually a Java class,
and comes with some *undocumented* methods.  However it's something the
Allaire / Macromedia / Adobe bods cooked up for their own benefit, not
ours.

The former is perfectly fine.  The latter is "use at your own risk".  I
asked on some beta programme a while ago (it might have been 6.1, I
can't remember), if they could document and "officialize" the
underlying Java methods of the internal CFMX Java classes.  The
response was "no way".  Pity.

-- 
Adam


--~--~-~--~~~---~--~~
 You received this message because you are subscribed to the Google Groups 
"cfaussie" group.
To post to this group, send email to cfaussie@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cfaussie?hl=en
-~--~~~~--~~--~--~---



[cfaussie] Re: SOT: sql datatypes

2006-12-06 Thread Adam Cameron

You're just confused, although this is not helped by me typing faster
than I was thinking, in my descriptions of the bit-usage of UTF-8, etc
(sorry, I'm @ work so was only paying 50% attention to what I was
typing).  Better not to rely on me in this case, but to read this lot:
http://en.wikipedia.org/wiki/Unicode_Transformation_Format

Anyway, to answer your question:

If you use "bytes" and specify varchar2(2000), you'll get 2000 bytes of
storage space for each row in that column.  That's obvious.

If you use "chars" and specify varchar2(2000), you'll get 2000x
[whatever the size of the char could be, for the given encoding you're
using for that column].  If it's a 4-byte character encoding, the
varchar2(2000) will be 8000 BYTES long (4x2000).

So if you use chars and say "2000, pls": you can definitely fit 2000
characters in there.  If you specify 2000 bytes... you'll be able to
fit 2000 bytes worth of characters, which given a UTF-8 character can
be 1-4 bytes each, will quite possibly be fewer than 2000 chars.

Basically the "byte semantics" comes from back in the day when we only
ever thought about english-language characters, which fitted nicely
into 7 bits, so one byte = one char worked nicely.  Now that we deal
with all sorts of different alphabets, the space needed to store a
character also varies, so trying to use a byte as a character unit
doesn't make sense, hence the character-based "semantics".

I'd be more inclined to use "characters" than "bytes".

-- 
Adam

-- 
Adam


--~--~-~--~~~---~--~~
 You received this message because you are subscribed to the Google Groups 
"cfaussie" group.
To post to this group, send email to cfaussie@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cfaussie?hl=en
-~--~~~~--~~--~--~---



[cfaussie] Re: SOT: sql datatypes

2006-12-06 Thread Adam Cameron

A byte is a standard length - almost always eight bits - which can
store 256 possible values.  I suspect that's the part you already knew
;-)

A character is often one byte in size (ASCII, for example... well:
strictly speaking that's only seven bits, but you get my drift); but
depending on the encoding scheme in use, could be two, three or more
bytes long.  In Unicode's UTF naming standard, the number at the end
(UTF-8, UTF-16, etc) denotes how many BITS each character uses.

Make sense?

-- 
Adam


--~--~-~--~~~---~--~~
 You received this message because you are subscribed to the Google Groups 
"cfaussie" group.
To post to this group, send email to cfaussie@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cfaussie?hl=en
-~--~~~~--~~--~--~---



[cfaussie] Re: CFFLUSH using script

2006-12-05 Thread Adam Cameron

You can't use  like that, but you CAN use  though.

This isn't appropriate for all situations, but is handy to know.

-- 
Adam


--~--~-~--~~~---~--~~
 You received this message because you are subscribed to the Google Groups 
"cfaussie" group.
To post to this group, send email to cfaussie@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cfaussie?hl=en
-~--~~~~--~~--~--~---



[cfaussie] Re: SQL Functions for QoQ

2006-12-04 Thread Adam Cameron

Sure.  OK, there's no LIST of "these are all the functions", but those
docs cover the entire gamut of SQL functionality (such as it is) that
is supported by QoQ.

Suggest you read the entire section.

There isn't much to it: QoQ's SQL support is rubbish.

There's a CFMX6 QoQ BNF here:
http://livedocs.macromedia.com/coldfusion/6.1/htmldocs/using_39.htm

upper(), lower() and cast() are the only omissions from it

-- 
Adam


--~--~-~--~~~---~--~~
 You received this message because you are subscribed to the Google Groups 
"cfaussie" group.
To post to this group, send email to cfaussie@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cfaussie?hl=en
-~--~~~~--~~--~--~---



[cfaussie] Re: SQL Functions for QoQ

2006-12-04 Thread Adam Cameron

> Anyone know the list functions ColdFusion knows in Query of Queries? I
> can't find a definitive list anywhere.

Livedocs covers it:
http://livedocs.macromedia.com/coldfusion/7/htmldocs/1266.htm

The section on "Using aggregate functions" is complete.

-- 
Adam


--~--~-~--~~~---~--~~
 You received this message because you are subscribed to the Google Groups 
"cfaussie" group.
To post to this group, send email to cfaussie@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cfaussie?hl=en
-~--~~~~--~~--~--~---