Rip's Domain

It’s HALLOWEEN!!!!!!

Posted in Halloween by rip747 on October 31, 2006

For those that know me personally, this is my favorite day of the year (yes, I HATE Christmas). So just a quick HAPPY HALLOWEEN to everyone. Be sure to go see SAWIII tonight or curl up with a good gore movie. Also buy tickets to the horror file fest going on near you.

Bravo documentary on ghosts
Halloween legends
More ghost videos

Are CFX tags really needed?

Posted in ColdFusion by rip747 on October 30, 2006

Ben Forta blogged recently about a text to XHTML converter called CFX_Markdown (NOTE: It’s always wise to have some sort of DEMO page for a web extension.).

What really struck me was that this project is written as a CFX Java tag. When I first read this, I said, “WTF!!! Who writes CFX tags anymore?”. I guess this guy answered that question, now on to the original.

With the advent of CFC in CFMX6.0, is there really a need to be writing extension to CF with CFX tags? Personally I don’t see the benefit. The main problem with CFX tags is that they need to be installed within CF administrator. This is sometimes impossible on a shared host as most shared hosts will not install them for fear that they aren’t thread safe and will cause the server to crash. Why couldn’t something like this be written with CFCs and then have a custom tag wrapper? I often wondered why extension like the Alagad Image Component never took this route. For most people it a lot easier to write using CF tags then method calls.

DotNet DataSet To CF Structure of Queries

Posted in ColdFusion by rip747 on October 30, 2006

UPDATE: I don’t want to get comments or hate mail saying that I stole this code from Joe and called it my own. I give Joe credit and I even emailed him about it.

I have no idea why Joe Rinehart never submitted this little gem to CFLIB.org (probably because it takes 6 months for your submission to show up). Any who, this is function that he wrote a while back that will take a DotNet Dataset and convert it to a CF structure of queries. I corrected some bugs (it would bomb if there was no record returned) and updated it (it now automatically converts xs:dateTime columns to CF datetime) and submitted it to CFLib. Hopefully someday it will make it into a library there, but for the mean time you can download it below.

I just want to say that Joe Rinehart deserves all the credit for this one. Thanks Joe!!!

====================================================================

<!— convertDotNetDataset —>
<cffunction name=”convertDotNetDataset” access=”public” returnType=”struct” output=”false”
hint=”takes a .Net dataset and converts it to a CF structure of queries”>
<cfargument name=”dataset” required=”true”>
<cfset var Local = StructNew()>
<cfset Local.result = structNew() />
<cfset Local.aDataset = arguments.dataset.get_any() />
<cfset Local.xSchema = xmlParse(Local.aDataset[1]) />
<cfset Local.xData = xmlParse(Local.aDataset[2]) />
<!— keeps track of which columns are xs:dateTime (1999-02-16T00:00:00.0000000-05:00) columns, so we can convert them —>
<cfset Local.DTColumns = StructNew()>

<!— Create Queries —>
<cfset Local.xTables = Local.xSchema[“xs:schema”][“xs:element”][“xs:complexType”][“xs:choice”] />
<cfloop from=”1″ to=”#arrayLen(Local.xTables.xmlChildren)#” index=”Local.i”>
<cfset Local.tableName = Local.xTables.xmlChildren[Local.i].xmlAttributes.name />
<cfset Local.xColumns = Local.xTables.xmlChildren[Local.i].xmlChildren[1].xmlChildren[1].xmlChildren/>
<cfset Local.result[Local.tableName] = queryNew(“”) />
<cfloop from=”1″ to=”#arrayLen(Local.xColumns)#” index=”Local.j”>
<cfif Local.xColumns[Local.j].xmlAttributes.type EQ “xs:dateTime”>
<cfset StructInsert(Local.DTColumns, Local.xColumns[Local.j].xmlAttributes.name, “”)>
</cfif>
<cfset queryAddColumn(Local.result[Local.tableName], Local.xColumns[Local.j].xmlAttributes.name, arrayNew(1)) />
</cfloop>
</cfloop>

<!— see if there are any row of data, if not exit —>
<cfif NOT StructKeyExists(Local.xData[“diffgr:diffgram”], “NewDataSet”)>
<cfreturn Local.result>
</cfif>

<!— Populate Queries —>
<cfset Local.xRows = Local.xData[“diffgr:diffgram”][“NewDataSet”] />
<cfloop from=”1″ to=”#arrayLen(Local.xRows.xmlChildren)#” index=”Local.i”>
<cfset Local.thisRow = Local.xRows.xmlChildren[Local.i] />
<cfset Local.tableName = Local.thisRow.xmlName />
<cfset queryAddRow(Local.result[Local.tableName], 1) />
<cfloop from=”1″ to=”#arrayLen(Local.thisRow.xmlChildren)#” index=”Local.j”>
<cfset Local.RowData = Local.thisRow.xmlChildren[Local.j].xmlText>
<cfset Local.ColumnName = Local.thisRow.xmlChildren[Local.j].xmlName>
<!— if this column is a xs:dateTime column, convert —>
<cfif StructKeyExists(Local.DTColumns, Local.ColumnName)>
<cfset Local.RowData = ReReplace(Local.RowData, “(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2,2}).*”, “\2/\3/\1 \4:\5:\6”)>
</cfif>
<cfset querySetCell(Local.result[Local.tableName], Local.ColumnName, Local.RowData, Local.result[Local.tableName].recordCount) />
</cfloop>
</cfloop>

<cfreturn Local.result>
</cffunction>

DOTD WTF happened?

Posted in movies by rip747 on October 27, 2006

I am pissed beyond belief. Upcoming Horror Movies just posted a link to the trailer for the new Day of the Dead (DOTD) remake and it looks like shit! How could this have happened? It has nothing in it from the original movie. I’ve been waiting for this file for the last 2 years since I saw the Dawn of the Dead remake. The Dawn remake is by far one of my most favorite movies of all times. Now I have these high hopes for Day and I’m totally bummed about it. My brother thinking about waiting for DVD to see it. I’m torn whether to go see this in the theater or not.

Any  other horror fans out there that have seen the trailer and think that they screwed the pooch?

When you shouldn’t use a framework.

Posted in ColdFusion, Frameworks by rip747 on October 27, 2006

Andy Jarrett hit upon something extremely interesting in a recent blog post: When not to use a framework. All the hype surrounding frameworks in the CF community lately has recently started to turn into a war. Which one is better, faster, more stable and practical. Depending on which one you use, your opinion will be different from the next guy.

Frameworks do make our lives easier by giving us a universal way of structuring our applications. It’s great when you later have to come back to a project written in say MG and need to do some tweaking or adding, that you know where to put things and can follow the logic. It’s also great if you get handed someone else’s project and can follow their logic. This is all done because the framework is the system that sets the logical flow of the application and not the individual.

But even though frameworks tend to make programming applications easier, they also bloat application just as well. I remember when Fusebox came out long ago and it was all the buzz. I remember one of the example application processing templates at 400ms. I took that example app and rewrote using straight procedural code and got the thing to process the templates in 10ms. The same can be said for the frameworks today. With all the overhead of the framework handling the event calls of you application, you application will be slower than if you just wrote it using straight CFC calls.

So when would be an appropriate time to tell someone to just dump frameworks altogether? To me it comes down when a portion of an application needs to run as fast as possible and can separated from other portions of the application. I’ll use BannerBoxes as an example.

The main portion of the site, where advertiser and publisher manage their account and sign up, uses a particular framework to make development quicker and easier for me. This portion of the site doesn’t get millions of hit a day, so I can trade off manageability for speed. I’d rather be able to quickly add another section to this portion of the site or have someone else be able to add it for me and the framework does makes this possible.

Now the Feed and Click processing portions of the site do get millions of hits a day. These portions of the site need as much speed as they can get. These portions do not use any frameworks as I can’t afford to have any overhead whatsoever. When you’re processing millions of feed pulls and clicks a day, 10ms in template processing DOES make a difference and it IS noticeable. These portions use straight CFCs with A LOT of caching to perform this feat.

So in closing, I’m NOT trying to bash all the frameworks out there or telling people not to use them in their development life cycle. What I am saying is that sometimes people need to stop and think if using a framework is the right move in a particular portion of an application that requires that portion perform at top speed.

My JQuery Plugin: PopUpWindow

Posted in Jquery, PopWindow by rip747 on October 26, 2006

This post is outdated. The new plugin can be found here. Please updated any bookmarks.

Who’s using ColdBox?

Posted in ColdFusion by rip747 on October 24, 2006

With all the talk about Model-Glue, MachII and Fusebox being the frameworks of choice for CF development, I’m wondering if anyone is using ColdBox out there. I’ve been watching this framework for sometime now, but I have yet to have the time to really sit down and give it a whirl. The features list is really impressive and thier the backend dashboard is unbelievable. This is one really professionally thought out framework. With the release of 1.1.0, I have to get off my ass and start playing around with this. So back to the original question: Is anyone out there using it yet? If you are, please leave me some comments about what your experience with it is like.

JQuery: Zebra Table Showdown

Posted in Jquery by rip747 on October 23, 2006

This is a very good blog post by John that shows you how to zebra stripe a table in all of the popular JS frameworks out there. I think that it’s funny how it takes at 5 lines of code and 4 different function calls in the other frameworks to do what JQuery does in just 2 chainables.

An excellent read and demostration

Andy Jarrett Friday tribute

Posted in ColdFusion, Jokes by rip747 on October 20, 2006

The best part of my day on Friday is reading Andy Jarrett’s blog for his Friday joke. They’re always funny and a great way to spill the coffee on your keyboard. With that said, here is my tribute to Andy and contribution to the Friday joke, keep it up Andy:

Two campers are in the woods sitting by the fire when a HUGE grizzly bear slowly enters their campsite. The one camper is frozen with fear while the other camly reaches for his sneakers and begins to put them on. The scaried camper saids to his freind, “Dude what are you doing? You’re never going to out run that bear.” The friend responses, “I’m not going to out run the bear, I’m going to out run you.”

Dave’s Jquery rewrite

Posted in Jquery by rip747 on October 19, 2006

I can’t resist. Dave Shuck just did a cool blog post use the DOM to insert or remove content. Once I saw this, I just couldn’t resist rewriting his code in JQuery!

<html>
<head>
<title>js stuff</title>
<script type=”text/javascript” src=”http://jquery.com/src/jquery-latest.pack.js”></script&gt;
<script type=”text/javascript”>
$(function(){

// say hello
$(‘a.sayhello’).click(function(){
$(“#DisplayContainer”).html($(“#divHelloWorld”).html());
});

// smile
$(‘a.smile’).click(function(){
$(“#DisplayContainer”).html($(“#divCassidy”).html());
});

// closeme
$(‘a.closeme’).click(function(){
$(“#DisplayContainer”).html($(“#divCloseMe”).html());
});

});
</script>

<style type=”text/css”>
.link{padding: 20px;float: left;}
.contentdiv{border: 1px dashed #cccccc;padding: 20px; clear: both;}
</style>

</head>
<body>
<div id=”HoldingContainer” style=”display:none;”>
<div id=”divHelloWorld”>Hello World</div>
<div id=”divCassidy”>
<div>Here is a picture:</div>
<div><img src=”http://www.instantspot.com/userfiles/073006/91/100_7776.JPG”></div&gt;
</div>
<div id=”divCloseMe”>
<input value=”bye!” type=”button” onclick=”wwwClearElement(document.getElementById(‘DisplayContainer’))”>
<div>(kills this div until page refresh rather than putting back into the holding div)</div>
</div>
</div>
<div class=”link”><a class=”sayhello” href=”javascript:void(0);”>Say Hello</a></div>
<div class=”link”><a class=”smile” href=”javascript:void(0);”>Smile</a></div>
<div class=”link”><a class=”closeme” href=”javascript:void(0);”>Self-loathing Div</a></div>

<div class=”contentdiv”>
Here is where we will show our dynamic content:
<div id=”DisplayContainer”></div>
</div>
</body>
</html>