Eric Fickes

Eric Fickes

43p

74 comments posted · 2 followers · following 2

1 day ago @ Eric Fickes - McDonalds' Chicken Nug... · 0 replies · +1 points

I think they started with foam before moving to chicken meat.

2 days ago @ Eric Fickes - Read flashlog.txt usin... · 0 replies · +1 points

ARGH, looks like I created that zip on my MAC. I will fix the zip and repost.

3 weeks ago @ Eric Fickes - McDonalds' Chicken Nug... · 0 replies · +1 points

Chickens have bones, glad somebody finally explained that to me. What still upsets me is McDonalds getting away with telling the public their nuggets are boneless white meat chicken.

Chickens have bones - yes

Fast food is processed animal parts - yes

Does McDonalds put these warnings on the fun boxes? - No, they shouldn't have to because they only sell boneless white meat chicken nuggets. Right?

I grew up eating McDonalds but my children have not. We just happened to get lucky one night while visiting school friends at the PlayPlace.

It's my opinion McDonalds has the money to serve the "bone free" food they market to the masses.

This post is emotional, but it's also my site. Thanks for stopping by.

10 weeks ago @ Eric Fickes - Incorrect syntax near ... · 0 replies · +1 points

The code is correct, but the word "table" is a reserved keyword in SQL. I never name my database tables "table" so I've never run into this one before.

Do you have any other tables in your database that you can run this code against?

-EF

11 weeks ago @ Eric Fickes - Update Twitter status ... · 0 replies · +1 points

Thanks for the tip James, I haven't heard of supertweet yet.

19 weeks ago @ Eric Fickes - Eleven Coldfusion-ish ... · 0 replies · +1 points

Sweet! Glad this post helped.

20 weeks ago @ Eric Fickes - Eleven Coldfusion-ish ... · 0 replies · +1 points

Yes, you created the Array correctly. However, you created a 2 dimensional array when you probably only need a single dimension array.

That is, I would change line 97 to read like this : "ordinalArray = ArrayNew(1);"

As for your error about column count not matching, that's exactly what the problem is. Look at your INSERT statement. You have five columns listed, but the values only contain four columns. It appears that you've added ipOrdinal to the INSERT statement, but not tot he VALUES portion of the statement. Hope that makes sense.

20 weeks ago @ Eric Fickes - Eleven Coldfusion-ish ... · 2 replies · +1 points

If you're looking to store each ordinal in a 2nd array, that should be a simple addition. Create a new array under this line "insertArray = ArrayNew(1); // temp array to hold insert values" for your ordinals. Then under this line "ArrayAppend( insertArray, "( '#groupName#', '#_ipPrefix#.#xx#', #ipStatus# )" ); ", put the same thing only for your new array.

Something like this "ArrayAppend( ordinalArray, #xx# ); ".

Hope that helps.

20 weeks ago @ Eric Fickes - Eleven Coldfusion-ish ... · 4 replies · +1 points

arrgghhh, I didn't realize I shouldn't be putting code in the comments. I just put the same code into http://pastebin.com/qusJ3R9V so maybe that will look a tad cleaner.

20 weeks ago @ Eric Fickes - Eleven Coldfusion-ish ... · 5 replies · +1 points

Hey jlig, this could really go a number of ways, but here's one possible solution. This code takes your ip range and creates one large INSERT statement using MySQL's multi-value insert feature. Hopefully this helps in some way. I've broken it out into two simple files.

form.cfm
[coldfusion]
< form action="handler.cfm" method="post" >
StartIP

EndIP

Status

Group



[/coldfusion]

handler.cfm
[coldfusion]

// NOTE : just assuming all data is correct from the form
startIP = form["startIP"];
endIP = form["endIP"];
ipStatus = form["ipStatus"];
groupName = form["groupName"];

// setup vars for loop processing
xx = listToArray( startIp, ".")[4]; // first IP in range
_endBit = listToArray( endIp, ".")[4]; // last IP in range
_ipPrefix = Replace( startIp, ".#xx#", "" ); // trim off the final .999 to get ipPrefix
insertArray = ArrayNew(1); // temp array to hold insert values

// loop through ip range and create VALUES list for SQL INSERT
while( xx <= _endBit )
{
// append each row's value to array
ArrayAppend( insertArray, "( '#groupName#', '#_ipPrefix#.#xx#', #ipStatus# )" );
xx++;
}
// convert array to comma delimited list
insert_values = ArrayToList( insertArray, "," );

// cleanup
ArrayClear( insertArray );



< cfquery name="insert_data" result="insert_result" DATASOURCE="#request.dsn#" USERNAME="#request.dbuser#" PASSWORD="#request.dbpswd#" >
INSERT INTO GROUP_IPS ( group_id, ip_address, status )
VALUES
#PreserveSingleQuotes( insert_values )#


[/coldfusion]