[cfaussie] Converting boolean YES to true

2011-08-04 Thread Steve Onnis
I have been coming across this issue more and more when dealing with JavaScript and JSON which is ColdFusion changing true|false to YES|NO values. For example:- cfset foo = true / cfoutput#foo#/cfoutput = true cfset foo = !foo / cfoutput#foo#/cfoutput = NO Now take this JSON

Re: [cfaussie] Converting boolean YES to true

2011-08-04 Thread Zac Spitzer
It's an annoying bug in Adobe CF, Railo works as expected http://stackoverflow.com/questions/1867728/how-can-i-prevent-serializejson-from-changing-yes-no-true-false-strings-to-boolea/6661460#6661460 z On Thu, Aug 4, 2011 at 4:39 PM, Steve Onnis st...@cfcentral.com.au wrote: I have been coming

Re: [cfaussie] Converting boolean YES to true

2011-08-04 Thread Barry Beattie
Also can anyone one recommend a way to do this now? I tried JavaCast(“Boolean”, foo) but that didn’t work. have you seen this? http://www.coldfusionmuse.com/index.cfm/2010/2/5/Booleans.and.Coldfusion Also, have you confirmed you have a true boolean? What I'm getting at is the difference between

RE: [cfaussie] Converting boolean YES to true

2011-08-04 Thread Steve Onnis
Wrong way I want it to be true|false -Original Message- From: Zac Spitzer [mailto:zac.spit...@gmail.com] Sent: Thursday, 4 August 2011 4:56 PM To: cfaussie@googlegroups.com Subject: Re: [cfaussie] Converting boolean YES to true It's an annoying bug in Adobe CF, Railo works as expected

RE: [cfaussie] Converting boolean YES to true

2011-08-04 Thread Steve Onnis
And that is dealing with the structures itself. I am dealing with single variables as per my example. No json conversion or anything. I want !true to give me false, not NO -Original Message- From: Zac Spitzer [mailto:zac.spit...@gmail.com] Sent: Thursday, 4 August 2011 4:56 PM To:

Re: [cfaussie] Converting boolean YES to true

2011-08-04 Thread Paul Kukiel
Its odd that !true is NO but cant you just use if/else to accomplish this till(if) Adobe fix this? Paul On Thu, Aug 4, 2011 at 5:04 PM, Steve Onnis st...@cfcentral.com.au wrote: And that is dealing with the structures itself. I am dealing with single variables as per my example. No json

RE: [cfaussie] Converting boolean YES to true

2011-08-04 Thread Steve Onnis
Yeah it can be fixed with if/else but should it be? We want to write less code, not more...true ? or maybe it is YES J From: Paul Kukiel [mailto:kuki...@gmail.com] Sent: Thursday, 4 August 2011 5:13 PM To: cfaussie@googlegroups.com Subject: Re: [cfaussie] Converting boolean YES to true

Re: [cfaussie] Converting boolean YES to true

2011-08-04 Thread Paul Kukiel
I agree Steve !true should be false but I'm not sure if there is an easier way until ( if ) this ever gets addressed by Adobe. Paul On Thu, Aug 4, 2011 at 5:14 PM, Steve Onnis st...@cfcentral.com.au wrote: Yeah it can be fixed with if/else but should it be? We want to write “less” code, not

Re: [cfaussie] Converting boolean YES to true

2011-08-04 Thread Chong
TBH you would have to fix it yourself, I can't see Adobe fixing it soon as it is likely a legacy issue, I would imagine if they change how it works to the way we expect it should, any code using specifically the old behaviour would error ... so they are probably stuck till they can agree on an

Re: [cfaussie] Converting boolean YES to true

2011-08-04 Thread Barry Beattie
so, what's !YES ... is it NO? is anything that can be construed as a YES (True, 1, etc) considered a YES and therefore the opposite is NO? On Thu, Aug 4, 2011 at 5:30 PM, Chong kck...@gmail.com wrote: TBH you would have to fix it yourself, I can't see Adobe fixing it soon as it is likely

Re: [cfaussie] Converting boolean YES to true

2011-08-04 Thread Mark Mandel
#(value ? true : false )# There you go. CF is dynamic, so true is YES is 1... if you want static values, use a static language. There are pros and cons both ways. Mark On Thu, Aug 4, 2011 at 5:33 PM, Barry Beattie barry.beat...@gmail.comwrote: so, what's !YES ... is it NO? is anything

Re: [cfaussie] Converting boolean YES to true

2011-08-04 Thread AJ Mercer
heads up - this is CF9 ( Railo 3.3 code) On 4 August 2011 15:40, Mark Mandel mark.man...@gmail.com wrote: #(value ? true : false )# There you go. CF is dynamic, so true is YES is 1... if you want static values, use a static language. There are pros and cons both ways. Mark -- *AJ

RE: [cfaussie] Converting boolean YES to true

2011-08-04 Thread Steve Onnis
They can leave it as it is. If they add a toBoolean() function then the existing functionality can remain but we can use this function to actually give a proper Boolean value From: Chong [mailto:kck...@gmail.com] Sent: Thursday, 4 August 2011 5:31 PM To: cfaussie@googlegroups.com Subject:

Re: [cfaussie] Converting boolean YES to true

2011-08-04 Thread Dennis Clark
The issue here is not one of static vs. dynamic languages. JavaScript is dynamic but doesn't have this difficulty with booleans that Adobe CF has. The problem is due to two characteristics of Adobe CFML: 1. Boolean is not a true primitive type. 2. Boolean operators return the string YES

RE: [cfaussie] Re: ColdFusion, Tomcat, IIS7 question

2011-08-04 Thread charlie arehart
Nkosi, I think you may be on a bit of a (needless) wild goose chase. Going back to your first note said; ... we cannot figure out how we can get our CF sites to run without requiring WEB-INF [and CFIDE] in the root of our sites. This basically means our CF Admin is browsable via our web site

RE: [cfaussie] JavaScript equivelant to HASH function

2011-08-04 Thread charlie arehart
Steve, you've mentioned 3 really unrelated subjects in this thread: hashing and encoding, and others have mentioned encrypting. So which is it you really need? In your last note, you say I am passing some JSON strings around which i want to just encode and decode elsewhere. Perhaps if you explain

RE: [cfaussie] Re: Preserve Carriage returns from textarea in HTML mail.

2011-08-04 Thread charlie arehart
No, Gavin. As I said in the note below (On Aug 2, 10:49 pm), Thanks, Gavin. I'd want to fix anything I could, but I don't see what's failing. Can you be more specific, please? The Adobe link works, right? http://www.adobe.com/cfusion/exchange/index.cfm?event=extensionDetailextid= 1000713

RE: [cfaussie] JavaScript equivelant to HASH function

2011-08-04 Thread Steve Onnis
I just don't want it human readable. Like i have foo.cfm?{var:val} and i just want to encrypt the query string and decrypt it in the foo.cfm page -Original Message- From: charlie arehart [mailto:charlie_li...@carehart.org] Sent: Thursday, 4 August 2011 10:31 PM To:

RE: [cfaussie] JavaScript equivelant to HASH function

2011-08-04 Thread charlie arehart
Well, are you sure that's really all you mean? Because you can make it non-human readable by encoding it, but someone can decode it. So the question is, in saying non-human readable, do you mean merely not obviously so (encoding), or not possibly so (encrypting, though of course even that's not

RE: [cfaussie] JavaScript equivelant to HASH function

2011-08-04 Thread Dale Fraser
Well, That's not a hash, that's encryption. Im not sure how you do that in Javascript without a key, and they key would need to be in the javascript code. I guess you could ajax call back to the server to get the key to encrypt the paramaters, but a sniffer would see the key. If you don't care

RE: [cfaussie] JavaScript equivelant to HASH function

2011-08-04 Thread Steve Onnis
Charlie I just mean not obvious as you say. It is for an admin system so from a client perspective it is more of a perceived security thing more than anything else. I don't like passing things around the URL as it is so this is just to make it more difficult to tamper with -Original