Agile Tortoise

Greg Pierce’s blog

Chronic “smart” date update

b.logi.cx posted an elegant and more complete solution to incorporating Chronic date fields in your ActiveRecord models. my version was certainly hack-ish.

I started on a simple helper plugin to use for AJAX previews of chronic’s parsing. Hopefully I’ll have something release on that before too long.

Posted in Ruby on Rails | No Comments »

Fat Frank on TV

My Uncle Robert, aka “Fat Frank” of Fat Frank and the Plank Spankers, is going to appear on this week’s installment of the Antique Roadshow on PBS. He’ll be the one with the Ukelele. If you can’t catch that, you can always just watch him on YouTube.

Posted in Family and Friends, TV | No Comments »

Rails and Chronic, easy ’smart’ date fields

There are quite a few Ruby on Rails plugins to give you nice Calendar drop downs for date selection...but, I'm much more partial to the style of fuzzy date entry you see in a lot of apps now, allowing you to enter common strings and have the app figure out the date -- ie, "next friday", "tomorrow", etc. With a pointer from Mike yesterday to the excellent Chronic gem, I was on my way.

Chronic does all the hard work, just install it...

CODE:
  1. gem install chronic

Then, in your views, use a text_field for your date...

RUBY:
  1. <% form_for :model do |f| %>
  2. <% f.text_field :date_attr_name %>
  3. <% end %>

In your model, you'll want to then use Chronic to parse the pre-cast value of the date attribute using the _before_type_cast methods...

RUBY:
  1. require 'chronic'
  2.  
  3. class MyModel <ActiveRecord::Base
  4.  
  5.   def before_save
  6.     self.date_attr_name = Chronic.parse(self.date_attr_name_before_type_cast) if self.date_attr_name_before_type_cast
  7.   end
  8.  
  9. end

I expect I'm going to find that I need to tweak this a little -- and I'm pretty sure I'll want to write a helper that will give the user a AJAX preview of the parsed date before the submit the form, but, it definitely beats the lousy Rails built-in date_select method.

Posted in Ruby on Rails | 3 Comments »

Using the Google Maps API geocoder in Servoy

I've posted a Servoy module that demonstrates how to make HTTP REST calls to the Google Maps API geocoder to get back a variety of useful information (such as Long/Lat) of a query address. Download here.

Posted in Servoy | No Comments »

RIP, Maxie

I had to put down my dog this week. She was 11 1/2 years old, and was, essentially, our first "baby." I had always thought she'd live to be a really old dog, because she was so energetic and active...but, cancer doesn't much care about those things. Katie and I got her together, the year we were married, though it was pretty clear over time that Maxie considered herself my dog.

She was a mutt. Played frisbee and fetched, chased squirrels, climbed trees (really, she did), barked at anyone who came near the house, loved to have her ears rubbed and generally did all those things that make a person love their dog -- which I did.

She was smart and a really good dog. She was always great around the kids, though I'm sure she resented them -- at least until they got big enough to throw her a ball and pet her. She mostly didn't get into things she shouldn't (except tissues. she loved tissues), and didn't annoy the neighbors.

So far the boys are taking it pretty well, and I'm dealing. Being so busy with Christmas probably helps. I'm sure we'll get another dog someday, but right now we're getting used to the fact that despite the constant chaos of a 3 child household it seems pretty quiet around here.

Posted in Family and Friends | No Comments »

Servoy 4.0 preview

On Wednesday, Servoy offered a preview webinar for the changes coming in version 4 -- due for public beta in January, and aimed for release in late Q2 2008. The most high-profile change in this release is the move to Eclipse platform for an IDE, abandoning the somewhat limited proprietary IDE in current versions of Servoy.

This is an interesting move strategically for Servoy. Personally, I'm thrilled. I use Eclipse, it's a top-notch IDE and will offer Servoy lots and lots of developer features that would otherwise likely not exist due to the resources it would require to develop them internally. I think for many Servoy developers, it's a little intimidating -- since many have come from Filemaker or 4GL environments where a lot of things are managed for you. I expect, however, that Servoy will do a good job of hiding the complexity from those who are not interested in it.

For developers who use SVN, add Java, XML or other to their Servoy solutions, it will be an incredible advantage. Need to use XML in your Servoy solution? Why not use Oxygen XML, right in your Eclipse installation to edit it? Good stuff.

Moving to file-based solutions will be great, too, and make it a lot easy to manage modules, and moving code around between solutions -- which is quite burdensome to manage with the current SQL-based repository.

Overall, I'm excited about the possibilities -- and look forward to getting my hands on the beta!

Posted in Servoy | 3 Comments »

Flotsam or jetsam?

So, is a garbarge truck in a swimming pool flotsam or jetsam? OK, probably neither....but, there was one in a swimming pool a couple of blocks from our house tonight.

We went outside to go to dinner and found an entourage of News helicopters circling overhead at low altitude. We didn't know what was going on, but it certainly smelled of a "developing story" -- so we called Kt's mom and had her check the news for us. We drove by on the way back from dinner and saw the crane working on lifting it.

Interesting and unexpected diversion.

Posted in Family and Friends | 1 Comment »

Servoy: simple HTML progress bar

I have several places in Servoy solutions where it's nice to display a simple progress bar to the user. This is for workflows, where the user needs a visual for how far along they are on the task/job/etc. -- not for actual progress on executing code.

I wrote a simple global method you can call from a dataprovider calculation to get back an HTML table that mimics a progress bar. So, if I've got a field (or calculation) on a table "progress_percent", that returns the percent complete on a item, I can also create a method that calls this global, passing in the percent field as an argument, returning a nice little visual of the progress -- like this,

progress.jpg

And here's the code:

JavaScript:
  1. var progress = arguments[0];
  2. if ( progress == null )
  3.     return null;
  4.  
  5. var html = "<html><head>";
  6.  
  7. html += "<style>";
  8. html += "td{font: 8pt Arial;}\n";
  9. html += "td.green{background-color:#AAFFAA;}\n";
  10. html += "td.red{background-color:#FFAAD4;}\n";
  11. html += "</style>";
  12.  
  13. html += "</head><body>";
  14. html += "<table width='100%' cellspacing='1' cellpadding='0' border='0'>";
  15. html += "<tr>";
  16.  
  17. for( var ix = 0; ix <100; ix=ix+10 )
  18. {
  19.     if( ix <progress )
  20.         html += "<td class='green' nowrap='nowrap'>&nbsp;</td>";
  21.     else
  22.         html += "<td class='red' nowrap='nowrap'>&nbsp;</td>"
  23. }
  24.  
  25. html += "</tr>";
  26. html += "</table>";
  27. html += "</body></html>";
  28. return html;

Posted in Servoy | 1 Comment »

Servoy newsletter

Servoy was nice enough to acknowledge my Servoy-related blogging in their October newsletter. Nice compliment, thanks! Now, I just feel guilty about not blogging more. ;-)

Posted in Servoy | No Comments »

Agile Tortoise Widget

Ok, really just an excuse to play with Dashcode, but, yes, ladies and gentlemen, I now have a custom Dashboard Widget for this blog. Please download if you're of the OS X persuasion.

Posted in Apple, Blogging | No Comments »

12 years

Though our anniversary sadly gets lost in the shuffle of birthday parties and Halloween around our house, as of yesterday Katie and I have been married for 12 years. I continue to steadfastly believe that marrying Katie was the finest decision I've ever made.

Posted in Family and Friends | No Comments »

Welcome to the blogosphere, sis!

My sister's got a blog now. She's an independent consultant in the Seattle area who helps non-profit organizations actually live up to the "organization" part of their name.

Posted in Family and Friends | 1 Comment »

TextMate syntax coloring and Rails 2.0

Now that the Ruby on Rails 2.0 Preview Release is out, I'm playing around with it. First thing I noticed, while minor, is that TextMate's syntax coloring for "HTML (Rails)" doesn't recognize the new view naming scheme. "rhtml" is now replaced by "html.erb" as the file extension.

It's a simple fix, however. Just open up the Bundle Editor, go to the "Rails" bundle, then the "HTML (Rails)" language definition, and add 'erb' to the filetypes array on the second line. Like:

JavaScript:
  1. {   scopeName = 'text.html.ruby';
  2.     fileTypes = ( 'rhtml', 'erb' );
  3. ...

Posted in Ruby on Rails | 4 Comments »

Large client app online

I spent the weekend migrating data for one of my clients, and they are 'live' starting today on a large Servoy project management application I've been working on for the last year. The app has 160+ forms and reports.

The application handles most of them up-front business processes, Estimating and managing Jobs, through Invoicing, where it hands off to Quickbooks with complete 2-way synchronization of Jobs, Invoices and payments through the Quickbooks SDK. It includes a lot of custom workflows to manage their operations and an integrated Activity system that handles logging histories, and to-dos on job activity.

Probably the most interesting portion of the app is a highly configurable Estimating system with it's own calculation engine to allow them to define dependencies between materials (ie, if I say the job needs 5 of these, it will also need 5*2 of these other things).

There still work to be done ironing out bugs and features, but it's always rewarding to finally see software you've been working on for so long get put to use.

Bonded screenshot

Posted in Servoy, Work | 1 Comment »

Dog update

Maxie, my dog, is doing much better now. Whatever infection she had seems to be responding to the antibiotics and she getting up and moving around pretty well, though still with somewhat of a hobble. Hopefully there won't be any long term side effects.

Posted in Family and Friends | No Comments »

« Previous Entries Next Entries »