self.is_a? Blog

random tech drivelings from ouray, colorado

Gett Yourr Sh$tt Togetherr with Taskk - Task Management Done Right

Try As I Might
For years (and I mean that, literally), I have tried more task management applications than I can shake a stick at. Hell, I actually have one that I built myself after starting an Active Admin (Rails) tutorial (more crap to-do). All of them, my own included, did not work for me. For the longest time, I could not figure out why they did not work for me. The long and short of it was that I would spend time creating my lists and then never do anything with them from there ... after the first week or so of using whatever particular software I was on at that time. 

Enter Taskk
Recently, I had the opportunity to try Taskk.it (@taskk_it),  which is currently in an invite-only beta (I have some invites, so ping me if you are interested in trying it out). Although it's in an early beta state, Taskk is, hands down, the best task management application I've used. 

Why Taskk?
For me, Taskk separates itself in on key area from its competitors: it tells you what to do next! Yeah, you heard me. Taskk not only compiles and maintains a list of your projects and their tasks but it also calculates what tasks you should be working on each day.

I'm Sorry. Say What?
Yeah, I'll say it again. Taskk tells you what to work on next. But how? Hell if I know. It's probably fairies or pixie dust in the code. Alright, that may not be the case but here's a little overview on Taskk's magic and why I like it so much. 

The Process
It's actually quite easy to get rolling with Taskk. First, you set up a list. Then, for each list, you create a series of tasks (ToDos), all of which you have entered with a time estimate, notes, deadlines, etc. Once you've entered all your ToDos, you can rearrange them (drag & drop) to set their priority level. 

From here, you head over to what Taskk calls the "Planner". And this is where Taskk starts to set itself apart. You go through the available days in your planner and let Taskk know how many hours you have each day to work on your list(s). Once you have entered your available hours, you click the "Update Planner" and Taskk creates your work schedule. 

But Something Changed
Got a new assignment? Ran into a wall working on a particular task? Just slow one day? No worries. Anytime you want to recalculate your schedule, you only need to visit the Planner page and click the "Update Planner" button and you're good to go. 

Going Forward
I am very excited to have Taskk as part of my toolbelt. I've been using it to plan out and manage several side projects as my new full-time gig has plenty of project management tools, which work great for the team, and it's helped me stay on track and keep those projects moving forward. 

As I mentioned above, if you are interested in trying Taskk out, please let me know. I have a few invites left to give out and would be happy to share. 

What Time is It? It's TDD with ColdFusion Koans (and MXUnit) Time!

I started a new CFML position on a Knowledge Management (KM) project this past Monday. It's a a great bunch of folks and an awesome team of CFML developers, in particular.

My new position has me working on the mobile team, on which we are currently building an Air desktop application for our KM project. The only 'drag' with my first week is that my team lead is out for vacation ... and the mobile team is the smallest team in the company, consisting of the team lead and me. 

So, my assignment this week has been twofold: (1) get up and running and (2) start working on unit tests for the existing methods in the mobile project. 

The first task was no big deal. The second task, however, is both exciting and intimidating. It's exciting because I have read and toyed with test driven development (TDD) for years but was not disciplined about testing and did not use TDD across my projects.

It's intimidating because, as I just noted, I have not yet used TDD consistently in my projects, let alone employing TDD inside a new, existing, large project that heretofore has not used TDD/unit tests. 

The development teams have decided that we should start out with adding unit tests for all existing methods so that we can do regressing testing as we add new features, etc. Going forward, I believe the mobile team will go full-on TDD.

Great. But, why am I boring you all with this? Well, mostly because I'm sort of evil that way :). 

Okay, I am not that evil. I wanted to write this post because of how important I think it is that more and more CFML developers give TDD (or BDD, if that's your thing) a long, hard look. But where do we go to get started? 

Here's the approach I took to get myself rolling: 

  1. MXUnit
    1. Download mxunit (and the eclipse plugin, if you use CFEclipse or ColdFusion Builder)
    2. Follow the wiki's Getting Started section to make sure you have it installed and running correctly
    3. Read through the Testing Basics section of the wiki to give yourself a general sense of how unit testing works
    4. Read through the Using the Eclipse Plugin section of the wiki (if you're using an Eclipse-based IDE, that is)
  2. ColdFusion Koans (Github URL)
    1. Read the initial documentation on the Koans page
    2. Clone the github repository and get to work making and running tests!
  3. Back to MXUnit
    1. Complete reading through the wiki (Advanced Stuf and the API Reference sections)
  4. Start a simple project and go TDD all the way
    1. I did the now-standard "To-Do" project to get myself more into the mindset of TDD)

Ryan Anklam and Mike Henke have done a great job with Koans. Not only does Koans teach you a lot about TDD in ColdFusion but it's also a great project to learn ColdFusion/CFML or just refresh your knowledge of it. 

There you have it ... in my opinion, it's time to start living the TDD lifestyle. And, with kick-ass projects like MXUnit and ColdFusion Koans, there is no time like the present to get started! 

CFDynamo: Weekend Updates

Over the weekend I knocked out a few wrapper methods for CFDynamo (and pushed them to the Github Repo). I was hoping to get a bit farther but I'm the boys basketball coach here in Ouray (pop. 900) and we had homecoming this weekend. I was a bit more wiped out than I expected on Sunday!

The following methods have been added and tested: 

  • create_table
  • update_table
  • delete_table

The following methods will be added/enhanced/cleaned up later today and tomorrow:

  • get_item (will be added)
  • update_item (will be added)
  • put_item (enhanced to better handle the varying return/result options of this call)
  • create_ update_, and delete_ table methods (ehnaced/cleaned up to hold AWS call backs added to asses the progress of table changes) 

After getting these in place today and tomorrow, I intend to complete, test and push the query and scan methods, at which point CFDynamo should be at a solid 1.0 release state. That should happen by Thursday. 

Let me know if you have any questions or suggestions and do feel free to fork the project on Github and add to it!

CFDynamo: A CFC Wrapper for Amazon DynamoDB

Earlier this week I began implementing a DynamoDB solution for a client. DynamoDB is a NoSQL solution long ago planned but only recently released on Amazon Web Services. It is more closely related to Cassandra than MongoDB or CouchDB but offers some interesting and enticing features (e.g., all DynamoDB tables exist on SSDs, so the I/O is pretty damn fast!). 

My client's site is built with CFML and runs on Tomcat/Railo 3.3.1 (to be upgraded to 3.3.2 this weekend) on a load-balanced EC2 instance that employs several other AWS services, such as a MySQL DB on RDS, S3, CloudFront and the new ElastiCache. While our RDS database serves most of our needs, some of our data is quite complex and we feel we would better served breaking some items out into a NoSQL solution. 

After an initial review of NoSQL options, we thought we'd go with MongoDB but, with the announcement of DynamoDB, we decided that it would be a better choice for our team because all DynamoDB instances are managed by Amazon's experts ... and this seemed a might better option than building and managing our own MongoDB cluster!

As many/most CFML developers know, there is no CFML SDK for Amazon Web Services. And, if you want to write CFML code to directly access AWS services such as DynamoDB, it can be a pain in the ass, to say the least.

Why such a pain? Primarily because you have to manage your security credentials and session tokens yourself/in your CFML code and none of these actions are straight-forward or easy. Plus, it ends up pretty non-CFMLy because it requires a shit-ton of code (IMHO). The pre-built AWS SDKs, on the other hand, handle all these security actions for you. 

Fortunately, there is an AWS Java SDK, as I am sure you all know. And, thankfully, we CFML developers can (fairly) easily access and use Java APIs/libraries directly in our CFML code. Hooray!

So, to make my life easier, I created and started working on a project I named CFDynamo (yep, typically uninspired CFML project name :). To start, I have integrated the security aspect (i.e., enabling CFDynamo to access your DynamoDB instance) and table listings. To get started quicker, I created a couple of tables in the AWS console. 

If you are interested in the project, please check it out on Github. The README contains instructions for getting the Java SDK setup and running on either Tomcat/Railo or ACF 9. I won't bore you with more setup details here.

I'll be adding more API functions/calls to CFDynamo between today and Monday. Feel free to watch the Github repo for updates, which should come in the following order: 

  • createTable
  • deleteTable
  • updateTable
  • getItem
  • updateItem
  • query
  • scan
  • refine putItem

And, of course, please fork the project and make some better coding updates than I will and I can merge your pull requests!

CFWheels StatesAndCountries Plugin Updated

With many thanks due to Jordan Clark, my StatesAndCountries plugin for CFWheels has been updated.

Because my CFML work is focused solely on Railo and I do not have a current Adobe ColdFusion installation on my main work machine, I missed that there was an issue on ACF with the plugin (it could not find the asset files). 

Jordan tweaked the plugin to work for him on ACF and then I went back in and made a few tweaks so that it will work on both now. 

Thanks, again, to Jordan for his assistance and recommitting the code (pull requesting, whatever :) to the GitHub repo. This is why I freaking love open source code!

CFWheels and SES URLs

I’ve been talking with a fellow CF'er and he was having some trouble getting SES URLs rolling in a Tomcat and CFWheels application that he’s working on. Since I had to go through all sorts of ‘fun’ times with SES URLs and Wheels a year ago, I thought I’d write up a little post on my experiences and how I got the URLs I want. And, really, it ain’t that bad.

URLRewriteFilter

First things first, download the excellent Java Web Filter library, URLRewriteFilter. Once downloaded, expand the Zip Archive. You will see a WEB-INF folder, inside of which, are two important items: urlrewrite.xml and lib/urlrewrite-3.2.0.jar. From here, it’s not too difficult to figure out what’s next … move these items (the XML and JAR) into the corresponding locations in your application’s WEB-INF folder. Note that you may need to create a lib folder in your WEB-INF (I did).

WEB.XML

Next up, you need to add a declaration to your web.xml file (also located in WEB-INF) so that your server knows to load the URLRewriteFilter JAR. The addition is pretty simple.

Now the filter will be loaded when your server starts.

URLREWRITE.XML

Next, you need to instruct the URLRewriteFilter how to filter and pass on your requests, which is done by providing the conditions under which the filter should not run (in this case). For Wheels, there were two levels at which I did not want the filter to kick in:

  • when certain folders were requested
  • when specific files were requested

For organization and readability, I organized my filter declarations by folders and then files. As you can see from the XML document belowm I select all the major folders where your CFML server is doing stuff (e.g., flex2gateway or railo-context) or where static files are server (e.g., javascripts, stylesheets).

Once your conditions are in place, you need to just tell the filter from what and to which URLs should it rewrite. For Wheels, this appears as follows:

CFWheels

The last piece of the puzzle … the framework itself. There are two (easy) steps to making URL rewrites happen in Wheels:

  • Tell Wheels to turn on URLRewriting
  • Add a piece of code to events/onrequeststart.cfm for populating the path info**

The first step is super-duper easy. Just add the following line in your config/settings.cfm file:

set(URLRewriting="On")

The second step is also easy. Add the following to events/onrequeststart.cfm:

if(structKeyExists(url,"$pathinfo")){
    request.cgi.path_info = url.$pathinfo
}

**EDIT: Many thanks to Tony Petruzzi for pointing out this far more elegant solution.

That’s it. From here, restart your CFML server and you’re ready to roll. To see my SES URLs in action, head to Ouray Climbing and start clicking some links!

P.S. I did write this post rather quickly, so let me know if you spot any errors or have any issues trying the same thing.

Rails HAML Heads Up with CSRF Tag and Destroy Calls

Rails HAML Gotcha with CSRF

I’ve been doing a good bit of work with Ruby 1.9.2 and Rails 3.0 and 3.1 lately. It’s been a pretty exciting time as I have not really delved heavily into a new language in a couple of years (I had lots of CFML work from 2009-2011).

Right now, I’m working on a site for our volunteer fire department, of which I am a member. I’ve got the front-end of the site in place and lots of the admin/CMS section done, too. However, as I started running through admin/CMS tests, I found that none of my delete/destroy calls were not working. Every time I’d try to delete something, it would log me out, force me to log back in and then fail to have run the delete.

I researched the issue on the Interwebs but only found references to needing the cross site request forgery meta tag in place (csrf_meta_tag) in your documents. However, I did have this in place … see the code block below:

Admin Head Section

%head
    %title Website Administration
    %meta{ :http_equiv=>'Content-Type', :content => 'text/html;', 'charset' => 'utf-8' }    
    = stylesheet_link_tag "960","reset","text","red","smoothness/ui", "wysiwyg/jquery.wysiwyg", "lightbox", "admin"
    = javascript_include_tag "jquery.min","jquery-ui-1.8.7.custom.min.js","jquery.blend-min","wysiwyg/jquery.wysiwyg", "jquery.lightbox", "jquery.slideto.min", "jquery_ujs","admin"        
    /[if IE 6]
        = stylesheet_link_tag "iefix"
        = javascript_include_tag "pngfix"
        %script{:type=>"text/javascript", :language=>"javascript"} DD_belatedPNG.fix('#menu ul li a span span');
        = csrf_meta_tag

Notice anything screwy in that? Because I clearly did not. My csrf_meta_tag was indented one step too far so that it was included in the IE6 conditional comments. D'oh!

It should have been …

%head
    %title Website Administration
    %meta{ :http_equiv=>'Content-Type', :content => 'text/html;', 'charset' => 'utf-8' }    
    = stylesheet_link_tag "960","reset","text","red","smoothness/ui", "wysiwyg/jquery.wysiwyg", "lightbox", "admin"
    = javascript_include_tag "jquery.min","jquery-ui-1.8.7.custom.min.js","jquery.blend-min","wysiwyg/jquery.wysiwyg", "jquery.lightbox", "jquery.slideto.min", "jquery_ujs","admin"                                                                                                
    = csrf_meta_tag   
    /[if IE 6]
        = stylesheet_link_tag "iefix"
        = javascript_include_tag "pngfix"
        %script{:type=>"text/javascript", :language=>"javascript"} DD_belatedPNG.fix('#menu ul li a span span');

Or …

%head
    %title Website Administration
    %meta{ :http_equiv=>'Content-Type', :content => 'text/html;', 'charset' => 'utf-8' }    
    = stylesheet_link_tag "960","reset","text","red","smoothness/ui", "wysiwyg/jquery.wysiwyg", "lightbox", "admin"
    = javascript_include_tag "jquery.min","jquery-ui-1.8.7.custom.min.js","jquery.blend-min","wysiwyg/jquery.wysiwyg", "jquery.lightbox", "jquery.slideto.min", "jquery_ujs","admin"        
    /[if IE 6]
        = stylesheet_link_tag "iefix"
        = javascript_include_tag "pngfix"
        %script{:type=>"text/javascript", :language=>"javascript"} DD_belatedPNG.fix('#menu ul li a span span');
    = csrf_meta_tag

Long story short, be sure to check your HAML indentations and orders if something is not working as expected!

How I Got Started in ColdFusion

Steve Bryant recently suggested we make August 1, "How I Got Started in ColdFusion" day. The idea is to get as many CFML developers to write a blog post detailing how they got started with ColdFusion. I think it's a wonderful idea and, as such, following is my own story. 

My first forray into ColdFusion began late in the magical decade that brought us grunge, a revival of hippie/jam-band music, and a booming economy: the 90's. I had just finished my Masters degree in Anthropology at the University of California, Santa Barbara and was moving (back) to the Washington DC area to get married. After an extended honeymoon of several months backpacking in the US West and another several months in Europe, I needed a job. Surprisingly, an MA in Anthropology did not yield jobs outside of a McDonald's. Weird, I know. 

Shortly after I graduated from the University of Pittsburgh in 1992, I got a job at Quark, Inc. as a support technician. After a couple years at Quark, I was asked to and happily pitched in on the company's first-ever website. As a result of my QuarkXPress knowledge and experience, I was able to get a job in the marketing department for Government Executive magazine; designing and laying out brochures, simple HTML websites/web pages for events, mailers and the like.

After a month on the job, my boss requested that I build a website for an upcoming conference our magazine. The company's online magazine was built with ColdFusion 4.0 and we decided that it would be best for me to go ahead and use ColdFusion to build my marketing site. So, I set off one day after work with the following book under my arm: 

51echyjxyrl

I spent a week, and this is what I LOVE about CFML, working through the book and some examples. One week later, we had a database-driven website for our upcoming Excellence in Government 2001 Conference. I just think this is the amazing thing about CFML ... I knew some HTML and some JavaScript and before I knew it, I had a nice looking, fully functional database-driven website to promote and provide all the required details about our upcoming conference. From a total novice to a solid, well working (albeit not a complex) site in two weeks ... that is just awesome! 

Okay, fine ... get picky ... I was using Access and maybe calling that a database-driven site is giving it a bit too much credit :). I kid. I kid. 

The site was a huge success and before I knew it my job had morphed from a marketing person to, basically, a web developer creating ColdFusion-driven websites for every thing and anything our directors could think of. 

From there, I never looked back. Anthropology was a thing of the past and web development with ColdFusion was the way forward. And I could not be happier about how it all unfolded. 

From VPS to the Cloud (AWS): Setting up an AMI for Railo

From VPS to the AWS Cloud

As I mentioned in one of my last posts, my primary client and I have undertaken a mission to make the application kronum.com more scalable and nimble, as we are experiencing sudden and dramatic spikes in our traffic.

The process of migrating from a traditional VPS stack to a nimbler Cloud setup has been quite educational and illuminating. It definitely alters how you view the architecture of your application. It’s hard but fun.

Disclaimer

I want to call out that I am new to this AWS world and recognize that some or many of the options I’ve selected may not be ideal or the best ones. I did my best to research it thoroughly and make good choices.

Build the AMI YOU Want

I’ve been mulling over how to approach this series and, as if often the case, I find myself typically searching for similar topics over and over. One thing I often check for is how to install things on a Unix server. So, I wanted to detail how I built our current server on AWS, what services I chose to install, how I configured them and how it’s played out.

I suppose the best place to start is to list off what we’ll install and in which order these services will be installed. Please note that our production instance is a large 64-bit Ubuntu machine while the one I’ll create below is for our staging system and will be a small 32-bit machine. Despite the differences in instance type (large v. small) and bit (64-bit v. 32-bit), the process for installing and the software chosen is identical.

The Amazon Machine Image (AMI)

I chose the pre-built Amazon Linux AMI made available publically via the AWS console. For the purposes of this blog post, I chose this image because it’s a minimal Linux install (you don’t need to remove lots of options/software from some of the other available images) yet has the AWS configurations built in.

With my server chosen and running, I set out to begin installing the services I would need to run our application. In order of installation, they are:

  • Apache Tomcat 7.0.x
  • ActiveMQ 5.5.x
  • Apache 2.2.x
  • Railo 3.3.000.x
  • VFTPD (ftp)
  • Postfix (mail)

Picking an Instance

  • Log onto AWS and select the EC2 tab
  • Click the Launch Instance button
  • Select the Amazon Basic 32-bit Amazon Linux AMI 2011.02.1 Beta (note: the date may change depending on when Amazon makes updates and this post is read)
  • Follow the Request Instances Wizard steps to complete the setup of your AMI
  • You should probably pick the Small instance (a few bucks per month) or the micro (free) unless you know you want a large instance (more money)
  • It will take a few minutes but, in short order, your instance will be up and running

The instance wizard looks like this (and we’re using the top AMI in this screen shot): Instance Wizard

Elastic IP

One thing to note about AWS is that each time you shut down (versus reboot) your instance, the IP address assigned to it will ‘go away’ and upon your next boot, a new one will be assigned. This can be a pain in the ass for SSH connections, FTP, DNS, etc. To get around this issue, AWS has Elastic IP addresses. These IPs are static in that AWS allocates them to you. What’s cool is that you can assign this IP address to any instance you want … and it will persist beyond stop/starts.

Getting started with an Elastic IP is quite easy.

  • Select the Elastic IP link on the left-hand side of the EC2 page (under the section for Networking & Security)
  • Press the button to allocate a new IP address and follow the prompts
  • Select the Elastic IP in the grid
  • Click the now-enabled button: Associate Address
  • Select your instance identifier from the select list

Now you have a static IP from which you can access your server.

Installing the Software/Services

The first step to installing your software is to connect to the server itself. I use my Terminal and connect via SSH. For help doing this, return to the Instances section of the EC2 tab and select your instance in the grid. Then, expand the Instance Actions menu and select Connect. This will show you the SSH details. If you’re not familiar with SSH and PEM key files, spend a few minutes learning about them.

Once connected to your instance, you’re ready to install. To make your life easier for the installations, type ‘sudo su’ (no quotes) at the prompt so you are now working as the super-user.

Next Post

In order to keep the posts fairl readable, in terms of length, I’ll stop here and create a new post, which I am working on now, for the actual installations.