AW: Can anyone explain this?
Hi, if you manually pass the values for CFID and CFTOKEN from page to page (or enable cookies), they won't change anymore and indeed CF stores these values and along with them stores all session variables for that user. Whenever the user tries to access a session variable, CF looks up the users CFID and CFTOKEN in server memory and retrieves the associated session var. HTH, Chris -Ursprüngliche Nachricht- Von: sebastian palmigiani [mailto:[EMAIL PROTECTED]] Gesendet: Samstag, 27. Januar 2001 05:52 An: CF-Talk Betreff: Re: Can anyone explain this? Do these "session cookies" help to connect session variables with a particular user? I don't see how as their values change from page to page. What is the purpose of these "session cookies?" Sebastian on 1/26/01 9:43 PM, David E. Crawford at [EMAIL PROTECTED] wrote: These are "session cookies", which are not written to the "cookie" file, but exist in memory, but not necessarily between pages. DC - Original Message - From: "sebastian palmigiani" [EMAIL PROTECTED] To: "CF-Talk" [EMAIL PROTECTED] Sent: Friday, January 26, 2001 22:31 Subject: Can anyone explain this? Can anyone explain this? I have cookies disabled. I have session management and setclientcookies set to yes in application.cfm. I am using CF 4.0 On each page I put the following code: cfoutput#cookie.cfid#br#cookie.cftoken#/cfoutput There are no cookies listed in the Parameters CGI variables of each page. And yet for each page I get a different value for cfid which increments by one and a different value for cftoken. Sebastian ~~ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
Re: (WOT) Sample code for COM object wrappers for Stored Procedures
Why ... n-tier development. Typically 3 tiers: presentation, business logic and backend processing. And the COM component is the middle tier ... enforcing business rules. ASP/CF acts as the presentation tier with T-SQL as the third tier. Why n-tier development ... because of scalability, security, control of critical resources, maintainability, etc. The middle-tier COM component can distribute requests across multiple resources/servers. Also, these middle-tier objects can be MTS-ized [Microsoft Transaction Server] ... thus providing connection polling and multi-object transactional processing. It is awful early ... hope that helps. Bill In a message dated 1/26/01 10:13:53 PM Eastern Standard Time, [EMAIL PROTECTED] writes: Can I ask why you would want to use a COM object to access a Stored Procedure instead of just calling the procedure directly? ~~ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
Re: ALLR/MACR Merger - ColdFusion to be repositioned ?????
"Repositioned" eh? Sounds like a major screw-up is in the offing. Rick - Original Message - From: "Dave Watts" [EMAIL PROTECTED] To: "CF-Talk" [EMAIL PROTECTED] Sent: Friday, January 26, 2001 2:06 PM Subject: RE: ALLR/MACR Merger - ColdFusion to be "repositioned" ? In the past, Macromedia has made a point of NOT participating directly in the application server business but rather to partner with leader's in the space. Management is aware of this issue and pointed out that Allaire's flagship product, ColdFusion, would be repositioned such that Allaire's CFML technology would be maintained and that applications built with CFML will run on top of application servers from other vendors. This isn't that confusing. The version 6 release of CF, which will merge CF and JRun, will really be a CFML interface on top of the JRun engine. CFML scripts will be compiled into Java servlet class files, similar to how JSP files are handled by servlet engines now. If you write servlet/JSP code now, you can move that code from one Java application server to another pretty easily. If CFML code becomes just another way to write servlets, then there's no reason that those servlets couldn't be moved across application servers as well. The end result of this, of course, would be to broaden the potential market for CFML development quite a bit. The general direction of web application server vendors is moving this way already - web development languages becoming independent from OS and application server platforms. Microsoft is even promising that .NET applications will be available on non-Windows platforms! Dave Watts, CTO, Fig Leaf Software http://www.figleaf.com/ voice: (202) 797-5496 fax: (202) 797-5444 ~~ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
Re: [Get newest record?]
max(orderid) "Jon Hall" [EMAIL PROTECTED] wrote: I have a query that returns placed orders by a customer. How would I pull olny the newest order by a particular customer? I have a datestamp field and an autonumber id field if that helps... I know I could do SELECT TOP 1 * FROM orderTable WHERE usercode = 'usercode' ORDER BY orderdatetime DESC But this seems rather ineffiecient, anyone know of a better way? jon ~~ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
Re: Why can't you see the cookies?
On 1/27/01, sebastian palmigiani penned: I have following code in application.cfm: cfif NOT IsDefined("COOKIE.cfid") OR NOT IsDefined("COOKIE.cftoken") cfinclude template="NoCookie.cfm" cfabort /cfif I have cookies turned off and no matter what page I am on this code is not picking up the fact that these 2 cookies don't exist. Yet when I make up a fictitious cookie name and test for it's existence then this code works. What is going on here? Sebastian When a cookie is set, it exists at that point in time, even if the user's browser doesn't accept it. So, if you have setclientcookies="yes" in your cfapplication tag, then cookie.cfid and cookie.cftoken will exist every time a page loads. Try it. Put cfcookie name="test" value="1" expires="1" cfoutput#cookie.test#/cfoutput cookie.test will return 1 even if cookies are off. Here is the code I use, which will try and set a cookie on entering the site, then look for it on the first click. Keep in mind that you will need to pass the cfid and cftoken in a query string for the 2nd click, or CF won't KNOW it's the second click if cookies are off. This code is based on client variables, but can be changed easy enough for session variables. You could then set just before the last /cfif tag: cfset nocookie = 1 Then where you want to include your nocookie.cfm page: cfif isdefined('nocookie') cfinclude template="NoCookie.cfm" /cfif Remember, this isn't going to work until first click and you will need to make any links look like this to pass along cfid and cftoken on the first click: link.cfm?#variables.id# cfapplication name="myapplication" clientmanagement="Yes" sessionmanagement="No" setclientcookies="Yes" CFIF not isDefined('client.initialize_session') cfset client.initialize_session = now() cfelse cfset app_timeout = now() - createtimespan(0,0,20,0) CFIF client.initialize_session GTE app_timeout cfset client.initialize_session = now() CFELSE cfset clientlist = GetClientVariablesList() cfloop index="i" list="#clientlist#" cfset temp = DeleteClientVariable('#i#') /cfloop cfset client.initialize_session = now() /CFIF /CFIF CFIF not isdefined('client.rollcount')cfset client.rollcount = "1" cfcookie name="testcookie" value = "test" expires="1" cfset variables.ID = "cfid=#client.cfid#cftoken=#client.cftoken#"cfelse cfset variables.ID = "#IIf(not isDefined('cookie.mycookie'), DE ('cfid=#client.cfid#cftoken=#client.cftoken#'), DE(''))#" /CFIF -- Bud Schneehagen - Tropical Web Creations _/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/ ColdFusion Solutions / eCommerce Development [EMAIL PROTECTED] http://www.twcreations.com/ 954.721.3452 ~~ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
Re: ALLR/MACR Merger - ColdFusion to be repositioned ?????
On 1/27/01, Richard L Smith penned: I hope you're right just to be safe I learning Java Hopefully, we won't have to learn Java. Just like I don't have to know C++ to code CF now. -- Bud Schneehagen - Tropical Web Creations _/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/ ColdFusion Solutions / eCommerce Development [EMAIL PROTECTED] http://www.twcreations.com/ 954.721.3452 ~~ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
Re: AbleCommerce
On 1/26/01, Duane Boudreau penned: Can anyone tell me what is involved with setting up PGP encryption? I'm thinking of using it to encrypt the numbers while they sit in the database. It'll pretty easy with PGP and the CFX_PGP tag if the card is only being stored so the site owner can retrieve it for processing. The tag is about 400 bucks now. It will be more difficult if you are going to use the stored credit card numbers so the shopper can make future purchases with it using online processing. You would basically need to create a key pair on the person's e-mail address and password, encrypt the data with that, then decrypt the data when they checkout for future purchases. Of course, in that case, you would need to encrypt their password also or the setup would be useless. Then try and decrypt their password the next time they log in and store it as a session variable or pass it around until they checkout. If they forget their password, you won't be able to e-mail it to them since it will be encrypted. You'd have to insert some random password, e-mail it to them, let them log in, then make them them set a new password, delete the old key pair, create a new key pair. And then we have a whole NEW ballgame if their e-mail address changes. :) This can all be done with the CFX_PGP tag, but it'll take some work. Sounds like fun! LOL -- Bud Schneehagen - Tropical Web Creations _/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/ ColdFusion Solutions / eCommerce Development [EMAIL PROTECTED] http://www.twcreations.com/ 954.721.3452 ~~ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
Re: Can anyone explain this?
Just a guess, but.. You are using a CFAPPLICATION tag, correct? 1. CFAPPLICATION sets up the two cookies (CFID, CFTOKEN) and sends them to the browser. 2. Your browser isn't allowing cookies. 3.Browser hits page, CFAPPLICATION tag runs, it looks for the CFID / CFTOKEN cookies. They don't exist, so it creates them. 4.The cookies are available during the execution of the current page. 5. Cookies don't get set to the browser. Not as temporary cookies, not as permanent. 6. Click to next page and start again at number 1. Anyone want to verify? sebastian palmigiani wrote: Can anyone explain this? I have cookies disabled. I have session management and setclientcookies set to yes in application.cfm. I am using CF 4.0 On each page I put the following code: cfoutput#cookie.cfid#br#cookie.cftoken#/cfoutput There are no cookies listed in the Parameters CGI variables of each page. And yet for each page I get a different value for cfid which increments by one and a different value for cftoken. Sebastian ~~ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
Setting a Cookie
The query MemberRoles returns 2 values: 2 3 !--- Set the query to a local variable --- cfoutput query="MemberRoles" cfset Roles = RoleID /cfoutput !--- Set the local variable to a cookie --- cfcookie name="CFRoles" value="#Roles#" Only one of the values is set to the cookie which in this case the value becomes CFRoles=3 I don't understand why the value of the local variable does not become the value of the cookie. ~~ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
RE: Alphabetic List
cfset myLetters=ValueList(LetterList.Letter) cfloop index="i" from=1 to=26 cfset s=Chr(64+i) cfif ListFind(myLetters,s) gt 0 a href="file.cfm?Letter=#s#"#s#/a cfelse #s# /cfif /cfloop Actually, adjusting my previous code to make it faster - cfif myLetters contains s Contains is much faster than any List commands... Philip Arnold Director Certified ColdFusion Developer ASP Multimedia Limited T: +44 (0)20 8680 1133 "Websites for the real world" ** This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. ** ~~ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
RE: Integrating with Secure Trading
Do any of you have experience integrating a CF shopping cart with SecureTrading.com' services ?? Or can anyone impart any knowledge on what they use and how easily a CF application, maybe even Ablecommerce can integrate? We've used it, and we're not that impressed with their service... Their system now works OK, but before they had you being able to FTP your own files, it took 5 working days for them to upload a new set of our files - yup, you read right, FIVE WORKING DAYS! They also don't send out the commission checks, and we've had one of our emails broadcast on a mail-shot they did because they don't know the difference between CC and BCC On top of that, they don't respond to our emails... But, it's up to you g Philip Arnold Director Certified ColdFusion Developer ASP Multimedia Limited T: +44 (0)20 8680 1133 "Websites for the real world" ** This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. ** ~~ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
RE: CFSCRIPT performance
I have a question on CFSCRIPT performance. I know that it is quicker to use CFSCRIPT than to use CFSET. Is it likewise quicker to use the CFSCRIPT if() over CFIF? I have a CFIF checking that one of 14 empressions are met (13 ORs). Would it be better to use CFSCRIPT for this? This is for the security on a web site, so it needs to be efficient. CFScript is more efficient as long as you aren't just doing just a couple CFSET or CFIF The problem I have with CFSCRIPT and if() is that there is no elseif(), you have to embed things in the else part of the code, which gets very deep if you want to check loads of variations (and can't use switch, such as ranges) CF4.5.2 has faster looping in CFSCRIPT than in CFML, so that's an advantage Also, as Robert pointed out, no white-space! Philip Arnold Director Certified ColdFusion Developer ASP Multimedia Limited T: +44 (0)20 8680 1133 "Websites for the real world" ** This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. ** ~~ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
RE: import excel
Do you guys know of a way to insert an uploaded excel document into a database? If you have access to the server then use the database import (Enterprise Manager for SQL Server, etc.) Or, if you want to automate the process via CF; Create an ODBC link to the spreadsheet, then import it from that, Create a Link table in Access, and import it from that, Open it via COM and read it cell for cell. There are disadvantages to using ODBC - the driver reads the cell types from the "top n" rows (set in the ODBC screen if you have an Excel ODBC setup), from here, if it decides the column is Text, then it will ignore numbers, and vica-versa (sp?) Via COM you can read any cell information as you wish as you have direct access to the file - BUT you need Excel installed on the server. Philip Arnold Director Certified ColdFusion Developer ASP Multimedia Limited T: +44 (0)20 8680 1133 "Websites for the real world" ** This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. ** ~~ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
RE: count statement
I want this statement to count how many people are in the class by the date. Please help me it keeps on kicking out this error. Microsoft][ODBC Microsoft Access Driver] Syntax error (missing operator) in query expression 'count(distinct cccustomer.clname)'. cfquery name="qryGETSTUDENTS" datasource="conceal" dbtype="ODBC" SELECT classdate.id, cccustomer.dateid, count(distinct cccustomer.clname) as sum_custname FROMcccustomer, classdate WHERE classdate.id = cccustomer.dateid/cfquery Count is an aggrigate function, and you're not aggrigating any of the other fields Try grouping the other fields BTW, a little cheat I used to use when we used Access, build your queries in the Query builder - that way you can get it to make the odd SQL instead of you hassling with problems like this Philip Arnold Director Certified ColdFusion Developer ASP Multimedia Limited T: +44 (0)20 8680 1133 "Websites for the real world" ** This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. ** ~~ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
RE: RequestTimeout
Does anyone know if there is an upper limit for RequestTimeout (as set in the query string)? Not that I know of, as you can turn the whole thing off in the Admin... but remember that IE has a 5 minute limit before it spits (so you don't know if CF has finished or not) There's probably the Integer limit on numbers, but it depends if Allaire treat it internally as an Int or a Long Int (4 byte or 8 byte)... maybe I'm over-thinking this??? Philip Arnold Director Certified ColdFusion Developer ASP Multimedia Limited T: +44 (0)20 8680 1133 "Websites for the real world" ** This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. ** ~~ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
RE: Setting a Cookie
The query MemberRoles returns 2 values: 2 3 !--- Set the query to a local variable --- cfoutput query="MemberRoles" cfset Roles = RoleID /cfoutput !--- Set the local variable to a cookie --- cfcookie name="CFRoles" value="#Roles#" Only one of the values is set to the cookie which in this case the value becomes CFRoles=3 I don't understand why the value of the local variable does not become the value of the cookie. I'm sorry, but, WHAT? Since you're setting the cookie from the local variable, how can they NOT be the same? Philip Arnold Director Certified ColdFusion Developer ASP Multimedia Limited T: +44 (0)20 8680 1133 "Websites for the real world" ** This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. ** -Original Message- From: sebastian palmigiani [mailto:[EMAIL PROTECTED]] Sent: 27 January 2001 15:19 To: CF-Talk Subject: Setting a Cookie ~~ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
Re: array value not found???
My understanding of ArraySet() was that it initialized an array with some default values. Setting temp = to it was just the way it's done. That line should give me an array full of 0's. #temp[Variables.TestIndex]# doesn't work either. - Original Message - From: "Joby Bednar" [EMAIL PROTECTED] To: "CF-Talk" [EMAIL PROTECTED] Sent: Friday, January 26, 2001 6:46 PM Subject: RE: array value not found??? how about using: #temp[variables.testindex]# rather than #Evaluate('Request.arrClassListFromGroupID[#Variables.TestIndex#]')# Joby Bednar Director of Internet Design iNEOgroup.com -Original Message- From: Todd Ashworth [mailto:[EMAIL PROTECTED]] Sent: Friday, January 26, 2001 12:45 PM To: CF-Talk Subject: array value not found??? I have thise code: cfset Request.arrClassListFromGroupID = ArrayNew(1) cfset temp = ArraySet(Request.arrClassListFromGroupID, 1, 7, "0") cfloop from="1" to="7" index="Variables.TestIndex" cfoutput #Evaluate('Request.arrClassListFromGroupID[#Variables.TestIndex#]')# /cfoutput /cfloop I keep getting this message: Error Diagnostic Information An error occurred while evaluating the expression: #Evaluate('Request.arrClassListFromGroupID[#i#]')# Error near line 155, column 40. An error has occurred while processing the expression: Request.arrClassListFromGroupID[1] Error near line 1, column 34. -- -- Error resolving parameter VARIABLES.ARRCLASSLISTFROMGROUPID The specified variable name cannot be found. This problem is very likely due to the fact that you have misspelled the variable name. Shouldn't I get a '0' ?? Todd Ashworth ~~ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
Re: Setting a Cookie
That was my reaction too. But I kept checking the value of the cookie with cfoutput and it had only one value. I ended up setting the query to a list and then setting the value of the cookie to the list and it worked. Sebastian on 1/27/01 10:19 AM, Philip Arnold - ASP at [EMAIL PROTECTED] wrote: I'm sorry, but, WHAT? Since you're setting the cookie from the local variable, how can they NOT be the same? Philip Arnold Director Certified ColdFusion Developer ASP Multimedia Limited T: +44 (0)20 8680 1133 --- The query MemberRoles returns 2 values: 2 3 !--- Set the query to a local variable --- cfoutput query="MemberRoles" cfset Roles = RoleID /cfoutput !--- Set the local variable to a cookie --- cfcookie name="CFRoles" value="#Roles#" Only one of the values is set to the cookie which in this case the value becomes CFRoles=3 I don't understand why the value of the local variable does not become the value of the cookie. ~~ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
RE: CFSCRIPT performance
There is too an else if. Just do else if(). Use it all over the place. Never had a problem. Bob Everland -Original Message- From: Philip Arnold - ASP [mailto:[EMAIL PROTECTED]] Sent: Saturday, January 27, 2001 11:07 AM To: CF-Talk Subject: RE: CFSCRIPT performance I have a question on CFSCRIPT performance. I know that it is quicker to use CFSCRIPT than to use CFSET. Is it likewise quicker to use the CFSCRIPT if() over CFIF? I have a CFIF checking that one of 14 empressions are met (13 ORs). Would it be better to use CFSCRIPT for this? This is for the security on a web site, so it needs to be efficient. CFScript is more efficient as long as you aren't just doing just a couple CFSET or CFIF The problem I have with CFSCRIPT and if() is that there is no elseif(), you have to embed things in the else part of the code, which gets very deep if you want to check loads of variations (and can't use switch, such as ranges) CF4.5.2 has faster looping in CFSCRIPT than in CFML, so that's an advantage Also, as Robert pointed out, no white-space! Philip Arnold Director Certified ColdFusion Developer ASP Multimedia Limited T: +44 (0)20 8680 1133 "Websites for the real world" ** This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. ** ~~ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
RE: Setting a Cookie
That was my reaction too. But I kept checking the value of the cookie with cfoutput and it had only one value. I ended up setting the query to a list and then setting the value of the cookie to the list and it worked. I actually mis-understood what you meant... Remember that when you CFSET or CFCOOKIE it places the current value into the variable or the cookie, so if you want it comma separated, then you have to use a list Philip Arnold Director Certified ColdFusion Developer ASP Multimedia Limited T: +44 (0)20 8680 1133 "Websites for the real world" ** This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. ** ~~ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
RE: CFSCRIPT performance
There is too an else if. Just do else if(). Use it all over the place. Never had a problem. How come the docs say you can only do else and place the if inside the else... I've done else if() before - as it's actually else { if() } I'll have to check with multiple else if()s Philip Arnold Director Certified ColdFusion Developer ASP Multimedia Limited T: +44 (0)20 8680 1133 "Websites for the real world" ** This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. ** ~~ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
CF and VoiceMail?
Any ideas on some good tools to do this: 1) User calls a phone number and pushes one for this and push two for that. 2) The menu choices and the user responses are managed with a CF admin module. TIA, Rick ~~ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
Re: CF and VoiceMail?
This was demoed at the Allaire conference. Here are some linksL Voxeo main page: http://www.voxeo.com Product info: http://www.voxeo.com/index.cfm?pageid=07F9F899-1E19-4B0C-AA24B3A4F65F8C1E HTH, Howie Hamlin - inFusion Project Manager On-Line Data Solutions, Inc. www.CoolFusion.com 631-737-4668 x101 inFusion Mail Server (iMS) - the World's most configurable mail server Get your free copy of iMS POST-SE Server from CoolFusion! - Original Message - From: [EMAIL PROTECTED] To: "CF-Talk" [EMAIL PROTECTED] Sent: Saturday, January 27, 2001 1:27 PM Subject: CF and VoiceMail? Any ideas on some good tools to do this: 1) User calls a phone number and pushes one for this and push two for that. 2) The menu choices and the user responses are managed with a CF admin module. TIA, Rick ~~ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
Re: Setting a Cookie
On 1/27/01, sebastian palmigiani penned: The query MemberRoles returns 2 values: 2 3 !--- Set the query to a local variable --- cfoutput query="MemberRoles" cfset Roles = RoleID /cfoutput !--- Set the local variable to a cookie --- cfcookie name="CFRoles" value="#Roles#" Only one of the values is set to the cookie which in this case the value becomes CFRoles=3 I don't understand why the value of the local variable does not become the value of the cookie. It does, twice. The first row of the query sets it to "2", the second row resets it to "3". Depending upon how you want the value of the cookie to look, say "23" or "2,3" will dictate the easiest way to do it. Start like this: cfset roles = "" cfoutput query="MemberRoles" cfset Roles = listappend(roles, RoleID) /cfoutput cfcookie name="CFRoles" value="#Roles#" You could do a replace(roles, ",", "WithAnything", "ALL") before you set the cookie if you wanted to replace the comma with nothing or another value. -- Bud Schneehagen - Tropical Web Creations _/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/ ColdFusion Solutions / eCommerce Development [EMAIL PROTECTED] http://www.twcreations.com/ 954.721.3452 ~~ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
ISP to support WAP and CF
I'm looking for a host that will support WAP and CF. I'm doing this just to have an opportunity to learn and test. Any suggestions? Athelene Gieseman ~~ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
RE: ISP to support WAP and CF
I'm looking for a host that will support WAP and CF. I'm doing this just to have an opportunity to learn and test. Any suggestions? WAP is just a content type and page definition, therefore any host who supports CF will automatically support WAP If you want to have a "wap." domain then it's just a matter of DNS Philip Arnold Director Certified ColdFusion Developer ASP Multimedia Limited T: +44 (0)20 8680 1133 "Websites for the real world" ** This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. ** ~~ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
Re: ISP to support WAP and CF
Checkout www.atswebnet.com We support both. Thanks, Robert - Original Message - From: "Gieseman, Athelene" [EMAIL PROTECTED] To: "CF-Talk" [EMAIL PROTECTED] Sent: Saturday, January 27, 2001 3:23 PM Subject: ISP to support WAP and CF I'm looking for a host that will support WAP and CF. I'm doing this just to have an opportunity to learn and test. Any suggestions? Athelene Gieseman ~~ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
Re: (WOT) Sample code for COM object wrappers for Stored Procedures
great response. I want to implement a working example to learn from. Any suggestions as to where to get a working database example? Eric From: [EMAIL PROTECTED] Reply-To: [EMAIL PROTECTED] To: CF-Talk [EMAIL PROTECTED] Subject: Re: (WOT) Sample code for COM object wrappers for Stored Procedures Date: Sat, 27 Jan 2001 05:43:13 EST Why ... n-tier development. Typically 3 tiers: presentation, business logic and backend processing. And the COM component is the middle tier ... enforcing business rules. ASP/CF acts as the presentation tier with T-SQL as the third tier. Why n-tier development ... because of scalability, security, control of critical resources, maintainability, etc. The middle-tier COM component can distribute requests across multiple resources/servers. Also, these middle-tier objects can be MTS-ized [Microsoft Transaction Server] ... thus providing connection polling and multi-object transactional processing. It is awful early ... hope that helps. Bill In a message dated 1/26/01 10:13:53 PM Eastern Standard Time, [EMAIL PROTECTED] writes: Can I ask why you would want to use a COM object to access a Stored Procedure instead of just calling the procedure directly? ~~ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
RE: ISP to support WAP and CF
you don't need anything server-side to deliver WAP applications. -Original Message- From: Gieseman, Athelene [mailto:[EMAIL PROTECTED]] Sent: Saturday, January 27, 2001 12:24 PM To: CF-Talk Subject: ISP to support WAP and CF I'm looking for a host that will support WAP and CF. I'm doing this just to have an opportunity to learn and test. Any suggestions? Athelene Gieseman ~~ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
RE: CFSCRIPT performance
There is too an else if. Just do else if(). Use it all over the place. Never had a problem. How come the docs say you can only do else and place the if inside the else... I've done else if() before - as it's actually else { if() } I'll have to check with multiple else if()s I don't know what the docs say, but CFSCRIPT code uses the same syntax as JavaScript for if ... else: if (condition) statement_to_execute else other_statement_to_execute; Most developers are used to having curly brackets, but these are only needed with blocks of code: if (condition) { statement_to_execute; } else { other_statement_to_execute; } Since an "if" construct is just a single statement, no curly brackets are required for it, and are typically left off: if (condition) { } else if (othercondition) { } CFSCRIPT, because it follows JavaScript syntax, will also allow this. Dave Watts, CTO, Fig Leaf Software http://www.figleaf.com/ voice: (202) 797-5496 fax: (202) 797-5444 ~~ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
Session tracking help??!!
Newbie needs help!! I need to be able to track users logged into a website. But I don't want to restrict access to the site, just certain areas if they are not a member. And I have to be able to at anytime see which members are actually logged in to the site to participate. Can I track a session variable and erase it when the cookie disappears from closing the browser or leaving the site? Jeff Davis ~~ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
CF Admin Password and CF Studio 4.5 config queries
Hi All, I am learning Cold Fusion in a college class. I've purchased Cold Fusion Studio 4.5. After about a week of struggle I finally got Apache installed. CF Server is running. I thought I'd seen the end of my travails. No such luck. (smile) I can't access the adminstrator as it refuses to accept the password I gave it. I know it is the correct password. Is there some way to get the system to give me a new password other than uninstalling it and reinstalling it? If I must reinstall, what files do I need to save, if any, that I've configured so far? At this point I've lost track of what I am doing. Also, I can't get CFStudio to work. Obviously there is some sort of configuration problem there as well! It starts fine, you can code in it. When you attempt to browse it says: The ColdFusion file you are trying to browse cannot be resolved into a URL. Add a server development mapping to enable URL resolution for this file. I believe those two questions are sufficient for now, although I have about a dozen more in reserve. Thank you in advance for your time and assistance. Marsha Graham ~~ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
RE: ALLR/MACR Merger - ColdFusion to be repositioned ?????
Hopefully, we won't have to learn Java. Just like I don't have to know C++ to code CF now. No, you shouldn't have to learn Java. However, I suspect that Java component development will become much more important to CF application development; now, typically, CF applications don't use components at all. In this new model, Java skills will be important, just as VB or VC++ skills are important to the construction of high-end ASP applications. Dave Watts, CTO, Fig Leaf Software http://www.figleaf.com/ voice: (202) 797-5496 fax: (202) 797-5444 ~~ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
The real distance formula
A week or more ago, someone posted a formula for calculating the distance between two points using latitude/longitude. I think the formula as incorrect. However, here is one that works perfectly; #Evaluate(((pi()*6378)/180)*(ACos((Sin(lat_A)*Sin(lat_B)) + (Cos(lat_A)*Cos(lat_B)*Cos(lat_A-lat_B)# This yields distance in KM. If you want miles, do the calculation after the fact, or change the value of 6378 - the earth's radius in KM - to a value in miles. --Dylan ~~ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
RE: ALLR/MACR Merger - ColdFusion to be repositioned ?????
The version 6 release of CF, which will merge CF and JRun, will really be a CFML interface on top of the JRun engine. CFML scripts will be compiled into Java servlet class files, similar to how JSP files are handled by servlet engines now. I thought this was the plan for CF _5_ ??? Originally, it was. I guess it was harder than it looked, and it's been pushed back to CF 6, or "Neo". CF 5 will be a native code release, just like CF 4.x. Dave Watts, CTO, Fig Leaf Software http://www.figleaf.com/ voice: (202) 797-5496 fax: (202) 797-5444 ~~ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
CFOBJECT problem
Hi Gurus, I was trying to do some CFOBJECT stuff, but I cannot configure CFusion server. What am I supposed to put into the "JVM library path"? (It's NT4.) I was trying to do: c:\jdk1.2.2\bin\ because that's where I have java.exe After doing this, I couldn't eve start the server again... Uninstall, install again...:-((( Where are these settings stored? Any config file around? Am I missing something here (happened before :-) TIA, laszlo ~~ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
RE: CFSCRIPT performance
I've done multiple else if() statements within cfscript many times. No problems at all. Evan -Original Message- From: Philip Arnold - ASP [mailto:[EMAIL PROTECTED]] Sent: Saturday, January 27, 2001 12:26 PM To: CF-Talk Subject: RE: CFSCRIPT performance There is too an else if. Just do else if(). Use it all over the place. Never had a problem. How come the docs say you can only do else and place the if inside the else... I've done else if() before - as it's actually else { if() } I'll have to check with multiple else if()s Philip Arnold Director Certified ColdFusion Developer ASP Multimedia Limited T: +44 (0)20 8680 1133 "Websites for the real world" ** This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. ** ~~ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
RE: CFSCRIPT performance
CFSCRIPT gains about a 10% performance advantage (I wish I still had the source for this number, but I can't seem to find it anymore... it was a good article) and generally cleaner code if you're doing a lot of page logic; obviously it loses out on the ease of screen display to tag based though. "The problem I have with CFSCRIPT and if() is that there is no elseif()..." Actually there is, just use 'else if (expr)' with a space. The above comment is in the right vein though, CFSCRIPT just isn't very powerful. In going w/ the tag based for display they seem to have left out anything more than a meek gesture towards scripting. It's missing many tags that would be beneficial, such as; cflock, cfthrow, etc. As well, common short form syntax like 'var = (expr) ? true : false ;' or simple operators like ++, --, +=, etc. (x=x+1 gets rather annoying :) are missing. Overall though, if you're doing more than three or four lines of non-display coding, you might want to switch over to cfscript for speed and easier reading. And if you plan to work w/ objects or complex structures staying tag based is for the masochists. ;P -Original Message- From: Philip Arnold - ASP [mailto:[EMAIL PROTECTED]] Sent: January 27, 2001 11:07 To: CF-Talk Subject: RE: CFSCRIPT performance I have a question on CFSCRIPT performance. I know that it is quicker to use CFSCRIPT than to use CFSET. Is it likewise quicker to use the CFSCRIPT if() over CFIF? I have a CFIF checking that one of 14 empressions are met (13 ORs). Would it be better to use CFSCRIPT for this? This is for the security on a web site, so it needs to be efficient. CFScript is more efficient as long as you aren't just doing just a couple CFSET or CFIF The problem I have with CFSCRIPT and if() is that there is no elseif(), you have to embed things in the else part of the code, which gets very deep if you want to check loads of variations (and can't use switch, such as ranges) CF4.5.2 has faster looping in CFSCRIPT than in CFML, so that's an advantage Also, as Robert pointed out, no white-space! Philip Arnold Director Certified ColdFusion Developer ASP Multimedia Limited T: +44 (0)20 8680 1133 "Websites for the real world" ** This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. ** ~~ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
RE: Why can't you see the cookies?
-Original Message- From: sebastian palmigiani [mailto:[EMAIL PROTECTED]] Sent: Saturday, January 27, 2001 11:28 AM To: CF-Talk Subject: Why can't you see the cookies? I have following code in application.cfm: cfif NOT IsDefined("COOKIE.cfid") OR NOT IsDefined("COOKIE.cftoken") cfinclude template="NoCookie.cfm" cfabort /cfif I have cookies turned off and no matter what page I am on this code is not picking up the fact that these 2 cookies don't exist. Yet when I make up a fictitious cookie name and test for it's existence then this code works. What is going on here? Sebastian ~~ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
RE: Why can't you see the cookies?
-Original Message- From: sebastian palmigiani [mailto:[EMAIL PROTECTED]] Sent: Saturday, January 27, 2001 11:28 AM To: CF-Talk Subject: Why can't you see the cookies? I have following code in application.cfm: cfif NOT IsDefined("COOKIE.cfid") OR NOT IsDefined("COOKIE.cftoken") cfinclude template="NoCookie.cfm" cfabort /cfif I have cookies turned off and no matter what page I am on this code is not picking up the fact that these 2 cookies don't exist. Yet when I make up a fictitious cookie name and test for it's existence then this code works. What is going on here? Sebastian ~~ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
RE: Why can't you see the cookies?
-Original Message- From: sebastian palmigiani [mailto:[EMAIL PROTECTED]] Sent: Saturday, January 27, 2001 11:28 AM To: CF-Talk Subject: Why can't you see the cookies? I have following code in application.cfm: cfif NOT IsDefined("COOKIE.cfid") OR NOT IsDefined("COOKIE.cftoken") cfinclude template="NoCookie.cfm" cfabort /cfif I have cookies turned off and no matter what page I am on this code is not picking up the fact that these 2 cookies don't exist. Yet when I make up a fictitious cookie name and test for it's existence then this code works. What is going on here? Sebastian ~~ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
RE: ALLR/MACR Merger - ColdFusion to be repositioned ?????
-Original Message- From: Joby Bednar [mailto:[EMAIL PROTECTED]] Sent: Friday, January 26, 2001 2:39 PM To: CF-Talk Subject: RE: ALLR/MACR Merger - ColdFusion to be "repositioned" ? Or... and I'm leaning towards this idea... the reporter got a little confused and thought they would add a couple big technology words to make it sound "techie", covering up the absence of any notes that were missing from dropping on the floor of a taxi cab. I think there's also a tie in with President Bush and some aliens, but I'm having a hard time proving it. I think the bottom line is that CF makes them money... so they are going to keep letting it make them money. Joby Bednar Director of Internet Design iNEOgroup.com -Original Message- From: Stephen M Aylor [mailto:[EMAIL PROTECTED]] Sent: Friday, January 26, 2001 12:23 PM To: CF-Talk Subject: ALLR/MACR Merger - ColdFusion to be "repositioned" ? Sands Brothers Investment Research Covering MACR Hears the link - hears the paragraph causing me some "kun-fusion" http://investor.cnet.com/investor/news/newsitem/0-9900-1028-4599632-1.html?t ag=yhoo In the past, Macromedia has made a point of NOT participating directly in the application server business but rather to partner with leader's in the space. Management is aware of this issue and pointed out that Allaire's flagship product, ColdFusion, would be repositioned such that Allaire's CFML technology would be maintained and that applications built with CFML will run on top of application servers from other vendors. Steve ~~ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
OS Detection
My debug info is not working on my machine.. Is there any way to tell the OS in CF? -- Clint Tredway www.factorxsoftware.com -- ~~ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
RE: Why can't you see the cookies?
I have cookies turned off and no matter what page I am on this code is not picking up the fact that these 2 cookies don't exist. Yet when I make up a fictitious cookie name and test for it's existence then this code works. What is going on here? Sebastian. Look for my earlier response. I explained it. -- Bud Schneehagen - Tropical Web Creations _/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/ ColdFusion Solutions / eCommerce Development [EMAIL PROTECTED] http://www.twcreations.com/ 954.721.3452 ~~ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
Re: The real distance formula
That was me, who was asking But I'm glad you spoke up, because something I was wondering about the formulas that were being tossed around. Do they handle the fact that two sets of positions, with identical longitudes (east-west, right?) but different latitu des, would be a different distance? For example, two sets of positions - both the same longitude, but latitudes of several hundred miles difference - and two other positions, also the same longitude, and the same distance apart north-south as the other two. The northern set of positions would be a shorter distance apart than the southern set... does the formula deal with that? --Scott - Original Message - From: "Dylan Bromby" [EMAIL PROTECTED] To: "CF-Talk" [EMAIL PROTECTED] Sent: Saturday, January 27, 2001 4:36 PM Subject: The real distance formula A week or more ago, someone posted a formula for calculating the distance between two points using latitude/longitude. I think the formula as incorrect. However, here is one that works perfectly; #Evaluate(((pi()*6378)/180)*(ACos((Sin(lat_A)*Sin(lat_B)) + (Cos(lat_A)*Cos(lat_B)*Cos(lat_A-lat_B)# This yields distance in KM. If you want miles, do the calculation after the fact, or change the value of 6378 - the earth's radius in KM - to a value in miles. --Dylan ~~ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
RE: OS Detection
My debug info is not working on my machine.. Is there any way to tell the OS in CF? If you're trying to determine the OS of the CF Server, you can look at the "Version Info" page in the CF Administrator, or you can reference the variable Server.OS.Version. Dave Watts, CTO, Fig Leaf Software http://www.figleaf.com/ voice: (202) 797-5496 fax: (202) 797-5444 ~~ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
RE: CF Admin Password and CF Studio 4.5 config queries
I can't access the adminstrator as it refuses to accept the password I gave it. I know it is the correct password. Is there some way to get the system to give me a new password other than uninstalling it and reinstalling it? Yes. You can simply disable the administrator password by editing the registry. Set HKEY_LOCAL_MACHINE\SOFTWARE\Allaire\ColdFusion\CurrentVersion\Server\UseAdmi nPassword to 0. It starts fine, you can code in it. When you attempt to browse it says: The ColdFusion file you are trying to browse cannot be resolved into a URL. Add a server development mapping to enable URL resolution for this file. You'll have to do as it says - you need to add a server development mapping. To browse your CF files, CF Studio needs to have them run by the CF server, and you have to tell it what URL matches a given filename. Here's how: 1. From the drive browser at the top of the file resource tab, select "Allaire FTP RDS". 2. Right-click on "Allaire FTP RDS" in the window below. 3. Select "Add RDS Server". 4. Fill in the fields to connect to your CF server. If it's on your local machine, you can put "localhost" in the first two fields. If "localhost" doesn't work, you can use 127.0.0.1, your IP loopback address. 5. Once you're done with this, select your new RDS server entry to make sure you can connect successfully. 6. Press Alt+M to open the "Development Mappings" dialog. 7. Select your new RDS server. 8. Enter the appropriate path info. If you're browsing your own machine, you can simply click on the little yellow button next to "Studio Path", then navigate to the document root directory of your web server. 9. Click the "Add" button. At this point, you should now be able to browse your CF files from within Studio. Dave Watts, CTO, Fig Leaf Software http://www.figleaf.com/ voice: (202) 797-5496 fax: (202) 797-5444 ~~ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
RE: OS Detection
Thanks! That is what I needed... -- Clint Tredway www.factorxsoftware.com -- ~~ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
RE: The real distance formula
Just out of curiousity ... Are we talking about the distance in a straight line (so to speak) or is it the shortest distance you're looking for ? Allan Pichler -Original Message- From: Scott Weikert [mailto:[EMAIL PROTECTED]] Sent: Saturday, January 27, 2001 6:12 PM To: CF-Talk Subject: Re: The real distance formula That was me, who was asking But I'm glad you spoke up, because something I was wondering about the formulas that were being tossed around. Do they handle the fact that two sets of positions, with identical longitudes (east-west, right?) but different latitu des, would be a different distance? For example, two sets of positions - both the same longitude, but latitudes of several hundred miles difference - and two other positions, also the same longitude, and the same distance apart north-south as the other two. The northern set of positions would be a shorter distance apart than the southern set... does the formula deal with that? --Scott - Original Message - From: "Dylan Bromby" [EMAIL PROTECTED] To: "CF-Talk" [EMAIL PROTECTED] Sent: Saturday, January 27, 2001 4:36 PM Subject: The real distance formula A week or more ago, someone posted a formula for calculating the distance between two points using latitude/longitude. I think the formula as incorrect. However, here is one that works perfectly; #Evaluate(((pi()*6378)/180)*(ACos((Sin(lat_A)*Sin(lat_B)) + (Cos(lat_A)*Cos(lat_B)*Cos(lat_A-lat_B)# This yields distance in KM. If you want miles, do the calculation after the fact, or change the value of 6378 - the earth's radius in KM - to a value in miles. --Dylan ~~ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
RE: CFOBJECT problem
No need to uninstall/install for this problem. Just do the following: Run "regedit". Navigate to HKEY_LOCAL_MACHINE/SOFTWARE/Allaire/ColdFusion/CurrentVersion/JVM Double-click on JVMLoad and change the value from 1 to 0. Close the registry editor and now restart ColdFusion. At that point you'll be able to restart ColdFusion and then fix your JVM settings. It should be pointing to the jvm.dll file, not just a directory. For more info, here's a KB on the subject: http://www.allaire.com/Handlers/index.cfm?ID=13863Method=Full Debbie -Original Message- From: Laszlo Nadai [mailto:[EMAIL PROTECTED]] Sent: Saturday, January 27, 2001 8:14 PM To: CF-Talk Subject: CFOBJECT problem Hi Gurus, I was trying to do some CFOBJECT stuff, but I cannot configure CFusion server. What am I supposed to put into the "JVM library path"? (It's NT4.) I was trying to do: c:\jdk1.2.2\bin\ because that's where I have java.exe After doing this, I couldn't eve start the server again... Uninstall, install again...:-((( Where are these settings stored? Any config file around? Am I missing something here (happened before :-) TIA, laszlo ~~ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
RE: The real distance formula
Well, it's been quite a while since I last delved into GIS and trig but here goes. The earth does not lend itself well to simple calculations, all the below (except the last) assume a spherical earth and ignore any diffences in the terrain, elevation, roadways, etc. That said, let's look at some formulas. The formula given in the previous post [below] is a VERY UNRELIABLE way to calculate distances (and the last lat_A, lat_B should be longitude). It's based on the law of cosines for spherical trigonometry: Mathmatically it's all there but for small distances the inverse cosine gives huge room for roundoff error. In short there are much better solutions. The haversine formula is probably most used. latd = lat1 - lat2 ; lond = lon1 - lon2 ; a = (sin(latd/2)^2 + cos(lat1) * cos(lat2) * (sin(londd/2))^2 ; c = 2 * atan(sqr(a)/sqr(1-a)) ; R = 6367 ; d = R * c ; I broke the formula up into quit a few parts so you could better see what's happening: - 'land' and 'lond' are the differences in latitude and longitude respecitively - 'a' is the chord length between the points - 'R' is the accepted radius of the earth (spherical model) 6367km Feel free to make it all one line, just sub in for the variables. There are of course some caveats with this, as with any other equation. As stated before, the earth is assumed to be spherical: If your application requires greater accuracy you can vary R in respect to latitude using the eccentricity (0.08108) of the ellipsoid (earth), the equatorial radius (6379km), and the polar radius (6357km). I won't get into that, as I really don't remeber how it's done... my notes from school seem to indicate I was more interested in the brunette sitting infront of me in that class at that point... heh. Ohh.. and this equation doesn't deal well with antipodal points (ie. exact oposite side of the earth) seems it can be off by a few kilometers. If you're dealing with very local distances you might want to consider treating the earth as flat; it can actually yield more acurate results over short distances due to the assumed R. Again, not going to bother explaining this as I'm sure you can work out the math relatively easily for asimple polar coordinate system. Anyways, neat question... I've been meaning to brush up on my trig and this gave me an excuse. Later. -Original Message- From: Scott Weikert [mailto:[EMAIL PROTECTED]] Sent: January 27, 2001 21:12 To: CF-Talk Subject: Re: The real distance formula That was me, who was asking But I'm glad you spoke up, because something I was wondering about the formulas that were being tossed around. Do they handle the fact that two sets of positions, with identical longitudes (east-west, right?) but different latitu des, would be a different distance? For example, two sets of positions - both the same longitude, but latitudes of several hundred miles difference - and two other positions, also the same longitude, and the same distance apart north-south as the other two. The northern set of positions would be a shorter distance apart than the southern set... does the formula deal with that? --Scott - Original Message - From: "Dylan Bromby" [EMAIL PROTECTED] To: "CF-Talk" [EMAIL PROTECTED] Sent: Saturday, January 27, 2001 4:36 PM Subject: The real distance formula A week or more ago, someone posted a formula for calculating the distance between two points using latitude/longitude. I think the formula as incorrect. However, here is one that works perfectly; #Evaluate(((pi()*6378)/180)*(ACos((Sin(lat_A)*Sin(lat_B)) + (Cos(lat_A)*Cos(lat_B)*Cos(lat_A-lat_B)# This yields distance in KM. If you want miles, do the calculation after the fact, or change the value of 6378 - the earth's radius in KM - to a value in miles. --Dylan ~~ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
RE: iif usage
At 1/25/2001 06:13 PM +, Stephen Moretti wrote: snip Cfoutput#iif(isDefined("Attributes.display"),Trim(attributes.name"_query. "attributes.display),DE(''))#/cfoutput This is good advice, and it will also not throw any errors if attributes.display is not defined. For example: IIf( IsDefined("attributes.foo"), DE("#attributes.foo#"), DE("") ) would throw an error if attributes.foo wasn't defined, while IIf( IsDefined("attributes.foo"), "attributes.foo", DE("") ) would work as expected. Cheers, -Max ~~ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
RE: Macromedia and Allaire to Merge
a side note to this is that the proposed java based CF App Server is not an applet machine... it is a servlet engine at heart. Just a technicallity, but I thought it was worth mentioning that applets have nothing to do with most of allaire's future plans for java based technologies. Yes, true. I suppose I didn't phrase that properly -- sometimes I'm too terse. I just meant since CF will be Java-based there will be course increased activity all across the Java front in regards to such things. Today it's rare to find Java CFX or a Java applet for CF. --min ~Simon ~~ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
RE: The real distance formula
yep my bad...that last pair should be longitude. :) my point was the forumla that was previously posted didn't work. whether it was a typo (like mine! :) ) or not, i'm not sure. -Original Message- From: Raymond B. [mailto:[EMAIL PROTECTED]] Sent: Saturday, January 27, 2001 8:34 PM To: CF-Talk Subject: RE: The real distance formula Well, it's been quite a while since I last delved into GIS and trig but here goes. The earth does not lend itself well to simple calculations, all the below (except the last) assume a spherical earth and ignore any diffences in the terrain, elevation, roadways, etc. That said, let's look at some formulas. The formula given in the previous post [below] is a VERY UNRELIABLE way to calculate distances (and the last lat_A, lat_B should be longitude). It's based on the law of cosines for spherical trigonometry: Mathmatically it's all there but for small distances the inverse cosine gives huge room for roundoff error. In short there are much better solutions. The haversine formula is probably most used. latd = lat1 - lat2 ; lond = lon1 - lon2 ; a = (sin(latd/2)^2 + cos(lat1) * cos(lat2) * (sin(londd/2))^2 ; c = 2 * atan(sqr(a)/sqr(1-a)) ; R = 6367 ; d = R * c ; I broke the formula up into quit a few parts so you could better see what's happening: - 'land' and 'lond' are the differences in latitude and longitude respecitively - 'a' is the chord length between the points - 'R' is the accepted radius of the earth (spherical model) 6367km Feel free to make it all one line, just sub in for the variables. There are of course some caveats with this, as with any other equation. As stated before, the earth is assumed to be spherical: If your application requires greater accuracy you can vary R in respect to latitude using the eccentricity (0.08108) of the ellipsoid (earth), the equatorial radius (6379km), and the polar radius (6357km). I won't get into that, as I really don't remeber how it's done... my notes from school seem to indicate I was more interested in the brunette sitting infront of me in that class at that point... heh. Ohh.. and this equation doesn't deal well with antipodal points (ie. exact oposite side of the earth) seems it can be off by a few kilometers. If you're dealing with very local distances you might want to consider treating the earth as flat; it can actually yield more acurate results over short distances due to the assumed R. Again, not going to bother explaining this as I'm sure you can work out the math relatively easily for asimple polar coordinate system. Anyways, neat question... I've been meaning to brush up on my trig and this gave me an excuse. Later. -Original Message- From: Scott Weikert [mailto:[EMAIL PROTECTED]] Sent: January 27, 2001 21:12 To: CF-Talk Subject: Re: The real distance formula That was me, who was asking But I'm glad you spoke up, because something I was wondering about the formulas that were being tossed around. Do they handle the fact that two sets of positions, with identical longitudes (east-west, right?) but different latitu des, would be a different distance? For example, two sets of positions - both the same longitude, but latitudes of several hundred miles difference - and two other positions, also the same longitude, and the same distance apart north-south as the other two. The northern set of positions would be a shorter distance apart than the southern set... does the formula deal with that? --Scott - Original Message - From: "Dylan Bromby" [EMAIL PROTECTED] To: "CF-Talk" [EMAIL PROTECTED] Sent: Saturday, January 27, 2001 4:36 PM Subject: The real distance formula A week or more ago, someone posted a formula for calculating the distance between two points using latitude/longitude. I think the formula as incorrect. However, here is one that works perfectly; #Evaluate(((pi()*6378)/180)*(ACos((Sin(lat_A)*Sin(lat_B)) + (Cos(lat_A)*Cos(lat_B)*Cos(lat_A-lat_B)# This yields distance in KM. If you want miles, do the calculation after the fact, or change the value of 6378 - the earth's radius in KM - to a value in miles. --Dylan ~~ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
RE: The real distance formula
also remember, if you're using distance calculations for determining the proximity of real-world locations, you can only get *truly* meaningful data with turn-by-turn calculations using road data. lat/lon calculations only provide "crow-flies" distances. --dylan -Original Message- From: Raymond B. [mailto:[EMAIL PROTECTED]] Sent: Saturday, January 27, 2001 8:34 PM To: CF-Talk Subject: RE: The real distance formula Well, it's been quite a while since I last delved into GIS and trig but here goes. The earth does not lend itself well to simple calculations, all the below (except the last) assume a spherical earth and ignore any diffences in the terrain, elevation, roadways, etc. That said, let's look at some formulas. The formula given in the previous post [below] is a VERY UNRELIABLE way to calculate distances (and the last lat_A, lat_B should be longitude). It's based on the law of cosines for spherical trigonometry: Mathmatically it's all there but for small distances the inverse cosine gives huge room for roundoff error. In short there are much better solutions. The haversine formula is probably most used. latd = lat1 - lat2 ; lond = lon1 - lon2 ; a = (sin(latd/2)^2 + cos(lat1) * cos(lat2) * (sin(londd/2))^2 ; c = 2 * atan(sqr(a)/sqr(1-a)) ; R = 6367 ; d = R * c ; I broke the formula up into quit a few parts so you could better see what's happening: - 'land' and 'lond' are the differences in latitude and longitude respecitively - 'a' is the chord length between the points - 'R' is the accepted radius of the earth (spherical model) 6367km Feel free to make it all one line, just sub in for the variables. There are of course some caveats with this, as with any other equation. As stated before, the earth is assumed to be spherical: If your application requires greater accuracy you can vary R in respect to latitude using the eccentricity (0.08108) of the ellipsoid (earth), the equatorial radius (6379km), and the polar radius (6357km). I won't get into that, as I really don't remeber how it's done... my notes from school seem to indicate I was more interested in the brunette sitting infront of me in that class at that point... heh. Ohh.. and this equation doesn't deal well with antipodal points (ie. exact oposite side of the earth) seems it can be off by a few kilometers. If you're dealing with very local distances you might want to consider treating the earth as flat; it can actually yield more acurate results over short distances due to the assumed R. Again, not going to bother explaining this as I'm sure you can work out the math relatively easily for asimple polar coordinate system. Anyways, neat question... I've been meaning to brush up on my trig and this gave me an excuse. Later. -Original Message- From: Scott Weikert [mailto:[EMAIL PROTECTED]] Sent: January 27, 2001 21:12 To: CF-Talk Subject: Re: The real distance formula That was me, who was asking But I'm glad you spoke up, because something I was wondering about the formulas that were being tossed around. Do they handle the fact that two sets of positions, with identical longitudes (east-west, right?) but different latitu des, would be a different distance? For example, two sets of positions - both the same longitude, but latitudes of several hundred miles difference - and two other positions, also the same longitude, and the same distance apart north-south as the other two. The northern set of positions would be a shorter distance apart than the southern set... does the formula deal with that? --Scott - Original Message - From: "Dylan Bromby" [EMAIL PROTECTED] To: "CF-Talk" [EMAIL PROTECTED] Sent: Saturday, January 27, 2001 4:36 PM Subject: The real distance formula A week or more ago, someone posted a formula for calculating the distance between two points using latitude/longitude. I think the formula as incorrect. However, here is one that works perfectly; #Evaluate(((pi()*6378)/180)*(ACos((Sin(lat_A)*Sin(lat_B)) + (Cos(lat_A)*Cos(lat_B)*Cos(lat_A-lat_B)# This yields distance in KM. If you want miles, do the calculation after the fact, or change the value of 6378 - the earth's radius in KM - to a value in miles. --Dylan ~~ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
RE: The real distance formula
Correct me if i'm wrong, but in a spherical environment (the earth) a straight line is not always the shortest is it ? Allan Pichler -Original Message- From: Dylan Bromby [mailto:[EMAIL PROTECTED]] Sent: Saturday, January 27, 2001 10:06 PM To: CF-Talk Subject: RE: The real distance formula also remember, if you're using distance calculations for determining the proximity of real-world locations, you can only get *truly* meaningful data with turn-by-turn calculations using road data. lat/lon calculations only provide "crow-flies" distances. --dylan -Original Message- From: Raymond B. [mailto:[EMAIL PROTECTED]] Sent: Saturday, January 27, 2001 8:34 PM To: CF-Talk Subject: RE: The real distance formula Well, it's been quite a while since I last delved into GIS and trig but here goes. The earth does not lend itself well to simple calculations, all the below (except the last) assume a spherical earth and ignore any diffences in the terrain, elevation, roadways, etc. That said, let's look at some formulas. The formula given in the previous post [below] is a VERY UNRELIABLE way to calculate distances (and the last lat_A, lat_B should be longitude). It's based on the law of cosines for spherical trigonometry: Mathmatically it's all there but for small distances the inverse cosine gives huge room for roundoff error. In short there are much better solutions. The haversine formula is probably most used. latd = lat1 - lat2 ; lond = lon1 - lon2 ; a = (sin(latd/2)^2 + cos(lat1) * cos(lat2) * (sin(londd/2))^2 ; c = 2 * atan(sqr(a)/sqr(1-a)) ; R = 6367 ; d = R * c ; I broke the formula up into quit a few parts so you could better see what's happening: - 'land' and 'lond' are the differences in latitude and longitude respecitively - 'a' is the chord length between the points - 'R' is the accepted radius of the earth (spherical model) 6367km Feel free to make it all one line, just sub in for the variables. There are of course some caveats with this, as with any other equation. As stated before, the earth is assumed to be spherical: If your application requires greater accuracy you can vary R in respect to latitude using the eccentricity (0.08108) of the ellipsoid (earth), the equatorial radius (6379km), and the polar radius (6357km). I won't get into that, as I really don't remeber how it's done... my notes from school seem to indicate I was more interested in the brunette sitting infront of me in that class at that point... heh. Ohh.. and this equation doesn't deal well with antipodal points (ie. exact oposite side of the earth) seems it can be off by a few kilometers. If you're dealing with very local distances you might want to consider treating the earth as flat; it can actually yield more acurate results over short distances due to the assumed R. Again, not going to bother explaining this as I'm sure you can work out the math relatively easily for asimple polar coordinate system. Anyways, neat question... I've been meaning to brush up on my trig and this gave me an excuse. Later. -Original Message- From: Scott Weikert [mailto:[EMAIL PROTECTED]] Sent: January 27, 2001 21:12 To: CF-Talk Subject: Re: The real distance formula That was me, who was asking But I'm glad you spoke up, because something I was wondering about the formulas that were being tossed around. Do they handle the fact that two sets of positions, with identical longitudes (east-west, right?) but different latitu des, would be a different distance? For example, two sets of positions - both the same longitude, but latitudes of several hundred miles difference - and two other positions, also the same longitude, and the same distance apart north-south as the other two. The northern set of positions would be a shorter distance apart than the southern set... does the formula deal with that? --Scott - Original Message - From: "Dylan Bromby" [EMAIL PROTECTED] To: "CF-Talk" [EMAIL PROTECTED] Sent: Saturday, January 27, 2001 4:36 PM Subject: The real distance formula A week or more ago, someone posted a formula for calculating the distance between two points using latitude/longitude. I think the formula as incorrect. However, here is one that works perfectly; #Evaluate(((pi()*6378)/180)*(ACos((Sin(lat_A)*Sin(lat_B)) + (Cos(lat_A)*Cos(lat_B)*Cos(lat_A-lat_B)# This yields distance in KM. If you want miles, do the calculation after the fact, or change the value of 6378 - the earth's radius in KM - to a value in miles. --Dylan ~~ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
Re: The real distance formula
From http://www.its.bldrdoc.gov/fs-1037/dir-017/ great circle: A circle defined by the intersection of the surface of the Earth and any plane that passes through the center of the Earth. Note: On the idealized surface of the Earth, the shortest distance between two points lies along a great circle. -David On Sat, 27 Jan 2001 23:04:11 -0800 "Allan Pichler" [EMAIL PROTECTED] writes: Correct me if i'm wrong, but in a spherical environment (the earth) a straight line is not always the shortest is it ? Allan Pichler -Original Message- From: Dylan Bromby [mailto:[EMAIL PROTECTED]] Sent: Saturday, January 27, 2001 10:06 PM To: CF-Talk Subject: RE: The real distance formula also remember, if you're using distance calculations for determining the proximity of real-world locations, you can only get *truly* meaningful data with turn-by-turn calculations using road data. lat/lon calculations only provide "crow-flies" distances. --dylan -Original Message- From: Raymond B. [mailto:[EMAIL PROTECTED]] Sent: Saturday, January 27, 2001 8:34 PM To: CF-Talk Subject: RE: The real distance formula Well, it's been quite a while since I last delved into GIS and trig but here goes. The earth does not lend itself well to simple calculations, all the below (except the last) assume a spherical earth and ignore any diffences in the terrain, elevation, roadways, etc. That said, let's look at some formulas. The formula given in the previous post [below] is a VERY UNRELIABLE way to calculate distances (and the last lat_A, lat_B should be longitude). It's based on the law of cosines for spherical trigonometry: Mathmatically it's all there but for small distances the inverse cosine gives huge room for roundoff error. In short there are much better solutions. The haversine formula is probably most used. latd = lat1 - lat2 ; lond = lon1 - lon2 ; a = (sin(latd/2)^2 + cos(lat1) * cos(lat2) * (sin(londd/2))^2 ; c = 2 * atan(sqr(a)/sqr(1-a)) ; R = 6367 ; d = R * c ; I broke the formula up into quit a few parts so you could better see what's happening: - 'land' and 'lond' are the differences in latitude and longitude respecitively - 'a' is the chord length between the points - 'R' is the accepted radius of the earth (spherical model) 6367km Feel free to make it all one line, just sub in for the variables. There are of course some caveats with this, as with any other equation. As stated before, the earth is assumed to be spherical: If your application requires greater accuracy you can vary R in respect to latitude using the eccentricity (0.08108) of the ellipsoid (earth), the equatorial radius (6379km), and the polar radius (6357km). I won't get into that, as I really don't remeber how it's done... my notes from school seem to indicate I was more interested in the brunette sitting infront of me in that class at that point... heh. Ohh.. and this equation doesn't deal well with antipodal points (ie. exact oposite side of the earth) seems it can be off by a few kilometers. If you're dealing with very local distances you might want to consider treating the earth as flat; it can actually yield more acurate results over short distances due to the assumed R. Again, not going to bother explaining this as I'm sure you can work out the math relatively easily for asimple polar coordinate system. Anyways, neat question... I've been meaning to brush up on my trig and this gave me an excuse. Later. -Original Message- From: Scott Weikert [mailto:[EMAIL PROTECTED]] Sent: January 27, 2001 21:12 To: CF-Talk Subject: Re: The real distance formula That was me, who was asking But I'm glad you spoke up, because something I was wondering about the formulas that were being tossed around. Do they handle the fact that two sets of positions, with identical longitudes (east-west, right?) but different latitu des, would be a different distance? For example, two sets of positions - both the same longitude, but latitudes of several hundred miles difference - and two other positions, also the same longitude, and the same distance apart north-south as the other two. The northern set of positions would be a shorter distance apart than the southern set... does the formula deal with that? --Scott - Original Message - From: "Dylan Bromby" [EMAIL PROTECTED] To: "CF-Talk" [EMAIL PROTECTED] Sent: Saturday, January 27, 2001 4:36 PM Subject: The real distance formula A week or more ago, someone posted a formula for calculating the distance between two points using latitude/longitude. I think the formula as incorrect. However, here is one that works perfectly; #Evaluate(((pi()*6378)/180)*(ACos((Sin(lat_A)*Sin(lat_B)) +