Entries for month: August 2009

jQuery Tip: Finding, Adding, and Removing Values from Arrays

JavaScript , jQuery 5 Comments »

Usually, finding a particular value in a Javascript array requires looping through the array until you find the value you're looking for.

jQuery provides a utility function called inArray() that takes the value being sought and the array as parameters and returns the index value indicating where in the array the value is located (-1 is returned if the value is not found in the array):

var index= jQuery.inArray(theValue, theArray);

You can use this jQuery function in conjunction with the Javascript push() and slice() functions to easily add or remove a value from an array:

//If you're not using any other Javascript library that utilizes the $ sign, you can use the $ sign 
//instead of the jQuery namespace var index= $.inArray(theValue, theArray); if(index== -1) { //Value not found in the array. Add to the end of the array with push(); theArray.push(theValue); } else { //Remove from the array using splice(). Splice takes the index value of where you want to start
//removing items from the array as the first parameter, and then the number of item you want
//to remove as the second parameter. theArray.splice(index,1); }

New jQuery Plugin dirtyFields: Bring Attention to Changed/Unsaved Fields

JavaScript , Web development , jQuery 14 Comments »

I just finished a project that included an administrative page where users could make changes to a parent record and numerous child records via multiple forms. All of the form submissions were done via AJAX, so I needed a way to illustrate which of the forms on the page contained changed or "dirty" data, and which forms had no unsaved changes.

This dirtyFields plugin is derived from the functions I wrote to handle that task in that project.

Read more...

Looking for Support For My CF Builder Enhancement Request: WebDAV Support

ColdFusion Builder , ColdFusion , Miscellaneous , CFML 6 Comments »

As a whole, I like the new ColdFusion Builder IDE. I've run into a few quirks and roadblocks while trying to install it and set it up the way I want it on my machines, but I suspect that's more a result of how my machines are set up than a failing of the product, and hopefully I'll get it all straight soon.

But CF Builder is missing one feature that I need to make it my sole, do-it-all IDE: support for the WebDAV file transfer protocol. At the university where I work, WebDAV is THE protocol used to allow developers to upload, download, update, and delete files on the web server because it makes it easy for the web hosting unit to delegate a certain amount of control to departmental representatives in what is essentially a shared webhosting environment.

This isn't exactly a new problem for me: CFEclipse didn't provide any WebDAV support of its own either. While there is an Eclipse plugin in existence that provides both FTP and WebDAV support, it's old, doesn't support the secure WebDAV implementation that we use, and is no longer being worked on/developed further. So while I've been doing my coding and testing locally using CFEclipse, I've had to rely on Dreamweaver or a stand-alone WebDAV desktop client to actually upload my files to the server. It's not the worst process in the world, but it would be nice to be able to handle it all in one program/IDE.

At CFUnited, I asked Adam Lehman (Product Manager for ColdFusion at Adobe) if there were any plans in the works for adding WebDAV support to Builder (seeing as how Dreamweaver supports WebDAV). He indicated that he didn't think so, but suggested that I submit a feature enhancement through the CF Builder bug database.

So I did: it's request #79437.

If you have any interest in seeing WebDAV support added to ColdFusion Builder (whether because you also have a need to upload files via WebDAV, or because you simply feel Builder should be capable of handling any file management protocol), please visit the CF Builder bug database, log in with your Adobe ID and password (if you don't already have an Adobe account, it's easy to sign up for one), go to the request record, and use the "Bug Votes" option to vote for the request and/or the "Comments" option to weigh in on the topic.

News and Impressions from CFUnited 2009

ColdFusion , Web development , CFML , Adobe No Comments »

If you've been following my updates on Twitter, you know that I was at the CFUnited conference last week. I didn't post anything during the conference because, quite frankly, I didn't set aside any time to do so, and there was lot going on most of the time.

I'm not going to try and sum up everything that was presented at the conference: I'm not sure any one person can. But there were a number of news items and developments that came about either just before the conference or during the conference that I thought were worth pointing out:

  • ColdFusion 9 in the Cloud: In the opening CFUnited keynote, Ben Forta and the Adobe team announced that ColdFusion 9 would include licensing options for running ColdFusion in cloud environments, and that they would specifically support the use of ColdFusion 9 on Amazon's EC2 cloud environment. Details (sparse though they are) can be found on Ben's blog post on the subject. Though I'm not a fan boy of cloud computing, having this option is important for ColdFusion developers who have an idea for a high-traffic web application but don't have the money to invest in their own server farm.

  • 4CFF: 4CFF is the acronym for the For ColdFusion Foundation, a new non-profit foundations founded by several member of the CF community with the goal of providing assistance and resources to ColdFusion open-source projects and establishing a "professional membership society for the ColdFusion Community at large." I missed their unofficial announcement/presentation, so I can't provide any information about how they plan to move forward with their goals, but I think the idea of having a resource where CF programmers can get help with the non-programming challenges involved in starting and maintaining an open-source project is a good one.

  • Framework updates/changes: The final, production version of Model-Glue 3.0 (Gesture) was released just prior to the conference, while the beta release of ColdBox 3.0 was announced on the first day of the conference. But perhaps the most dramatic framework announcement was that Adam Haskell, previously the lead developer for the Fusebox framework, was going to resign from that role and lead the development of a new and separate version of Fusebox called FuseNG (Fusebox Next Generation), citing irreconcilable difference between himself and TeraTech, the Maryland-based CF development/training shop that currently controls the domain name and source code behind Fusebox. As a developer who uses Fusebox, I'm curious to see how this decision will play out. The current version of Fusebox is a very effective, usable, and mature framework, but Adam's a smart guy and it'll be interesting to see what he and the other developers involved in FuseNG will come up with.

  • The Merlin Manager beta: The final event on Friday at the conference was the Demo Derby, where developers got several minutes to show off a project of theirs. While all of the presentations were noteworthy (and in two instances quite humorous), the one I thought really needed to be brought to the attention of the CF community as a whole was John Mason's Merlin Manager. One of the announcements regarding ColdFusion 9 was that it would provide an AIR-powered desktop application that would let ColdFusion server administrators manage and compare multiple ColdFusion server instances from one dashboard. John's Merlin Manager is also an AIR-powered CF server manager, but it's built to work with ColdFusion 7 and 8 servers. He demonstrated how his app provided real-time status information for a server, how it let you store current server settings as a snapshot prior to making a settings change, and that it could compare the settings between two different servers, highlighting where the settings differed. Even though the project is still in beta, it looked very feature-complete and could be of real benefit to those CF shops that won't be upgrading to CF 9 anytime soon. John is looking for volunteers to participate in evaluating the beta: if you're interested, visit http://www.merlinmanager.com/ to sign up.

As for the conference as a whole, I have to echo everyone who's already commented about it on their blogs and via Twitter: it was an excellent, informative, and fun conference, the best I've ever attended. And that statement is coming from someone who, for various personal and professional reasons, wasn't all that worked up about attending. Everyone involved in the planning and execution of the conferences, especially the folks from Stellr and those presenters who stepped up to fill in for last-minute speaker cancellations (all the presenters deserve credit, but those folks especially) should be proud of the work they did.

For those folks who weren't able to attend, be aware that a number of the presenters will be posting their presentations online, either on their own blogs, SlideSix, or both, so keep an eye out for announcements about those (and note that some of those posting and announcements were made last week during the conference itself).

Federal CTO Envisions a Purpose-Driven, Collaborative Internet

Technology , Miscellaneous , Web development , Podcasts No Comments »

One of my favorite podcasts is Buzz Out Loud, a weekday live video stream and podcast from CNET.com that reports, analyzes, and banters about the tech news of the day. This past week, they conducted an interview with Federal CTO Aneesh Chopra, which I just finished listening to today.

The entire interview was quite interesting, but there were two particular discussions that struck me.

The first one was about broadband penetration: the Buzz Out Loud podcasters wanted to know what plans, if any, were being made to promote the rollout of broadband to those areas where such service was limited or unavailable. Chopra said that they hoped to address that issue with a national broadband plan due to be revealed in February 2010, but he said that his personal focus was more on encouraging innovation in developing applications that would further the adoption and development of a robust broadband infrastructure. In other words, it's not just about building the infrastructure for people, businesses, and government organizations to have, but creating compelling applications of that infrastructure that bring people on board and give them more reasons for wanting ubiquitous Internet access.

As web/Internet application developers, we tend to think of broadband, high bandwith, and Internet access as the infrastructure that allows us to build robust applications. It's kind of exciting to look at it the other way around, that creating useful, effective, compelling applications that people want (or perhaps even need) could promote and justify the expanse of the broadband infrastructure.

The second discussion was in response to a viewer question about the use of open source software within government agencies (SUSE and RedHat were specifically mentioned). Chopra said that that was really in the federal CIO's arena of concern, but that he personally was more interested in promoting the principles of "open collaboration" and the "sharing of intellectual property as we build value." He went on to explain that what he meant by that was that he didn't care so much if an application built for the government was built on a proprietary platform so long as that application became shared intellectual property between government agencies. That again was another point that I hadn't heard anyone make before.

I'd encourage anyone who has an interest in how the federal government hopes to leverage technology to the country's advantage to listen to this podcast episode. You can watch the video version or listen to the audio version, either streaming or as a download, at the following address:

http://www.cnet.com/8301-19709_1-10302978-10.html?tag=mncol;title