Community Member Profile
- Profile: /members/1725-Elliott-Sprehn.htm
- URL: http://www.elliottsprehn.com/blog/
- Comments: 129
- Points: 137
Recent Blog Comments By Elliott Sprehn
-
Exploring ColdFusion Component Runtime Class Properties And Serialization
Posted on Mar 18, 2010 at 5:35 PM
Saving private properties is necessary so that you can "reconstitute" an object on the other side of the wire, or load up a serialized object you saved to disk. If it didn't save the private state of the object you'd lose that information and possibly end up with an object in an unusable st... read more »
-
Executing A Recursive CFThread In ColdFusion 9
Posted on Feb 24, 2010 at 1:35 PM
This the coolest use of getFunctionCalledName() I've seen. There was some initial feedback on the prerelease like "what would you ever use that for!" and no one even dreamed of anything like this.... read more »
-
Making Sure Your ColdFusion Applications Are Uniquely Named
Posted on Feb 10, 2010 at 6:32 AM
I've seen this approach taken before, but it's messy with a lot of things. Saying you don't have to read the name is not true. For instance cflog writes the application name in the log file. As you somewhat mentioned CF also uses the application name to create the the full (server side) se... read more »
-
ColdFusion GetPageContext() Massive Exploration
Posted on Feb 9, 2010 at 4:13 PM
@Sean You don't need to use GetPageContext().getFusionContext().getPagePath(), just use GetCurrentTemplatePath() instead (which really just calls getPagePath() anyway). As for the methodCalledName private property, use GetFunctionCalledName() which was added in CF9. The methodCalledNa... read more »
-
Using Logical Operators To Perform Ternary Operations In Javascript
Posted on Nov 19, 2009 at 1:35 PM
@Ben Hah! You should start a CF obfuscation contest.... read more »
-
Using Logical Operators To Perform Ternary Operations In Javascript
Posted on Nov 19, 2009 at 11:38 AM
In excess it certainly reduces readability, but the idea that the operators return a value is pretty foundational to some languages. For instance, ruby doesn't have a ternary operator, instead you use the logical operators. An example from a recent project was: # username is the... read more »
-
Getting IFRAME Window (And Then Document) References With contentWindow
Posted on Jun 10, 2009 at 4:56 PM
@Muhammad You can only interact with the document of an iframe if the document it loaded is on the same domain. So it would depend on what you meant by "other websites".... read more »
-
Getting IFRAME Window (And Then Document) References With contentWindow
Posted on May 22, 2009 at 2:43 PM
@Ben http://scheduler.cfunited.com/js/scheduler.js If you search for "getIFrameDocument" that's what I used. It works in basically every browser, new and old. :)... read more »
-
ColdFusion 8 Per-Application Settings Get Partially Cached (And There's Nothing You Can Do About It)
Posted on May 6, 2009 at 8:11 PM
@Ben This bit us recently with the mappings and how part of our platform worked. All of our applications live in the same CF application and each has a section of the application scope. I had it defining an auto mapping for the root of each sub-application (which is outside the webroo... read more »
-
Using Super Constructors Is Critical In Prototypal Inheritance In Javascript
Posted on Apr 17, 2009 at 11:58 AM
@RickO Who is multithreading JavaScript? To my knowledge all browsers single thread JS execution. I've not seen anything about adding support for threading constructs.... read more »
-
Testing For ColdFusion Component Interface Support
Posted on Apr 16, 2009 at 4:07 PM
@John Ack! If you want to go that route just use IDL. component extends Super { public function method( string arg1="default", optional numeric arg2 ); } There's nothing in there that isn't plain text for another developer. Notation that uses *, -, +, ~, # and... read more »
-
Quick Thought On OOP Data Validation And Why Redundancy Is OK
Posted on Apr 5, 2009 at 6:01 PM
@Ben The problem with throwing errors like that is that you can't generically catch them. Account.Init.Number.InvalidArgument With this you can cfcatch Account errors, or Account.Init errors, or even Account.Init.Number errors, but you can't catch InvalidArgument errors generica... read more »
-
Ask Ben: Finding XML Nodes That Have Children With The Given Case-Insensitive Phrase
Posted on Feb 12, 2009 at 1:18 PM
It's not about them implementing anything. XPath 1 just doesn't have those functions, the XPath engine they use (Xalan) is XPath 1 compliant. They'd need to use an XPath 2 compatible library instead, and that means switching to Saxon because that's the only implementation in Java unfortunat... read more »
-
Ask Ben: Checking Domain Name Availability Using ColdFusion
Posted on Nov 25, 2008 at 8:18 PM
@Stork Provided you query for the A record contents then no, it will never change. If you have access to a *nix machine try "dig google.com" and what you'll get back is the DNS master file records. That's the actual DNS format that will never change until they replace DNS with s... read more »
-
Ask Ben: Limiting The Number Of Simultaneous Users For A Given IP Address
Posted on Nov 21, 2008 at 12:57 PM
This is trivial to fix with an onError() handler. When you cfabort or cflocation CF throws a coldfusion.runtime.AbortException which you could trap in the Application.cfc#onError() and decrement the counter. That aside, limiting connections based on IP address is a horrible horrible idea un... read more »
-
Comprehensive ColdFusion Component OnMissingMethod() Testing
Posted on Nov 20, 2008 at 1:38 AM
The reason for this is actually very simple. I'm pretty sure I've posted about this a number of times... CFCs are just proxied pages. CreateObject() returns a TemplateProxy that wraps the CFPage that is your actual code. When you call a method inside a CFC without qualifying it with t... read more »
-
Ask Ben: Limit File Upload Size In ColdFusion
Posted on Nov 12, 2008 at 1:21 PM
@Adrian That won't work because of the possible race condition. Right after the fileExists() and before the delete the file could vanish, and then the operation would still fail.... read more »
-
Ask Ben: Redirecting Users To A Random Page
Posted on Oct 29, 2008 at 2:29 AM
@Gareth Haha, fair enough. I've not benchmarked it, so outside the theory I'm not quite sure what the exact metrics are. That'd certainly be something fun to look at. Thanks!... read more »
-
Ask Ben: Redirecting Users To A Random Page
Posted on Oct 28, 2008 at 10:33 PM
@Gareth If you read through the comments on that page you can see the various suggested methods don't scale well at all because they require generating random numbers for every row in the table. If you have 62 million rows, that's no good. Generating a finite key set and checkin... read more »
-
Ask Ben: Redirecting Users To A Random Page
Posted on Oct 28, 2008 at 3:14 PM
@Christopher and Ben It's not a totally unusual request in community sites. When you have thousands or millions of members, it's quite a cool feature to randomly be redirected to a random user page or submission to learn about users you wouldn't normally encounter. deviantART for inst... read more »



