Wednesday, June 29, 2011

Ideas for making cities more innovative and fun

A few weeks ago I spoke about ideas for making Baltimore a more innovative and fun place. My thesis was that we should be placing a whole lot of "small bets" that would benefit residents of the city instead of investing in mega one-off projects intended to attract itinerant visitors.

Tuesday, June 21, 2011

Computing Broadcast Calendar Dates in Ruby

While building a new product I discovered that broadcast advertisers use a special broadcast calendar to normalize advertising schedules. Each month starts on a Monday. I made an tiny open source Ruby gem called broadcast_calendar to compute the Gregorian/civil dates for broadcast months:

gem install broadcast_calendar

> BroadcastCalendar.dates_for(5,2011)
=> Mon, 25 Apr 2011..Sun, 29 May 2011

I also found a list of pre-printed broadcast calendar dates.

Wednesday, June 8, 2011

Gemfile for Rails 3.x Greenfield

I just started building a new product, and wanted to document my tools of choice in the Gemfile below. I also like to use use Rails Wizard to generate some of the configuration stuff (like making sure generators use Rspec instead of Test::Unit). Normally I would also lock the Rails gems to specific versions but I've been trying this app out with Rails 3.1rc1 so it's easier to let those dependencies float for now.

I'm using 'thin' here because I'm running this on Heroku's new Celadon Cedar stack where you need to bring your own app container (unless you want to use WEBrick).

# gems needed by Rails
gem 'rails', '3.0.8'
gem 'pg'
gem 'sass'
gem 'coffee-script'
gem 'uglifier'
gem 'jquery-rails'

# application gems
gem 'thin', '1.2.11'
gem "haml", "3.1.1"
gem "haml-rails", "0.3.4"
gem 'formtastic', "1.2.4"
gem "foreigner", "1.0.3"
gem "dim", "1.0.0"
gem "authlogic", "3.0.3"

group :development do
  gem "annotate"
end

group :test do
  gem "rb-fsevent", "0.4.0"
  gem "growl", "1.0.3"
  gem "guard-spork", "0.2.0"
  gem "guard-rspec", "0.4.0"
  gem "shoulda-matchers", "1.0.0.beta2"
  gem "capybara", "1.0.0.rc1"
  gem "launchy", "0.4.0"
  gem "timecop", "0.3.5"
end

group :development, :test do
  gem "rspec-rails", "2.6.1"
  gem "silent-postgres", "0.0.8"
  gem "factory_girl_rails", "1.0.1"
end

Friday, June 3, 2011

The Ontology of Unknowability

I just started reading a great book called The Cybernetic Brain with this great passage from the opening chapters:
One could say that the modern sciences stage for us a modern ontology of the world as a knowable and representable place. And, at the same time, the product of the modern sciences, scientific knowledge itself, enforces this vision. Theoretical physics tells us about the unvarying properties of hidden entities like quarks or strings and is silent about the performances of scientists, instruments, and nature from which such representations emerge...the performative aspects of our being are unrepresentable in the idiom of the modern sciences...
Cybernetics...was the science of exceedingly complex systems that modern science can never quite grasp...This is the aspect of cybernetics that interests me most: the aspect that assumes an ontology of unknowability, as one might call it, and tries to address the problematic of getting along performatively with systems that can always surprise us...
I keep running into ideas about the limits on human knowledge in much of my reading. It's become my favorite topic to think about, and I'm always delighted to see it crop up somewhere new. I love the notion that something I grew up thinking unconsciously, a totally unexamined assumption, has been so upended: the notion that science can in theory provide all the answers. I guess I used to think that if we had enough resources to do a "Manhattan Project" on every human problem, we could solve them all. I'm perceiving there's another way to view the world, one that is hopeful and capable, but one that is more realistic about what we can figure out for ourselves. It sounds like cybernetics is or was the science of people trying to work with these limits instead of against them, to get things done in the real world; it has a dark reputation for its contributions to things like cruise missile technology, but the science has many nonmilitary applications and in fact grew out of psychiatry!

Here's a quick reading list of where I've confronted ideas about unknowability and fallibility, in case this interests you, too:

  • Godel, Escher, Bach: this is an amazing, complicated book treating a number of subjects, but it explains Godel's Theorems, and generalizes from the mathematical results to suggest that certain truths in the universe probably are unprovable (even though they are true).
  • Thinking in Systems: complex systems cause their own behavior. No one is really in charge of anything and seemingly common-sense simple solutions can have disastrous outcomes because of the essential nature of systems. Feedback loops are much more important than we'd like to think.
  • The Black Swan: we think unusual events are predictable, or avoidable, and we think that human history is driven by measurable, understandable processes that can be rendered into narratives. This author argues that in reality extreme events (black swans) are responsible for much of why things are the way they are.
  • Omnivore's Dilemma and Primal Blueprint: nutrition as a science has failed us because it reduces a complex entity, food, to the most base macronutrients. As a result we treat proteins, carbs, and fats as holy quantities that need to be measured and controlled, simply because we CAN measure and control them, without much concern for the context in which they are consumed. Both of those books point to alternative, less stressful ways of consuming food to be more healthy and less obsessed. Come to think of it, I'd say the latter book, with its discussion of food epigenetics, is a very cybernetic book!
  • Tyler Cowen's TEDxMidAtlantic talk: the human need to package everything as a story (particularly as a good vs evil story) can be extremely limiting in imagining real solutions to problems.
  • Path Dependence in Rocketry: rocketry is stuck on a path laid out in World War II. We would never build space technology from scratch the way we are doing it now, but it's pretty much impossible for us to ever modernize how we launch rockets due to the phenomenon of path dependence. e.g. rocket science is not really evolving even if we all would like it to. We're stuck.
  • The Selfish Gene: Natural selection does not operate the way you think it does (at the species or the population level); instead it operates at the level of individual genes or groups of genes.
  • The Annotated Turing: explains the halting problem which limits what we can ever hope to compute.
  • Antikythera mechanism: this ancient clock reveals that early civilizations had much better technology and achieved much greater knowledge, including rudimentary calculus, than we had assumed. Read this to make sure you don't get overarrogant about Western or 20th century achievements. Everything old is new. Humans had calculus way back when, and lost it for many centuries: what could we lose today? 
  • The Elegant Universe: quantum mechanics has disturbing implications for what the true nature of reality is. String theory makes pretty wild predictions that seem like they might be accurate, but we'll probably never be able to prove them because the task would involve massive, impossible amounts of energy. The archetypal example of human cognition exceeding human know-how. 

Thursday, June 2, 2011

Why I Work in Baltimore

Here's the video from my recent Ignite for a Better Baltimore talk, "Baltimore: A Great Place to Pickup Ideas and Run With Them".


The slides are posted here.