S.E.A.N.I.C.U.S.

Friday, May 26, 2006

All is not lost

To be short, my contract has been extended to June 30, at which point they'll be able to decide whether to take me on full-time as a regular employee. Until then, I'm trying to find some other work, hopefully telecommuting.

Tuesday, May 23, 2006

FlexTimes moved

Because I'm leaving KCKCC, I have moved the FlexTimes plugin to RubyForge. Here is the project address: http://rubyforge.org/projects/flextimes/

Subversion access is available via: svn://rubyforge.org//var/svn/flextimes

Please submit any bugs or issues there.

Monday, May 22, 2006

Somebody set me up the bomb

After a very productive day getting the podcasting portal even closer to production, Amber (my boss) asked me to come to her office.

Then the bomb exploded. (All my base are belong to them!)

Apparently, my position, which is on a contract basis, can no longer be funded. I have until Friday. :(

Whether this means my podcasting portal will go live or not is still up in the air -- Amber has to talk to her boss, the Dean of Information Systems, to see if we should move forward. Unfortunately, despite the lavish praise bestowed on my work and interpersonal skills by the Dean and various others around the college, if the money's not there, it's not there. I suspect the Dean and Amber will try to find a way to keep me, but until they find it, I've got to pack my bags and try to move on.

Luckily, I haven't spent the time at KCKCC idly, I have greatly increased my experience with Ruby on Rails, MySQL, Linux administration, Apache, lighttpd, and various other peripheral technologies. I hope this will make me more marketable, perhaps to somebody looking for a specifically RoR developer.

I may also try to go freelancing -- luckily there's a KCRUG meeting Wednesday and some of them have experience freelancing, so I'll ask their advice.

The thing that sucks most is that I had become accustomed to the income and regularity of it all. Elizabeth and I had made some plans too, like going to SF this summer -- which may have to be scrapped.

It's all very much up in the air, but I'm hopeful -- I don't have too much reason to be pessimistic yet.

Friday, May 19, 2006

Crisis averted and future plugins(?)

This morning I completed uninstalling and reinstalling Ruby, RadRails, MySQL and all the gems I need.

I checked the project back out and discovered I had the same problem as yesterday. I tried my Ruby file-sanitizing script again to no avail.

Finally, on a hunch that it had was RadRails that corrupted my files, I copied their contents to an external editor and retyped about four different partials.

Success! I committed the non-corrupted versions to the repository.

---------------------------------------------------

It seems as I write my Rails projects, I discover more programming tasks that could be factored out into plugins because they'd be useful to others (and myself in other projects). I have potentially two more up-and-coming.

The first is one that I sort of completed this afternoon, after my file-corruption woes were placated. If you've used Basecamp (or many other AJAX-ed apps), you're aware of checkboxes and radio buttons that automatically save when changed. I wanted to make some for the project I'm working on that would make use of in_place_edit_for just as I had for my text-based fields.

After reading some documentation on Prototype, and peeking at the Rails code for ideas, I sat down and wrote a helper that creates AJAX'd radio buttons for you. On Monday, I intend to create one for check boxes, and then factor it out into a plugin. It works somewhat like a cross between in_place_editor_field and select_tag. Here's a sample:
<%= in_place_radio_buttons :post, :can_comment, 
:choices => ["all", "registered", "none"] %>

This would create a bank of radio buttons, separated by spaces, with labels, and they would have onClick events (although I'll change this to onChange) that fire off an AJAX request to the 'set_post_can_comment' in your controller, like any good in_place_editor would.

I did hit one snag in implementing this, however, and it has to do with Boolean fields in the AR model. The default in_place_edit_for produces a method that responds with a render :text => value_of_the_field (for more details about particulars look at the code embedded in the documentation). For a Boolean field when false, this produces render :text => false which makes AV look for a template to render, and produces a "Template missing" error. For the specific field I was using, I decided to rewrite the method and make that last line read render :text => value_of_the_field.to_s -- thus converting the value to a string before rendering it. When I factor out the plugin, I'll create a special AR helper/declaration for boolean-type fields.

My other potential plugin is a file upload handler, but since there are so many of those out there (file_column, acts_as_attachment, and the list goes on), I'm not sure whether I'll release it. It started as some really simple home-brewed file upload in another project, but grew and generalized for this one because I had to do it for multiple classes, with potentially multiple fields being uploaded into. Quite frankly, I think the code is a little ugly, but to my credit, with file upload you have to not only deal with the file itself, but also with the object lifecycle, especially if you're creating a new record at the same time as the upload.

Thursday, May 18, 2006

Don't reboot your computer

This morning I came in and started to work where I had left off last night. However, last night I had rebooted my machine since it had been a while. Apparently, that was a BAD IDEA.

I kept getting really strange errors about illegal characters and whatnot. So, I thought maybe my files were corrupt. I tried editing them and removing any potentially bad characters, then saving. No effect.

So then I tried writing a Ruby script to strip any characters that aren't normal whitespace out of the file and save it. No effect.

At this point I realized that when I refreshed the page, I would get errors generated in the SAME PARTIAL, but they weren't the same error each time. It would randomly change!

Figuring it was just my crazy Win32 box, I hopped over to the iMac and checked out the source from the repository (which luckily I had committed before reboot last night). After fixing one documented problem with LoginEngine and a problem I knew existed with acts_as_taggable, it ran fine.

So I had to delete the project in RadRails and check it back out from the repository, fixing those same issues I had with the plugins. And now, after all of that, it's still broken.

Moral of the story? Don't reboot your computer.

Wednesday, May 10, 2006

Speed bumps on the way to production

I've been working for a few weeks on a Rails-based application that allows our campus to create, manage, and subscribe to podcasts. Much like the online employment applicaiton, writing this application has been a learning process (see some of my previous posts to get an idea of things I've encountered). Overall, the process has been smooth and the development timeline linear.

However, in the last few days, I've hit a few snags that have really irked me. Some of these probably should be tackled by someone more adept than I at Ruby and Rails.

  1. The file_column plugin is broken. It has not been updated since November or something. There's a version in branches/kyle that sort-of works, but takes out the RMagick capabilities (which I happen to need and why I considered the plugin in the first place).

  2. As a corollary to the previous item, RMagick 1.10 is not available for Windows, so if I do use it (with or without file_column), there may be incompatibilities between my server and my dev machine.

  3. The plugin script needs the ability to add the svn:externals property for all installed plugins. If you forget the little -x switch, good luck getting the format correct in SVN. I'd much rather do:
    script/plugin set_externals
    or something like that. It could even use the discovered repositories to set the property and ignore all others.