InquiryLabs

Politics, Programming and Possibilities

Archive for the ‘Software Engineering’ Category

Textmate Backtracer 1.0

The backtracer has been around for a while now, and seems to have done its job well enough to deserve a 1.0 mark. This release includes a small improvement from Geoff Grosenbach that limits the loading of this plugin to development mode only. Geoff notes that this “simplifies the backtrace when running tests”. Thanks Geoff.

Download Version 1.0

Enjoy!

Ralph Douglass has made some nice improvements to my earlier instructions for installing Ruby SDL on Mac OS X. In fact, his instructions are a mere 25 lines compared to my 90!

Now if only someone more knowledgable than myself would wrap this all up in to a Port file… :)

[tags]ruby, simple directmedia library, sdl[/tags]

Setting up OpenCV on Ubuntu

OpenCV is a fast and well-designed C library for computer vision research and development. Since I’m not aware of an OpenCV library for Mac OS X, I’m using my old Ubuntu box to get things up and running.

So I don’t forget what I did, here’s some of the configuration I had to do:

  • Install libraw1394-dev Ubuntu package
  • Using ‘testlibraw’, check permissions
  • # sudo chgrp video /dev/raw1394
  • # sudo chmod g rw /dev/raw1394
  • Download OpenCV 0.9.7
  • # ./configure –with-apps; make; make install
  • # export LD_LIBRARY_PATH=/usr/local/lib
  • Compile and run my app with the following script

#!/bin/sh
export LD_LIBRARY_PATH=/usr/local/lib
echo `pkg-config --cflags opencv`
echo `pkg-config --libs opencv`
g `pkg-config --cflags opencv` -g -o igaze igaze.c `pkg-config --libs opencv`
./igaze

qforms á=á=á=á=á= dynarch_calendar á=á=á=jstree

á= á=á=lightbox jsá=á=á= stateful_formá=á=á= á=textarea tools

Bundles that include javascripts, stylesheets and images are getting easier and easier. It’s a wonderful time to be a Rails developer :)

For those who would like to know what bundled_resource is, check out my earlier post that introduces the problem and solution offered by this package.

This release marks a much improved and nearly completely rewritten dynarch calendar bundle. Here’s what’s new:

  • It is no longer necessary to call convert_date_to_multi_params! in your controller
  • Backwards compatibility for non-javascript browsers. Calling dynarch_date_select now calls the built-in rails date_select method so that users who have browsers without javascript can still select a date in a reasonable way.
  • There is no longer an obnoxious “:date” field in the returned multiparameter values.
  • Bundles now accept optional parameters. For the dynarch_calendar bundle, you can specify the color, language and icon for your dynarch calendar.
  • 12-hour time is handled in a novel way, so that the user enters a 12-hour time (e.g. 3 PM) and Rails can read it as if it’s a 24-hour time
  • Better documentation.

Version 0.9 of bundled_resource now also includes a “stateful_form” bundle that makes it easier to store the open/closed states of form sections. This is particularly useful for AJAX forms that have hidden sections that the user can open up. When the form is submitted to the server and returned with an error, the form will retain its open/closed states so that it’s just as the user expects it.

You can download bundled_resource 0.9 here (345 KB) or use the subversion repository directly:

svn://syncid.textdriven.com/svn/opensource/bundled_resource/trunk

Compliments of syncPEOPLE social conference software development

Mindshare moving from PHP to Rails

Jamis Buck just pointed me to these two links, and I wanted to share the side-by-side snapshot. Not that this is new news:


Rails and PHP mailing lists.png

I’m thinking of moving back to PHP, just so I can keep up with all of the mail each day. (just kidding).

Virtue for Tiger

Seems like I’m way behind the times, but I discovered today that the Virtue desktop manager is available for Mac OS X Tiger!

Just wanted to share, in case you haven’t found out about it yet :)

Updated pre-dispatcher

For those who expressed interest in the pre-dispatcher code I’ve been experimenting with, there is now an updated dispatcher.rb available for download.
This one appears to be much more robust in the method used to track down the “built-in dispatcher” and load that code first. If it can’t find the built-in one, it’ll fail silently so that your Rails application can work even if the pre-dispatcher doesn’t.

Thanks to Hans Fugal for testing the original dispatcher.rb code.

Easy Resource Management (Re-post)

UPDATE:
There is now a version 0.9 available (download).

The bundled_resource Plugin

Hot on the heels of my previous announcement, there is now a bundled_resource plugin that takes advantage of all of my previous work in this area at syncPEOPLE, plus some (download).

What’s it for?

If your development is in any way similar to mine, there are a number of useful resources out there that make web applications shine beautifully. For example, there’s the Dynarch calendar and the textarea tools. There are a number of others—too many, in fact. The problem is that as a web developer, it sometimes takes some real surgery to put each one of these in to an application. And then when you create a new page that uses these resources (even within the same app), you have to figure out which pieces to cut and paste to get it functional. Take the Dynarch calendar, for instance. There are 4 javascript files, 1 CSS file (among several to choose from), 2 images, several helper methods, and a controller method that you’ll need in order to get it to work with Rails. Sometimes it’s easier just to ignore the calendar bit because it’s such a pain to set up.

How does BundledResource help?

But what if it weren’t a pain? What if you could write this at the top of your page:

<% require_bundle :dynarch_calendar %>

And your dynarch calendar would just work? That’s what bundled_resource does. Now you can use this method:

dynarch_date_select 'post', 'publish_date'

anywhere on the page, and it’ll work. Easy :)

So it looks easy… what’s going on?

What the bundled_resource plugin does is it keeps all of your resources (javascripts, stylesheets, images) within the plugin’s directory structure and copies them in to the public folder whenever your app starts. This is very similar to James Adam’s technique that he uses with Rails Engines. The advantage, of course, is that you don’t have to worry about copying and pasting files all over the place whenever you want a new bundled_resource. They all belong together in one little folder inside the plugin.

Pre-packaged Bundles

Included with this release (0.7) are three bundles: the Dynarch Calendar, Textarea Tools and qForms. Setting up an app to use them is simple:

  1. Install bundled_resource
  2. Add the following two lines to your layout (just like the RequireResourceHelper):
    <%= stylesheet_auto_link_tags %>
    <%= javascript_auto_include_tags %>
  3. Add a require_bundle :[bundle name] at the top of your view file.
  4. For example:

    require_bundle :qforms

And that’s it! Welcome to Easier Resource Management for Rails.