ColdFusion Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreColdFusion Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
Get inside! Sample the range of functionality easily built with JMSL Library for Time Series Data Analysis, Heat Maps, Portfolio Optimization, Monte Carlo Simulation, Stock Price Charting and more. Download Now!
  #1  
Old December 5th, 2004, 04:46 PM
Panther893's Avatar
Panther893 Panther893 is offline
MostarDesigns.com
Dev Shed Novice (500 - 999 posts)
 
Join Date: Mar 2004
Posts: 810 Panther893 User rank is Second Lieutenant (5000 - 10000 Reputation Level)Panther893 User rank is Second Lieutenant (5000 - 10000 Reputation Level)Panther893 User rank is Second Lieutenant (5000 - 10000 Reputation Level)Panther893 User rank is Second Lieutenant (5000 - 10000 Reputation Level)Panther893 User rank is Second Lieutenant (5000 - 10000 Reputation Level)Panther893 User rank is Second Lieutenant (5000 - 10000 Reputation Level)Panther893 User rank is Second Lieutenant (5000 - 10000 Reputation Level) 
Time spent in forums: 5 Days 18 h 20 m 11 sec
Reputation Power: 56
Send a message via MSN to Panther893
glicko system, anyone heard of it....

well anyhow im using it in a project im doing to calculate points...

i got the equation down but i get a java.lang.String error. as i am guessing i think kitless will be the only one to answer this question

here is my calculation code below.
Code:
<cfset f = 0>
		<cfset p = 0>
		<cfset r1 = 0>
		<cfset r2 = 0>
		<cfset E = 0>
		<cfset q = 0>
		<cfset K = 0>
		<cfset RD_new = 0>
		<cfset RD = #unit_members_alias.RD#>
		
		
	
	
			<!--=========== BEGIN MATH ============-->
			
			    <!--
				/////// STEP 1
				/////// Calculate the new RD value
				-->
				<cfset RD_new = Sqr(#RD# + 50)>
				
				
				
				<!--
				/////// STEP 2
				/////// Calculate attenuating factor
				-->
				<cfset p = (30 * 30)/((Pi() * Pi()) * (400 * 400))>
				
				<cfset f = 1/Sqr(1 + #p# * (#RD# * #RD#))>
				
				
				
				<!--
				/////// STEP 3
				/////// Calculate r1 and r2
				-->
				<cfset r1 = #aliasdetails.RD#>
				
				<cfset r2 = #RD#>
				
				<cfset E = 1/(-(#r1# - #r2#) * (#f#/400))>
				
				
				
				<!--
				/////// STEP 4
				/////// Calculate K and q
				-->
				<cfset q = (50)/400>
				
				<cfset K = (#q# * #f#)/((1/(#RD# * #RD#)) + (#q# * #q#) * (#f# * #f#) * #E# * (1 - #E#))>
				
				<cfif #K# lt 16>
				  <cfset K = 16>
				</cfif>
				
				
				
				<!--
				/////// STEP 5
				/////// Calculate new rating
				-->
				
				<cfset RD_new = 1/Sqr( (1/(#RD# * #RD#)) + (#q# * #q#) * (#f# * #f#) * #E# * (1 - #E#))>
			
			
			<!--=========== END MATH ============-->



and my error which is really bugin me out....

You have attempted to dereference a scalar variable of type class java.lang.String as a structure with members.

Reply With Quote
  #2  
Old December 6th, 2004, 08:35 AM
bocmaxima's Avatar
bocmaxima bocmaxima is offline
Contributing User
Dev Shed Beginner (1000 - 1499 posts)
 
Join Date: Aug 2004
Location: Tucson, Sonora
Posts: 1,322 bocmaxima User rank is Sergeant (500 - 2000 Reputation Level)bocmaxima User rank is Sergeant (500 - 2000 Reputation Level)bocmaxima User rank is Sergeant (500 - 2000 Reputation Level)bocmaxima User rank is Sergeant (500 - 2000 Reputation Level)bocmaxima User rank is Sergeant (500 - 2000 Reputation Level) 
Time spent in forums: 3 Days 17 h 46 m 5 sec
Reputation Power: 22
Send a message via AIM to bocmaxima
CF is really picky about variables. If you assign them a certain way, you have to keep them that way unless you convert them. This error has to do with that, and is pretty common. It would be nice if CF would give you something a little more logical, but that's the best that it can do, I guess.
Point out the line number where you're receiving the error and that will help, but it will definitely have to do with you trying to use a variable as an integer when it wants to be a string or array or fairy princess.

Reply With Quote
  #3  
Old December 6th, 2004, 09:27 AM
FALCONSEYE FALCONSEYE is offline
Permanently Banned
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2004
Posts: 377 FALCONSEYE Negative: is most likely a SPAMMER and a traitor to the cause. 
Time spent in forums: 1 Day 16 h 57 m 14 sec
Warnings Level: 15
Number of bans: 1
Reputation Power: 0
what is this variable?
#unit_members_alias.RD#

Reply With Quote
  #4  
Old December 6th, 2004, 06:03 PM
Panther893's Avatar
Panther893 Panther893 is offline
MostarDesigns.com
Dev Shed Novice (500 - 999 posts)
 
Join Date: Mar 2004
Posts: 810 Panther893 User rank is Second Lieutenant (5000 - 10000 Reputation Level)Panther893 User rank is Second Lieutenant (5000 - 10000 Reputation Level)Panther893 User rank is Second Lieutenant (5000 - 10000 Reputation Level)Panther893 User rank is Second Lieutenant (5000 - 10000 Reputation Level)Panther893 User rank is Second Lieutenant (5000 - 10000 Reputation Level)Panther893 User rank is Second Lieutenant (5000 - 10000 Reputation Level)Panther893 User rank is Second Lieutenant (5000 - 10000 Reputation Level) 
Time spent in forums: 5 Days 18 h 20 m 11 sec
Reputation Power: 56
Send a message via MSN to Panther893
its this one: <cfset RD_new = Sqr(#RD# + 50)>

Reply With Quote
  #5  
Old December 6th, 2004, 08:04 PM
kiteless kiteless is offline
Moderator
Dev Shed Expert (3500 - 3999 posts)
 
Join Date: Jun 2002
Location: Raleigh, NC
Posts: 3,627 kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 1 Week 4 Days 10 h 8 m 55 sec
Reputation Power: 53
You don't need all those pound signs...you only need pound signs when outputting a variable inside a cfoutput block...within function calls or sets you only need them if you are outputting them as a string (inside quote marks or something).

What line is the error happening at?
__________________
Ask if you have a question, but also help answer questions that you have knowledge of! Thanks, Brian.
How to Post a Question in the Forums

Reply With Quote
  #6  
Old December 7th, 2004, 12:32 AM
Panther893's Avatar
Panther893 Panther893 is offline
MostarDesigns.com
Dev Shed Novice (500 - 999 posts)
 
Join Date: Mar 2004
Posts: 810 Panther893 User rank is Second Lieutenant (5000 - 10000 Reputation Level)Panther893 User rank is Second Lieutenant (5000 - 10000 Reputation Level)Panther893 User rank is Second Lieutenant (5000 - 10000 Reputation Level)Panther893 User rank is Second Lieutenant (5000 - 10000 Reputation Level)Panther893 User rank is Second Lieutenant (5000 - 10000 Reputation Level)Panther893 User rank is Second Lieutenant (5000 - 10000 Reputation Level)Panther893 User rank is Second Lieutenant (5000 - 10000 Reputation Level) 
Time spent in forums: 5 Days 18 h 20 m 11 sec
Reputation Power: 56
Send a message via MSN to Panther893
i said its happening when it does that sqare root equation.

Reply With Quote
  #7  
Old December 7th, 2004, 08:16 AM
FALCONSEYE FALCONSEYE is offline
Permanently Banned
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2004
Posts: 377 FALCONSEYE Negative: is most likely a SPAMMER and a traitor to the cause. 
Time spent in forums: 1 Day 16 h 57 m 14 sec
Warnings Level: 15
Number of bans: 1
Reputation Power: 0
i guess i couldnt explain myself.
i am trying to run the code you posted to see where the errors are . so i asked you what are the values for
#unit_members_alias.RD#, #aliasdetails.RD# ?

a square root of a negative number is not defined unless you use complex numbers. so, cold fusion is going to give you an error every single time it sees something like SQR(-25)

first make sure that <cfset RD_new = Sqr(#RD# + 50)>

RD + 50 >= 0

Reply With Quote
  #8  
Old December 7th, 2004, 08:38 AM
Panther893's Avatar
Panther893 Panther893 is offline
MostarDesigns.com
Dev Shed Novice (500 - 999 posts)
 
Join Date: Mar 2004
Posts: 810 Panther893 User rank is Second Lieutenant (5000 - 10000 Reputation Level)Panther893 User rank is Second Lieutenant (5000 - 10000 Reputation Level)Panther893 User rank is Second Lieutenant (5000 - 10000 Reputation Level)Panther893 User rank is Second Lieutenant (5000 - 10000 Reputation Level)Panther893 User rank is Second Lieutenant (5000 - 10000 Reputation Level)Panther893 User rank is Second Lieutenant (5000 - 10000 Reputation Level)Panther893 User rank is Second Lieutenant (5000 - 10000 Reputation Level) 
Time spent in forums: 5 Days 18 h 20 m 11 sec
Reputation Power: 56
Send a message via MSN to Panther893
its not negative RD is suppost to be 1720 and and same thing for the other RD it could be that i have the columb set in the db as a memo columb maybe.....

Reply With Quote
  #9  
Old December 7th, 2004, 08:55 AM
FALCONSEYE FALCONSEYE is offline
Permanently Banned
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2004
Posts: 377 FALCONSEYE Negative: is most likely a SPAMMER and a traitor to the cause. 
Time spent in forums: 1 Day 16 h 57 m 14 sec
Warnings Level: 15
Number of bans: 1
Reputation Power: 0
what does CF say? also, here

<cfset E = 1/(-(#r1# - #r2#) * (#f#/400))>

this may produce a -E

<cfset RD_new = 1/Sqr( (1/(RD * RD)) + (q * q) * (f * f) * E * (1 - E))>

then you will run into SQR(-number) problem again.
so you might consider taking absolute values of these numbers or use complex numbers
square root -1 = i

Reply With Quote
  #10  
Old December 7th, 2004, 12:52 PM
Panther893's Avatar
Panther893 Panther893 is offline
MostarDesigns.com
Dev Shed Novice (500 - 999 posts)
 
Join Date: Mar 2004
Posts: 810 Panther893 User rank is Second Lieutenant (5000 - 10000 Reputation Level)Panther893 User rank is Second Lieutenant (5000 - 10000 Reputation Level)Panther893 User rank is Second Lieutenant (5000 - 10000 Reputation Level)Panther893 User rank is Second Lieutenant (5000 - 10000 Reputation Level)Panther893 User rank is Second Lieutenant (5000 - 10000 Reputation Level)Panther893 User rank is Second Lieutenant (5000 - 10000 Reputation Level)Panther893 User rank is Second Lieutenant (5000 - 10000 Reputation Level) 
Time spent in forums: 5 Days 18 h 20 m 11 sec
Reputation Power: 56
Send a message via MSN to Panther893
it tells me that java error in my first post when it runs that cfset tag.

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreColdFusion Development > glicko system, anyone heard of it....


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway