Saturday, December 27, 2008

Manual Query Safe List via ReReplace (Regex) on a Comma Delimited list of Numbers

So, I've been using this a little more often, here and here, because it's handy and I think it's really safe.

Making the string safe, easily and quickly:

<!--- not a digit or comma = replace it out. Allow only digits and commas = safe --->
<cfset variables.itemtypeid = REREPLACE(variables.itemtypeid,"[^\d,],","","ALL")>

On top of this, if you know on the processing side that there cna be a max of 20 items, truncate the list at the 20th. This makes it even safer.

Now you can safely query:

Select id, text
from table
where id IN (#variables.idlist#)

Happy SQLing...


And that's a wrap.

Thursday, December 18, 2008

2012: ? or !

So I'm cruising slashdot and read about holes in the natural magnetic shielding of our amazing planet Earth. These wholes are mysterious and shrink and grow, or come and go, whatever. We don't know too much. But then it reads that the other side of this issue with the Earth's magnetic shielding and these holes is solar particles form our nice, big Sun. It continued to read how the Sun is having increasing numbers of Sun Spots which will peak in intensity in 2012.

And I think to myself, 'That's the same year that the Aztec/Mayan calendars END!'. Why does all this junk have to align? This is worse than a believable conspiracy theory.

Slashdot:

The End:

Monday, December 15, 2008

Google Salt?

Google NaCl = Google Salt. 

A little elemental punning.  :)



Could be good, could be bad.