December 1, 2008

Eclipse: Working Sets

Very neat feature of Eclipse. It is going to help you to locate files. Why would you watch and browse through jungle of files, if you can isolate only part of code (files) that are of your interest? Interested, then Read It!

November 24, 2008

ColdFusion Frameworks

The best retrospective of ColdFusion frameworks I've found on net. Article will give you insight into most popular frameworks and categorization.

Read It!

November 17, 2008

Unit testing in ColdFusion

Why would CF community differentiate from any other community? That's why "all" Unit testing platforms are derivatives of xUnit project. My choice is CFUnit, because CFCUnit looks abandoned (not sure is it really), it has Eclipse plugin and it's better documented. But, after all, both environments do the job well.
So much about installation. Nnow, when you have everything you need, you just need to know what to do with it. Well, go and read CFUnit primer. It's the fastest way to learn how to use CFUnit.

More to read:
Test Driven Development with ColdFusion
(part I-III)

CFC variables.instance

When I saw for the first time, in cfc code, variables.instance = StructNew(), I asked myself "What, what, what?" :) Well, purpose of "subinstancing" of variables structure, is nothing more but teh convenience:
1. It's organized better. All variables of same kind can be grouped in that manner.
2. Easier for cfdump-ing. Do and you'll see what I'm talking about.
3. And it is more obvious what you do: variables.instance.myVar="A" means "I am adding (assigning value to) myVar into instance of variables structure"

Not necessity but can be handy

November 13, 2008

Developer Guidelines

I found this in "Developer Guidelines" on R-Project developer page. This is something I was always followed during my work but never had it written and digested. So, thank you r-project people for this :) Here it goes:
  • DO fix simple bugs
  • DO NOT fix bugs that require extensive modification
  • DO NOT fix exotic bugs that haven't bugged anyone
  • DO make small enhancements if they are badly needed
  • DO NOT let one user decide what is badly needed
  • DO fix configuration for broken platforms
  • DO NOT break functioning platforms in the process
  • DO NOT fix things that are not broken
  • DO NOT restructure code
  • DO NOT add experimental code
  • DO NOT modify the API (unless absolutely sure it is buggy)
  • DO NOT change defaults without a *very* good reason
  • DO clarify documentation
  • ONLY add or modify examples if needed for clarification
  • DO NOT reword messages
  • DO NOT modify regression tests (except if they were buggy)
  • DO NOT add code that cannot become reasonably complete by the next release.
Obviously none of the above rules are carved in stone, and all are subject to interpretation in actual cases

November 12, 2008

Eclipse and SVN Client

I choose Subclipse as my favorite SVN Client plugin for Eclipse. Why? Because most people use it. To install it go here

To start working open Eclipse, go to Window -> Show View -> Other, open up the SVN Folder and pick the SVN Repository, click on the "Add SVN Respository" button and enter the address of your SVN server (svn:// or svn+ssh:// or http:// ot https://). That's it.

Few basic commands (abstract from SVN online book):
The typical work cycle looks like this:

1. Update your working copy.
• svn update

2. Make changes.
• svn add
• svn delete
• svn copy
• svn move

3. Examine your changes.
• svn status
• svn diff

4. Possibly undo some changes.
• svn revert

5. Resolve conflicts (merge others' changes).
• svn update
• svn resolve

6. Commit your changes.
• svn commit

Setting up SVN Server

OK, Let's be honest. Who doesn't like to do a job in a minute and pretend to be uber smart? Software that would allow you that, in case of SVN installation, is svn1clicksetup. Without further hesitation I will tell you to go there, download it and do your "next-next-finish" work.

But, if you really,really, really feel that you need to put some effort (aka extra work), you may
go to read Chapter 6. Server Configuration of SVN book online.
This chapter will help you to decide which server configuration to choose and how to set it up.
Read It!

Ofc, I've chosen easiest option - vanilla svnserve installation. Why? Well I am not an administrator, I am not willing to become one and there is always large possibility that company you are working for already have SVN server configured or rented.

Btw, "Version Control with Subversion" is very good literature to read and place where you can look for answers on this subject.

Eclipse error: Error retrieving feature.xml

Using Software Updates and then Find and install

1. Delete the site.xml file in your Eclipse directory.
2. Run Help->Software Updates->Find and install, the error will not appear.
If the plugin has the official site, from where you can install it in Eclipse using Help->Software Updates->Find and install, I suggest that you should not download it yourself and unzip it into your Eclipse directory.

source

Preparing Eclipse 3.x for ColdFusion Development

CFEclipse - An Eclipse plugin for ColdFusion

The best plugin I found, for Eclipse IDE. Simply it gears Eclipse with all-you-need for CF development: color-coding, content outline, code & bracket highlighting, code folding, tag code completion, snippets, etc... full feature list

Uber fast install:

1. Select the "Help->Software Updates->Find and install" menu option
2. On the screen that is displayed, select 'Search for new features to install' and click the 'Next' button
3. Now click the 'New Remote Site' button
4. Enter a name for the update site, for example "CFEclipse". In the URL box, enter "http://www.cfeclipse.org/update" and click the OK button


Note: This is the moment when you are going to install CFUnit too.

ColdFusion 8 Debugging

Well, not much to say but to advise you to sit and read this ADC step-by-step tutorial.
Read it!

Developing ColdFusion Extensions in Java

To make this short and effective:

1. You cannot reload CFX developed in Java without server restart. Empirically proven and confirmed by other CF developers (as some ppl claim, even by Adobe tech support)
ref: http://dreamweaverforum.info/advanced-techniques/78901-how-reload-java-cfx-without-restarting-coldfusion.html

2. Article to read to get into this subject fast and "good enough"
http://www.intermedia.net/support/coldfusion/cf5docs/Developing_ColdFusion_Applications/CFXTags4.html

3. Example
import com.allaire.cfx.*;

public class test implements CustomTag {

public void processRequest(Request request, Response response) throws Exception {
// TODO Auto-generated method stub
String strName = request.getAttribute( "NAME" );
response.write( "Cao, " + strName );

Query qr = request.getQuery();

if ( qr == null )
{
throw new Exception(
"Missing QUERY parameter. " +
"You must pass a QUERY parameter in "+
"order for this tag to work correctly." ) ;
}

int i=1,j=1;
while(i<=qr.getRowCount()){ j=1; response.write(" "); while(j<=qr.getColumns().length){ response.write(qr.getData(i, j)+" | "); j++; } i++; } } }


Voila! Now you know everything :)))