Coudal's 3 Questions

2008-09-29 20:00:00 -0400


Stephen forwarded me one of the Coudal Partners newsletters the other day, and it had this rather interesting bit where they describe the three questions they ask themselves when determining whether or not to pursue a new idea:

  1. Will we be able to make money? We’re a business. We have mortgages and tuitions to pay. Plus, if we don’t make some cash once in a while, how will we feed our habit of continually screwing around?
  2. When we’re done, will we be proud of the work we’ve done? Slaving for months on a project only to not want to show it to anyone when you’re finished just plain sucks. No amount of money can make that feel better.
  3. Can we learn a little something new along the way? Executing the project has to make us smarter and help satisfy our curiosity, which we think is our greatest asset.

The article then goes on to show how they applied it to their Field Notes Brand. Just figured I’d pass that along, you should be able to access the whole thing over here, at least for a little while.


Rolling your own pagination with will_paginate

2008-09-16 20:00:00 -0400


So I’ve been working on some decent paging of time entries for Tempo’s reporting interface. I would have loved to have just ran with the fantastic will_paginate plugin, but we don’t generate what you see on the reporting screen in Tempo via a simple Rails find call on the Entry model. Instead we have a class that builds the appropriate SQL according to the various report specs and then runs it via find_by_sql. Actually, it does quite a bit more than that, but I don’t want to get off topic.

Anyway, this meant we couldn’t simply expect will_paginate to know what kind of SQL it should generate, because the standard options on find wouldn’t be enough. But the plugin was really quite well-designed for extensibility, and that made it a snap to get our own paging going on:


class ReportContext
...
# the list of entries to display based on context
def entries
self.prepare # make sure the SQL for this report is already built and sanitized

@offset = DEFAULT_OFFSET if @offset.blank? or @offset < 1
@limit = DEFAULT_LIMIT if @limit.blank? or @limit < 1

@entries = WillPaginate::Collection.create(@offset, @limit) do |pager|
# must use a duplicate or original sql is modified (this can get pretty vexing)
sql = Entry.send(:add_limit!, @sql.dup, :limit => pager.per_page, :offset => pager.offset)
result = Entry.find_by_sql([sql])
pager.replace(result)

unless pager.total_entries
# the pager didn't manage to guess the total count, do it manually
pager.total_entries = self.count # run the count sql for this report
end
end
end

Now that our @context.entries method is returning a will_paginate collection, we can pass it to the view helpers, and voila:


- paginated_section @context.entries, :params => { :action => :index } do
#data
%table#entry-list.tabular-list
%tbody
%tr#entry-header.header
%th{:style => "text-align: center;"}= sortable_column('Hours', 'hours')
%th= sortable_column('Date', 'occurred_on')
%th= sortable_column('Person', 'user_name')
%th= sortable_column('Project', 'project_name')
%th Tags
%th Description
%th= sortable_column('Created', 'created_at')
%th= sortable_column('Updated', 'updated_at')
%th.actions.noprint
- @context.entries.each_with_index do |entry, i|
= render :partial => 'entries/entry_tr', :locals => {:entry => entry}

Note how we’re passing the :action parameter into the :params option of the helper. This gets passed to the link generators that create the actual pagination links. Because this view is generated in a partial, any number of methods could have displayed it from differing XHR calls to different REST urls (entries/filter, entries/data, etc), and we have to make sure that any pagination links would bounce off the index action. By default the pagination will link to the URL of the current request.

Oh, right, so that sortable_column business? We’re finally adding this oft-requested feature into an upcoming update to Tempo.


We're Hiring

2008-09-08 20:00:00 -0400


We just posted this to Craig’s List, but I figure we might as well get it up here, too. We’re looking to hire a web application developer. Our work load is expanding pretty rapidly and it’s time to bring on someone new to help us grow. If you’re a regular reader of this blog, you have a pretty good idea of the work that we do and how we roll. We’d really appreciate you forwarding this post on to anybody you know who might be a good fit.

Zetetic is a talented software development consultancy looking for a new teammate. We’re searching for a full-time developer to help us build and maintain client systems and our own applications (our newest product is Tempo, a time-tracking service).

The person we’re looking for has a couple of years experience and work to show off in a personal or professional portfolio. We need a developer with a passion for solving interesting problems.

Basic requirements:

  • A foundation in SQL and relational databases (such as: PostgreSQL, Oracle, SQL Server, MySQL)
  • Having either built or contributed to a Ruby on Rails or .NET application (with a desire to pick up Ruby)
  • An understanding of object-oriented programming
  • Working knowledge of CSS and Javascript
  • Great verbal and Internet communication skills
  • Self-motivation and an unflappably positive attitude
  • Comfortable working with command line interfaces

To apply send us your resume and a brief cover letter explaining your interest and relevant experience.

E-mail us at support@zetetic.net.


ruby-ldap gem for Windows

2008-09-08 20:00:00 -0400


Ruby/LDAP is a useful ruby library that allows you to connect to and manipulate LDAP directories like OpenLDAP and Active Directory. Unfortunately

  • the library isn’t distributed as a gem; and
  • depends on native LDAP libraries for its operation

This puts it out of reach for many ruby developers deploying to a Windows environment without an installed C compiler. In the past I’ve leaned on a few good Samaritans that posted pre-compiled versions, but unfortunately most of these have either been taken down or are really old.

So, in desperate need of an install on a new windows VM I just built it from source. If you trust our binaries you can download the gem-ified ruby-ldap build based on the latest 0.9.7 release and compiled using Visual Studio 2008.


unzip ldap-0.9.7-mswin32.gem.zip
gem install ldap-0.9.7-mswin32.gem

I’ve tested this on a few boxes, though your mileage may vary.

Zetetic is the creator of the super-flexible Tempo Time Tracking system.

PingMe and T-Mobile - Enabling E-mail to SMS

2008-09-04 20:00:00 -0400


We’ve received reports from some of our PingMe users who are also T-mobile customers that they’ve had difficulty receiving messages from PingMe on their T-mobile phone. Since none of us here at Zetetic is a T-Mobile customer there isn’t much more we can do beyond making sure that the outbound messages are actually being sent.

However, we have word from PingMe user Charles Eubanks that there is an account setting one must tweak in order to allow e-mail messages to be sent directly to your T-Mobile phone as SMS. We haven’t been able to verify this ourselves, but we’ve received a great walk-through description from Charles.

Just a quick explanation: PingMe uses your mobile provider’s e-mail-to-text gateway to send text messages to your mobile device. Not all carriers provide this option, some of them require you to enable or activate it, and some of the more nefarious ones will even charge you extra. However, for most folks it just works and it doesn’t cost any extra (beyond whatever you already pay to receive SMS messages).

That being said, this is the process for allowing email messages to be sent to your T-Mobile handset:

  1. Go to the T-Mobile website and login (or register if you haven’t yet).
  2. When the page loads, hover the pointer over the “My account” tab. One of the options will be “Send a text message.” Click on that.
  3. On the right side of the resulting page is a box with the heading “Resources.” One of the options in that list is “Create e-mail filters.” Click on that.
  4. On that page, there is an option labeled “Block all messages from E-Mail to handset.” Set this to “No.”

Once you’ve gotten that taken care of, you can create a new Mobile target in PingMe for your phone and start receiving and updating your reminders via text!