posted under category: Free Code For You on June 8, 2011 by Nathan
A little bit ago I committed my first code to GitHub in the form of a project I’ve been tinkering with, a cyclomatic complexity measuring tool for your CFML apps. It’s just a few files and a snazzy interface that will give you a heatmap kind of display to help highlight areas of complexity in your ColdFusion apps.
It’s a quick toy to play with, and maybe it can help you reduce or refactor some of the more complex aspects of your applications, so give it a try!
Project & Files on Github
And screenshots, so you know what you’re getting in to:
Finally, big props to Sean Coyne for already dropping a patch on it. I like this Github stuff, but I don’t understand all the terminology yet.
posted under category: Free Code For You on November 10, 2008 by Nathan
Hey all - quick note to let you all know that I issued my first commit of many into the SQL Surfer project. No real single-file download yet, but you can download the source and build your own with Eclipse, Ant and Groovy (if you dare!).
I'll share some more ideas with you all as I progress.
posted under category: Free Code For You on October 19, 2008 by Nathan
I kind of went overboard on the languages & platforms with SQL Surfer 2.0, which I first mentioned early yesterday morning. Luckily, the finished product is just running CF/HTML/CSS/JS (That's 4).
The build process uses C# (+1) to customize fixes to Edit Area.
I used a batch file (+1) to copy the C# exe to my dev folder.
The build file is Ant (+1), and Ant is in XML (+1).
The build file uses groovy (+1) to replace some includes with actual content.
Total count: 9 different platforms, languages or technologies. Not bad for a little SQL tool.
UPDATE 10/23: I move the c# asynchronous process into Groovy during the build process, so that removes 2. That puts me down to 7 now.
posted under category: Free Code For You on October 18, 2008 by Nathan
My wife has been on me to work on some projects that will make us money. Instead, she's seen me hacking away at this little toy. SQL Surfer 2.0 is a web 2.0 style SQL query editor. I've been playing with it for a few weeks now, and I've got to say, it really is starting to rock.
I had this old version, version 1, which was like your basic postback SQL tool in 200 lines of code. Well into 4 years old now, I was still using it, and i felt completely ashamed. Bad programmer. It looks lame, it works lame, but at least it worked. It had some cool ideas, like how it has a 1-file deployment for the whole thing - drop it in anywhere and it just works. Also, I like how it saves everything you run into a history box, but even that was limited.
SQL Surfer 2.0 brings the whole thing into web 2.0. I'm playing with some CF8 features now, but I hope to also deploy a CF6 compatible version. As always, I'm having trouble getting it to look right in Internet Explorer. I'm planning a beta "soon," so this is like a heads-up teaser.
Yeah I know the concept is like a solved problem. Ray Camden has the Database Explorer and Todd Sharp with Genesis, but I think I have a unique twist on the subject. More to come as I prep this one.
posted under category: Free Code For You on September 23, 2008 by Nathan
So after nearly a year of sitting on Pagination 1.0 RC, I finally have the 1.0 release of the data paging library for ColdFusion.
The only thing in the 1.0 final version that I changed from the release candidate was the error messages. Most of the questions I had were about why they were getting a variable doesn't exist type error. Turns out they didn't call init() or didn't set the queryToPaginate item. I added some checking and some cfthrows to better explain what is happening.
Pagination.cfc is available to download at RIAForge, and the subversion repository has all the files as well.
posted under category: Free Code For You on January 6, 2008 by Nathan
Today I am releasing a 1.0 Release Candidate of my Pagination.cfc. New in this version is:
Added examples (lots, in the download)
Added documentation (featuring what, why, usage, reference, css and extensibility)
Added ability to paginate Arrays and Structures
Added properties: BeforeNumericLinksHTML, BeforeNextLinkHTML, ClassName, TotalNumberOfItems, FirstPageLink, PreviousPageLink, NextPageLink, LastPageLink
Added CFCUnit test (needs help)
Moved numbered link rendering into its own function (extensibility)
Fixed CSS support (and documented)
I'm not anticipating further changes, so this is a release candidate! If you can, please help me test it out. I did include a CFCUnit test file but I didn't get very far with it. Any feedback is highly appreciated.
Download Pagination 1.0 RC here.
View the documentation online here. It is included in PDF and HTML formats in the download.
I think I'll put this up on RIAForge for the 1.0 final. Comments appreciated!
posted under category: Free Code For You on December 8, 2007 by Nathan
Back a few years ago, before bind parameters were the cool thing to do with your queries (even if they should have been), it was easier to debug your queries in ColdFusion because you could scroll down to the debugging information, copy your SQL statement and paste it into your database tool of choice to run ad-hoc style.
Now that we're more sophisticated, the queries that show up in your debugging output aren't so easy to copy and paste. You get output like this:
insert into users (
) values (
Query Parameter Value(s) -
Parameter #1(cf_sql_varchar) = Nathan
Parameter #2(cf_sql_varchar) = 1234 Main St.
Parameter #3(cf_sql_varchar) =
Parameter #4(cf_sql_varchar) = Phoenix
Parameter #5(cf_sql_varchar) = AZ
Parameter #6(cf_sql_varchar) = 85001
Parameter #7(cf_sql_varchar) = US
How useless is that? You can't copy and paste that into your database query tool. Short of changing your debug template, you're stuck moving those values into the query one at a time to run it again in a controlled environment.
So I made a tool to simplify this. It's a simple .NET desktop application. You paste your debugging output query (like that shown above) and it will fix all the fields and give you something to paste back into your SQL editor, ready to run.
It's a simple concept, and maybe I'm the only one who will ever use it, which is fine, but let me know if you like it, if you can use it, and what improvements we can make.
Download the CFQuery Reassembler now (requires .NET runtime 2.0). I would call this the 1.0 preview version. If you get any queries that don't come out right, drop a message here or mail me. If you have any useful suggestions, I'm all ears, but please remember I'm not a c# winforms guy, so don't expect any real magic.
PS - I'm releasing this as a BSD-licensed application. You can download the CFQuery Reassembler source code and VS2005 project files, here.
posted under category: Free Code For You on October 14, 2007 by Nathan
Tonight I'm releasing version 0.2 of my Pagination.cfc. I added a lot of features and functionality and have a bit more to go before a 1.0 RC. Also, I cleaned up the API a lot so if anyone out there is using 0.1, read the notes at the top to see the new usage sample. I think I nearly doubled the file size with this update. No, it's not slower. More to come on this one still, at least until I make a 1.0 final release.
Update: Sorry Nolan, Here's the download link. (it's nice when someone cares)
posted under category: Free Code For You on October 10, 2007 by Nathan
Last weekend I updated my family photos area. I have to do something to it every few months so my wife will keep using it.
In the process, I created a cfc for paging through a query. I saw something similar on cflib.org, but I was hoping for something a little more OO and a little more customizable for me to use on any number of other projects.
Some cool things about it is the customizable output and the caching when you call getRenderedHTML() so you can output it at the top and the bottom of the page without any performance hit.
Some room for improvement would be adding a few more convenience methods like getCurrentPageNumber() and the option to leave the <Previous link text up (but no link) when there is no previous page, that kind of thing. More suggestions are definitely welcome. Also I think the API will change somewhat to make it more discoverable, but I'm not sure how, yet.
I created it and licensed it this weekend without a release, then earlier this week, I realized I could use it in a project at work. I downloaded it and dropped it in, and it worked perfectly with nothing to change.
So, this is version 0.1 with a BSD license (free to do what you want with it but leave my © on it). Download Pagination.cfc here.
BTW, before there is any confusion, this is a one-use-only object, you create an instance of it when you need to output pagination and throw it away with the page. Do not put it in your application scope. Coldspring users, singleton=false.
posted under category: Free Code For You on August 24, 2006 by Nathan
Here's something I've been kicking around for a few weeks. I know this won't work for everyone, but bear with me.
Wouldn't it be nice if you could get to windows information from ColdFusion that you normally wouldn't easily be able to get from Java? Things like the disk space available, the count of, and even the names of all the folders and files beneathe a given folder? Well, I'm not sure that I thought so either, but nevertheless, I made a tool to let me do just that.
WinInfo is a hybrid .NET 2.0 c# command-line application, executed from a CFC. Download WinInfo pre-alpha 1 to see what I mean (it's fast and stable, but the name calls may change, and I'll probably add more). Just change the winInfoExePath to the executable in the CFC and you should be in business.
If anyone actually finds this genuinely useful, leave a comment and let me know that I should spend more time on this project. If anyone has ideas of what needs to be added (like network diagnostics, etc.), again, leave a comment. Thanks.
posted under category: Free Code For You on August 24, 2006 by Nathan
My wireless router, a Netgear WGR614v5 with 802.11g (for Alanda's tablet), has a problem now and then getting disconnected from the Motorola cable modem. She mentioned this yesterday, so I decided to do something about it. We were outside, so I put SharpDevelop on her tablet and made a little app that checks to see if the network connection is up, and if not, do a ip release/renew on the router.
If you don't know SharpDevelop, it's an open source visual studio for .NET programming. I wrote the tool in c# and it should run if you have .NET 2.0 installed. Feel free to download my code - chances are good that it won't match your network configuration, but it should be a good starting point, especially if you have a similar router.
The result in making this is that my lovely wife doesn't have to reboot the router by hand anymore, now she can just double-click on this little utility.
Sometimes programming really pays off in those small ways that make you feel good.
Click here to download my router restarter source and program, no warranty, no license.
posted under category: Free Code For You on August 13, 2006 by Nathan
If your shared development database server happens to have a permenant multiple drive failure like ours did on Friday, and if the project you're working on hadn't been added to the backups yet, and if you're smart enough to be using Reactor to manage your database abstraction and/or be your ORM service of choice, you just may be in luck!
One of the great things about Reactor is it creates metadata objects on all the tables it touches. The typical appliation for this feature is usually code generation, like scaffolding and such. Easy, cross-platform database information is really useful, especially in open-source software where you don't know what the target platform will be.
Now, the first thing you should do in a disaster situation like I described, as soon as you realize you're screwed, back up your reactor files, specifically those in the reactor projects file. In fact, just back up the whole reactor folder because those files are version-specific.
Next, change your reactor.xml file to be in production mode. Production mode will keep it from attempting to introspect your database. If it can't find the table, it will throw an error, so let's switch the mode. While you're in there, make sure you point to the correct dsn - if the existing server is still down, make a new DSN on an empty database and point the reactor.xml file to it.
Finally, you'll need to build a tool to loop through the tables Reactor knows about and write the create table scripts. Here, you can have mine (it works with sql server 2000 +. Feel free to modify it, then buy, sell or trade it for goods on the open market. It's better than gold, in a pinch. Just don't hold me accountable if anything bad happens.