Elliott Sprehn
Member since Dec 11, 2008
- Profile: /members/1725-elliott-sprehn.htm
- URL: http://www.elliottsprehn.com/blog/
- Comments: 132
Recent Blog Comments By Elliott Sprehn
-
Bug With ARGUMENTS Scope And Implicit Array / Struct Creation
Posted on Aug 1, 2010 at 12:29 AM
@Tom I submitted a bug because they broke implicit structs and arrays in named arguments in 9.0.1, specifically with accessing local variables (of which the arguments scope is one). I got a confirmation that they fixed it but it also vanished from the bug tracker. Hopefully we'll get a hotfix soon.... read more »
-
Javascript's IN Operator Does Not Work With Strings
Posted on May 11, 2010 at 4:39 PM
The next iteration of JS is supposed to finally get rid of the string primitive problem. Martin is right that the problem is that "in" is an operator and not a method. "foo" in new String("bar") does work for that reason. I'm pretty sure all this nonsense came about for performance reasons back in... 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) session Id... 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 webroot) at the sta... 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 what is horrendously cryptic, es... 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 generically. CF can catch... 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 unfortunately. Pe... 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 something better. :... 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 unless thi... 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 this, such as ... 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 checking against that is ... 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 instance has Rand... read more »
-
Hal Helms On Object Oriented Programming - Day Four
Posted on Oct 24, 2008 at 3:53 PM
@Todd Ah yes, I definitely agree.... read more »
-
Hal Helms On Object Oriented Programming - Day Four
Posted on Oct 24, 2008 at 3:31 PM
@Ben Thanks so much for posting this series. It's really great to see you growing your own set of ideas about OO and how to design applications, and Hal is definitely great for getting people to think different. All too often we take the one (vocally advertised) way of doing things as correct. It'... read more »