Tuesday, May 22, 2012

Detroit Robotics

An incomplete list of robotics stuff around Detroit.

Companies

Military
Institutions
Conferences and Organizations

Wednesday, August 3, 2011

Green Smoothie

I make and drink a pitcher of green smoothie just about every day I'm home.

To make it, put the following ingredients in a blender and blend on high after each addition.
  • 1 cup almond milk
  • 1 cup uncooked steel cut oatmeal
  • 1/2 cup plain yogurt
  • 1 raw egg
  • 1 scoop whey protein
  • 1 banana
  • 1 pear
  • 6 leaves of kale
  • 1/2 cup blueberries
  • 1 whole carrot
  • 1/2 cucumber
  • 1 squeeze fresh lemon juice
  • 1 pinch of parsley
  • top off with water
It's also nice to blend in some ice cubes to make it cool and refreshing.

Wednesday, December 15, 2010

API Design

I recently presented some opinions and ideas about web API design at Salesforce.com's Cloudstock event in San Francisco.

In the talk, I start with a poorly designed API and iterate it toward a well-behaved REST API. Along the way, I compare APIs from Facebook, LinkedIn, Twitter, Foursquare and others and share my opinions about which APIs do things well and which don't.

If you're thinking about API design, please give it a view and let me know what you think.

Here is a studio version of the talk:

Sunday, December 12, 2010

no such file to load -- spec

While trying to use Goto Alternate File (⌃⇧↓) in TextMate's Cucumber Bundle I was seeing an error like this:
no such file to load -- spec

that was pointing to line 20 of:
~/Library/Application\ Support/TextMate/Bundles/Cucumber.tmbundle/Support/lib/cucumber/mate.rb

That line reads like this:

I changed it to:

Reloaded bundles (Bundles→Bundle Editor→Reload Bundles). And now things are working fine. My guess is RSpec 2 now goes by 'rspec' instead of 'spec'.

Friday, September 24, 2010

Rails 3 Complex Join Query

I just struggled mightily to have the new Rails 3 query stuff create the SQL I wanted. I figured it out eventually. Here's the story.

I have the following models:I wanted to add a method to Person that would return all the add-ons to which a person subscribed through payment plans:So, I knew I would need this SQL query:I tried things like this, cursing the new query stuff the whole while:They all failed. Finally, I got what I wanted:It turned out to be nice and simple and I can do sweet chaining things like this:Now, I love the new Rails 3 query stuff.

Thursday, September 16, 2010

Heroku Bundler Deployment Issue

When deploying to heroku recently (bundler 1.0.0) I was getting a nasty looking error: after much struggling, I found troubleshooting directions here:
http://github.com/carlhuda/bundler/blob/master/ISSUES.md
I had to do a couple steps. first these:and then I had to edit my Gemfile to stop using any gems that pointed to github:

Tuesday, August 31, 2010

NoMethodError: undefined method 'coordinates' for #


In trying to use the latest Sunspot code (from github) for geo search with Rails 3.0.0 , I was getting the following error while running Sunspot.index!(Location.all), where Location is my ActiveRecord class for storing locations:

After searching through the new code I found that coordinates is no longer a valid field type, but instead location is to be used. location expects an object that responds to lat and lng. Sunspot provides a handly little struct called Coordinates to be this object. So, here is my model code for setting up the search:

notice the virtual attribute called coordinates which wraps the lat & lng ActiveRecord attributes. My search code now looks like this:

And my search results are coming in as expected.