Open Data: Making Toronto a Better Place to Live

Several months back Toronto mayor David Miller announced the city would embark on an “Open Data” initiative, with first steps to show by this fall. Well, fall fast approaches, and the city’s Open Data website is still a blank slate. While we don’t know yet what Open Data will be, lots of people have notions of what it ought to be. Here’s mine:

Start with a Sandbox and some Dogfood

It’s been a difficult summer for the city. The strike took a lot of resources offline, including people who would otherwise have been helping formulate and deliver the first batch of data. So while fall is probably still doable, plans for a first release must surely have been scaled back. The first go-round will have to focus on low-hanging fruit: data that happens to be readily available, privacy-clean, politically non-threatening, and already in machine-readable format.

Let’s also recognize that the first release, like any version 1, wants to be a pilot / proof of concept, not a polished product. I imagine the city will publish some sample data feeds (the “dogfood”), encourage people to build a few apps that consume the data (“dogfooding”), and then evolve a repeatable process around that while putting together a viable longer-term plan. That would be just ducky.

Beyond the first release, getting the city into the business of publishing and consuming data is a huge challenge. Technology is the least of the difficulties. It’s a huge prioritization problem, for one… the city needs to develop clear tenets, guidelines, and processes for deciding which requests to bubble to the top of the stack. And there are many “soft” barriers to overcome, including union fears (must automation lead to job losses?), privacy concerns, liability risks, and — probably most difficult — the turf struggles that will surely arise from trying to pry data out of people’s hands.

But this is not a blog post about Fear, Uncertainty, and Doubt. It’s about a happy world where the city overcomes its inertia, rises to the challenge, and Does Great Things. So let’s consider the question of what the data itself should be.

A Framework for Data Selection

If I was running the show, my framework for data selection would look something like this:

  1. Solve real people’s problems: focus on data that real people are requesting in order to solve real world problems. Ignore data that’s “looking for a problem to solve”, even if that data happens to be convenient to obtain and process. In other words, stay customer- and solution-driven, not expediency- and politically-driven.
  2. Satisfy the customers: those “real people” we want to satisfy break down into three groups: citizens, non-government organizations (both for-profit and not-for-profit), and government itself.
  3. Produce net benefit to society: the data’s benefits to society at large should outweigh the data processing costs. Benefit will be hard to measure in some cases. In other cases the benefit will be crystal clear in terms of dollars, e.g. money saved, time saved. Either way I say let’s measure, and get better at measuring, so that we can set goals and quantify our progress over time.
  4. Keep it clean: obviously the data must be OK to release from a privacy perspective, and it shouldn’t expose the city to unreasonable legal risk. That said, I would be perfectly happy with a license that exempted the city from all liability due to things like errors in the data, and I bet a lot of other people and companies would too. After all, we’ve signed a bunch of other licenses just like that for most other online data services we consume, including mission critical services like email and online document storage.
  5. Keep it fresh: the data can (and indeed, must) be refreshed periodically so that it doesn’t go stale. That implies an up-front commitment to continual publishing. Open Data isn’t a one-shot deal.

Open Data = Data In + Data Out

Almost all the examples I’ve read about open data initiatives are “Data Out”, i.e. cities publishing municipal data such as budget and contract details, service records for road repair, traffic flow, and so on, for the general public to consume. This is useful and necessary stuff, but there’s another equally important category I’ll refer to as “Data In”.

Data In is about society at large publishing data which the city consumes. For example, citizens noting the location of major potholes and failed streetlights; community service organizations reporting on how many people they are reaching, and how effectively (an idea Jane Zhang at TechSoup Canada is passionate about); schools reporting student attendance numbers, and so on. There’s a massive amount of “scouting” that can be done by citizens on behalf of the city, in effect crowd-sourcing information to help the city operate more efficiently and decide where to focus its limited resources. Citizens are incented to do it because they want their tax dollars spent efficiently.

“Data In” is the reason I list government itself as one of the key Open Data customers. As part of the planning process the city should be asking each of its departments for their own wish lists of data that society at large could provide in order to help them do their jobs better. Furthermore, those departments should be dogfooding the exact same data services that we the public consume. This process — internal dogfooding, and being your own customer — has a powerful built-in bias towards self-correction and accountability. You can bet the quality of city-published data feeds will be high, for instance, if internal city processes depend on those same feeds.

More to come…

I’ll write more about Open Data in the coming months. I’m selfishly hoping the city will publish some data we find useful for 5 Blocks Out, if only to save us from transcoding information trapped in PDFs (what’s with disabling copy-paste in PDFs?), and from hearing “Sorry, you’ll have to file a Access to Information Request Form for that” when we call our friends at City Hall. We can do better. Much better. Onwards!

MacBook iPhone Tethering Fix

I recently had some trouble getting my MacBook to connect to the Internet via an iPhone over Bluetooth. It worked fine for a while, then began disconnecting only a second or two after connecting. If you’re having the same problem, read on. If not, skip this post.

Context: My MacBook runs OS 10.5.7, and I’m trying to connect to the Internet via the Bluetooth connection and the “tethering” feature on an iPhone. The phone runs on the Rogers network.

I first went through the standard setup for tethering — turn on tethering, turn on Bluetooth, “pair” your devices — and everything went perfectly. Then, about a day later, things stopped working. The “Connect to Network” entry on the Bluetooth menu became grayed out. The Bluetooth Preferences showed the MacBook/iPhone connection fnctioning briefly when you manually turned the connection on, and then disconnecting after a few seconds. Green light for two seconds, then red light.

I am pretty sure the problem started after I plugged the iPhone in with the USB cable and then accepted prompts to create a new network connection. Everything went pear-shaped from that point on. I tried removing the network connections through the Bluetooth Preferences and Network Preferences UIs, to no avail.

After much digging, here’s a recipe that  solved the problem for me:

[on MacBook] Remove the device pairing: open Bluetooth preferences, select the iPhone entry, click the minus sign.

[on iPhone] Remove the device pairing for your Macbook: Settings, General, Bluetooth, select the device, click ‘Forget this Device’.

[on MacBook] Rename the directory /Library/Preferences/SystemConfiguration to something else, e.g. SystemConfiguration-old.

[on MacBook] Reboot. Mac OS will rebuild the SystemConfiguration for you.

[on MacBook] Run through the standard iPhone tethering setup steps again.

You might want to give it a shot if nothing else works. I assume no liability for any damage you might do.

Other references that might help you:

Good luck. Tethering is great when it works!

Spread the Word: City of Toronto Launches Urban Fellows Program

City of Toronto 175 Years

One of the reasons I love living in Toronto at this particular time is the growing energy going into making the city a truly great place to live. There’s an increasing interest amongst everyday citizens in civic issues: topics like housing, transit, streetscapes, art, outdoor life, pollution, and economic vitality are fast becoming part of everyone’s sphere of interest.[1] And just as importantly, there’s an increasing willingness and capacity to change things. Unlike many other cities I’ve visited, Toronto is a place where you can actually change the way the city works, and accomplish it in your lifetime. It’s a huge reason to live here.

If this line of thinking resonates with you, and you’ve been seeking ways to get more engaged within the city, there is a program you need to know about: The City of Toronto is launching the “Urban Fellows Program“, an initiative aimed at attracting new high caliber professionals to the Toronto Public Service.

As I understand it, it’s one half boot-camp, one half incubator for smart people who want to make the city better. Participants get “an intensive introduction to the governance, operations and administration of Canada’s largest city through a combination of full-time work experience and participation in a series of seminars, tours and workshops.”

The program is one year long, with two six-month rotations in city positions. They’re seeking Masters – and Ph.D.-level experience, although that doesn’t seem to be an absolute requirement… I read it as, “we want whip-smart, well-educated people who are fired up about making the city better”. There are a limited number of positions. And it’s paid: the salary is almost $62K, some serious cash.

I love this concept, and I hope they net some really great thinkers. Applications are due may 30, and the first cohort starts this September. Please help spread the word.

[1] I readily admit to being biased by the people I surround myself with.

David Crow posted thoughts on StartupNorth about startup incubators and why we don’t have one in Toronto. As he points out, funding an incubator program is a big challenge. There aren’t enough Angels and VCs around willing to risk money on very early stage ventures here, and the ever-decreasing amounts of capital needed by tech startups look less and less attractive to investors with big chunks of money to manage. So if we’re to have a farm team, in Rick Segal’s words, how do we fund it?

I believe Toronto has both the financial and intellectual capital needed to do this.  Given that we’re having trouble getting bigger investors to fund this sort of effort, I wondered in reply whether micro-financing might be a viable alternative:

What if we tried micro-funding instead of the current approach? That might net enough investors to make it viable. We create a fund that pays for operating one session (or one year) of the program from start to finish. Price shares at, say, $5,000 apiece. Standardize the share terms so there’s no negotiation involved. Entrepreneurs offer up a fixed amount of equity in exchange for program participation. Investors share in the entrepreneurs’ risk and reward.

Who would buy? Well, at that price, I’d buy a share. I bet at least a few hundred other people would too. Wealthy investors (incl. some Angels) might purchase tens or hundreds of shares. Forward-thinking corps and a VC or two looking for higher-risk investments would buy in, and get good PR as a result. Maybe even the government buys some shares, or provides a tax incentive to others for buying. If the terms are suitable, even investors in other countries could participate.

Could we sell 2000 shares at that price? $5,000 x 2000 shares = $10M.

$10M could buy you an awfully big farm team, or even better, many cohorts of a small farm team.

Would you buy a share?

Rails 2.2.2: Noisy Translation Errors

[This is one of several posts on upgrading a Ruby on Rails app from Rails 1.x to 2.2.2.]

Rails 2.x added some nice support for internationalization. I’m using this to “Canadianize” the UI of my app by translating a few words from the EN-US locale to EN-CA. “Favorite” becomes “favourite”, “huh?” becomes “eh?”, “Coors Light” becomes “water”, and so on.

One gotcha I ran into is that translation errors don’t manifest themselves as exceptions. The default I18n implementation rescues translation errors and returns the failed translation keys as a string. This behavior is nice in the development environment, because you can see the strings showing up in your application’s UI. On the other hand it makes testing dangerous, because translation errors can easily go unnoticed, especially when running automated tests.

I prefer my tests to fail noisily. (Hmm… perhaps this should be the default behavior?) To that end, here’s a patch, also available on Pastie.

# The code below patches I18n to raise exceptions for all errors, including translation errors.
# The default (unpatched) behavior in Rails 2.2.2 rescues translation errors and returns the failed
# translation keys as a string. This behavior is undesirable in test, because it makes it too
# easy for translation errors to go unnoticed when running automated tests. Instead, we want to fail noisily.
#
# == Usage
# (within test_helper)
# require File.dirname(__FILE__) + '/i18n_patch'      

# Patch translation within views

module ActionView
  module Helpers
    module TranslationHelper
      def translate(key, options = {})
        options[:raise] = true
        I18n.translate(key, options)
      rescue I18n::MissingTranslationData => e
        raise e if RAILS_ENV == 'test'  # <<< this line is the patch. everything else in this method is original.
        keys = I18n.send(:normalize_translation_keys, e.locale, e.key, e.options[:scope])
        content_tag('span', keys.join(', '), :class => 'translation_missing')
      end
      alias :t :translate

      def localize(*args)
        I18n.localize *args
      end
      alias :l :localize
    end
  end
end

# Patch translation in models and controllers
module I18n
  class << self
    def raise_all_exceptions(*args)
      raise args.first
    end
  end
end

I18n.exception_handler = :raise_all_exceptions

A Recipe for Protecting Your Rails App Secret

I’ve spent some time over the last few weeks upgrading 5 Blocks Out to Rails 2.2.2. One of the things I’ve been pondering how to integrate is the new protect_from_forgery feature which aims to deter cross-site request forgery attacks.

By default, Rails 2.x creates a random forgery protection secret string when generating a new app, and hard-codes the secret into  environment.rb. As with database passwords, this isn’t the sort of thing you want in your source code repository, especially if your code will be open source, or exposed in some other way to a lot of people over time. So, what to do?

I found two useful ideas on how to deal with this. Both rely on storying the secret in a file distinct from environment.rb. You store this file on your web server, and not in your source repository. This way, your secret key is as secure as your app server.

Here’s a scrap of code I cooked up to do this: http://pastie.org/369075.  It looks for a file named config/session_secret.txt and tries to load the key directly from the text in the file. When running in environments such as production or staging it raises an error if it can’t find the file. When running in dev or test environments it silently falls back to using a hard-coded key. Since I use Capistrano to deploy, I’ve added an after-deploy task that links config/session_secret.txt to a central copy of the file.

This is simple and I think it should work pretty well for me. I hope someone else finds it helpful.

StartupEmpire: Time Well Spent

I attended the StartupEmpire conference yesterday, and had an absolute blast. Thanks to the organizers for putting this on.

Here are some of my notes. Sorry I don’t have time to make this more concise.

Conference format:

  • Timing: the original 2-day schedule was just too much time away from product development for me. They scaled it down to 1 day, which was perfect: everyone stayed focused and we got a lot done. Given that the audience is entrepreneurs or would-be entrepreneurs, time is a key constraint.
  • Networking: there was lots of opportunity to socialize inbetween and after the talks. I found the crowd very friendly, and I think keeping the numbers low was vital to this. I didn’t get much out of EventVue, as a pre-conference tool, but I probably didn’t put enough into it. Perhaps more useful after the fact.
  • Content: good mix of practical advice with inspiration.  There wasn’t a speaker I didn’t like. I found Austin Hill particularly inspiring and worthwhile. As a bright entrepreneur and angel investor with great willingness to share his learnings, he was a real pleasure to listen to. I also enjoyed listening to Craig Hayashi of Maple Leaf Angels. He is doing a blog post series on angel financing, over on Startup North.
  • Students: I loved seeing local students helping out as volunteers in exchange for tickets. Yes, yes, yes! We need to graduate more students who are fired up about creating original works and starting their own ventures, not just students who are trained to plug into existing businesses.
  • Cost: at $65, this was a steal.  For me, the value provided was easily $100+.
  • Venue: This is London was pretty much perfect. I’d guess the crowd was around 150 people.

We need more startup community leadership: I would love to see more local people step up to help nurture the startup culture and community in Toronto. It seems we have a very small handful — David Crow and Jevon MacDonald chief most notable among them — who do the heavy lifting at the events I’m aware of. Yes, there are smaller events that cater to niche interest groups (mmm, like, Ruby on Rails nights — love ‘em), and those are absolutely necessary, but not sufficient. In particular I would love to see some local Angels, VCs, and prominent entrepreneurs step to the fore. The municipal government, Ontario Centres for Excellence and perhaps MaRS should take a sponsorship role. I personally want to devote time to doing this next year. David Cohen spoke about what he and his colleagues have done with TechStars in Boulder, and I think it’s a fabulous example of what a few people can do with some spare cycles. More on this another day… it’s a big topic.

Inspiration = oxygen for entrepreneurs: one of the most difficult things I’ve found about starting a new venture is the sheer negativity you often encounter. Lots of people — the majority, I’ve found — are biased to believe that all startup ideas fail. It is certainly true that most startup ventures don’t make it past the first year, but not all. If would-be entrepreneurs took all that the doom and gloom to heart, there would be no startup innovation. So I found it very encouraging to hear several of the speakers advise founders to stay focused and ignore the noise. Hugh MacLeod, in the second-to-last talk, said it even more firmly: “Ignore everybody. Good ideas have lonely childhoods.”

Milestones should include risk reduction: I find this concept particularly useful. When you’re planning product milestones (or sprints, or whatever jargon you want to use), a key part of the planning is what risks you’re going to reduce or eliminate. For instance, if a big risk is “Will customers think our product design smells like doggie doo?”, then you’d better have a milestone that includes testing your product and acting on customer feedback. Or if you’re worried about your server falling over, you should deal with that. While a risk reduction plan is essential if you’re going to pitch professional investors for funding, it’s just as valid if you’re going it alone. You owe it to yourself, your customers, and your investors to identify risks and make concrete plans to address them.

“Lifestyle Businesses”: Several of the speakers in the professional investment arena mentioned how important it is to distinguish clearly between “lifestyle businesses” and businesses that a VC or angel would invest in. A lifestyle business is one that makes enough money for you to live comfortably, but is highly unlikely to bring in the high returns a pro investor is looking for. (Hmm… I wonder how Craig Newmark would have described Craigslist ten years ago?) As an entrepreneur it’s essential you get honest and clear with yourself about this, for otherwise you are wasting your time and the time of those you’re pitching to.

Austin Hill highlights:

  • Austin used the analogy of a road trip to help convey some of the key things startups need to know. So, …
  • “Keep your eye on the fuel gauge [money and other key resources], but also on the road ahead [competition, industry trends, etc]“
  • Cash and runway is a critical asset. “You must have enough gas to reach the next service station. Don’t plan a lot of sightseeing trips.”
  • Fit your product to the market’s needs. “Nobody wants to invest in a rickshaw, a hummer, or a submersible RV. Build a Prius.”
  • (with investors): “You must present a clear, believable picture of how you will build a defensible market segment in 3-5 years”.
  • “What to pack”: customer acquisition plan; analytics, in particular pirate metrics; waterfall and cash model;’ risk reduction model
  • Look at Product Planner for user flows (boy how much did that domain name cost?) and Balsamiq for software wireframes and mockups
  • “Build meaning”
  • Advice for tough economic times
    • potential customers = who is losing the most money, or most desperate to offset the downturn’s effects
    • go talent shopping: “topgrade”
    • watch layoff rolls
    • get good at outsourcing (TopCoder, eLance)
    • think diversely on fundraising strategies: friends, family, angels, VCs, strategic investors
  • on pitching:
    • the job of a pitch is to grab someone’s attention and convince them to ask for more.
    • “talk to people’s hearts, minds, and wallets”. In that order.
    • you must be able to speak fluently about competitors and industry trends
    • offer customer references
    • don’t talk about features
    • referencing well-known real world parallels can be powerful
    • “where are we” helps, e.g. “60 days out of a beta”
    • “here is what we know and here is what we don’t know”
  • on red flags when hiring people:
    • lack of passion
    • people who can’t pass “practical exams”, i.e. work tasks that test basic competence
    • culture fit
    • inability to discuss results — “every hire should have a mental scorecard of what they’ve accomplished in the last 30, 60 and 90 days”.
  • on SRED credits: “There are way too many Canadian businesses eating zombie food. Walking wounded, should have died years ago.”

Typical Valuation Range for early stage startups

I believe this was a comment from Scott Pelton from GrowthWorks… he said he’s seeing valuations typically in the $1M to $3M range for initial funding. Higher end = great management team, product is real, and perhaps IP is particularly well protected.

“What should a startup CEO get paid?”

This was a great audience question asked of the professional investors who were presenting. A good deal of squirming ensued.

  • Rick Segal: “JLA has funded a large range of companies, and the CEO salaries range from $0 (all equity) to $110K”.
  • Craig Hayashi from Maple Leaf Angels: [long hesitation]… “it depends”… but eventually he held out $75K as reasonable.
  • Austin Hill: “enough so that the CEO doesn’t need to take a 2nd job [keep them focused] or have troubles in family life. For a professional in their 30′s, maybe 90K to a max of 140K, depending on experience. For someone younger, a lot less may be approriate.”

On advertising-based business models for web startups

The speakers were uniformly negative about business models based solely on ad revenue. I’m sure a lot of that has to do with the current economic climate — everyone’s spending less, and ads are easy to cut — but there seems also to be a backing away from the hype about ads being a magical biz model for web ventures. A few people voiced a preference for transactional biz models, and for focusing more on enterprise-centric products rather than consumer plays.

Microsoft BizSpark = free stuff for startups

Microsoft sponsored the event and it showed… job well done. They also talked about BizSpark, which is worth any startup looking at. Check it.

 

Technorati Tags:

It Takes 3 Customers To Make a Product Real

I can’t remember where I heard this, but it’s been on my mind a lot lately so I wanted to mention it.

When you’re designing something that’s going to be used by a lot of people, it’s vital you talk with some of your customers and get them to test your prototype to be sure you’re building something they actually like and find usable.  

Sounds like a no-brainer, right? Well, it ought to be accepted wisdom in any design-related job, but it isn’t universally so. I’ve worked a few places where talking to actual customers was considered a complete waste of time because customers “don’t know what they want”. (Not Microsoft, so much… most groups I worked in were very conscientious about trying to build products customers liked.)

In software, there is a useful accompanying rule of thumb: if you’re designing reusable code such as a library or an application programming interface, you need at least three different customers using your software successfully before you can be sure you’re anywhere near the right ballpark. If you don’t have at least three, you are just guessing at what a reasonable customer interface and user experience should be. And you will be wrong… you’ll miss something important, or design something the wrong way, or (my most common weakness) overbuild the product because you think they actually want all the bells and whistles that you do. In fact, you should save your energy, stop coding, and wait until you have three customers before moving ahead.

Of course, this isn’t to say that three is a sufficient number for getting a design right. For some products you need millions! But three is certainly necessary.

Toronto Startup Events

Here are two November events that might be interesting to folks in the Toronto-area startup space.

1) StartupEmpire. This is a 1-day conference on Nov 13th specifically for startups/entrepreneurs, put on by Jevon MacDonald and David Crow. Tickets are only $65. They have some great speakers and sponsors/partners lined up, including the  BlackBerry Partners Fund for people doing work in the mobile space. Jevon and David have put on some great events locally for tech entrepreneurs, so on reputation alone this is worth checking out. See blog coverage here.

2) GeoSocial is an informal social meetup inspired by Where 2.0, hosted by by Juan Gonzalez of PlanetEye and Mark Evans. This one is tomorrow Thursday Nov 6th, 6:30pm+. Juan describes it as “…a group for people interested in exploring the uses of geodata to enhance the relevancy of information on the web and create new means of social interaction.” Thanks Sandy for the heads up on this.

I will be at both of these.

MyOwnPirateRadio has a new home

I’ve just switched MyOwnPirateRadio from hosting on iPower.com to WordPress.com

If you subscribe to the email version of this blog you probably noticed a few duplicate posts mailed out last night. My apologies, and fear not, for I haven’t yet stooped to duplicating my own blog posts. It was a glitch in the import process.

Why leave iPower?

  • Poor availability. 5 hours of downtime in September, a whopping 49 hours in July. Not that this blog is mission-critical, but still, doesn’t 2 days seem a little excessive? Maybe they forgot to plug the server in.
  • iPower recently started charging for domain privacy, with no warning. Deceptive.
  • Their hosting prices have stayed the same while everyone else’s have dropped. $100+ a year is too much for a simple blog.
  • Their web host management UI is geared at selling services, not helping customers get stuff done.
  • Switching a domain to iPower is easy, switching away to another registrar is a devilish process. Again, bad business practice.
  • Support: not so much.

So, after many years as a customer, I’m moving all my business away from iPower. This blog is going to WordPress.com, my domain registrations are going to namecheap, and 5 Blocks Out is now ticking along happily over on slicehost.

Why rehost on WordPress.com? There are other places I could have hosted, but for running a simple blog with minimal customization requirements it’s a great value. I can just "set and forget"… I don’t worry about security updates, spam, bandwidth, etc. The only downsides I’ve experienced are (1) advertising is present unless I pay to remove it, and (2) there seems to be no way to import images. If anyone knows an easy way to fix #2 (read: takes less than 20 minutes!) I’d love to know.