Rip's Domain

<CFWSOP> Update: Dad going to Day 2!

Posted in WSOP by rip747 on July 29, 2006

This is suppose to be a CF blog, but anywho. Quoted directly from my brother:

Just wanted you all to know that Dad made it to Day 2! His chip count at the end of today was $12,275. While he had a lot more chips during the day, towards the end he wasn’t getting any hands. None the less, he played very well and didn’t go chasing hands.

He played from 12pm until 3:30am. We’re both tired as hell, so if any of you call earlier then 12pm our times, which is 3pm your time, I’m going to kick some ass when I get home πŸ™‚

He plays again on Tuesday at 12 noon. You can go to www.worldseriesofpoker.com and the chip counts will be displayed for the day.

Anyway, I’ll keep you all updated. Please be sure to forward this email to Louie and Mike L. I don’t have their email addresses on hand. Also, someone please call my mom and tell her.

Talk to you all tomorrow.

-Charles

PS: I love you Laura.
PPS: Tony, kick the dogs for me πŸ™‚

Awesome, totally awesome. I know my dad is going to increase his chip stack on Day 2. During day 1, he was down to $2K and started to play reckless like he normally does and got backup to $30K. The thing that pisses me off is that PokerStars still isn’t tracking his progress. This means have to wait until I talk to my brother, or he emails me until I get updates.

Advertisements

Happy System Administrator Appreciation Day!

Posted in Blogroll by rip747 on July 28, 2006

Since Slashdot finally put it up.

HAPPY SAAD to the people that keep JRUN running πŸ™‚

<CFWSOP> Wish my dad luck!!!

Posted in WSOP by rip747 on July 27, 2006

Just a quick note (I think my dad would appreciate it).

My dad is out in Las Vegas right now competing in the WSOP (World Series of Poker). He won a the seat off a satellite on PokerStars. With the seat comes some other perks as well:

  1. He was also invited by UltimateBet to go to the Vodoo louge for a pre-game party (it’s impossible to get into that place without knowing someone).
  2. His room is paid for for the duration of the tournament (as long as he keeps advancing).
  3. They’re giving him $1000 spending money.
  4. If he makes the final table they will give him an additional $100,000.
  5. If he wins the tournament he will get an additional $1,000,000.
  6. Obviously he will become a spokesmen for PokerStars and get all the benefits that come along.
  7. They give hime shirts, hats, pants and other PokerStars gear to wear during the tournament (this is required to get the additional money).
  8. I get nothing πŸ™‚

He starts playing tomorrow at 12pm PST. I will try to update my blog with his performance. My brother is out there with him for support. Personally I think my brother is jinxed (he already had his luggage lost, but they did find it). I just hope he knocks one person out.

GOOD LUCK DAD!!!!
Dumb Links:

My brother begging for money for the entree fee.
Keep track of the tournament.
WARNING!!! The most disgusting site on the internet!!!

CF and DTS. Let MSSQL do it’s job.

Posted in ColdFusion, SQL by rip747 on July 27, 2006

I commented on a recent post about using CF to call DTS packages to execute the package and then use CF to FTP the file to a remote server. I commented that I didn’t see the reason for using CF to do this since this could all be done from within DTS itself.

I know I’ve said this before, but I’ll say it again, use all the tools available to you to get the job done. Just because you can do something in CF, doesn’t mean you should. CF is not a cure all. Using DTS and SQL Jobs to perform the task the author was doing is infinatly faster than anything CF could do.

Remember that there are many resources out there when working with MSSQL and DTS. Anything that you are trying to do has already been done, trust me on this. Some of the resources that I use:

SQLTEAM
SQLDTS
Google Groups
MSDN

I don’t want this post to sound like I’m bashing the author. All I’m trying to get across is that anything that you’re trying to do, there are resources on the internet that explain how to do it.

I knew it was going to happend

Posted in ColdFusion by rip747 on July 21, 2006

Check out Damon Cooper’s post about the POC CFTHREAD and CFJOIN tags the CF developers at Adobe are working on.

Damon’s post
I could of bet my life that Adobe was going to start working on this right after NewAtlanta annouced it at CFUNITED. This is something that I have wanted in CF for so long, but trying to get MacroMedia (now Adobe) to listen to the small guy like me is like pulling teeth. Sure they listen to their by clients, because their big clients.

I just find it funny now that it’s Adobe scrambling to play catch up with NewAtlanta.

CFEclipse: Things I miss

Posted in ColdFusion by rip747 on July 19, 2006

OK, I know I’m suppose to be blogging about BannerBoxes, but I’m really want those posts to be good and informative, so I’m taking my time with them. In the lapse I though that I would share somethings that I’m missing while using CFEclipse.

As I stated previously, I’ve moved to CFEclipse for all my CFML development now. During this time I’m growing really fond of the features that it offers (snips, toolbars, integration with subversion is the biggest plus), but there are still things that I miss from CFStudio:

Split window: I never used this feature then one day i’m editing a huge CFC and got tired of scrolling up and down the windows to see what the instance variables were. I actually clicked on the button for split window by accident and fell over because I never noticed it before (note: I’m one of those people that don’t explore software. I know how to use it for what I need to do and that’s about it.)

CFML Reference: Yeah, yeah I know there is a dictionary view and I do use it. The thing is that it has limited information at best in there and to get any real information you have to right click and choose “View online help”. The thing that really annoys me though is the layout. Why in the world did they put the windows on top of each other instead of side by side? If anyone knows how to correct this, TELL ME!!!

Drive Resource Window: Again, yes I know that there is a File Explorer View, but you can only view and open files in it and that’s it. In CFStudio it was like have Windows Explore built right in. You can copy, delete, move and rename files right there. It was great for editing a file on my test server real quick and moving it over to the production server. Yeah, yeah, I know that you have these functionalities in the Navigator View, but you can only copy and move files between projects, not actual drives.

Oh… can someone tell me why I can’t make the Preview part of the Snip Tree View taller? It’s cool and all for shorter snips, but I would love to see all of the longer snips that I have.

So all and all again, I’m loving CFEclipse. Still a few features and bugs here and there, but CFStudio had them also. I’m sure that the CFEclipse team will fix these in the upcoming releases, so I’ll just hold out until then.

BannerBoxes 2.o behind the scenes.

Posted in ColdFusion by rip747 on July 17, 2006

For those that don’t know, I’m one of the owners and the sole coder behind BannerBoxes.com (BB). BB is an advertising services similar to Google AdSense in some ways. This weekend we finally launched version 2.0. What does this have to do with CF you might ask… keep reading.

We’ve been wanting to rewrite BB for quite sometime now. The site was good and the code was OK, but I always felt that I could push the limits of CF a lot more and get way more performance from it. The site was original written around CF5 and of course had a lot of procedural code and was a pain to maintain and upgrade. With that, the decision was made to rewrite BB from the ground utilizing CFCs to encapsulate the business logic and move it out of the database. This would make it a lot easier to upgrade and add features to BB in the future as well as fix any bugs that we might come across. We also wanted to use CFCs to cache as much of the database in memory as we could to minimize the load on the database server as it’s easier and cheaper to add web servers than a database server.

It took 3 months to rewrite BB from the ground up and I must say that it was well worth it. On the old code the CF server CPU was hovering around 30% – 50%, the database server was sitting at a constant 20% – 25%. With the new code and optimizations now possible with CFCs, the CF server is at 10% – 15% and the database server at 1% – 3%. This is a tremedous performance increase.

With that I’ve decided to go behind the scenes of this rewrite and share in the triumphs and struggles that occurred. I’m going to post some of the source code that we use on BB from both CF and MSSQL. I’m going to explain how and why we do things in order to squeeze every last bit of performance that we can from CF and MSSQL. Why am I doing this? Well for several reasons:
First it’s always fun to look at someone else’s code and pick it apart. Very rarly in our business do you get to see the source code from a site unless you’re hired to work on it.

Second you might learn something new. Someone out there might be doing a project similar to BB and these posts could shed some light on a part that they’re stuck on or having trouble with.

Third, I’m no expert; am I good at what I do, of course, but I’m not the best. Someone out there could look at the code and tell me that I could get more performance if I do this way. That right there is worth it’s weight in gold.

So stay tuned for the posts. I think I’m going to start with how we structured the site and the home grown framework that we used to build the site. Remember that along the way please post criticisms and suggestions. And check out BannerBoxes.com! Tell me what you think of the site and what we could to make it better, please, we want to hear it; even if it’s so-so is better because they do this and you guys don’t.

QoQs: share your tricks!

Posted in ColdFusion by rip747 on July 12, 2006

UPDATE: I keep getting hits on the post, but noone has shared a trick since August. Do me and the rest of the CF community a favor and share something, will ya! BTW, at the time of this update, I’m drinking vodka and Gator Aid (go blue!)Β  so I’m a little tipsy. Which might be why I’m typing this πŸ˜›

I know this won’t be the most advanced topic for most CF developers out there, but we have to remember that there are some people who are just starting out using CF and by sharing some of the tricks we know will help those people learn faster. With that in mind I present some basic, yet helpful tricks on using QoQs.

A little intro:

One of the best things to happened to CF was the introduction of QoQs in CF5. Using QoQs can save yourself some pretty good amount of code and increase the performance of your application. Let’s look at some ways to do this.

First off: Grabbing the total.

We’ve all programmed reports in our careers. Usually this involves running a query to return a bunch of records and displaying the results in a table, nothing big. For an added bonus we display the total of all the records in the last row of the table, again nothing big and complex. So how would you get the total for the records in the query?

Some popular ways were to query your database again and do a SUM() on the columns that you wanted the totals for. Not bad, but why hit the database again for something like this. You could do the old adding the total to a variable while outputting the query. However this is tedious and prone to errors especially when you want to total a bunch of columns. An easy way is to just use QoQs for the job. Left’s take a look:

<cfscript>
// setting up the test query
query1 = QueryNew("customer,ordertotal");
QueryAddRow(query1, 10);
for(i=1; i LTE 10; i=i+1)
{
	name = "Tony";
	if(bitand(i, 1)){name = "Charles";}
	QuerySetCell(query1, "customer", name, i);
	QuerySetCell(query1, "ordertotal", RandRange(50, 100), i);

}
</cfscript>
<cfdump var="#query1#">
<!--- use QoQ to grab the total for each customer --->
<cfquery dbtype="query" name="querytotal">
SELECT
customer,
SUM(ordertotal) AS total
FROM query1
GROUP BY customer
</cfquery>
<cfdump var="#querytotal#">

This is an extremely basic example, but it does show the point. By using QoQ you can avoid hitting your database again and grab the totals in an easy to read and use manner.

Next Up: Query Caching.

Again this doesn’t have a huge WOW factor. I think everyone has use the “cachedwithin” attribute of the cfquery tag at some point. The only thing I can’t stand about using “cachedwithin” is that CF will cache a copy of the query for each statement. Another gotcha is that you can’t use cfqueryparam when using cachedwithin, which should be used in every query.

So how can QoQ help us out? By using the application or session scopes to store the query into memory, we can use QoQ to hit this query and pull the information that we want. The example below shows how to do this by loading the query into the application scope and then performing two separate QoQs again the query in memory. Notice that now we are able to use cfqueryparam. Now I will say that you wouldn’t want to do this on a huge table, but for a table that’s is 5000 rows or less and gets hit frequently, this could help take some load of you database server.

<cfif NOT StructKeyExists(application, "testquery")>
<p>Loading query into memory</p>
<cfscript>
application.testquery = QueryNew("customer,ordertotal");
QueryAddRow(application.testquery, 10);
for(i=1; i LTE 10; i=i+1)
{
	name = "Tony";
	if(bitand(i, 1)){name = "Charles";}
	QuerySetCell(application.testquery, "customer", name, i);
	QuerySetCell(application.testquery, "ordertotal", RandRange(50, 100), i);
}
</cfscript>
</cfif>
<cfdump var="#application.testquery#">
<cfquery dbtype="query" name="query1">
SELECT *
FROM application.testquery
WHERE customer = <cfqueryparam cfsqltype="cf_sql_varchar" value="Tony">
</cfquery>
<cfdump var="#query1#">
<cfquery dbtype="query" name="query2">
SELECT *
FROM application.testquery
WHERE customer = <cfqueryparam cfsqltype="cf_sql_varchar" value="Charles">
</cfquery>
<cfdump var="#query2#">
<!--- Uncomment the line below to remove the query from memory --->
<!---<cfset StructDelete(application, "testquery")>--->

Now that I’ve shared some of my stupid tricks with QoQs, is there anything else that people are using them for that they would like to share? Let me know and I’ll update this post with your tricks.

I’ve been Googed!

Posted in ColdFusion by rip747 on July 11, 2006

I sent a message to the owner of Fullasagoog.com asking to take a look at my blog and seeing if he would want to syndicate it. Guess what, he did. I’m Googed baby!!!

I guess if I’m going to be on a respected feed like the goog, I need to clean up my act (and my grammar).

What is really exciting and an honor was that the first person to add a comment to my blog was Charlie Arehart! That man is like a messiah and I really look up to him. So in respect for Charlie who wanted to know more about this “rabble-rouser”, I’m updating my about page.

CFECLIPSE: Grown to love.

Posted in ColdFusion by rip747 on July 11, 2006

I’m really not the type of person to jump on a bandwagon just because something is released. About a month ago I heard that the CFECLIPSE beta was available for download and I avoided it like the plague. Now that I have a new computer and need a CFML editor, I figured that it would be a good time to see if it was up the par with CFSTUDIO. Yes, believe it or not, I still used CFSTUDIO for all my CFML development.

The last time I tried out the product, I couldn’t take using it for than 2 minutes at a time before I fired up CFSTUDIO.

My biggest problems with the previous releases has been really basic stuff that I have come to embrace. Let’s take for instance word-wrapping. Prior to this release, it wasn’t there. How could something as simple as word-wrapping not be in CFECLIPSE. To that fact, I actually went to the ECLIPSE bug list and this has been a requested feature since 2004! Better yet the ECLIPSE team is still deciding on whether to include it in the next release.

The toolbars are another thing that I liked about CFSTUDIO. I loved to click a button and having code appear, it makes me feel special. CFECLIPSE has keyboard shortcuts and snippets, but it really isn’t the same.

Tag editors, enough said there. I’m not the best at remembering every little attribute of a tag, so this baby is something that I must have. Yeah I know CFECLIPSE has tag and function insight, but it was buggy at best when I tried it last.

With all that said, let me grab a fork and ketschup so I may eat my words with flavor. This latest beta is the one baby.

I really have to commend the team and especially Mark Drew, for doing such a wonderful job with this program. Every single gripe I mentioned before has been taken care of. Word-wrapping, toolbars, tag editors and so much more. Everything has worked flawlessly for me and I haven’t had a need to open up CFSTUDIO all day. With the added bonus of just being able to have some basic version history that is built into ECLIPSE itself, this the product to use for CFML development now.

In case you haven’t guessed, I will be using CFECLIPSE from now on for all my CFML stuff. As I learn little things here and there, I will post them if no one else has beaten me to it.

Again I want to thank Mark Drew and the CFECLIPSE team.