the singularity of being and nothingness
Archive for September, 2010
Gotcha with Dynamic Component Method Invocation
Sep 30th
In an app I’m currently working on, I came across the need to be able to invoke methods from a particular component dynamically. On the surface, this is pretty simple:
myComp = createobject("component","com.utils").init(); dyn = myComp[methodvariable]; dyn();
While this technically *works*, there is one huge gotcha: there does not appear to be any persistence of the initialized component from init() to dyn(). That is, if the init method, say, sets up datasource names and other component properties, these will no longer be available in the invocation of dyn(). Not a big deal, I guess, if you don’t have need of the init function…but a killer if you do.
Fortunately, it’s easy enough to work around this. After you’ve instantiated the component, just use to call the dynamic method:
<cfinvoke component="#myComp#" method="#methodvariable#" /> (cfinvoke is still tag-bound...sorry! :))
Anyway, easy enough, but something a person can easily spend FAR too much time trying to work out. Uggh.
Share this:Ivoryline: Instincts
Sep 24th
I recently learned about Ivoryline from the Solid State sampler released by Tooth and Nail Records a while ago. First off, their latest album “Vessels” is pretty good–be sure to check it out.
So anyway, over the last few weeks, Tooth and Nail has been hyping and teasing about the release of the new video for Ivoryline’s song “Instincts.” It finally came out yesterday…
To be honest, I’m not terribly impressed with the video. There are parts that are interesting, but I think it doesn’t do justice to the song.
Anyway, here’s the video, and the lyrics for the song. If you agree or disagree with my take, leave a comment!!
InstinctsYou'll show me love, no matter what I do. You'll show me love, even when my back turns on you. And I will go about my friends Like I know just what to do, But I really need your hand To pull me through. Let it up, let it up, Let it out on. Instincts, can not keep me from falling I've learned that by now. Instincts, can not keep me from falling I've learned that by now Your start is love, and give us the choice On who we become, and if More >
Spam of Biblical Proportions
Sep 13th
I recently had several comments like this left on an old blog. I have reproduced the offending comment, mostly untouched save for corrections of the more offensive grammatical errors 🙂
—-
If I speak in the Cheap Authentic NFL Jerseys of men and of angels, but have not love, I am only a resounding gong or a clanging cymbal.
If I have the gift of prophecy and can fathom all mysteries and all Official NFL Jerseys, and if I have a faith that can move mountains, but have not love, I am nothing.
If I give all I possess to the poor and surrender my USA Jerseys Shop to the flames,but have not love, I gain nothing.
Love is patient, NFL Jerseys are kind.
It does not envy, it does not boast, it is not proud. It is not rude, it is not self-seeking, it is not easily angered, NHL Jerseys keep no record of wrongs.
Love does not delight in evil but rejoices with the truth.
It always protects, always trusts, MLB Jerseys always hope, always persevere.
NHL Hockey Jerseys never fail.
But where there are prophecies, they will cease; where there are tongues, they will be stilled; where there is knowledge, it will pass away.
For More >
Quick Note About Data Validation
Sep 1st
All developers, of course, give lip-service to the importance of data validation. But how many do a ridiculously thorough job of it? If you’re like me, the answer is probably that you do the obvious validations that come to mind during development, and then wait for the other, less probable ones when an issue actually comes up.
This happened to me today at work. I was working on a form that accepts–from the same field (not my design)–either an integer or a string. The way the validation was setup is that if the search term evaluated as numeric, the resulting query would look to match on primary keys in the db; for strings, well, a simple “like” search of the title field.
The validations worked fine for months and months, but today through an error. Here’s a simple recreation of the query:
<cfquery name="getstuff"> select field1, field2 from thetable where id = <cfqueryparm value="#arguments.searchterm#" cfsqltype="cf_sql_integer" /> </cfquery>
And the error I received was to the effect that the value of “#arguments.searchterm#” was not a valid integer based on the queryparam restraint.
So what happened? Basically, the validation for “numeric” failed. Well, it didn’t really fail…it just wasn’t looking for all the right stuff. After More >