Re: [cfaussie] Recursive function giving me 500 null error

2010-08-12 Thread Robin Hilliard
On 12/08/2010, at 2:34 PM, Seona Bellamy wrote:
 cffunction name=downTree hint=Returns the details of everything needed to 
 make an item access=public returntype=array output=no
 cfargument name=aItems type=array required=no default=
 
 cfscript
 var result = arrayNew(1);
 var i = 1;
 var qItem = ;
 
 qItem = getItemMadeBy(aItems[1].id);
 
 if (qItem.recordcount) {
 result[1] = structNew();
 result[1].id = qItem.id;
 result[1].item = qItem.item;
 result[1].skill = qItem.skillname;
 result[1].makes = arguments.aItems;
 
 downTree(result);
 }
 /cfscript
 
 cfreturn result
 /cffunction

I'm sure Geoff would have something like this for Eve by now. You can see with 
the function above that no matter how deep you recurse there is only ever going 
to be an item in the first position in the array, so there's definitely a 
problem. You could make a build tree like this (pseudocode):

function makeBuildTree() : struct {

stDependencies = structNew();

for all nextItem in allItems {
if not structKeyExists(stDependencies, nextItem.id)
stDependencies[nextItem.id] = structNew();

for all nextMadeThing in getItemsMadeBy(nextItem.id) {
if not structKeyExists(stDependencies, nextMadeThing.id)
stDependencies[nextMadeThing.id] = structNew();

stDependencies[nextMadeThing.id][nextItem.id] = 
stDependencies[nextItem.id];
}
}

return stDependencies;
}

If you then cfdump a key in stDependencies you'd see a tree of ids showing what 
built what. You might then use the little known but usefuly recursive CF 
function structFindValue(returnValue[id], , all) to get an array of all the 
keys under a branch of the result.

HTH,
Robin (who should get back to some project work)

 
ROBIN HILLIARD
Chief Technology Officer
ro...@rocketboots.com.au

RocketBoots Pty Ltd
Level 11
189 Kent Street
Sydney NSW 2001
Australia
Phone +61 2 9323 2507
Facsimile +61 2 9323 2501
Mobile +61 418 414 341
www.rocketboots.com.au   
 


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



Re: [cfaussie] Recursive function giving me 500 null error

2010-08-12 Thread Robin Hilliard
On 12/08/2010, at 4:18 PM, Robin Hilliard wrote:

 structFindValue(returnValue[id], , all) to get an array of all the keys 
 under a branch of the result.

Ah it's not quite right, when you first create a key in stDependencies you 
should set it to , and only replace it with a struct if something makes it.
Note that would only give you the raw materials, not the interim composite 
ones, because it would only match keys that were still = .

Robin

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



Re: [cfaussie] Recursive function giving me 500 null error

2010-08-12 Thread Sean Corfield
On Wed, Aug 11, 2010 at 9:34 PM, Seona Bellamy seon...@gmail.com wrote:
     cffunction name=downTree hint=Returns the details of everything
 needed to make an item access=public returntype=array output=no
         cfargument name=aItems type=array required=no default=
        ...
                 downTree(result);

Bear in mind that this copies result so changes made inside downTree()
are on a copy, not the original, so after calling downTree(), result
won't have changed.
-- 
Sean A Corfield -- (904) 302-SEAN
Railo Technologies, Inc. -- http://getrailo.com/
An Architect's View -- http://corfield.org/

If you're not annoying somebody, you're not really alive.
-- Margaret Atwood

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



[cfaussie] Re: Security update: Hotfix available for ColdFusion

2010-08-12 Thread Andrew
Thanks Guys.  I would have been unaware of this had it not been for
the cfaussie list.

Is there an official announcements list I can join?

Regards,
Andrew.

On Aug 12, 10:52 am, charlie arehart charlie_li...@carehart.org
wrote:
 Well, no, because that would then expose to bad guys how they could use the
 vulnerability for ill.

 Really, every shop should apply it, but as it notes, the key is an exposure 
 via the CF
 Admin, so if you have your CF Admin available to the public, you're 
 vulnerable. If you
 require web server authentication, or have IP restrictions, etc, that 
 certainly limits
 your exposure, but really, everyone should apply the fix. (To be clear, it's 
 NOT
 enough that your Admin requires a password as defined within the CF Admin!)

 I will say this, Pete Frietag has said he will be updating his HackMyCF 
 service to
 check for this vulnerability, which will be the best way for people to check 
 (without
 the exploit being exposed). It's a FREE web-based service where you point it 
 to your
 site, it runs its checks, and emails you a report. More at hackmycf.com. If I 
 hear
 that he has updated it, I'll pass it on.

 /charlie



  -Original Message-
  From: cfaussie@googlegroups.com [mailto:cfaus...@googlegroups.com] On 
  Behalf Of
  Steve Onnis
  Sent: Wednesday, August 11, 2010 8:22 PM
  To: cfaussie@googlegroups.com
  Subject: RE: [cfaussie] Security update: Hotfix available for ColdFusion

  They couldn't give more information about the actual security issue??

  -Original Message-
  From: Kai Koenig [mailto:k...@koeni.de]
  Sent: Thursday, 12 August 2010 8:39 AM
  To: cfugauckl...@googlegroups.com; cfaussie@googlegroups.com
  Subject: [cfaussie] Security update: Hotfix available for ColdFusion

  Sorry for the crosspost to the NZ and AU lists, but you might want to
  install this one rather sooner than later:

 http://www.adobe.com/support/security/bulletins/apsb10-18.html

  Cheers
  Kai

  --
  Kai Koenig - Ventego Creative Ltd
  ph: +64 4 476 6781 - mob: +64 21 928 365 /  +61 450 132 117
  web:http://www.ventego-creative.co.nz
  blog:http://www.bloginblack.de
  twitter:http://www.twitter.com/agentK
  --

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

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

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



Re: [cfaussie] Re: Security update: Hotfix available for ColdFusion

2010-08-12 Thread Sean Corfield
On Wed, Aug 11, 2010 at 11:38 PM, Andrew am2...@gmail.com wrote:
 Thanks Guys.  I would have been unaware of this had it not been for
 the cfaussie list.

 Is there an official announcements list I can join?

Yes, you can sign up for notifications from this page:

http://www.adobe.com/support/security/
-- 
Sean A Corfield -- (904) 302-SEAN
Railo Technologies, Inc. -- http://getrailo.com/
An Architect's View -- http://corfield.org/

If you're not annoying somebody, you're not really alive.
-- Margaret Atwood

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



Re: [cfaussie] Re: Security update: Hotfix available for ColdFusion

2010-08-12 Thread Gavin Beau Baumanis
Hi Andrew,


There is a link for signing up for email notification here;
http://www.adobe.com/support/security/



Gavin Beau Baumanis

On 12/08/2010, at 4:38 PM, Andrew wrote:

 Thanks Guys.  I would have been unaware of this had it not been for
 the cfaussie list.
 
 Is there an official announcements list I can join?
 
 Regards,
 Andrew.
 
 On Aug 12, 10:52 am, charlie arehart charlie_li...@carehart.org
 wrote:
 Well, no, because that would then expose to bad guys how they could use the
 vulnerability for ill.
 
 Really, every shop should apply it, but as it notes, the key is an exposure 
 via the CF
 Admin, so if you have your CF Admin available to the public, you're 
 vulnerable. If you
 require web server authentication, or have IP restrictions, etc, that 
 certainly limits
 your exposure, but really, everyone should apply the fix. (To be clear, it's 
 NOT
 enough that your Admin requires a password as defined within the CF Admin!)
 
 I will say this, Pete Frietag has said he will be updating his HackMyCF 
 service to
 check for this vulnerability, which will be the best way for people to check 
 (without
 the exploit being exposed). It's a FREE web-based service where you point it 
 to your
 site, it runs its checks, and emails you a report. More at hackmycf.com. If 
 I hear
 that he has updated it, I'll pass it on.
 
 /charlie
 
 
 
 -Original Message-
 From: cfaussie@googlegroups.com [mailto:cfaus...@googlegroups.com] On 
 Behalf Of
 Steve Onnis
 Sent: Wednesday, August 11, 2010 8:22 PM
 To: cfaussie@googlegroups.com
 Subject: RE: [cfaussie] Security update: Hotfix available for ColdFusion
 
 They couldn't give more information about the actual security issue??
 
 -Original Message-
 From: Kai Koenig [mailto:k...@koeni.de]
 Sent: Thursday, 12 August 2010 8:39 AM
 To: cfugauckl...@googlegroups.com; cfaussie@googlegroups.com
 Subject: [cfaussie] Security update: Hotfix available for ColdFusion
 
 Sorry for the crosspost to the NZ and AU lists, but you might want to
 install this one rather sooner than later:
 
 http://www.adobe.com/support/security/bulletins/apsb10-18.html
 
 Cheers
 Kai
 
 --
 Kai Koenig - Ventego Creative Ltd
 ph: +64 4 476 6781 - mob: +64 21 928 365 /  +61 450 132 117
 web:http://www.ventego-creative.co.nz
 blog:http://www.bloginblack.de
 twitter:http://www.twitter.com/agentK
 --
 
 --
 You received this message because you are subscribed to the Google Groups
 cfaussie group.
 To post to this group, send email to cfaus...@googlegroups.com.
 To unsubscribe from this group, send email to
 cfaussie+unsubscr...@googlegroups.com.
 For more options, visit this group at
 http://groups.google.com/group/cfaussie?hl=en.
 
 --
 You received this message because you are subscribed to the Google Groups
 cfaussie group.
 To post to this group, send email to cfaus...@googlegroups.com.
 To unsubscribe from this group, send email to
 cfaussie+unsubscr...@googlegroups.com.
 For more options, visit this group at
 http://groups.google.com/group/cfaussie?hl=en.
 
 -- 
 You received this message because you are subscribed to the Google Groups 
 cfaussie group.
 To post to this group, send email to cfaus...@googlegroups.com.
 To unsubscribe from this group, send email to 
 cfaussie+unsubscr...@googlegroups.com.
 For more options, visit this group at 
 http://groups.google.com/group/cfaussie?hl=en.

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



Re: [cfaussie] Recursive function giving me 500 null error

2010-08-12 Thread Seona Bellamy
On 12 August 2010 16:27, Sean Corfield seancorfi...@gmail.com wrote:

 On Wed, Aug 11, 2010 at 9:34 PM, Seona Bellamy seon...@gmail.com wrote:
  cffunction name=downTree hint=Returns the details of everything
  needed to make an item access=public returntype=array output=no
  cfargument name=aItems type=array required=no default=
 ...
  downTree(result);

 Bear in mind that this copies result so changes made inside downTree()
 are on a copy, not the original, so after calling downTree(), result
 won't have changed.


Aha! Turns out this was the missing piece. Changing that line to:

result = downTree(result);

has made everything play nicely. Thanks for all the responses and
clarifications. I understand what's going on better now, and why it
originally screwed itself up. It was indeed caught in a never-ending loop as
the first value in the array never changed and so it never got to the
beginning of the tree.

Cheers,

Seona.

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



[cfaussie] getting server name of server

2010-08-12 Thread BarryC
Hi,

We have several servers in a cluster, but I am wondering how to get
the name of the server that a script happens to be running on, there
is nothing in the cgi variable, are there any system level functions
coldfusion has (I couldn't find any), or is there a way to call native
functions to get system information?

Thanks
Barry.

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



[cfaussie] Re: getting server name of server

2010-08-12 Thread BarryC
No matter! I have found the answer;

Createobject('java','java.net.InetAddress').getLocalHost().getHostName()

I knew I'd find it as soon as I posted on here :)

On Aug 13, 3:21 pm, BarryC barrychester...@gmail.com wrote:
 Hi,

 We have several servers in a cluster, but I am wondering how to get
 the name of the server that a script happens to be running on, there
 is nothing in the cgi variable, are there any system level functions
 coldfusion has (I couldn't find any), or is there a way to call native
 functions to get system information?

 Thanks
 Barry.

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



Re: [cfaussie] Re: getting server name of server

2010-08-12 Thread Brett Payne-Rhodes
I was going to suggest the cgi variables - http_host and server_name but a
little bit of testing shows that these are related to the URL rather than
the name of the physical machine which is what you want given the solution
below.

Thanks, could be very useful...

B)



On Fri, Aug 13, 2010 at 11:23 AM, BarryC barrychester...@gmail.com wrote:

 No matter! I have found the answer;

 Createobject('java','java.net.InetAddress').getLocalHost().getHostName()

 I knew I'd find it as soon as I posted on here :)

 On Aug 13, 3:21 pm, BarryC barrychester...@gmail.com wrote:
  Hi,
 
  We have several servers in a cluster, but I am wondering how to get
  the name of the server that a script happens to be running on, there
  is nothing in the cgi variable, are there any system level functions
  coldfusion has (I couldn't find any), or is there a way to call native
  functions to get system information?
 
  Thanks
  Barry.

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



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