Another Open Source Project Management Tool

So, I'm back to using project management tools again and I've come across OpenProj. So far, it is the closest app to Microsoft Project I've found. I'm enjoying it so far. I'll keep you posted on how it works in the future.

Congrats Barack Obama!

I forgot to say congrats to Barack Obama! I'm looking forward to see how well he executes the job as President.

Just don't screw it up worse than it already is, OK? Theoretically, we can only go up from here. Right?

Getting Used to this MacBook Pro

Macs rock! I'm thoroughly impressed with how easy it is to manage this MBP. I've installed Eclipse, OpenOffice, FireFox, and all of the other programs I've needed (except ColdFusion, I'm getting to it). It is such a cinch to use and it's fun too!

One thing I miss on this Mac is the "End" and "Home" keys. You can do it using Command+[right arrow] for simulated "End" or you can use Command+[left arrow] for simulated "Home". I can get used to it.

I also needed to view hidden files in Finder because I needed to view the httpd.conf file for Apache. That's easy too using Terminal commands:

defaults write com.apple.finder AppleShowAllFiles TRUE
killall Finder

To hide the hidden files simply change the value to false:

defaults write com.apple.finder AppleShowAllFiles FALSE
killall Finder

I don't remember where I found that code so, I apologize for not posting the link.

Installing programs is a breeze. Download the program, extract it to .DMG if needed, double-click .DMG file and off you go.

Again, I'd like to thank my friends at the USU PAD Team for "enlightening" me about Macs.

Lost My Job. Learned Flex. Got a New Job and a Mac. Oh, and Happy Halloween!

I'm writing this from a new MacBook Pro! I never thought I'd work on a Mac...

It all started when the company I was working for lost investor funding. Thanks to the sour economy, my contract was not renewed and I was out of a job for about a week. No problem, though, had plenty of means to continue onward and upward.

So being out of a job for a week gave me a chance to, first, find a new one and, second, learn a little Flex. I built a simple online signature for one of my clients so that persons applying for jobs can sign their name using their mouse. It's a little awkward (signing your name with a mouse), but it works and they can use it to streamline the employment application process. You can check it out here.

Then I called a former boss to get a reference. Instead of a reference he wanted me to work for him as a General Manager of his new company STEDI, LLC. They are a new spinout from Utah State University specializing in substitute teacher training for school districts all over the country. I'm quite excited and am looking forward to the challenge! Especially learning ASP.NET. But I told them they would have to learn Flex and ColdFusion.

That's where this new MacBook Pro comes in. STEDI is a Mac shop (except for the one programmer that uses .NET) and while I had a choice to get a Mac or PC, you can thank my friends at the USU PAD Team for finally convincing me to get a Mac!

Now, how do I install programs on a Mac? I'll figure it out after I take my kids out to get stuffed with candy.

ColdFusion Component MetaData

I recently needed to get the list of functions from a component that I was building. This is helpful especially if you want to loop through the list of functions and execute all of them. Now, this is possible by listing the functions in a variable in a component, but that's not very scalable because every time I add or remove a function, I have to subsequently add or remove that function from the list. So, here is how you dynamically get the list of functions from a component:

<!--- Instantiate the component. CMS --->
<cfset obj = CreateObject("component","com.test.ExpressComponent") />

<!--- Get the metadata. CMS --->
<cfset md = getMetaData(obj) />

<!--- Now loop through the variables. CMS --->
<cfset mdfunc = md.functions />

<!--- Here I dump the info. But it can be processed in whatever manner. CMS --->
<cfloop from="1" to="#ArrayLen(mdfunc)#" index="k">
   <p><cfdump var="#mdfunc[k]#" /></p>
</cfloop>

The getMetaData() function returns a nicely formatted structure of various information about the component. Here is a dump of it:

cfdump of getMetaData() result.

Lot's of valuable information about the component.

Benefits of Unit Testing

The following are some benefits to ColdFusion unit testing that I've noticed while creating them over the past several days:

  • As I write the unit tests (and the subsequent code for the cfcs) I find that changes are actually quite simple. It makes it easier to make changes in the beginning. IMHO, it is much more difficult to make changes as I'm implementing the CFC into the presentation layer.
  • As I develop unit tests, I establish the expected behavior of the CFC even before I begin to create it. This allows me to have a more absolute concept of what the CFC is supposed to do early on. As mentioned above, that's much easier to change than if the whole darn CFC is already coded and implemented in an interface.
  • Initial bugs are found and fixed before connecting to the interface. I have a fully functional CFC that has been bug tested (by the unit testing) prior to its implementation. Plus, I'm not bug testing with the interface (except for interface bugs) because that's already been done with the unit test. So nice.

I'm sure there are so many other reasons to do unit tests that I haven't covered. If I think of any, I'll post them. Otherwise, feel free to post your reasons for unit testing.

Which ColdFusion Unit Testing Framework?

I'm currently using MXUnit. In the past I've tried CFUnit which was really nice, BUT THEY STOPPED UPDATING IT! It's been dormant for about 18 months.

I've also tried CFCUnit but they stopped updating it over two years ago! That's a bummer because their interface was really nice.

MXUnit is currently being updated, supported and they even have an Eclipse plug-in (that I haven't tried yet). They have an active blog and an active Google Group to get support.

No Materialized Views in MySQL

I've created a nasty view in MySQL that retrieves a lot of data across multiple tables and performs some calculations for columns. The query runs slow and will obviously become a problem under high loads. Another problem is that MySQL doesn't support materialized views.

Materialized views are a way to cache or store a view's data like an actual table to increase data access speeds for queries. In this scenario, when you request data from a view in a SELECT statement, the data is retrieved from the cached table instead of executing the query for the view to get the data. Because the SQL parser doesn't have to execute the query for the view, performance is increased. Data for the materialized view is updated frequently to prevent dirty reads from the view. Materialized views are normally used in data warehousing to improve querying on large amounts of data or for complex views. But I find them useful for complex queries.

However, in MySQL (and PostgreSQL), when you perform a SELECT statement on a view, the SQL for that view is actually executed to get the data. This can have serious performance problems if the view is a complex query (like the one I created) or is accessed (executed) frequently.

You can improve performance for a complex view by indexing the view. This is not supported in MySQL but the underlying indexes in tables will be used which can increase performance.
http://forums.mysql.com/read.php?100,22967,23070#msg-23070

You can also mimic materialized views by setting up a table with the columns you need. Then create a MySQL function that executes the query for the view and populates the table. This can be executed at specific intervals using cron jobs. The downside is that the table is not updated in real-time (due to the cron job). See the comments at the bottom of the following pages:
http://dev.mysql.com/doc/refman/6.0/en/create-view.html
http://dev.mysql.com/doc/refman/5.0/en/create-view.html

SQL Server supports materialized and indexed views as per this article:
http://www.microsoft.com/technet/prodtechnol/sql/2005/impprfiv.mspx

Oracle also supports materialized views:
http://download.oracle.com/docs/cd/B10501_01/server.920/a96567/repmview.htm

Knowing Your Audience

I've been working on a custom web-based system for a local company and have realized the importance of knowing who will be using any system you develop. Knowing the audience, their skills, and abilities helps you frame your development directly around them. I've noticed this because after working face-to-face with my client, I realized that a slight internet incompetence exists. Now that I understand this individual's perspective of the internet and how they think it works, I can tailor the web site to add extra explanations where complex functionality exists.

Several years ago while working at Utah State University I had the opportunity to record a user testing session with a blind tester. Using a screen reader, he navigated the web site as good as any of us did. The most interesting element of the test was how fast he setup the screen reader to "speak" the elements on the screen. He played it so fast that my colleagues and I couldn't even understand what the screen reader was saying! It really brought a real sense of "we've got to make this better to work for everyone."

I encourage you to do the same. The importance of user testing will only present itself when you see unassisted testers run through your web site. The bottlenecks and confusing areas become self-evident. You may even realize just how "bad" your design is.

That's happened to me a few times.

New Team Collaboration Tool...

Today we released our team collaboration tool at MondoTeams.com. It is a free online tool that allows you to:

  • Create and manage projects
  • Invite team members to join your project and participate in the project development.
  • Create deadlines, bulletins, and comments on the project.
  • Create tasks to be done on the project.
  • Track your time spent on projects.
  • Build time reports for customer invoices on time spent on projects.
  • Create folders for the project and upload files to those files.
  • Track file revisions.
  • Project calendar tool.

It's all written in CF and AJAX and is free for you to use! There are obvious limitations, like a maximum number of projects (20), folders and files (I'll have to look that up), etc. However, the limitations are generous and should be plenty for most projects.

We are also creating some new and improved features that I'll blog about in the future.

Also, another tool we created is call MondoDesigner.com. This tool allows you to create your own web sites (for those who don't want to get into code), host it on our servers, add a blog, and community sign in, and use your same login and password for all of the Mondo tools.

We have a whole suite of tools and projects that we'll be releasing in the future. I'm way excited about them and I'll keep you posted!

JavaScript setTimeout Issue

So, I realized how stupid I was today when I was trying to build a slideshow with JavaScript. Well, I'm obviously going to use the setTimeout or setInterval timing functions.

Well, my JS code was quite extensive due to it being integrated with other functionality. Here is an example of the code:

// Show the thumbnails.
for (var t = 0; t < preLoad.length; t++) {
   if (document.getElementById("thumb_" + t)) {
      document.getElementById("thumb_" + t).style.border = "2px solid black";
      }
   }
document.getElementById("thumb_" + j).style.border = "2px solid blue";
   
t = setTimeout("runSlideShow('forward',false)", slideShowSpeed);

If you can see my problem, its because I used the "var t" in the loop and then used it as the object for the setTimeout. Well, there is actually a "var t;" declaration outside of this function that makes the t variable global. So, after trying to access it after the loop, it caused all sorts of problems, like multiple timeouts running at the same time on one slideshow. Whew it was confusing.

Anyway, once I changed that "var t" in the loop to say "var k", it all worked fine.

More Entries

Contact Chris SchofieldBlogCFC was created by Raymond Camden. This blog is running version 5.9.001.