Life is a Mystery

26 February 2010 . Comment

Code4Lib 2010

I just spent a wonderful week in Asheville, NC, attending Code4Lib 2010. Code4Lib is an energetic community of library hackers who communicate all year round via IRC, email, and other media, but like to also meet annually to grab some face time with each other and share a bit of play in the process. What struck me most about the meeting was how well Code4Lib lives up to its ethos of “no spectators.” It was a meeting that demanded real participation, not simple proximity. I wrote a report about this first look at Code4Lib, take a look if you want to know more.

code4lib.png

21 February 2010 . Comment

Wherein I figure out the iPad

I have not been alone in musing about the iPad for the past few weeks. Just what is it? What will it do? Why would I want one? What is it for? Today I stumbled upon an answer. The iPad is not a device to read electronic books, the iPad will help us invent electronic books. More “below the fold”…

ipad.png
Read the rest of this entry »

10 February 2010 . Comment

Google wants to bring fiber to your doorstep

Google today announced its Fiber for Communities initiative. They want to bring 1 gigabit per second connections (20 to 100 times faster than what most of us have access to) to 50,000 to 500,000 homes. Google figures it can (1) do something cool, (2) learn how to run a network, and (3) demonstrate the benefits of the kind of open network it advocates by putting some money where its mouth has been. This looks like a really great opportunity, now the challenge is to get our community to make a concerted response by the March 26th deadline!

8 February 2010 . Comment

Customizing the Ruby on Rails scaffold

I’m trying to learn Ruby on Rails this week. I found a wonderful book called Learning Rails that takes a non-evangelical tone, works from the ground up, and seems to match my style pretty well (also, I love the errata). But I quickly ran into an issue not covered in the book, how do I customize the Ruby on Rails scaffold?

I wanted to customize the scaffold so that I could replace the space indents with tabs (I know, silly me) and add JSON support to the scaffold. I found a post about how to accomplish this in Rails 3, but my Mac and the book both talk Rails 2. So I dug in a little bit. Here’s what I came up with for doing this in Rails 2.2.2 on a Mac.

Copy the original Ruby scaffold folder to a new folder somewhere reasonable with the name “my_scaffold”. (For the rest of these instructions you can replace “my” with anything reasonable.)

% cp -R /usr/lib/ruby/gems/1.8/gems/rails-2.2.2/lib/rails_generator/generators/components/scaffold /Users/myhome/Ruby/my_scaffold

Use a symbolic link to hook your new folder back to Ruby.

% ln -s /Users/myhome/Ruby/my_scaffold /usr/lib/ruby/gems/1.8/gems/rails-2.2.2/lib/rails_generator/generators/components/.

Change the name of the generator script to reflect your folder name.

% mv /Users/myhome/Ruby/my_scaffold/scaffold_generator.rb /Users/myhome/Ruby/my_scaffold/my_scaffold_generator.rb

Edit the generator script to modify the name of the object it creates. Change “ScaffoldGenerator” in the first line to “MyScaffoldGenerator” (adjust that name as necessary).

Now you have your own scaffold. You can edit any of the templates in /Users/myhome/Ruby/my_scaffold/templates and use the command “ruby script/generate my_scaffold MyObject my_field:string” to get rolling.

Note, the stylesheet.css name still conflicts with the same file in the original scaffold. If you want to resolve that conflict you can edit another line in the generator script. The line “m.template(’style.css’, ‘public/stylesheets/scaffold.css’)” would be made to refer to your new stylesheet name and the layout template should be changed accordingly. Notice that you don’t have to change the name of the actual “style.css” file.

Fair warning, I am on day two of Ruby and Rails. I know almost nothing, so use the above hint with care. Feel free to comment if you know more and want to offer a better suggestion!

ruby.jpg

27 January 2010 . Comment

SubCalc at the App Store

As folks who read this blog know, I have been pretty hard on Apple about their overzealous policing of the iPhone App Store. Today I have a very personal reason to acknowledge a job well done. Apple took only three days to review the app Alex and I submitted on 1/25. Today SubCalc became a free app on the App Store.

SubCalc is an app to help convenors of precinct caucuses and conventions in Minnesota. The Minnesota Democratic Farmer Labor (DFL) party uses a wonderful, but bit arcane, “walking subcaucus” process that is simple enough to do, but rather difficult to tabulate.

This app calculates the number of delegates each subcaucus gets when you enter the total number of delegates your precinct or convention is allowed and how many people are in each subcaucus. The rules it follows appeared on page 4 of the DFL 2010-2011 Official Call, including the proper treatment of remainders. It makes the math involved in a walking subcaucus disappear.

The app could be used to facilitate a “walking subcaucus” or “proportional representation” system for any group.

If you don’t have an iPhone, try the “web app” version of this subcaucus calculator for at http://www.sd64dfl.org/sub/. But if you do have an iPhone or iPod Touch (or iPad!) please give SubCalc a spin!

subcalc.png

27 January 2010 . Comment

Pondering the iPad

Apple made it’s big announcement today. Personally, I think it is a home run, particularly the pricing. But my brother disagrees. I’ve used his criticism to spur my thinking on this newest venture from Apple. If you want to dig in, read on!

ipad.png
Read the rest of this entry »

21 January 2010 . Comment

Bumptop

A few years ago I saw a TED demo video about BumpTop, a prototype 3D desktop designed for pen interaction. Now this prototype has grown into a Mac desktop environment called BumpTop. (There is a Windows version too.) Now it is time to see how much the product can live up to the presentation.

bumptop.jpg

14 January 2010 . Comment

FFR: Web hosts

A great thread on the Code4Lib list gives shoutouts to a number of web hosting services. Every few years I take a look at this market, so I wanted to remember to look at these in the future: Heroku (for Ruby), Slicehost (now owned by RackSpace), Linode (founded in 2003), WiredTree (noted for Drupal), DreamHost (which I’ve used too), and Sonic (run by geeks).

Screen shot 2010-01-14 at 7.52.31 PM.png

13 January 2010 . Comment

FFR: Inklet

I’ve been wondering why nobody has done this. Inklet makes the modern Mac trackpad a pen tablet as well. If I had a newer MacBook or Pro, I’d be checking it out.

13 January 2010 . Comment

The Walking Subcaucus

Last week I spent an evening training new caucus convenors for our February 2nd DFL precinct caucuses here in Minnesota. In general, precinct caucuses can be great fun, and I’ve found the caucus system here in Minnesota was much more successful at getting me involved in party politics at the local scale than I ever was in Massachusetts or Ohio, which rely on primaries.

One tradition of the caucus is that if there are more people in your caucus who want to be delegates to the next level of party convention than you have delegate slots available, the walking subcaucus process (a kind of proportional representation) will be used to determine who gets elected as delegates. In theory the walking subcaucus is a pretty easy process, each person just walks over to the group that best represents their point of view. If that group ends up big enough to elect one or more delegates, they do so within the group. It is a fun way to get to know your neighbors.

In practice, the simple math involved can be a bear. It is well described on page 4 of the 2010-2011 Official Call put out by the DFL, but even that clear description does not make it easy. I decided to write a web-based calculator to help with the math, and after I dug into the problem I realized that even the training we had been giving convenors was incomplete in some minor, but notable, ways. In fact, I’d never been given a complete picture myself!

This is all a long way of getting around to the point, my Minnesota DFL Subcaucus Calculator is now available. I still consider it beta, because it is only a few days old and I hope some early testers shake out some problems. I have had a couple people from the statewide DFL dig into it and report a raft of problems to me which I’ve fixed, but please don’t blame the DFL if the calculator still makes mistakes. Just let me know.

In particular, I’ve tried to make this a tool that can be used from an iPhone or other mobile device. I was particularly pleased to find ways to make the calculator iPhone aware (though it could be prettier) and even able to use the numeric keypad by default for certain text fields. The small joys of programming!

Anyway, if you are a Minnesota DFLer, take a look!

vote.jpg

Eric Celeste / Saint Paul, Minnesota / 651.323.2009 / efc@clst.org